Browse Source

导出修改

develop
wangsixiang 4 months ago
parent
commit
3fa4ecc74f
  1. 11
      zc-business/src/main/java/com/zc/business/controller/DcPublishManageController.java
  2. 29
      zc-business/src/main/java/com/zc/business/domain/DcPublishManage.java

11
zc-business/src/main/java/com/zc/business/controller/DcPublishManageController.java

@ -344,17 +344,6 @@ public class DcPublishManageController extends BaseController
@Log(title = "信息发布管理记录", businessType = BusinessType.EXPORT) @Log(title = "信息发布管理记录", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response,@RequestBody DcPublishManage dcPublishManage) throws UnsupportedEncodingException { public void export(HttpServletResponse response,@RequestBody DcPublishManage dcPublishManage) throws UnsupportedEncodingException {
String percentEncodedFileName= URLEncoder.encode("公众服务统计.xlsx", StandardCharsets.UTF_8.toString()).replaceAll("\\+", "%20");
StringBuilder contentDispositionValue = new StringBuilder();
contentDispositionValue.append("attachment; filename=")
.append(percentEncodedFileName)
.append(";")
.append("filename*=")
.append("utf-8''")
.append(percentEncodedFileName);
response.addHeader("Access-Control-Expose-Headers", "Content-Disposition,download-filename");
response.setHeader("Content-disposition", contentDispositionValue.toString());
response.setHeader("download-filename", percentEncodedFileName);
List<DcPublishManage> list = dcPublishManageService.selectDcPublishManageExport(dcPublishManage); List<DcPublishManage> list = dcPublishManageService.selectDcPublishManageExport(dcPublishManage);
ExcelUtil<DcPublishManage> util = new ExcelUtil<>(DcPublishManage.class); ExcelUtil<DcPublishManage> util = new ExcelUtil<>(DcPublishManage.class);
util.exportExcel(response, list, UniversalEnum.INFORMATION_RELEASE_MANAGEMENT_RECORD_DATA.getValue()); util.exportExcel(response, list, UniversalEnum.INFORMATION_RELEASE_MANAGEMENT_RECORD_DATA.getValue());

29
zc-business/src/main/java/com/zc/business/domain/DcPublishManage.java

@ -41,12 +41,25 @@ public class DcPublishManage extends BaseEntity
@Excel(name = "发布渠道",readConverterExp="1=手机短信,2=微信公众号,3=微博,4=情报板,5=服务网站,6=微信小程序,7=语音广播,8=企业微信") @Excel(name = "发布渠道",readConverterExp="1=手机短信,2=微信公众号,3=微博,4=情报板,5=服务网站,6=微信小程序,7=语音广播,8=企业微信")
private Integer publishChannels; private Integer publishChannels;
/** 发布时间 */
@Excel(name = "发布时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date publishTime;
//位置
@Excel(name = "位置/设备")
private String position;
/** 事件详情 */
@Excel(name = "发布内容")
private String contentDetails;
/** 审核状态:0-待审核1-已审核2-未通过 */ /** 审核状态:0-待审核1-已审核2-未通过 */
//@Excel(name = "审核状态: 0-待审核 1-已审核 2-未通过") //@Excel(name = "审核状态: 0-待审核 1-已审核 2-未通过")
private Integer isverify; private Integer isverify;
/** 发布者 */ /** 发布者 */
@Excel(name = "发布者") @Excel(name = "发布")
private String publisher; private String publisher;
/** 审核者1 */ /** 审核者1 */
@ -75,18 +88,12 @@ public class DcPublishManage extends BaseEntity
//@Excel(name = "审核者2意见") //@Excel(name = "审核者2意见")
private String auditComment2; private String auditComment2;
/** 发布时间 */
@Excel(name = "发布时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date publishTime;
/** 发布状态:1-成功2-失败3-草稿 */ /** 发布状态:1-成功2-失败3-草稿 */
@Excel(name = "发布状态",readConverterExp="1=成功,2=失败,3=草稿") @Excel(name = "发布结果",readConverterExp="1=成功,2=失败,3=草稿")
private Integer publishStatus; private Integer publishStatus;
/** 事件详情 */
@Excel(name = "内容")
private String contentDetails;
//@Excel(name = "方向", readConverterExp = "1=菏泽方向,3=济南方向") //@Excel(name = "方向", readConverterExp = "1=菏泽方向,3=济南方向")
private String direction; private String direction;
@ -123,9 +130,7 @@ public class DcPublishManage extends BaseEntity
//位置
@Excel(name = "位置/设备")
private String position;
public String getPosition() { public String getPosition() {
return position; return position;

Loading…
Cancel
Save