From f76bf27bf93e523ae4572d9e10e9ca541c324185 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期二, 03 十一月 2026 17:18:55 +0800
Subject: [PATCH] 部分改动

---
 src/main/java/com/ruoyi/sales/service/BusinessApprovalService.java |   33 +++------------------------------
 1 files changed, 3 insertions(+), 30 deletions(-)

diff --git a/src/main/java/com/ruoyi/sales/service/BusinessApprovalService.java b/src/main/java/com/ruoyi/sales/service/BusinessApprovalService.java
index 939cd2f..956d226 100644
--- a/src/main/java/com/ruoyi/sales/service/BusinessApprovalService.java
+++ b/src/main/java/com/ruoyi/sales/service/BusinessApprovalService.java
@@ -1,17 +1,11 @@
 package com.ruoyi.sales.service;
 
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.ruoyi.common.enums.PlanStageEnum;
 import com.ruoyi.common.enums.ReviewStatusEnum;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.SecurityUtils;
-import com.ruoyi.projectManagement.dto.PlanStageDto;
 import com.ruoyi.projectManagement.mapper.InfoMapper;
-import com.ruoyi.projectManagement.mapper.PlanMapper;
-import com.ruoyi.projectManagement.mapper.PlanNodeMapper;
 import com.ruoyi.projectManagement.pojo.Info;
-import com.ruoyi.projectManagement.pojo.Plan;
-import com.ruoyi.projectManagement.pojo.PlanNode;
 import com.ruoyi.sales.dto.BusinessReviewDto;
 import com.ruoyi.sales.mapper.SalesLedgerMapper;
 import com.ruoyi.sales.pojo.SalesLedger;
@@ -22,15 +16,12 @@
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
-import java.util.List;
 
 @Service
 @RequiredArgsConstructor
 public class BusinessApprovalService {
     private final SalesLedgerMapper salesLedgerMapper;
     private final InfoMapper infoMapper;
-    private final PlanMapper planMapper;
-    private final PlanNodeMapper planNodeMapper;
 
     @Transactional(rollbackFor = Exception.class)
     public void submit(Long id) {
@@ -74,18 +65,6 @@
     }
 
     private Long createProject(SalesLedger ledger, Long selectedPlanId) {
-        Plan plan = selectedPlanId == null ? planMapper.selectOne(new LambdaQueryWrapper<Plan>()
-                .eq(Plan::getName, "椤圭洰鐢虫姤鍏樁娈�")
-                .eq(Plan::getIsDelete, 0).last("limit 1")) : planMapper.selectById(selectedPlanId);
-        if (plan == null) {
-            throw new ServiceException("鏈壘鍒扳�滈」鐩敵鎶ュ叚闃舵鈥濊鍒掞紝璇峰厛鎵ц鍗囩骇SQL");
-        }
-        List<PlanNode> nodes = planNodeMapper.selectList(new LambdaQueryWrapper<PlanNode>()
-                .eq(PlanNode::getProjectManagementPlanId, plan.getId())
-                .eq(PlanNode::getIsDelete, 0).orderByAsc(PlanNode::getSort));
-        if (nodes.isEmpty()) {
-            throw new ServiceException("椤圭洰鍏樁娈靛皻鏈厤缃�");
-        }
         Info info = new Info();
         info.setNo("XM" + LocalDate.now().format(DateTimeFormatter.BASIC_ISO_DATE)
                 + String.format("%06d", ledger.getId()));
@@ -94,22 +73,16 @@
         info.setClientId(ledger.getCustomerId());
         info.setClientName(ledger.getCustomerName());
         info.setEstablishTime(LocalDate.now());
-        info.setProjectManagementPlanId(plan.getId());
-        info.setSource("涓氬姟瀹℃壒");
-        info.setManagerId(SecurityUtils.getUserId());
-        info.setManagerName(SecurityUtils.getLoginUser().getNickName());
+        info.setSource("涓氬姟鐢熸垚");
+        info.setSourceBusinessId(ledger.getId());
+        info.setCurrentPhase("鏈紑濮�");
         info.setSalesmanName(ledger.getSalesman());
         info.setIsDelete(0);
-        info.setPlanStartTime(LocalDate.now());
         info.setReviewStatus(ReviewStatusEnum.APPROVED.getCode());
         info.setStatus(PlanStageEnum.TO_BEGIN.getCode());
-        info.setOrderDate(ledger.getExecutionDate());
-        info.setOrderAmount(ledger.getContractAmount() == null ? null : ledger.getContractAmount().toPlainString());
         info.setRemark(ledger.getRemarks());
         info.setAttachment(ledger.getAttachmentMaterials());
         info.setDeptId(ledger.getDeptId());
-        info.setPlanStage(nodes.stream().map(node -> new PlanStageDto(node.getId(), node.getName(),
-                PlanStageEnum.TO_BEGIN, node.getSort(), node.getEstimatedDuration())).toList());
         infoMapper.insert(info);
         return info.getId();
     }

--
Gitblit v1.9.3