优化代码

This commit is contained in:
chenxudong 2025-05-12 14:28:06 +08:00
parent 5e44225d93
commit 10da858abb
3 changed files with 13 additions and 11 deletions

View File

@ -120,6 +120,12 @@ public class EdFileInfo extends BaseModel {
@TableField(value = "permanent_deleted")
private Boolean permanentDeleted;
/**
* 模板编码
*/
@TableField(value = "template_code")
private String templateCode;
public void newInit() {
String newFileDbId = IdWorker.getSnowFlakeIdString();
String fileTime = EleCommonUtil.getNowTimeStr();

View File

@ -1521,8 +1521,11 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
try {
// 创建工程
String prjId = updateImportPrj2Db(file);
// 层级沿用
commonService.follow("100001", prjId, DataOwnEnum.SYS_PRJ.code);
// 层级沿用先这样写后续根据需求扩展
EdFileInfo prj = this.baseMapper.selectOne(Wrappers.lambdaQuery(EdFileInfo.class)
.eq(EdFileInfo::getTemplateCode, "bhdcfzrjzt")
.eq(EdFileInfo::getEffectFlag, EffectFlagEnum.EFFECT.code));
commonService.follow(prj.getId(), prjId, DataOwnEnum.SYS_PRJ.code);
// 工程发布
commonService.publish(prjId, DataOwnEnum.SYS_PRJ.code);
// 将文件存入到数据库和文件系统

View File

@ -85,15 +85,8 @@ public class AESUtils {
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS7Padding");
cipher.init(Cipher.DECRYPT_MODE, secretKeySpec);
return new String(cipher.doFinal(Base64.decode(enc)));
} catch (NoSuchPaddingException e) {
throw new RuntimeException(e);
} catch (IllegalBlockSizeException e) {
throw new RuntimeException(e);
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
} catch (BadPaddingException e) {
throw new RuntimeException(e);
} catch (InvalidKeyException e) {
} catch (NoSuchPaddingException | IllegalBlockSizeException | NoSuchAlgorithmException | BadPaddingException |
InvalidKeyException e) {
throw new RuntimeException(e);
}
}