machaoyi 1 рік тому
батько
коміт
bdcc93a0a2
18 змінених файлів з 1213 додано та 9 видалено
  1. 96 9
      .idea/workspace.xml
  2. 113 0
      application/src/main/java/com/ctsi/System/SysDic/controller/SysDicController.java
  3. 100 0
      application/src/main/java/com/ctsi/System/SysDic/entity/SysDic.java
  4. 26 0
      application/src/main/java/com/ctsi/System/SysDic/mapper/SysDicMapper.java
  5. 8 0
      application/src/main/java/com/ctsi/System/SysDic/mapper/SysDicMapper.xml
  6. 51 0
      application/src/main/java/com/ctsi/System/SysDic/service/SysDicService.java
  7. 107 0
      application/src/main/java/com/ctsi/System/SysDic/service/impl/SysDicServiceImpl.java
  8. 154 0
      application/src/main/java/com/ctsi/System/SysDicItem/controller/SysDicItemController.java
  9. 122 0
      application/src/main/java/com/ctsi/System/SysDicItem/entity/SysDicItem.java
  10. 135 0
      application/src/main/java/com/ctsi/System/SysDicItem/entity/SysDicItemSearchPO.java
  11. 32 0
      application/src/main/java/com/ctsi/System/SysDicItem/entity/SysDicItemSearchVO.java
  12. 27 0
      application/src/main/java/com/ctsi/System/SysDicItem/mapper/SysDicItemMapper.java
  13. 8 0
      application/src/main/java/com/ctsi/System/SysDicItem/mapper/SysDicItemMapper.xml
  14. 57 0
      application/src/main/java/com/ctsi/System/SysDicItem/service/SysDicItemService.java
  15. 171 0
      application/src/main/java/com/ctsi/System/SysDicItem/service/impl/SysDicItemServiceImpl.java
  16. 2 0
      application/src/main/java/com/ctsi/System/SysMenu/controller/SysMenuController.java
  17. 2 0
      application/src/main/java/com/ctsi/System/SysOrg/controller/SysOrgController.java
  18. 2 0
      application/src/main/java/com/ctsi/System/SysRole/controller/SysRoleController.java

+ 96 - 9
.idea/workspace.xml

@@ -4,8 +4,25 @@
     <option name="autoReloadType" value="SELECTIVE" />
   </component>
   <component name="ChangeListManager">
-    <list default="true" id="1dc46973-e6f5-473b-a131-bf2bbc2dca15" name="更改" comment="1、根据部门获取用户列表&#10;2、修改base64包">
-      <change beforePath="$PROJECT_DIR$/application/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/application/pom.xml" afterDir="false" />
+    <list default="true" id="1dc46973-e6f5-473b-a131-bf2bbc2dca15" name="更改" comment="1、修改图形验证码的字体,以便在linux中使用">
+      <change afterPath="$PROJECT_DIR$/application/src/main/java/com/ctsi/System/SysDic/controller/SysDicController.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/src/main/java/com/ctsi/System/SysDic/entity/SysDic.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/src/main/java/com/ctsi/System/SysDic/mapper/SysDicMapper.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/src/main/java/com/ctsi/System/SysDic/mapper/SysDicMapper.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/src/main/java/com/ctsi/System/SysDic/service/SysDicService.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/src/main/java/com/ctsi/System/SysDic/service/impl/SysDicServiceImpl.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/src/main/java/com/ctsi/System/SysDicItem/controller/SysDicItemController.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/src/main/java/com/ctsi/System/SysDicItem/entity/SysDicItem.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/src/main/java/com/ctsi/System/SysDicItem/entity/SysDicItemSearchPO.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/src/main/java/com/ctsi/System/SysDicItem/entity/SysDicItemSearchVO.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/src/main/java/com/ctsi/System/SysDicItem/mapper/SysDicItemMapper.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/src/main/java/com/ctsi/System/SysDicItem/mapper/SysDicItemMapper.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/src/main/java/com/ctsi/System/SysDicItem/service/SysDicItemService.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/src/main/java/com/ctsi/System/SysDicItem/service/impl/SysDicItemServiceImpl.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/src/main/java/com/ctsi/System/SysMenu/controller/SysMenuController.java" beforeDir="false" afterPath="$PROJECT_DIR$/application/src/main/java/com/ctsi/System/SysMenu/controller/SysMenuController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/src/main/java/com/ctsi/System/SysOrg/controller/SysOrgController.java" beforeDir="false" afterPath="$PROJECT_DIR$/application/src/main/java/com/ctsi/System/SysOrg/controller/SysOrgController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/src/main/java/com/ctsi/System/SysRole/controller/SysRoleController.java" beforeDir="false" afterPath="$PROJECT_DIR$/application/src/main/java/com/ctsi/System/SysRole/controller/SysRoleController.java" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -22,6 +39,11 @@
   <component name="Git.Settings">
     <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
   </component>
+  <component name="Jenkins.Settings">
+    <option name="jenkinsUrl" value="http://matrix34.tpddns.cn:9004" />
+    <option name="lastSelectedView" value="all" />
+    <option name="username" value="matrix" />
+  </component>
   <component name="MavenImportPreferences">
     <option name="generalSettings">
       <MavenGeneralSettings>
@@ -87,11 +109,11 @@
       <recent name="C:\Users\setin\IdeaProjects\GeneralFrame\application\src\main\java\com\ctsi" />
     </key>
     <key name="CopyClassDialog.RECENTS_KEY">
+      <recent name="com.ctsi.System.SysDicItem.entity" />
       <recent name="com.ctsi.Auth.entity" />
       <recent name="com.ctsi.System.SysRole.entity.PO" />
       <recent name="com.ctsi.System.SysUserRole.entity.PO" />
       <recent name="com.ctsi.SysUserRole.entity" />
-      <recent name="com.ctsi.SysRole.entity" />
     </key>
   </component>
   <component name="RunManager">
@@ -122,7 +144,7 @@
       <workItem from="1704693899463" duration="56714000" />
       <workItem from="1704875622703" duration="2299000" />
       <workItem from="1704932572547" duration="31458000" />
-      <workItem from="1705278479826" duration="21733000" />
+      <workItem from="1705278479826" duration="37226000" />
     </task>
     <task id="LOCAL-00001" summary="基础框架配置">
       <option name="closed" value="true" />
@@ -324,7 +346,71 @@
       <option name="project" value="LOCAL" />
       <updated>1705309483595</updated>
     </task>
-    <option name="localTasksCounter" value="26" />
+    <task id="LOCAL-00026" summary="1、修改pom一些version,不用release">
+      <option name="closed" value="true" />
+      <created>1705309881279</created>
+      <option name="number" value="00026" />
+      <option name="presentableId" value="LOCAL-00026" />
+      <option name="project" value="LOCAL" />
+      <updated>1705309881279</updated>
+    </task>
+    <task id="LOCAL-00027" summary="1、优化import">
+      <option name="closed" value="true" />
+      <created>1705310074208</created>
+      <option name="number" value="00027" />
+      <option name="presentableId" value="LOCAL-00027" />
+      <option name="project" value="LOCAL" />
+      <updated>1705310074208</updated>
+    </task>
+    <task id="LOCAL-00028" summary="1、debug">
+      <option name="closed" value="true" />
+      <created>1705364826524</created>
+      <option name="number" value="00028" />
+      <option name="presentableId" value="LOCAL-00028" />
+      <option name="project" value="LOCAL" />
+      <updated>1705364826524</updated>
+    </task>
+    <task id="LOCAL-00029" summary="1、修改图形验证码的字体,以便在linux中使用">
+      <option name="closed" value="true" />
+      <created>1705365840096</created>
+      <option name="number" value="00029" />
+      <option name="presentableId" value="LOCAL-00029" />
+      <option name="project" value="LOCAL" />
+      <updated>1705365840096</updated>
+    </task>
+    <task id="LOCAL-00030" summary="1、修改图形验证码的字体,以便在linux中使用">
+      <option name="closed" value="true" />
+      <created>1705368559704</created>
+      <option name="number" value="00030" />
+      <option name="presentableId" value="LOCAL-00030" />
+      <option name="project" value="LOCAL" />
+      <updated>1705368559704</updated>
+    </task>
+    <task id="LOCAL-00031" summary="1、修改图形验证码的字体,以便在linux中使用">
+      <option name="closed" value="true" />
+      <created>1705370241254</created>
+      <option name="number" value="00031" />
+      <option name="presentableId" value="LOCAL-00031" />
+      <option name="project" value="LOCAL" />
+      <updated>1705370241254</updated>
+    </task>
+    <task id="LOCAL-00032" summary="1、修改图形验证码的字体,以便在linux中使用">
+      <option name="closed" value="true" />
+      <created>1705370664730</created>
+      <option name="number" value="00032" />
+      <option name="presentableId" value="LOCAL-00032" />
+      <option name="project" value="LOCAL" />
+      <updated>1705370664730</updated>
+    </task>
+    <task id="LOCAL-00033" summary="1、修改图形验证码的字体,以便在linux中使用">
+      <option name="closed" value="true" />
+      <created>1705370862985</created>
+      <option name="number" value="00033" />
+      <option name="presentableId" value="LOCAL-00033" />
+      <option name="project" value="LOCAL" />
+      <updated>1705370862985</updated>
+    </task>
+    <option name="localTasksCounter" value="34" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
@@ -343,8 +429,6 @@
   </component>
   <component name="VcsManagerConfiguration">
     <option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
-    <MESSAGE value="基础框架配置" />
-    <MESSAGE value="1、post请求用body体&#10;2、通用返回体" />
     <MESSAGE value="1、修改登录接口的userName字段&#10;2、long类型的id使用string字符串传递给前端&#10;3、优化用户相关接口&#10;4、新增用户详情表&#10;5、新增mybatis-plus-join" />
     <MESSAGE value="1、菜单接口、部门接口" />
     <MESSAGE value="1、部门列表树型结构构建" />
@@ -354,7 +438,6 @@
     <MESSAGE value="1、用户角色表" />
     <MESSAGE value="1、用户绑定角色&#10;2、用户接口包修改" />
     <MESSAGE value="1、获取用户当前角色" />
-    <MESSAGE value="1、优化import" />
     <MESSAGE value="1、用户部门接口" />
     <MESSAGE value="1、新增、修改用户,关联角色表、部门表" />
     <MESSAGE value="1、新增角色菜单表" />
@@ -367,7 +450,11 @@
     <MESSAGE value="1、用户登录获取信息接口" />
     <MESSAGE value="1、用户修改生日类型为时间戳" />
     <MESSAGE value="1、根据部门获取用户列表&#10;2、修改base64包" />
-    <option name="LAST_COMMIT_MESSAGE" value="1、根据部门获取用户列表&#10;2、修改base64包" />
+    <MESSAGE value="1、修改pom一些version,不用release" />
+    <MESSAGE value="1、优化import" />
+    <MESSAGE value="1、debug" />
+    <MESSAGE value="1、修改图形验证码的字体,以便在linux中使用" />
+    <option name="LAST_COMMIT_MESSAGE" value="1、修改图形验证码的字体,以便在linux中使用" />
   </component>
   <component name="XSLT-Support.FileAssociations.UIState">
     <expand />

+ 113 - 0
application/src/main/java/com/ctsi/System/SysDic/controller/SysDicController.java

@@ -0,0 +1,113 @@
+package com.ctsi.System.SysDic.controller;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ctsi.entity.FramePage;
+import com.ctsi.utils.ApiResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.bind.annotation.*;
+import com.ctsi.System.SysDic.entity.SysDic;
+import com.ctsi.System.SysDic.service.SysDicService;
+
+import javax.annotation.Resource;
+
+ /**
+ * 字典表;(sys_dic)表控制层
+ * @author : machaoyi
+ * @date : 2024-1-16
+ */
+@Api(tags = "字典表对象功能接口")
+@RestController
+@RequestMapping("/sysDic")
+public class SysDicController{
+    @Resource
+    private SysDicService sysDicService;
+    private static final Logger log = LoggerFactory.getLogger(SysDicController.class);
+    
+    /** 
+     * 通过ID查询单条数据 
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    @ApiOperation("通过ID查询单条数据")
+    @GetMapping("{id}")
+    public ApiResult<SysDic> queryById(Long id){
+        try {
+            return ApiResult.success(sysDicService.queryById(id));
+        } catch (Exception e) {
+            log.error(e.getMessage());
+            return ApiResult.failure("查询失败",null);
+        }
+    }
+    
+    /** 
+     * 分页查询
+     *
+     * @param sysDic 筛选条件
+     * @return 查询结果
+     */
+    @ApiOperation("分页查询")
+    @GetMapping
+    public ApiResult<Page<SysDic>> paginQuery(SysDic sysDic, FramePage framePage){
+        try {
+            return ApiResult.success(sysDicService.paginQuery(sysDic, framePage.getPageNum(), framePage.getPageSize()));
+        } catch (Exception e) {
+            log.error(e.getMessage());
+            return ApiResult.failure("分页查询失败",null);
+        }    
+    }
+    
+    /** 
+     * 新增数据
+     *
+     * @param sysDic 实例对象
+     * @return 实例对象
+     */
+    @ApiOperation("新增数据")
+    @PostMapping
+    public ApiResult<SysDic> add(@RequestBody SysDic sysDic){
+        try {
+            return ApiResult.success(sysDicService.insert(sysDic));
+        } catch (Exception e) {
+            log.error(e.getMessage());
+            return ApiResult.failure("新增数据失败",null);
+        }
+    }
+    
+    /** 
+     * 更新数据
+     *
+     * @param sysDic 实例对象
+     * @return 实例对象
+     */
+    @ApiOperation("更新数据")
+    @PutMapping
+    public ApiResult<SysDic> edit(@RequestBody SysDic sysDic){
+        try {
+            return ApiResult.success(sysDicService.update(sysDic));
+        } catch (Exception e) {
+            log.error(e.getMessage());
+            return ApiResult.failure("更新数据失败",null);
+        }
+    }
+    
+    /** 
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 是否成功
+     */
+    @ApiOperation("通过主键删除数据")
+    @DeleteMapping
+    public ApiResult<Boolean> deleteById(Long id){
+        try {
+            return ApiResult.success(sysDicService.deleteById(id));
+        } catch (Exception e) {
+            log.error(e.getMessage());
+            return ApiResult.failure("删除数据失败",null);
+        }
+    }
+}

+ 100 - 0
application/src/main/java/com/ctsi/System/SysDic/entity/SysDic.java

@@ -0,0 +1,100 @@
+package com.ctsi.System.SysDic.entity;
+
+import com.ctsi.utils.LongtoStringSerialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import java.util.Date;
+
+ /**
+ * 字典表;
+ * @author : machaoyi
+ * @date : 2024-1-16
+ */
+@ApiModel(value = "字典表",description = "")
+@TableName("sys_dic")
+public class SysDic implements Serializable,Cloneable{
+    /** 主键id */
+    @ApiModelProperty(value = "主键id",notes = "")
+    @TableId
+    @JsonSerialize(using = LongtoStringSerialize.class)
+    private Long id ;
+    /** 创建人userid */
+    @ApiModelProperty(value = "创建人userid",notes = "")
+    private Long createdBy ;
+    /** 创建时间 */
+    @ApiModelProperty(value = "创建时间",notes = "")
+    private Date createdTime ;
+    /** 逻辑删除 */
+    @ApiModelProperty(value = "逻辑删除",notes = "")
+    private Integer delFlag ;
+    /** 字典名称 */
+    @ApiModelProperty(value = "字典名称",notes = "")
+    private String dicName ;
+    /** 字典编码 */
+    @ApiModelProperty(value = "字典编码",notes = "")
+    private String dicCode ;
+    /** 排序 */
+    @ApiModelProperty(value = "排序",notes = "")
+    private Integer dicSort ;
+
+    /** 主键id */
+    public Long getId(){
+        return this.id;
+    }
+    /** 主键id */
+    public void setId(Long id){
+        this.id=id;
+    }
+    /** 创建人userid */
+    public Long getCreatedBy(){
+        return this.createdBy;
+    }
+    /** 创建人userid */
+    public void setCreatedBy(Long createdBy){
+        this.createdBy=createdBy;
+    }
+    /** 创建时间 */
+    public Date getCreatedTime(){
+        return this.createdTime;
+    }
+    /** 创建时间 */
+    public void setCreatedTime(Date createdTime){
+        this.createdTime=createdTime;
+    }
+    /** 逻辑删除 */
+    public Integer getDelFlag(){
+        return this.delFlag;
+    }
+    /** 逻辑删除 */
+    public void setDelFlag(Integer delFlag){
+        this.delFlag=delFlag;
+    }
+    /** 字典名称 */
+    public String getDicName(){
+        return this.dicName;
+    }
+    /** 字典名称 */
+    public void setDicName(String dicName){
+        this.dicName=dicName;
+    }
+    /** 字典编码 */
+    public String getDicCode(){
+        return this.dicCode;
+    }
+    /** 字典编码 */
+    public void setDicCode(String dicCode){
+        this.dicCode=dicCode;
+    }
+    /** 排序 */
+    public Integer getDicSort(){
+        return this.dicSort;
+    }
+    /** 排序 */
+    public void setDicSort(Integer dicSort){
+        this.dicSort=dicSort;
+    }
+}

+ 26 - 0
application/src/main/java/com/ctsi/System/SysDic/mapper/SysDicMapper.java

@@ -0,0 +1,26 @@
+package com.ctsi.System.SysDic.mapper;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import com.ctsi.System.SysDic.entity.SysDic;
+
+ /**
+ * 字典表;(sys_dic)表数据库访问层
+ * @author : machaoyi
+ * @date : 2024-1-16
+ */
+@Mapper
+public interface SysDicMapper  extends BaseMapper<SysDic>{
+    /** 
+     * 分页查询指定行数据
+     *
+     * @param page 分页参数
+     * @param wrapper 动态查询条件
+     * @return 分页对象列表
+     */
+    IPage<SysDic> selectByPage(IPage<SysDic> page , @Param(Constants.WRAPPER) Wrapper<SysDic> wrapper);
+}

+ 8 - 0
application/src/main/java/com/ctsi/System/SysDic/mapper/SysDicMapper.xml

@@ -0,0 +1,8 @@
+<?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.ctsi.System.SysDic.mapper.SysDicMapper">
+     <select id="selectByPage" resultType="com.ctsi.System.SysDic.entity.SysDic">
+        select * from sys_dic ${ew.customSqlSegment}
+    </select>
+</mapper>

+ 51 - 0
application/src/main/java/com/ctsi/System/SysDic/service/SysDicService.java

@@ -0,0 +1,51 @@
+package com.ctsi.System.SysDic.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ctsi.System.SysDic.entity.SysDic;
+
+ /**
+ * 字典表;(sys_dic)表服务接口
+ * @author : machaoyi
+ * @date : 2024-1-16
+ */
+public interface SysDicService{
+    
+    /** 
+     * 通过ID查询单条数据 
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    SysDic queryById(Long id);
+    
+    /**
+     * 分页查询
+     *
+     * @param sysDic 筛选条件
+     * @param current 当前页码
+     * @param size  每页大小
+     * @return
+     */
+    Page<SysDic> paginQuery(SysDic sysDic, long current, long size);
+    /** 
+     * 新增数据
+     *
+     * @param sysDic 实例对象
+     * @return 实例对象
+     */
+    SysDic insert(SysDic sysDic);
+    /** 
+     * 更新数据
+     *
+     * @param sysDic 实例对象
+     * @return 实例对象
+     */
+    SysDic update(SysDic sysDic);
+    /** 
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 是否成功
+     */
+    boolean deleteById(Long id);
+}

+ 107 - 0
application/src/main/java/com/ctsi/System/SysDic/service/impl/SysDicServiceImpl.java

@@ -0,0 +1,107 @@
+package com.ctsi.System.SysDic.service.impl;
+
+import cn.hutool.core.util.StrUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
+import com.ctsi.System.SysDic.entity.SysDic;
+import com.ctsi.System.SysDic.mapper.SysDicMapper;
+import com.ctsi.System.SysDic.service.SysDicService;
+ /**
+ * 字典表;(sys_dic)表服务实现类
+ * @author : machaoyi
+ * @date : 2024-1-16
+ */
+@Service
+public class SysDicServiceImpl implements SysDicService{
+    @Autowired
+    private SysDicMapper sysDicMapper;
+    
+    /** 
+     * 通过ID查询单条数据 
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    public SysDic queryById(Long id){
+        return sysDicMapper.selectById(id);
+    }
+    
+    /**
+     * 分页查询
+     *
+     * @param sysDic 筛选条件
+     * @param current 当前页码
+     * @param size  每页大小
+     * @return
+     */
+    public Page<SysDic> paginQuery(SysDic sysDic, long current, long size){
+        //1. 构建动态查询条件
+        LambdaQueryWrapper<SysDic> queryWrapper = new LambdaQueryWrapper<>();
+        if(StrUtil.isNotBlank(sysDic.getDicName())){
+            queryWrapper.eq(SysDic::getDicName, sysDic.getDicName());
+        }
+        if(StrUtil.isNotBlank(sysDic.getDicCode())){
+            queryWrapper.eq(SysDic::getDicCode, sysDic.getDicCode());
+        }
+        //2. 执行分页查询
+        Page<SysDic> pagin = new Page<>(current , size , true);
+        IPage<SysDic> selectResult = sysDicMapper.selectPage(pagin , queryWrapper);
+        pagin.setPages(selectResult.getPages());
+        pagin.setTotal(selectResult.getTotal());
+        pagin.setRecords(selectResult.getRecords());
+        //3. 返回结果
+        return pagin;
+    }
+    
+    /** 
+     * 新增数据
+     *
+     * @param sysDic 实例对象
+     * @return 实例对象
+     */
+    public SysDic insert(SysDic sysDic){
+        sysDicMapper.insert(sysDic);
+        return sysDic;
+    }
+    
+    /** 
+     * 更新数据
+     *
+     * @param sysDic 实例对象
+     * @return 实例对象
+     */
+    public SysDic update(SysDic sysDic){
+        //1. 根据条件动态更新
+        LambdaUpdateChainWrapper<SysDic> chainWrapper = new LambdaUpdateChainWrapper<SysDic>(sysDicMapper);
+        if(StrUtil.isNotBlank(sysDic.getDicName())){
+            chainWrapper.set(SysDic::getDicName, sysDic.getDicName());
+        }
+        if(StrUtil.isNotBlank(sysDic.getDicCode())){
+            chainWrapper.set(SysDic::getDicCode, sysDic.getDicCode());
+        }
+        //2. 设置主键,并更新
+        chainWrapper.eq(SysDic::getId, sysDic.getId());
+        boolean ret = chainWrapper.update();
+        //3. 更新成功了,查询最最对象返回
+        if(ret){
+            return queryById(sysDic.getId());
+        }else{
+            return sysDic;
+        }
+    }
+    
+    /** 
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 是否成功
+     */
+    public boolean deleteById(Long id){
+        int total = sysDicMapper.deleteById(id);
+        return total > 0;
+    }
+}

+ 154 - 0
application/src/main/java/com/ctsi/System/SysDicItem/controller/SysDicItemController.java

@@ -0,0 +1,154 @@
+package com.ctsi.System.SysDicItem.controller;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ctsi.System.SysDicItem.entity.SysDicItemSearchPO;
+import com.ctsi.System.SysDicItem.entity.SysDicItemSearchVO;
+import com.ctsi.entity.FramePage;
+import com.ctsi.utils.ApiResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.bind.annotation.*;
+import com.ctsi.System.SysDicItem.entity.SysDicItem;
+import com.ctsi.System.SysDicItem.service.SysDicItemService;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 字典项表;(sys_dic_item)表控制层
+ * @author : machaoyi
+ * @date : 2024-1-16
+ */
+@Api(tags = "字典项表对象功能接口")
+@RestController
+@RequestMapping("/sysDicItem")
+public class SysDicItemController{
+    @Resource
+    private SysDicItemService sysDicItemService;
+    private static final Logger log = LoggerFactory.getLogger(SysDicItemController.class);
+    
+    /** 
+     * 通过ID查询单条数据 
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    @ApiOperation("通过ID查询单条数据")
+    @GetMapping("{id}")
+    public ApiResult<SysDicItem> queryById(Long id){
+        try {
+            return ApiResult.success(sysDicItemService.queryById(id));
+        } catch (Exception e) {
+            log.error(e.getMessage());
+            return ApiResult.failure("查询失败",null);
+        }
+    }
+    
+    /** 
+     * 分页查询
+     *
+     * @param sysDicItem 筛选条件
+     * @return 查询结果
+     */
+    @ApiOperation("分页查询")
+    @GetMapping
+    public ApiResult<Page<SysDicItem>> paginQuery(SysDicItem sysDicItem, FramePage framePage){
+        try {
+            return ApiResult.success(sysDicItemService.paginQuery(sysDicItem, framePage.getPageNum(), framePage.getPageSize()));
+        } catch (Exception e) {
+            log.error(e.getMessage());
+            return ApiResult.failure("分页查询失败",null);
+        }    
+    }
+    
+    /** 
+     * 新增数据
+     *
+     * @param sysDicItem 实例对象
+     * @return 实例对象
+     */
+    @ApiOperation("新增数据")
+    @PostMapping
+    public ApiResult<SysDicItem> add(@RequestBody SysDicItem sysDicItem){
+        try {
+            return ApiResult.success(sysDicItemService.insert(sysDicItem));
+        } catch (Exception e) {
+            log.error(e.getMessage());
+            return ApiResult.failure("新增数据失败",null);
+        }
+    }
+    
+    /** 
+     * 更新数据
+     *
+     * @param sysDicItem 实例对象
+     * @return 实例对象
+     */
+    @ApiOperation("更新数据")
+    @PutMapping
+    public ApiResult<SysDicItem> edit(@RequestBody SysDicItem sysDicItem){
+        try {
+            return ApiResult.success(sysDicItemService.update(sysDicItem));
+        } catch (Exception e) {
+            log.error(e.getMessage());
+            return ApiResult.failure("更新数据失败",null);
+        }
+    }
+    
+    /** 
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 是否成功
+     */
+    @ApiOperation("通过主键删除数据")
+    @DeleteMapping
+    public ApiResult<Boolean> deleteById(Long id){
+        try {
+            return ApiResult.success(sysDicItemService.deleteById(id));
+        } catch (Exception e) {
+            log.error(e.getMessage());
+            return ApiResult.failure("删除数据失败",null);
+        }
+    }
+
+     /**
+      * 根据字典id查询字典项列表
+      *
+      * @param dicId 字典id
+      * @return 查询结果
+      */
+     @ApiOperation("根据字典id查询字典项列表")
+     @GetMapping("/getDicItemListByDicId")
+     public ApiResult<List<SysDicItemSearchPO>> getDicItemListByDicId(Long dicId){
+         try {
+             SysDicItemSearchVO sysDicItemSearchVO = new SysDicItemSearchVO();
+             sysDicItemSearchVO.setDicId(dicId);
+             return ApiResult.success(sysDicItemService.getDicItemList(sysDicItemSearchVO));
+         } catch (Exception e) {
+             log.error(e.getMessage());
+             return ApiResult.failure("查询失败",null);
+         }
+     }
+
+    /**
+     * 根据字典code查询字典项列表
+     *
+     * @param dicCode 字典code
+     * @return 查询结果
+     */
+    @ApiOperation("根据字典code查询字典项列表")
+    @GetMapping("/getDicItemListByDicCode")
+    public ApiResult<List<SysDicItemSearchPO>> getDicItemListByDicCode(String dicCode){
+        try {
+            SysDicItemSearchVO sysDicItemSearchVO = new SysDicItemSearchVO();
+            sysDicItemSearchVO.setDicCode(dicCode);
+            return ApiResult.success(sysDicItemService.getDicItemList(sysDicItemSearchVO));
+        } catch (Exception e) {
+            log.error(e.getMessage());
+            return ApiResult.failure("查询失败",null);
+        }
+    }
+}

+ 122 - 0
application/src/main/java/com/ctsi/System/SysDicItem/entity/SysDicItem.java

@@ -0,0 +1,122 @@
+package com.ctsi.System.SysDicItem.entity;
+
+import com.ctsi.utils.LongtoStringSerialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import java.util.Date;
+
+ /**
+ * 字典项表;
+ * @author : machaoyi
+ * @date : 2024-1-16
+ */
+@ApiModel(value = "字典项表",description = "")
+@TableName("sys_dic_item")
+public class SysDicItem implements Serializable,Cloneable{
+    /** 主键id */
+    @ApiModelProperty(value = "主键id",notes = "")
+    @TableId
+    @JsonSerialize(using = LongtoStringSerialize.class)
+    private Long id ;
+    /** 创建人userid */
+    @ApiModelProperty(value = "创建人userid",notes = "")
+    private Long createdBy ;
+    /** 创建时间 */
+    @ApiModelProperty(value = "创建时间",notes = "")
+    private Date createdTime ;
+    /** 逻辑删除 */
+    @ApiModelProperty(value = "逻辑删除",notes = "")
+    private Integer delFlag ;
+    /** 字典表id */
+    @ApiModelProperty(value = "字典表id",notes = "")
+    private Long dicId ;
+    /** 字典项编码 */
+    @ApiModelProperty(value = "字典项编码",notes = "")
+    private String itemCode ;
+    /** 字典值 */
+    @ApiModelProperty(value = "字典值",notes = "")
+    private String itemValue ;
+    /** 字典项排序 */
+    @ApiModelProperty(value = "字典项排序",notes = "")
+    private Integer itemSort ;
+    /** 字典项父级id */
+    @ApiModelProperty(value = "字典项父级id(没有就不填)",notes = "")
+    private Long itemParentId ;
+
+    /** 主键id */
+    public Long getId(){
+        return this.id;
+    }
+    /** 主键id */
+    public void setId(Long id){
+        this.id=id;
+    }
+    /** 创建人userid */
+    public Long getCreatedBy(){
+        return this.createdBy;
+    }
+    /** 创建人userid */
+    public void setCreatedBy(Long createdBy){
+        this.createdBy=createdBy;
+    }
+    /** 创建时间 */
+    public Date getCreatedTime(){
+        return this.createdTime;
+    }
+    /** 创建时间 */
+    public void setCreatedTime(Date createdTime){
+        this.createdTime=createdTime;
+    }
+    /** 逻辑删除 */
+    public Integer getDelFlag(){
+        return this.delFlag;
+    }
+    /** 逻辑删除 */
+    public void setDelFlag(Integer delFlag){
+        this.delFlag=delFlag;
+    }
+    /** 字典表id */
+    public Long getDicId(){
+        return this.dicId;
+    }
+    /** 字典表id */
+    public void setDicId(Long dicId){
+        this.dicId=dicId;
+    }
+    /** 字典项编码 */
+    public String getItemCode(){
+        return this.itemCode;
+    }
+    /** 字典项编码 */
+    public void setItemCode(String itemCode){
+        this.itemCode=itemCode;
+    }
+    /** 字典值 */
+    public String getItemValue(){
+        return this.itemValue;
+    }
+    /** 字典值 */
+    public void setItemValue(String itemValue){
+        this.itemValue=itemValue;
+    }
+    /** 字典项排序 */
+    public Integer getItemSort(){
+        return this.itemSort;
+    }
+    /** 字典项排序 */
+    public void setItemSort(Integer itemSort){
+        this.itemSort=itemSort;
+    }
+    /** 字典项父级id */
+    public Long getItemParentId(){
+        return this.itemParentId;
+    }
+    /** 字典项父级id */
+    public void setItemParentId(Long itemParentId){
+        this.itemParentId=itemParentId;
+    }
+}

+ 135 - 0
application/src/main/java/com/ctsi/System/SysDicItem/entity/SysDicItemSearchPO.java

@@ -0,0 +1,135 @@
+package com.ctsi.System.SysDicItem.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ctsi.utils.LongtoStringSerialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+* 字典项表;
+* @author : machaoyi
+* @date : 2024-1-16
+*/
+@ApiModel(value = "字典项表",description = "")
+@TableName("sys_dic_item")
+public class SysDicItemSearchPO implements Serializable,Cloneable{
+   /** 主键id */
+   @ApiModelProperty(value = "主键id",notes = "")
+   @TableId
+   @JsonSerialize(using = LongtoStringSerialize.class)
+   private Long id ;
+   /** 创建人userid */
+   @ApiModelProperty(value = "创建人userid",notes = "")
+   private Long createdBy ;
+   /** 创建时间 */
+   @ApiModelProperty(value = "创建时间",notes = "")
+   private Date createdTime ;
+   /** 逻辑删除 */
+   @ApiModelProperty(value = "逻辑删除",notes = "")
+   private Integer delFlag ;
+   /** 字典表id */
+   @ApiModelProperty(value = "字典表id",notes = "")
+   private Long dicId ;
+   /** 字典项编码 */
+   @ApiModelProperty(value = "字典项编码",notes = "")
+   private String itemCode ;
+   /** 字典值 */
+   @ApiModelProperty(value = "字典值",notes = "")
+   private String itemValue ;
+   /** 字典项排序 */
+   @ApiModelProperty(value = "字典项排序",notes = "")
+   private Integer itemSort ;
+   /** 字典项父级id */
+   @ApiModelProperty(value = "字典项父级id",notes = "")
+   private Long itemParentId ;
+   /** 子级 */
+   @ApiModelProperty(value = "子级",notes = "")
+   private List<SysDicItemSearchPO> children ;
+
+   /** 主键id */
+   public Long getId(){
+       return this.id;
+   }
+   /** 主键id */
+   public void setId(Long id){
+       this.id=id;
+   }
+   /** 创建人userid */
+   public Long getCreatedBy(){
+       return this.createdBy;
+   }
+   /** 创建人userid */
+   public void setCreatedBy(Long createdBy){
+       this.createdBy=createdBy;
+   }
+   /** 创建时间 */
+   public Date getCreatedTime(){
+       return this.createdTime;
+   }
+   /** 创建时间 */
+   public void setCreatedTime(Date createdTime){
+       this.createdTime=createdTime;
+   }
+   /** 逻辑删除 */
+   public Integer getDelFlag(){
+       return this.delFlag;
+   }
+   /** 逻辑删除 */
+   public void setDelFlag(Integer delFlag){
+       this.delFlag=delFlag;
+   }
+   /** 字典表id */
+   public Long getDicId(){
+       return this.dicId;
+   }
+   /** 字典表id */
+   public void setDicId(Long dicId){
+       this.dicId=dicId;
+   }
+   /** 字典项编码 */
+   public String getItemCode(){
+       return this.itemCode;
+   }
+   /** 字典项编码 */
+   public void setItemCode(String itemCode){
+       this.itemCode=itemCode;
+   }
+   /** 字典值 */
+   public String getItemValue(){
+       return this.itemValue;
+   }
+   /** 字典值 */
+   public void setItemValue(String itemValue){
+       this.itemValue=itemValue;
+   }
+   /** 字典项排序 */
+   public Integer getItemSort(){
+       return this.itemSort;
+   }
+   /** 字典项排序 */
+   public void setItemSort(Integer itemSort){
+       this.itemSort=itemSort;
+   }
+   /** 字典项父级id */
+   public Long getItemParentId(){
+       return this.itemParentId;
+   }
+   /** 字典项父级id */
+   public void setItemParentId(Long itemParentId){
+       this.itemParentId=itemParentId;
+   }
+
+   public List<SysDicItemSearchPO> getChildren() {
+      return children;
+   }
+
+   public void setChildren(List<SysDicItemSearchPO> children) {
+      this.children = children;
+   }
+}

+ 32 - 0
application/src/main/java/com/ctsi/System/SysDicItem/entity/SysDicItemSearchVO.java

@@ -0,0 +1,32 @@
+package com.ctsi.System.SysDicItem.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ctsi.utils.LongtoStringSerialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+* 字典表;
+* @author : machaoyi
+* @date : 2024-1-16
+*/
+@ApiModel(value = "字典表查询字典项列表",description = "")
+@TableName("sys_dic")
+@Data
+public class SysDicItemSearchVO implements Serializable {
+   /** 字典表id */
+   @ApiModelProperty(value = "字典表id",notes = "")
+   @JsonSerialize(using = LongtoStringSerialize.class)
+   private Long dicId ;
+   /** 字典表code */
+   @ApiModelProperty(value = "字典表code",notes = "")
+   @JsonSerialize(using = LongtoStringSerialize.class)
+   private String dicCode ;
+
+}

+ 27 - 0
application/src/main/java/com/ctsi/System/SysDicItem/mapper/SysDicItemMapper.java

@@ -0,0 +1,27 @@
+package com.ctsi.System.SysDicItem.mapper;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.github.yulichang.base.MPJBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import com.ctsi.System.SysDicItem.entity.SysDicItem;
+
+ /**
+ * 字典项表;(sys_dic_item)表数据库访问层
+ * @author : machaoyi
+ * @date : 2024-1-16
+ */
+@Mapper
+public interface SysDicItemMapper  extends MPJBaseMapper<SysDicItem> {
+    /** 
+     * 分页查询指定行数据
+     *
+     * @param page 分页参数
+     * @param wrapper 动态查询条件
+     * @return 分页对象列表
+     */
+    IPage<SysDicItem> selectByPage(IPage<SysDicItem> page , @Param(Constants.WRAPPER) Wrapper<SysDicItem> wrapper);
+}

+ 8 - 0
application/src/main/java/com/ctsi/System/SysDicItem/mapper/SysDicItemMapper.xml

@@ -0,0 +1,8 @@
+<?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.ctsi.System.SysDicItem.mapper.SysDicItemMapper">
+     <select id="selectByPage" resultType="com.ctsi.System.SysDicItem.entity.SysDicItem">
+        select * from sys_dic_item ${ew.customSqlSegment}
+    </select>
+</mapper>

+ 57 - 0
application/src/main/java/com/ctsi/System/SysDicItem/service/SysDicItemService.java

@@ -0,0 +1,57 @@
+package com.ctsi.System.SysDicItem.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ctsi.System.SysDicItem.entity.SysDicItem;
+import com.ctsi.System.SysDicItem.entity.SysDicItemSearchPO;
+import com.ctsi.System.SysDicItem.entity.SysDicItemSearchVO;
+
+import java.util.List;
+
+/**
+ * 字典项表;(sys_dic_item)表服务接口
+ * @author : machaoyi
+ * @date : 2024-1-16
+ */
+public interface SysDicItemService{
+    
+    /** 
+     * 通过ID查询单条数据 
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    SysDicItem queryById(Long id);
+    
+    /**
+     * 分页查询
+     *
+     * @param sysDicItem 筛选条件
+     * @param current 当前页码
+     * @param size  每页大小
+     * @return
+     */
+    Page<SysDicItem> paginQuery(SysDicItem sysDicItem, long current, long size);
+    /** 
+     * 新增数据
+     *
+     * @param sysDicItem 实例对象
+     * @return 实例对象
+     */
+    SysDicItem insert(SysDicItem sysDicItem);
+    /** 
+     * 更新数据
+     *
+     * @param sysDicItem 实例对象
+     * @return 实例对象
+     */
+    SysDicItem update(SysDicItem sysDicItem);
+    /** 
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 是否成功
+     */
+    boolean deleteById(Long id);
+
+    List<SysDicItemSearchPO> getDicItemList(SysDicItemSearchVO sysDicItemSearchVO);
+}

+ 171 - 0
application/src/main/java/com/ctsi/System/SysDicItem/service/impl/SysDicItemServiceImpl.java

@@ -0,0 +1,171 @@
+package com.ctsi.System.SysDicItem.service.impl;
+
+import cn.hutool.core.util.StrUtil;
+import com.ctsi.System.SysDic.entity.SysDic;
+import com.ctsi.System.SysDicItem.entity.SysDicItemSearchPO;
+import com.ctsi.System.SysDicItem.entity.SysDicItemSearchVO;
+import com.ctsi.System.SysOrg.entity.PO.SysOrgSearchPO;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
+import com.ctsi.System.SysDicItem.entity.SysDicItem;
+import com.ctsi.System.SysDicItem.mapper.SysDicItemMapper;
+import com.ctsi.System.SysDicItem.service.SysDicItemService;
+
+import java.util.*;
+
+/**
+ * 字典项表;(sys_dic_item)表服务实现类
+ * @author : machaoyi
+ * @date : 2024-1-16
+ */
+@Service
+public class SysDicItemServiceImpl implements SysDicItemService{
+    @Autowired
+    private SysDicItemMapper sysDicItemMapper;
+    
+    /** 
+     * 通过ID查询单条数据 
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    public SysDicItem queryById(Long id){
+        return sysDicItemMapper.selectById(id);
+    }
+    
+    /**
+     * 分页查询
+     *
+     * @param sysDicItem 筛选条件
+     * @param current 当前页码
+     * @param size  每页大小
+     * @return
+     */
+    public Page<SysDicItem> paginQuery(SysDicItem sysDicItem, long current, long size){
+        //1. 构建动态查询条件
+        LambdaQueryWrapper<SysDicItem> queryWrapper = new LambdaQueryWrapper<>();
+        if(StrUtil.isNotBlank(sysDicItem.getItemCode())){
+            queryWrapper.eq(SysDicItem::getItemCode, sysDicItem.getItemCode());
+        }
+        if(StrUtil.isNotBlank(sysDicItem.getItemValue())){
+            queryWrapper.eq(SysDicItem::getItemValue, sysDicItem.getItemValue());
+        }
+        //2. 执行分页查询
+        Page<SysDicItem> pagin = new Page<>(current , size , true);
+        IPage<SysDicItem> selectResult = sysDicItemMapper.selectPage(pagin , queryWrapper);
+        pagin.setPages(selectResult.getPages());
+        pagin.setTotal(selectResult.getTotal());
+        pagin.setRecords(selectResult.getRecords());
+        //3. 返回结果
+        return pagin;
+    }
+    
+    /** 
+     * 新增数据
+     *
+     * @param sysDicItem 实例对象
+     * @return 实例对象
+     */
+    public SysDicItem insert(SysDicItem sysDicItem){
+        sysDicItemMapper.insert(sysDicItem);
+        return sysDicItem;
+    }
+    
+    /** 
+     * 更新数据
+     *
+     * @param sysDicItem 实例对象
+     * @return 实例对象
+     */
+    public SysDicItem update(SysDicItem sysDicItem){
+        //1. 根据条件动态更新
+        LambdaUpdateChainWrapper<SysDicItem> chainWrapper = new LambdaUpdateChainWrapper<SysDicItem>(sysDicItemMapper);
+        if(StrUtil.isNotBlank(sysDicItem.getItemCode())){
+            chainWrapper.set(SysDicItem::getItemCode, sysDicItem.getItemCode());
+        }
+        if(StrUtil.isNotBlank(sysDicItem.getItemValue())){
+            chainWrapper.set(SysDicItem::getItemValue, sysDicItem.getItemValue());
+        }
+        //2. 设置主键,并更新
+        chainWrapper.eq(SysDicItem::getId, sysDicItem.getId());
+        boolean ret = chainWrapper.update();
+        //3. 更新成功了,查询最最对象返回
+        if(ret){
+            return queryById(sysDicItem.getId());
+        }else{
+            return sysDicItem;
+        }
+    }
+    
+    /** 
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 是否成功
+     */
+    public boolean deleteById(Long id){
+        int total = sysDicItemMapper.deleteById(id);
+        return total > 0;
+    }
+
+     /**
+      * 查询字典项列表
+      *
+      * @param
+      * @return 是否成功
+      */
+     public List<SysDicItemSearchPO> getDicItemList(SysDicItemSearchVO sysDicItemSearchVO){
+         MPJLambdaWrapper<SysDicItem> wrapper = new MPJLambdaWrapper<>();
+         if (sysDicItemSearchVO.getDicId() != null && sysDicItemSearchVO.getDicId() != 0){
+             wrapper.eq(SysDicItem::getDicId,sysDicItemSearchVO.getDicId());
+         } else if (StrUtil.isNotBlank(sysDicItemSearchVO.getDicCode())){
+             wrapper.leftJoin(SysDic.class,SysDic::getId,SysDicItem::getDicId);
+             wrapper.eq(SysDic::getDicCode,sysDicItemSearchVO.getDicCode());
+         }
+         wrapper.selectAll(SysDicItem.class);
+         List<SysDicItemSearchPO> sysDicItemList = sysDicItemMapper.selectJoinList(SysDicItemSearchPO.class,wrapper);
+         sysDicItemList = buildTree(sysDicItemList);
+         return sysDicItemList;
+     }
+
+    public static List<SysDicItemSearchPO> buildTree(List<SysDicItemSearchPO> nodeList) {
+        Map<Long, SysDicItemSearchPO> nodeMap = new LinkedHashMap<>();
+
+        // 将节点放入 Map 中,方便通过 id 查找
+        for (SysDicItemSearchPO node : nodeList) {
+            nodeMap.put(node.getId(), node);
+        }
+
+        List<SysDicItemSearchPO> tree = new ArrayList<>();
+
+        // 逐个节点构建树
+        for (SysDicItemSearchPO node : nodeList) {
+            if (node.getItemParentId() == 0) {
+                // 根节点
+                tree.add(buildTreeRecursively(node, nodeMap, node.getId()));
+            }
+        }
+
+        return tree;
+    }
+
+    private static SysDicItemSearchPO buildTreeRecursively(SysDicItemSearchPO parentNode, Map<Long, SysDicItemSearchPO> nodeMap, Long parentId) {
+        List<SysDicItemSearchPO> children = new ArrayList<>();
+
+        // 查找当前节点的子节点
+        nodeMap.forEach((id, node) -> {
+            if (Objects.equals(node.getItemParentId(), parentId)) {
+                children.add(buildTreeRecursively(node, nodeMap, node.getId()));
+            }
+        });
+        // 将子节点设置到父节点
+        parentNode.setChildren(children);
+
+        return parentNode;
+    }
+}

+ 2 - 0
application/src/main/java/com/ctsi/System/SysMenu/controller/SysMenuController.java

@@ -1,5 +1,6 @@
 package com.ctsi.System.SysMenu.controller;
 
+import cn.dev33.satoken.stp.StpUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ctsi.System.SysMenu.entity.PO.SysMenuSearchPO;
 import com.ctsi.System.SysMenu.entity.SysMenu;
@@ -71,6 +72,7 @@ public class SysMenuController{
     @PostMapping
     public ApiResult<SysMenu> add(@RequestBody SysMenu sysMenu){
         try {
+            sysMenu.setCreatedBy(StpUtil.getLoginIdAsLong());
             return ApiResult.success(sysMenuService.insert(sysMenu));
         } catch (Exception e) {
             log.error(e.getMessage());

+ 2 - 0
application/src/main/java/com/ctsi/System/SysOrg/controller/SysOrgController.java

@@ -1,5 +1,6 @@
 package com.ctsi.System.SysOrg.controller;
 
+import cn.dev33.satoken.stp.StpUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ctsi.System.SysOrg.entity.PO.SysOrgSearchPO;
 import com.ctsi.System.SysOrg.entity.SysOrg;
@@ -71,6 +72,7 @@ public class SysOrgController{
     @PostMapping
     public ApiResult<SysOrg> add(@RequestBody SysOrg sysOrg){
         try {
+            sysOrg.setCreatedBy(StpUtil.getLoginIdAsLong());
             return ApiResult.success(sysOrgService.insert(sysOrg));
         } catch (Exception e) {
             log.error(e.getMessage());

+ 2 - 0
application/src/main/java/com/ctsi/System/SysRole/controller/SysRoleController.java

@@ -1,5 +1,6 @@
 package com.ctsi.System.SysRole.controller;
 
+import cn.dev33.satoken.stp.StpUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ctsi.System.SysRole.entity.PO.SysRoleMenuAddPO;
 import com.ctsi.System.SysRole.entity.SysRole;
@@ -75,6 +76,7 @@ public class SysRoleController{
     @PostMapping
     public ApiResult<SysRole> add(@RequestBody SysRole sysRole){
         try {
+            sysRole.setCreatedBy(StpUtil.getLoginIdAsLong());
             return ApiResult.success(sysRoleService.insert(sysRole));
         } catch (Exception e) {
             log.error(e.getMessage());