Merge remote-tracking branch 'origin/dev_third_stage' into dev_third_stage

This commit is contained in:
wangzhijiang
2022-09-28 17:56:18 +08:00
14 changed files with 317 additions and 147 deletions
@@ -166,8 +166,9 @@ public class SarFileCompareItemCommentController extends JeroController<SarFileC
@AutoLog(value = "文档对比信息条款评论表-查询对比结果")
@ApiOperation(value = "文档对比信息条款评论表-查询对比结果", notes = "文档对比信息条款评论表-查询对比结果")
@GetMapping(value = "/queryCompareResult")
public Result<SarFileCompareResultVO> queryCompareResult(@RequestParam(name = "infoId", required = true) String infoId) {
SarFileCompareResultVO res = sarFileCompareItemCommentService.queryCompareResult(infoId);
public Result<SarFileCompareResultVO> queryCompareResult(@RequestParam(name = "infoId", required = true) String infoId,
@RequestParam(name = "comment", required = false) String comment) {
SarFileCompareResultVO res = sarFileCompareItemCommentService.queryCompareResult(infoId,comment);
return Result.OK(res);
}
@@ -178,8 +179,9 @@ public class SarFileCompareItemCommentController extends JeroController<SarFileC
@RequestParam(name = "selectIds", required = true) String selectIds,
@RequestParam(name = "includeComments", required = true) boolean includeComments,
@RequestParam(name = "cut", required = true) String cut,
HttpServletResponse response,HttpServletRequest request) {
sarFileCompareItemCommentService.exportResXls(request,response, infoId, selectIds, includeComments, cut);
HttpServletResponse response,HttpServletRequest request,
@RequestParam(name = "comment", required = false) String comment) {
sarFileCompareItemCommentService.exportResXls(request,response, infoId, selectIds, includeComments, cut,comment);
}
}
@@ -65,9 +65,9 @@ public interface ISarFileCompareItemCommentService extends IService<SarFileCompa
*/
List<SarFileCompareItemComment> queryList();
SarFileCompareResultVO queryCompareResult(String infoId);
SarFileCompareResultVO queryCompareResult(String infoId,String comment);
void exportResXls(HttpServletRequest request,HttpServletResponse response, String infoId, String selectIds, boolean includeComments, String cut);
void exportResXls(HttpServletRequest request,HttpServletResponse response, String infoId, String selectIds, boolean includeComments, String cut,String comment);
void consensusAssessment(SarFileCompareItemComment sarFileCompareItemComment);
}
@@ -11,6 +11,7 @@ import com.jero.modules.compare.service.ISarFileCompareInfoService;
import com.jero.modules.compare.service.ISarFileCompareItemCommentService;
import com.jero.modules.compare.service.ISarFileCompareItemService;
import com.jero.modules.system.util.StringUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
import org.apache.poi.hssf.usermodel.HSSFPatriarch;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
@@ -134,7 +135,7 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl<SarFileCom
}
@Override
public SarFileCompareResultVO queryCompareResult(String infoId) {
public SarFileCompareResultVO queryCompareResult(String infoId,String comment) {
SarFileCompareResultVO resultVO = new SarFileCompareResultVO();
SarFileCompareInfo sfcInfo = sarFileCompareInfoServiceImpl.queryById(infoId);
resultVO.setInfoId(infoId);
@@ -144,7 +145,7 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl<SarFileCom
resultVO.setFileNameRight(sfcInfo.getFileNameRight());
resultVO.setComments(sfcInfo.getComments());
List<SarFileCompareItemComment> list = queryListByInfoId(infoId);
List<SarFileCompareItemComment> list = queryListByInfoId(infoId,comment);
Map<String, SarFileCompareItem> sfcItemMap = SarFileCompareItemServiceImpl.queryMapByInfoId(infoId);
for (SarFileCompareItemComment sfcItemCom : list) {
SarFileCompareItemComVO itemComVO = new SarFileCompareItemComVO();
@@ -174,8 +175,11 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl<SarFileCom
}
public List<SarFileCompareItemComment> queryListByInfoId(String infoId) {
public List<SarFileCompareItemComment> queryListByInfoId(String infoId,String comment) {
LambdaQueryWrapper<SarFileCompareItemComment> queryWrapper = new LambdaQueryWrapper<>();
if (ObjectUtils.isNotEmpty(comment)) {
queryWrapper.eq(SarFileCompareItemComment::getComment, comment);
}
queryWrapper.eq(SarFileCompareItemComment::getInfoId, infoId);
queryWrapper.orderBy(true, true, SarFileCompareItemComment::getCreateTime);
List<SarFileCompareItemComment> list = this.list(queryWrapper);
@@ -183,7 +187,7 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl<SarFileCom
}
@Override
public void exportResXls(HttpServletRequest request,HttpServletResponse response, String infoId, String selectIds, boolean includeComments, String cut) {
public void exportResXls(HttpServletRequest request,HttpServletResponse response, String infoId, String selectIds, boolean includeComments, String cut,String comment) {
List<SarFileCompareItemComment> list = null;
if (includeComments && StringUtils.isEmpty(selectIds)) {
//只导出全文评论的情况
@@ -194,6 +198,9 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl<SarFileCom
if (!StringUtils.isEmpty(selectIds)) {
queryWrapper.in(SarFileCompareItemComment::getId, Arrays.asList(selectIds.split(",")));
}
if (ObjectUtils.isNotEmpty(comment)) {
queryWrapper.eq(SarFileCompareItemComment::getComment, comment);
}
queryWrapper.orderBy(true, true, SarFileCompareItemComment::getCreateTime);
list = this.list(queryWrapper);
}
@@ -648,7 +648,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
XWPFDocument documentContentCn = new XWPFDocument();
FileOutputStream outContentCn = new FileOutputStream(wordFileContentCn);
//封面
cover(lawsMonthlyReportWriteEOS, titleCN, documentContentCn);
coverCn(lawsMonthlyReportWriteEOS, titleCN, documentContentCn);
// //目录
// catalogue(lawsMonthlyReportWriteEOS, lawsMonthlyReportTitleTemplateEOS, reportTitleOneList, "目录", documentContentCn,CutEnum.CN.getValue());
wordContent(lawsMonthlyReportWriteEOS, lawsMonthlyReportTitleTemplateEOS, reportTitleOneList, titleCN,
@@ -662,7 +662,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
XWPFDocument documentContentEn = new XWPFDocument();
FileOutputStream outContentEn = new FileOutputStream(wordFileContentEn);
//封面
cover(lawsMonthlyReportWriteEOS, titleEN, documentContentEn);
coverEn(lawsMonthlyReportWriteEOS, titleEN, documentContentEn);
// //目录
// catalogue(lawsMonthlyReportWriteEOS, lawsMonthlyReportTitleTemplateEOS, reportTitleOneList, "catalogue", documentContentEn,CutEnum.EN.getValue());
wordContent(lawsMonthlyReportWriteEOS, lawsMonthlyReportTitleTemplateEOS, reportTitleOneList, titleEN,
@@ -738,10 +738,10 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
String moth = lawsMonthlyReportWriteEOS.get(0).getMonth().replaceAll("-", "") + "";
//标题
WordUtil.exportWord(document, titleCN, null, ParagraphAlignment.CENTER, 0, 14,
false, false, "Blue Sky Noto Regular",null,null);
false, false, "Blue Sky Noto Regular",null,null,null);
//主要内容
WordUtil.exportWord(document, content, null, ParagraphAlignment.LEFT, 0, 12,
false, true, "Blue Sky Noto Regular",null,null);
false, true, "Blue Sky Noto Regular",null,null,null);
//生成页脚
WordUtil.exportHeardAndFootMain(document,moth);
int oneCount = 1;
@@ -758,7 +758,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
}
if(StringUtils.isNotBlank(oneTitle)){
WordUtil.exportWord(document, oneNumber+" "+oneTitle, null, ParagraphAlignment.LEFT,
0, 12, false, true, "Blue Sky Noto Regular","0","一级标题");
0, 12, false, true, "Blue Sky Noto Regular","0","一级标题",null);
oneCount++;
}
@@ -781,7 +781,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
}
if(StringUtils.isNotBlank(twoTitle)){
WordUtil.exportWord(document, twoNumber+" "+twoTitle, null, ParagraphAlignment.LEFT,
2, 12, false, true, "Blue Sky Noto Regular","1","二级标题");
2, 12, false, true, "Blue Sky Noto Regular","1","二级标题",null);
twoCount++;
}
@@ -795,7 +795,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
}
if(org.apache.commons.lang3.StringUtils.isNotBlank(reportTitle)){
WordUtil.exportWord(document, reportCount+". "+reportTitle, null, ParagraphAlignment.LEFT,
4, 12, false, false, "Blue Sky Noto Regular","2","三级标题");
4, 12, false, false, "Blue Sky Noto Regular","2","三级标题",null);
reportCount++;
}
}
@@ -812,7 +812,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
String moth = lawsMonthlyReportWriteEOS.get(0).getMonth().replaceAll("-", "") + "";
//单独设置每页右侧的时间
WordUtil.exportWord(document, catalogue, null, ParagraphAlignment.LEFT, 0, 18,
false, false, "Blue Sky Noto Regular",null,null);
false, false, "Blue Sky Noto Regular",null,null,null);
int oneCount = 1;
@@ -828,7 +828,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
}
if(StringUtils.isNotBlank(oneTitle)){
WordUtil.exportWord(document, oneNumber+" "+oneTitle, null, ParagraphAlignment.LEFT,
0, 12, false, true, "Blue Sky Noto Regular",null,null);
0, 12, false, true, "Blue Sky Noto Regular",null,null,null);
oneCount++;
}
@@ -851,7 +851,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
}
if(StringUtils.isNotBlank(twoTitle)){
WordUtil.exportWord(document, twoNumber+" "+twoTitle, null, ParagraphAlignment.LEFT,
0, 12, false, true, "Blue Sky Noto Regular",null,null);
0, 12, false, true, "Blue Sky Noto Regular",null,null,null);
twoCount++;
}
@@ -865,7 +865,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
}
if(org.apache.commons.lang3.StringUtils.isNotBlank(reportTitle)){
WordUtil.exportWord(document, reportCount+". "+reportTitle, null, ParagraphAlignment.LEFT,
0, 12, false, false, "Blue Sky Noto Regular",null,null);
0, 12, false, false, "Blue Sky Noto Regular",null,null,null);
reportCount++;
}
}
@@ -874,16 +874,32 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
}
//封面
private void cover(List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS,
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\r\n\r\n\r\n";
WordUtil.exportWord(document, titleCN, null, ParagraphAlignment.CENTER, 0, 18,
false, false, "Blue Sky Noto Regular",null,null);
WordUtil.exportWord(document, moth, null, ParagraphAlignment.CENTER, 0, 12,
false, true, "Blue Sky Noto Regular",null,null);
false, false, "Blue Sky Noto Regular",null,null,flag);
WordUtil.exportWord(document, moth+"\r\n", null, ParagraphAlignment.CENTER, 0, 12,
false, true, "Blue Sky Noto Regular",null,null,flag);
}
//封面
private void coverEn(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\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+"\r\n", null, ParagraphAlignment.CENTER, 0, 12,
false, true, "Blue Sky Noto Regular",null,null,flag);
}
private void wordContent(List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS,
List<LawsMonthlyReportTitleTemplateEO> lawsMonthlyReportTitleTemplateEOS,
@@ -904,8 +920,8 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
//生成页眉页脚
WordUtil.exportHeardAndFoot(document,moth);
//生成标题
WordUtil.exportWord(document, "", null, ParagraphAlignment.CENTER, 0, 18,
false, true, "Blue Sky Noto Regular",null,null);
// WordUtil.exportWord(document, "", null, ParagraphAlignment.CENTER, 0, 18,
// false, true, "Blue Sky Noto Regular",null,null,null);
int oneCount = 1;
for (LawsMonthlyReportTitleTemplateEO lawsMonthlyReportTitleTemplateEO : reportTitleOneList) {
@@ -924,7 +940,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
}
if(StringUtils.isNotBlank(oneTitle)){
WordUtil.exportWord(document, oneNumber+" "+oneTitle, null, ParagraphAlignment.LEFT,
0, 14, false, true, "Blue Sky Noto Regular","0","一级标题");
0, 14, false, true, "Blue Sky Noto Regular","0","一级标题","oneTitle");
oneCount++;
}
@@ -951,7 +967,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
}
if(StringUtils.isNotBlank(twoTitle)){
WordUtil.exportWord(document, twoNumber+" "+twoTitle, null, ParagraphAlignment.LEFT,
0, 12, false, true, "Blue Sky Noto Regular","1","二级标题");
0, 12, false, true, "Blue Sky Noto Regular","1","二级标题",null);
twoCount++;
}
//二级目录下放--->新征求意见清单模板, 新发布标准清单模板
@@ -960,13 +976,13 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
for (LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO : askList) {
WordUtil.exportWordExcelAsk(document,lawsMonthlyReportWriteEO,cut);
WordUtil.exportWord(document, null, null, null,
0, 0, false, true, null,null,null);
0, 0, false, true, null,null,null,null);
}
for (LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO : issueList) {
WordUtil.exportWordExcelIssue(document,lawsMonthlyReportWriteEO,cut);
WordUtil.exportWord(document, null, null, null, 0, 0,
false, true, null,null,null);
false, true, null,null,null,null);
}
for (LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO : lawsMonthlyReportWriteEOList) {
@@ -979,7 +995,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
}
if(StringUtils.isNotBlank(reportTitle)){
WordUtil.exportWord(document, reportCount+". "+reportTitle, null, ParagraphAlignment.LEFT,
0, 11, false, false, "Blue Sky Noto Regular","2","三级标题");
0, 11, false, false, "Blue Sky Noto Regular","2","三级标题",null);
}
@@ -82,6 +82,7 @@ public class WordUtil {
* @param fontFamily 字体,默认宋体
* @param directoryLevel 目录级别
* @param styleName 标题样式
* @param flag 封面标识(不做行间距处理)
*/
public static void exportWord(XWPFDocument document,
String text,
@@ -93,7 +94,8 @@ public class WordUtil {
Boolean isBold,
String fontFamily,
String directoryLevel,
String styleName) {
String styleName,
String flag) {
//设置标题级别
if(StringUtils.isNotEmpty(directoryLevel)){
@@ -103,6 +105,20 @@ public class WordUtil {
XWPFParagraph titleParagraph = document.createParagraph();
titleParagraph.setStyle(styleName);
//设置行间距
// if(!"cover".equals(flag) && !"oneTitle".equals(flag)){
// CTP ctp = titleParagraph.getCTP();
// CTPPr ppr = ctp.isSetPPr() ? ctp.getPPr() : ctp.addNewPPr();
// CTSpacing spacing = ppr.isSetSpacing()? ppr.getSpacing() : ppr.addNewSpacing();
// spacing.setAfter(BigInteger.valueOf(0));
// spacing.setBefore(BigInteger.valueOf(0));
// //设置行距类型为 EXACT
// spacing.setLineRule(STLineSpacingRule.EXACT);
// //1磅数是20
// spacing.setLine(BigInteger.valueOf(40*20));
// }
//设置段落左对齐
if (align == null) {
titleParagraph.setAlignment(ParagraphAlignment.LEFT);