1. 同步 base-version

This commit is contained in:
chenbowen
2025-09-18 00:51:31 +08:00
parent aedb839ae0
commit eb650ef56c
24 changed files with 666 additions and 37 deletions

View File

@@ -34,9 +34,9 @@ public interface DeptApi {
@Operation(summary = "删除部门")
CommonResult<Boolean> deleteDept(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/list-all")
@PostMapping(PREFIX + "/list-all")
@Operation(summary = "获得部门列表")
CommonResult<List<DeptDetailRespDTO>> getDeptList(@RequestParam DeptListReqDTO reqVO);
CommonResult<List<DeptDetailRespDTO>> getDeptList(@RequestBody DeptListReqDTO reqVO);
@GetMapping(PREFIX + "/simple-list")
@Operation(summary = "获得部门精简信息列表")
@@ -77,4 +77,9 @@ public interface DeptApi {
@Parameter(name = "id", description = "部门编号", example = "1024", required = true)
CommonResult<List<DeptRespDTO>> getChildDeptList(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/company-dept-info")
@Operation(summary = "获得指定用户的公司部门信息")
@Parameter(name = "userId", description = "用户编号", example = "1", required = true)
CommonResult<Set<CompanyDeptInfoRespDTO>> getCompanyDeptInfoListByUserId(@RequestParam("userId") Long userId);
}

View File

@@ -0,0 +1,27 @@
package cn.iocoder.yudao.module.system.api.dept.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 公司部门信息 Response DTO
*
* @author ZT
*/
@Schema(description = "RPC 服务 - 公司部门信息 Response DTO")
@Data
public class CompanyDeptInfoRespDTO {
@Schema(description = "公司编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long companyId;
@Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道源码")
private String companyName;
@Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long deptId;
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "研发部")
private String deptName;
}

View File

@@ -9,8 +9,8 @@ import cn.iocoder.yudao.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@Tag(name = "RPC 服务 - 操作日志")
@@ -18,8 +18,8 @@ public interface OperateLogApi extends OperateLogCommonApi {
String PREFIX = ApiConstants.PREFIX + "/operate-log";
@GetMapping(PREFIX + "/page")
@PostMapping(PREFIX + "/page")
@Operation(summary = "获取指定模块的指定数据的操作日志分页")
CommonResult<PageResult<OperateLogRespDTO>> getOperateLogPage(@SpringQueryMap OperateLogPageReqDTO pageReqDTO);
CommonResult<PageResult<OperateLogRespDTO>> getOperateLogPage(@RequestBody OperateLogPageReqDTO pageReqDTO);
}

View File

@@ -1,20 +1,18 @@
package cn.iocoder.yudao.module.system.api.sms;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeValidateReqDTO;
import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeSendReqDTO;
import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeUseReqDTO;
import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeValidateReqDTO;
import cn.iocoder.yudao.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
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.RequestBody;
import jakarta.validation.Valid;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@Tag(name = "RPC 服务 - 短信验证码")
public interface SmsCodeApi {
@@ -29,7 +27,7 @@ public interface SmsCodeApi {
@Operation(summary = "验证短信验证码,并进行使用")
CommonResult<Boolean> useSmsCode(@Valid @RequestBody SmsCodeUseReqDTO reqDTO);
@GetMapping(PREFIX + "/validate")
@PostMapping(PREFIX + "/validate")
@Operation(summary = "检查验证码是否有效")
CommonResult<Boolean> validateSmsCode(@Valid @RequestBody SmsCodeValidateReqDTO reqDTO);

View File

@@ -9,7 +9,6 @@ import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@@ -52,9 +51,9 @@ public interface SocialClientApi {
CommonResult<SocialWxPhoneNumberInfoRespDTO> getWxMaPhoneNumberInfo(@RequestParam("userType") Integer userType,
@RequestParam("phoneCode") String phoneCode);
@GetMapping(PREFIX + "/get-wxa-qrcode")
@PostMapping(PREFIX + "/get-wxa-qrcode")
@Operation(summary = "获得小程序二维码")
CommonResult<byte[]> getWxaQrcode(@SpringQueryMap SocialWxQrcodeReqDTO reqVO);
CommonResult<byte[]> getWxaQrcode(@RequestBody SocialWxQrcodeReqDTO reqVO);
@GetMapping(PREFIX + "/get-wxa-subscribe-template-list")
@Operation(summary = "获得微信小程订阅模板")

View File

@@ -2,18 +2,20 @@ package cn.iocoder.yudao.module.system.api.dept;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.CompanyDeptInfo;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.system.api.dept.dto.*;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptSaveReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
import cn.iocoder.yudao.module.system.service.dept.DeptService;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;
import jakarta.annotation.Resource;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@@ -88,4 +90,10 @@ public class DeptApiImpl implements DeptApi {
return success(BeanUtils.toBean(depts, DeptRespDTO.class));
}
@Override
public CommonResult<Set<CompanyDeptInfoRespDTO>> getCompanyDeptInfoListByUserId(Long userId) {
Set<CompanyDeptInfo> companyDeptInfos = deptService.getCompanyDeptInfoListByUserId(userId);
return success(BeanUtils.toBean(companyDeptInfos, CompanyDeptInfoRespDTO.class));
}
}

View File

@@ -84,6 +84,23 @@ public class DeptController {
return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
}
@GetMapping("/top-level-list")
@Operation(summary = "获取顶级部门列表", description = "用于懒加载,只返回没有父部门的顶级部门")
@PreAuthorize("@ss.hasPermission('system:dept:query')")
public CommonResult<List<DeptSimpleRespVO>> getTopLevelDeptList() {
List<DeptDO> list = deptService.getTopLevelDeptList();
return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
}
@GetMapping("/children")
@Operation(summary = "根据父部门ID获取子部门列表", description = "用于懒加载根据父部门ID返回直接子部门")
@Parameter(name = "parentId", description = "父部门ID", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('system:dept:query')")
public CommonResult<List<DeptSimpleRespVO>> getChildrenDeptList(@RequestParam("parentId") Long parentId) {
List<DeptDO> list = deptService.getDirectChildDeptList(parentId);
return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
}
@GetMapping("/get")
@Operation(summary = "获得部门信息")
@Parameter(name = "id", description = "编号", required = true, example = "1024")

View File

@@ -49,4 +49,13 @@ public class SyncLogController {
return success(BeanUtils.toBean(pageResult, SyncLogRespVO.class));
}
@PostMapping("/rerun")
@Operation(summary = "重新执行异常的同步接口")
@Parameter(name = "id", description = "日志编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('system:sync-log:rerun')")
public CommonResult<Boolean> rerunSyncLog(@RequestParam("id") Long id) {
boolean success = syncLogService.rerunSyncLog(id);
return success(success);
}
}

View File

@@ -58,6 +58,34 @@ public interface DeptMapper extends BaseMapperX<DeptDO> {
UpdateWrapper<DeptDO> wrapper = new UpdateWrapper<>();
wrapper.in("id", ids).set("tenant_id", tenantId);
update(null, wrapper);
};
}
/**
* 根据父部门ID和状态查询部门列表
*
* @param parentId 父部门ID
* @param status 状态
* @return 部门列表
*/
default List<DeptDO> selectList(Long parentId, Integer status) {
return selectList(new LambdaQueryWrapperX<DeptDO>()
.eqIfPresent(DeptDO::getParentId, parentId)
.eqIfPresent(DeptDO::getStatus, status)
);
}
/**
* 根据父部门ID和状态查询子部门列表
*
* @param parentId 父部门ID
* @param status 状态
* @return 子部门列表
*/
default List<DeptDO> selectListByParentId(Long parentId, Integer status) {
return selectList(new LambdaQueryWrapperX<DeptDO>()
.eq(DeptDO::getParentId, parentId)
.eqIfPresent(DeptDO::getStatus, status)
);
}
}

View File

@@ -118,4 +118,21 @@ public interface DeptService {
List<DeptDO> getUserCompanyList();
Set<CompanyDeptInfo> getCompanyDeptInfoListByUserId(Long userId);
/**
* 获取顶级部门列表
* 用于懒加载,只返回没有父部门的顶级部门
*
* @return 顶级部门列表
*/
List<DeptDO> getTopLevelDeptList();
/**
* 根据父部门ID获取直接子部门列表
* 用于懒加载,只返回指定父部门的直接子部门
*
* @param parentId 父部门ID
* @return 直接子部门列表
*/
List<DeptDO> getDirectChildDeptList(Long parentId);
}

Some files were not shown because too many files have changed in this diff Show More