From 0bb6071f92b2d26ae23c225bf4db8593a328a22f Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 10 四月 2025 13:48:57 +0800
Subject: [PATCH] 项目草稿bug
---
business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java | 34 ++++++++++++++++++++++------------
1 files changed, 22 insertions(+), 12 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 cde781f..9b1bdb3 100644
--- a/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
+++ b/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
@@ -20,10 +20,7 @@
import com.ycl.common.core.domain.BaseEntity;
import com.ycl.common.core.domain.entity.SysDictData;
import com.ycl.common.enums.YesOrNo;
-import com.ycl.common.enums.business.FileTypeEnum;
-import com.ycl.common.enums.business.ImportanceTypeEnum;
-import com.ycl.common.enums.business.ProjectCategoryEnum;
-import com.ycl.common.enums.business.ProjectStatusEnum;
+import com.ycl.common.enums.business.*;
import com.ycl.common.exception.base.BaseException;
import com.ycl.common.utils.CopyUtils;
import com.ycl.common.utils.DateUtils;
@@ -100,6 +97,7 @@
private final ProjectUnitRegistrationInfoServiceImpl projectUnitRegistrationInfoServiceImpl;
private final SysDeptMapper sysDeptMapper;
private final ISysDictDataService dictDataService;
+ private final ProcessLogService processLogService;
/**
@@ -547,6 +545,12 @@
public Map<String, Integer> countExceptionProject(IndexDTO indexDTO) {
Map<String, Integer> map = new HashMap<>();
map.put("processExceptionProject", 0);
+ // 鏌ヨ鍙戠敓杩囧缂虹殑椤圭洰鏁�
+ List<String> projectIds = new LambdaQueryChainWrapper<>(processLogService.getBaseMapper())
+ .select(ProcessLog::getProjectId)
+ .eq(ProcessLog::getEventType, ProcessLogEventTypeEnum.WAIT)
+ .list().stream().map(ProcessLog::getProjectId).distinct().collect(Collectors.toList());
+ map.put("hasWaitProjectNum", projectIds.size());
return map;
}
@@ -828,6 +832,12 @@
@Override
@Transactional(rollbackFor = Exception.class)
public Result editProject(ProjectForm form) {
+ // 鑽夌鐨勬儏鍐碉紝闇�瑕佸垽瀹氭湁娌℃湁閫変笟涓诲崟浣�(鍥犱负鑽夌涓嶆牎楠屽繀濉�)锛屾病閫夊垯榛樿璁剧疆涓哄綋鍓嶄汉鐨勫崟浣�
+ if (ProjectConstant.DRAFT.equals(form.getProjectInfoForm().getUsedStatus())) {
+ if (Objects.isNull(form.getProjectInfoForm().getProjectOwnerUnit())) {
+ form.getProjectInfoForm().setProjectOwnerUnit(SecurityUtils.getDeptId());
+ }
+ }
Long projectId = form.getProjectInfoForm().getId();
if (ObjectUtil.isNotNull(form.getProjectInfoForm())) {
if (ObjectUtil.isNull(form.getProjectInfoForm().getId())) {
@@ -836,12 +846,12 @@
Long userId = SecurityUtils.getUserId();
entity.setCreateBy(userId);
entity.setUpdateBy(userId);
- //濡傛灉鏄偍澶囬」鐩�(鏈紑宸ラ」鐩�)涓嶉渶瑕佸鏍�
- if (ProjectCategoryEnum.RESERVE.getType().equals(entity.getProjectPhase())) {
+ //濡傛灉鏄偍澶囬」鐩�(鏈紑宸ラ」鐩�)涓嶉渶瑕佸鏍革紙鑽夌闄ゅ锛�
+ if (ProjectCategoryEnum.RESERVE.getType().equals(entity.getProjectPhase()) && ! ProjectConstant.DRAFT.equals(entity.getUsedStatus())) {
entity.setUsedStatus(ProjectConstant.PASS);
}
- // 绠$悊鍛樹慨鏀圭殑鐩存帴閫氳繃
- if (SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
+ // 绠$悊鍛樹慨鏀圭殑鐩存帴閫氳繃(绠$悊鍛樹繚瀛樹负鑽夌锛岄偅涔堢姸鎬佽繕鏄崏绋�)
+ if (SecurityUtils.isAdmin(SecurityUtils.getUserId()) && ! ProjectConstant.DRAFT.equals(entity.getUsedStatus())) {
entity.setUsedStatus(ProjectConstant.PASS);
}
if(!checkProjectNameAndIdIsUnique(entity,null)){
@@ -881,12 +891,12 @@
ProjectInfoForm.getEntityByForm(form.getProjectInfoForm(), entity);
Long userId = SecurityUtils.getUserId();
entity.setUpdateBy(userId);
- //濡傛灉鏄偍澶囬」鐩�(鏈紑宸ラ」鐩�)涓嶉渶瑕佸鏍�
- if (ProjectCategoryEnum.RESERVE.getType().equals(entity.getProjectPhase())) {
+ //濡傛灉鏄偍澶囬」鐩�(鏈紑宸ラ」鐩�)涓嶉渶瑕佸鏍革紙鑽夌闄ゅ锛�
+ if (ProjectCategoryEnum.RESERVE.getType().equals(entity.getProjectPhase()) && ! ProjectConstant.DRAFT.equals(entity.getUsedStatus())) {
entity.setUsedStatus(ProjectConstant.PASS);
}
- // 绠$悊鍛樹慨鏀圭殑鐩存帴閫氳繃
- if (SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
+ // 绠$悊鍛樹慨鏀圭殑鐩存帴閫氳繃(绠$悊鍛樹繚瀛樹负鑽夌锛岄偅涔堢姸鎬佽繕鏄崏绋�)
+ if (SecurityUtils.isAdmin(SecurityUtils.getUserId()) && ! ProjectConstant.DRAFT.equals(entity.getUsedStatus())) {
entity.setUsedStatus(ProjectConstant.PASS);
}
if(!checkProjectNameAndIdIsUnique(entity, entity.getId())){
--
Gitblit v1.8.0