|
|
@ -1,5 +1,6 @@ |
|
|
package com.project.information.application.impl; |
|
|
package com.project.information.application.impl; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.project.base.domain.exception.BusinessErrorException; |
|
|
import com.project.base.domain.exception.BusinessErrorException; |
|
|
import com.project.base.config.CustomIdGenerator; |
|
|
import com.project.base.config.CustomIdGenerator; |
|
|
@ -148,12 +149,8 @@ public class DraftReviewApplicationServiceImpl implements DraftReviewApplication |
|
|
return confirmKnowledgePointDraftDomainService.confirm(informationId); |
|
|
return confirmKnowledgePointDraftDomainService.confirm(informationId); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 批量保存草稿并确认(替代逐条编辑+单独确认) |
|
|
|
|
|
* 前端编辑完所有草稿后一次性提交,提交后自动固化 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Result<String> batchSaveAndConfirm(Long informationId, List<DraftSaveDTO> draftList) { |
|
|
public Result<String> batchSaveAndConfirm(Long informationId, List<DraftSaveDTO> draftList, String name) { |
|
|
if (informationId == null) { |
|
|
if (informationId == null) { |
|
|
throw new BusinessErrorException("资料ID不能为空"); |
|
|
throw new BusinessErrorException("资料ID不能为空"); |
|
|
} |
|
|
} |
|
|
@ -173,7 +170,21 @@ public class DraftReviewApplicationServiceImpl implements DraftReviewApplication |
|
|
throw new BusinessErrorException("该资料不在待审核状态"); |
|
|
throw new BusinessErrorException("该资料不在待审核状态"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 2. 获取该资料下所有待审核草稿ID(仅查ID,减少数据传输)
|
|
|
// 2. 如果传了名称且与原名不同,查重并更新
|
|
|
|
|
|
if (StrUtil.isNotBlank(name) && !StrUtil.equals(name, information.getName())) { |
|
|
|
|
|
boolean exists = informationBaseService.lambdaQuery() |
|
|
|
|
|
.eq(InformationEntity::getSubLineId, information.getSubLineId()) |
|
|
|
|
|
.eq(InformationEntity::getName, name) |
|
|
|
|
|
.ne(InformationEntity::getId, informationId) |
|
|
|
|
|
.exists(); |
|
|
|
|
|
if (exists) { |
|
|
|
|
|
throw new BusinessErrorException("该子产品线下已存在同名资料「" + name + "」,请修改文件名"); |
|
|
|
|
|
} |
|
|
|
|
|
information.setName(name); |
|
|
|
|
|
informationBaseService.updateById(information); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 3. 获取该资料下所有待审核草稿ID(仅查ID,减少数据传输)
|
|
|
List<Long> existingIds = knowledgePointDraftBaseService.lambdaQuery() |
|
|
List<Long> existingIds = knowledgePointDraftBaseService.lambdaQuery() |
|
|
.select(KnowledgePointDraftEntity::getId) |
|
|
.select(KnowledgePointDraftEntity::getId) |
|
|
.eq(KnowledgePointDraftEntity::getInformationId, informationId) |
|
|
.eq(KnowledgePointDraftEntity::getInformationId, informationId) |
|
|
|