Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

master
PoffyZhang pirms 1 gada
vecāks
revīzija
cbdfea44b6
7 mainītis faili ar 50 papildinājumiem un 6 dzēšanām
  1. +1
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java
  2. +32
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java
  3. +0
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/MenuServiceImpl.java
  4. +12
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  5. Binārs
      pmapi/src/main/resources/template/丽水市2023年数字化项目年度计划编辑表(空).xls
  6. Binārs
      pmapi/src/main/resources/template/丽水市2023年数字化项目年度计划编辑表.xls
  7. +5
    -1
      pmapi/src/main/resources/template/预审申请单.html

+ 1
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java Parādīt failu

@@ -145,6 +145,7 @@ public final class TreeUtil {
} else {
menus = new ArrayList<>(currMenus);
}
menus.sort(Comparator.comparing(MenuRoleVO::getSort));
ListIterator<MenuRoleVO> currIter = menus.listIterator();
while (currIter.hasNext()) {
MenuRoleVO curr = currIter.next();


+ 32
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java Parādīt failu

@@ -6,6 +6,7 @@ import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.poi.excel.ExcelUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -22,6 +23,7 @@ import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter;
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils;
import com.ningdatech.pmapi.common.util.ExcelDownUtil;
import com.ningdatech.pmapi.common.util.ExcelExportStyle;
import com.ningdatech.pmapi.datascope.model.DataScopeDTO;
import com.ningdatech.pmapi.datascope.utils.DataScopeUtil;
import com.ningdatech.pmapi.expert.constant.ExpertUserInfoSensitiveFieldEnum;
@@ -54,9 +56,14 @@ import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
@@ -399,7 +406,31 @@ public class AnnualPlanLibManage {
map.put("mapList1", null);
Workbook workbook = ExcelExportUtil.exportExcel(temp, map);
if (workbook == null) {
throw new BizException("读取模板失败!");
// 输出空模板
// 获取本地目录的年度计划编辑表空Excel模板
String emptyTemplate = "丽水市" + year + "年数字化项目年度计划编辑表(空)";
try {
InputStream templateInputStream =
this.getClass().getClassLoader().getResourceAsStream("template" + File.separator + emptyTemplate + ".xls");

OutputStream outputStream = response.getOutputStream();
// 设置要下载的文件的名称
response.setHeader("Content-disposition", "attachment;fileName=" + new String(templateName.getBytes("UTF-8"),"ISO8859-1"));
// 设置文件的MIME类型
response.setContentType("application/vnd.ms-excel;charset=UTF-8");

byte[] b = new byte[2048];
int len;
while ((len = templateInputStream.read(b)) != -1) {
outputStream.write(b, 0, len);
}
templateInputStream.close();
outputStream.flush();
outputStream.close();
} catch (IOException e) {
throw new BizException("读取模板失败!");
}
return;
}
// 重置响应对象
response.reset();


+ 0
- 2
pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/MenuServiceImpl.java Parādīt failu

@@ -91,8 +91,6 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IM
throw new BaseUncheckedException(HttpStatus.HTTP_OK, "【地址栏路径】:{}重复", data.getPath());
}
}
} else {
checkButtonUnique(data.getPid(), data.getPath(), data.getId());
}
Menu old = getById(data);
if (Objects.isNull(old)) {


+ 12
- 2
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java Parādīt failu

@@ -431,7 +431,7 @@ public class TodoCenterManage {
// 调用盖章接口,获取盖章后返回的pdf文件字符数组
byte[] signPdf = IRSAPIRequest.createSignPdf(signReq);
// 转换成MultipartFile
MultipartFile multipartFile = new MockMultipartFile("file", originalFileName + ".pdf", "application/pdf", signPdf);
MultipartFile multipartFile = new MockMultipartFile("file", originalFileName, "application/pdf", signPdf);
// 上传OSS
FileResultVO resultVo = fileService.upload(multipartFile, "default");
// 将返回的文件ID更新到项目库中对应的项目下
@@ -957,8 +957,13 @@ public class TodoCenterManage {
* @since 2023/03/16 22:46
*/
public Long getNotSealedPdf(Long projectId) {
// 设置pdf模板参数
Project project = projectService.getById(projectId);
Long pretrialFileId = project.getPretrialFileId();
// 如果项目关联的预审文件ID不为空,说明已经进行过盖章审核,直接返回盖章后的预审申请单文件ID
if (Objects.nonNull(pretrialFileId)){
return pretrialFileId;
}
// 设置pdf模板参数
JSONObject paramsMap = assemblyPdfParams(project);
paramsMap.put("superOrgOpinion",null);
paramsMap.put("superOrgAuditDate",null);
@@ -1072,6 +1077,10 @@ public class TodoCenterManage {
paramsMap.put("yearPlanInvest",yearPlanInvest);
// TODO 根据地区编码获取当地大数据局(中心)的名称
paramsMap.put("bigDataBureauName",null);
// 备注模块如果为空
if (Objects.isNull(pdfGenerateDTO.getProjectRemarks())){
paramsMap.put("projectRemarks",null);
}

// 获取立项依据
String buildBasis = project.getBuildBasis();
@@ -1097,6 +1106,7 @@ public class TodoCenterManage {
}
String buildBasisList = builder.toString();
paramsMap.put("buildBasisList",buildBasisList);

return paramsMap;
}



Binārs
template/丽水市2023年数字化项目年度计划编辑表.xls → pmapi/src/main/resources/template/丽水市2023年数字化项目年度计划编辑表(空).xls Parādīt failu


Binārs
pmapi/src/main/resources/template/丽水市2023年数字化项目年度计划编辑表.xls Parādīt failu


+ 5
- 1
pmapi/src/main/resources/template/预审申请单.html Parādīt failu

@@ -24,6 +24,10 @@
font-size: 34px;
margin: 40px 0 0 0;
font-family: SimSun;
word-break: break-all;
}
.tit {
word-break: break-all;
}
.tab {
padding: 0 20px;
@@ -84,7 +88,7 @@
<body>
<div class="pdf">
<p class="title">
<span>#title#</span>
<span class="tit">#title#</span>
</p>
<div class="tab">
<p class="projectId">


Notiek ielāde…
Atcelt
Saglabāt