@@ -25,7 +25,8 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; | |||||
"com.ningdatech.pmapi.user.controller", | "com.ningdatech.pmapi.user.controller", | ||||
"com.ningdatech.pmapi.meeting.controller", | "com.ningdatech.pmapi.meeting.controller", | ||||
"com.ningdatech.pmapi.expert.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<Object> { | public class GlobalResponseHandler implements ResponseBodyAdvice<Object> { | ||||
@@ -6,10 +6,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.ningdatech.basic.function.VUtils; | import com.ningdatech.basic.function.VUtils; | ||||
import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; | import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; | ||||
import com.ningdatech.pmapi.common.helper.UserInfoHelper; | 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.model.entity.DingOrganization; | ||||
import com.ningdatech.pmapi.organization.service.IDingOrganizationService; | import com.ningdatech.pmapi.organization.service.IDingOrganizationService; | ||||
import com.ningdatech.pmapi.projectdeclared.model.dto.ProjectConditionDTO; | 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.dto.ProjectDTO; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | ||||
@@ -64,7 +65,7 @@ public class DefaultDeclaredProjectManage { | |||||
private final IProjectInstService projectInstService; | private final IProjectInstService projectInstService; | ||||
private final StateMachineUtils stateMachineUtils; | |||||
private final IDeclaredStatisticsService statisticsService; | |||||
//项目名称去重 | //项目名称去重 | ||||
public void checkDuplication(ProjectDTO project){ | public void checkDuplication(ProjectDTO project){ | ||||
@@ -232,4 +233,10 @@ public class DefaultDeclaredProjectManage { | |||||
throw new BusinessException("提交预审 项目信息修改 错误 :" + e.getMessage()); | throw new BusinessException("提交预审 项目信息修改 错误 :" + e.getMessage()); | ||||
} | } | ||||
} | } | ||||
public DeclaredProjectStatisticsPO declaredProjectStatistics(Integer year){ | |||||
UserInfoDetails userInfo = LoginUserUtil.loginUserDetail(); | |||||
//查此人建设单位的项目 | |||||
return statisticsService.getStatistics(userInfo.getOrganizationCode(),year); | |||||
} | |||||
} | } |
@@ -6,19 +6,15 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.google.common.collect.Maps; | import com.google.common.collect.Maps; | ||||
import com.ningdatech.basic.function.VUtils; | import com.ningdatech.basic.function.VUtils; | ||||
import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; | 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.projectdeclared.model.dto.ProjectConditionDTO; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectInstService; | import com.ningdatech.pmapi.projectlib.service.IProjectInstService; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | 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.bean.entity.WflowModels; | ||||
import com.wflow.exception.BusinessException; | import com.wflow.exception.BusinessException; | ||||
import com.wflow.workflow.bean.dto.OrgInfoDTO; | 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.bean.vo.ProcessStartParamsVo; | ||||
import com.wflow.workflow.service.ProcessInstanceService; | import com.wflow.workflow.service.ProcessInstanceService; | ||||
import com.wflow.workflow.service.ProcessModelService; | import com.wflow.workflow.service.ProcessModelService; | ||||
@@ -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; | |||||
/** | |||||
* <p> | |||||
* Mapper 接口 | |||||
* </p> | |||||
* | |||||
* @author zpf | |||||
* @since 2023-02-05 | |||||
*/ | |||||
public interface DeclaredStatisticsMapper extends BaseMapper { | |||||
DeclaredProjectStatisticsPO getStatistics(@Param("orgCode") String orgCode,@Param("year") Integer year); | |||||
} |
@@ -0,0 +1,22 @@ | |||||
<?xml version="1.0" encoding="UTF-8"?> | |||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
<mapper namespace="com.ningdatech.pmapi.projectdeclared.mapper.DeclaredStatisticsMapper"> | |||||
<select id="getStatistics" resultType="com.ningdatech.pmapi.projectdeclared.model.po.DeclaredProjectStatisticsPO"> | |||||
SELECT | |||||
count(0) totalNum, | |||||
count(CASE WHEN p.project_type = 1 THEN 1 end) buildNum, | |||||
count(CASE WHEN p.project_type = 2 THEN 1 end) operationNum, | |||||
count(CASE WHEN p.stage = 10000 THEN 1 end) notApprovedNum, | |||||
count(CASE WHEN p.stage = 20000 THEN 1 end) approvedNum, | |||||
count(CASE WHEN p.stage = 20000 AND p.status = 20002 THEN 1 end) constructionNum, | |||||
count(CASE WHEN p.stage = 20000 AND p.status = 20003 THEN 1 end) tobeInspectedNum, | |||||
count(CASE WHEN p.stage = 30000 THEN 1 end) archivedNum, | |||||
sum(p.declare_amount) declaredAmount, | |||||
sum(p.approval_amount) approvalAmount | |||||
FROM | |||||
nd_project p | |||||
WHERE build_org_code = #{orgCode} and project_year = #{year} | |||||
</select> | |||||
</mapper> |
@@ -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; | |||||
} |
@@ -0,0 +1,17 @@ | |||||
package com.ningdatech.pmapi.projectdeclared.service; | |||||
import com.ningdatech.pmapi.projectdeclared.model.po.DeclaredProjectStatisticsPO; | |||||
/** | |||||
* <p> | |||||
* 服务类 | |||||
* </p> | |||||
* | |||||
* @author zpf | |||||
* @since 2023-02-05 | |||||
*/ | |||||
public interface IDeclaredStatisticsService { | |||||
DeclaredProjectStatisticsPO getStatistics(String orgCode,Integer year); | |||||
} |
@@ -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; | |||||
/** | |||||
* <p> | |||||
* 服务实现类 | |||||
* </p> | |||||
* | |||||
* @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); | |||||
} | |||||
} |
@@ -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; | |||||
} | |||||
} |
@@ -1,5 +1,6 @@ | |||||
package com.ningdatech.pmapi.todocenter.manage; | package com.ningdatech.pmapi.todocenter.manage; | ||||
import cn.hutool.core.bean.BeanUtil; | |||||
import cn.hutool.core.codec.Base64; | import cn.hutool.core.codec.Base64; | ||||
import cn.hutool.core.collection.CollUtil; | import cn.hutool.core.collection.CollUtil; | ||||
import cn.hutool.core.util.StrUtil; | 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.PdfGenerateDTO; | ||||
import com.ningdatech.pmapi.todocenter.model.dto.SealInfoDTO; | import com.ningdatech.pmapi.todocenter.model.dto.SealInfoDTO; | ||||
import com.ningdatech.pmapi.todocenter.model.dto.SignReqDTO; | 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.model.vo.ProcessProgressDetailVo; | ||||
import com.ningdatech.pmapi.todocenter.enumeration.IsAppendProjectEnum; | import com.ningdatech.pmapi.todocenter.enumeration.IsAppendProjectEnum; | ||||
import com.ningdatech.pmapi.todocenter.model.req.ProcessDetailReq; | import com.ningdatech.pmapi.todocenter.model.req.ProcessDetailReq; | ||||
@@ -92,7 +94,6 @@ import javax.servlet.http.HttpServletResponse; | |||||
import java.io.IOException; | import java.io.IOException; | ||||
import java.io.InputStream; | import java.io.InputStream; | ||||
import java.math.BigDecimal; | import java.math.BigDecimal; | ||||
import java.net.URL; | |||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.util.*; | import java.util.*; | ||||
import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
@@ -128,6 +129,8 @@ public class TodoCenterManage { | |||||
private final FileService fileService; | private final FileService fileService; | ||||
private final ICompanySignatureService companySignatureService; | 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; | |||||
} | } | ||||
} | } |
@@ -1,10 +1,11 @@ | |||||
package com.ningdatech.pmapi.todocenter.mapper; | package com.ningdatech.pmapi.todocenter.mapper; | ||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 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 { | public interface StatisticsMapper extends BaseMapper { | ||||
TodoCenterStatisticsPO getStatistics(@Param("userId") Long userId); | |||||
} | } |
@@ -1,5 +1,24 @@ | |||||
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
<mapper namespace="com.ningdatech.pmapi.todocenter.mapper.StatisticsMapper"> | <mapper namespace="com.ningdatech.pmapi.todocenter.mapper.StatisticsMapper"> | ||||
<select id="getStatistics" parameterType="java.lang.Long" | |||||
resultType="com.ningdatech.pmapi.todocenter.model.po.TodoCenterStatisticsPO"> | |||||
SELECT | |||||
sum(CASE WHEN tol.todoNum IS NOT NULL AND tol.todoNum > 0 THEN 1 ELSE 0 end) todoNum, | |||||
sum(CASE WHEN tol.idoNum IS NOT NULL AND tol.idoNum > 0 THEN 1 ELSE 0 end) idoNum, | |||||
sum(CASE WHEN tol.mysubmitNum IS NOT NULL AND tol.mysubmitNum > 0 THEN 1 ELSE 0 end) mysubmitNum, | |||||
sum(CASE WHEN tol.ccmeNum IS NOT NULL AND tol.ccmeNum > 0 THEN 1 ELSE 0 end) ccmeNum | |||||
FROM ( | |||||
SELECT | |||||
sum(CASE WHEN ht.assignee_ = #{userId} AND ht.end_time_ is NULL THEN 1 end) todoNum, | |||||
sum(CASE WHEN ht.assignee_ = #{userId} AND ht.end_time_ IS not NULL THEN 1 end) idoNum, | |||||
sum(CASE WHEN hp.start_user_id_ = #{userId} THEN 1 end) mysubmitNum, | |||||
0 ccmeNum | |||||
FROM | |||||
act_hi_procinst hp | |||||
LEFT JOIN | |||||
act_hi_taskinst ht ON hp.proc_inst_id_ = ht.proc_inst_id_ | |||||
GROUP BY hp.id_ | |||||
) tol | |||||
</select> | |||||
</mapper> | </mapper> |
@@ -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; | |||||
} |
@@ -1,5 +1,7 @@ | |||||
package com.ningdatech.pmapi.todocenter.service; | package com.ningdatech.pmapi.todocenter.service; | ||||
import com.ningdatech.pmapi.todocenter.model.po.TodoCenterStatisticsPO; | |||||
/** | /** | ||||
* @Classname StatisticsService | * @Classname StatisticsService | ||||
* @Description | * @Description | ||||
@@ -8,6 +10,6 @@ package com.ningdatech.pmapi.todocenter.service; | |||||
*/ | */ | ||||
public interface StatisticsService { | public interface StatisticsService { | ||||
//根据用户id 去查询 一些统计数据 | |||||
TodoCenterStatisticsPO getStatistics(Long userId); | |||||
} | } |
@@ -1,6 +1,9 @@ | |||||
package com.ningdatech.pmapi.todocenter.service.impl; | 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 com.ningdatech.pmapi.todocenter.service.StatisticsService; | ||||
import lombok.AllArgsConstructor; | |||||
import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
/** | /** | ||||
@@ -10,8 +13,13 @@ import org.springframework.stereotype.Service; | |||||
* @Author PoffyZhang | * @Author PoffyZhang | ||||
*/ | */ | ||||
@Service | @Service | ||||
@AllArgsConstructor | |||||
public class StatisticsServiceImpl implements StatisticsService { | public class StatisticsServiceImpl implements StatisticsService { | ||||
private final StatisticsMapper mapper; | |||||
@Override | |||||
public TodoCenterStatisticsPO getStatistics(Long userId) { | |||||
return mapper.getStatistics(userId); | |||||
} | |||||
} | } |
@@ -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<NoticeListItemVO> converts(List<NoticeListItemVO> 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; | |||||
} | |||||
} |
@@ -1,10 +1,30 @@ | |||||
package com.ningdatech.pmapi.workbench.manage; | 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.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 com.ningdatech.pmapi.workbench.model.vo.WorkbenchVO; | ||||
import lombok.AllArgsConstructor; | import lombok.AllArgsConstructor; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import java.util.stream.Collectors; | |||||
/** | /** | ||||
* @Classname WorkbenchManage | * @Classname WorkbenchManage | ||||
* @Description | * @Description | ||||
@@ -15,13 +35,42 @@ import org.springframework.stereotype.Component; | |||||
@AllArgsConstructor | @AllArgsConstructor | ||||
public class WorkbenchManage { | 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){ | public WorkbenchVO getWorkbenchData(Integer year){ | ||||
UserInfoDetails userInfo = LoginUserUtil.loginUserDetail(); | |||||
WorkbenchVO res = new WorkbenchVO(); | |||||
//1.待办中心数据 | //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; | |||||
} | |||||
} | } |
@@ -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 | |||||
} |
@@ -32,7 +32,7 @@ public class WorkbenchVO implements Serializable { | |||||
public List<ProjectLibListItemVO> projects; | public List<ProjectLibListItemVO> projects; | ||||
@ApiModelProperty("公告列表") | @ApiModelProperty("公告列表") | ||||
public NoticeListItemVO noticeList; | |||||
public List<NoticeListItemVO> noticeList; | |||||
@Data | @Data | ||||
public static class DeclaredStatistics { | public static class DeclaredStatistics { | ||||