From 50c1c603191286283c99d077b1d16495659f01db Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Mon, 20 Mar 2023 17:41:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E5=8F=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/handler/GlobalResponseHandler.java | 3 +- .../manage/DefaultDeclaredProjectManage.java | 11 ++++- .../manage/ReviewByDeptJointManage.java | 4 -- .../mapper/DeclaredStatisticsMapper.java | 20 ++++++++ .../mapper/DeclaredStatisticsMapper.xml | 22 +++++++++ .../model/po/DeclaredProjectStatisticsPO.java | 40 +++++++++++++++ .../service/IDeclaredStatisticsService.java | 17 +++++++ .../impl/DeclaredStatisticsServiceImpl.java | 32 ++++++++++++ .../pmapi/sys/enumeration/NoticeTypeEnum.java | 40 +++++++++++++++ .../pmapi/todocenter/manage/TodoCenterManage.java | 14 ++++-- .../pmapi/todocenter/mapper/StatisticsMapper.java | 5 +- .../pmapi/todocenter/mapper/StatisticsMapper.xml | 21 +++++++- .../model/po/TodoCenterStatisticsPO.java | 27 ++++++++++ .../todocenter/service/StatisticsService.java | 6 ++- .../service/impl/StatisticsServiceImpl.java | 10 +++- .../workbench/converter/WorkbenchConverter.java | 43 ++++++++++++++++ .../pmapi/workbench/manage/WorkbenchManage.java | 57 ++++++++++++++++++++-- .../workbench/model/TodoCenterStatisticsPO.java | 16 ------ .../pmapi/workbench/model/vo/WorkbenchVO.java | 2 +- 19 files changed, 351 insertions(+), 39 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/DeclaredStatisticsMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/DeclaredStatisticsMapper.xml create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/po/DeclaredProjectStatisticsPO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IDeclaredStatisticsService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/DeclaredStatisticsServiceImpl.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/enumeration/NoticeTypeEnum.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/po/TodoCenterStatisticsPO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/workbench/converter/WorkbenchConverter.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/workbench/model/TodoCenterStatisticsPO.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java index 8c757c2..d21c29b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java @@ -25,7 +25,8 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; "com.ningdatech.pmapi.user.controller", "com.ningdatech.pmapi.meeting.controller", "com.ningdatech.pmapi.expert.controller", - "com.ningdatech.pmapi.sms.controller" + "com.ningdatech.pmapi.sms.controller", + "com.ningdatech.pmapi.workbench.controller" }) public class GlobalResponseHandler implements ResponseBodyAdvice { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java index b225a2b..8badd65 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java @@ -6,10 +6,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.basic.function.VUtils; import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; import com.ningdatech.pmapi.common.helper.UserInfoHelper; -import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; import com.ningdatech.pmapi.organization.model.entity.DingOrganization; import com.ningdatech.pmapi.organization.service.IDingOrganizationService; import com.ningdatech.pmapi.projectdeclared.model.dto.ProjectConditionDTO; +import com.ningdatech.pmapi.projectdeclared.model.po.DeclaredProjectStatisticsPO; +import com.ningdatech.pmapi.projectdeclared.service.IDeclaredStatisticsService; import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; @@ -64,7 +65,7 @@ public class DefaultDeclaredProjectManage { private final IProjectInstService projectInstService; - private final StateMachineUtils stateMachineUtils; + private final IDeclaredStatisticsService statisticsService; //项目名称去重 public void checkDuplication(ProjectDTO project){ @@ -232,4 +233,10 @@ public class DefaultDeclaredProjectManage { throw new BusinessException("提交预审 项目信息修改 错误 :" + e.getMessage()); } } + + public DeclaredProjectStatisticsPO declaredProjectStatistics(Integer year){ + UserInfoDetails userInfo = LoginUserUtil.loginUserDetail(); + //查此人建设单位的项目 + return statisticsService.getStatistics(userInfo.getOrganizationCode(),year); + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java index 2107c67..0f87662 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java @@ -6,19 +6,15 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.Maps; import com.ningdatech.basic.function.VUtils; import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; -import com.ningdatech.pmapi.common.helper.UserInfoHelper; import com.ningdatech.pmapi.projectdeclared.model.dto.ProjectConditionDTO; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; import com.ningdatech.pmapi.projectlib.service.IProjectInstService; import com.ningdatech.pmapi.projectlib.service.IProjectService; -import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; -import com.ningdatech.pmapi.user.util.LoginUserUtil; import com.wflow.bean.entity.WflowModels; import com.wflow.exception.BusinessException; import com.wflow.workflow.bean.dto.OrgInfoDTO; -import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; import com.wflow.workflow.bean.vo.ProcessStartParamsVo; import com.wflow.workflow.service.ProcessInstanceService; import com.wflow.workflow.service.ProcessModelService; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/DeclaredStatisticsMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/DeclaredStatisticsMapper.java new file mode 100644 index 0000000..8360f6b --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/DeclaredStatisticsMapper.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.projectdeclared.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ningdatech.pmapi.projectdeclared.model.entity.ProjectDraft; +import com.ningdatech.pmapi.projectdeclared.model.po.DeclaredProjectStatisticsPO; +import org.apache.ibatis.annotations.Param; + +/** + *

+ * Mapper 接口 + *

+ * + * @author zpf + * @since 2023-02-05 + */ +public interface DeclaredStatisticsMapper extends BaseMapper { + + DeclaredProjectStatisticsPO getStatistics(@Param("orgCode") String orgCode,@Param("year") Integer year); + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/DeclaredStatisticsMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/DeclaredStatisticsMapper.xml new file mode 100644 index 0000000..846791f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/DeclaredStatisticsMapper.xml @@ -0,0 +1,22 @@ + + + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/po/DeclaredProjectStatisticsPO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/po/DeclaredProjectStatisticsPO.java new file mode 100644 index 0000000..28dbfb8 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/po/DeclaredProjectStatisticsPO.java @@ -0,0 +1,40 @@ +package com.ningdatech.pmapi.projectdeclared.model.po; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * @Classname DeclaredProjectStatistics + * @Description + * @Date 2023/3/20 16:29 + * @Author PoffyZhang + */ +@Data +public class DeclaredProjectStatisticsPO { + + @ApiModelProperty("总项目数") + private Integer totalNum; + @ApiModelProperty("建设项目数") + private Integer buildNum; + @ApiModelProperty("运维项目数") + private Integer operationNum; + + @ApiModelProperty("待立项数") + private Integer notApprovedNum; + @ApiModelProperty("已立项数") + private Integer approvedNum; + @ApiModelProperty("建设中数") + private Integer constructionNum; + @ApiModelProperty("待验收数") + private Integer tobeInspectedNum; + @ApiModelProperty("已归档数") + private Integer archivedNum; + + @ApiModelProperty("申报总金额") + private BigDecimal declaredAmount; + @ApiModelProperty("立项总金额") + private BigDecimal approvalAmount; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IDeclaredStatisticsService.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IDeclaredStatisticsService.java new file mode 100644 index 0000000..107f75f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IDeclaredStatisticsService.java @@ -0,0 +1,17 @@ +package com.ningdatech.pmapi.projectdeclared.service; + +import com.ningdatech.pmapi.projectdeclared.model.po.DeclaredProjectStatisticsPO; + +/** + *

+ * 服务类 + *

+ * + * @author zpf + * @since 2023-02-05 + */ +public interface IDeclaredStatisticsService { + + DeclaredProjectStatisticsPO getStatistics(String orgCode,Integer year); + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/DeclaredStatisticsServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/DeclaredStatisticsServiceImpl.java new file mode 100644 index 0000000..3fbbdd4 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/DeclaredStatisticsServiceImpl.java @@ -0,0 +1,32 @@ +package com.ningdatech.pmapi.projectdeclared.service.impl; + +import com.ningdatech.pmapi.projectdeclared.mapper.DeclaredStatisticsMapper; +import com.ningdatech.pmapi.projectdeclared.model.po.DeclaredProjectStatisticsPO; +import com.ningdatech.pmapi.projectdeclared.service.IDeclaredStatisticsService; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author zpf + * @since 2023-02-05 + */ +@Service +@AllArgsConstructor +public class DeclaredStatisticsServiceImpl implements IDeclaredStatisticsService { + + private final DeclaredStatisticsMapper declaredStatisticsMapper; + + /** + * 根据userId 去查询 申报项目统计 + * @param orgCode + * @return + */ + @Override + public DeclaredProjectStatisticsPO getStatistics(String orgCode,Integer year) { + return declaredStatisticsMapper.getStatistics(orgCode,year); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/enumeration/NoticeTypeEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/enumeration/NoticeTypeEnum.java new file mode 100644 index 0000000..51c7206 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/enumeration/NoticeTypeEnum.java @@ -0,0 +1,40 @@ +package com.ningdatech.pmapi.sys.enumeration; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.StringUtils; + +import java.util.Objects; + +/** + * + * 公告类型枚举 + * @author ZPF + * @since 2023/02/24 16:14 + */ +@Getter +@NoArgsConstructor +@AllArgsConstructor +public enum NoticeTypeEnum { + /** + * 公告类型枚举 + */ + ANNOUNCEMENT(1, "公告"), + HELP_DOCUMENTS(2, "帮助文档"); + + private Integer code; + private String desc; + + public static String getDescByCode(Integer code) { + if (Objects.isNull(code)) { + return StringUtils.EMPTY; + } + for (NoticeTypeEnum t : NoticeTypeEnum.values()) { + if (code.equals(t.getCode())) { + return t.desc; + } + } + return StringUtils.EMPTY; + } +} 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 b89fe6f..6179e2d 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 @@ -1,5 +1,6 @@ package com.ningdatech.pmapi.todocenter.manage; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.codec.Base64; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; @@ -49,6 +50,7 @@ import com.ningdatech.pmapi.todocenter.model.dto.AdjustHandleDTO; import com.ningdatech.pmapi.todocenter.model.dto.PdfGenerateDTO; import com.ningdatech.pmapi.todocenter.model.dto.SealInfoDTO; import com.ningdatech.pmapi.todocenter.model.dto.SignReqDTO; +import com.ningdatech.pmapi.todocenter.model.po.TodoCenterStatisticsPO; import com.ningdatech.pmapi.todocenter.model.vo.ProcessProgressDetailVo; import com.ningdatech.pmapi.todocenter.enumeration.IsAppendProjectEnum; import com.ningdatech.pmapi.todocenter.model.req.ProcessDetailReq; @@ -92,7 +94,6 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.InputStream; import java.math.BigDecimal; -import java.net.URL; import java.time.LocalDateTime; import java.util.*; import java.util.stream.Collectors; @@ -128,6 +129,8 @@ public class TodoCenterManage { private final FileService fileService; private final ICompanySignatureService companySignatureService; + private final StatisticsService statisticsService; + /** * 待办中心待我处理项目列表查询 @@ -1148,12 +1151,13 @@ public class TodoCenterManage { } //获取当前登录人的 待办中心统计数据 - public TodoCenterStatisticsVO todoCenterStatistics(Integer year){ - TodoCenterStatisticsVO resVo = new TodoCenterStatisticsVO(); + public TodoCenterStatisticsVO todoCenterStatistics(){ + Long userId = LoginUserUtil.getUserId(); //为了查询效率 还是自己去写统计接口 -// statisticsService. + TodoCenterStatisticsPO statistics = statisticsService.getStatistics(userId); + TodoCenterStatisticsVO statisticsVO = BeanUtil.copyProperties(statistics,TodoCenterStatisticsVO.class); - return resVo; + return statisticsVO; } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/mapper/StatisticsMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/mapper/StatisticsMapper.java index 178e028..0336c63 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/mapper/StatisticsMapper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/mapper/StatisticsMapper.java @@ -1,10 +1,11 @@ package com.ningdatech.pmapi.todocenter.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.wflow.bean.entity.WflowDepartments; +import com.ningdatech.pmapi.todocenter.model.po.TodoCenterStatisticsPO; +import org.apache.ibatis.annotations.Param; public interface StatisticsMapper extends BaseMapper { - + TodoCenterStatisticsPO getStatistics(@Param("userId") Long userId); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/mapper/StatisticsMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/mapper/StatisticsMapper.xml index 64c8506..56e4cdd 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/mapper/StatisticsMapper.xml +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/mapper/StatisticsMapper.xml @@ -1,5 +1,24 @@ - + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/po/TodoCenterStatisticsPO.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/po/TodoCenterStatisticsPO.java new file mode 100644 index 0000000..ab9bfdf --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/po/TodoCenterStatisticsPO.java @@ -0,0 +1,27 @@ +package com.ningdatech.pmapi.todocenter.model.po; + +import com.ningdatech.pmapi.todocenter.model.vo.TodoVO; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @Classname TodoCenterStatisticsPO + * @Description + * @Date 2023/3/20 11:51 + * @Author PoffyZhang + */ +@Data +public class TodoCenterStatisticsPO { + + @ApiModelProperty("待处理数") + private Integer todoNum; + @ApiModelProperty("已处理数") + private Integer idoNum; + @ApiModelProperty("我发起数") + private Integer mysubmitNum; + @ApiModelProperty("抄送我数") + private Integer ccmeNum; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/service/StatisticsService.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/service/StatisticsService.java index 3d1cd5f..2b1bd7e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/service/StatisticsService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/service/StatisticsService.java @@ -1,5 +1,7 @@ package com.ningdatech.pmapi.todocenter.service; +import com.ningdatech.pmapi.todocenter.model.po.TodoCenterStatisticsPO; + /** * @Classname StatisticsService * @Description @@ -8,6 +10,6 @@ package com.ningdatech.pmapi.todocenter.service; */ public interface StatisticsService { - - + //根据用户id 去查询 一些统计数据 + TodoCenterStatisticsPO getStatistics(Long userId); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/service/impl/StatisticsServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/service/impl/StatisticsServiceImpl.java index b2ff8cc..3c77943 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/service/impl/StatisticsServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/service/impl/StatisticsServiceImpl.java @@ -1,6 +1,9 @@ package com.ningdatech.pmapi.todocenter.service.impl; +import com.ningdatech.pmapi.todocenter.mapper.StatisticsMapper; +import com.ningdatech.pmapi.todocenter.model.po.TodoCenterStatisticsPO; import com.ningdatech.pmapi.todocenter.service.StatisticsService; +import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; /** @@ -10,8 +13,13 @@ import org.springframework.stereotype.Service; * @Author PoffyZhang */ @Service +@AllArgsConstructor public class StatisticsServiceImpl implements StatisticsService { - + private final StatisticsMapper mapper; + @Override + public TodoCenterStatisticsPO getStatistics(Long userId) { + return mapper.getStatistics(userId); + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/workbench/converter/WorkbenchConverter.java b/pmapi/src/main/java/com/ningdatech/pmapi/workbench/converter/WorkbenchConverter.java new file mode 100644 index 0000000..f413173 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/workbench/converter/WorkbenchConverter.java @@ -0,0 +1,43 @@ +package com.ningdatech.pmapi.workbench.converter; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.pmapi.projectdeclared.model.po.DeclaredProjectStatisticsPO; +import com.ningdatech.pmapi.sys.model.vo.NoticeListItemVO; +import com.ningdatech.pmapi.todocenter.model.vo.ResToBeProcessedVO; +import com.ningdatech.pmapi.todocenter.model.vo.TodoVO; +import com.ningdatech.pmapi.workbench.model.vo.WorkbenchVO; + +import java.util.Collections; +import java.util.List; + +/** + * @Classname WorkbenchConverter + * @Description + * @Date 2023/3/20 17:23 + * @Author PoffyZhang + */ +public class WorkbenchConverter { + + + public static List converts(List vos) { + if(CollUtil.isNotEmpty(vos)){ + + } + return Collections.emptyList(); + } + + public static WorkbenchVO.DeclaredStatistics convert(DeclaredProjectStatisticsPO po) { + WorkbenchVO.DeclaredStatistics res = BeanUtil.copyProperties(po,WorkbenchVO.DeclaredStatistics.class); + return res; + } + + public static TodoVO convert(ResToBeProcessedVO vo) { + TodoVO res = new TodoVO(); + res.setNodeId(vo.getNodeId()); + res.setProjectId(vo.getProjectId()); + res.setProjectName(vo.getProjectName()); + return res; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java index 88d40de..d6d8629 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java @@ -1,10 +1,30 @@ package com.ningdatech.pmapi.workbench.manage; +import cn.hutool.core.bean.BeanUtil; +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.pmapi.projectdeclared.manage.DeclaredProjectManage; +import com.ningdatech.pmapi.projectdeclared.manage.DefaultDeclaredProjectManage; +import com.ningdatech.pmapi.projectdeclared.model.po.DeclaredProjectStatisticsPO; +import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; +import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; +import com.ningdatech.pmapi.sys.enumeration.NoticeTypeEnum; +import com.ningdatech.pmapi.sys.manage.NoticeManage; +import com.ningdatech.pmapi.sys.model.req.NoticeListReq; +import com.ningdatech.pmapi.sys.model.vo.NoticeListItemVO; import com.ningdatech.pmapi.todocenter.manage.TodoCenterManage; +import com.ningdatech.pmapi.todocenter.model.req.ToBeProcessedReq; +import com.ningdatech.pmapi.todocenter.model.vo.ResToBeProcessedVO; +import com.ningdatech.pmapi.todocenter.model.vo.TodoCenterStatisticsVO; +import com.ningdatech.pmapi.todocenter.model.vo.TodoVO; +import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; +import com.ningdatech.pmapi.user.util.LoginUserUtil; +import com.ningdatech.pmapi.workbench.converter.WorkbenchConverter; import com.ningdatech.pmapi.workbench.model.vo.WorkbenchVO; import lombok.AllArgsConstructor; import org.springframework.stereotype.Component; +import java.util.stream.Collectors; + /** * @Classname WorkbenchManage * @Description @@ -15,13 +35,42 @@ import org.springframework.stereotype.Component; @AllArgsConstructor public class WorkbenchManage { - private TodoCenterManage todoCenterManage; + private final TodoCenterManage todoCenterManage; + + private final DefaultDeclaredProjectManage defaultDeclaredProjectManage; + + private final DeclaredProjectManage declaredProjectManage; + + private final NoticeManage noticeManage; public WorkbenchVO getWorkbenchData(Integer year){ + UserInfoDetails userInfo = LoginUserUtil.loginUserDetail(); + WorkbenchVO res = new WorkbenchVO(); + //1.待办中心数据 - todoCenterManage.todoCenterStatistics(year); + TodoCenterStatisticsVO statisticsVO = todoCenterManage.todoCenterStatistics(); + ToBeProcessedReq toBeProcessedReq = new ToBeProcessedReq(); + toBeProcessedReq.setPageNumber(1); + toBeProcessedReq.setPageSize(5); + statisticsVO.setTodoList(todoCenterManage.todoProjectList(toBeProcessedReq).getRecords() + .stream().map(v -> WorkbenchConverter.convert(v)).collect(Collectors.toList())); + res.setTodoCerter(statisticsVO); - return null; - } + //2.项目统计数据 + res.setOrgDeclared(WorkbenchConverter.convert(defaultDeclaredProjectManage.declaredProjectStatistics(year))); + ProjectListReq projectListReq = new ProjectListReq(); + projectListReq.setPageNumber(1); + projectListReq.setPageSize(5); + projectListReq.setProjectYear(year); + res.setProjects(declaredProjectManage.projectLibList(projectListReq).getRecords().stream().collect(Collectors.toList())); + //3.政策文件 + NoticeListReq noticeListReq = new NoticeListReq(); + noticeListReq.setType(NoticeTypeEnum.HELP_DOCUMENTS.getCode()); + noticeListReq.setPageNumber(1); + noticeListReq.setPageSize(5); + res.setNoticeList(noticeManage.listByManager(noticeListReq).getRecords().stream().collect(Collectors.toList())); + + return res; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/workbench/model/TodoCenterStatisticsPO.java b/pmapi/src/main/java/com/ningdatech/pmapi/workbench/model/TodoCenterStatisticsPO.java deleted file mode 100644 index 6d5881a..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/workbench/model/TodoCenterStatisticsPO.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.ningdatech.pmapi.workbench.model; - -import lombok.Data; - -/** - * @Classname TodoCenterStatisticsPO - * @Description - * @Date 2023/3/20 11:51 - * @Author PoffyZhang - */ -@Data -public class TodoCenterStatisticsPO { - -// private - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/workbench/model/vo/WorkbenchVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/workbench/model/vo/WorkbenchVO.java index ffcc9e1..564f198 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/workbench/model/vo/WorkbenchVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/workbench/model/vo/WorkbenchVO.java @@ -32,7 +32,7 @@ public class WorkbenchVO implements Serializable { public List projects; @ApiModelProperty("公告列表") - public NoticeListItemVO noticeList; + public List noticeList; @Data public static class DeclaredStatistics {