부과 수정.

main
JoJH 4 days ago
parent 26bcbc95f2
commit 8b641e44f9

@ -36,7 +36,7 @@ import cokr.xit.foundation.data.DataObject;
*
* <pre>
* ============ ============
* 2023-08-30 JoJH
* 2023-08-30 JoJH
* ================================
* </pre>
*/
@ -44,300 +44,299 @@ import cokr.xit.foundation.data.DataObject;
@RequestMapping(name="부과", value=Levy01Controller.CLASS_URL)
public class Levy01Controller extends ApplicationController {
public static final String CLASS_URL = "/levy/levy01";
public class METHOD_URL {
public static final String
reductionLevyTargetMain = "/010/main.do" // 사전 감경부과 대상 메인 화면
, getReductionLevyTargetList = "/010/list.do" // 사전 감경부과 대상 대장 목록 조회
, getReductionLevyTargetInfo = "/020/info.do" // 사전 감경부과 대상 정보
, createReductionLevyList = "/020/createRdctLevyList.do" // 사전 감경부과 등록
, levyMain = "/050/main.do" // 부과 관리 메인 화면
, getLevyList = "/050/list.do" // 부과 대장 목록 조회
;
}
/**부과 대장 서비스*/
@Resource(name="levyService")
private LevyService levyService;
/**업무 정보 서비스 */
@Resource(name="taskBean")
private TaskBean taskBean;
/**설정 정보 Bean */
@Resource(name="stngBean")
private StngBean stngBean;
/** (levy/levy01010-main) .
* @return
*/
@RequestMapping(name="사전 감경부과 등록 메인", value=METHOD_URL.reductionLevyTargetMain)
public ModelAndView reductionLevyTargetMain() {
ModelAndView mav = new ModelAndView("fims/levy/levy01010-main");
// 사용자 정보
FimsUser fimsUser = (FimsUser)currentUser().getUser();
// View(jsp)에서 사용할 공통코드를 조회
Map<String, List<CommonCode>> commonCodes = getCodesOf("FIM004", "FIM005", "FIM006", "FIM054", "FIM061", "FIM064");
addCodes(commonCodes, mav, "FIM004", "FIM005", "FIM006", "FIM061", "FIM064");
return mav
.addObject("pageName", "levy01010") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
.addObject("infoPrefixUrl", CLASS_URL) // prefixUrl
.addObject("sggCd", fimsUser.getOrgID()) // 시군구 코드(SGG_CD)
.addObject("taskListForSgg", stngBean.filterTaskSectionCodeForSgg(commonCodes.get("FIM054"))) // 업무 구분 코드(TASK_SE_CD)
;
}
/** .
* {@link LevyService#getRdctLevyTrgtList(LevyQuery)}
* @param req
* @return jsonView
* <pre><code> {
* "levyList": [ ]
* "levyStart":
* "levyFetch":
* "levyTotal":
* }</code></pre>
*/
@Task({"PVS","BPV"})
@RequestMapping(name="사전 감경부과 대상 목록 조회", value=METHOD_URL.getReductionLevyTargetList)
public ModelAndView getReductionLevyTargetList(LevyQuery req) {
if (!"xls".equals(req.getDownload())) {
List<?> result = levyService.getRdctLevyTrgtList(setFetchSize(req));
return setCollectionInfo(new ModelAndView("jsonView"), result, "");
} else {
// 현재 날짜 구하기
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String dateTime = dateFormat.format(System.currentTimeMillis());
List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = levyService.getRdctLevyTrgtList(req.setFetchSize(0));
Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("업무구분", format.of("TASK_SE_NM").style(center));
valueMap.put("단속일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "CRDN_YMD_TM").style(dateDT));
valueMap.put("차량번호", format.of("VHRNO"));
valueMap.put("법정동", format.of("CRDN_STDG_NM"));
valueMap.put("단속장소", format.of("CRDN_PLC"));
valueMap.put("위반항목", format.of("VLTN_ARTCL"));
valueMap.put("단속원금", format.of("FFNLG_CRDN_AMT").style(numeric));
valueMap.put("과태료금액", format.of("FFNLG_AMT").style(numeric));
valueMap.put("처리상태", format.of("CRDN_STTS_NM"));
public static final String CLASS_URL = "/levy/levy01";
public class METHOD_URL {
public static final String
reductionLevyTargetMain = "/010/main.do" // 사전 감경부과 대상 메인 화면
, getReductionLevyTargetList = "/010/list.do" // 사전 감경부과 대상 대장 목록 조회
, getReductionLevyTargetInfo = "/020/info.do" // 사전 감경부과 대상 정보
, createReductionLevyList = "/020/createRdctLevyList.do" // 사전 감경부과 등록
, levyMain = "/050/main.do" // 부과 관리 메인 화면
, getLevyList = "/050/list.do" // 부과 대장 목록 조회
;
}
/**부과 대장 서비스*/
@Resource(name="levyService")
private LevyService levyService;
/**업무 정보 서비스 */
@Resource(name="taskBean")
private TaskBean taskBean;
/**설정 정보 Bean */
@Resource(name="stngBean")
private StngBean stngBean;
/** (levy/levy01010-main) .
* @return
*/
@RequestMapping(name="사전 감경부과 등록 메인", value=METHOD_URL.reductionLevyTargetMain)
public ModelAndView reductionLevyTargetMain() {
ModelAndView mav = new ModelAndView("fims/levy/levy01010-main");
// 사용자 정보
FimsUser fimsUser = (FimsUser)currentUser().getUser();
// View(jsp)에서 사용할 공통코드를 조회
Map<String, List<CommonCode>> commonCodes = getCodesOf("FIM004", "FIM005", "FIM006", "FIM054", "FIM061", "FIM064");
addCodes(commonCodes, mav, "FIM004", "FIM005", "FIM006", "FIM061", "FIM064");
return mav
.addObject("pageName", "levy01010") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
.addObject("prefixUrl", CLASS_URL) // prefixUrl
.addObject("sggCd", fimsUser.getOrgID()) // 시군구 코드(SGG_CD)
.addObject("taskListForSgg", stngBean.filterTaskSectionCodeForSgg(commonCodes.get("FIM054"))) // 업무 구분 코드(TASK_SE_CD)
;
}
/** .
* {@link LevyService#getRdctLevyTrgtList(LevyQuery)}
* @param req
* @return jsonView
* <pre><code> {
* "levyList": [ ]
* "levyStart":
* "levyFetch":
* "levyTotal":
* }</code></pre>
*/
@Task({"PVS","BPV"})
@RequestMapping(name="사전 감경부과 대상 목록 조회", value=METHOD_URL.getReductionLevyTargetList)
public ModelAndView getReductionLevyTargetList(LevyQuery req) {
if (!"xls".equals(req.getDownload())) {
List<?> result = levyService.getRdctLevyTrgtList(setFetchSize(req));
return setPagingInfo(new ModelAndView("jsonView"), result, "");
} else {
// 현재 날짜 구하기
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String dateTime = dateFormat.format(System.currentTimeMillis());
List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = levyService.getRdctLevyTrgtList(req.setFetchSize(0));
Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("업무구분", format.of("TASK_SE_NM").style(center));
valueMap.put("단속일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "CRDN_YMD_TM").style(dateDT));
valueMap.put("차량번호", format.of("VHRNO"));
valueMap.put("법정동", format.of("CRDN_STDG_NM"));
valueMap.put("단속장소", format.of("CRDN_PLC"));
valueMap.put("위반항목", format.of("VLTN_ARTCL"));
valueMap.put("단속원금", format.of("FFNLG_CRDN_AMT").style(numeric));
valueMap.put("과태료금액", format.of("FFNLG_AMT").style(numeric));
valueMap.put("처리상태", format.of("CRDN_STTS_NM"));
valueMap.put("민원접수일자", FormatMaker.yyyy_mm_dd(format, "CVLCPT_RCPT_YMD").style(dateYMD));
valueMap.put("민원신청번호", format.of("CVLCPT_APLY_NO").style(center));
valueMap.put("민원접수번호", format.of("CVLCPT_RCPT_NO").style(center));
valueMap.put("민원담당자", format.of("CVLCPT_PRCS_PIC_NM").style(center));
valueMap.put("민원신청번호", format.of("CVLCPT_APLY_NO").style(center));
valueMap.put("민원접수번호", format.of("CVLCPT_RCPT_NO").style(center));
valueMap.put("민원담당자", format.of("CVLCPT_PRCS_PIC_NM").style(center));
valueMap.put("민원처리일시", FormatMaker.yyyy_mm_dd(format, "CVLCPT_PRCS_CMPTN_DT").style(dateYMD));
valueMap.put("민원전송결과", format.of("CVLCPT_TRSM_NM").style(center));
valueMap.put("납부자구분", format.of("RTPYR_SE_NM").style(center));
valueMap.put("납부자번호", format.of("RTPYR_NO").style(center));
valueMap.put("납부자명", format.of("RTPYR_NM"));
valueMap.put("우편번호", format.of("ZIP").style(center));
valueMap.put("주소", format.of("ADDR"));
valueMap.put("상세주소", format.of("DTL_ADDR"));
valueMap.put("등록일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT));
valueMap.put("등록사용자", format.of("RGTR_NM").style(center));
valueMap.put("수정일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "MDFCN_DT").style(dateDT));
valueMap.put("수정사용자", format.of("MDFR_NM").style(center));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0).value("사전 감경부과 대상").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(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"));
}
}
/** (info) .
* @param req
* @return fims/levy/levy01020-info jsonView
* <pre>{
* "rdctLevyYmdInfo":
* }</pre>
*/
@Task({"PVS","BPV"})
@RequestMapping(name="사전 감경부과 정보 조회", value=METHOD_URL.getReductionLevyTargetInfo)
public ModelAndView getReductionLevyTargetInfo(HttpServletRequest hReq, LevyQuery req) {
// 감경 부과일자
DataObject info = taskBean.getAdvntceYmdInfo(new CmmnQuery().setSggCd(req.getSggCd())
.setTaskSeCd(req.getTaskSeCd()));
boolean json = jsonResponse();
ModelAndView mav = new ModelAndView(json ? "jsonView" : "fims/levy/levy01020-info");
// 이전에 조회되었던 총건수, 금액
info.put("TNOCS", req.getTnocs());
info.put("GRAMT_FFNLG_AMT", req.getGramtFfnlgAmt());
info.put("GRAMT_ADVNTCE_AMT", req.getGramtAdvntceAmt());
return mav
.addObject("callPurpose", req.getCallPurpose()) // 호출 용도
.addObject("pageName", "levy01020") // jsp pageName
.addObject("infoPrefixUrl", CLASS_URL) // prefixUrl
.addObject("mainQuery", json ? req : toJson(req)) // 검색 조건
.addObject("info", json ? info : toJson(info))
;
}
/** .
* @param levy
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
@Task({"PVS","BPV"})
@RequestMapping(name="사전 감경부과 대장 등록", value=METHOD_URL.createReductionLevyList)
public ModelAndView createReductionLevyList(LevyQuery req) {
boolean saved = false;
String rtnMsg = levyService.createRdctLevyList(req);
if (rtnMsg.contains("[S]")) {
saved = true;
} else {
saved = false;
}
return new ModelAndView("jsonView")
.addObject("saved", saved)
.addObject("rtnMsg", rtnMsg);
}
/** (levy/levy01050-main) .
* @return
*/
@RequestMapping(name="부과 관리 메인", value=METHOD_URL.levyMain)
public ModelAndView levyMain() {
ModelAndView mav = new ModelAndView("fims/levy/levy01050-main");
// 사용자 정보
FimsUser fimsUser = (FimsUser)currentUser().getUser();
// View(jsp)에서 사용할 공통코드를 조회
Map<String, List<CommonCode>> commonCodes = getCodesOf("FIM010", "FIM046", "FIM054");
return mav
.addObject("pageName", "levy01050") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
.addObject("infoPrefixUrl", CLASS_URL) // prefixUrl
.addObject("sggCd", fimsUser.getOrgID()) // 시군구 코드(SGG_CD)
.addObject("taskListForSgg", stngBean.filterTaskSectionCodeForSgg(commonCodes.get("FIM054"))) // 업무 구분 코드(TASK_SE_CD)
.addObject("FIM010List", commonCodes.get("FIM010")) // 단속 상태 코드(CRDN_STTS_CD)
.addObject("FIM046List", commonCodes.get("FIM046")) // 감경 구분 코드(RDCT_SE_CD)
;
}
/** .
* {@link LevyService#getLevyList(LevyQuery)}
* @param req
* @return jsonView
* <pre><code> {
* "levyList": [ ]
* "levyStart":
* "levyFetch":
* "levyTotal":
* }</code></pre>
*/
@Task
@RequestMapping(name="부과 대장 목록 조회", value=METHOD_URL.getLevyList)
public ModelAndView getLevyList(LevyQuery req) {
if (!"xls".equals(req.getDownload())) {
List<?> result = levyService.getLevyList(setFetchSize(req));
return setCollectionInfo(new ModelAndView("jsonView"), result, "");
} else {
// 현재 날짜 구하기
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String dateTime = dateFormat.format(System.currentTimeMillis());
List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = levyService.getLevyList(req.setFetchSize(0));
Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("업무구분", format.of("TASK_SE_NM").style(center));
valueMap.put("회계연도", format.of("FYR").style(center));
valueMap.put("회계코드", format.of("ACNTG_SE_CD").style(center));
valueMap.put("세목코드", format.of("TXITM_CD").style(center));
valueMap.put("세목명", format.of("TXITM_NM").style(center));
valueMap.put("부과번호", format.of("LEVY_NO").style(center));
valueMap.put("분납순번", format.of("ISPY_SN").style(center));
valueMap.put("부과구분", format.of("LEVY_SE_NM").style(center));
valueMap.put("통합구분", format.of("UNTY_SE_NM").style(center));
valueMap.put("감경구분", format.of("RDCT_SE_NM").style(center));
valueMap.put("부과일자", FormatMaker.yyyy_mm_dd(format, "LEVY_YMD").style(dateYMD));
valueMap.put("최초납기일자", FormatMaker.yyyy_mm_dd(format, "FRST_DUDT_YMD").style(dateYMD));
valueMap.put("납기일자", FormatMaker.yyyy_mm_dd(format, "DUDT_YMD").style(dateYMD));
valueMap.put("과태료금액", format.of("FFNLG_AMT").style(numeric));
valueMap.put("부과본세", format.of("LEVY_PCPTAX").style(numeric));
valueMap.put("부과가산금", format.of("LEVY_ADAMT").style(numeric));
valueMap.put("분납이자", format.of("ISPY_INT").style(numeric));
valueMap.put("수납본세", format.of("RCVMT_PCPTAX").style(numeric));
valueMap.put("수납가산금", format.of("RCVMT_ADAMT").style(numeric));
valueMap.put("감액본세", format.of("RDAMT_PCPTAX").style(numeric));
valueMap.put("감액가산금", format.of("RDAMT_ADAMT").style(numeric));
valueMap.put("미납금액", format.of("SUM_AMT").style(numeric));
valueMap.put("과세물건", format.of("TXTN_THING"));
valueMap.put("체납사유", format.of("NPMNT_RSN_NM"));
valueMap.put("수납일자", FormatMaker.yyyy_mm_dd(format, "RCVMT_YMD").style(dateYMD));
valueMap.put("압류일자", FormatMaker.yyyy_mm_dd(format, "SZR_YMD").style(dateYMD));
valueMap.put("압류물건", format.of("SZR_THING"));
valueMap.put("대체압류차량", format.of("RPM_SZR_VHRNO"));
valueMap.put("압류해제일자", FormatMaker.yyyy_mm_dd(format, "SZR_RMV_YMD").style(dateYMD));
valueMap.put("전자납부번호", format.of("EPAYNO_MASK"));
valueMap.put("은행명", format.of("BANK_NM"));
valueMap.put("가상계좌번호", format.of("VR_ACTNO").style(center));
valueMap.put("은행명2", format.of("BANK_NM2"));
valueMap.put("가상계좌번호2", format.of("VR_ACTNO2").style(center));
valueMap.put("은행명3", format.of("BANK_NM3"));
valueMap.put("가상계좌번호3", format.of("VR_ACTNO3").style(center));
valueMap.put("단속일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "CRDN_YMD_TM").style(dateDT));
valueMap.put("차량번호", format.of("VHRNO"));
valueMap.put("법정동", format.of("CRDN_STDG_NM"));
valueMap.put("단속장소", format.of("CRDN_PLC"));
valueMap.put("위반항목", format.of("VLTN_ARTCL"));
valueMap.put("단속원금", format.of("FFNLG_CRDN_AMT").style(numeric));
valueMap.put("처리상태", format.of("CRDN_STTS_NM"));
valueMap.put("납부자구분", format.of("RTPYR_SE_NM").style(center));
valueMap.put("납부자번호", format.of("RTPYR_NO").style(center));
valueMap.put("납부자명", format.of("RTPYR_NM"));
valueMap.put("우편번호", format.of("ZIP").style(center));
valueMap.put("주소", format.of("ADDR"));
valueMap.put("상세주소", format.of("DTL_ADDR"));
valueMap.put("등록일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT));
valueMap.put("등록사용자", format.of("RGTR_NM").style(center));
valueMap.put("수정일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "MDFCN_DT").style(dateDT));
valueMap.put("수정사용자", format.of("MDFR_NM").style(center));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0).value("부과").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(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"));
}
}
valueMap.put("민원전송결과", format.of("CVLCPT_TRSM_NM").style(center));
valueMap.put("납부자구분", format.of("RTPYR_SE_NM").style(center));
valueMap.put("납부자번호", format.of("RTPYR_NO").style(center));
valueMap.put("납부자명", format.of("RTPYR_NM"));
valueMap.put("우편번호", format.of("ZIP").style(center));
valueMap.put("주소", format.of("ADDR"));
valueMap.put("상세주소", format.of("DTL_ADDR"));
valueMap.put("등록일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT));
valueMap.put("등록사용자", format.of("RGTR_NM").style(center));
valueMap.put("수정일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "MDFCN_DT").style(dateDT));
valueMap.put("수정사용자", format.of("MDFR_NM").style(center));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0).value("사전 감경부과 대상").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(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"));
}
}
/** (info) .
* @param req
* @return fims/levy/levy01020-info jsonView
* <pre>{
* "rdctLevyYmdInfo":
* }</pre>
*/
@Task({"PVS","BPV"})
@RequestMapping(name="사전 감경부과 정보 조회", value=METHOD_URL.getReductionLevyTargetInfo)
public ModelAndView getReductionLevyTargetInfo(HttpServletRequest hReq, LevyQuery req) {
// 감경 부과일자
DataObject info = taskBean.getAdvntceYmdInfo(new CmmnQuery().setSggCd(req.getSggCd())
.setTaskSeCd(req.getTaskSeCd()));
boolean json = jsonResponse();
ModelAndView mav = new ModelAndView(json ? "jsonView" : "fims/levy/levy01020-info");
// 이전에 조회되었던 총건수, 금액
info.put("TNOCS", req.getTnocs());
info.put("GRAMT_FFNLG_AMT", req.getGramtFfnlgAmt());
info.put("GRAMT_ADVNTCE_AMT", req.getGramtAdvntceAmt());
return mav
.addObject("callPurpose", req.getCallPurpose()) // 호출 용도
.addObject("pageName", "levy01020") // jsp pageName
.addObject("prefixUrl", CLASS_URL) // prefixUrl
.addObject("mainQuery", json ? req : toJson(req)) // 검색 조건
.addObject("Info", json ? info : toJson(info))
;
}
/** .
* @param levy
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
@Task({"PVS","BPV"})
@RequestMapping(name="사전 감경부과 대장 등록", value=METHOD_URL.createReductionLevyList)
public ModelAndView createReductionLevyList(LevyQuery req) {
boolean saved = false;
String rtnMsg = levyService.createRdctLevyList(req);
if (rtnMsg.contains("[S]")) {
saved = true;
} else {
saved = false;
}
return new ModelAndView("jsonView")
.addObject("saved", saved)
.addObject("rtnMsg", rtnMsg);
}
/** (levy/levy01050-main) .
* @return
*/
@RequestMapping(name="부과 관리 메인", value=METHOD_URL.levyMain)
public ModelAndView levyMain() {
ModelAndView mav = new ModelAndView("fims/levy/levy01050-main");
// 사용자 정보
FimsUser fimsUser = (FimsUser)currentUser().getUser();
// View(jsp)에서 사용할 공통코드를 조회
Map<String, List<CommonCode>> commonCodes = getCodesOf("FIM010", "FIM046", "FIM054");
return mav
.addObject("pageName", "levy01050") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
.addObject("prefixUrl", CLASS_URL) // prefixUrl
.addObject("sggCd", fimsUser.getOrgID()) // 시군구 코드(SGG_CD)
.addObject("taskListForSgg", stngBean.filterTaskSectionCodeForSgg(commonCodes.get("FIM054"))) // 업무 구분 코드(TASK_SE_CD)
.addObject("FIM010List", commonCodes.get("FIM010")) // 단속 상태 코드(CRDN_STTS_CD)
.addObject("FIM046List", commonCodes.get("FIM046")) // 감경 구분 코드(RDCT_SE_CD)
;
}
/** .
* {@link LevyService#getLevyList(LevyQuery)}
* @param req
* @return jsonView
* <pre><code> {
* "levyList": [ ]
* "levyStart":
* "levyFetch":
* "levyTotal":
* }</code></pre>
*/
@Task
@RequestMapping(name="부과 대장 목록 조회", value=METHOD_URL.getLevyList)
public ModelAndView getLevyList(LevyQuery req) {
if (!"xls".equals(req.getDownload())) {
List<?> result = levyService.getLevyList(setFetchSize(req));
return setPagingInfo(new ModelAndView("jsonView"), result, "");
} else {
// 현재 날짜 구하기
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String dateTime = dateFormat.format(System.currentTimeMillis());
List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = levyService.getLevyList(req.setFetchSize(0));
Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("업무구분", format.of("TASK_SE_NM").style(center));
valueMap.put("회계연도", format.of("FYR").style(center));
valueMap.put("회계코드", format.of("ACNTG_SE_CD").style(center));
valueMap.put("세목코드", format.of("TXITM_CD").style(center));
valueMap.put("세목명", format.of("TXITM_NM").style(center));
valueMap.put("부과번호", format.of("LEVY_NO").style(center));
valueMap.put("분납순번", format.of("ISPY_SN").style(center));
valueMap.put("부과구분", format.of("LEVY_SE_NM").style(center));
valueMap.put("통합구분", format.of("UNTY_SE_NM").style(center));
valueMap.put("감경구분", format.of("RDCT_SE_NM").style(center));
valueMap.put("부과일자", FormatMaker.yyyy_mm_dd(format, "LEVY_YMD").style(dateYMD));
valueMap.put("최초납기일자", FormatMaker.yyyy_mm_dd(format, "FRST_DUDT_YMD").style(dateYMD));
valueMap.put("납기일자", FormatMaker.yyyy_mm_dd(format, "DUDT_YMD").style(dateYMD));
valueMap.put("과태료금액", format.of("FFNLG_AMT").style(numeric));
valueMap.put("부과본세", format.of("LEVY_PCPTAX").style(numeric));
valueMap.put("부과가산금", format.of("LEVY_ADAMT").style(numeric));
valueMap.put("분납이자", format.of("ISPY_INT").style(numeric));
valueMap.put("수납본세", format.of("RCVMT_PCPTAX").style(numeric));
valueMap.put("수납가산금", format.of("RCVMT_ADAMT").style(numeric));
valueMap.put("감액본세", format.of("RDAMT_PCPTAX").style(numeric));
valueMap.put("감액가산금", format.of("RDAMT_ADAMT").style(numeric));
valueMap.put("미납금액", format.of("SUM_AMT").style(numeric));
valueMap.put("과세물건", format.of("TXTN_THING"));
valueMap.put("체납사유", format.of("NPMNT_RSN_NM"));
valueMap.put("수납일자", FormatMaker.yyyy_mm_dd(format, "RCVMT_YMD").style(dateYMD));
valueMap.put("압류일자", FormatMaker.yyyy_mm_dd(format, "SZR_YMD").style(dateYMD));
valueMap.put("압류물건", format.of("SZR_THING"));
valueMap.put("대체압류차량", format.of("RPM_SZR_VHRNO"));
valueMap.put("압류해제일자", FormatMaker.yyyy_mm_dd(format, "SZR_RMV_YMD").style(dateYMD));
valueMap.put("전자납부번호", format.of("EPAYNO_MASK"));
valueMap.put("은행명", format.of("BANK_NM"));
valueMap.put("가상계좌번호", format.of("VR_ACTNO").style(center));
valueMap.put("은행명2", format.of("BANK_NM2"));
valueMap.put("가상계좌번호2", format.of("VR_ACTNO2").style(center));
valueMap.put("은행명3", format.of("BANK_NM3"));
valueMap.put("가상계좌번호3", format.of("VR_ACTNO3").style(center));
valueMap.put("단속일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "CRDN_YMD_TM").style(dateDT));
valueMap.put("차량번호", format.of("VHRNO"));
valueMap.put("법정동", format.of("CRDN_STDG_NM"));
valueMap.put("단속장소", format.of("CRDN_PLC"));
valueMap.put("위반항목", format.of("VLTN_ARTCL"));
valueMap.put("단속원금", format.of("FFNLG_CRDN_AMT").style(numeric));
valueMap.put("처리상태", format.of("CRDN_STTS_NM"));
valueMap.put("납부자구분", format.of("RTPYR_SE_NM").style(center));
valueMap.put("납부자번호", format.of("RTPYR_NO").style(center));
valueMap.put("납부자명", format.of("RTPYR_NM"));
valueMap.put("우편번호", format.of("ZIP").style(center));
valueMap.put("주소", format.of("ADDR"));
valueMap.put("상세주소", format.of("DTL_ADDR"));
valueMap.put("등록일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT));
valueMap.put("등록사용자", format.of("RGTR_NM").style(center));
valueMap.put("수정일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "MDFCN_DT").style(dateDT));
valueMap.put("수정사용자", format.of("MDFR_NM").style(center));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0).value("부과").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(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"));
}
}
}

@ -36,7 +36,7 @@ import cokr.xit.foundation.data.DataObject;
*
* <pre>
* ============ ============
* 2023-08-30 JoJH
* 2023-08-30 JoJH
* ================================
* </pre>
*/
@ -44,248 +44,252 @@ import cokr.xit.foundation.data.DataObject;
@RequestMapping(name="과태료 감경 관리", value=Levy02Controller.CLASS_URL)
public class Levy02Controller extends ApplicationController {
public static final String CLASS_URL = "/levy/levy02";
public class METHOD_URL {
public static final String
reductionMain = "/010/main.do" // 과태료 감경 관리 메인 화면
, getReductionList = "/010/list.do" // 과태료 감경 대장 목록 조회
, removeReduction = "/010/remove.do" // 과태료 감경 대장 삭제
, getReductionInfo = "/020/info.do" // 과태료 감경 정보 조회
, createReduction = "/020/create.do" // 과태료 감경 대장 등럭
, updateReduction = "/020/update.do" // 과태료 감경 대장 수정
;
}
/**과태료 감경 대장 서비스*/
@Resource(name="rdctService")
private RdctService rdctService;
@Resource(name="stngBean")
private StngBean stngBean;
@Resource(name="userMapper")
protected UserMapper userMapper;
/** (levy/levy02010-main) .
* {@link #getRdctList(RdctQuery) } .
* @return /rdct/rdct-main
*/
@RequestMapping(name="과태료 감경 관리 대장 메인", value=METHOD_URL.reductionMain)
public ModelAndView reductionMain() {
ModelAndView mav = new ModelAndView("fims/levy/levy02010-main");
// 사용자 정보
FimsUser fimsUser = (FimsUser)currentUser().getUser();
// View(jsp)에서 사용할 공통코드를 조회
Map<String, List<CommonCode>> commonCodes = getCodesOf("FIM010", "FIM019", "FIM054");
return mav
.addObject("pageName", "levy02010") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
.addObject("infoPrefix", "rdct") // prefix
.addObject("infoPrefixUrl", CLASS_URL) // prefixUrl
.addObject("sggCd", fimsUser.getOrgID()) // 시군구 코드(SGG_CD)
.addObject("taskListForSgg", stngBean.filterTaskSectionCodeForSgg(commonCodes.get("FIM054"))) // 업무 구분 코드(TASK_SE_CD)
.addObject("FIM019List", commonCodes.get("FIM019")) // 감경 사유 구분 코드(RDCT_RSN_CD)
;
}
/** .<br />
* {@link RdctService#getRdctList(RdctQuery)}
* @param req
* @return jsonView
* <pre><code> {
* "rdctList": [ ]
* "rdctStart":
* "rdctFetch":
* "rdctTotal":
* }</code></pre>
*/
@Task
@RequestMapping(name="과태료 감경 대장 목록 조회", value=METHOD_URL.getReductionList)
public ModelAndView getRdctList(LevyQuery req) {
if (!"xls".equals(req.getDownload())) {
List<?> result = rdctService.getRdctList(setFetchSize(req));
return setCollectionInfo(new ModelAndView("jsonView"), result, "rdct");
} else {
// 현재 날짜 구하기
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String dateTime = dateFormat.format(System.currentTimeMillis());
List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = rdctService.getRdctList(req.setFetchSize(0));
Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("업무구분", format.of("TASK_SE_NM").style(center));
valueMap.put("감경일자", FormatMaker.yyyy_mm_dd(format, "RDCT_YMD").style(dateYMD));
valueMap.put("감경사유", format.of("RDCT_RSN_NM"));
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("VHRNO"));
valueMap.put("납부자구분", format.of("RTPYR_SE_NM").style(center));
valueMap.put("납부자번호", format.of("RTPYR_NO").style(center));
valueMap.put("납부자명", format.of("RTPYR_NM"));
valueMap.put("단속법정동", format.of("CRDN_STDG_NM").style(center));
valueMap.put("단속장소", format.of("CRDN_PLC"));
valueMap.put("상세단속장소", format.of("DTL_CRDN_PLC"));
valueMap.put("단속원금", format.of("FFNLG_CRDN_AMT").style(numeric));
valueMap.put("감경금액", format.of("RDCT_AMT").style(numeric));
valueMap.put("과태료금액", format.of("FFNLG_AMT").style(numeric));
valueMap.put("미납금액", format.of("SUM_AMT").style(numeric));
valueMap.put("처리상태", format.of("CRDN_STTS_NM"));
valueMap.put("단속특별구역", format.of("CRDN_SPAREA_NM").style(center));
valueMap.put("사용연료", format.of("USE_FUEL_NM").style(center));
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("RGTR_NM").style(center));
valueMap.put("수정일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "MDFCN_DT").style(dateDT));
valueMap.put("수정사용자", format.of("MDFR_NM").style(center));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0).value("과태료감경").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(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"));
}
}
/** ID (info) .
* @param req
* @return fims/levy/levy02020-info jsonView
* <pre>{
* "rdctInfo":
* }</pre>
*/
@Task
@RequestMapping(name="과태료 감경 정보 조회", value=METHOD_URL.getReductionInfo)
public ModelAndView getRdctInfo(HttpServletRequest hReq, LevyQuery req) {
DataObject info = rdctService.getRdctInfo(req);
// 등록을 호출하였지만 등록된 감경 ID가 있는지 확인.
if (req.getCallPurpose().equals("create") && !info.string("RDCT_ID").equals("")) {
ModelAndView mav = new ModelAndView("jsonView");
return mav.addObject("rtnMsg", "이미 등록된 과태료 감경 정보가 있습니다.");
} else if (req.getCallPurpose().equals("create") && info.string("RTPYR_ID").equals("")) {
ModelAndView mav = new ModelAndView("jsonView");
return mav.addObject("rtnMsg", "납부자 정보가 없습니다.");
} else {
boolean json = jsonResponse();
ModelAndView mav = new ModelAndView(json ? "jsonView" : "fims/levy/levy02020-info");
// View(jsp)에서 사용할 공통코드를 조회
Map<String, List<CommonCode>> commonCodes = getCodesOf("FIM019");
return mav
.addObject("openerPageName", hReq.getParameter("openerPageName")) // 호출한 Jsp PageName
.addObject("callPurpose", req.getCallPurpose()) // 호출 용도
.addObject("pageName", "levy02020") // jsp pageName
.addObject("infoPrefix", "rdct") // prefix
.addObject("infoPrefixUrl", CLASS_URL) // prefixUrl
.addObject("FIM019List", commonCodes.get("FIM019")) // 감경 사유 구분 코드(RDCT_RSN_CD)
.addObject("rdctInfo", json ? info : toJson(info))
;
}
}
/** .
* @param rdct
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
@Task
@RequestMapping(name="과태료 감경 대장 등록", value=METHOD_URL.createReduction)
public ModelAndView createRdct(Rdct rdct) {
boolean saved = false;
String rtnMsg = rdctService.createRdct(rdct);
if (rtnMsg.contains("[S]")) {
saved = true;
} else {
saved = false;
}
return new ModelAndView("jsonView")
.addObject("saved", saved)
.addObject("rtnMsg", rtnMsg);
}
/** .
* @param rdct
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
@Task
@RequestMapping(name="과태료 감경 대장 수정", value=METHOD_URL.updateReduction)
public ModelAndView updateRdct(Rdct rdct) {
boolean saved = false;
String rtnMsg = rdctService.updateRdct(rdct);
if (rtnMsg.contains("[S]")) {
saved = true;
} else {
saved = false;
}
return new ModelAndView("jsonView")
.addObject("saved", saved)
.addObject("rtnMsg", rtnMsg);
}
/** .
* @param rdctId ID
* @return jsonView
* <pre><code> {
* "affected":
* "saved": true, false
* }</code></pre>
*/
@Task
@RequestMapping(name="과태료 감경 대장 삭제", value=METHOD_URL.removeReduction)
public ModelAndView removeRdct(Rdct rdct) {
boolean saved = false;
String rtnMsg = "";
if (rdct.getRdctIds() == null || rdct.getRdctIds().length < 1) {
rtnMsg = rdctService.removeRdct(rdct);
} else {
// 부과제외 Ids 만큼 반복..
for (int iLoop = 0; iLoop < rdct.getRdctIds().length; iLoop++) {
rdct.setRdctId(rdct.getRdctIds()[iLoop]); // 감경 ID 설정
// 부과제외 삭제 호출
rtnMsg = rdctService.removeRdct(rdct);
if (!rtnMsg.contains("[S]")) // 오류가 발생하였으면 종료..
break;
}
}
if (rtnMsg.contains("[S]")) {
saved = true;
} else {
saved = false;
}
return new ModelAndView("jsonView")
.addObject("saved", saved)
.addObject("rtnMsg", rtnMsg);
}
public static final String CLASS_URL = "/levy/levy02";
public class METHOD_URL {
public static final String
reductionMain = "/010/main.do" // 과태료 감경 관리 메인 화면
, getReductionList = "/010/list.do" // 과태료 감경 대장 목록 조회
, removeReduction = "/010/remove.do" // 과태료 감경 대장 삭제
, getReductionInfo = "/020/info.do" // 과태료 감경 정보 조회
, createReduction = "/020/create.do" // 과태료 감경 대장 등럭
, updateReduction = "/020/update.do" // 과태료 감경 대장 수정
;
}
/**과태료 감경 대장 서비스*/
@Resource(name="rdctService")
private RdctService rdctService;
@Resource(name="stngBean")
private StngBean stngBean;
@Resource(name="userMapper")
protected UserMapper userMapper;
/** (levy/levy02010-main) .
* {@link #getRdctList(RdctQuery) } .
* @return /rdct/rdct-main
*/
@RequestMapping(name="과태료 감경 관리 대장 메인", value=METHOD_URL.reductionMain)
public ModelAndView reductionMain() {
ModelAndView mav = new ModelAndView("fims/levy/levy02010-main");
// 사용자 정보
FimsUser fimsUser = (FimsUser)currentUser().getUser();
// View(jsp)에서 사용할 공통코드를 조회
Map<String, List<CommonCode>> commonCodes = getCodesOf("FIM019", "FIM054");
return mav
.addObject("pageName", "levy02010") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
.addObject("prefixUrl", CLASS_URL) // prefixUrl
.addObject("sggCd", fimsUser.getOrgID()) // 시군구 코드(SGG_CD)
.addObject("taskListForSgg", stngBean.filterTaskSectionCodeForSgg(commonCodes.get("FIM054"))) // 업무 구분 코드(TASK_SE_CD)
.addObject("FIM019List", commonCodes.get("FIM019")) // 감경 사유 구분 코드(RDCT_RSN_CD)
;
}
/** .<br />
* {@link RdctService#getRdctList(RdctQuery)}
* @param req
* @return jsonView
* <pre><code> {
* "rdctList": [ ]
* "rdctStart":
* "rdctFetch":
* "rdctTotal":
* }</code></pre>
*/
@Task
@RequestMapping(name="과태료 감경 대장 목록 조회", value=METHOD_URL.getReductionList)
public ModelAndView getRdctList(LevyQuery req) {
if (!"xls".equals(req.getDownload())) {
List<?> result = rdctService.getRdctList(setFetchSize(req));
return setPagingInfo(new ModelAndView("jsonView"), result, "");
} else {
// 현재 날짜 구하기
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String dateTime = dateFormat.format(System.currentTimeMillis());
List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = rdctService.getRdctList(req.setFetchSize(0));
Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("업무구분", format.of("TASK_SE_NM").style(center));
valueMap.put("감경일자", FormatMaker.yyyy_mm_dd(format, "RDCT_YMD").style(dateYMD));
valueMap.put("감경사유", format.of("RDCT_RSN_NM"));
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("VHRNO"));
valueMap.put("납부자구분", format.of("RTPYR_SE_NM").style(center));
valueMap.put("납부자번호", format.of("RTPYR_NO").style(center));
valueMap.put("납부자명", format.of("RTPYR_NM"));
valueMap.put("단속법정동", format.of("CRDN_STDG_NM").style(center));
valueMap.put("단속장소", format.of("CRDN_PLC"));
valueMap.put("상세단속장소", format.of("DTL_CRDN_PLC"));
valueMap.put("단속원금", format.of("FFNLG_CRDN_AMT").style(numeric));
valueMap.put("감경금액", format.of("RDCT_AMT").style(numeric));
valueMap.put("과태료금액", format.of("FFNLG_AMT").style(numeric));
valueMap.put("미납금액", format.of("SUM_AMT").style(numeric));
valueMap.put("처리상태", format.of("CRDN_STTS_NM"));
valueMap.put("단속특별구역", format.of("CRDN_SPAREA_NM").style(center));
valueMap.put("사용연료", format.of("USE_FUEL_NM").style(center));
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("RGTR_NM").style(center));
valueMap.put("수정일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "MDFCN_DT").style(dateDT));
valueMap.put("수정사용자", format.of("MDFR_NM").style(center));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0).value("과태료감경").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(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"));
}
}
/** ID (info) .
* @param req
* @return fims/levy/levy02020-info jsonView
* <pre>{
* "rdctInfo":
* }</pre>
*/
@Task
@RequestMapping(name="과태료 감경 정보 조회", value=METHOD_URL.getReductionInfo)
public ModelAndView getRdctInfo(HttpServletRequest hReq, LevyQuery req) {
// 상세 정보 조회
DataObject rdctInfo = rdctService.getRdctInfo(req);
if (req.getCallPurpose().equals("create")) { // 등록
if (!rdctInfo.string("RDCT_ID").equals("")) {
ModelAndView mav = new ModelAndView("jsonView");
return mav.addObject("rtnMsg", "이미 등록된 과태료 감경 정보가 있습니다.");
} else if (rdctInfo.string("RTPYR_ID").equals("")) {
ModelAndView mav = new ModelAndView("jsonView");
return mav.addObject("rtnMsg", "납부자 정보가 없습니다.");
}
} else if (req.getCallPurpose().equals("update")) { // 수정
if (rdctInfo.string("RDCT_ID").equals("")) {
ModelAndView mav = new ModelAndView("jsonView");
return mav.addObject("rtnMsg", "조회된 과태료 감경 정보가 없습니다.");
}
}
boolean json = jsonResponse();
ModelAndView mav = new ModelAndView(json ? "jsonView" : "fims/levy/levy02020-info");
// View(jsp)에서 사용할 공통코드를 조회
Map<String, List<CommonCode>> commonCodes = getCodesOf("FIM019");
return mav
.addObject("callPurpose", req.getCallPurpose()) // 호출 용도
.addObject("pageName", "levy02020") // jsp pageName
.addObject("prefixUrl", CLASS_URL) // prefixUrl
.addObject("FIM019List", commonCodes.get("FIM019")) // 감경 사유 구분 코드(RDCT_RSN_CD)
.addObject("Info", json ? rdctInfo : toJson(rdctInfo))
;
}
/** .
* @param rdct
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
@Task
@RequestMapping(name="과태료 감경 대장 등록", value=METHOD_URL.createReduction)
public ModelAndView createRdct(Rdct rdct) {
boolean saved = false;
String rtnMsg = rdctService.createRdct(rdct);
if (rtnMsg.contains("[S]")) {
saved = true;
} else {
saved = false;
}
return new ModelAndView("jsonView")
.addObject("saved", saved)
.addObject("rtnMsg", rtnMsg);
}
/** .
* @param rdct
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
@Task
@RequestMapping(name="과태료 감경 대장 수정", value=METHOD_URL.updateReduction)
public ModelAndView updateRdct(Rdct rdct) {
boolean saved = false;
String rtnMsg = rdctService.updateRdct(rdct);
if (rtnMsg.contains("[S]")) {
saved = true;
} else {
saved = false;
}
return new ModelAndView("jsonView")
.addObject("saved", saved)
.addObject("rtnMsg", rtnMsg);
}
/** .
* @param rdctId ID
* @return jsonView
* <pre><code> {
* "affected":
* "saved": true, false
* }</code></pre>
*/
@Task
@RequestMapping(name="과태료 감경 대장 삭제", value=METHOD_URL.removeReduction)
public ModelAndView removeRdct(Rdct rdct) {
boolean saved = false;
String rtnMsg = "";
if (rdct.getRdctIds() == null || rdct.getRdctIds().length < 1) {
rtnMsg = rdctService.removeRdct(rdct);
} else {
// 감경 IDs 만큼 감경 삭제 반복..
for (String rdctId : rdct.getRdctIds()) {
Rdct deltRdct = new Rdct();
deltRdct.setRdctId(rdctId);
deltRdct.setDelRsn(rdct.getDelRsn());
// 감경 삭제 호출
rtnMsg = rdctService.removeRdct(deltRdct);
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