From 2330e34c1d0f8a3c58a729eaee8e9987f612d83d Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 12 十二月 2024 10:51:27 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java b/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
index 21740bb..afe0041 100644
--- a/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
+++ b/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
@@ -24,6 +24,7 @@
 import com.ycl.domain.entity.*;
 import com.ycl.domain.excel.ProjectExcelTemplate;
 import com.ycl.domain.form.DocumentInfoForm;
+import com.ycl.domain.form.PlanForm;
 import com.ycl.domain.form.ProjectInfoForm;
 import com.ycl.domain.query.ProjectExportQuery;
 import com.ycl.domain.query.ProjectInfoQuery;
@@ -70,6 +71,7 @@
     private final ProjectUnitRegistrationInfoMapper unitRegistrationInfoMapper;
     private final FileService fileService;
     private final FileMapper fileMapper;
+    private final PlanMapper planMapper;
 
     /**
      * 娣诲姞
@@ -86,6 +88,7 @@
         entity.setCreateBy(userId);
         entity.setUpdateBy(userId);
         baseMapper.insert(entity);
+        addPlan(entity.getId()); //娣诲姞璁″垝琛�
         //娣诲姞鏂囦欢
         List<File> fileList = form.getFileList();
         fileList.forEach(item -> {
@@ -94,6 +97,17 @@
         });
         fileService.saveBatch(fileList);
         return Result.ok("娣诲姞鎴愬姛").data(entity.getId());
+    }
+
+    public void addPlan(Long projectInfoId) {
+        Plan plan = new Plan();
+        plan.setProjectInfoId(projectInfoId);
+        plan.setReportStatus(1);
+        plan.setMonthStatus(1);
+        plan.setSeasonStatus(1);
+        plan.setYearStatus(1);
+        plan.setDeleted(0);
+        planMapper.insert(plan);
     }
 
     /**
@@ -390,6 +404,9 @@
         ProjectInfo projectInfo = baseMapper.selectById(recordId);
         // 鍒ゆ柇褰撳墠鐢ㄦ埛id鏄惁鍦ㄤ富绠″垪琛ㄤ腑
         String competentDepartment = projectInfo.getCompetentDepartment();
+        if (StringUtils.isEmpty(competentDepartment)){
+            return Result.ok().data(false);
+        }
         List<String> list = Arrays.asList(competentDepartment.split(","));
         // 鑾峰緱褰撳墠鐢ㄦ埛id
         Long userId = SecurityUtils.getUserId();

--
Gitblit v1.8.0