From 0c739bda5d471e3a96f2af2535e59f1f77fbde8c Mon Sep 17 00:00:00 2001 From: WendyYang Date: Thu, 9 Mar 2023 15:41:51 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/controller/AnnualPlanController.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java index 59e41af..907372c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java @@ -11,7 +11,6 @@ import com.ningdatech.pmapi.projectlib.model.req.StartProjectDeclareReq; import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import lombok.AllArgsConstructor; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -69,16 +68,17 @@ public class AnnualPlanController { annualPlanLibManage.importAnnualPlan(file); } - @GetMapping("/modify") + @PostMapping("/modify") @ApiOperation("年度计划编辑") @WebLog("年度计划编辑") public void modify(@RequestBody ProjectDTO req) { annualPlanLibManage.updateAnnualPlan(req); } + @PostMapping("/exportList") @ApiOperation("项目库【列表|编辑表】导出") - public void exportList(@Valid @RequestBody ProjectListReq param, HttpServletResponse response){ - annualPlanLibManage.exportList(param,response); + public void exportList(@Valid @RequestBody ProjectListReq param, HttpServletResponse response) { + annualPlanLibManage.exportList(param, response); } } From b5eec266e0c3480c184def43638f3c9da4118542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?niohe=C2=B7erbao?= Date: Thu, 9 Mar 2023 15:52:37 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E8=A1=A5=E5=85=85=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=95=B0=E6=8D=AE=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/common/helper/impl/RegionLimitHelperImpl.java | 2 +- .../com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/RegionLimitHelperImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/RegionLimitHelperImpl.java index e3a02fc..674b112 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/RegionLimitHelperImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/RegionLimitHelperImpl.java @@ -115,7 +115,7 @@ public class RegionLimitHelperImpl extends AbstractRegionLimitHelper { regionContainsBO.setParentRegionTreeLevel(expertAdminRegion.getRegionLevel()); regionContainsBOList.add(regionContainsBO); }*/ - return null; + return new ArrayList<>(); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java index 81ccb68..648a42c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java @@ -68,7 +68,7 @@ public class ExpertMetaApplyManage { private final IExpertMetaApplyService iMetaApplyService; private final IExpertDictionaryService expertDictionaryService; - // private final IExpertAdminManageService ExpertAdminManageService; +// private final IExpertAdminManageService ExpertAdminManageService; private final RegionCacheHelper regionCacheHelper; private final IExpertUserFullInfoService userFullInfoService; private final DictionaryCache dictionaryCache; @@ -89,7 +89,9 @@ public class ExpertMetaApplyManage { ExpertAdminExpertManageQueryCmd queryCmd = buildExpertAdminExpertManageQueryCmd(req, viewRegions); // TODO // List filterExpertUserIdList = expertAdminManageService.filterExpertUserIdList(queryCmd); - List filterExpertUserIdList = new ArrayList<>(); + List expertUserFullInfoList = userFullInfoService.list(); + // TODO 获取所有的专家审核列表 + List filterExpertUserIdList = expertUserFullInfoList.stream().map(ExpertUserFullInfo::getUserId).distinct().collect(Collectors.toList()); if (CollUtil.isEmpty(filterExpertUserIdList)) { return PageVo.empty(); } From 3ac55d2a8a539733c5bebfe0efc935da903fda79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?niohe=C2=B7erbao?= Date: Thu, 9 Mar 2023 16:47:03 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=B8=93=E5=AE=B6=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E8=8E=B7=E5=8F=96=E4=B8=93=E5=AE=B6=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/expert/controller/ExpertController.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java index 1bb6a08..cc55bd1 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java @@ -16,6 +16,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; +import javax.validation.constraints.NotNull; /** *

@@ -46,6 +47,13 @@ public class ExpertController { return expertManage.getExpertFullInfoDetail(null); } + + @GetMapping("/admin/detail") + @ApiOperation("专家管理员获取专家详细信息") + public ExpertFullInfoVO getExpertFullInfoDetail(@RequestParam(value = "expertUserId") @NotNull Long expertUserId) { + return expertManage.getExpertFullInfoDetail(expertUserId); + } + @PostMapping("/expert-library/list") @ApiOperation("专家库列表查询接口") public PageVo getExpertLibraryList( From c237b07aca6ba648e2fe7846e6d5aedc20e310f4 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 9 Mar 2023 16:55:29 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/todocenter/manage/TodoCenterManage.java | 59 ++++++---------------- .../pmapi/statemachine/StateMachineTest.java | 2 +- 2 files changed, 17 insertions(+), 44 deletions(-) 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 58e2f41..8c55664 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 @@ -8,6 +8,7 @@ import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.CollUtils; +import com.ningdatech.basic.util.NdDateUtils; import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.common.helper.UserInfoHelper; import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter; @@ -123,26 +124,12 @@ public class TodoCenterManage { } List instCodes = userTodoList.stream().map(ProcessTaskVo::getInstanceId).collect(Collectors.toList()); - List resList = new ArrayList<>(); - List instList = new ArrayList<>(); - for (ProcessTaskVo processTaskVo : userTodoList) { - Map map = resList.stream().collect(Collectors.toMap(ProcessTaskVo::getInstanceId, v -> v)); - if (instList.contains(processTaskVo.getInstanceId())){ - // 比较两个processTaskVo的endTime,保留最后处理的 - ProcessTaskVo vo = map.get(processTaskVo.getInstanceId()); - int compare = processTaskVo.getTaskEndTime().compareTo(vo.getTaskEndTime()); - if (compare > 0){ - instList.remove(processTaskVo.getInstanceId()); - resList.remove(vo); - }else { - continue; - } - } - instList.add(processTaskVo.getInstanceId()); - resList.add(processTaskVo); - } - - Map taskVoMap = resList.stream().collect(Collectors.toMap(ProcessTaskVo::getInstanceId, v -> v)); + Set processSet = Sets.newHashSet(); + Map taskMap = userTodoList.stream() + .sorted((t1,t2) -> t2.getTaskCreateTime().compareTo(t1.getTaskCreateTime())) + .collect(Collectors.toList()).stream() + .filter(v -> processSet.add(v.getInstanceId())) + .collect(Collectors.toMap(ProcessTaskVo::getInstanceId, v -> v)); //2.再分页查询项目信息 ProjectListReq projectListReq = new ProjectListReq(); @@ -158,7 +145,7 @@ public class TodoCenterManage { ResToBeProcessedVO res = new ResToBeProcessedVO(); BeanUtils.copyProperties(d, res); res.setProjectId(d.getId()); - ProcessTaskVo taskVo = taskVoMap.get(d.getInstCode()); + ProcessTaskVo taskVo = taskMap.get(d.getInstCode()); res.setNodeId(taskVo.getTaskDefKey()); res.setProcessStatusName(taskVo.getStatus()); res.setProcessLaunchTime(d.getCreateOn()); @@ -192,7 +179,6 @@ public class TodoCenterManage { projectListReq.setInstCodes(instCodes); BeanUtils.copyProperties(param, projectListReq); List projects = CollUtil.isEmpty(userTodoList) ? Collections.emptyList() : projectLibManage.projectList(projectListReq); - PageVo projectLibList = projectLibManage.projectLibList(projectListReq); ExcelExportWriter excelExportWriter = new ExcelExportWriter(); String fileName = null; @@ -644,26 +630,13 @@ public class TodoCenterManage { List instCodes = userIdoList.stream().map(ProcessTaskVo::getInstanceId).collect(Collectors.toList()); - List resList = new ArrayList<>(); - List instList = new ArrayList<>(); - for (ProcessTaskVo processTaskVo : userIdoList) { - Map map = resList.stream().collect(Collectors.toMap(ProcessTaskVo::getInstanceId, v -> v)); - if (instList.contains(processTaskVo.getInstanceId())){ - // 比较两个processTaskVo的endTime,保留最后处理的 - ProcessTaskVo vo = map.get(processTaskVo.getInstanceId()); - int compare = processTaskVo.getTaskEndTime().compareTo(vo.getTaskEndTime()); - if (compare > 0){ - instList.remove(processTaskVo.getInstanceId()); - resList.remove(vo); - }else { - continue; - } - } - instList.add(processTaskVo.getInstanceId()); - resList.add(processTaskVo); - } + Set processSet = Sets.newHashSet(); + Map taskMap = userIdoList.stream() + .sorted((t1,t2) -> t2.getTaskEndTime().compareTo(t1.getTaskEndTime())) + .collect(Collectors.toList()).stream() + .filter(v -> processSet.add(v.getInstanceId())) + .collect(Collectors.toMap(ProcessTaskVo::getInstanceId, v -> v)); - Map taskVoMap = resList.stream().collect(Collectors.toMap(ProcessTaskVo::getInstanceId, v -> v)); // 分页查询项目信息 ProjectListReq projectListReq = new ProjectListReq(); projectListReq.setInstCodes(instCodes); @@ -677,10 +650,10 @@ public class TodoCenterManage { ResToBeProcessedVO res = new ResToBeProcessedVO(); BeanUtils.copyProperties(d, res); res.setProjectId(d.getId()); - ProcessTaskVo taskVo = taskVoMap.get(d.getInstCode()); + ProcessTaskVo taskVo = taskMap.get(d.getInstCode()); res.setProcessStatusName(taskVo.getStatus()); res.setProcessLaunchTime(d.getCreateOn()); - res.setProcessHandleTime(d.getUpdateOn()); + res.setProcessHandleTime(NdDateUtils.date2LocalDateTime(taskVo.getTaskEndTime())); return res; }).collect(Collectors.toList()); return PageVo.of(resVos, projectPage.getTotal()); diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java b/pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java index d563236..63b8810 100644 --- a/pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java +++ b/pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java @@ -26,7 +26,7 @@ public class StateMachineTest extends AppTests { public void stateMachineTest() throws Exception { Project project = new Project(); project.setStage(ProjectStatusEnum.PROJECT_APPROVED.getCode()); - project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode()); + project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode()); project.setDeclareAmount(BigDecimal.valueOf(2000)); stateMachineUtils.execute(project, stateMachineUtils.getProjectStatusPassEvent(project.getStatus())); System.out.println(String.format("project:%s", JSON.toJSONString(project))); From 1d81fe9c1b18ffb7bb1255ec33641d72a702bd64 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Thu, 9 Mar 2023 17:08:26 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=94=B3=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java | 2 ++ .../test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java index e2db4ad..868599b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java @@ -127,6 +127,7 @@ public class AnnualPlanLibManage { throw new BizException("开启方案申报失败"); } }); + projectService.updateBatchById(projects); } @Transactional(rollbackFor = Exception.class) @@ -147,6 +148,7 @@ public class AnnualPlanLibManage { public void suspendAnnualPlan(ProjectIdReq req) throws Exception { Project project = projectService.getById(req.getProjectId()); stateMachine.execute(project, ProjectStatusChangeEvent.ANNUAL_PLAN_SUSPEND); + projectService.updateById(project); } @Transactional(rollbackFor = Exception.class) diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java b/pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java index 63b8810..4e6b197 100644 --- a/pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java +++ b/pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java @@ -3,10 +3,9 @@ package com.ningdatech.pmapi.statemachine; import com.alibaba.fastjson.JSON; import com.ningdatech.pmapi.AppTests; import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; -import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.model.entity.Project; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import java.math.BigDecimal;