瀏覽代碼

项目库全选导出、未盖章pdf内容修改

tags/24080901
CMM 1 年之前
父節點
當前提交
3d123dde2b
共有 5 個檔案被更改,包括 62 行新增3 行删除
  1. +12
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConst.java
  2. +18
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/util/ExcelDownUtil.java
  3. +30
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  4. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/PdfGenerateDTO.java
  5. +1
    -1
      pmapi/src/main/resources/template/预审申请单.html

+ 12
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConst.java 查看文件

@@ -31,5 +31,17 @@ public interface CommonConst {

String ARCHIVED = "归档";

String FILE_NAME = "name";

String NULL = "null";

String TITLE = "title";

String FILE_NAME_STR = "fileName";
String FILE_LIST = "fileList";
String ITEM_BASED = "依据项:";
String ITEM_BASED_FILE_NAME = "依据文件名:";
String APPENDIX = "文件:";


}

+ 18
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/util/ExcelDownUtil.java 查看文件

@@ -4,18 +4,23 @@ import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.*;
import java.util.function.BiConsumer;
import java.util.stream.Collectors;

import javax.servlet.http.HttpServletResponse;

import cn.hutool.json.JSONUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson.JSONObject;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.common.enumeration.ExportOptionEnum;
import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.scheduler.contants.TaskContant;
import com.wflow.workflow.bean.vo.ProcessInstanceVo;
import com.wflow.workflow.bean.vo.ProcessTaskVo;
import org.apache.commons.collections4.CollectionUtils;
@@ -204,7 +209,19 @@ public class ExcelDownUtil {
projects.forEach(project -> {
String s = JSON.toJSONString(project);
JSONObject jsonObject = JSON.parseObject(s);
String columnValue = String.valueOf(jsonObject.get(column.toString()));
String columnValue;
if (ExportOptionEnum.preliminaryPlanFile.equals(column)
|| ExportOptionEnum.supportingMaterialsFile.equals(column)){
String fileStr = String.valueOf(jsonObject.get(column.toString()));
if (Objects.isNull(fileStr) || CommonConst.NULL.equals(fileStr)){
return;
}
List<JSONObject> fileArray = JSON.parseArray(fileStr, JSONObject.class);
List<String> nameList = CollUtils.fieldList(fileArray, w -> w.getString(CommonConst.FILE_NAME));
columnValue = nameList.stream().collect(Collectors.joining(StrPool.COMMA));
}else {
columnValue = String.valueOf(jsonObject.get(column.toString()));
}
columnValues.add(columnValue);
});
rowList.add(columnValues);


+ 30
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java 查看文件

@@ -6,13 +6,16 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.StopWatch;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Sets;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.basic.util.StrPool;
import com.ningdatech.file.entity.File;
import com.ningdatech.file.entity.vo.result.FileResultVO;
import com.ningdatech.file.service.FileService;
@@ -21,6 +24,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.StrUtils;
import com.ningdatech.pmapi.irs.sign.IRSAPIRequest;
import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo;
import com.ningdatech.pmapi.organization.model.entity.DingOrganization;
@@ -1191,6 +1195,7 @@ public class TodoCenterManage {
// 获取表单数据
PdfGenerateDTO pdfGenerateDTO = new PdfGenerateDTO();
BeanUtils.copyProperties(project, pdfGenerateDTO);

JSONObject paramsMap = JSONObject.parseObject(JSONObject.toJSONString(pdfGenerateDTO));
// 设置title
String title = "【" + project.getProjectName() + "】" + fileName;
@@ -1241,6 +1246,31 @@ public class TodoCenterManage {
paramsMap.put("yearPlanInvest",yearPlanInvest);
// TODO 根据地区编码获取当地大数据局(中心)的名称
paramsMap.put("bigDataBureauName",null);

// 获取立项依据
String buildBasis = project.getBuildBasis();
StringBuilder builder = new StringBuilder();
List<JSONObject> fileArray = JSON.parseArray(buildBasis, JSONObject.class);
for (JSONObject jsonObject : fileArray) {
String titleStr = jsonObject.getString(CommonConst.TITLE);
builder.append(CommonConst.ITEM_BASED);
builder.append(titleStr);
builder.append(StrPool.SPACE);
String fileNameStr = jsonObject.getString(CommonConst.FILE_NAME_STR);
builder.append(CommonConst.ITEM_BASED_FILE_NAME);
builder.append(fileNameStr);
builder.append(StrPool.SPACE);
String fileInfo = jsonObject.getString(CommonConst.FILE_LIST);
List<JSONObject> fileInfoArray = JSON.parseArray(fileInfo, JSONObject.class);
List<String> nameList = CollUtils.fieldList(fileInfoArray, w -> w.getString(CommonConst.FILE_NAME));
String appendixStr = nameList.stream().collect(Collectors.joining(StrPool.COMMA));
builder.append(CommonConst.APPENDIX);
builder.append(appendixStr);
builder.append(StrPool.SEMICOLON);
builder.append(StrPool.NEWLINE);
}
String buildBasisList = builder.toString();
paramsMap.put("buildBasisList",buildBasisList);
return paramsMap;
}



+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/PdfGenerateDTO.java 查看文件

@@ -61,7 +61,7 @@ public class PdfGenerateDTO {
private String bizDomain;

@ApiModelProperty("立项依据")
private String buildBasis;
private String buildBasisList;


@ApiModelProperty("是否上云 0:否 1:是")


+ 1
- 1
pmapi/src/main/resources/template/预审申请单.html 查看文件

@@ -151,7 +151,7 @@
</tr>
<tr>
<td class="label">立项依据</td>
<td colspan="3" align="center">#buildBasis#</td>
<td colspan="3" align="center">#buildBasisList#</td>
</tr>
<tr>
<td class="label">是否上云</td>


Loading…
取消
儲存