成球意见详情导出格式bug修改~~

This commit is contained in:
Mr.Z
2021-08-24 15:30:43 +08:00
parent 3d9952df59
commit c65edcbaab
5 changed files with 41 additions and 9 deletions
+6
View File
@@ -127,6 +127,12 @@
<artifactId>hanlp</artifactId>
<version>portable-1.7.5</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
@@ -21,4 +21,5 @@ public interface SarBussStandValDao extends BaseMapper<SarBussStandVal> {
int deleteDataByStandId(String standId);
int insertForeach(List<SarBussStandVal> list); //批量新增
}
@@ -10,6 +10,7 @@ import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
@@ -109,13 +110,24 @@ public class SarPublicIdeaAllController extends BaseController<SarPublicIdeaAll>
for (SarPublicIdeaAll sarPublicIdeaAll:data){
GetExcelDto getExcelDto=GetExcelDto.builder()
.partCode(sarPublicIdeaAll.getPartCode())
.content(sarPublicIdeaAll.getContent())
.oldText(sarPublicIdeaAll.getOldText())
.newText(sarPublicIdeaAll.getNewText())
.reason(sarPublicIdeaAll.getReason())
.userName(sarPublicIdeaAll.getUserName())
.deptName(sarPublicIdeaAll.getDeptName())
.build();
standExcel.add(getExcelDto);
}
EasyExcel.write(response.getOutputStream(),GetExcelDto.class).autoCloseStream(Boolean.FALSE).sheet("sheet1")
List<List<String>> headList=new ArrayList<List<String>>();
headList.add(Lists.newArrayList("章节编号"));
headList.add(Lists.newArrayList("修改意见内容(包括理由或依据)","修改前"));
headList.add(Lists.newArrayList("修改意见内容(包括理由或依据)","修改后"));
headList.add(Lists.newArrayList("修改意见内容(包括理由或依据)","修改理由"));
headList.add(Lists.newArrayList("提出部门"));
headList.add(Lists.newArrayList("提出人"));
EasyExcel.write(response.getOutputStream(),GetExcelDto.class).head(headList).autoCloseStream(Boolean.FALSE).sheet("sheet1")
.doWrite(standExcel);
} catch (Exception e) {
response.reset();
@@ -2,6 +2,7 @@ package com.adc.da.slrs.sarStandIdea.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentLoopMerge;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
@@ -23,13 +24,20 @@ import lombok.NoArgsConstructor;
@ColumnWidth(15)
public class GetExcelDto {
@ExcelProperty("章节编号")
// @ExcelProperty("章节编号")
private String partCode;
@ExcelProperty("修改意见内容(包括理由或依据)")
private String content;
@ExcelProperty("提出人")
private String userName;
@ExcelProperty("所在部门")
// @ExcelProperty("修改意见内容(包括理由或依据)")
// private String content;
private String oldText;
private String newText;
private String reason;
// @ExcelProperty("提出部门")
private String deptName;
// @ExcelProperty("提出人")
private String userName;
}
@@ -1398,7 +1398,12 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
}
}
page.setOrderBy("SAR_STANDARDS_INFO.issue_time is null,SAR_STANDARDS_INFO.issue_time desc,SAR_STANDARDS_INFO.id");
page.setUserId(LoginUserUtil.getUserId());
//不知道从哪来的代码,疑似从Dmaster拉下来的
if(standardsInfoExcelVO.getUserId() != null){
page.setUserId(standardsInfoExcelVO.getUserId());
}else {
page.setUserId(LoginUserUtil.getUserId());
}
List<SarStandardsInfo> getList = dao.getSarStandardsExportInfo(page);
attrInfoShow(getList);
return getList;