From ee024ee5431ad8c2e846adf569f3c11ea4c01a0d Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Thu, 25 Jul 2024 18:55:38 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=97=91=EC=85=80=20=EB=8B=A4=EC=9A=B4?= =?UTF-8?q?=EB=A1=9C=EB=93=9C=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cokr/xit/adds/cmmn/xls/FormatMaker.java | 16 --------- .../xit/adds/nims/web/AddsNimsController.java | 35 ++++++++++++------- .../dsuseMgtNcrdAndPrtmStatistics-main.jsp | 9 +++-- 3 files changed, 26 insertions(+), 34 deletions(-) delete mode 100644 src/main/java/cokr/xit/adds/cmmn/xls/FormatMaker.java diff --git a/src/main/java/cokr/xit/adds/cmmn/xls/FormatMaker.java b/src/main/java/cokr/xit/adds/cmmn/xls/FormatMaker.java deleted file mode 100644 index efe63d6..0000000 --- a/src/main/java/cokr/xit/adds/cmmn/xls/FormatMaker.java +++ /dev/null @@ -1,16 +0,0 @@ -package cokr.xit.adds.cmmn.xls; - -import java.util.Map; - -import cokr.xit.base.docs.xls.Format; - -public class FormatMaker { - - @SuppressWarnings("rawtypes") - public static Format a_slash_ab(Format format, String a, String b) { - return format.of(a).value(o -> { - return ((Map) o).get(a) + " / " + ((Map) o).get(a+b); - }); - } - -} diff --git a/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java b/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java index 9c5e07e..4da6337 100644 --- a/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java +++ b/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java @@ -361,23 +361,24 @@ public class AddsNimsController extends ApplicationController { XLSWriter xlsx = new XLSWriter().worksheet(0); Format format = new Format(xlsx); CellStyle center = format.cellStyle(Style.CENTER); + CellStyle right = format.cellStyle(Style.RIGHT); CellStyle numeric = format.n_nn0(); List list = addsNimsService.getDsuseMgtNcrdAndPrtmStatistics(query); - Map valueMap = new HashMap(); + Map valueMap = new HashMap<>(); valueMap.put("관할관청", format.of("dept_nm").style(center)); - valueMap.put("대마", format.of("대마").style(numeric)); - valueMap.put("마약", format.of("마약").style(numeric)); - valueMap.put("한외마약", format.of("한외마약").style(numeric)); - valueMap.put("향정", format.of("향정").style(numeric)); - valueMap.put("향정제외", format.of("향정제외").style(numeric)); - valueMap.put("기타", format.of("기타").style(numeric)); - valueMap.put("마약향정 계", format.of("마약향정계").style(numeric)); - valueMap.put("비마약류", format.of("비마약류").style(numeric)); - valueMap.put("일반관리대상", format.of("일반관리대상").style(numeric)); - valueMap.put("중점관리대상", format.of("중점관리대상").style(numeric)); - valueMap.put("중점일반 계", format.of("중점일반계").style(numeric)); + valueMap.put("대마", a_slash_ab(format, "대마", "Qy").style(numeric)); + valueMap.put("마약", a_slash_ab(format, "마약", "Qy").style(right)); + valueMap.put("한외마약", a_slash_ab(format, "한외마약", "Qy").style(right)); + valueMap.put("향정", a_slash_ab(format, "향정", "Qy").style(right)); + valueMap.put("향정제외", a_slash_ab(format, "향정제외", "Qy").style(right)); + valueMap.put("기타", a_slash_ab(format, "기타", "Qy").style(right)); + valueMap.put("마약향정계", a_slash_ab(format, "마약향정계", "Qy").style(right)); + valueMap.put("비마약류", a_slash_ab(format, "비마약류", "Qy").style(right)); + valueMap.put("일반관리대상", a_slash_ab(format, "일반관리대상", "Qy").style(right)); + valueMap.put("중점관리대상", a_slash_ab(format, "중점관리대상", "Qy").style(right)); + valueMap.put("중점일반계", a_slash_ab(format, "중점일반계", "Qy").style(right)); CellDef.setValues(cellDefs, valueMap); @@ -416,7 +417,7 @@ public class AddsNimsController extends ApplicationController { Map valueMap = new HashMap(); valueMap.put("관할관청", format.of("dept_nm").style(center)); - valueMap.put("대마", format.of("대마").style(numeric)); + valueMap.put("제품코드", format.of("prduct_cd").style(numeric)); valueMap.put("마약", format.of("마약").style(numeric)); valueMap.put("한외마약", format.of("한외마약").style(numeric)); valueMap.put("향정", format.of("향정").style(numeric)); @@ -1017,6 +1018,14 @@ public class AddsNimsController extends ApplicationController { byteOut.write(("Content-Type: application/json; charset=UTF-8" + lineSeparator + lineSeparator).getBytes(StandardCharsets.UTF_8)); byteOut.write((dsuseMgtJsonStr + lineSeparator).getBytes(StandardCharsets.UTF_8)); } + + private static Format a_slash_ab(Format format, String a, String b) { + return format.of(a).value((o) -> { + Number aa = (Number)((Map)o).get(a); + Number bb = (Number)((Map)o).get(a + b); + return aa.intValue() + " / " + bb.intValue(); + }); + } //------------------------------------------------------------------------------------------------- // private method //------------------------------------------------------------------------------------------------- diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtNcrdAndPrtmStatistics-main.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtNcrdAndPrtmStatistics-main.jsp index ff2f46b..20d72ce 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtNcrdAndPrtmStatistics-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtNcrdAndPrtmStatistics-main.jsp @@ -98,11 +98,11 @@ 향정 향정제외 기타 - 계 + 마약향정계 비마약류 일반관리대상 중점관리대상 - 계 + 중점일반계 @@ -314,11 +314,10 @@ // DataTables(그리드) let cellDefs = getCellDefs( $("#theadTr0--${pageName} th, #theadTr--${pageName} th") - .not(".dummy-th").not(":eq(0)").not("[colspan]"), + .not(".dummy-th").not("[colspan]"), $($("#${infoPrefix}Row--${pageName}")[0].content).find("td") .not(".dummy-td").not(":eq(0)").not("[colspan]")); - debugger - debug.log("cellDefs", cellDefs); + console.table("cellDefs", cellDefs); $P.control.query.cellDefs = cellDefs; $P.control.download();