1. 新增外部系统编码部门编码关联管理
2. 新增统一的 api 对外门户管理 3. 修正各个模块的 api 命名
This commit is contained in:
@@ -55,6 +55,15 @@ public class DeptController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("init-codes")
|
||||
@Operation(summary = "初始化部门编码", description = "按照层级自动为全部部门重新生成编码")
|
||||
@PreAuthorize("@ss.hasPermission('system:dept:init-code')")
|
||||
@TenantIgnore
|
||||
public CommonResult<Boolean> initializeDeptCodes() {
|
||||
deptService.initializeDeptCodes();
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("delete")
|
||||
@Operation(summary = "删除部门")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
|
||||
@@ -19,7 +19,7 @@ public class DeptSaveReqVO {
|
||||
@Schema(description = "部门编号", example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "部门编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "DEPT_001")
|
||||
@Schema(description = "部门编码", example = "ZT001001")
|
||||
@Size(max = 50, message = "部门编码长度不能超过 50 个字符")
|
||||
private String code;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.system.controller.admin.sync;
|
||||
|
||||
import com.zt.plat.framework.common.biz.system.oauth2.OAuth2TokenCommonApi;
|
||||
import com.zt.plat.framework.common.biz.system.oauth2.dto.OAuth2AccessTokenCheckRespDTO;
|
||||
import com.zt.plat.framework.common.util.security.CryptoSignatureUtils;
|
||||
import com.zt.plat.framework.security.core.LoginUser;
|
||||
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.zt.plat.framework.tenant.core.aop.TenantIgnore;
|
||||
@@ -558,7 +559,7 @@ public class SyncController {
|
||||
syncLogService.logDecryptResult(logId, bimRequestId, bodyJson, authUser, true);
|
||||
|
||||
// 签名验证
|
||||
boolean signatureValid = SyncVerifyUtil.verifySignature(map, "MD5");
|
||||
boolean signatureValid = CryptoSignatureUtils.verifySignature(map, CryptoSignatureUtils.SIGNATURE_TYPE_MD5);
|
||||
syncLogService.logSignatureVerifyResult(logId, signatureValid);
|
||||
if (!signatureValid) {
|
||||
throw exception(SYNC_SIGNATURE_VERIFY_FAILED);
|
||||
@@ -608,8 +609,8 @@ public class SyncController {
|
||||
String bodyJson;
|
||||
String jsonString = JSON.toJSONString(object);
|
||||
try {
|
||||
bodyJson = SyncVerifyUtil.encrypt(jsonString, encryptKey, "AES");
|
||||
} catch (Exception e) {
|
||||
bodyJson = CryptoSignatureUtils.encrypt(jsonString, encryptKey, CryptoSignatureUtils.ENCRYPT_TYPE_AES);
|
||||
} catch (IllegalArgumentException | IllegalStateException e) {
|
||||
throw exception(SYNC_DECRYPT_TYPE);
|
||||
}
|
||||
return bodyJson;
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
|
||||
import com.zt.plat.module.system.dal.dataobject.dept.DeptDO;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -88,6 +89,20 @@ public interface DeptMapper extends BaseMapperX<DeptDO> {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询指定父部门下编码最大的子部门
|
||||
*
|
||||
* @param parentId 父部门ID
|
||||
* @return 编码最大的子部门
|
||||
*/
|
||||
default DeptDO selectLastChildByCode(Long parentId) {
|
||||
return selectOne(new LambdaQueryWrapper<DeptDO>()
|
||||
.eq(DeptDO::getParentId, parentId)
|
||||
.isNotNull(DeptDO::getCode)
|
||||
.orderByDesc(DeptDO::getCode)
|
||||
.last("LIMIT 1"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门编码查询部门
|
||||
*
|
||||
|
||||
@@ -152,4 +152,9 @@ public interface DeptService {
|
||||
* @return 公司列表
|
||||
*/
|
||||
List<DeptDO> getAllCompanyList();
|
||||
|
||||
/**
|
||||
* 按照新的编码规则初始化全部部门编码
|
||||
*/
|
||||
void initializeDeptCodes();
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -37,6 +37,7 @@ public interface EbanOAuth2Service {
|
||||
private String mobile;
|
||||
private String deptName;
|
||||
private String uid;
|
||||
private String displayName;
|
||||
private String rawUserInfoJson;
|
||||
private EbanOAuth2ServiceImpl.EbanTokenInfo tokenInfo; // 添加Token信息
|
||||
|
||||
@@ -70,6 +71,9 @@ public interface EbanOAuth2Service {
|
||||
public String getUid() { return uid; }
|
||||
public void setUid(String uid) { this.uid = uid; }
|
||||
|
||||
public String getDisplayName() { return displayName; }
|
||||
public void setDisplayName(String displayName) { this.displayName = displayName; }
|
||||
|
||||
public String getRawUserInfoJson() { return rawUserInfoJson; }
|
||||
public void setRawUserInfoJson(String rawUserInfoJson) { this.rawUserInfoJson = rawUserInfoJson; }
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user