From a22c582a4867ee5a3f27e89da7d20fa52008b32c Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期三, 26 二月 2025 10:19:39 +0800
Subject: [PATCH] 前置任务节点查出来未走的节点bug
---
business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java | 81 ++++++++++++++++++++++------------------
1 files changed, 45 insertions(+), 36 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 b8c5db5..65c029b 100644
--- a/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
+++ b/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
@@ -10,6 +10,7 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycl.common.base.Result;
@@ -17,6 +18,7 @@
import com.ycl.common.constant.Constants;
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;
@@ -153,21 +155,18 @@
public boolean checkProjectNameAndIdIsUnique(ProjectInfo entity,Long updateId){
QueryWrapper<ProjectInfo> queryWrapper = new QueryWrapper<ProjectInfo>();
if (updateId == null) {
-
- queryWrapper.eq("project_name", entity.getProjectName());
- queryWrapper.eq("deleted",0);
- if (StringUtils.isNotEmpty(entity.getProjectCode())) {
- queryWrapper.eq("project_code", entity.getProjectCode());
- }
-
- List<ProjectInfo> project = projectInfoMapper.selectList(queryWrapper);
-
- return project == null || project.isEmpty();
- }else {
-
- List<ProjectInfo> project = projectInfoMapper.checkProjectNameAndIdIsUnique(updateId,entity.getProjectName(),entity.getProjectCode());
-
- return project == null || project.isEmpty();
+ List<ProjectInfo> list = new LambdaQueryChainWrapper<>(baseMapper)
+ .eq(ProjectInfo::getProjectName, entity.getProjectName())
+ .eq(ProjectInfo::getProjectCode, entity.getProjectCode())
+ .list();
+ return list == null || list.isEmpty();
+ } else {
+ List<ProjectInfo> list = new LambdaQueryChainWrapper<>(baseMapper)
+ .eq(ProjectInfo::getProjectName, entity.getProjectName())
+ .eq(ProjectInfo::getProjectCode, entity.getProjectCode())
+ .ne(ProjectInfo::getId, updateId)
+ .list();
+ return list == null || list.isEmpty();
}
}
@@ -324,8 +323,11 @@
if (query.getProjectEndTime() != null) {
query.setProjectEndTime(DateUtils.getDayEnd(query.getProjectEndTime()));
}
+ if (YesOrNo.YES.getCode().equals(query.getCenter())) {
+ query.setProjectPhase("6");
+ }
// 寮傚父椤圭洰鏆傛椂杩斿洖绌�
- if (ProjectCategoryEnum.EXCEPTION.getType().equals(query.getProjectPhase())) {
+ if (YesOrNo.YES.getCode().equals(query.getExe())) {
return Result.ok().data(new ArrayList<>()).total(0);
}
Long userId = SecurityUtils.getUserId();
@@ -353,10 +355,10 @@
ProjectInfoVO.transform(vo);
ProjectVO projectVO = new ProjectVO();
copyToProjectVO(vo, projectVO);
- List<Long> departmentList = vo.getCompetentDepartmentList();
- projectVO.setAuditRole(SecurityUtils.isAdmin(SecurityUtils.getUserId()) || (!CollectionUtils.isEmpty(departmentList) && departmentList.contains(SecurityUtils.getDeptId())));
+ String competentDepartment = vo.getCompetentDepartment();
+ projectVO.setAuditRole(SecurityUtils.isAdmin(SecurityUtils.getUserId()) || (StringUtils.isNotEmpty(competentDepartment) && competentDepartment.equals(SecurityUtils.getDeptId())));
// 缈昏瘧椤圭洰闃舵
- String phase = ProjectCategoryEnum.getPhaseByProjectStatus(projectVO.getProjectStatus(), projectVO.getProcessId() != null);
+ String phase = ProjectCategoryEnum.getPhaseByProjectStatus(projectVO.getProjectPhase());
projectVO.setProjectPhase(phase);
if (StringUtils.isNotEmpty(projectVO.getProjectSubType())) {
// 缈昏瘧椤圭洰瀛愮被鍨�
@@ -394,8 +396,8 @@
ProjectInfo entity = baseMapper.getById(id);
Assert.notNull(entity, "璁板綍涓嶅瓨鍦�");
ProjectInfoVO vo = ProjectInfoVO.getVoByEntity(entity, null);
- List<Long> departmentList = vo.getCompetentDepartmentList();
- vo.setAuditRole(SecurityUtils.isAdmin(SecurityUtils.getUserId()) || (!CollectionUtils.isEmpty(departmentList) && departmentList.contains(SecurityUtils.getDeptId())));
+ String competentDepartment = vo.getCompetentDepartment();
+ vo.setAuditRole(SecurityUtils.isAdmin(SecurityUtils.getUserId()) || (StringUtils.isNotEmpty(competentDepartment) && competentDepartment.equals(SecurityUtils.getDeptId())));
QueryWrapper<File> fileQueryWrapper = new QueryWrapper<>();
fileQueryWrapper.eq("type", FileTypeEnum.PROJECT_INFO.getType());
fileQueryWrapper.eq("bus_id", vo.getId());
@@ -455,25 +457,32 @@
List<ProjectVO> city = new ArrayList<>();
List<ProjectVO> county = new ArrayList<>();
projectVOS.forEach(item -> {
- if (ProjectCategoryEnum.RESERVE.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectStatus(), item.getProcessId() != null))) {
+ if (ProjectCategoryEnum.RESERVE.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectPhase()))) {
reserve.add(item);
- } else if (ProjectCategoryEnum.PREVIOUS.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectStatus(), item.getProcessId() != null))) {
+ } else if (ProjectCategoryEnum.PREVIOUS.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectPhase()))) {
previous.add(item);
- } else if (ProjectCategoryEnum.IMPLEMENT.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectStatus(), item.getProcessId() != null))) {
+ } else if (ProjectCategoryEnum.IMPLEMENT.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectPhase()))) {
implement.add(item);
- } else if (ProjectCategoryEnum.FINISH.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectStatus(), item.getProcessId() != null))) {
+ } else if (ProjectCategoryEnum.FINISH.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectPhase()))) {
finish.add(item);
}
- if (ImportanceTypeEnum.PROVINCIAL_KEY.getType().equals(item.getImportanceType())) {
- province.add(item);
- } else if (ImportanceTypeEnum.SUINING_KEY.getType().equals(item.getImportanceType())) {
- city.add(item);
- } else if (ImportanceTypeEnum.SHEHONG_KEY.getType().equals(item.getImportanceType())) {
- county.add(item);
- } else // if (ImportanceTypeEnum.NORMAL.getType().equals(item.getImportanceType()))
- {
+ if (StringUtils.isBlank(item.getImportanceType())) {
normal.add(item);
+ // 浣跨敤contains锛屽洜涓洪噸鐐瑰垎绫诲彲澶氶�夛紝浣跨敤,鍒嗗壊瀛樺偍鐨�
+ } else {
+ if (item.getImportanceType().contains(ImportanceTypeEnum.PROVINCIAL_KEY.getType())) {
+ province.add(item);
+ }
+ if (item.getImportanceType().contains(ImportanceTypeEnum.SUINING_KEY.getType())) {
+ city.add(item);
+ }
+ if (item.getImportanceType().contains(ImportanceTypeEnum.SHEHONG_KEY.getType())) {
+ county.add(item);
+ }
+ if (item.getImportanceType().contains(ImportanceTypeEnum.NORMAL.getType())) {
+ normal.add(item);
+ }
}
});
//鍗曚綅鍏堥粯璁や负鍏�
@@ -586,7 +595,7 @@
ProjectExcelTemplate excel = new ProjectExcelTemplate();
BeanUtils.copyProperties(item, excel);
//椤圭洰闃舵
- excel.setProjectPhase(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectStatus(), item.getProcessId() != null));
+ excel.setProjectPhase(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectPhase()));
excelList.add(excel);
});
Set<Integer> indexes = OutputExcelUtils.getSelectFields(query.getFieldList(), ProjectExcelTemplate.class);
@@ -817,7 +826,7 @@
entity.setCreateBy(userId);
entity.setUpdateBy(userId);
//濡傛灉鏄偍澶囬」鐩�(鏈紑宸ラ」鐩�)涓嶉渶瑕佸鏍�
- if ("0".equals(entity.getProjectPhase())) {
+ if (ProjectCategoryEnum.RESERVE.getType().equals(entity.getProjectPhase())) {
entity.setUsedStatus(ProjectConstant.PASS);
}
// 绠$悊鍛樹慨鏀圭殑鐩存帴閫氳繃
@@ -862,7 +871,7 @@
Long userId = SecurityUtils.getUserId();
entity.setUpdateBy(userId);
//濡傛灉鏄偍澶囬」鐩�(鏈紑宸ラ」鐩�)涓嶉渶瑕佸鏍�
- if (ProjectConstant.COMMIT.equals(entity.getUsedStatus()) && ProjectStatusEnum.PENDDING.getType().equals(entity.getProjectStatus())) {
+ if (ProjectCategoryEnum.RESERVE.getType().equals(entity.getProjectPhase())) {
entity.setUsedStatus(ProjectConstant.PASS);
}
// 绠$悊鍛樹慨鏀圭殑鐩存帴閫氳繃
--
Gitblit v1.8.0