Browse Source

modify:

1. 区县项目备案数据导入修改;
tags/24092001
WendyYang 3 months ago
parent
commit
0f985de2dd
3 changed files with 13 additions and 4 deletions
  1. +5
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/QxProjectImportManage.java
  2. +4
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/req/QxProjectRecordReq.java
  3. +4
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/QxProjectVO.java

+ 5
- 4
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/QxProjectImportManage.java View File

@@ -4,6 +4,7 @@ import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.json.JSONUtil;
import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -91,20 +92,20 @@ public class QxProjectImportManage {
String constructionFileIds = MapUtil.getStr(map, "建设方案附件(多附件逗号隔开)");
String[] split = constructionFileIds.split(",");
if (split.length > 0) {
String fileIds = Arrays.stream(split).map(w -> {
List<FileResultVO> fileResults = Arrays.stream(split).map(w -> {
File tmpFile = mhFileClient.downloadToTmpFile(w);
try (FileInputStream inputStream = new FileInputStream(tmpFile)) {
String mimeType = FileUtil.getMimeType(tmpFile.getPath());
MockMultipartFile multipartFile = new MockMultipartFile(tmpFile.getName(), tmpFile.getName(), mimeType, inputStream);
ApiResponse<FileResultVO> fileRet = fileController.upload(multipartFile, "default");
return fileRet.getData().getId().toString();
return fileRet.getData();
} catch (Exception e) {
throw BizException.wrap("建设方案上传失败");
} finally {
tmpFile.deleteOnExit();
}
}).collect(Collectors.joining(","));
project.setConstructionPlanFile(fileIds);
}).collect(Collectors.toList());
project.setConstructionPlanFile(JSONUtil.toJsonStr(fileResults));
}
projects.add(project);
}


+ 4
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/req/QxProjectRecordReq.java View File

@@ -5,6 +5,7 @@ import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

/**
@@ -52,4 +53,7 @@ public class QxProjectRecordReq {
@ApiModelProperty("源系统ID")
private List<String> sourceSystemIds;

@ApiModelProperty("投资总额")
private BigDecimal totalInvest;

}

+ 4
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/QxProjectVO.java View File

@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
@@ -56,4 +57,7 @@ public class QxProjectVO {
@ApiModelProperty("创建时间")
private LocalDateTime createOn;

@ApiModelProperty("投资总额")
private BigDecimal totalInvest;

}

Loading…
Cancel
Save