From a7dd93b840bdce4bd0011bc948157f440514a207 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期二, 28 四月 2026 16:36:04 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_New_pro' into dev_New_pro
---
src/main/java/com/ruoyi/projectManagement/service/impl/PlanServiceImpl.java | 25 +++++++++++++++++--------
1 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/src/main/java/com/ruoyi/projectManagement/service/impl/PlanServiceImpl.java b/src/main/java/com/ruoyi/projectManagement/service/impl/PlanServiceImpl.java
index 0a32691..e05ce2e 100644
--- a/src/main/java/com/ruoyi/projectManagement/service/impl/PlanServiceImpl.java
+++ b/src/main/java/com/ruoyi/projectManagement/service/impl/PlanServiceImpl.java
@@ -6,7 +6,10 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.ruoyi.basic.dto.StorageBlobVO;
+import com.ruoyi.basic.enums.RecordTypeEnum;
import com.ruoyi.basic.service.CustomerFollowUpFileService;
+import com.ruoyi.basic.utils.FileUtil;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.projectManagement.mapper.PlanMapper;
import com.ruoyi.projectManagement.mapper.PlanNodeMapper;
@@ -40,6 +43,7 @@
private final CustomerFollowUpFileService customerFollowUpFileService;
private final PlanNodeMapper planNodeMapper;
+ private final FileUtil fileUtil;
@Lazy
@Autowired
@@ -49,9 +53,8 @@
@Transactional(rollbackFor = Exception.class)
public void savePlan(SavePlanVo savePlanVo) {
Plan plan = BeanUtil.copyProperties(savePlanVo, Plan.class);
- // 闄勪欢澶勭悊 , 鎷兼帴
- String attachments = String.join(",", Optional.ofNullable(savePlanVo.getAttachmentIds()).orElse(Collections.emptyList()));
- plan.setAttachment(attachments);
+ // 闄勪欢澶勭悊
+ fileUtil.saveStorageAttachmentByRecordTypeAndRecordId("", RecordTypeEnum.PLAN, savePlanVo.getId(), savePlanVo.getStorageBlobDTOs());
if (savePlanVo.getId() == null) {
planMapper.insert(plan);
} else {
@@ -93,16 +96,20 @@
});
}
- private List<PlanNode> getPlanNodeByPlanId(Long planId) {
+ @Override
+ public List<PlanNode> getPlanNodeByPlanId(Long planId) {
return planNodeMapper.selectList(new LambdaQueryWrapper<PlanNode>()
.eq(PlanNode::getIsDelete, 0)
- .eq(PlanNode::getProjectManagementPlanId, planId));
+ .eq(PlanNode::getProjectManagementPlanId, planId).orderByAsc(PlanNode::getSort));
}
private List<PlanNode> getPlanNodeByPlanIds(List<Long> planIds) {
+ if(CollUtil.isEmpty(planIds)){
+ return Collections.emptyList();
+ }
return planNodeMapper.selectList(new LambdaQueryWrapper<PlanNode>()
.eq(PlanNode::getIsDelete, 0)
- .in(PlanNode::getProjectManagementPlanId, planIds));
+ .in(PlanNode::getProjectManagementPlanId, planIds).orderByAsc(PlanNode::getSort));
}
@@ -132,12 +139,14 @@
IPage<Plan> planIPage = planMapper.selectPlanPage(searchPlanVo);
IPage<PlanVo> resultPage = planIPage.convert(plan -> BeanUtil.copyProperties(plan, PlanVo.class));
// 鏂囦欢鑾峰彇
- customerFollowUpFileService.fillAttachment(resultPage.getRecords(), PlanVo::getAttachment, PlanVo::setAttachmentList);
Map<Long, List<PlanNodeVo>> collect = getPlanNodeByPlanIds(resultPage.getRecords().stream().map(PlanVo::getId).collect(Collectors.toList()))
.stream()
.map(it -> BeanUtil.copyProperties(it, PlanNodeVo.class))
.collect(Collectors.groupingBy(PlanNodeVo::getProjectManagementPlanId, Collectors.toList()));
- resultPage.getRecords().forEach(planVo -> planVo.setPlanNodeList(collect.getOrDefault(planVo.getId(), Collections.emptyList())));
+ resultPage.getRecords().forEach(planVo -> {
+ planVo.setPlanNodeList(collect.getOrDefault(planVo.getId(), Collections.emptyList()));
+ planVo.setStorageBlobVOs(fileUtil.getStorageBlobVOsByRecordTypeAndRecordId(RecordTypeEnum.PLAN, planVo.getId()));
+ });
return resultPage;
}
--
Gitblit v1.9.3