修改bug

This commit is contained in:
chenxudong 2025-04-25 11:09:37 +08:00
parent 3dc82bdea3
commit dbba7ea178
2 changed files with 5 additions and 7 deletions

View File

@ -112,6 +112,7 @@ public class ChatService {
}
case "xls", "xlsx" -> {
String filePath = elePropertyConfig.getEleTmpPath() + File.separator + fileMd5 + "." + fileType;
FileUtil.writeFromStream(file.getInputStream(), filePath);
List<PageFile> pageInfo = StrUtil.equals("xlsx", filePath) ?
OfficeFileUtil.parseXlsxByPage(filePath) :
OfficeFileUtil.parseXlsByPage(filePath);

View File

@ -137,14 +137,13 @@ public class EdPrjServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo>
@Transactional(rollbackFor = Exception.class)
public ElectromagneticResult<?> modifyPrjName(String prjId, String newPrjName, int dataOwnCode) {
EdFileInfo fileInfo = this.baseMapper.selectOne(Wrappers.lambdaQuery(EdFileInfo.class)
.select(EdFileInfo::getFileName)
.eq(EdFileInfo::getId, prjId));
EdFileInfo fileInfo = this.baseMapper.selectById(prjId);
String oldPrjName = fileInfo.getFileName();
try {
Assert.isTrue(EleCommonUtil.isFileNameValid(newPrjName), StrFormatter.format("{} {}{} 修改失败。", newPrjName, NAME_VALID_MSG, oldPrjName));
Long count = this.baseMapper.selectCount(Wrappers.lambdaQuery(EdFileInfo.class)
.eq(EdFileInfo::getParentId, PRJ_PARENT_ID)
.eq(EdFileInfo::getDataOwn, dataOwnCode)
.eq(EdFileInfo::getEffectFlag, EffectFlagEnum.EFFECT.code)
.eq(EdFileInfo::getFileName, newPrjName));
if (count > 0) {
@ -152,10 +151,8 @@ public class EdPrjServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo>
log.info(info);
return ElectromagneticResultUtil.fail("-1", info);
}
this.baseMapper.update(new EdFileInfo(), Wrappers.lambdaUpdate(EdFileInfo.class)
.eq(EdFileInfo::getId, prjId)
.set(EdFileInfo::getFileName, newPrjName));
fileInfo.setFileName(newPrjName);
this.baseMapper.updateById(fileInfo);
UserThreadLocal.setSuccessInfo("", prjId, "修改工层名 {} 为 {} 成功。", oldPrjName, newPrjName);
} catch (Exception e) {
String info = StrFormatter.format("修改工程名异常--->{}{}", newPrjName, e.getMessage());