优化代码

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") @TableField(value = "permanent_deleted")
private Boolean permanentDeleted; private Boolean permanentDeleted;
/**
* 模板编码
*/
@TableField(value = "template_code")
private String templateCode;
public void newInit() { public void newInit() {
String newFileDbId = IdWorker.getSnowFlakeIdString(); String newFileDbId = IdWorker.getSnowFlakeIdString();
String fileTime = EleCommonUtil.getNowTimeStr(); String fileTime = EleCommonUtil.getNowTimeStr();

View File

@ -1521,8 +1521,11 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
try { try {
// 创建工程 // 创建工程
String prjId = updateImportPrj2Db(file); 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); commonService.publish(prjId, DataOwnEnum.SYS_PRJ.code);
// 将文件存入到数据库和文件系统 // 将文件存入到数据库和文件系统

View File

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