| | |
| | | ) throws IOException { |
| | | OutputExcelUtils.export(response, "导入模板", "项目信息", null, ProjectExcelTemplate.class ,fieldList); |
| | | } |
| | | |
| | | } |
| | |
| | | /** 投资类别(0企业投资,1政府投资,2外商投资,3境外投资) */ |
| | | private String investType; |
| | | |
| | | @TableField("project_phase") |
| | | /** 项目阶段(0储备规划阶段, 1项目前期阶段, 2实施阶段, 3竣工投用阶段) */ |
| | | private String projectPhase; |
| | | // @TableField("project_phase") |
| | | // /** 项目阶段(0储备规划阶段, 1项目前期阶段, 2实施阶段, 3竣工投用阶段) */ |
| | | // private String projectPhase; |
| | | |
| | | @TableField("tag") |
| | | /** 标签 */ |
| | |
| | | private Date projectStartTime; |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date projectEndTime; |
| | | //从有没有流程判断是存储还是早期 |
| | | private String reserveOrPrevious; |
| | | } |
| | | |
| | |
| | | |
| | | @ApiModelProperty("文件") |
| | | private List<File> fileList; |
| | | |
| | | private Long processId; |
| | | private ProjectInvestmentInfoVO projectInvestmentInfo; |
| | | private ProjectInvestmentFundingVO projectInvestmentFunding; |
| | | private ProjectUnitRegistrationInfoVO projectUnitRegistrationInfo; |
| | |
| | | private String projectColorCode; |
| | | private List<Long> competentDepartmentList; |
| | | private List<String> managementCentralizationList; |
| | | |
| | | private Long processId; |
| | | } |
| | |
| | | package com.ycl.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.common.base.Result; |
| | | import com.ycl.common.enums.business.FileTypeEnum; |
| | | import com.ycl.common.enums.business.ProjectCategoryEnum; |
| | | import com.ycl.common.utils.CopyUtils; |
| | | import com.ycl.common.utils.DateUtils; |
| | | import com.ycl.common.utils.SecurityUtils; |
| | |
| | | if (query.getProjectEndTime() != null) { |
| | | query.setProjectEndTime(DateUtils.getDayEnd(query.getProjectEndTime())); |
| | | } |
| | | String projectCategory = query.getProjectCategory(); |
| | | if (ProjectCategoryEnum.RESERVE.getType().equals(projectCategory)) { |
| | | query.setProjectStatus(ProjectCategoryEnum.RESERVE.getStatus()); |
| | | query.setReserveOrPrevious(ProjectCategoryEnum.RESERVE.getCode()); |
| | | } else if (ProjectCategoryEnum.PREVIOUS.getType().equals(projectCategory)) { |
| | | query.setProjectStatus(ProjectCategoryEnum.PREVIOUS.getStatus()); |
| | | query.setReserveOrPrevious(ProjectCategoryEnum.PREVIOUS.getCode()); |
| | | } else if (ProjectCategoryEnum.FINISH.getType().equals(projectCategory)) { |
| | | query.setProjectStatus(ProjectCategoryEnum.FINISH.getStatus()); |
| | | } else if (ProjectCategoryEnum.EXCEPTION.getType().equals(projectCategory)) { |
| | | //TODO |
| | | //先查出异常流程或者异常进度或者异常计划的projectId和异常种类 |
| | | //通过projectId查出项目数据 |
| | | //补充相应的异常数据(异常种类、异常流程节点等) |
| | | List<ProjectVO> list = new ArrayList<>(); |
| | | return Result.ok().data(list).total(0); |
| | | } |
| | | |
| | | IPage<ProjectInfoVO> page = PageUtil.getPage(query, ProjectInfoVO.class); |
| | | baseMapper.getPage(page, query); |
| | | List<ProjectInfoVO> records = page.getRecords(); |
| | |
| | | vo.setProjectColorCode("green"); |
| | | ProjectVO projectVO = new ProjectVO(); |
| | | copyToProjectVO(vo,projectVO); |
| | | //翻译项目阶段 |
| | | String phase = ProjectCategoryEnum.getPhaseByProjectStatus(projectVO.getProjectStatus(), projectVO.getProcessId() != null); |
| | | projectVO.setProjectPhase(phase); |
| | | list.add(projectVO); |
| | | }); |
| | | return Result.ok().data(list).total(page.getTotal()); |
| | |
| | | |
| | | <select id="getPage" resultMap="resultMap"> |
| | | SELECT |
| | | TPI.*, |
| | | TPI.*,TPP.process_instance_id as processId, |
| | | TPIF.total_investment as TPIF_totalInvestment, |
| | | TPIF.principal as TPIF_principal,TPIF.government_investment_total as TPIF_government_investment_total,TPIF.central_investment_total as TPIF_central_investment_total, |
| | | TPIF.central_budget_investment as TPIF_central_budget_investment,TPIF.central_fiscal_investment as TPIF_central_fiscal_investment, |
| | |
| | | LEFT JOIN t_project_investment_info TPII ON TPI.id = TPII.project_id and TPII.deleted = 0 |
| | | LEFT JOIN t_project_investment_policy_compliance TPIPC ON TPI.id = TPIPC.project_id and TPIPC.deleted = 0 |
| | | LEFT JOIN t_project_unit_registration_info TPURI ON TPI.id = TPURI.project_id and TPURI.deleted = 0 |
| | | LEFT JOIN t_project_process TPP ON TPI.id = TPP.project_id and TPP.deleted = 0 |
| | | <where> |
| | | TPI.deleted = 0 |
| | | <if test="query.projectCategory !=null and query.projectCategory!=''"> |
| | | and TPI.project_phase = #{query.projectCategory} |
| | | </if> |
| | | <if test="query.projectName !=null and query.projectName!=''"> |
| | | and TPI.project_name like concat('%',#{query.projectName},'%') |
| | | </if> |
| | |
| | | <if test="query.projectStartTime !=null and query.projectEndTime !=null"> |
| | | and TPI.create_project_time between #{query.projectStartTime} and #{query.projectEndTime} |
| | | </if> |
| | | <if test="query.reserveOrPrevious != null and query.reserveOrPrevious == 'reserve'"> |
| | | and TPP.process_instance_id is null |
| | | </if> |
| | | <if test="query.reserveOrPrevious != null and query.reserveOrPrevious == 'previous'"> |
| | | and TPP.process_instance_id is not null |
| | | </if> |
| | | </where> |
| | | order by gmt_create |
| | | order by TPI.gmt_create |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.ycl.common.enums.business; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum ProjectCategoryEnum { |
| | | |
| | | RESERVE("1", "pendding", "储备项目","reserve","储备规划阶段"), |
| | | PREVIOUS("2", "pendding","前期项目","previous","项目前期阶段"), |
| | | IMPLEMENT("3", "working,stop","实施项目","implement","实施阶段"), |
| | | FINISH("4", "finish","竣工项目","finish","竣工投用阶段"), |
| | | EXCEPTION("5", "","异常项目","exception",""); |
| | | |
| | | |
| | | private final String type; |
| | | private final String status; |
| | | private final String name; |
| | | private final String code; |
| | | private final String desc; |
| | | |
| | | //判断传入数据是否存在四种项目推进状态 |
| | | public static boolean isValidType(String type) { |
| | | for (ProjectCategoryEnum status : ProjectCategoryEnum.values()) { |
| | | if (status.getDesc().equals(type) && ObjectUtil.notEqual(type,ProjectCategoryEnum.EXCEPTION.getName())) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 获取项目阶段 |
| | | * @param projectStatus |
| | | * @param hasProcess 是否启动流程 |
| | | * @return |
| | | */ |
| | | public static String getPhaseByProjectStatus(String projectStatus, boolean hasProcess) { |
| | | for (ProjectCategoryEnum projectCategoryEnum : ProjectCategoryEnum.values()) { |
| | | if (hasProcess && PREVIOUS.status.contains(projectStatus)) { |
| | | return PREVIOUS.desc; |
| | | } |
| | | if (projectCategoryEnum.status.contains(projectStatus)) { |
| | | return projectCategoryEnum.desc; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |