From 992dab5bd400ea6d63003a283f4b1ecec6835acd Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 25 Jul 2023 16:38:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=97=E6=AE=B5=E5=AF=B9?= =?UTF-8?q?=E6=AF=94=20=E5=92=8C=20=E5=BD=93=E6=97=B6=E7=9A=84=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/common/compare/CompareUtils.java | 4 +-- .../pmapi/projectlib/manage/ProjectLibManage.java | 32 +--------------------- .../pmapi/todocenter/manage/TodoCenterManage.java | 5 +++- .../pmapi/todocenter/service/ITodoService.java | 2 ++ .../todocenter/service/impl/TodoServiceImpl.java | 2 +- 5 files changed, 10 insertions(+), 35 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/compare/CompareUtils.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/compare/CompareUtils.java index baef813..cfafd5c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/compare/CompareUtils.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/compare/CompareUtils.java @@ -142,8 +142,8 @@ public class CompareUtils { if (!sv.equals(tv)) { JSONObject valueChange = new JSONObject(); valueChange.put("fieldKey",sn.getFieldKey()); - valueChange.put("old",sv); - valueChange.put("new",tv); + valueChange.put("old",tv); + valueChange.put("new",sv); res.put(sn.getFieldName(),valueChange); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 52bf8a9..8b2e9d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -1128,36 +1128,6 @@ public class ProjectLibManage { } /** - * 判断 当前项目是不是被驳回 或者 退回过 - * @param projectId - * @return - */ - public Boolean isChangeRecord(Long projectId) { - //1.先判断下 项目存不存在 - Project project = projectService.getById(projectId); - if(Objects.isNull(project)){ - return Boolean.FALSE; - } - - List projectIds = projectService.getAllVersionProjectId(project); - //2.要判断 项目在当前状态 有没有被驳回和退回过 - //当前项目状态流程的 实例 看看是不是有2个以上 有2个说明 有退回 驳回 - List pis = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) - .in(ProjectInst::getProjectId, projectIds) - .orderByDesc(ProjectInst::getInstType) - .last("limit 2")); - if(CollUtil.isEmpty(pis)){ - return Boolean.FALSE; - } - if( pis.size() < 2 || - !pis.get(0).getInstType().equals(pis.get(1).getInstType())) { - return Boolean.FALSE; - } - - return Boolean.TRUE; - } - - /** * 查看 项目的 变更记录(驳回 重新发起的 和上个版本的变更字段) * @param projectId * @return @@ -1172,7 +1142,7 @@ public class ProjectLibManage { //2.要判断 项目在当前状态 有没有被驳回和退回过 //当前项目状态流程的 实例 看看是不是有2个以上 有2个说明 有退回 驳回 - Boolean isChangeRecord = isChangeRecord(projectId); + Boolean isChangeRecord = todoService.isChangeRecord(projectId); if(!isChangeRecord){ return res; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index 8ba8ec0..7505ca2 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -25,6 +25,7 @@ import com.ningdatech.pmapi.todocenter.handle.WithDrawHandle; import com.ningdatech.pmapi.todocenter.model.dto.*; import com.ningdatech.pmapi.todocenter.model.vo.*; import com.ningdatech.pmapi.todocenter.model.vo.TodoNumVO; +import com.ningdatech.pmapi.todocenter.service.ITodoService; import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; import com.wflow.contants.HisProInsEndActId; import com.wflow.workflow.bean.dto.ReqAuditOpinionSaveDTO; @@ -137,6 +138,8 @@ public class TodoCenterManage { private final RepositoryService repositoryService; private final IRegionService regionService; + private final ITodoService todoService; + /** * 待办中心待我处理项目列表查询 * @@ -564,7 +567,7 @@ public class TodoCenterManage { res.setIsHighLine(isHighLine); passHandle.checkCanPassOrSeal(request.getInstanceId(),request.getTaskId(),employeeCode,res); //是不是被 驳回|退回 - res.setIsChange(projectLibManage.isChangeRecord(projectId)); + res.setIsChange(todoService.isChangeRecord(projectId)); return res; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/service/ITodoService.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/service/ITodoService.java index 5c8c530..0ad5270 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/service/ITodoService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/service/ITodoService.java @@ -16,4 +16,6 @@ public interface ITodoService { * @return */ ProcessProgressDetailVo getProcessDetail(ProcessDetailReq request) ; + + Boolean isChangeRecord(Long projectId) ; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/service/impl/TodoServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/service/impl/TodoServiceImpl.java index e5a0490..64b3317 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/service/impl/TodoServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/service/impl/TodoServiceImpl.java @@ -137,7 +137,7 @@ public class TodoServiceImpl implements ITodoService { * @param projectId * @return */ - private Boolean isChangeRecord(Long projectId) { + public Boolean isChangeRecord(Long projectId) { //1.先判断下 项目存不存在 Project project = projectService.getById(projectId); if(Objects.isNull(project)){