새올요청자료 등록 기능 추가

main
이범준 1 year ago
parent 45f2f4bbbd
commit ea8ce1e498

@ -203,4 +203,19 @@ public class CrdnCvlcpt extends AbstractEntity {
*/ */
private java.lang.String mailCn; private java.lang.String mailCn;
/**
* ID
*/
private java.lang.String indivId;
/**
*
*/
private java.lang.String rcptYmd;
/**
*
*/
private java.lang.String pstNo;
} }

@ -5,6 +5,7 @@ import java.util.List;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper; import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.cvlc.CrdnCvlcpt;
import cokr.xit.foundation.component.AbstractMapper; import cokr.xit.foundation.component.AbstractMapper;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
@ -20,4 +21,10 @@ public interface SaCvlcptIndviDmndMapper extends AbstractMapper {
*/ */
List<DataObject> selectDmndDataList(CrdnQuery query); List<DataObject> selectDmndDataList(CrdnQuery query);
/** .
* @param crdnCvlcpt
* @return
*/
int insertDmndDataInfo(CrdnCvlcpt crdnCvlcpt);
} }

@ -115,4 +115,10 @@ public interface CrdnCvlcptService {
*/ */
List<DataObject> getDmndDataList(CrdnQuery query); List<DataObject> getDmndDataList(CrdnQuery query);
/** .
* @param crdnCvlcpt
* @return
*/
boolean createDmndDataInfo(CrdnCvlcpt crdnCvlcpt);
} }

@ -327,7 +327,19 @@ public class CrdnCvlcptMainBean extends AbstractComponent {
* @return * @return
*/ */
public List<DataObject> selectDmndDataList(CrdnQuery query) { public List<DataObject> selectDmndDataList(CrdnQuery query) {
query.setOrderBy("INDIV_ID");
return saCvlcptIndviDmndMapper.selectDmndDataList(query); return saCvlcptIndviDmndMapper.selectDmndDataList(query);
} }
/** .
* @param crdnCvlcpt
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public boolean createDmndDataInfo(CrdnCvlcpt crdnCvlcpt) {
return saCvlcptIndviDmndMapper.insertDmndDataInfo(crdnCvlcpt) == 1 ? true : false;
}
} }

@ -732,4 +732,9 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv
return crdnCvlcptMainBean.selectDmndDataList(query); return crdnCvlcptMainBean.selectDmndDataList(query);
} }
@Override
public boolean createDmndDataInfo(CrdnCvlcpt crdnCvlcpt) {
return crdnCvlcptMainBean.createDmndDataInfo(crdnCvlcpt);
}
} }

@ -12,6 +12,7 @@ import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.GlobalStngMapper; import cokr.xit.fims.crdn.dao.GlobalStngMapper;
import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.crdn.service.CrdnService;
import cokr.xit.fims.cvlc.CrdnCvlcpt;
import cokr.xit.fims.cvlc.service.CrdnCvlcptService; import cokr.xit.fims.cvlc.service.CrdnCvlcptService;
/** .<br /> /** .<br />
@ -24,7 +25,9 @@ public class Cvlc04Controller extends ApplicationController {
public class METHOD_URL { public class METHOD_URL {
public static final String public static final String
getDmndDataList = "/010/list.do"; getDmndDataList = "/010/list.do",
createDmndDataInfo = "/010/create.do"
;
} }
@Resource(name="crdnService") @Resource(name="crdnService")
@ -65,4 +68,24 @@ public class Cvlc04Controller extends ApplicationController {
} }
/** .
* {@link CrdnCvlcService#createDmndDataInfo(crdnCvlcpt)}
* @param crdnCvlcpt
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
public ModelAndView createDmndDataInfo(CrdnCvlcpt crdnCvlcpt) {
crdnCvlcpt.setSggCd(globalStngMapper.selectSggCdForCurrentUser());
boolean saved = false;
saved = crdnCvlcptService.createDmndDataInfo(crdnCvlcpt);
return new ModelAndView("jsonView")
.addObject("saved", saved);
}
} }

@ -124,6 +124,12 @@ public class BpvController {
return super.getDmndDataList(query); return super.getDmndDataList(query);
} }
@Override
@RequestMapping(name="전용차로과태료업무 새올요청자료 등록", value=METHOD_URL.createDmndDataInfo)
public ModelAndView createDmndDataInfo(CrdnCvlcpt crdnCvlcpt) {
return super.createDmndDataInfo(crdnCvlcpt);
}
} }
@Controller @Controller

@ -126,6 +126,12 @@ public class DpvController {
return super.getDmndDataList(query); return super.getDmndDataList(query);
} }
@Override
@RequestMapping(name="장애인과태료업무 새올요청자료 등록", value=METHOD_URL.createDmndDataInfo)
public ModelAndView createDmndDataInfo(CrdnCvlcpt crdnCvlcpt) {
return super.createDmndDataInfo(crdnCvlcpt);
}
} }
@Controller @Controller

@ -124,6 +124,12 @@ public class EcaController {
return super.getDmndDataList(query); return super.getDmndDataList(query);
} }
@Override
@RequestMapping(name="전기차과태료업무 새올요청자료 등록", value=METHOD_URL.createDmndDataInfo)
public ModelAndView createDmndDataInfo(CrdnCvlcpt crdnCvlcpt) {
return super.createDmndDataInfo(crdnCvlcpt);
}
} }
@Controller @Controller

@ -129,6 +129,12 @@ public class PvsController {
return super.getDmndDataList(query); return super.getDmndDataList(query);
} }
@Override
@RequestMapping(name="주정차과태료업무 새올요청자료 등록", value=METHOD_URL.createDmndDataInfo)
public ModelAndView createDmndDataInfo(CrdnCvlcpt crdnCvlcpt) {
return super.createDmndDataInfo(crdnCvlcpt);
}
} }
@Controller @Controller

@ -5,18 +5,19 @@
<select id="selectDmndDataList" parameterType="cokr.xit.fims.crdn.CrdnQuery" resultType="dataobject"> <select id="selectDmndDataList" parameterType="cokr.xit.fims.crdn.CrdnQuery" resultType="dataobject">
/* 새올요청자료 목록 조회(saCvlcptIndviDmndMapper.selectDmndDataList) */ /* 새올요청자료 목록 조회(saCvlcptIndviDmndMapper.selectDmndDataList) */
<include refid="utility.paging-prefix"/> <include refid="utility.paging-prefix"/>
SELECT SA.INDIV_ID SELECT SA.INDIV_ID <!-- 개별 ID -->
, SA.DMND_YMD , SA.DMND_YMD <!-- 요청일자 -->
, SA.DMND_SE_CD , SA.DMND_SE_CD <!-- 요청 구분 코드 -->
, SA.RCPT_YMD , SA.RCPT_YMD <!-- 접수 일자 -->
, SA.PST_NO , SA.PST_NO <!-- 게시물 번호 -->
, SA.CRDN_ID , SA.CRDN_ID <!-- 단속 ID -->
, SA.STTS_CD , SA.STTS_CD <!-- 상태 코드 -->
, SA.RSPNS_DT , FN_GET_CODE_NM('FIM063', SA.STTS_CD) AS STTS_NM <!-- 상태명 -->
, SA.RSPNS_DT <!-- 응답 일시 -->
, (SELECT USER_NM , (SELECT USER_NM
FROM TB_USER FROM TB_USER
WHERE USER_ID = SA.RGTR WHERE USER_ID = SA.RGTR
) AS RGTR ) AS RGTR <!-- 요청자 -->
FROM TB_SA_CVLCPT_INDIV_DMND SA FROM TB_SA_CVLCPT_INDIV_DMND SA
WHERE SA.SGG_CD = #{sggCd} WHERE SA.SGG_CD = #{sggCd}
<if test="schDmndYmdFrom != null or schDmndYmdTo != null"> <if test="schDmndYmdFrom != null or schDmndYmdTo != null">
@ -27,4 +28,41 @@ SELECT SA.INDIV_ID
<include refid="utility.paging-suffix"/> <include refid="utility.paging-suffix"/>
</select> </select>
<insert id="insertDmndDataInfo" parameterType="cokr.xit.fims.cvlc.CrdnCvlcpt">
<selectKey resultType="string" keyProperty="indivId" keyColumn="NEW_ID" order="BEFORE">
SELECT
CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), LPAD(CAST(IFNULL(MAX(SUBSTRING(INDIV_ID, 5)) + 1, 1) AS INT), 26, '0'))
AS NEW_ID
FROM TB_SA_CVLCPT_INDIV_DMND
</selectKey>
/* 새올요청자료 등록(saCvlcptIndviDmndMapper.insertDmndDataInfo) */
INSERT
INTO TB_SA_CVLCPT_INDIV_DMND (
INDIV_ID
, SGG_CD
, RCPT_YMD
, PST_NO
, DMND_YMD
, DMND_SE_CD
, STTS_CD
, REG_DT
, RGTR
, MDFCN_DT
, MDFR
)
VALUES (
#{indivId}
, #{sggCd}
, REPLACE(#{rcptYmd},'-','')
, LPAD(#{pstNo}, 6, '0')
, <include refid="utility.today" />
, '1'
, '0'
, <include refid="utility.now" />
, #{modifiedBy}
, <include refid="utility.now" />
, #{modifiedBy}
)
</insert>
</mapper> </mapper>

@ -51,13 +51,13 @@
<div> <div>
<span class="container-page-btn"> <span class="container-page-btn">
<div class="d-flex flex-row justify-content-between"> <div class="d-flex flex-row justify-content-between">
<label id="requestPaging--${pageName}PagingInfo" class="dataTables_info" <label id="dmndPaging--${pageName}PagingInfo" class="dataTables_info"
role="status" aria-live="polite"></label> role="status" aria-live="polite"></label>
<ul id="requestPaging--${pageName}" class="pagination pagination-primary"> <ul id="dmndPaging--${pageName}" class="pagination pagination-primary">
</ul> </ul>
</div> </div>
<span class="container-window-btn-right"> <span class="container-window-btn-right">
<button type="button" id="btnOpenRequestPop--${pageName}" <button type="button" id="btnOpenDmndPop--${pageName}"
class="btn btn-primary" title="요청 등록">요청 등록</button> class="btn btn-primary" title="요청 등록">요청 등록</button>
<button type="button" id="btnDelete--${pageName}" <button type="button" id="btnDelete--${pageName}"
class="btn btn-primary" title="한 건 삭제">한 건 삭제</button> class="btn btn-primary" title="한 건 삭제">한 건 삭제</button>
@ -73,7 +73,7 @@
style="overflow-x: scroll;height:550px;overflow-y: scroll;"> style="overflow-x: scroll;height:550px;overflow-y: scroll;">
<table id="DataTables_Table_0--${pageName}" <table id="DataTables_Table_0--${pageName}"
class="datatables-ajax table table-bordered dataTable no-footer"> class="datatables-ajax table table-bordered dataTable no-footer">
<thead id="requestThead--${pageName}"> <thead id="dmndThead--${pageName}">
<tr data-by="by--${pageName}" data-by-output="byOutput--${pageName}" <tr data-by="by--${pageName}" data-by-output="byOutput--${pageName}"
data-main-option="mainOption--${pageName}" data-sub-option="subOption--${pageName}"> data-main-option="mainOption--${pageName}" data-sub-option="subOption--${pageName}">
<th style="min-width: 80px;">No.</th> <th style="min-width: 80px;">No.</th>
@ -86,8 +86,8 @@
<th style="min-width: 80px;">상태</th> <th style="min-width: 80px;">상태</th>
</tr> </tr>
</thead> </thead>
<tbody id="requestTbody--${pageName}"></tbody> <tbody id="dmndTbody--${pageName}"></tbody>
<template id="requestRow--${pageName}"> <template id="dmndRow--${pageName}">
<tr data-key="{INDIV_ID}"> <tr data-key="{INDIV_ID}">
<td onclick="{onclick}" class="text-end">{ROW_NUM}</td> <td onclick="{onclick}" class="text-end">{ROW_NUM}</td>
<td onclick="{onclick}" class="text-center">{DMND_YMD}</td> <td onclick="{onclick}" class="text-center">{DMND_YMD}</td>
@ -96,10 +96,10 @@
<td onclick="{onclick}" class="text-center">{PST_NO}</td> <td onclick="{onclick}" class="text-center">{PST_NO}</td>
<td onclick="{onclick}" class="text-center">{RGTR}</td> <td onclick="{onclick}" class="text-center">{RGTR}</td>
<td onclick="{onclick}" class="text-center">{RSPNS_DT}</td> <td onclick="{onclick}" class="text-center">{RSPNS_DT}</td>
<td onclick="{onclick}" class="text-center">{STTS_CD}</td> <td onclick="{onclick}" class="text-center">{STTS_NM}</td>
</tr> </tr>
</template> </template>
<template id="requestNotFound--${pageName}"> <template id="dmndNotFound--${pageName}">
<tr> <tr>
<td valign="top" colspan="8" class="dataTables_empty text-center">요청 정보를 찾지 못했습니다.</td> <td valign="top" colspan="8" class="dataTables_empty text-center">요청 정보를 찾지 못했습니다.</td>
</tr> </tr>
@ -111,8 +111,7 @@
</div> </div>
<div class="toast-container position-fixed bottom-0 end-0 p-3"> <div class="toast-container position-fixed bottom-0 end-0 p-3">
<div id="divToast--${pageName}" class="toast" role="alert" aria-live="assertive" aria-atomic="true"> <div id="divToast--${pageName}" class="toast" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-body bg-black text-white"> <div id="toastText--${pageName}" class="toast-body bg-black text-white">
삭제 되었습니다.
</div> </div>
</div> </div>
</div> </div>
@ -125,21 +124,21 @@
<div class="content-backdrop fade"></div> <div class="content-backdrop fade"></div>
</div> </div>
<template id="rcptRequestDialogTemplate--${pageName}"> <template id="seallDmndDialogTemplate--${pageName}">
<form id="frmEdit--${pageName}"> <form id="frmEdit--${pageName}">
<div class="card"> <div class="card">
<div class="row g-1"> <div class="row g-1">
<div class="col-md-12"> <div class="col-md-12">
<label for="requestYmd--${pageName}" <label for="rcptYmd--${pageName}"
class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end required">접수일자</label> class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end required">접수일자</label>
<input type="text" id="requestYmd--${pageName}" name="requestYmd" required <input type="text" id="rcptYmd--${pageName}" name="rcptYmd" required
class="form-control form-date" data-fmt-type="day" /> class="form-control form-date" data-fmt-type="day" />
<button type="button" class="bx bx-sm bx-calendar bg-white"></button> <button type="button" class="bx bx-sm bx-calendar bg-white"></button>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<label for="listNo--${pageName}" <label for="pstNo--${pageName}"
class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end required">목록번호</label> class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end required">목록번호</label>
<input type="text" id="listNo--${pageName}" name="listNo" required <input type="text" id="pstNo--${pageName}" name="pstNo" required
class="form-control" type="text" maxlength="6" data-maxlengthb="6" data-fmt-type="zeroLpadNumber" /> class="form-control" type="text" maxlength="6" data-maxlengthb="6" data-fmt-type="zeroLpadNumber" />
</div> </div>
</div> </div>
@ -176,83 +175,83 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
**************************************************************************/ **************************************************************************/
$P.requestControl = new DatasetControl({ $P.dmndControl = new DatasetControl({
urls : { load : "", create : "", remove : "" }, urls : { load : "", create : "", remove : "" },
dataGetter : obj => obj["List"], appendData:true, dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.INDIV_ID : "", keymapper : info => info ? info.INDIV_ID : "",
formats : { formats : {
DMND_SE_CD : FIM062, DMND_SE_CD : FIM062,
STTS_CD : FIM063,
DMND_YMD : dateFormat, DMND_YMD : dateFormat,
RCPT_YMD : dateFormat, RCPT_YMD : dateFormat,
RSPNS_DT : datetimeFormat RSPNS_DT : datetimeFormat
} }
}); });
$P.requestControl.defaultFetchSize = FETCH_XS; $P.dmndControl.defaultFetchSize = FETCH_XS;
$P.requestControl.untilPageNum = 0; $P.dmndControl.untilPageNum = 0;
$P.requestControl.beforeCurrent = null; $P.dmndControl.beforeCurrent = null;
$P.requestControl.tableRenderComplete = false; $P.dmndControl.tableRenderComplete = false;
/************************************************************************** /**************************************************************************
* DatasetControl.on * DatasetControl.on
**************************************************************************/ **************************************************************************/
$P.requestControl.onDatasetChange = (obj) => { $P.dmndControl.onDatasetChange = (obj) => {
$P.renderRequestList(obj["Total"]); $P.renderDmndList(obj["Total"]);
$("#requestPaging--${pageName}").setPagingInfo({ $("#dmndPaging--${pageName}").setPagingInfo({
list: $P.requestControl.dataset, list: $P.dmndControl.dataset,
prefix: "requestPaging--${pageName}", prefix: "dmndPaging--${pageName}",
start: obj["Start"], start: obj["Start"],
totalSize: obj["Total"], totalSize: obj["Total"],
fetchSize: obj["Fetch"], fetchSize: obj["Fetch"],
func: "pageObject['${pageName}'].requestControl.load({index})" func: "pageObject['${pageName}'].dmndControl.load({index})"
}); });
$P.requestControl.tableRenderComplete = true; $P.dmndControl.tableRenderComplete = true;
}; };
$P.requestControl.onCurrentChange = (item) => { $P.dmndControl.onCurrentChange = (item) => {
if(!$P.requestControl.tableRenderComplete){ if(!$P.dmndControl.tableRenderComplete){
return; return;
} }
if($P.requestControl.beforeCurrent != null){ if($P.dmndControl.beforeCurrent != null){
var beforeCurrentKey = $P.requestControl.beforeCurrent.key; var beforeCurrentKey = $P.dmndControl.beforeCurrent.key;
var beforeCurrentIndex = $P.requestControl.beforeCurrent.index; var beforeCurrentIndex = $P.dmndControl.beforeCurrent.index;
$P.requestControl.beforeCurrent = null; $P.dmndControl.beforeCurrent = null;
if(!$P.requestControl.dataset.empty){ if(!$P.dmndControl.dataset.empty){
var info = $P.requestControl.dataset.getData(beforeCurrentKey); var info = $P.dmndControl.dataset.getData(beforeCurrentKey);
if(info != null){ if(info != null){
$P.requestControl.dataset.setCurrent(beforeCurrentKey,true); $P.dmndControl.dataset.setCurrent(beforeCurrentKey,true);
return; return;
} }
if(beforeCurrentIndex > ($P.requestControl.dataset.length - 1)){ if(beforeCurrentIndex > ($P.dmndControl.dataset.length - 1)){
info = $P.requestControl.dataset.getDataset()[$P.requestControl.dataset.length - 1]; info = $P.dmndControl.dataset.getDataset()[$P.dmndControl.dataset.length - 1];
} else { } else {
info = $P.requestControl.dataset.getDataset()[beforeCurrentIndex]; info = $P.dmndControl.dataset.getDataset()[beforeCurrentIndex];
} }
$P.requestControl.dataset.setCurrent(info["INDIV_ID"],true); $P.dmndControl.dataset.setCurrent(info["INDIV_ID"],true);
return; return;
} }
} }
$P.requestControl.tableRenderComplete = false; $P.dmndControl.tableRenderComplete = false;
if(!item){ if(!item){
$P.clickRequestList("", true); $P.clickDmndList("", true);
} else { } else {
$P.clickRequestList($P.requestControl.getCurrent()["INDIV_ID"], true); $P.clickDmndList($P.dmndControl.getCurrent()["INDIV_ID"], true);
} }
} }
$P.requestControl.onRemove = (selected, resp) => { $P.dmndControl.onRemove = (selected, resp) => {
if (resp.saved){ if (resp.saved){
$("#toastText--${pageName}").html("삭제 되었습니다.");
$P.toast.show(); $P.toast.show();
$P.refreshRequestList(); $P.refreshDmndList();
} }
} }
@ -263,31 +262,35 @@ $(document).ready(function(){
$('#schDmndYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-5475).date); $('#schDmndYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-5475).date);
$('#schDmndYmdTo--${pageName}').datepicker('setDate', new Date()); $('#schDmndYmdTo--${pageName}').datepicker('setDate', new Date());
$P.requestControl.setData([]); $P.dmndControl.setData([]);
} }
$P.fnResetAndChangeBiz = (taskSeCd) => { $P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset(); $P.fnReset();
$P.requestControl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/list.do"); $P.dmndControl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/list.do");
$P.requestControl.urls.create = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/create.do"); $P.dmndControl.urls.create = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/create.do");
$P.requestControl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/remove.do"); $P.dmndControl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/remove.do");
} }
$P.refreshRequestList = () => { $P.refreshDmndList = () => {
$P.requestControl.untilPageNum = $P.requestControl.query.pageNum; $P.dmndControl.untilPageNum = $P.dmndControl.query.pageNum;
$P.requestControl.query.fetchSize = $P.requestControl.defaultFetchSize * $P.requestControl.query.pageNum; $P.dmndControl.query.fetchSize = $P.dmndControl.defaultFetchSize * $P.dmndControl.query.pageNum;
$P.requestControl.beforeCurrent = {
key : $P.requestControl.getCurrent()["INDIV_ID"], if(!$P.dmndControl.dataset.empty){
index : $P.requestControl.getCurrent()["ROW_NUM"] - 1 $P.dmndControl.beforeCurrent = {
key : $P.dmndControl.getCurrent()["INDIV_ID"],
index : $P.dmndControl.getCurrent()["ROW_NUM"] - 1
}; };
$P.requestControl.load(1);
} }
$P.searchRequestList = () => { $P.dmndControl.load(1);
}
$P.searchDmndList = () => {
$P.requestControl.query = $P.getParams(); $P.dmndControl.query = $P.getParams();
$P.requestControl.load(1); $P.dmndControl.load(1);
} }
$P.scrollEnd = (obj) => { $P.scrollEnd = (obj) => {
@ -302,15 +305,15 @@ $(document).ready(function(){
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){ if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){
obj.dataset.scrollStatus = "waiting"; obj.dataset.scrollStatus = "waiting";
$P.scrollRequestList(); $P.scrollDmndList();
} }
} }
$P.scrollRequestList = () => { $P.scrollDmndList = () => {
$P.requestControl.load($P.requestControl.query.pageNum + 1); $P.dmndControl.load($P.dmndControl.query.pageNum + 1);
} }
$P.clickRequestList = (dataKey, auto) => { $P.clickDmndList = (dataKey, auto) => {
if(dataKey == ""){ if(dataKey == ""){
if(auto){ if(auto){
$("label[for='table-responsive--${pageName}']").trigger("refreshEnd"); $("label[for='table-responsive--${pageName}']").trigger("refreshEnd");
@ -318,120 +321,135 @@ $(document).ready(function(){
return; return;
} }
$("#requestTbody--${pageName}").setCurrentRow(dataKey); $("#dmndTbody--${pageName}").setCurrentRow(dataKey);
if(!auto){ if(!auto){
$P.requestControl.setCurrent(dataKey); $P.dmndControl.setCurrent(dataKey);
} else { } else {
$("label[for='table-responsive--${pageName}']").trigger("refreshEnd"); $("label[for='table-responsive--${pageName}']").trigger("refreshEnd");
} }
} }
$P.renderRequestList = (total) => { $P.renderDmndList = (total) => {
var requestList = $P.requestControl.dataset; var dmndList = $P.dmndControl.dataset;
var empty = requestList.empty; var empty = dmndList.empty;
var notFound = [document.getElementById("requestNotFound--${pageName}").innerHTML]; var notFound = [document.getElementById("dmndNotFound--${pageName}").innerHTML];
var found = document.getElementById("requestRow--${pageName}").innerHTML; var found = document.getElementById("dmndRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickRequestList('" + dataItem.getValue("INDIV_ID") + "');"); .replace(/{onclick}/gi, "pageObject['${pageName}'].clickDmndList('" + dataItem.getValue("INDIV_ID") + "');");
var trs = empty ? notFound : requestList.inStrings(found, replacer); var trs = empty ? notFound : dmndList.inStrings(found, replacer);
$("#requestTbody--${pageName}").html(trs.join()); $("#dmndTbody--${pageName}").html(trs.join());
if(total == requestList.length){ if(total == dmndList.length){
$("#table-responsive--${pageName}").attr("data-scroll-status", "complete"); $("#table-responsive--${pageName}").attr("data-scroll-status", "complete");
} else { } else {
$("#table-responsive--${pageName}").removeAttr("data-scroll-status"); $("#table-responsive--${pageName}").removeAttr("data-scroll-status");
} }
if($P.requestControl.untilPageNum != 0){ if($P.dmndControl.untilPageNum != 0){
$P.requestControl.query.fetchSize = $P.requestControl.defaultFetchSize; $P.dmndControl.query.fetchSize = $P.dmndControl.defaultFetchSize;
$P.requestControl.query.pageNum = $P.requestControl.untilPageNum; $P.dmndControl.query.pageNum = $P.dmndControl.untilPageNum;
$P.requestControl.untilPageNum = 0; $P.dmndControl.untilPageNum = 0;
} }
} }
$P.getParams = () => { $P.getParams = () => {
var formFields = new FimsFormFields("#frmSearch--${pageName}"); var formFields = new FimsFormFields("#frmSearch--${pageName}");
var data = formFields.get(); var data = formFields.get();
data.fetchSize = $P.requestControl.defaultFetchSize; data.fetchSize = $P.dmndControl.defaultFetchSize;
return data; return data;
} }
$P.fnRemove = (allCompleteData) => { $P.fnRemove = (allCompleteData) => {
if(allCompleteData != null){ if(allCompleteData){
var ds = $P.requestControl.dataset.getDataset(); var ds = $P.dmndControl.dataset.getDataset();
var requestIds = ds.map(function(item){ var indivIds = ds.map(function(item){
if(item['STTS_CD'] == 'complete'){ if(item['STTS_CD'] == '9'){
return item["INDIV_ID"]; return item["INDIV_ID"];
} }
}); });
$P.requestControl.select(requestIds,true); $P.dmndControl.select(indivIds,true);
} else { } else {
var cur = $P.requestControl.getCurrent(); var cur = $P.dmndControl.getCurrent();
if(cur == null){ if(cur == null){
return; return;
} }
var curKey = cur["INDIV_ID"]; var curKey = cur["INDIV_ID"];
$P.requestControl.select(curKey,true); $P.dmndControl.select(curKey,true);
} }
// TODO : 요청 삭제 서비스 //$P.requestControl.remove(); // TODO : 요청 삭제 서비스 //$P.dmndControl.remove();
} }
$P.fnRemoveAllCompleteData = () => { $P.fnRemoveAllCompleteData = () => {
var cur = $P.requestControl.getCurrent(); var cur = $P.dmndControl.getCurrent();
if(cur == null){ if(cur == null){
return; return;
} }
dialog.alert({ dialog.alert({
content : "완료된 자료를 모두 삭제하시겠습니까?" content : "완료된 자료를 모두 삭제하시겠습니까?",
, onOK : () => { onOK : () => {
$P.fnRemove('allCompleteData'); $P.fnRemove(true);
} }
}); });
} }
//요청 등록 팝업 호출 //요청 등록 팝업 호출
$P.fnOpenRequestPop = () => { $P.fnOpenDmndPop = () => {
dialog.open({ dialog.open({
id : "rcptRequestDialog--${pageName}", id : "seallDmndDialog--${pageName}",
title : "새올 접수 요청", title : "새올 접수 요청",
content : document.getElementById("rcptRequestDialogTemplate--${pageName}").innerHTML, content : document.getElementById("seallDmndDialogTemplate--${pageName}").innerHTML,
size : "lg", size : "lg",
init : () => { init : () => {
initDatepicker("rcptRequestDialog--${pageName}"); initDatepicker("seallDmndDialog--${pageName}");
$('#requestYmd--${pageName}').datepicker('setDate', new Date()); $('#rcptYmd--${pageName}').datepicker('setDate', new Date());
$('#btnCreate--${pageName}').on("click", () => $P.fnCreateRequest()); $('#btnCreate--${pageName}').on("click", () => $P.fnCreateDmnd());
}, },
onClose : () => {} onClose : () => {}
}); });
} }
//요청 등록 //요청 등록
$P.fnCreateRequest = () => { $P.fnCreateDmnd = () => {
if(!customValidate($("#frmEdit--${pageName} input"))) return; if(!customValidate($("#frmEdit--${pageName} input"))) return;
var info = (new FimsFormFields("#frmEdit--${pageName}")).get(); var info = (new FimsFormFields("#frmEdit--${pageName}")).get();
// TODO : 요청 등록 서비스 //ajax ajax.get({
url : $P.dmndControl.urls.create,
data : info,
success : resp => {
if(resp.saved){
dialog.close("seallDmndDialog--${pageName}");
$("#toastText--${pageName}").html("등록 되었습니다.");
$P.toast.show();
if(!$P.dmndControl.dataset.empty){
$P.refreshDmndList();
}
}
}
});
} }
/************************************************************************** /**************************************************************************
* element.on * element.on
**************************************************************************/ **************************************************************************/
$('#btnReset--${pageName}').on('click', () => $P.fnReset()); $('#btnReset--${pageName}').on('click', () => $P.fnReset());
$('#btnSearch--${pageName}').on('click', () => $P.searchRequestList()); $('#btnSearch--${pageName}').on('click', () => $P.searchDmndList());
$("#table-responsive--${pageName}").scroll(function(){ $P.scrollEnd(this); }); $("#table-responsive--${pageName}").scroll(function(){ $P.scrollEnd(this); });
$("#btnOpenRequestPop--${pageName}").on("click", () => $P.fnOpenRequestPop()); $("#btnOpenDmndPop--${pageName}").on("click", () => $P.fnOpenDmndPop());
$("#btnDelete--${pageName}").on("click", () => $P.fnRemove()); $("#btnDelete--${pageName}").on("click", () => $P.fnRemove(false));
$("#btnDeleteAllCompleteData--${pageName}").on("click", () => $P.fnRemoveAllCompleteData()); $("#btnDeleteAllCompleteData--${pageName}").on("click", () => $P.fnRemoveAllCompleteData());
/************************************************************************** /**************************************************************************

Loading…
Cancel
Save