Merge remote-tracking branch 'origin/dev_third_stage' into dev_third_stage
This commit is contained in:
+33
-1
@@ -1,5 +1,6 @@
|
||||
package com.jero.modules.system.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -24,6 +25,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.jero.modules.system.util.FindsDepartsChildrenUtil.convertSysDepartToSysDepartTreeModel;
|
||||
|
||||
@@ -286,7 +288,37 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
||||
|
||||
@Override
|
||||
public List<String> getSubDepIdsByDepId(String departId) {
|
||||
return this.baseMapper.getSubDepIdsByDepId(departId);
|
||||
List<String> idList = new ArrayList<>();
|
||||
if(StringUtils.isNotEmpty(departId)) {
|
||||
// 查询所有部门
|
||||
LambdaQueryWrapper<SysDepart> query = new LambdaQueryWrapper<SysDepart>();
|
||||
query.eq(SysDepart::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
|
||||
List<SysDepart> listAll = this.list(query);
|
||||
|
||||
List<SysDepart> result = new ArrayList<>();
|
||||
// 递归查询 指定父节点下的所有子节点,包括父节点
|
||||
if (CollectionUtil.isNotEmpty(listAll)) {
|
||||
recursion(listAll, result, departId);
|
||||
}
|
||||
|
||||
|
||||
idList.add(departId); // 加上父节点
|
||||
idList = result.stream().map(SysDepart::getId).collect(Collectors.toList());
|
||||
|
||||
}
|
||||
return idList;
|
||||
}
|
||||
|
||||
// 递归查询子节点
|
||||
private void recursion(List<SysDepart> listAll, List<SysDepart> result, String fatherId) {
|
||||
List<SysDepart> childern = listAll.stream().filter(e-> fatherId.equals(e.getParentId())).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(childern)) {
|
||||
result.addAll(childern);
|
||||
for(SysDepart depart : childern) {
|
||||
recursion(listAll, result, depart.getId());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+23
-2
@@ -1,6 +1,7 @@
|
||||
package com.jero.modules.report.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
@@ -62,9 +63,29 @@ public class LawsMonthlyReportWriteEOController extends JeroController<LawsMonth
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<LawsMonthlyReportWriteEO> pageList = lawsMonthlyReportWriteEOService.getPageInfo(lawsMonthlyReportWriteEO, pageNo,pageSize,req);
|
||||
return Result.OK(pageList);
|
||||
List<LawsMonthlyReportWriteEO> listInfo = lawsMonthlyReportWriteEOService.getListInfo(lawsMonthlyReportWriteEO, pageNo, pageSize, req);
|
||||
Page pages = lawsMonthlyReportWriteEOService.getPages(pageNo, pageSize, listInfo);
|
||||
return Result.OK(pages);
|
||||
}
|
||||
// /**
|
||||
// * 分页列表查询
|
||||
// *
|
||||
// * @param lawsMonthlyReportWriteEO
|
||||
// * @param pageNo
|
||||
// * @param pageSize
|
||||
// * @param req
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "月报填写-分页列表查询")
|
||||
// @ApiOperation(value="月报填写-分页列表查询", notes="月报填写-分页列表查询")
|
||||
// @GetMapping(value = "/page")
|
||||
// public Result<?> queryPageList(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO,
|
||||
// @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
// @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
// HttpServletRequest req) {
|
||||
// IPage<LawsMonthlyReportWriteEO> pageList = lawsMonthlyReportWriteEOService.getPageInfo(lawsMonthlyReportWriteEO, pageNo,pageSize,req);
|
||||
// return Result.OK(pageList);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
|
||||
+7
-2
@@ -13,7 +13,6 @@ import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -29,7 +28,7 @@ import java.util.List;
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="laws_monthly_report_title_template对象", description="月报标题模板")
|
||||
public class LawsMonthlyReportTitleTemplateEO implements Serializable {
|
||||
public class LawsMonthlyReportTitleTemplateEO implements Comparable<LawsMonthlyReportTitleTemplateEO> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@@ -84,4 +83,10 @@ public class LawsMonthlyReportTitleTemplateEO implements Serializable {
|
||||
|
||||
@TableField(exist = false)
|
||||
private String key;
|
||||
|
||||
@Override
|
||||
public int compareTo(LawsMonthlyReportTitleTemplateEO o) {
|
||||
return this.sort-o.sort;//升序
|
||||
// return o.id-this.id;//降序
|
||||
}
|
||||
}
|
||||
|
||||
+8
-1
@@ -1,6 +1,7 @@
|
||||
package com.jero.modules.report.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.report.entity.LawsMonthlyReportWriteEO;
|
||||
|
||||
@@ -72,7 +73,11 @@ public interface ILawsMonthlyReportWriteEOService extends IService<LawsMonthlyRe
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
IPage<LawsMonthlyReportWriteEO> getPageInfo(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO,
|
||||
// IPage<LawsMonthlyReportWriteEO> getPageInfo(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO,
|
||||
// Integer pageNo,
|
||||
// Integer pageSize,
|
||||
// HttpServletRequest req);
|
||||
List<LawsMonthlyReportWriteEO> getListInfo(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO,
|
||||
Integer pageNo,
|
||||
Integer pageSize,
|
||||
HttpServletRequest req);
|
||||
@@ -82,4 +87,6 @@ public interface ILawsMonthlyReportWriteEOService extends IService<LawsMonthlyRe
|
||||
LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO);
|
||||
|
||||
IPage queryPageDocument(Map<String, Object> parameter);
|
||||
|
||||
Page getPages(Integer currentPage, Integer pageSize, List<LawsMonthlyReportWriteEO> list);
|
||||
}
|
||||
|
||||
+285
-12
@@ -60,8 +60,10 @@ import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -288,7 +290,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<LawsMonthlyReportWriteEO> getPageInfo(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEOTemp,
|
||||
public List<LawsMonthlyReportWriteEO> getListInfo(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEOTemp,
|
||||
Integer pageNo,
|
||||
Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
@@ -300,11 +302,48 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
if(!rolesList.contains(ProjectRoleEnum.ADMIN.getCode())){
|
||||
queryWrapper.in("create_by",currentUser.getUsername());
|
||||
}
|
||||
Page<LawsMonthlyReportWriteEO> page = new Page<LawsMonthlyReportWriteEO>(pageNo, pageSize);
|
||||
Page<LawsMonthlyReportWriteEO> pageInfo = this.page(page, queryWrapper);
|
||||
// Page<LawsMonthlyReportWriteEO> page = new Page<LawsMonthlyReportWriteEO>(pageNo, pageSize);
|
||||
// Page<LawsMonthlyReportWriteEO> pageInfo = this.page(page, queryWrapper);
|
||||
|
||||
|
||||
//所有的月报
|
||||
List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOList = this.list(queryWrapper);
|
||||
//所有月报的一级目录
|
||||
List<String> oneMenuIdLIst = lawsMonthlyReportWriteEOList.stream().map(LawsMonthlyReportWriteEO::getMemoriesChapterOne).distinct().collect(Collectors.toList());
|
||||
//月报标题模板
|
||||
LambdaQueryWrapper<LawsMonthlyReportTitleTemplateEO> wrapperTemp = new LambdaQueryWrapper<>();
|
||||
wrapperTemp.orderByAsc(LawsMonthlyReportTitleTemplateEO::getSort);
|
||||
List<LawsMonthlyReportTitleTemplateEO> list = lawsMonthlyReportTitleTemplateEOService.list(wrapperTemp);
|
||||
//1. 一级目录
|
||||
List<LawsMonthlyReportTitleTemplateEO> oneList = list.stream().filter(e -> StringUtils.isBlank(e.getParentId())).collect(Collectors.toList());
|
||||
oneList = oneList.stream().filter(e -> oneMenuIdLIst.contains(e.getId())).collect(Collectors.toList());
|
||||
Collections.sort(oneList);//正序排序
|
||||
|
||||
List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS = new LinkedList<>();
|
||||
for (LawsMonthlyReportTitleTemplateEO lawsMonthlyReportTitleTemplateEO : oneList) {
|
||||
String oneId = lawsMonthlyReportTitleTemplateEO.getId();
|
||||
//一级目录下的二级目录
|
||||
List<LawsMonthlyReportTitleTemplateEO> twoList = list.stream().filter(e -> StringUtils.isNotBlank(e.getParentId()) && oneId.equals(e.getParentId())).collect(Collectors.toList());
|
||||
Collections.sort(twoList);//正序排序
|
||||
|
||||
//一级目录下的月报
|
||||
for (LawsMonthlyReportTitleTemplateEO monthlyReportTitleTemplateEO : twoList) {
|
||||
for (LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO : lawsMonthlyReportWriteEOList) {
|
||||
if(oneId.equals(lawsMonthlyReportWriteEO.getMemoriesChapterOne()) && monthlyReportTitleTemplateEO.getId().equals(lawsMonthlyReportWriteEO.getMemoriesChapter())){
|
||||
lawsMonthlyReportWriteEOS.add(lawsMonthlyReportWriteEO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOListOne = lawsMonthlyReportWriteEOList.stream()
|
||||
// .filter(e -> oneId.equals(e.getMemoriesChapterOne())).collect(Collectors.toList());
|
||||
// lawsMonthlyReportWriteEOS.addAll(lawsMonthlyReportWriteEOListOne);
|
||||
}
|
||||
|
||||
|
||||
//法规月报id
|
||||
List<String> lawsMonthlyReportIdList = pageInfo.getRecords().stream().map(LawsMonthlyReportWriteEO::getId).collect(Collectors.toList());
|
||||
List<String> userIdList = pageInfo.getRecords().stream().map(LawsMonthlyReportWriteEO::getLawsContact).collect(Collectors.toList());
|
||||
List<String> lawsMonthlyReportIdList = lawsMonthlyReportWriteEOS.stream().map(LawsMonthlyReportWriteEO::getId).collect(Collectors.toList());
|
||||
List<String> userIdList = lawsMonthlyReportWriteEOS.stream().map(LawsMonthlyReportWriteEO::getLawsContact).collect(Collectors.toList());
|
||||
List<String> userIds = new ArrayList<>();
|
||||
for (String s : userIdList) {
|
||||
if(StringUtils.isNotBlank(s)){
|
||||
@@ -343,7 +382,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
}
|
||||
|
||||
|
||||
for (LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO : pageInfo.getRecords()) {
|
||||
for (LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO : lawsMonthlyReportWriteEOS) {
|
||||
//处理法规联系人
|
||||
lawsContact(userList, lawsMonthlyReportWriteEO,lawsMonthlyReportWriteEOTemp.getCut());
|
||||
//处理章节目录
|
||||
@@ -398,8 +437,121 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
}
|
||||
}
|
||||
}
|
||||
return pageInfo;
|
||||
return lawsMonthlyReportWriteEOS;
|
||||
}
|
||||
// @Override
|
||||
// public IPage<LawsMonthlyReportWriteEO> getPageInfo(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEOTemp,
|
||||
// Integer pageNo,
|
||||
// Integer pageSize,
|
||||
// HttpServletRequest req) {
|
||||
// QueryWrapper<LawsMonthlyReportWriteEO> queryWrapper = QueryGenerator.initQueryWrapper(lawsMonthlyReportWriteEOTemp, req.getParameterMap());
|
||||
// queryWrapper.orderByDesc("memories_chapter_one","memories_chapter","create_time");
|
||||
// //管理员查看全部数据,其余人只能查看自己的数据
|
||||
// LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// List<String> rolesList = sysBaseApi.getRolesByUsername(currentUser.getUsername());
|
||||
// if(!rolesList.contains(ProjectRoleEnum.ADMIN.getCode())){
|
||||
// queryWrapper.in("create_by",currentUser.getUsername());
|
||||
// }
|
||||
// Page<LawsMonthlyReportWriteEO> page = new Page<LawsMonthlyReportWriteEO>(pageNo, pageSize);
|
||||
// Page<LawsMonthlyReportWriteEO> pageInfo = this.page(page, queryWrapper);
|
||||
// //法规月报id
|
||||
// List<String> lawsMonthlyReportIdList = pageInfo.getRecords().stream().map(LawsMonthlyReportWriteEO::getId).collect(Collectors.toList());
|
||||
// List<String> userIdList = pageInfo.getRecords().stream().map(LawsMonthlyReportWriteEO::getLawsContact).collect(Collectors.toList());
|
||||
// List<String> userIds = new ArrayList<>();
|
||||
// for (String s : userIdList) {
|
||||
// if(StringUtils.isNotBlank(s)){
|
||||
// if(s.contains(",")){
|
||||
// userIds.addAll(Arrays.asList(s.split(",")));
|
||||
// }else{
|
||||
// userIds.add(s);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// List<JSONObject> jsonObjects = sysBaseApi.queryUsersByIds(StringUtils.join(userIds, ","));
|
||||
// List<LoginUser> userList = new ArrayList<>();
|
||||
// for (JSONObject jsonObject : jsonObjects) {
|
||||
// LoginUser loginUser = JSONObject.parseObject(jsonObject.toJSONString(), LoginUser.class);
|
||||
// userList.add(loginUser);
|
||||
// }
|
||||
//
|
||||
// //获取章节目录
|
||||
// List<LawsMonthlyReportTitleTemplateEO> lawsMonthlyReportTitleTemplateEOList = lawsMonthlyReportTitleTemplateEOService.list();
|
||||
//
|
||||
// //新征求意见清单模板
|
||||
// List<NewOpinionTemplateEO> newOpinionTemplateEOList = new ArrayList<>();
|
||||
// if(lawsMonthlyReportIdList.size() != 0){
|
||||
// LambdaQueryWrapper<NewOpinionTemplateEO> wrapper = new LambdaQueryWrapper<>();
|
||||
// wrapper.in(NewOpinionTemplateEO::getLawsMonthlyReportWriteId,lawsMonthlyReportIdList);
|
||||
// newOpinionTemplateEOList = iNewOpinionTemplateEOService.list(wrapper);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// //新发布标准清单模板
|
||||
// List<NewStandardTemplateEO> newStandardTemplateEOList = new ArrayList<>();
|
||||
// if(lawsMonthlyReportIdList.size() != 0){
|
||||
// LambdaQueryWrapper<NewStandardTemplateEO> qrapperTemp = new LambdaQueryWrapper<>();
|
||||
// qrapperTemp.in(NewStandardTemplateEO::getLawsMonthlyReportWriteId,lawsMonthlyReportIdList);
|
||||
// newStandardTemplateEOList = iNewStandardTemplateEOService.list(qrapperTemp);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// for (LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO : pageInfo.getRecords()) {
|
||||
// //处理法规联系人
|
||||
// lawsContact(userList, lawsMonthlyReportWriteEO,lawsMonthlyReportWriteEOTemp.getCut());
|
||||
// //处理章节目录
|
||||
// if(StringUtils.isNotBlank(lawsMonthlyReportWriteEO.getMemoriesChapter())){
|
||||
// List<LawsMonthlyReportTitleTemplateEO> lawsMonthlyReportTitleTemplateEOS = lawsMonthlyReportTitleTemplateEOList.stream()
|
||||
// .filter(e -> lawsMonthlyReportWriteEO.getMemoriesChapter().equals(e.getId())).collect(Collectors.toList());
|
||||
// if(CutEnum.CN.getValue().equals(lawsMonthlyReportWriteEOTemp.getCut()) && lawsMonthlyReportTitleTemplateEOS.size() != 0){
|
||||
// lawsMonthlyReportWriteEO.setMemoriesChapterName(lawsMonthlyReportTitleTemplateEOS.get(0).getTitleCn());
|
||||
// }else if(CutEnum.EN.getValue().equals(lawsMonthlyReportWriteEOTemp.getCut()) && lawsMonthlyReportTitleTemplateEOS.size() != 0){
|
||||
// lawsMonthlyReportWriteEO.setMemoriesChapterName(lawsMonthlyReportTitleTemplateEOS.get(0).getTitleEn());
|
||||
// }
|
||||
// }
|
||||
// //处理章节目录对应的一级目录
|
||||
// if(StringUtils.isNotBlank(lawsMonthlyReportWriteEO.getMemoriesChapterOne())){
|
||||
// List<LawsMonthlyReportTitleTemplateEO> lawsMonthlyReportTitleTemplateEOS = lawsMonthlyReportTitleTemplateEOList.stream()
|
||||
// .filter(e -> lawsMonthlyReportWriteEO.getMemoriesChapterOne().equals(e.getId())).collect(Collectors.toList());
|
||||
// if(CutEnum.CN.getValue().equals(lawsMonthlyReportWriteEOTemp.getCut()) && lawsMonthlyReportTitleTemplateEOS.size() != 0){
|
||||
// lawsMonthlyReportWriteEO.setMemoriesChapterOneName(lawsMonthlyReportTitleTemplateEOS.get(0).getTitleCn());
|
||||
// }else if(CutEnum.EN.getValue().equals(lawsMonthlyReportWriteEOTemp.getCut()) && lawsMonthlyReportTitleTemplateEOS.size() != 0){
|
||||
// lawsMonthlyReportWriteEO.setMemoriesChapterOneName(lawsMonthlyReportTitleTemplateEOS.get(0).getTitleEn());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if(ContentTemplateEnum.NEW_REQUEST_LIST_TEMPLATE.getValue().equals(lawsMonthlyReportWriteEO.getContentTemplate())){
|
||||
// //新征求意见清单模板
|
||||
// List<NewOpinionTemplateEO> collect = newOpinionTemplateEOList.stream()
|
||||
// .filter(e -> lawsMonthlyReportWriteEO.getId().equals(e.getLawsMonthlyReportWriteId())).collect(Collectors.toList());
|
||||
// lawsMonthlyReportWriteEO.setNewOpinionTemplateEOList(collect);
|
||||
//
|
||||
// }else if(ContentTemplateEnum.NEW_RELEASE_STANDARD_MANIFEST_TEMPLATE.getValue().equals(lawsMonthlyReportWriteEO.getContentTemplate())){
|
||||
// //新发布标准清单模板
|
||||
// List<NewStandardTemplateEO> collect = newStandardTemplateEOList.stream()
|
||||
// .filter(e -> lawsMonthlyReportWriteEO.getId().equals(e.getLawsMonthlyReportWriteId())).collect(Collectors.toList());
|
||||
// lawsMonthlyReportWriteEO.setNewStandardTemplateEOList(collect);
|
||||
// }
|
||||
//
|
||||
// //处理导出状态
|
||||
// String exportState = lawsMonthlyReportWriteEO.getExportState();
|
||||
// if(StringUtils.isNotBlank(exportState)){
|
||||
// if(ExportStateEnum.NOT_EXPORT.getValue().equals(exportState)){
|
||||
// if(CutEnum.CN.getValue().equals(lawsMonthlyReportWriteEOTemp.getCut())){
|
||||
// lawsMonthlyReportWriteEO.setExportStateName(ExportStateEnum.NOT_EXPORT.getName());
|
||||
// }else{
|
||||
// lawsMonthlyReportWriteEO.setExportStateName(ExportStateEnum.NOT_EXPORT.getNameEn());
|
||||
// }
|
||||
// }else if(ExportStateEnum.HAS_BEEN_EXPORT.getValue().equals(exportState)){
|
||||
// if(CutEnum.CN.getValue().equals(lawsMonthlyReportWriteEOTemp.getCut())){
|
||||
// lawsMonthlyReportWriteEO.setExportStateName(ExportStateEnum.HAS_BEEN_EXPORT.getName());
|
||||
// }else{
|
||||
// lawsMonthlyReportWriteEO.setExportStateName(ExportStateEnum.HAS_BEEN_EXPORT.getNameEn());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return pageInfo;
|
||||
// }
|
||||
|
||||
private void lawsContact(List<LoginUser> userList, LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO,String cut) {
|
||||
String lawsContact = lawsMonthlyReportWriteEO.getLawsContact();
|
||||
@@ -873,17 +1025,26 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
}
|
||||
}
|
||||
|
||||
//封面
|
||||
//封面(office版本)
|
||||
private void coverCn(List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS,
|
||||
String titleCN,
|
||||
XWPFDocument document) {
|
||||
//封面标识
|
||||
String flag = "cover";
|
||||
String moth = lawsMonthlyReportWriteEOS.get(0).getMonth().replaceAll("-", "年") + "月";
|
||||
//标题前面添加一个换行
|
||||
WordUtil.exportWord(document, "", null, ParagraphAlignment.CENTER, 0, null,
|
||||
false, false, "Blue Sky Noto Regular",null,null,"break");
|
||||
|
||||
titleCN = "\r\n\r\n" + titleCN + "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n";
|
||||
//添加标题
|
||||
WordUtil.exportWord(document, titleCN, null, ParagraphAlignment.CENTER, 0, 18,
|
||||
false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
|
||||
//标题下面添加9个换行
|
||||
for (int i = 0; i < 9; i++) {
|
||||
WordUtil.exportWord(document, "", null, ParagraphAlignment.CENTER, 0, null,
|
||||
false, false, "Blue Sky Noto Regular",null,null,"break");
|
||||
}
|
||||
WordUtil.exportWord(document, moth, null, ParagraphAlignment.CENTER, 0, 12,
|
||||
false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
|
||||
@@ -908,7 +1069,42 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
//添加下一页
|
||||
document.createParagraph().createRun().addBreak(BreakType.PAGE);
|
||||
}
|
||||
//封面
|
||||
//封面(WPS版本)
|
||||
// private void coverCn(List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS,
|
||||
// String titleCN,
|
||||
// XWPFDocument document) {
|
||||
// //封面标识
|
||||
// String flag = "cover";
|
||||
// String moth = lawsMonthlyReportWriteEOS.get(0).getMonth().replaceAll("-", "年") + "月";
|
||||
//
|
||||
// titleCN = "\r\n\r\n" + titleCN + "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n";
|
||||
// WordUtil.exportWord(document, titleCN, null, ParagraphAlignment.CENTER, 0, 18,
|
||||
// false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
// WordUtil.exportWord(document, moth, null, ParagraphAlignment.CENTER, 0, 12,
|
||||
// false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
//
|
||||
// String year = lawsMonthlyReportWriteEOS.get(0).getMonth().split("-")[0];
|
||||
// String mothNew = lawsMonthlyReportWriteEOS.get(0).getMonth().split("-")[1];
|
||||
// int mothLast = Integer.valueOf(mothNew) + 1;
|
||||
//
|
||||
// //添加说明 2022/7/15 至 2022/8/14 期间发布的主要内容
|
||||
// String text = year + "/" + mothNew +"/15 至 "+year+"/"+mothLast+"/14期间发布的主要内容";
|
||||
// WordUtil.exportWord(document, text, null, ParagraphAlignment.CENTER, 0, 11,
|
||||
// false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
//
|
||||
// //添加换行
|
||||
// WordUtil.exportWord(document, "\r\n", null, ParagraphAlignment.CENTER, 0, null,
|
||||
// false, false, null,null,null,flag);
|
||||
//
|
||||
// //添加说明 编辑: 整车工程 - 法规与认证&环保与材料科团队
|
||||
// String text1 = "编辑: 整车工程 - 法规与认证&环保与材料科团队";
|
||||
// WordUtil.exportWord(document, text1, null, ParagraphAlignment.CENTER, 0, 11,
|
||||
// false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
//
|
||||
// //添加下一页
|
||||
// document.createParagraph().createRun().addBreak(BreakType.PAGE);
|
||||
// }
|
||||
//封面(office版本)
|
||||
private void coverEn(List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS,
|
||||
String titleCN,
|
||||
XWPFDocument document) {
|
||||
@@ -922,11 +1118,19 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
String mothNewEn = getMothEn(mothNew);
|
||||
String mothLastEn = getMothEn(String.valueOf(mothLast));
|
||||
|
||||
// String moth = lawsMonthlyReportWriteEOS.get(0).getMonth().replaceAll("-", "年") + "月";
|
||||
//标题前面添加一个换行
|
||||
WordUtil.exportWord(document, "", null, ParagraphAlignment.CENTER, 0, null,
|
||||
false, false, "Blue Sky Noto Regular",null,null,"break");
|
||||
|
||||
titleCN = "\r\n\r\n" + titleCN + "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n";
|
||||
//添加标题
|
||||
WordUtil.exportWord(document, titleCN, null, ParagraphAlignment.CENTER, 0, 18,
|
||||
false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
//标题下面添加8个换行
|
||||
for (int i = 0; i < 8; i++) {
|
||||
WordUtil.exportWord(document, "", null, ParagraphAlignment.CENTER, 0, null,
|
||||
false, false, "Blue Sky Noto Regular",null,null,"break");
|
||||
}
|
||||
|
||||
WordUtil.exportWord(document, moth, null, ParagraphAlignment.CENTER, 0, 12,
|
||||
false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
|
||||
@@ -949,6 +1153,47 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
//添加下一页
|
||||
document.createParagraph().createRun().addBreak(BreakType.PAGE);
|
||||
}
|
||||
//封面(WPS版本)
|
||||
// private void coverEn(List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS,
|
||||
// String titleCN,
|
||||
// XWPFDocument document) {
|
||||
// //封面标识
|
||||
// String flag = "cover";
|
||||
//
|
||||
// String year = lawsMonthlyReportWriteEOS.get(0).getMonth().split("-")[0];
|
||||
// String mothNew = lawsMonthlyReportWriteEOS.get(0).getMonth().split("-")[1];
|
||||
// int mothLast = Integer.valueOf(mothNew) + 1;
|
||||
// String moth = mothNew+"/"+year;
|
||||
// String mothNewEn = getMothEn(mothNew);
|
||||
// String mothLastEn = getMothEn(String.valueOf(mothLast));
|
||||
//
|
||||
//// String moth = lawsMonthlyReportWriteEOS.get(0).getMonth().replaceAll("-", "年") + "月";
|
||||
//
|
||||
// titleCN = "\r\n\r\n" + titleCN + "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n";
|
||||
// WordUtil.exportWord(document, titleCN, null, ParagraphAlignment.CENTER, 0, 18,
|
||||
// false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
// WordUtil.exportWord(document, moth, null, ParagraphAlignment.CENTER, 0, 12,
|
||||
// false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
//
|
||||
//
|
||||
//
|
||||
// //添加说明 Update between July 15, 2022 and August 14, 2022
|
||||
// String text = "Update between "+mothNewEn+" 15,"+year+" and "+mothLastEn+" 14,"+year;
|
||||
// WordUtil.exportWord(document, text, null, ParagraphAlignment.CENTER, 0, 11,
|
||||
// false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
//
|
||||
// //添加换行
|
||||
// WordUtil.exportWord(document, "\r\n", null, ParagraphAlignment.CENTER, 0, null,
|
||||
// false, false, null,null,null,flag);
|
||||
//
|
||||
// //添加说明 编辑: 整车工程 - 法规与认证&环保与材料科团队
|
||||
// String text1 = "Edit By: Regulation & Homologation, Environmental & Materials Team";
|
||||
// WordUtil.exportWord(document, text1, null, ParagraphAlignment.CENTER, 0, 11,
|
||||
// false, false, "Blue Sky Noto Regular",null,null,flag);
|
||||
//
|
||||
// //添加下一页
|
||||
// document.createParagraph().createRun().addBreak(BreakType.PAGE);
|
||||
// }
|
||||
|
||||
private String getMothEn(String moth){
|
||||
String result = "";
|
||||
@@ -1269,4 +1514,32 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
return infoPage;
|
||||
}
|
||||
|
||||
|
||||
public Page getPages(Integer currentPage, Integer pageSize, List<LawsMonthlyReportWriteEO> list){
|
||||
Page page =new Page();
|
||||
if(list==null){
|
||||
return null;
|
||||
}
|
||||
int size = list.size();
|
||||
if(pageSize > size){
|
||||
pageSize = size;
|
||||
}
|
||||
if(pageSize!=0){
|
||||
//求出最⼤页数,防⽌currentPage越界
|
||||
int maxPage = size % pageSize ==0? size / pageSize : size / pageSize +1;
|
||||
if(currentPage > maxPage){
|
||||
currentPage = maxPage;
|
||||
}
|
||||
}
|
||||
//当前页第⼀条数据的下标
|
||||
int curIdx = currentPage >1?(currentPage -1)* pageSize :0;
|
||||
List pageList =new ArrayList();
|
||||
//将当前页的数据放进pageList
|
||||
for(int i =0; i < pageSize && curIdx + i < size; i++){
|
||||
pageList.add(list.get(curIdx + i));
|
||||
}
|
||||
page.setCurrent(currentPage).setSize(pageSize).setTotal(list.size()).setRecords(pageList);
|
||||
return page;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+142
-49
@@ -128,6 +128,10 @@ public class WordUtil {
|
||||
}
|
||||
|
||||
XWPFRun titleParagraphRun = titleParagraph.createRun();
|
||||
//封面中的换行
|
||||
if("break".equals(flag)){
|
||||
titleParagraphRun.addBreak();
|
||||
}
|
||||
if (isNewline) {
|
||||
titleParagraphRun.setText("\r");
|
||||
} else {
|
||||
@@ -202,45 +206,7 @@ public class WordUtil {
|
||||
styles.addStyle(style);
|
||||
}
|
||||
|
||||
// @SneakyThrows
|
||||
// public static void exportHeardAndFoot(XWPFDocument document){
|
||||
//// XWPFDocument document = new XWPFDocument();
|
||||
//
|
||||
// // create header-footer
|
||||
// XWPFHeaderFooterPolicy headerFooterPolicy = document.getHeaderFooterPolicy();
|
||||
// if (headerFooterPolicy == null) headerFooterPolicy = document.createHeaderFooterPolicy();
|
||||
//
|
||||
// // create header start
|
||||
// XWPFHeader header = headerFooterPolicy.createHeader(XWPFHeaderFooterPolicy.DEFAULT);
|
||||
//
|
||||
// XWPFParagraph paragraph = header.createParagraph();
|
||||
// paragraph.setAlignment(ParagraphAlignment.CENTER);
|
||||
//
|
||||
// XWPFRun run = paragraph.createRun();
|
||||
// run.setText("Header");
|
||||
//
|
||||
// // create footer start
|
||||
// XWPFFooter footer = headerFooterPolicy.createFooter(XWPFHeaderFooterPolicy.DEFAULT);
|
||||
//
|
||||
// paragraph = footer.createParagraph();
|
||||
// paragraph.setAlignment(ParagraphAlignment.CENTER);
|
||||
//
|
||||
// run = paragraph.createRun();
|
||||
// run.setText("Footer");
|
||||
//
|
||||
// CTSectPr sectPr = document.getDocument().getBody().getSectPr();
|
||||
// if (sectPr == null) sectPr = document.getDocument().getBody().addNewSectPr();
|
||||
// CTPageMar pageMar = sectPr.getPgMar();
|
||||
// if (pageMar == null) pageMar = sectPr.addNewPgMar();
|
||||
// pageMar.setLeft(BigInteger.valueOf(2000)); //720 TWentieths of an Inch Point (Twips) = 720/20 = 36 pt = 36/72 = 0.5"
|
||||
// pageMar.setRight(BigInteger.valueOf(720));
|
||||
// pageMar.setTop(BigInteger.valueOf(1440)); //1440 Twips = 1440/20 = 72 pt = 72/72 = 1"
|
||||
// pageMar.setBottom(BigInteger.valueOf(1440));
|
||||
//
|
||||
// pageMar.setHeader(BigInteger.valueOf(2000)); //45.4 pt * 20 = 908 = 45.4 pt header from top
|
||||
// pageMar.setFooter(BigInteger.valueOf(568)); //28.4 pt * 20 = 568 = 28.4 pt footer from bottom
|
||||
//
|
||||
// }
|
||||
//主要内容生成页眉页脚(office版本)
|
||||
@SneakyThrows
|
||||
public static void exportHeardAndFoot(XWPFDocument document,String month){
|
||||
XWPFHeaderFooterPolicy headerFooterPolicy = document.getHeaderFooterPolicy();
|
||||
@@ -266,7 +232,7 @@ public class WordUtil {
|
||||
picture.getCTPicture().getBlipFill().getBlip().setEmbed(blipID);
|
||||
run.addTab();
|
||||
is.close();
|
||||
run.setText(" "+month);
|
||||
run.setText(" "+month);
|
||||
run.setFontSize(11);
|
||||
run.setFontFamily("Blue Sky Noto Regular");
|
||||
}
|
||||
@@ -313,20 +279,107 @@ public class WordUtil {
|
||||
|
||||
CTSectPr sectPr = document.getDocument().getBody().getSectPr();
|
||||
if (sectPr == null) sectPr = document.getDocument().getBody().addNewSectPr();
|
||||
//设置页面大小
|
||||
//设置页面大小(21*29.7)
|
||||
CTPageSz pgSz = sectPr.addNewPgSz();
|
||||
pgSz.setW(BigInteger.valueOf(11907));
|
||||
pgSz.setH(BigInteger.valueOf(16840));
|
||||
pgSz.setW(BigInteger.valueOf(11905));
|
||||
pgSz.setH(BigInteger.valueOf(16838));
|
||||
CTPageMar pageMar = sectPr.getPgMar();
|
||||
if (pageMar == null) pageMar = sectPr.addNewPgMar();
|
||||
pageMar.setLeft(BigInteger.valueOf(1803)); //左边距
|
||||
pageMar.setRight(BigInteger.valueOf(1803));//右边距
|
||||
pageMar.setLeft(BigInteger.valueOf(1797)); //左边距
|
||||
pageMar.setRight(BigInteger.valueOf(1797));//右边距
|
||||
pageMar.setTop(BigInteger.valueOf(1440)); //页眉高度
|
||||
pageMar.setBottom(BigInteger.valueOf(1440));//页脚高度
|
||||
|
||||
pageMar.setHeader(BigInteger.valueOf(720)); //页眉上边框到顶部的距离
|
||||
pageMar.setFooter(BigInteger.valueOf(720)); //页脚下边框到底部的距离
|
||||
}
|
||||
//主要内容生成页眉页脚(WPS版本)
|
||||
// @SneakyThrows
|
||||
// public static void exportHeardAndFoot(XWPFDocument document,String month){
|
||||
// XWPFHeaderFooterPolicy headerFooterPolicy = document.getHeaderFooterPolicy();
|
||||
// if (headerFooterPolicy == null) headerFooterPolicy = document.createHeaderFooterPolicy();
|
||||
// XWPFHeader header = headerFooterPolicy.createHeader(XWPFHeaderFooterPolicy.DEFAULT);
|
||||
//
|
||||
//// String logoFilePath = "/jero-boot/home/weilai.png";
|
||||
// String logoFilePath = WordUtil.class.getClassLoader().getResource("static/home/weilai.png").getPath();
|
||||
// //页眉第一个段落展示logo-----------------------------------------------------------------------------------
|
||||
// if (org.apache.commons.lang3.StringUtils.isNotBlank(logoFilePath)) {
|
||||
// XWPFParagraph logo = header.createParagraph();
|
||||
// logo.setAlignment(ParagraphAlignment.LEFT);
|
||||
// XWPFRun run = logo.createRun();
|
||||
//
|
||||
// String imgFile = logoFilePath;
|
||||
// InputStream is = WordUtil.class.getClassLoader().getResourceAsStream("static/home/weilai.png");
|
||||
//// InputStream is = new FileInputStream(imgFile);
|
||||
// XWPFPicture picture = run.addPicture(is, XWPFDocument.PICTURE_TYPE_PNG, imgFile, Units.toEMU(95), Units.toEMU(35));
|
||||
// String blipID = "";
|
||||
// for(XWPFPictureData picturedata : header.getAllPackagePictures()) { //这段必须有,不然打开的logo图片不显示
|
||||
// blipID = header.getRelationId(picturedata);
|
||||
// }
|
||||
// picture.getCTPicture().getBlipFill().getBlip().setEmbed(blipID);
|
||||
// run.addTab();
|
||||
// is.close();
|
||||
// run.setText(" "+month);
|
||||
// run.setFontSize(11);
|
||||
// run.setFontFamily("Blue Sky Noto Regular");
|
||||
// }
|
||||
// //页眉第二个段落展示日期------------------------------------------------------------
|
||||
// XWPFParagraph paragraph = header.createParagraph();//创建新的段落
|
||||
//// paragraph.setAlignment(ParagraphAlignment.RIGHT);//段落文本的对齐方式
|
||||
// XWPFRun run = paragraph.createRun();
|
||||
//// run.setText(month);
|
||||
//
|
||||
// //页脚(三个段落分别展示3个内容)-----------------------------------------------------
|
||||
// XWPFFooter footer = headerFooterPolicy.createFooter(XWPFHeaderFooterPolicy.DEFAULT);
|
||||
//
|
||||
// paragraph = footer.createParagraph();
|
||||
// paragraph.setAlignment(ParagraphAlignment.CENTER);
|
||||
// run = paragraph.createRun();
|
||||
// run.setText("NIO Internal");
|
||||
// run.setFontSize(11);
|
||||
// run.setFontFamily("Blue Sky Standard Regular");
|
||||
//
|
||||
// paragraph = footer.createParagraph();
|
||||
// paragraph.setAlignment(ParagraphAlignment.LEFT);
|
||||
// run = paragraph.createRun();
|
||||
// run.setText("NIO.com");
|
||||
// run.setFontSize(11);
|
||||
// run.setFontFamily("Blue Sky Noto Regular");
|
||||
//
|
||||
// //生成页码---------------------------------------------------------------------
|
||||
// paragraph = footer.createParagraph();
|
||||
// paragraph.setAlignment(ParagraphAlignment.RIGHT);
|
||||
// run = paragraph.createRun();
|
||||
// CTFldChar fldChar = run.getCTR().addNewFldChar();
|
||||
// fldChar.setFldCharType(STFldCharType.Enum.forString("begin"));
|
||||
//
|
||||
// run = paragraph.createRun();
|
||||
// CTText ctText = run.getCTR().addNewInstrText();
|
||||
// ctText.setStringValue("PAGE \\* MERGEFORMAT");
|
||||
// ctText.setSpace(SpaceAttribute.Space.Enum.forString("preserve"));
|
||||
//
|
||||
// fldChar = run.getCTR().addNewFldChar();
|
||||
// fldChar.setFldCharType(STFldCharType.Enum.forString("end"));
|
||||
// //----------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
// CTSectPr sectPr = document.getDocument().getBody().getSectPr();
|
||||
// if (sectPr == null) sectPr = document.getDocument().getBody().addNewSectPr();
|
||||
// //设置页面大小
|
||||
// CTPageSz pgSz = sectPr.addNewPgSz();
|
||||
// pgSz.setW(BigInteger.valueOf(11907));
|
||||
// pgSz.setH(BigInteger.valueOf(16840));
|
||||
// CTPageMar pageMar = sectPr.getPgMar();
|
||||
// if (pageMar == null) pageMar = sectPr.addNewPgMar();
|
||||
// pageMar.setLeft(BigInteger.valueOf(1803)); //左边距
|
||||
// pageMar.setRight(BigInteger.valueOf(1803));//右边距
|
||||
// pageMar.setTop(BigInteger.valueOf(1440)); //页眉高度
|
||||
// pageMar.setBottom(BigInteger.valueOf(1440));//页脚高度
|
||||
//
|
||||
// pageMar.setHeader(BigInteger.valueOf(720)); //页眉上边框到顶部的距离
|
||||
// pageMar.setFooter(BigInteger.valueOf(720)); //页脚下边框到底部的距离
|
||||
// }
|
||||
|
||||
/**
|
||||
* 主页面(只有页脚)
|
||||
@@ -356,18 +409,58 @@ public class WordUtil {
|
||||
if (sectPr == null) sectPr = document.getDocument().getBody().addNewSectPr();
|
||||
//设置页面大小
|
||||
CTPageSz pgSz = sectPr.addNewPgSz();
|
||||
pgSz.setW(BigInteger.valueOf(11907));
|
||||
pgSz.setH(BigInteger.valueOf(16840));
|
||||
pgSz.setW(BigInteger.valueOf(11905));
|
||||
pgSz.setH(BigInteger.valueOf(16838));
|
||||
CTPageMar pageMar = sectPr.getPgMar();
|
||||
if (pageMar == null) pageMar = sectPr.addNewPgMar();
|
||||
pageMar.setLeft(BigInteger.valueOf(1803)); //左边距
|
||||
pageMar.setRight(BigInteger.valueOf(1803));//右边距
|
||||
pageMar.setLeft(BigInteger.valueOf(1797)); //左边距
|
||||
pageMar.setRight(BigInteger.valueOf(1797));//右边距
|
||||
pageMar.setTop(BigInteger.valueOf(1440)); //页眉高度
|
||||
pageMar.setBottom(BigInteger.valueOf(1440));//页脚高度
|
||||
|
||||
pageMar.setHeader(BigInteger.valueOf(500)); //页眉上边框到顶部的距离
|
||||
pageMar.setFooter(BigInteger.valueOf(1200)); //页脚下边框到底部的距离
|
||||
}
|
||||
// /**
|
||||
// * 主页面(只有页脚 WPS版本)
|
||||
// * @param document
|
||||
// * @param month
|
||||
// */
|
||||
// @SneakyThrows
|
||||
// public static void exportHeardAndFootMain(XWPFDocument document,String month){
|
||||
// XWPFHeaderFooterPolicy headerFooterPolicy = document.getHeaderFooterPolicy();
|
||||
// if (headerFooterPolicy == null) headerFooterPolicy = document.createHeaderFooterPolicy();
|
||||
//// XWPFHeader header = headerFooterPolicy.createHeader(XWPFHeaderFooterPolicy.DEFAULT);
|
||||
//// XWPFParagraph paragraph = header.createParagraph();//创建新的段落
|
||||
//// XWPFRun run = paragraph.createRun();
|
||||
//
|
||||
// XWPFFooter footer = headerFooterPolicy.createFooter(XWPFHeaderFooterPolicy.DEFAULT);
|
||||
// XWPFParagraph paragraph = footer.createParagraph();
|
||||
// paragraph.setAlignment(ParagraphAlignment.CENTER);
|
||||
// XWPFRun run = paragraph.createRun();
|
||||
// run.setText("NIO Internal");
|
||||
// run.setFontSize(18);
|
||||
// run.setFontFamily("Blue Sky Standard Regular");
|
||||
//// run.setFontFamily("Blue Sky Noto Regular");
|
||||
// run.setBold(true);
|
||||
//
|
||||
//
|
||||
// CTSectPr sectPr = document.getDocument().getBody().getSectPr();
|
||||
// if (sectPr == null) sectPr = document.getDocument().getBody().addNewSectPr();
|
||||
// //设置页面大小
|
||||
// CTPageSz pgSz = sectPr.addNewPgSz();
|
||||
// pgSz.setW(BigInteger.valueOf(11907));
|
||||
// pgSz.setH(BigInteger.valueOf(16840));
|
||||
// CTPageMar pageMar = sectPr.getPgMar();
|
||||
// if (pageMar == null) pageMar = sectPr.addNewPgMar();
|
||||
// pageMar.setLeft(BigInteger.valueOf(1803)); //左边距
|
||||
// pageMar.setRight(BigInteger.valueOf(1803));//右边距
|
||||
// pageMar.setTop(BigInteger.valueOf(1440)); //页眉高度
|
||||
// pageMar.setBottom(BigInteger.valueOf(1440));//页脚高度
|
||||
//
|
||||
// pageMar.setHeader(BigInteger.valueOf(500)); //页眉上边框到顶部的距离
|
||||
// pageMar.setFooter(BigInteger.valueOf(1200)); //页脚下边框到底部的距离
|
||||
// }
|
||||
|
||||
/**
|
||||
* 导出工具示例
|
||||
|
||||
+7
-7
@@ -576,13 +576,13 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
}
|
||||
}
|
||||
//如果value中包含英文单、双引号,替换成中文的。 英文的符号影响到法规技术评估流程了。
|
||||
if(entry.getValue() != null){
|
||||
if(StringUtils.contains(entry.getValue().toString(),"'") || StringUtils.contains(entry.getValue().toString(),"\"")){
|
||||
String key = entry.getKey();
|
||||
String value = entry.getValue().toString().replaceAll("'", "‘").replaceAll("\"", "”");
|
||||
record1.put(key,value);
|
||||
}
|
||||
}
|
||||
// if(entry.getValue() != null){
|
||||
// if(StringUtils.contains(entry.getValue().toString(),"'") || StringUtils.contains(entry.getValue().toString(),"\"")){
|
||||
// String key = entry.getKey();
|
||||
// String value = entry.getValue().toString().replaceAll("'", "‘").replaceAll("\"", "”");
|
||||
// record1.put(key,value);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
// 拼接文件名
|
||||
|
||||
Reference in New Issue
Block a user