|
|
|
@ -24,6 +24,7 @@ import org.apache.poi.hssf.util.HSSFColor;
|
|
|
|
|
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.VerticalAlignment;
|
|
|
|
|
import org.json.simple.JSONObject;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
@ -988,17 +989,26 @@ public class AddsNimsController extends ApplicationController {
|
|
|
|
|
|
|
|
|
|
CellDef.setValues(cellDefs, valueMap);
|
|
|
|
|
|
|
|
|
|
Style headerStyle = new Style().foregroundColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex())
|
|
|
|
|
.configure(styl -> {
|
|
|
|
|
styl.alignment(HorizontalAlignment.CENTER);
|
|
|
|
|
styl.alignment(VerticalAlignment.CENTER);
|
|
|
|
|
});
|
|
|
|
|
Style headerStyle2 = new Style().foregroundColor(HSSFColor.HSSFColorPredefined.GREY_50_PERCENT.getIndex())
|
|
|
|
|
.configure(styl -> {
|
|
|
|
|
Font font = xlsx.workbook().createFont();
|
|
|
|
|
font.setColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex());
|
|
|
|
|
styl.alignment(HorizontalAlignment.CENTER);
|
|
|
|
|
styl.alignment(VerticalAlignment.CENTER);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
xlsx.cell(0, 0).value("마약류 제품 구분별 현황").value(center).merge(0, cellDefs.size()-1);
|
|
|
|
|
xlsx.cell(0, 1).value("마약류 제품 구분별 현황").value(center).merge(1, cellDefs.size()-1);
|
|
|
|
|
// 관할관청 - rowspan
|
|
|
|
|
xlsx.cell(2, 0).value("관할관청").value(headerStyle).merge(2, 3, 0, 0);
|
|
|
|
|
xlsx.cell(2, 1).value("마약/향정 구분(폐기건수 / 폐기수량)").value(headerStyle2).merge(1, 7);
|
|
|
|
|
xlsx.cell(2, 8).value("중점/일반 구분(폐기건수 / 폐기수량)").value(headerStyle2).merge(8, 11);
|
|
|
|
|
xlsx.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)));
|
|
|
|
|
List<CellDef> cellDefs2 = cellDefs.subList(1, cellDefs.size());
|
|
|
|
|
xlsx.cell(3, 1).rowValues(CellDef.header(cellDefs2, () -> StyleMaker.headerStyle(xlsx)));
|
|
|
|
|
xlsx.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
|
|
|
|
|
|
|
|
|
|
ModelAndView mav = new ModelAndView("downloadView");
|
|
|
|
@ -1020,7 +1030,7 @@ public class AddsNimsController extends ApplicationController {
|
|
|
|
|
List<DataObject> list = addsNimsService.getDsuseMgtDsuseQyByPrdStatistics(query);
|
|
|
|
|
|
|
|
|
|
Map<String, Object> valueMap = new HashMap<String, Object>();
|
|
|
|
|
valueMap.put("No.", format.of("ROW_NUM").style(center));
|
|
|
|
|
valueMap.put("NO.", format.of("ROW_NUM").style(center));
|
|
|
|
|
valueMap.put("관할관청", format.of("dept_nm").style(center));
|
|
|
|
|
valueMap.put("제품코드", format.of("prduct_cd").style(center));
|
|
|
|
|
valueMap.put("제품명", format.of("prduct_nm").style(left));
|
|
|
|
@ -1033,17 +1043,31 @@ public class AddsNimsController extends ApplicationController {
|
|
|
|
|
|
|
|
|
|
CellDef.setValues(cellDefs, valueMap);
|
|
|
|
|
|
|
|
|
|
Style headerStyle = new Style().foregroundColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex())
|
|
|
|
|
.configure(styl -> {
|
|
|
|
|
styl.alignment(HorizontalAlignment.CENTER);
|
|
|
|
|
styl.alignment(VerticalAlignment.CENTER);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Style headerStyle2 = new Style().foregroundColor(HSSFColor.HSSFColorPredefined.GREY_50_PERCENT.getIndex())
|
|
|
|
|
.configure(styl -> {
|
|
|
|
|
Font font = xlsx.workbook().createFont();
|
|
|
|
|
font.setColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex());
|
|
|
|
|
styl.alignment(HorizontalAlignment.CENTER);
|
|
|
|
|
styl.alignment(VerticalAlignment.CENTER);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
xlsx.cell(0, 0).value("마약류 제품별 폐기 현황").value(center).merge(0, cellDefs.size()-1);
|
|
|
|
|
xlsx.cell(2, 1).value("마약/향정 구분").value(headerStyle2).merge(1, 7);
|
|
|
|
|
xlsx.cell(2, 8).value("중점/일반 구분").value(headerStyle2).merge(8, 11);
|
|
|
|
|
xlsx.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)));
|
|
|
|
|
// rowspan
|
|
|
|
|
xlsx.cell(2, 0).value("NO.").value(headerStyle).merge(2, 3, 0, 0);
|
|
|
|
|
xlsx.cell(2, 1).value("관할관청").value(headerStyle).merge(2, 3, 1, 1);
|
|
|
|
|
xlsx.cell(2, 2).value("제품코드").value(headerStyle).merge(2, 3, 2, 2);
|
|
|
|
|
xlsx.cell(2, 3).value("제품명").value(headerStyle).merge(2, 3, 3, 3);
|
|
|
|
|
xlsx.cell(2, 4).value("처리상태 별 (폐기건수 / 폐기수량)").value(headerStyle2).merge(4, 7);
|
|
|
|
|
xlsx.cell(2, 8).value("폐기건수").value(headerStyle).merge(2, 3, 8, 8);
|
|
|
|
|
xlsx.cell(2, 9).value("폐기수량").value(headerStyle).merge(2, 3, 9, 9);
|
|
|
|
|
List<CellDef> cellDefs2 = cellDefs.subList(4, cellDefs.size()-2);
|
|
|
|
|
xlsx.cell(3, 4).rowValues(CellDef.header(cellDefs2, () -> StyleMaker.headerStyle(xlsx)));
|
|
|
|
|
xlsx.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
|
|
|
|
|
|
|
|
|
|
ModelAndView mav = new ModelAndView("downloadView");
|
|
|
|
|