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 7fcfb27..4860f2e 100644 --- a/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java +++ b/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java @@ -237,8 +237,8 @@ public class AddsNimsController extends ApplicationController { // 폐기증거사진 - 폐기증거사진 등록 정보 조회 mav.addObject("dsuseRsltImgList","[]"); - // 폐기일자가 있는 경우 - 폐기증거사진 등록 정보 조회 - if(!isEmpty(dsuseRsltInfo.getDsuseDe())) { + // 신청서접수상태가 아닌 경우 - 폐기증거사진 등록 정보 조회 + if(!"01".equals(dsuseRsltInfo.getPrgrsSttsCd())) { mav.addObject( "dsuseRsltImgList", toJson( @@ -252,6 +252,8 @@ public class AddsNimsController extends ApplicationController { ) ) ); + }else { + mav.addObject("dsuseRsltImgList", "[]"); } return mav @@ -273,7 +275,6 @@ public class AddsNimsController extends ApplicationController { //------------------------------------------------------------------------------------------------- // 보고 확인 처리 //------------------------------------------------------------------------------------------------- - // dsuseMgtMappingList = "/dsuseMgtMapping-list.do" @RequestMapping(value = "/dsuseMgtMapping-info.do", name = "페기 보고 확인 등록") public ModelAndView getDsuseMgtMappingInfo(DsuseMappingInfo dsuseMappingInfo) { ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtMapping-info"); @@ -368,23 +369,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); @@ -423,7 +425,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)); @@ -1080,6 +1082,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/resources/sql/mapper/adds/nims/dsuseMgtStatistics-mapper.xml b/src/main/resources/sql/mapper/adds/nims/dsuseMgtStatistics-mapper.xml index 02369a9..7fcc5ae 100644 --- a/src/main/resources/sql/mapper/adds/nims/dsuseMgtStatistics-mapper.xml +++ b/src/main/resources/sql/mapper/adds/nims/dsuseMgtStatistics-mapper.xml @@ -6,16 +6,24 @@ /* 마약/항정 and 중점/일반 별 통계 */ WITH tgt AS ( SELECT tdm.dept_cd - , IF(tpi.nrcd_se_nm = '대마', '1', '0') AS 대마 - , IF(tpi.nrcd_se_nm = '마약', '1', '0') AS 마약 - , IF(tpi.nrcd_se_nm = '한외마약', '1', '0') AS 한외마약 - , IF(tpi.nrcd_se_nm = '향정', '1', '0') AS 향정 - , IF(tpi.nrcd_se_nm = '향정제외', '1', '0') AS 향정제외 - , IF(tpi.nrcd_se_nm IS NULL, '1', '0') AS 기타 + , IF(tpi.nrcd_se_nm = '대마', 1, '0') AS 대마 + , IF(tpi.nrcd_se_nm = '마약', 1, '0') AS 마약 + , IF(tpi.nrcd_se_nm = '한외마약', 1, '0') AS 한외마약 + , IF(tpi.nrcd_se_nm = '향정', 1, '0') AS 향정 + , IF(tpi.nrcd_se_nm = '향정제외', 1, '0') AS 향정제외 + , IF(tpi.nrcd_se_nm IS NULL, 1, '0') AS 기타 , IF(tpi.prtm_se_nm = '비마약류', 1, 0) AS 비마약류 , IF(tpi.prtm_se_nm = '일반관리대상', 1, 0) AS 일반관리대상 , IF(tpi.prtm_se_nm = '중점관리대상', 1, 0) AS 중점관리대상 - , COUNT(tpi.prduct_cd) OVER(PARTITION BY tdm.dept_cd) AS TOTAL + , IF(tpi.nrcd_se_nm = '대마', tdmd.dsuse_qy, '0') AS 대마qy + , IF(tpi.nrcd_se_nm = '마약', tdmd.dsuse_qy, '0') AS 마약qy + , IF(tpi.nrcd_se_nm = '한외마약', tdmd.dsuse_qy, '0') AS 한외마약qy + , IF(tpi.nrcd_se_nm = '향정', tdmd.dsuse_qy, '0') AS 향정qy + , IF(tpi.nrcd_se_nm = '향정제외', tdmd.dsuse_qy, '0') AS 향정제외qy + , IF(tpi.nrcd_se_nm IS NULL, tdmd.dsuse_qy, '0') AS 기타qy + , IF(tpi.prtm_se_nm = '비마약류', tdmd.dsuse_qy, 0) AS 비마약류qy + , IF(tpi.prtm_se_nm = '일반관리대상', tdmd.dsuse_qy, 0) AS 일반관리대상qy + , IF(tpi.prtm_se_nm = '중점관리대상', tdmd.dsuse_qy, 0) AS 중점관리대상qy FROM tb_dsuse_mgt tdm JOIN tb_dsuse_mgt_dtl tdmd ON tdm.dscdmng_id = tdmd.dscdmng_id JOIN tb_prduct_info tpi ON tdmd.prduct_cd = tpi.prduct_cd @@ -49,6 +57,17 @@ , SUM(tgt.일반관리대상) AS 일반관리대상 , SUM(tgt.중점관리대상) AS 중점관리대상 , SUM(tgt.비마약류 + tgt.일반관리대상 + tgt.중점관리대상) AS 중점일반계 + , SUM(tgt.대마qy) AS 대마qy + , SUM(tgt.마약qy) AS 마약qy + , SUM(tgt.한외마약qy) AS 한외마약qy + , SUM(tgt.향정qy) AS 향정qy + , SUM(tgt.향정제외qy) AS 향정제외qy + , SUM(tgt.기타qy) AS 기타qy + , SUM(tgt.대마qy + tgt.마약qy + tgt.한외마약qy + tgt.향정qy + tgt.향정제외qy + tgt.기타qy) AS 마약향정계qy + , SUM(tgt.비마약류qy) AS 비마약류qy + , SUM(tgt.일반관리대상qy) AS 일반관리대상qy + , SUM(tgt.중점관리대상qy) AS 중점관리대상qy + , SUM(tgt.비마약류qy + tgt.일반관리대상qy + tgt.중점관리대상qy) AS 중점일반계qy FROM tgt GROUP BY tgt.dept_cd UNION ALL @@ -64,6 +83,17 @@ , SUM(tgt.일반관리대상) AS 일반관리대상 , SUM(tgt.중점관리대상) AS 중점관리대상 , SUM(tgt.비마약류 + tgt.일반관리대상 + tgt.중점관리대상) AS 중점일반계 + , SUM(tgt.대마qy) AS 대마qy + , SUM(tgt.마약qy) AS 마약qy + , SUM(tgt.한외마약qy) AS 한외마약qy + , SUM(tgt.향정qy) AS 향정qy + , SUM(tgt.향정제외qy) AS 향정제외qy + , SUM(tgt.기타qy) AS 기타qy + , SUM(tgt.대마qy + tgt.마약qy + tgt.한외마약qy + tgt.향정qy + tgt.향정제외qy + tgt.기타qy) AS 마약향정계qy + , SUM(tgt.비마약류qy) AS 비마약류qy + , SUM(tgt.일반관리대상qy) AS 일반관리대상qy + , SUM(tgt.중점관리대상qy) AS 중점관리대상qy + , SUM(tgt.비마약류qy + tgt.일반관리대상qy + tgt.중점관리대상qy) AS 중점일반계qy FROM tgt ) T LEFT JOIN tb_dept td @@ -82,6 +112,10 @@ , IF(tdm.prgrs_stts_cd = '06', 1, 0) AS rslt , IF(tdm.prgrs_stts_cd = '21', 1, 0) AS mapping , IF(tdm.prgrs_stts_cd = '99', 1, 0) AS cplt + , IF(tdm.prgrs_stts_cd = '01', tdmd.dsuse_qy, 0) AS receiptQy + , IF(tdm.prgrs_stts_cd = '06', tdmd.dsuse_qy, 0) AS rsltQy + , IF(tdm.prgrs_stts_cd = '21', tdmd.dsuse_qy, 0) AS mappingQy + , IF(tdm.prgrs_stts_cd = '99', tdmd.dsuse_qy, 0) AS cpltQy FROM tb_dsuse_mgt tdm JOIN tb_dsuse_mgt_dtl tdmd ON tdm.dscdmng_id = tdmd.dscdmng_id @@ -102,7 +136,6 @@ ) SELECT T.* - -- , ROW_NUMBER() over (order by prduct_nm) AS ROW_NUM , ROW_NUMBER() OVER (ORDER BY T.dept_cd, T.prduct_nm, T.prduct_cd) AS ROW_NUM , IF(td.dept_nm IS NULL, T.dept_cd, dept_nm) AS dept_nm FROM ( @@ -113,6 +146,10 @@ , SUM(tgt.rslt) AS rsltCnt , SUM(tgt.mapping) AS mappingCnt , SUM(tgt.cplt) AS cpltCnt + , SUM(tgt.receiptQy) AS receiptQy + , SUM(tgt.rsltQy) AS rsltQy + , SUM(tgt.mappingQy) AS mappingQy + , SUM(tgt.cpltQy) AS cpltQy , COUNT(tgt.dscdmng_id) AS dsuseCnt , SUM(tgt.dsuse_qy) AS dsuseQy FROM tgt @@ -125,6 +162,10 @@ , SUM(tgt.rslt) AS rsltCnt , SUM(tgt.mapping) AS mappingCnt , SUM(tgt.cplt) AS cpltCnt + , SUM(tgt.receiptQy) AS receiptQy + , SUM(tgt.rsltQy) AS rsltQy + , SUM(tgt.mappingQy) AS mappingQy + , SUM(tgt.cpltQy) AS cpltQy , count(tgt.dscdmng_id) AS dsuseCnt , sum(tgt.dsuse_qy) AS dsuseQy FROM tgt @@ -149,6 +190,13 @@ , IF(tbi.induty_nm = '마약류제조업', 1, 0) AS 마약류제조업 , IF(tbi.induty_nm = '마약류취급의료업', 1, 0) AS 마약류취급의료업 , IF(tbi.induty_nm = '마약류취급학술연구', 1, 0) AS 마약류취급학술연구 + , IF(tbi.induty_nm = '마약류도매업', tdmd.dsuse_qy, 0) AS 마약류도매업Qy + , IF(tbi.induty_nm = '마약류소매업', tdmd.dsuse_qy, 0) AS 마약류소매업Qy + , IF(tbi.induty_nm = '마약류수출입업', tdmd.dsuse_qy, 0) AS 마약류수출입업Qy + , IF(tbi.induty_nm = '마약류원료사용', tdmd.dsuse_qy, 0) AS 마약류원료사용Qy + , IF(tbi.induty_nm = '마약류제조업', tdmd.dsuse_qy, 0) AS 마약류제조업Qy + , IF(tbi.induty_nm = '마약류취급의료업', tdmd.dsuse_qy, 0) AS 마약류취급의료업Qy + , IF(tbi.induty_nm = '마약류취급학술연구', tdmd.dsuse_qy, 0) AS 마약류취급학술연구Qy FROM tb_dsuse_mgt tdm JOIN tb_dsuse_mgt_dtl tdmd ON tdm.dscdmng_id = tdmd.dscdmng_id @@ -180,7 +228,13 @@ , SUM(tgt.마약류제조업) AS 마약류제조업 , SUM(tgt.마약류취급의료업) AS 마약류취급의료업 , SUM(tgt.마약류취급학술연구) AS 마약류취급학술연구 - -- , SUM(tgt.마약류도매업 + tgt.마약류소매업 + tgt.마약류수출입업 + tgt.마약류원료사용 + tgt.마약류제조업 + tgt.마약류취급의료업 + tgt.마약류취급학술연구) AS 계 + , SUM(tgt.마약류도매업Qy) AS 마약류도매업Qy + , SUM(tgt.마약류소매업Qy) AS 마약류소매업Qy + , SUM(tgt.마약류수출입업Qy) AS 마약류수출입업Qy + , SUM(tgt.마약류원료사용Qy) AS 마약류원료사용Qy + , SUM(tgt.마약류제조업Qy) AS 마약류제조업Qy + , SUM(tgt.마약류취급의료업Qy) AS 마약류취급의료업Qy + , SUM(tgt.마약류취급학술연구Qy) AS 마약류취급학술연구Qy , COUNT(tgt.dscdmng_id) as dsuseCnt , SUM(tgt.dsuse_qy) as dsuseQy FROM tgt @@ -194,7 +248,13 @@ , SUM(tgt.마약류제조업) AS 마약류제조업 , SUM(tgt.마약류취급의료업) AS 마약류취급의료업 , SUM(tgt.마약류취급학술연구) AS 마약류취급학술연구 - -- , SUM(tgt.마약류도매업 + tgt.마약류소매업 + tgt.마약류수출입업 + tgt.마약류원료사용 + tgt.마약류제조업 + tgt.마약류취급의료업 + tgt.마약류취급학술연구) AS 계 + , SUM(tgt.마약류도매업Qy) AS 마약류도매업Qy + , SUM(tgt.마약류소매업Qy) AS 마약류소매업Qy + , SUM(tgt.마약류수출입업Qy) AS 마약류수출입업Qy + , SUM(tgt.마약류원료사용Qy) AS 마약류원료사용Qy + , SUM(tgt.마약류제조업Qy) AS 마약류제조업Qy + , SUM(tgt.마약류취급의료업Qy) AS 마약류취급의료업Qy + , SUM(tgt.마약류취급학술연구Qy) AS 마약류취급학술연구Qy , COUNT(tgt.dscdmng_id) AS dsuseCnt , SUM(tgt.dsuse_qy) AS dsuseQy FROM tgt @@ -217,6 +277,10 @@ , IF(tdm.prgrs_stts_cd = '06', 1, 0) AS rslt , IF(tdm.prgrs_stts_cd = '21', 1, 0) AS mapping , IF(tdm.prgrs_stts_cd = '99', 1, 0) AS cplt + , IF(tdm.prgrs_stts_cd = '01', tdmd.dsuse_qy, 0) AS receiptQy + , IF(tdm.prgrs_stts_cd = '06', tdmd.dsuse_qy, 0) AS rsltQy + , IF(tdm.prgrs_stts_cd = '21', tdmd.dsuse_qy, 0) AS mappingQy + , IF(tdm.prgrs_stts_cd = '99', tdmd.dsuse_qy, 0) AS cpltQy FROM tb_dsuse_mgt tdm JOIN tb_dsuse_mgt_dtl tdmd ON tdm.dscdmng_id = tdmd.dscdmng_id @@ -248,6 +312,10 @@ , SUM(tgt.rslt) AS rsltCnt , SUM(tgt.mapping) AS mappingCnt , SUM(tgt.cplt) AS cpltCnt + , SUM(tgt.receiptQy) AS receiptQy + , SUM(tgt.rsltQy) AS rsltQy + , SUM(tgt.mappingQy) AS mappingQy + , SUM(tgt.cpltQy) AS cpltQy , COUNT(tgt.dscdmng_id) AS dsuseCnt , SUM(tgt.dsuse_qy) AS dsuseQy FROM tgt @@ -261,6 +329,10 @@ , SUM(tgt.rslt) AS rsltCnt , SUM(tgt.mapping) AS mappingCnt , SUM(tgt.cplt) AS cpltCnt + , SUM(tgt.receiptQy) AS receiptQy + , SUM(tgt.rsltQy) AS rsltQy + , SUM(tgt.mappingQy) AS mappingQy + , SUM(tgt.cpltQy) AS cpltQy , count(tgt.dscdmng_id) AS dsuseCnt , sum(tgt.dsuse_qy) AS dsuseQy FROM tgt diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByBsshStatistics-main.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByBsshStatistics-main.jsp index 81c1b0f..0c08f4b 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByBsshStatistics-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByBsshStatistics-main.jsp @@ -88,16 +88,16 @@ 취급자번호 취급업체명 대표자 - 처리상태별 건수 + 처리상태 별 (폐기건수 / 폐기수량) 폐기건수 폐기수량 - 접수건수 - 결과처리건수 - 보고확인건수 - 완료건수 + 신청서접수 + 폐기결과[통보]처리 + 폐기보고확인 + 보고완료 @@ -109,10 +109,10 @@ {bssh_cd} {bssh_nm} {rprsntv_nm} - {receiptCnt} - {rsltCnt} - {mappingCnt} - {cpltCnt} + {receiptCnt} / {receiptQy} + {rsltCnt} / {rsltQy} + {mappingCnt} / {mappingQy} + {cpltCnt} / {cpltQy} {dsuseCnt} {dsuseQy} @@ -339,10 +339,6 @@ $("#btnBsshSearch--${pageName}").on("click", function() { $P.fnSearchBssh(); }); - - // DataTables width 변경 조정 (업무별 그리드가 존재 한다면.. crdn06010-main.jsp 참고) - fnMakeResizableTable($("#table-responsive--${pageName}")[0]); - } // 초기 화면 설정 diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByIndutyStatistics-main.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByIndutyStatistics-main.jsp index b82ba6d..6d6152a 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByIndutyStatistics-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtDsuseQyByIndutyStatistics-main.jsp @@ -82,9 +82,14 @@
+ + + + + + - @@ -92,8 +97,6 @@ - - @@ -101,13 +104,13 @@