增加科室管理 增加科室字典和机构字典接口
Some checks are pending
Java CI with Maven / build (11) (push) Waiting to run
Java CI with Maven / build (17) (push) Waiting to run
Java CI with Maven / build (8) (push) Waiting to run
yudao-ui-admin CI / build (14.x) (push) Waiting to run
yudao-ui-admin CI / build (16.x) (push) Waiting to run

This commit is contained in:
lxd 2024-07-30 15:00:35 +08:00
parent d50a296845
commit 5b8bf7b57f
23 changed files with 592 additions and 7 deletions

View File

@ -72,7 +72,20 @@ public class ApiconfigController {
}
else
{
bol=false;
ApiconfigDO apiconfig = apiconfigService.getApiconfig(updateReqVO.getId());
if(apiconfig!=null)
{
if(apiconfig.getApiCode().equals(updateReqVO.getApiCode()))
{
apiconfigService.updateApiconfig(updateReqVO);
bol=true;
}
else
{
bol=false;
}
}
}
return success(bol);

View File

@ -0,0 +1,135 @@
package cn.iocoder.yudao.module.system.controller.admin.department;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
import com.mzt.logapi.starter.annotation.LogRecord;
import com.thoughtworks.xstream.core.SecurityUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
import cn.iocoder.yudao.module.system.controller.admin.department.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.department.DepartmentDO;
import cn.iocoder.yudao.module.system.service.department.DepartmentService;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
@Tag(name = "管理后台 - 科室管理")
@RestController
@RequestMapping("/system/department")
@Validated
public class DepartmentController {
@Resource
private DepartmentService departmentService;
@Resource
private AdminUserService userService;
@PostMapping("/create")
@Operation(summary = "创建科室管理")
@PreAuthorize("@ss.hasPermission('system:department:create')")
@LogRecord(type = "科室管理", subType = "创建", bizNo ="000" , success = "创建名称为{{#createReqVO.getDepartmentName}}的科室")
public CommonResult<String> createDepartment(@Valid @RequestBody DepartmentSaveReqVO createReqVO) {
UUID guid = UUID.randomUUID();
//当前时间
LocalDateTime dateTime= LocalDateTime.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")),
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
createReqVO.setId(guid.toString());
createReqVO.setCreateDate(dateTime);
return success(departmentService.createDepartment(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新科室管理")
@PreAuthorize("@ss.hasPermission('system:department:update')")
@LogRecord(type = "科室管理", subType = "更新", bizNo ="000" , success = "更新名称为{{#updateReqVO.getDepartmentName}}的科室")
public CommonResult<Boolean> updateDepartment(@Valid @RequestBody DepartmentSaveReqVO updateReqVO) {
departmentService.updateDepartment(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除科室管理")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('system:department:delete')")
@LogRecord(type = "科室管理", subType = "删除", bizNo ="000" , success = "删除ID为{{#id}}的科室")
public CommonResult<Boolean> deleteDepartment(@RequestParam("id") String id) {
//当前时间
LocalDateTime dateTime= LocalDateTime.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")),
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
//获取当前登陆用户
AdminUserDO user = userService.getUser(getLoginUserId());
DepartmentSaveReqVO updateReqVO=new DepartmentSaveReqVO();
updateReqVO.setId(id);
updateReqVO.setDeletePerson(user.getUsername());
updateReqVO.setDeleteDate(dateTime);
updateReqVO.setIsDelete("1");
departmentService.updateDepartment(updateReqVO);
// departmentService.deleteDepartment(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得科室管理")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('system:department:query')")
public CommonResult<DepartmentRespVO> getDepartment(@RequestParam("id") String id) {
DepartmentDO department = departmentService.getDepartment(id);
return success(BeanUtils.toBean(department, DepartmentRespVO.class));
}
@GetMapping("/getlist")
@Operation(summary = "获得科室管理列表 用于字典")
@PreAuthorize("@ss.hasPermission('system:department:query')")
public CommonResult<List<DepartmentRespVO>> getDepartmentListr() {
List<DepartmentDO> department = departmentService.getgetDepartmentList();
return success(BeanUtils.toBean(department, DepartmentRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得科室管理分页")
@PreAuthorize("@ss.hasPermission('system:department:query')")
public CommonResult<PageResult<DepartmentRespVO>> getDepartmentPage(@Valid DepartmentPageReqVO pageReqVO) {
PageResult<DepartmentDO> pageResult = departmentService.getDepartmentPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, DepartmentRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出科室管理 Excel")
@PreAuthorize("@ss.hasPermission('system:department:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportDepartmentExcel(@Valid DepartmentPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<DepartmentDO> list = departmentService.getDepartmentPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "科室管理.xls", "数据", DepartmentRespVO.class,
BeanUtils.toBean(list, DepartmentRespVO.class));
}
}

View File

@ -0,0 +1,24 @@
package cn.iocoder.yudao.module.system.controller.admin.department.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 科室管理分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class DepartmentPageReqVO extends PageParam {
@Schema(description = "科室名称", example = "张三")
private String departmentName;
@Schema(description = "机构ID", example = "15227")
private String orgId;
}

View File

@ -0,0 +1,60 @@
package cn.iocoder.yudao.module.system.controller.admin.department.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 科室管理 Response VO")
@Data
@ExcelIgnoreUnannotated
public class DepartmentRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "28070")
@ExcelProperty("主键")
private String id;
@Schema(description = "科室名称", example = "张三")
@ExcelProperty("科室名称")
private String departmentName;
@Schema(description = "创建人")
@ExcelProperty("创建人")
private String createPerson;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createDate;
@Schema(description = "科室备注", example = "你说的对")
@ExcelProperty("科室备注")
private String departmentRemark;
@Schema(description = "删除操作人")
@ExcelProperty("删除操作人")
private String deletePerson;
@Schema(description = "删除时间")
@ExcelProperty("删除时间")
private LocalDateTime deleteDate;
@Schema(description = "科室具体位置")
@ExcelProperty("科室具体位置")
private String departmentAddress;
@Schema(description = "机构ID", example = "15227")
@ExcelProperty("机构ID")
private String orgId;
@Schema(description = "科室代号:科室短号", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("科室代号:科室短号")
private String departmentCode;
@Schema(description = "删除标记1为删除", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("删除标记1为删除")
private String isDelete;
}

View File

@ -0,0 +1,46 @@
package cn.iocoder.yudao.module.system.controller.admin.department.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 科室管理新增/修改 Request VO")
@Data
public class DepartmentSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "28070")
private String id;
@Schema(description = "科室名称", example = "张三")
private String departmentName;
@Schema(description = "创建人")
private String createPerson;
@Schema(description = "创建时间")
private LocalDateTime createDate;
@Schema(description = "科室备注", example = "你说的对")
private String departmentRemark;
@Schema(description = "删除操作人")
private String deletePerson;
@Schema(description = "删除时间")
private LocalDateTime deleteDate;
@Schema(description = "科室具体位置")
private String departmentAddress;
@Schema(description = "机构ID", example = "15227")
private String orgId;
@Schema(description = "科室代号:科室短号", requiredMode = Schema.RequiredMode.REQUIRED)
private String departmentCode;
@Schema(description = "删除标记1为删除", requiredMode = Schema.RequiredMode.REQUIRED)
private String isDelete;
}

View File

@ -99,6 +99,14 @@ public class OrgUnitController {
return success(BeanUtils.toBean(aDo, OrgUnitRespVO.class));
}
@GetMapping("/getlist")
@Operation(summary = "获得机构管理字典")
@PreAuthorize("@ss.hasPermission('org::query')")
public CommonResult<List<OrgUnitRespVO>> getlist() {
List<OrgUnitDO> aDo = Service.getOrgUnitList();
return success(BeanUtils.toBean(aDo, OrgUnitRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得机构管理分页")
@PreAuthorize("@ss.hasPermission('org::query')")

View File

@ -27,5 +27,5 @@ public class UserProfileUpdateReqVO {
@Schema(description = "用户性别,参见 SexEnum 枚举类", example = "1")
private Integer sex;
private String orgId;
}

View File

@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -35,4 +36,5 @@ public class UserPageReqVO extends PageParam {
@Schema(description = "部门编号,同时筛选子部门", example = "1024")
private Long deptId;
private String orgId;
}

View File

@ -71,5 +71,5 @@ public class UserRespVO{
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "时间戳格式")
private LocalDateTime createTime;
private String orgId;
}

View File

@ -5,6 +5,7 @@ import cn.iocoder.yudao.framework.common.validation.Mobile;
import cn.iocoder.yudao.module.system.framework.operatelog.core.DeptParseFunction;
import cn.iocoder.yudao.module.system.framework.operatelog.core.PostParseFunction;
import cn.iocoder.yudao.module.system.framework.operatelog.core.SexParseFunction;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.mzt.logapi.starter.annotation.DiffLogField;
import io.swagger.v3.oas.annotations.media.Schema;
@ -64,6 +65,11 @@ public class UserSaveReqVO {
@DiffLogField(name = "用户头像")
private String avatar;
/**
* 机构ID
*/
@NotBlank(message = "机构不能为空")
private String orgId;
// ========== 创建需要传递的字段 ==========
@Schema(description = "密码", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")

View File

@ -21,5 +21,5 @@ public class UserSimpleRespVO {
private Long deptId;
@Schema(description = "部门名称", example = "IT 部")
private String deptName;
private String orgId;
}

View File

@ -0,0 +1,80 @@
package cn.iocoder.yudao.module.system.dal.dataobject.department;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 科室管理 DO
*
* @author 李晓东
*/
@TableName("tb_department")
@KeySequence("tb_department_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DepartmentDO {
/**
* 主键
*/
@TableId(type = IdType.INPUT)
private String id;
/**
* 科室名称
*/
@TableField("departmentName")
private String departmentName;
/**
* 创建人
*/
@TableField("createPerson")
private String createPerson;
/**
* 创建时间
*/
@TableField("createDate")
private LocalDateTime createDate;
/**
* 科室备注
*/
@TableField("departmentRemark")
private String departmentRemark;
/**
* 删除操作人
*/
@TableField("deletePerson")
private String deletePerson;
/**
* 删除时间
*/
@TableField("deleteDate")
private LocalDateTime deleteDate;
/**
* 科室具体位置
*/
@TableField("departmentAddress")
private String departmentAddress;
/**
* 机构ID
*/
@TableField("orgId")
private String orgId;
/**
* 科室代号科室短号
*/
@TableField("departmentCode")
private String departmentCode;
/**
* 删除标记1为删除
*/
@TableField("isDelete")
private String isDelete;
}

View File

@ -92,5 +92,9 @@ public class AdminUserDO extends TenantBaseDO {
* 最后登录时间
*/
private LocalDateTime loginDate;
/**
* 机构ID
*/
@TableField("orgId")
private String orgId;
}

View File

@ -0,0 +1,33 @@
package cn.iocoder.yudao.module.system.dal.mysql.department;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.department.DepartmentDO;
import cn.iocoder.yudao.module.system.dal.dataobject.examitems.examitemsDO;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.department.vo.*;
/**
* 科室管理 Mapper
*
* @author 李晓东
*/
@InterceptorIgnore(tenantLine = "true")
@Mapper
public interface DepartmentMapper extends BaseMapperX<DepartmentDO> {
default PageResult<DepartmentDO> selectPage(DepartmentPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<DepartmentDO>()
.likeIfPresent(DepartmentDO::getDepartmentName, reqVO.getDepartmentName())
.eqIfPresent(DepartmentDO::getOrgId, reqVO.getOrgId())
.eq(DepartmentDO::getIsDelete, '0')
.orderByDesc(DepartmentDO::getId));
}
List<DepartmentDO> getDepartmentList();
}

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.system.dal.mysql.examitems;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.doctor.DoctorDO;
import cn.iocoder.yudao.module.system.dal.dataobject.examitems.examitemsDO;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import org.apache.ibatis.annotations.Mapper;
@ -23,8 +24,7 @@ public interface examitemsMapper extends BaseMapperX<examitemsDO> {
.likeIfPresent(examitemsDO::getExamItemName, reqVO.getExamItemName())
.likeIfPresent(examitemsDO::getExamItemCode, reqVO.getExamItemCode())
.likeIfPresent(examitemsDO::getExamPartCode, reqVO.getExamPartCode())
.or(wrapper -> wrapper.eq(examitemsDO::getIsdelete, 0))
.or(wrapper -> wrapper.isNull(examitemsDO::getIsdelete))
.eq(examitemsDO::getIsdelete, '0')
.orderByDesc(examitemsDO::getId));
}

View File

@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.apiconfig.ApiconfigDO;
import cn.iocoder.yudao.module.system.dal.dataobject.department.DepartmentDO;
import cn.iocoder.yudao.module.system.dal.dataobject.doctor.DoctorDO;
import cn.iocoder.yudao.module.system.dal.dataobject.org.OrgUnitDO;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
@ -11,6 +12,8 @@ import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.org.vo.*;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 机构管理 Mapper
*
@ -38,4 +41,7 @@ public interface OrgUnitMapper extends BaseMapperX<OrgUnitDO> {
}
//查询当前ID 是否存在
int getOrgUnitIDExist(@Param("orgID") String orgID);
List<OrgUnitDO> getOrgUnitdictList();
}

View File

@ -0,0 +1,57 @@
package cn.iocoder.yudao.module.system.service.department;
import java.util.*;
import cn.iocoder.yudao.module.system.controller.admin.department.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.department.DepartmentDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import javax.validation.Valid;
/**
* 科室管理 Service 接口
*
* @author 李晓东
*/
public interface DepartmentService {
/**
* 创建科室管理
*
* @param createReqVO 创建信息
* @return 编号
*/
String createDepartment(@Valid DepartmentSaveReqVO createReqVO);
/**
* 更新科室管理
*
* @param updateReqVO 更新信息
*/
void updateDepartment(@Valid DepartmentSaveReqVO updateReqVO);
/**
* 删除科室管理
*
* @param id 编号
*/
void deleteDepartment(String id);
/**
* 获得科室管理
*
* @param id 编号
* @return 科室管理
*/
DepartmentDO getDepartment(String id);
/**
* 获得科室管理分页
*
* @param pageReqVO 分页查询
* @return 科室管理分页
*/
PageResult<DepartmentDO> getDepartmentPage(DepartmentPageReqVO pageReqVO);
List<DepartmentDO> getgetDepartmentList();
}

View File

@ -0,0 +1,81 @@
package cn.iocoder.yudao.module.system.service.department;
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import cn.iocoder.yudao.module.system.controller.admin.department.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.department.DepartmentDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.system.dal.mysql.department.DepartmentMapper;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
/**
* 科室管理 Service 实现类
*
* @author 李晓东
*/
@Service
@Validated
public class DepartmentServiceImpl implements DepartmentService {
@Resource
private DepartmentMapper departmentMapper;
@Override
public String createDepartment(DepartmentSaveReqVO createReqVO) {
// 插入
DepartmentDO department = BeanUtils.toBean(createReqVO, DepartmentDO.class);
departmentMapper.insert(department);
// 返回
return department.getId();
}
@Override
public void updateDepartment(DepartmentSaveReqVO updateReqVO) {
// 校验存在
validateDepartmentExists(updateReqVO.getId());
// 更新
DepartmentDO updateObj = BeanUtils.toBean(updateReqVO, DepartmentDO.class);
departmentMapper.updateById(updateObj);
}
@Override
public void deleteDepartment(String id) {
// 校验存在
validateDepartmentExists(id);
// 删除
departmentMapper.deleteById(id);
}
private void validateDepartmentExists(String id) {
if (departmentMapper.selectById(id) == null) {
throw exception(new ErrorCode(1,"ID为空"));
}
}
@Override
public DepartmentDO getDepartment(String id) {
return departmentMapper.selectById(id);
}
@Override
public PageResult<DepartmentDO> getDepartmentPage(DepartmentPageReqVO pageReqVO) {
return departmentMapper.selectPage(pageReqVO);
}
@Override
public List<DepartmentDO> getgetDepartmentList() {
return departmentMapper.getDepartmentList();
}
}

View File

@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import org.apache.ibatis.annotations.Param;
import javax.validation.Valid;
import java.util.List;
/**
* 机构管理 Service 接口
@ -53,4 +54,7 @@ public interface OrgUnitService {
PageResult<OrgUnitDO> getPage(OrgUnitPageReqVO pageReqVO);
boolean getOrgUnitIDISExist(String orgID);
// 获取机构字典
List<OrgUnitDO> getOrgUnitList();
}

View File

@ -14,6 +14,8 @@ import cn.iocoder.yudao.module.system.dal.mysql.org.OrgUnitMapper;
import javax.annotation.Resource;
import java.util.List;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
/**
@ -78,4 +80,9 @@ public class OrgUnitServiceImpl implements OrgUnitService {
return bol;
}
@Override
public List<OrgUnitDO> getOrgUnitList() {
return Mapper.getOrgUnitdictList();
}
}

View File

@ -0,0 +1,15 @@
<?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="cn.iocoder.yudao.module.system.dal.mysql.department.DepartmentMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<select id="getDepartmentList" resultType="cn.iocoder.yudao.module.system.dal.dataobject.department.DepartmentDO">
select departmentName,departmentCode from tb_department where isDelete='0'
</select>
</mapper>

View File

@ -12,4 +12,7 @@
<select id="getOrgUnitIDExist" resultType="java.lang.Integer">
select count(*) from tb_org where orgID=#{orgID}
</select>
<select id="getOrgUnitdictList" resultType="cn.iocoder.yudao.module.system.dal.dataobject.org.OrgUnitDO">
select orgID,orgName from tb_org where isDelete='0'
</select>
</mapper>

View File

@ -172,6 +172,7 @@ logging:
cn.iocoder.yudao.module.crm.dal.mysql: debug
cn.iocoder.yudao.module.erp.dal.mysql: debug
cn.iocoder.yudao.module.ultrasoniccom.dal: debug
cn.iocoder.yudao.module.tblist.dal: debug
org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO 芋艿先禁用Spring Boot 3.X 存在部分错误的 WARN 提示
debug: false