Compare commits

..

No commits in common. 'f7abee8455d9e4f1a857bf620ae7d5ad1edb9e85' and 'd55394e5a1ce970cb759de51194f7c1facb523fb' have entirely different histories.

  1. 4
      src/main/java/com/biutag/supervision/pojo/dto/complaintCollection/ComplaintCollectionExcelDTO.java
  2. 3
      src/main/java/com/biutag/supervision/pojo/dto/complaintCollection/ExportComplaintCollectionExcelVo.java
  3. 4
      src/main/java/com/biutag/supervision/pojo/request/complaintCollection/ComplaintCollectionAddRequest.java
  4. 49
      src/main/java/com/biutag/supervision/service/ModifiedVerifyContentCellWriteHandler.java
  5. 2
      src/main/java/com/biutag/supervision/service/NegativeReturnExportService.java
  6. 7
      src/main/resources/mapper/ComplaintCollectionMapper.xml

4
src/main/java/com/biutag/supervision/pojo/dto/complaintCollection/ComplaintCollectionExcelDTO.java

@ -1,6 +1,5 @@
package com.biutag.supervision.pojo.dto.complaintCollection;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import io.swagger.v3.oas.annotations.media.Schema;
@ -75,7 +74,8 @@ public class ComplaintCollectionExcelDTO {
@ColumnWidth(20)
private String publicRecognition;
@ExcelIgnore
@ExcelProperty("办理方式")
@ColumnWidth(20)
private String handleMethod;
@ExcelProperty("业务类别")

3
src/main/java/com/biutag/supervision/pojo/dto/complaintCollection/ExportComplaintCollectionExcelVo.java

@ -1,6 +1,5 @@
package com.biutag.supervision.pojo.dto.complaintCollection;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
@ -82,7 +81,7 @@ public class ExportComplaintCollectionExcelVo {
@ExcelProperty("群众认可")
private String publicRecognition;
@ExcelIgnore
@ExcelProperty("办理方式")
private String handleMethod;
@ExcelProperty("是否重复件")

4
src/main/java/com/biutag/supervision/pojo/request/complaintCollection/ComplaintCollectionAddRequest.java

@ -190,6 +190,10 @@ public class ComplaintCollectionAddRequest implements ParamChecked {
// if (CollectionUtil.isEmpty(tags)){
// throw new IllegalArgumentException("标签不能为空");
// }
if (StrUtil.isEmpty(handleMethod)){
throw new IllegalArgumentException("办理方式不能为空");
}
if (CollectionUtil.isNotEmpty(involveProblemIdList)){
involveProblemIdStr = involveProblemIdList.stream()
.filter(StrUtil::isNotBlank)

49
src/main/java/com/biutag/supervision/service/ModifiedVerifyContentCellWriteHandler.java

@ -2,37 +2,22 @@ package com.biutag.supervision.service;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.write.handler.CellWriteHandler;
import com.alibaba.excel.write.handler.RowWriteHandler;
import com.alibaba.excel.write.handler.context.CellWriteHandlerContext;
import com.alibaba.excel.write.handler.context.RowWriteHandlerContext;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.RichTextString;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFColor;
import org.apache.poi.xssf.usermodel.XSSFFont;
public class ModifiedVerifyContentCellWriteHandler implements CellWriteHandler, RowWriteHandler {
public class ModifiedVerifyContentCellWriteHandler implements CellWriteHandler {
private static final int MODIFIED_VERIFY_CONTENT_COLUMN_INDEX = 6;
private static final int FINAL_WRITE_ORDER = 60000;
private static final int ESTIMATED_CHARACTERS_PER_LINE = 55;
private static final float ROW_HEIGHT_PER_LINE = 20F;
private Font labelFont;
private Font arrowFont;
private CellStyle wrappedStyle;
@Override
public int order() {
return FINAL_WRITE_ORDER;
}
@Override
public void afterCellDispose(CellWriteHandlerContext context) {
if (Boolean.TRUE.equals(context.getHead())
@ -50,38 +35,21 @@ public class ModifiedVerifyContentCellWriteHandler implements CellWriteHandler,
String[] lines = content.split("\\n", -1);
int offset = 0;
for (String line : lines) {
int separatorIndex = line.indexOf('\uFF1A');
int separatorIndex = line.indexOf('');
if (separatorIndex > 0) {
richText.applyFont(offset, offset + separatorIndex, getLabelFont(workbook));
}
int arrowIndex = line.indexOf('\u2192', separatorIndex + 1);
int arrowIndex = line.indexOf('', separatorIndex + 1);
if (arrowIndex >= 0) {
richText.applyFont(offset + arrowIndex, offset + arrowIndex + 1, getArrowFont(workbook));
}
offset += line.length() + 1;
}
float requiredHeight = Math.max(cell.getRow().getHeightInPoints(), lines.length * 18F);
cell.getRow().setHeightInPoints(requiredHeight);
cell.setCellValue(richText);
}
@Override
public void afterRowDispose(RowWriteHandlerContext context) {
if (Boolean.TRUE.equals(context.getHead())) {
return;
}
Row row = context.getRow();
Cell contentCell = row.getCell(MODIFIED_VERIFY_CONTENT_COLUMN_INDEX);
if (contentCell == null || StrUtil.isBlank(contentCell.getStringCellValue())) {
return;
}
String[] lines = contentCell.getStringCellValue().split("\\n", -1);
int visualLineCount = 0;
for (String line : lines) {
visualLineCount += Math.max(1, (line.length() + ESTIMATED_CHARACTERS_PER_LINE - 1)
/ ESTIMATED_CHARACTERS_PER_LINE);
}
row.setHeightInPoints(Math.max(row.getHeightInPoints(), visualLineCount * ROW_HEIGHT_PER_LINE));
}
private Font getLabelFont(Workbook workbook) {
if (labelFont == null) {
labelFont = workbook.createFont();
@ -95,12 +63,8 @@ public class ModifiedVerifyContentCellWriteHandler implements CellWriteHandler,
if (arrowFont == null) {
arrowFont = workbook.createFont();
arrowFont.setBold(true);
if (arrowFont instanceof XSSFFont xssfFont) {
xssfFont.setColor(new XSSFColor(new byte[]{(byte) 255, 0, 0}, null));
} else {
arrowFont.setColor(IndexedColors.RED.getIndex());
}
}
return arrowFont;
}
@ -109,10 +73,7 @@ public class ModifiedVerifyContentCellWriteHandler implements CellWriteHandler,
wrappedStyle = workbook.createCellStyle();
wrappedStyle.cloneStyleFrom(cell.getCellStyle());
wrappedStyle.setWrapText(true);
wrappedStyle.setVerticalAlignment(VerticalAlignment.TOP);
wrappedStyle.setAlignment(HorizontalAlignment.LEFT);
}
cell.setCellStyle(wrappedStyle);
}
}

2
src/main/java/com/biutag/supervision/service/NegativeReturnExportService.java

@ -58,7 +58,7 @@ public class NegativeReturnExportService {
returnVo.setReturnTime(history.getCrtTime());
returnVo.setReturnUser(history.getCrtName());
returnVo.setReturnOpinion(parsedHistory.comments());
returnVo.setModifiedVerifyContent(null);
returnVo.setModifiedVerifyContent("尚未再次提交");
returnRecords.add(returnVo);
pendingReturn = new PendingReturn(parsedHistory.actionKey(), latestSnapshot, returnVo);
} else if (pendingReturn != null && parsedHistory.snapshot() != null) {

7
src/main/resources/mapper/ComplaintCollectionMapper.xml

@ -315,14 +315,7 @@
<if test="param.tags != null and param.tags.size > 0">
AND (
<foreach collection="param.tags" item="tagItem" separator=" OR ">
<choose>
<when test="tagItem == '__EMPTY__'">
(cc.tag IS NULL OR TRIM(cc.tag) = '')
</when>
<otherwise>
FIND_IN_SET(#{tagItem}, cc.tag)
</otherwise>
</choose>
</foreach>
)
</if>

Loading…
Cancel
Save