Browse Source

晾晒看板-任务名称导出设置

master
gjh 2 days ago
parent
commit
f833ebfccc
  1. 5
      huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/ProjectManagerController.java
  2. 60
      huzhou/src/main/java/com/easy/admin/modules/huzhou/converter/ReformNameConverter.java
  3. 8
      huzhou/src/main/java/com/easy/admin/modules/huzhou/dto/HuzhouProjectinfoExportDTO.java
  4. 3
      huzhou/src/main/java/com/easy/admin/modules/huzhou/entity/HuzhouProjectinfo.java

5
huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/ProjectManagerController.java

@ -106,7 +106,8 @@ public class ProjectManagerController {
projectInfo.getSuperiorFundPayRate(), projectInfo.getSuperiorFundPayRate(),
projectInfo.getCurrentStage(), projectInfo.getCurrentStage(),
projectInfo.getTotalPercent(), projectInfo.getTotalPercent(),
projectInfo.getDutyWorkplace())) projectInfo.getDutyWorkplace(),
projectInfo.getReformName()))
.collect(Collectors.toList()); .collect(Collectors.toList());
// for (HuzhouProjectinfoExportDTO huzhouProjectinfoExportDTO : dtoList) { // for (HuzhouProjectinfoExportDTO huzhouProjectinfoExportDTO : dtoList) {
@ -128,7 +129,7 @@ public class ProjectManagerController {
EasyExcel.write(response.getOutputStream(), HuzhouProjectinfoExportDTO.class) EasyExcel.write(response.getOutputStream(), HuzhouProjectinfoExportDTO.class)
.registerWriteHandler(new HorizontalCellStyleStrategy(headStyle, bodyStyle)) .registerWriteHandler(new HorizontalCellStyleStrategy(headStyle, bodyStyle))
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
.registerWriteHandler(new CustomMergeStrategy(Arrays.asList("dutyWorkplace"))) .registerWriteHandler(new CustomMergeStrategy(Arrays.asList("dutyWorkplace","reformName")))
.sheet("上级资金执行率汇总") .sheet("上级资金执行率汇总")
.doWrite(dtoList); .doWrite(dtoList);
} }

60
huzhou/src/main/java/com/easy/admin/modules/huzhou/converter/ReformNameConverter.java

@ -0,0 +1,60 @@
package com.easy.admin.modules.huzhou.converter;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
/**
* 所属改革任务转换器
*
* @author gjh
*/
public class ReformNameConverter implements Converter<String> {
/**
* Convert Java objects to excel objects
*
* @param value Java Data.NotNull.
* @param contentProperty Content property.Nullable.
* @param globalConfiguration Global configuration.NotNull.
* @return Data to put into a Excel
*/
@Override
public WriteCellData<?> convertToExcelData(String value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) {
switch (value) {
case "1":
return new WriteCellData<>("2+N紧密型城市医疗集团建设");
case "2":
return new WriteCellData<>("9+9+N县域医共体建设");
case "3":
return new WriteCellData<>("市县公立医院妇幼能力建设");
case "4":
return new WriteCellData<>("打造长三角市域医学高地");
case "5":
return new WriteCellData<>("高水平县级医院建设");
case "6":
return new WriteCellData<>("公立医院院前急救与院内救治服务融合发展");
case "7":
return new WriteCellData<>("医共体下三医联动改革");
case "8":
return new WriteCellData<>("智慧医院服务能力提档升级");
case "9":
return new WriteCellData<>("数字健康大脑建设");
case "10":
return new WriteCellData<>("高层次人才引育");
case "11":
return new WriteCellData<>("舒心就医");
case "12":
return new WriteCellData<>("中医药固本培元");
case "13":
return new WriteCellData<>("公立医院运营管理");
case "14":
return new WriteCellData<>("公立医院党建全行业引领改革工程");
case "15":
return new WriteCellData<>("高质量临床重点专科建设");
default:
return new WriteCellData<>("未知");
}
}
}

8
huzhou/src/main/java/com/easy/admin/modules/huzhou/dto/HuzhouProjectinfoExportDTO.java

@ -5,10 +5,14 @@ import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.NumberFormat; import com.alibaba.excel.annotation.format.NumberFormat;
import com.alibaba.excel.annotation.write.style.HeadStyle; import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.easy.admin.modules.huzhou.converter.ReformNameConverter;
import lombok.Data; import lombok.Data;
@HeadStyle(fillForegroundColor = 44) @HeadStyle(fillForegroundColor = 44)
@Data @Data
public class HuzhouProjectinfoExportDTO { public class HuzhouProjectinfoExportDTO {
@ExcelProperty(value = {"任务名称"}, converter = ReformNameConverter.class)
private String reformName;
@ExcelProperty("指导处室") @ExcelProperty("指导处室")
private String dutyWorkplace; private String dutyWorkplace;
@ -30,11 +34,13 @@ public class HuzhouProjectinfoExportDTO {
Double superiorFundPayRate, Double superiorFundPayRate,
String currentStage, String currentStage,
String totalPercent, String totalPercent,
String dutyWorkplace) { String dutyWorkplace,
String reformName) {
this.projectName = projectName; this.projectName = projectName;
this.superiorFundPayRate = superiorFundPayRate; this.superiorFundPayRate = superiorFundPayRate;
this.currentStage = currentStage; this.currentStage = currentStage;
this.totalPercent = totalPercent; this.totalPercent = totalPercent;
this.dutyWorkplace = dutyWorkplace; this.dutyWorkplace = dutyWorkplace;
this.reformName = reformName;
} }
} }

3
huzhou/src/main/java/com/easy/admin/modules/huzhou/entity/HuzhouProjectinfo.java

@ -204,7 +204,8 @@ public class HuzhouProjectinfo extends BaseEntity {
this.superiorFundPayRate, this.superiorFundPayRate,
this.currentStage, this.currentStage,
this.totalPercent, this.totalPercent,
this.dutyWorkplace); this.dutyWorkplace,
this.reformName);
} }
} }

Loading…
Cancel
Save