감액 수정.

main
JoJH 4 days ago
parent 8b641e44f9
commit 1f3c892d09

@ -31,197 +31,210 @@ import cokr.xit.foundation.data.DataObject;
* *
* <pre> * <pre>
* ============ ============ * ============ ============
* 2024-02-01 JoJH * 2024-02-01 JoJH
* ================================ * ================================
* </pre> * </pre>
*/ */
public class Rdca01Controller extends ApplicationController { public class Rdca01Controller extends ApplicationController {
public static final String CLASS_URL = "/rdca/rdca01"; public static final String CLASS_URL = "/rdca/rdca01";
public class METHOD_URL { public class METHOD_URL {
public static final String public static final String
reducedAmountMain = "/010/main.do" // 감액 관리 메인 화면 reducedAmountMain = "/010/main.do" // 감액 관리 메인 화면
, getReducedAmountList = "/010/list.do" // 감액 대장 목록 조회 , getReducedAmountList = "/010/list.do" // 감액 대장 목록 조회
, getReducedAmountInfo = "/020/info.do" // 감액 대장 조회 , getReducedAmountInfo = "/020/info.do" // 감액 대장 조회
, createReducedAmount = "/020/create.do" // 감액 대장 등록 , createReducedAmount = "/020/create.do" // 감액 대장 등록
, updateReducedAmount = "/020/update.do" // 감액 대장 수정 , updateReducedAmount = "/020/update.do" // 감액 대장 수정
, removeReducedAmount = "/010/remove.do" // 감액 대장 삭제 , removeReducedAmount = "/010/remove.do" // 감액 대장 삭제
; ;
} }
/**감액 대장 서비스*/ /**감액 대장 서비스*/
@Resource(name = "rdamtService") @Resource(name = "rdamtService")
private RdamtService rdamtService; private RdamtService rdamtService;
@Resource(name = "stngBean") @Resource(name = "stngBean")
private StngBean stngBean; private StngBean stngBean;
/** (rdamt/rdamt-main) . /** (rdamt/rdamt-main) .
* {@link #getRdamtList(RdamtQuery) } . * {@link #getRdamtList(RdamtQuery) } .
* @return /rdcamt/rdamt-main * @return /rdcamt/rdamt-main
*/ */
public ModelAndView reducedAmountMain() { public ModelAndView reducedAmountMain() {
ModelAndView mav = new ModelAndView("fims/rdca/rdca01010-main"); ModelAndView mav = new ModelAndView("fims/rdca/rdca01010-main");
// 사용자 정보 // 사용자 정보
FimsUser fimsUser = (FimsUser)currentUser().getUser(); FimsUser fimsUser = (FimsUser)currentUser().getUser();
// View(jsp)에서 사용할 공통코드를 조회 // View(jsp)에서 사용할 공통코드를 조회
Map<String, List<CommonCode>> commonCodes = getCodesOf("FIM021", "FIM022", "FIM054", "FIM085"); Map<String, List<CommonCode>> commonCodes = getCodesOf("FIM054", "FIM085", "FIM086");
addCodes(commonCodes, mav, "FIM085", "FIM086");
addCodes(commonCodes, mav, "FIM021", "FIM022", "FIM085");
return mav
return mav .addObject("pageName", "rdca01010") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
.addObject("pageName", "rdca01010") // View(jsp)에서 사용할 id 뒤에 붙일 suffix .addObject("prefixUrl", CLASS_URL) // prefixUrl
.addObject("infoPrefix", "rdamt") // prefix .addObject("sggCd", fimsUser.getOrgID()) // 시군구 코드(SGG_CD)
.addObject("sggCd", fimsUser.getOrgID()) // 시군구 코드(SGG_CD) .addObject("taskListForSgg", stngBean.filterTaskSectionCodeForSgg(commonCodes.get("FIM054")))
.addObject("taskListForSgg", stngBean.filterTaskSectionCodeForSgg(commonCodes.get("FIM054"))) .addObject("FIM086List", commonCodes.get("FIM086")) // 감액 사유 코드(RDAMT_RSN_CD)
.addObject("FIM021List", commonCodes.get("FIM021")) // 부과 제외 구분 코드(LEVY_EXCL_SE_CD) ;
.addObject("FIM022List", commonCodes.get("FIM022")) // 부과 제외 사유 코드(LEVY_EXCL_RSN_CD) }
.addObject("FIM054List", commonCodes.get("FIM054")) // 업무 구분 코드(TASK_SE_CD)
.addObject("FIM085List", commonCodes.get("FIM085")) // 감액 구분 코드(RDAMT_SE_CD) /** .<br />
; * {@link RdamtService#getRdamtList(RdamtQuery)}
} * @param req
* @return jsonView
/** .<br /> * <pre><code> {
* {@link RdamtService#getRdamtList(RdamtQuery)} * "rdamtList": [ ]
* @param req * "rdamtStart":
* @return jsonView * "rdamtFetch":
* <pre><code> { * "rdamtTotal":
* "rdamtList": [ ] * }</code></pre>
* "rdamtStart": */
* "rdamtFetch": public ModelAndView getReducedAmountList(RdamtQuery req) {
* "rdamtTotal": if (!"xls".equals(req.getDownload())) {
* }</code></pre> List<?> result = rdamtService.getRdamtList(setFetchSize(req));
*/ return setPagingInfo(new ModelAndView("jsonView"), result, "");
public ModelAndView getReducedAmountList(RdamtQuery req) { } else {
if (!"xls".equals(req.getDownload())) { // 현재 날짜 구하기
List<?> result = rdamtService.getRdamtList(setFetchSize(req)); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
return setCollectionInfo(new ModelAndView("jsonView"), result, "rdamt"); String dateTime = dateFormat.format(System.currentTimeMillis());
} else {
// 현재 날짜 구하기 List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType());
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String dateTime = dateFormat.format(System.currentTimeMillis()); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx);
List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType()); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0();
XLSWriter xlsx = new XLSWriter().worksheet(0); CellStyle dateYMD = format.yyyy_mm_dd();
Format format = new Format(xlsx); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); List<DataObject> list = rdamtService.getRdamtList(req.setFetchSize(0));
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("업무구분", format.of("TASK_SE_NM").style(center));
List<DataObject> list = rdamtService.getRdamtList(req.setFetchSize(0)); valueMap.put("감액일자", FormatMaker.yyyy_mm_dd(format, "RDAMT_YMD").style(dateYMD));
valueMap.put("감액구분", format.of("RDAMT_SE_CD_NM").style(center));
Map<String,Object> valueMap = new HashMap<String,Object>(); valueMap.put("감액사유", format.of("RDAMT_RSN_CD_NM"));
valueMap.put("업무구분", format.of("TASK_SE_NM").style(center)); valueMap.put("기타내용", format.of("ETC_CN"));
valueMap.put("부과제외일자", FormatMaker.yyyy_mm_dd(format, "LEVY_EXCL_YMD").style(dateYMD)); valueMap.put("민원신청번호", format.of("CVLCPT_APLY_NO").style(center));
valueMap.put("부과제외구분", format.of("LEVY_EXCL_SE_NM").style(center)); valueMap.put("민원접수번호", format.of("CVLCPT_RCPT_NO").style(center));
valueMap.put("부과제외사유", format.of("LEVY_EXCL_RSN_NM")); valueMap.put("민원접수일자", FormatMaker.yyyy_mm_dd(format, "CVLCPT_RCPT_YMD").style(dateYMD));
valueMap.put("기타내용", format.of("ETC_CN")); valueMap.put("단속일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "CRDN_YMD_TM").style(dateDT));
valueMap.put("민원신청번호", format.of("CVLCPT_APLY_NO").style(center)); valueMap.put("차량번호", format.of("VHRNO"));
valueMap.put("민원접수번호", format.of("CVLCPT_RCPT_NO").style(center)); valueMap.put("납부자구분", format.of("RTPYR_SE_NM").style(center));
valueMap.put("민원접수일자", FormatMaker.yyyy_mm_dd(format, "CVLCPT_RCPT_YMD").style(dateYMD)); valueMap.put("납부자번호", format.of("RTPYR_NO").style(center));
valueMap.put("단속일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "CRDN_YMD_TM").style(dateDT)); valueMap.put("납부자명", format.of("RTPYR_NM"));
valueMap.put("차량번호", format.of("VHRNO")); valueMap.put("단속법정동", format.of("CRDN_STDG_NM").style(center));
valueMap.put("납부자구분", format.of("RTPYR_SE_NM").style(center)); valueMap.put("단속장소", format.of("CRDN_PLC"));
valueMap.put("납부자번호", format.of("RTPYR_NO").style(center)); valueMap.put("상세단속장소", format.of("DTL_CRDN_PLC"));
valueMap.put("납부자명", format.of("RTPYR_NM")); valueMap.put("위반항목", format.of("VLTN_ARTCL"));
valueMap.put("단속법정동", format.of("CRDN_STDG_NM").style(center)); valueMap.put("단속원금", format.of("FFNLG_CRDN_AMT").style(numeric));
valueMap.put("단속장소", format.of("CRDN_PLC")); valueMap.put("처리상태", format.of("CRDN_STTS_NM"));
valueMap.put("상세단속장소", format.of("DTL_CRDN_PLC")); valueMap.put("단속특별구역", format.of("CRDN_SPAREA_NM").style(center));
valueMap.put("위반항목", format.of("VLTN_ARTCL")); valueMap.put("사용연료", format.of("USE_FUEL_NM").style(center));
valueMap.put("단속원금", format.of("FFNLG_CRDN_AMT").style(numeric)); valueMap.put("주차가능여부", format.of("PRK_PSBLTY_RSLT_NM").style(center));
valueMap.put("처리상태", format.of("CRDN_STTS_NM")); valueMap.put("우편번호", format.of("ZIP").style(center));
valueMap.put("단속특별구역", format.of("CRDN_SPAREA_NM").style(center)); valueMap.put("주소", format.of("ADDR"));
valueMap.put("사용연료", format.of("USE_FUEL_NM").style(center)); valueMap.put("상세주소", format.of("DTL_ADDR"));
valueMap.put("주차가능여부", format.of("PRK_PSBLTY_RSLT_NM").style(center)); valueMap.put("등록일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT));
valueMap.put("우편번호", format.of("ZIP").style(center)); valueMap.put("등록사용자", format.of("RGTR_NM").style(center));
valueMap.put("주소", format.of("ADDR")); valueMap.put("수정일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "MDFCN_DT").style(dateDT));
valueMap.put("상세주소", format.of("DTL_ADDR")); valueMap.put("수정사용자", format.of("MDFR_NM").style(center));
valueMap.put("등록일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT));
valueMap.put("등록사용자", format.of("RGTR_NM").style(center)); CellDef.setValues(cellDefs, valueMap);
valueMap.put("수정일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "MDFCN_DT").style(dateDT));
valueMap.put("수정사용자", format.of("MDFR_NM").style(center)); xlsx.cell(0, 0).value("감액").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
CellDef.setValues(cellDefs, valueMap); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> { if(i.getValue() instanceof Format) { i.setField(null); }; return i; }).toList()));
xlsx.cell(0, 0).value("감액").value(center).merge(0, cellDefs.size() - 1) return new ModelAndView("downloadView")
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .addObject("download", xlsx.getDownloadable().setFilename("감액" + "_목록_" + dateTime + ".xlsx"));
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); }
}
return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("감액" + "_목록_" + dateTime + ".xlsx")); /** .
} * @param rdamt
} * @return jsonView
* <pre><code> {
/** . * "saved": true, false
* @param rdamt * }</code></pre>
* @return jsonView */
* <pre><code> { public ModelAndView createReducedAmount(Rdamt rdamt) {
* "saved": true, false boolean saved = false;
* }</code></pre> String rtnMsg = rdamtService.createRdamt(rdamt);
*/
public ModelAndView createReducedAmount(Rdamt rdamt) { if (rtnMsg.contains("[S]")) {
boolean saved = false; saved = true;
String rtnMsg = rdamtService.createRdamt(rdamt); } else {
saved = false;
if (rtnMsg.contains("[S]")) { }
saved = true;
} else { return new ModelAndView("jsonView")
saved = false; .addObject("saved", saved)
} .addObject("rtnMsg", rtnMsg);
}
return new ModelAndView("jsonView")
.addObject("saved", saved) /** .
.addObject("rtnMsg", rtnMsg); * @param rdamt
} * @return jsonView
* <pre><code> {
/** . * "saved": true, false
* @param rdamt * }</code></pre>
* @return jsonView */
* <pre><code> { public ModelAndView updateReducedAmount(Rdamt rdamt) {
* "saved": true, false boolean saved = false;
* }</code></pre> String rtnMsg = rdamtService.updateRdamt(rdamt);
*/
public ModelAndView updateReducedAmount(Rdamt rdamt) { if (rtnMsg.contains("[S]")) {
boolean saved = false; saved = true;
String rtnMsg = rdamtService.updateRdamt(rdamt); } else {
saved = false;
if (rtnMsg.contains("[S]")) { }
saved = true;
} else { return new ModelAndView("jsonView")
saved = false; .addObject("saved", saved)
} .addObject("rtnMsg", rtnMsg);
}
return new ModelAndView("jsonView")
.addObject("saved", saved) /** .
.addObject("rtnMsg", rtnMsg); * @param rdamtIds
} * @return jsonView
* <pre><code> {
/** . * "affected":
* @param rdamtIds * "saved": true, false
* @return jsonView * }</code></pre>
* <pre><code> { */
* "affected": public ModelAndView removeReducedAmount(Rdamt rdamt) {
* "saved": true, false boolean saved = false;
* }</code></pre> String rtnMsg = "";
*/
public ModelAndView removeReducedAmount(Rdamt rdamt) { // 감액(rdamtId) 단건 삭제
boolean saved = false; if (rdamt.getRdamtIds() == null || rdamt.getRdamtIds().length < 1) {
String rtnMsg = rdamtService.removeRdamt(rdamt); rtnMsg = rdamtService.removeRdamt(rdamt);
} else {
if (rtnMsg.contains("[S]")) { // 부과제외 IDs 만큼 부과제외 삭제 반복..
saved = true; for (String rdamtId : rdamt.getRdamtIds()) {
} else { Rdamt deltRdamt = new Rdamt();
saved = false; deltRdamt.setRdamtId(rdamtId);
} deltRdamt.setDelRsn(rdamt.getDelRsn());
return new ModelAndView("jsonView") // 감액 삭제 호출
.addObject("saved", saved) rtnMsg = rdamtService.removeRdamt(deltRdamt);
.addObject("rtnMsg", rtnMsg); if (!rtnMsg.contains("[S]")) // 오류가 발생하였으면 종료..
} break;
}
}
if (rtnMsg.contains("[S]")) {
saved = true;
} else {
saved = false;
}
return new ModelAndView("jsonView")
.addObject("saved", saved)
.addObject("rtnMsg", rtnMsg);
}
} }

Loading…
Cancel
Save