diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/ProjectGovSystemReplaceInfoController.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/ProjectGovSystemReplaceInfoController.java index 896608a..1f0fd36 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/ProjectGovSystemReplaceInfoController.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/ProjectGovSystemReplaceInfoController.java @@ -9,6 +9,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import javax.servlet.http.HttpServletResponse; + /** *

* ProjectGovSystemReplaceInfoController @@ -30,4 +32,9 @@ public class ProjectGovSystemReplaceInfoController { return systemReplaceInfoManage.systemReplaceInfos(targetSystem); } + @GetMapping("/down") + public void downTmp(HttpServletResponse response) { + systemReplaceInfoManage.downTmp(response); + } + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectGovSystemReplaceInfoManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectGovSystemReplaceInfoManage.java index d5208e4..e37a972 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectGovSystemReplaceInfoManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectGovSystemReplaceInfoManage.java @@ -2,11 +2,14 @@ package com.hz.pm.api.projectlib.manage; import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.StrUtil; +import cn.hutool.poi.excel.ExcelUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.hz.pm.api.common.exception.ReturnException; import com.hz.pm.api.projectlib.entity.ProjectGovSystemReplaceInfos; import com.hz.pm.api.projectlib.model.dto.GovSystemReplaceInfoDTO; import com.hz.pm.api.projectlib.model.entity.Project; +import com.hz.pm.api.projectlib.model.enumeration.GovSystemReplaceTypeEnum; import com.hz.pm.api.projectlib.model.vo.SystemReplaceInfoVO; import com.hz.pm.api.projectlib.model.vo.UnitProjectGovSystemReplaceVO; import com.hz.pm.api.projectlib.model.vo.UnitProjectGovSystemReplaceVO.ProjectGovSystemReplaceVO; @@ -18,10 +21,9 @@ import com.ningdatech.basic.util.CollUtils; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; -import java.util.Map; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.util.*; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; @@ -112,4 +114,34 @@ public class ProjectGovSystemReplaceInfoManage { return retDetail; } + public void downTmp(HttpServletResponse response) { + List replaceInfos = systemReplaceInfosService.list(); + replaceInfos.removeIf(w -> StrUtil.isNotBlank(w.getSourceSystemId())); + if (replaceInfos.isEmpty()) { + throw ReturnException.wrap("暂无数据可供导出"); + } + for (ProjectGovSystemReplaceInfos replaceInfo : replaceInfos) { + if (StrUtil.isNotBlank(replaceInfo.getReplaceType())) { + String replaceType = replaceInfo.getReplaceType(); + String[] split = replaceType.split(","); + String replaceTypeStr = Arrays.stream(split) + .filter(NumberUtil::isNumber) + .map(w -> GovSystemReplaceTypeEnum.getVal(Integer.parseInt(w))) + .collect(Collectors.joining(",")); + replaceInfo.setReplaceType(replaceTypeStr); + } else { + replaceInfo.setReplaceType(StrUtil.EMPTY); + } + } + try (ServletOutputStream sos = response.getOutputStream()) { + response.setContentType("application/vnd.ms-excel"); + ExcelUtil.getWriter() + .write(replaceInfos) + .flush(sos) + .close(); + } catch (Exception e) { + throw ReturnException.wrap("导出失败"); + } + } + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/ProjectDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/ProjectDTO.java index 31bdcd2..0b7fb15 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/ProjectDTO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/ProjectDTO.java @@ -383,6 +383,12 @@ public class ProjectDTO implements Serializable { @ApiModelProperty("政务信息系统替代情况") private List systemReplaceInfos; + @ApiModelProperty("是否新增迭代升级内容") + private Boolean isAddIterativeUpgradeContent; + + @ApiModelProperty("迭代升级内容") + private String iterativeUpgradeContent; + @ApiModelProperty("信产项目ID") private Long mhProjectId; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/entity/Project.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/entity/Project.java index e46a41d..3314a16 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/entity/Project.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/entity/Project.java @@ -503,4 +503,10 @@ public class Project implements Serializable { @ApiModelProperty("是否是重大项目") private Boolean isMajorProject; + @ApiModelProperty("是否新增迭代升级内容") + private Boolean isAddIterativeUpgradeContent; + + @ApiModelProperty("迭代升级内容") + private String iterativeUpgradeContent; + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/ProjectDetailVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/ProjectDetailVO.java index 2d18c07..fdcb26b 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/ProjectDetailVO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/ProjectDetailVO.java @@ -594,4 +594,10 @@ public class ProjectDetailVO { @ApiModelProperty("所属领域") private Integer unitStrip; + @ApiModelProperty("是否新增迭代升级内容") + private Boolean isAddIterativeUpgradeContent; + + @ApiModelProperty("迭代升级内容") + private String iterativeUpgradeContent; + }