과태료업무 설정, 위반항목 설정 저장 기능 추가

main
이범준 9 months ago
parent 2f6941338a
commit 7f3b2a12c5

@ -1,5 +1,7 @@
package cokr.xit.fims.mngt; package cokr.xit.fims.mngt;
import java.util.List;
import cokr.xit.foundation.AbstractEntity; import cokr.xit.foundation.AbstractEntity;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@ -30,7 +32,7 @@ public class Task extends AbstractEntity {
/** /**
* *
*/ */
private Integer advntceDaycnt; private Integer advntceDayCnt;
/** /**
* *
@ -72,4 +74,9 @@ public class Task extends AbstractEntity {
*/ */
private String nxrpLinkSeDtlSn; private String nxrpLinkSeDtlSn;
/**
*
*/
private List<Vltn> vltnStngList;
} }

@ -0,0 +1,28 @@
package cokr.xit.fims.mngt.service;
import java.util.List;
import cokr.xit.fims.mngt.Task;
import cokr.xit.fims.mngt.Vltn;
public interface TaskVltnService {
/** , .
* @param task , vltnList
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
boolean update(Task task, List<Vltn> vltnList);
/** , .
* @param sggCd , taskSeCd
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
boolean create(String sggCd, String taskSeCd);
}

@ -0,0 +1,100 @@
package cokr.xit.fims.mngt.service.bean;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import cokr.xit.base.code.service.CodeQuery;
import cokr.xit.base.code.service.bean.CodeBean;
import cokr.xit.fims.mngt.Task;
import cokr.xit.fims.mngt.Vltn;
import cokr.xit.fims.mngt.service.TaskVltnService;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.foundation.data.DataObject;
@Service("taskVltnService")
public class TaskVltnServiceBean extends AbstractServiceBean implements TaskVltnService {
/** 업무 정보 Bean */
@Resource(name = "taskBean")
private TaskBean taskBean;
/** 위반 정보 Bean */
@Resource(name = "vltnBean")
private VltnBean vltnBean;
@Resource(name = "codeBean")
private CodeBean codeBean;
@Override
public boolean update(Task task, List<Vltn> vltnList) {
boolean result = taskBean.update(task);
if(!result) {
throw new RuntimeException("[F]업무 설정 수정 중 오류가 발생하였습니다.");
}
for(Vltn vltn : vltnList) {
result = vltnBean.update(vltn);
if(!result) {
throw new RuntimeException("[F]위반 설정 수정 중 오류가 발생하였습니다.");
}
}
return result;
}
@Override
public boolean create(String sggCd, String taskSeCd) {
Task task = new Task();
task.setSggCd(sggCd);
task.setTaskSeCd(taskSeCd);
CodeQuery cq = new CodeQuery();
cq.setGroupIDs("FIM054");
List<DataObject> taskCodes = codeBean.getCodeList(cq);
for(DataObject taskCodeInfo : taskCodes) {
if(taskCodeInfo.string("CODE").equals(taskSeCd)) {
task.setTaskSeNm(taskCodeInfo.string("CODE_VAL"));
}
}
boolean result = taskBean.create(task);
if(!result) {
throw new RuntimeException("[F]업무 설정 추가 중 오류가 발생하였습니다.");
}
List<DataObject> vltnCdList = new ArrayList<>();
String vltnByTask = "";
switch(taskSeCd) {
case "PVS" -> { vltnByTask = "FIM004"; }
case "BPV" -> { vltnByTask = "FIM005"; }
case "DPV" -> { vltnByTask = "FIM006"; }
case "ECA" -> { vltnByTask = "FIM061"; }
case "TPV" -> { vltnByTask = "FIM064"; }
}
if(!vltnByTask.equals("")) {
cq = new CodeQuery();
cq.setGroupIDs(vltnByTask);
vltnCdList = codeBean.getCodeList(cq);
}
for(DataObject vltnCdInfo : vltnCdList) {
Vltn vltn = new Vltn();
vltn.setSggCd(sggCd);
vltn.setTaskSeCd(taskSeCd);
vltn.setVltnCd(vltnCdInfo.string("CODE"));
vltn.setVltnArtcl(vltnCdInfo.string("CODE_VAL"));
result = vltnBean.create(vltn);
if(!result) {
throw new RuntimeException("[F]위반 설정 추가 중 오류가 발생하였습니다.");
}
}
return result;
}
}

@ -15,10 +15,10 @@ import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.cmmn.CmmnQuery; import cokr.xit.fims.cmmn.CmmnQuery;
import cokr.xit.fims.mngt.Sgg; import cokr.xit.fims.mngt.Sgg;
import cokr.xit.fims.mngt.Task; import cokr.xit.fims.mngt.Task;
import cokr.xit.fims.mngt.Vltn;
import cokr.xit.fims.mngt.VltnQuery; import cokr.xit.fims.mngt.VltnQuery;
import cokr.xit.fims.mngt.dao.FactionMapper; import cokr.xit.fims.mngt.dao.FactionMapper;
import cokr.xit.fims.mngt.service.SggService; import cokr.xit.fims.mngt.service.SggService;
import cokr.xit.fims.mngt.service.TaskVltnService;
import cokr.xit.fims.mngt.service.bean.FactionBean; import cokr.xit.fims.mngt.service.bean.FactionBean;
import cokr.xit.fims.mngt.service.bean.TaskBean; import cokr.xit.fims.mngt.service.bean.TaskBean;
import cokr.xit.fims.mngt.service.bean.VltnBean; import cokr.xit.fims.mngt.service.bean.VltnBean;
@ -39,7 +39,9 @@ public class Mngt03Controller extends ApplicationController {
getSggInfo = "/010/getSggInfo.do", getSggInfo = "/010/getSggInfo.do",
getTasks = "/010/getTasks.do", getTasks = "/010/getTasks.do",
getVltns = "/010/getVltns.do", getVltns = "/010/getVltns.do",
updateSgg = "/010/updateSgg.do" updateSgg = "/010/updateSgg.do",
updateTaskStng = "/010/updateTaskStng.do",
createTaskStng = "/010/createTaskStng.do"
; ;
} }
@ -48,10 +50,14 @@ public class Mngt03Controller extends ApplicationController {
private SggService sggService; private SggService sggService;
/** 업무 정보 서비스 */ /** 업무 정보 서비스 */
@Resource(name = "taskVltnService")
private TaskVltnService taskVltnService;
/** 업무 정보 Bean */
@Resource(name = "taskBean") @Resource(name = "taskBean")
private TaskBean taskBean; private TaskBean taskBean;
/**위반 정보 서비스*/ /**위반 정보 Bean */
@Resource(name = "vltnBean") @Resource(name = "vltnBean")
private VltnBean vltnBean; private VltnBean vltnBean;
@ -185,4 +191,36 @@ public class Mngt03Controller extends ApplicationController {
return newFileInfoMap; return newFileInfoMap;
} }
/** , .
* @param sgg
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
public ModelAndView updateTaskStng(Task task) {
ModelAndView mav = new ModelAndView("jsonView");
boolean saved = taskVltnService.update(task, task.getVltnStngList());
mav.addObject("saved", saved);
return mav;
}
/** , .
* @param sggCd , taskSeCd
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
public ModelAndView createTaskStng(String sggCd, String taskSeCd) {
ModelAndView mav = new ModelAndView("jsonView");
boolean saved = taskVltnService.create(sggCd, taskSeCd);
mav.addObject("saved", saved);
return mav;
}
} }

@ -10,6 +10,7 @@ import org.springframework.web.servlet.ModelAndView;
import cokr.xit.fims.cmmn.CmmnQuery; import cokr.xit.fims.cmmn.CmmnQuery;
import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.mngt.Sgg; import cokr.xit.fims.mngt.Sgg;
import cokr.xit.fims.mngt.Task;
import cokr.xit.fims.mngt.VltnQuery; import cokr.xit.fims.mngt.VltnQuery;
import cokr.xit.fims.sprt.OtptForm; import cokr.xit.fims.sprt.OtptForm;
import cokr.xit.fims.sprt.OtptStngQuery; import cokr.xit.fims.sprt.OtptStngQuery;
@ -623,6 +624,19 @@ public class CmnController {
public ModelAndView updateSgg(Sgg sgg, MultipartFile symbol, MultipartFile logo, MultipartFile offcs) { public ModelAndView updateSgg(Sgg sgg, MultipartFile symbol, MultipartFile logo, MultipartFile offcs) {
return super.updateSgg(sgg, symbol, logo, offcs); return super.updateSgg(sgg, symbol, logo, offcs);
} }
@Override
@RequestMapping(name="업무 설정 정보 수정", value=METHOD_URL.updateTaskStng)
public ModelAndView updateTaskStng(Task task) {
return super.updateTaskStng(task);
}
@Override
@RequestMapping(name="시군구 과태료 업무 추가", value=METHOD_URL.createTaskStng)
public ModelAndView createTaskStng(String sggCd, String taskSeCd) {
return super.createTaskStng(sggCd,taskSeCd);
}
} }
@Controller @Controller

@ -122,7 +122,7 @@
, #{task.ffnlgInadtnRt} <!-- 과태료 중가산 율 --> , #{task.ffnlgInadtnRt} <!-- 과태료 중가산 율 -->
, #{task.ffnlgInadtnMxmmCnt} <!-- 과태료 중가산 최대 수 --> , #{task.ffnlgInadtnMxmmCnt} <!-- 과태료 중가산 최대 수 -->
, #{task.nxrpLinkSeCd} <!-- 세외수입 연계 구분 코드 --> , #{task.nxrpLinkSeCd} <!-- 세외수입 연계 구분 코드 -->
, #{task.nxrpLinkDtlSn} <!-- 세외수입 연계 구분 상세 순번 --> , #{task.nxrpLinkSeDtlSn} <!-- 세외수입 연계 구분 상세 순번 -->
, 'Y' <!-- 사용 여부 --> , 'Y' <!-- 사용 여부 -->
, <include refid="utility.now" /> <!-- 등록 일시 --> , <include refid="utility.now" /> <!-- 등록 일시 -->
, #{currentUser.id} <!-- 등록자 --> , #{currentUser.id} <!-- 등록자 -->

@ -99,7 +99,14 @@
<include refid="utility.orderBy" /> <include refid="utility.orderBy" />
</select> </select>
<insert id="insertVltn" parameterType="map">/* 위반 정보 등록(vltnMapper.insertVltn) */ <insert id="insertVltn" parameterType="map">
/* 위반 정보 등록(vltnMapper.insertVltn) */
<selectKey resultType="string" keyProperty="vltnId" keyColumn="NEW_ID" order="BEFORE">
SELECT
LPAD(CAST(IFNULL(MAX(VLTN_ID) + 1, 1) AS INT), 10, '0')
AS NEW_ID
FROM TB_VLTN
</selectKey>
INSERT INSERT
INTO TB_VLTN ( INTO TB_VLTN (
VLTN_ID <!-- 위반 ID --> VLTN_ID <!-- 위반 ID -->
@ -125,7 +132,7 @@
, MDFR <!-- 수정자 --> , MDFR <!-- 수정자 -->
) )
VALUES ( VALUES (
#{vltn.vltnId} <!-- 위반 ID --> #{vltnId} <!-- 위반 ID -->
, #{vltn.sggCd} <!-- 시군구 코드 --> , #{vltn.sggCd} <!-- 시군구 코드 -->
, #{vltn.taskSeCd} <!-- 업무 구분 코드 --> , #{vltn.taskSeCd} <!-- 업무 구분 코드 -->
, #{vltn.vltnCd} <!-- 위반 코드 --> , #{vltn.vltnCd} <!-- 위반 코드 -->
@ -151,8 +158,7 @@
<update id="updateVltn" parameterType="map">/* 위반 정보 수정(vltnMapper.updateVltn) */ <update id="updateVltn" parameterType="map">/* 위반 정보 수정(vltnMapper.updateVltn) */
UPDATE TB_VLTN UPDATE TB_VLTN
SET VLTN_CD = #{vltn.vltnCd} <!-- 위반 코드 --> SET VLTN_ARTCL = #{vltn.vltnArtcl} <!-- 위반 항목 -->
, VLTN_ARTCL = #{vltn.vltnArtcl} <!-- 위반 항목 -->
, VLTN_LAW_NM = #{vltn.vltnLawNm} <!-- 위반 법 명 --> , VLTN_LAW_NM = #{vltn.vltnLawNm} <!-- 위반 법 명 -->
, VLTN_LAW1 = #{vltn.vltnLaw1} <!-- 위반 법1 --> , VLTN_LAW1 = #{vltn.vltnLaw1} <!-- 위반 법1 -->
, VLTN_LAW2 = #{vltn.vltnLaw2} <!-- 위반 법2 --> , VLTN_LAW2 = #{vltn.vltnLaw2} <!-- 위반 법2 -->

@ -71,9 +71,11 @@
</span> </span>
</div> </div>
<div id="" class="nav-align-top my-2 mx-2" style="flex-direction: row;"> <div class="nav-align-top my-2 mx-2" style="flex-direction: row;">
<ul class="nav nav-tabs" role="tablist" id="tabButtonContainer--${pageName}"> <ul class="nav nav-tabs" role="tablist" id="tabButtonContainer--${pageName}">
</ul> </ul>
<button type="button" id="btnOpenSelectTaskDialog--${pageName}"
class="btn btn-darkgray ms-1 superadmin">+ 새 과태료업무 추가</button>
</div> </div>
<span class="tab-content" id="tabContentContainer--${pageName}"> <span class="tab-content" id="tabContentContainer--${pageName}">
@ -98,15 +100,21 @@
<template id="taskTabContentsTemplate--${pageName}"> <template id="taskTabContentsTemplate--${pageName}">
<span id="tab{task}--${pageName}" class="tab-pane {activeshow}" role="tabpanel"> <span id="tab{task}--${pageName}" class="tab-pane {activeshow}" role="tabpanel">
<div class="mx-3 my-2 d-block"> <div class="mx-3 my-2 d-flex" style="flex-direction:column">
<span> <div class="float-end">
<button type="button" onclick="" class="btn btn-primary w-px-100" style="float:right" <button type="button" data-task="{task}"
disabled>저장</button> onclick="pageObject['${pageName}'].fnSaveForTask(this);"
</span> class="btn btn-primary w-px-100" style="float:right"
>저장</button>
</div>
</div> </div>
<form id="{task}Form--${pageName}"> <form id="{task}Form--${pageName}">
<div class="row g-3 mt-1 mb-3"> <div class="row g-3 mt-1 mb-3">
<div class="col-md-3">
<label class="w-px-140 col-form-label text-sm-end" for="">업무명</label>
<input name="taskSeNm" type="text" class="form-control w-px-150" />
</div>
<div class="col-md-3"> <div class="col-md-3">
<label class="w-px-140 col-form-label text-sm-end" for="">사전통지일수</label> <label class="w-px-140 col-form-label text-sm-end" for="">사전통지일수</label>
<input name="advntceDayCnt" type="text" class="form-control w-px-50" /> <input name="advntceDayCnt" type="text" class="form-control w-px-50" />
@ -119,8 +127,6 @@
<label class="w-px-140 col-form-label text-sm-end" for="">사회적약자감경율</label> <label class="w-px-140 col-form-label text-sm-end" for="">사회적약자감경율</label>
<input name="wksnRductRt" type="text" class="form-control w-px-50" /> <input name="wksnRductRt" type="text" class="form-control w-px-50" />
</div> </div>
<div class="col-md-3">
</div>
<div class="col-md-3"> <div class="col-md-3">
<label class="w-px-140 col-form-label text-sm-end" for="">과태료가산일자</label> <label class="w-px-140 col-form-label text-sm-end" for="">과태료가산일자</label>
<input name="ffnlgAdtnYmd" type="text" class="form-control w-px-100" /> <input name="ffnlgAdtnYmd" type="text" class="form-control w-px-100" />
@ -138,57 +144,95 @@
<input name="ffnlgInadtnMxmmCnt" type="text" class="form-control w-px-50" /> <input name="ffnlgInadtnMxmmCnt" type="text" class="form-control w-px-50" />
</div> </div>
</div> </div>
<div class="row g-3 mt-1 mb-3 superadmin">
<div class="card-datatable text-nowrap area-photoinspection mx-2 mt-2 mb-3"> <div class="col-md-3">
<div id="{task}Table_0_wrapper--${pageName}" class="dataTables_wrapper dt-bootstrap5 no-footer"> <label class="w-px-140 col-form-label text-sm-end" for="">세외수입연계<br/>구분코드</label>
<div id="{task}table-responsive--${pageName}" class="table-responsive" <input name="nxrpLinkSeCd" type="text" class="form-control w-px-50" />
style="overflow-x: scroll;height:300px;overflow-y: scroll;"> </div>
<table id="{task}Table_0--${pageName}" <div class="col-md-3">
class="table-layout-fixed datatables-ajax table table-bordered dataTable no-footer"> <label class="w-px-140 col-form-label text-sm-end" for="">세외수입연계<br/>구분상세순번</label>
<thead class="sticky-thead"> <input name="nxrpLinkSeDtlSn" type="text" class="form-control w-px-50" />
<tr>
<th style="width: 90px;">위반코드</th>
<th style="width: 160px;">위반항목</th>
<th style="width: 360px;">위반법명</th>
<th style="width: 160px;">위반법1</th>
<th style="width: 160px;">위반법2</th>
<th style="width: 160px;">위반법기타</th>
<th style="width: 120px;">회계구분코드</th>
<th style="width: 120px;">회계구분명</th>
<th style="width: 120px;">세목코드</th>
<th style="width: 300px;">세목명</th>
<th style="width: 120px;">운영항목코드</th>
<th style="width: 300px;">운영항목명</th>
<th style="width: 160px;">특별회계사업코드</th>
<th style="width: 300px;">특별회계사업명</th>
<th class="dummy-th"></th>
</tr>
</thead>
<tbody id="{task}tbody--${pageName}"></tbody>
</table>
</div>
</div> </div>
<div class="col-md-6"></div>
</div> </div>
</form> </form>
<div class="card-datatable text-nowrap area-photoinspection mx-2 mt-2 mb-3">
<div id="{task}Table_0_wrapper--${pageName}" class="dataTables_wrapper dt-bootstrap5 no-footer">
<div id="{task}table-responsive--${pageName}" class="table-responsive"
style="overflow-x: scroll;height:300px;overflow-y: scroll;">
<table id="{task}Table_0--${pageName}"
class="table-layout-fixed datatables-ajax table table-bordered dataTable no-footer">
<thead class="sticky-thead">
<tr>
<th style="width: 90px;">위반코드</th>
<th style="width: 160px;">위반항목</th>
<th style="width: 360px;">위반법명</th>
<th style="width: 160px;">위반법1</th>
<th style="width: 160px;">위반법2</th>
<th style="width: 160px;">위반법기타</th>
<th style="width: 120px;">회계구분코드</th>
<th style="width: 120px;">회계구분명</th>
<th style="width: 120px;">세목코드</th>
<th style="width: 300px;">세목명</th>
<th style="width: 120px;">운영항목코드</th>
<th style="width: 300px;">운영항목명</th>
<th style="width: 160px;">특별회계사업코드</th>
<th style="width: 300px;">특별회계사업명</th>
<th class="dummy-th"></th>
</tr>
</thead>
<tbody id="{task}tbody--${pageName}"></tbody>
</table>
</div>
</div>
</div>
</span> </span>
</template> </template>
<template id="taskTbodyTemplate--${pageName}"> <template id="taskTbodyTemplate--${pageName}">
<tr data-key="{VLTN_ID}"> <tr data-key="{VLTN_ID}">
<td>{VLTN_CD}</td> <td>{VLTN_CD}</td>
<td><input type="text" class="form-control w-100" value="{VLTN_ARTCL}" /></td> <td data-col="vltnArtcl">
<td><input type="text" class="form-control w-100" value="{VLTN_LAW_NM}" /></td> <input type="text" class="form-control w-100" value="{VLTN_ARTCL}" />
<td><input type="text" class="form-control w-100" value="{VLTN_LAW1}" /></td> </td>
<td><input type="text" class="form-control w-100" value="{VLTN_LAW2}" /></td> <td data-col="vltnLawNm">
<td><input type="text" class="form-control w-100" value="{VLTN_LAW_ETC}" /></td> <input type="text" class="form-control w-100" value="{VLTN_LAW_NM}" />
<td><input type="text" class="form-control w-100" value="{ACNTG_SE_CD}" /></td> </td>
<td><input type="text" class="form-control w-100" value="{ACNTG_SE_NM}" /></td> <td data-col="vltnLaw1">
<td><input type="text" class="form-control w-100" value="{TXITM_CD}" /></td> <input type="text" class="form-control w-100" value="{VLTN_LAW1}" />
<td><input type="text" class="form-control w-100" value="{TXITM_NM}" /></td> </td>
<td><input type="text" class="form-control w-100" value="{OPER_ITEM_CD}" /></td> <td data-col="vltnLaw2">
<td><input type="text" class="form-control w-100" value="{OPER_ITEM_NM}" /></td> <input type="text" class="form-control w-100" value="{VLTN_LAW2}" />
<td><input type="text" class="form-control w-100" value="{SPCL_BIZ_CD}" /></td> </td>
<td><input type="text" class="form-control w-100" value="{SPCL_BIZ_NM}" /></td> <td data-col="vltnLawEtc">
<input type="text" class="form-control w-100" value="{VLTN_LAW_ETC}" />
</td>
<td data-col="acntgSeCd">
<input type="text" class="form-control w-100" value="{ACNTG_SE_CD}" />
</td>
<td data-col="acntgSeNm">
<input type="text" class="form-control w-100" value="{ACNTG_SE_NM}" />
</td>
<td data-col="txitmCd">
<input type="text" class="form-control w-100" value="{TXITM_CD}" />
</td>
<td data-col="txitmNm">
<input type="text" class="form-control w-100" value="{TXITM_NM}" />
</td>
<td data-col="operItemCd">
<input type="text" class="form-control w-100" value="{OPER_ITEM_CD}" />
</td>
<td data-col="operItemNm">
<input type="text" class="form-control w-100" value="{OPER_ITEM_NM}" />
</td>
<td data-col="spclBizCd">
<input type="text" class="form-control w-100" value="{SPCL_BIZ_CD}" />
</td>
<td data-col="spclBizNm">
<input type="text" class="form-control w-100" value="{SPCL_BIZ_NM}" />
</td>
</tr> </tr>
</template> </template>
@ -198,6 +242,10 @@ pageObject["${pageName}"] = {};
$(document).ready(function(){ $(document).ready(function(){
if(MY_INFO.institute != "default"){
$(".superadmin").attr("hidden","hidden");
}
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
$P.sggInfo = {}; $P.sggInfo = {};
$P.taskList = []; $P.taskList = [];
@ -306,11 +354,15 @@ $(document).ready(function(){
$("#tabButtonContainer--${pageName}").html(tabs.join("")); $("#tabButtonContainer--${pageName}").html(tabs.join(""));
$("#tabContentContainer--${pageName}").html(contents.join("")); $("#tabContentContainer--${pageName}").html(contents.join(""));
if(MY_INFO.institute != "default"){
$(".superadmin").attr("hidden","hidden");
}
for(var i=0; i < $P.taskList.length; i++){ for(var i=0; i < $P.taskList.length; i++){
var task = $P.taskList[i]; var task = $P.taskList[i];
var taskSeCd = task.TASK_SE_CD; var taskSeCd = task.TASK_SE_CD;
var taskSeNm = task.TASK_SE_NM; var taskSeNm = task.TASK_SE_NM;
$("#"+taskSeCd+"Form--${pageName}").find("[name='taskSeNm']").val(taskSeNm);
$("#"+taskSeCd+"Form--${pageName}").find("[name='advntceDayCnt']").val(task.ADVNTCE_DAY_CNT); $("#"+taskSeCd+"Form--${pageName}").find("[name='advntceDayCnt']").val(task.ADVNTCE_DAY_CNT);
$("#"+taskSeCd+"Form--${pageName}").find("[name='advntceRductRt']").val(task.ADVNTCE_RDUCT_RT); $("#"+taskSeCd+"Form--${pageName}").find("[name='advntceRductRt']").val(task.ADVNTCE_RDUCT_RT);
$("#"+taskSeCd+"Form--${pageName}").find("[name='wksnRductRt']").val(task.WKSN_RDUCT_RT); $("#"+taskSeCd+"Form--${pageName}").find("[name='wksnRductRt']").val(task.WKSN_RDUCT_RT);
@ -319,8 +371,10 @@ $(document).ready(function(){
$("#"+taskSeCd+"Form--${pageName}").find("[name='ffnlgInadtnRt']").val(task.FFNLG_INADTN_RT); $("#"+taskSeCd+"Form--${pageName}").find("[name='ffnlgInadtnRt']").val(task.FFNLG_INADTN_RT);
$("#"+taskSeCd+"Form--${pageName}").find("[name='ffnlgInadtnMxmmCnt']").val(task.FFNLG_INADTN_MXMM_CNT); $("#"+taskSeCd+"Form--${pageName}").find("[name='ffnlgInadtnMxmmCnt']").val(task.FFNLG_INADTN_MXMM_CNT);
$("#"+taskSeCd+"Form--${pageName}").find("[name='nxrpLinkSeCd']").val(task.NXRP_LINK_SE_CD);
$("#"+taskSeCd+"Form--${pageName}").find("[name='nxrpLinkSeDtlSn']").val(task.NXRP_LINK_SE_DTL_SN);
} }
resolve({resp, textStatus, jqXHR}); resolve({resp, textStatus, jqXHR});
}, },
error: function(jqXHR, textStatus, error) { error: function(jqXHR, textStatus, error) {
@ -361,10 +415,12 @@ $(document).ready(function(){
}); });
}; };
//이미지 뷰어
fnMakeSingleImageViewer($("#offcsImage--${pageName}")[0] , $("#offcs--${pageName}")[0], "orgn-path", "orgn-name"); fnMakeSingleImageViewer($("#offcsImage--${pageName}")[0] , $("#offcs--${pageName}")[0], "orgn-path", "orgn-name");
fnMakeSingleImageViewer($("#symbolImage--${pageName}")[0] , $("#symbol--${pageName}")[0], "orgn-path", "orgn-name"); fnMakeSingleImageViewer($("#symbolImage--${pageName}")[0] , $("#symbol--${pageName}")[0], "orgn-path", "orgn-name");
fnMakeSingleImageViewer($("#logoImage--${pageName}")[0] , $("#logo--${pageName}")[0], "orgn-path", "orgn-name"); fnMakeSingleImageViewer($("#logoImage--${pageName}")[0] , $("#logo--${pageName}")[0], "orgn-path", "orgn-name");
//시군구 기본 설정 저장 버튼
$("#btnSaveSgg--${pageName}").on("click", function(){ $("#btnSaveSgg--${pageName}").on("click", function(){
var formData = new FormData($("#mainForm--${pageName}")[0]); var formData = new FormData($("#mainForm--${pageName}")[0]);
@ -388,7 +444,138 @@ $(document).ready(function(){
}); });
}); });
//업무 추가 버튼
$("#btnOpenSelectTaskDialog--${pageName}").on("click", function(){
$("#selectTaskButtons").html("");
var keys = Object.keys(ALL_TASK);
var ableKeys = [];
for(var i=0; i < keys.length; i++){
if($("#tabContentContainer--${pageName}").find("#tab"+keys[i]+"--${pageName}").length < 1){
ableKeys.push(keys[i]);
}
}
if(ableKeys.length < 1){
alert("추가 가능한 과태료 업무가 없습니다.");
return;
}
var pn = "${pageName}";
for(var i=0; i < ableKeys.length; i++){
var button = `<button type="button" class="btn btn-xl btn-primary" onclick="pageObject['`
+pn
+`'].fnCreateTaskStng('`
+ableKeys[i]
+`');">`
+ALL_TASK[ableKeys[i]]
+`</button>`;
$("#selectTaskButtons").append(button);
}
$("#selectTaskModal").modal("show");
});
$P.fnCreateTaskStng = (taskSeCd) => {
$("#selectTaskModal").modal("hide");
ajax.post({
url: wctx.url("mngt/mngt03/010/createTaskStng.do"),
data: {
sggCd : $("#mainForm--${pageName}").find("[name='sggCd']").val(),
taskSeCd : taskSeCd
},
success: (resp) => {
dialog.alert({
content : "저장됐습니다.",
init : function(){
setDialogZindex();
focusClose();
},
onClose : () => {
$P.getSggTaskInfo().then(()=>{ $P.getVltnInfo(); });
}
});
}
});
};
$P.fnSaveForTask = (el) => {
var taskSeCd = el.dataset.task;
var sggCd = $("#mainForm--${pageName}").find("[name='sggCd']").val();
var formData = new FormData($("#"+taskSeCd+"Form--${pageName}")[0]);
formData.append("taskSeCd",taskSeCd);
formData.append("sggCd", sggCd);
var rowArr = $P.getRowData(taskSeCd+"tbody--${pageName}", formData);
var vltnStngList = fnJsonArrayToFormData(rowArr,"vltnStngList");
var keys = Object.keys(vltnStngList);
for(var i=0; i < keys.length; i++){
formData.append(keys[i], vltnStngList[keys[i]]);
}
ajax.post({
url: wctx.url("mngt/mngt03/010/updateTaskStng.do"),
data: formData,
contentType : false, processData : false,
success: (resp) => {
dialog.alert({
content : "저장됐습니다.",
init : function(){
setDialogZindex();
focusClose();
},
onClose : () => {
$P.getSggTaskInfo().then(()=>{ $P.getVltnInfo(); });
}
});
}
});
};
$P.getRowData = (tbodyId, formData) => {
var rowArr = [];
$("#"+tbodyId+" tr").each(function(){
var row = {};
row.vltnId = this.dataset.key;
row.vltnArtcl = $($P.fnGetElement(this,"vltnArtcl")).val();
row.vltnLawNm = $($P.fnGetElement(this,"vltnLawNm")).val();
row.vltnLaw1 = $($P.fnGetElement(this,"vltnLaw1")).val();
row.vltnLaw2 = $($P.fnGetElement(this,"vltnLaw2")).val();
row.vltnLawEtc = $($P.fnGetElement(this,"vltnLawEtc")).val();
row.acntgSeCd = $($P.fnGetElement(this,"acntgSeCd")).val();
row.acntgSeNm = $($P.fnGetElement(this,"acntgSeNm")).val();
row.txitmCd = $($P.fnGetElement(this,"txitmCd")).val();
row.txitmNm = $($P.fnGetElement(this,"txitmNm")).val();
row.operItemCd = $($P.fnGetElement(this,"operItemCd")).val();
row.operItemNm = $($P.fnGetElement(this,"operItemNm")).val();
row.spclBizCd = $($P.fnGetElement(this,"spclBizCd")).val();
row.spclBizNm = $($P.fnGetElement(this,"spclBizNm")).val();
row.sggCd = formData.get("sggCd");
row.taskSeCd = formData.get("taskSeCd");
rowArr.push(row);
});
return rowArr;
};
$P.fnGetElement = (tableRow, colName) => {
return $(tableRow).find("td[data-col='"+colName+"']").children("input, select").first()[0];
}
/**************************************************************************
* 초기화
**************************************************************************/
$P.getSggInfo() $P.getSggInfo()
.then(() => { .then(() => {
return $P.getSggTaskInfo(); return $P.getSggTaskInfo();

@ -41,8 +41,9 @@
<div class="modal-dialog modal-sm" role="document"> <div class="modal-dialog modal-sm" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-body" style="min-height:10em; min-width:30%;"> <div class="modal-body" style="min-height:10em; min-width:30%;">
<div style="text-align:center" class="h3 fw-bold">업무를 선택하세요.</div>
<span id="selectTaskButtons" class="row g-3" style="display: flex;flex-direction:column"> <span id="selectTaskButtons" class="row g-3" style="display: flex;flex-direction:column">
<div style="text-align:center" class="h3 fw-bold">업무를 선택하세요.</div>
</span> </span>
</div> </div>
</div> </div>
@ -261,6 +262,7 @@
} }
//사용자별 선택가능한 업무 렌더링 //사용자별 선택가능한 업무 렌더링
$("#selectTaskButtons").html("");
for(var i=0; i < MY_INFO.info.taskForUser.length; i++){ for(var i=0; i < MY_INFO.info.taskForUser.length; i++){
var taskCd = MY_INFO.info.taskForUser[i]; var taskCd = MY_INFO.info.taskForUser[i];
var taskNm = ALL_TASK[taskCd]; var taskNm = ALL_TASK[taskCd];

Loading…
Cancel
Save