优化审计报告模板、审计报告生成下载接口
This commit is contained in:
@@ -113,12 +113,12 @@ public class AuditReportController extends BaseController {
|
|||||||
// 准备模板数据
|
// 准备模板数据
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put(AuditReportEnum.AUDIT_TITLE.getCode().toString(), req.getFrom0());
|
map.put(AuditReportEnum.AUDIT_TITLE.getCode().toString(), req.getFrom0());
|
||||||
map.put(AuditReportEnum.AUDIT_BASIS.getCode().toString(), req.getFrom1());
|
map.put(AuditReportEnum.AUDIT_BASIS.getCode().toString(), convertNewlines(req.getFrom1()));
|
||||||
map.put(AuditReportEnum.AUDIT_OBJECTIVE.getCode().toString(), req.getFrom2());
|
map.put(AuditReportEnum.AUDIT_OBJECTIVE.getCode().toString(), convertNewlines(req.getFrom2()));
|
||||||
map.put(AuditReportEnum.AUDIT_SCOPE.getCode().toString(), req.getFrom3());
|
map.put(AuditReportEnum.AUDIT_SCOPE.getCode().toString(), convertNewlines(req.getFrom3()));
|
||||||
map.put(AuditReportEnum.UNIT_OVERVIEW.getCode().toString(), req.getFrom41());
|
map.put(AuditReportEnum.UNIT_OVERVIEW.getCode().toString(), convertNewlines(req.getFrom41()));
|
||||||
map.put(AuditReportEnum.ORG_AND_PERSONNEL.getCode().toString(), req.getFrom42());
|
map.put(AuditReportEnum.ORG_AND_PERSONNEL.getCode().toString(), convertNewlines(req.getFrom42()));
|
||||||
map.put(AuditReportEnum.AUDIT_CONTENT_METHODS.getCode().toString(), req.getFrom5());
|
map.put(AuditReportEnum.AUDIT_CONTENT_METHODS.getCode().toString(), convertNewlines(req.getFrom5()));
|
||||||
|
|
||||||
// 使用Easypoi的Word模板功能
|
// 使用Easypoi的Word模板功能
|
||||||
XWPFDocument document = WordExportUtil.exportWord07(templateConfig.getWordTemplatePath(), map);
|
XWPFDocument document = WordExportUtil.exportWord07(templateConfig.getWordTemplatePath(), map);
|
||||||
@@ -141,4 +141,14 @@ public class AuditReportController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将文本中的 \n\n 转换为Word可识别的换行格式
|
||||||
|
*/
|
||||||
|
private String convertNewlines(String text) {
|
||||||
|
if (text == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
String line = System.getProperty("line.separator");
|
||||||
|
return text.replace("\n\n", line).replace("\n", line);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ package com.gxwebsoft.oa.controller;
|
|||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
import com.gxwebsoft.oa.service.OaCompanyService;
|
import com.gxwebsoft.oa.service.OaCompanyService;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
|
||||||
import com.gxwebsoft.oa.entity.OaCompany;
|
import com.gxwebsoft.oa.entity.OaCompany;
|
||||||
import com.gxwebsoft.oa.param.OaCompanyParam;
|
import com.gxwebsoft.oa.param.OaCompanyParam;
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
@@ -61,6 +64,15 @@ public class OaCompanyController extends BaseController {
|
|||||||
@PostMapping()
|
@PostMapping()
|
||||||
public ApiResult<?> save(@RequestBody OaCompany oaCompany) {
|
public ApiResult<?> save(@RequestBody OaCompany oaCompany) {
|
||||||
if (oaCompanyService.save(oaCompany)) {
|
if (oaCompanyService.save(oaCompany)) {
|
||||||
|
//TODO 查询知识库(kb_name=enterprise.getCreditCode)
|
||||||
|
|
||||||
|
//TODO 新建知识库
|
||||||
|
String kbId = "pggi9mpair";
|
||||||
|
|
||||||
|
//绑定知识库
|
||||||
|
oaCompany.setKbId(kbId);
|
||||||
|
oaCompanyService.updateById(oaCompany);
|
||||||
|
|
||||||
return success("添加成功");
|
return success("添加成功");
|
||||||
}
|
}
|
||||||
return fail("添加失败");
|
return fail("添加失败");
|
||||||
@@ -69,6 +81,15 @@ public class OaCompanyController extends BaseController {
|
|||||||
@Operation(summary = "修改企业信息")
|
@Operation(summary = "修改企业信息")
|
||||||
@PutMapping()
|
@PutMapping()
|
||||||
public ApiResult<?> update(@RequestBody OaCompany oaCompany) {
|
public ApiResult<?> update(@RequestBody OaCompany oaCompany) {
|
||||||
|
if(StrUtil.isEmpty(oaCompany.getKbId())) {
|
||||||
|
//TODO 查询知识库
|
||||||
|
|
||||||
|
//TODO 新建知识库
|
||||||
|
String kbId = "pggi9mpair";
|
||||||
|
|
||||||
|
//绑定知识库
|
||||||
|
oaCompany.setKbId(kbId);
|
||||||
|
}
|
||||||
if (oaCompanyService.updateById(oaCompany)) {
|
if (oaCompanyService.updateById(oaCompany)) {
|
||||||
return success("修改成功");
|
return success("修改成功");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -175,6 +175,9 @@ public class PwlProject implements Serializable {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
|
@Schema(description = "知识库ID")
|
||||||
|
private String kbId;
|
||||||
|
|
||||||
@Schema(description = "租户id")
|
@Schema(description = "租户id")
|
||||||
private Integer tenantId;
|
private Integer tenantId;
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user