특기사항 일괄 등록 기능 추가

main
이범준 1 year ago
parent 1875c1048d
commit 7660a9d625

@ -36,6 +36,12 @@ public interface CrdnUpdtMapper extends AbstractMapper {
*/
int updateCrdnAmt(Crdn crdn);
/** .
* @param crdn
* @return
*/
int updateEtcCn(Crdn crdn);
/** .<br />
* {@link cokr.xit.fims.crdn.service.bean.CrdnBean#update(Crdn)}
* @param crdn

@ -23,4 +23,10 @@ public interface Sprt01Service {
*/
List<DataObject> getIntegrationDataList(SprtQuery query);
/** .
* @param etcCn , crdnIds ID
* @return
*/
boolean updateEtcCn(String etcCn, String... crdnIds);
}

@ -6,6 +6,8 @@ import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.dao.CrdnUpdtMapper;
import cokr.xit.fims.sprt.SprtQuery;
import cokr.xit.fims.sprt.dao.IntegrationSearchMapper;
import cokr.xit.foundation.AbstractComponent;
@ -28,6 +30,9 @@ public class Sprt01Bean extends AbstractComponent {
@Resource(name = "integrationSearchMapper")
private IntegrationSearchMapper integrationSearchMapper;
@Resource(name = "crdnUpdtMapper")
private CrdnUpdtMapper crdnUpdtMapper;
/** .
* @param query
* @return
@ -37,4 +42,26 @@ public class Sprt01Bean extends AbstractComponent {
return integrationSearchMapper.selectIntegrationDataList(query);
}
/** .
* @param etcCn , crdnIds ID
* @return
*/
public boolean updateEtcCn(String etcCn, String[] crdnIds) {
Crdn crdn = new Crdn();
crdn.setEtcCn(etcCn);
int effected = 0;
for(String crdnId : crdnIds) {
crdn.setCrdnId(crdnId);
int result = crdnUpdtMapper.updateEtcCn(crdn);
effected += result;
}
if(effected != crdnIds.length) {
throw new RuntimeException("특기사항 저장 중 오류가 발생하였습니다.");
}
return true;
}
}

@ -33,4 +33,11 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv
return sprt01Bean.getIntegrationDataList(query);
}
@Override
public boolean updateEtcCn(String etcCn, String... crdnIds) {
return sprt01Bean.updateEtcCn(etcCn, crdnIds);
}
}

@ -32,6 +32,18 @@ import cokr.xit.foundation.data.DataObject;
*/
public class Sprt01Controller extends ApplicationController {
public static final String CLASS_URL = "/sprt/sprt01";
public class METHOD_URL {
public static final String
integrationSearchMain = "/010/main.do",
getIntegrationDataList = "/010/list.do",
manageEtcCnMain = "/020/info.do",
inputEtcCnMain = "/030/info.do",
inputEtcCn = "/030/update.do"
;
}
/**통합 조회 서비스*/
@Resource(name="sprt01Service")
private Sprt01Service sprt01Service;
@ -69,7 +81,7 @@ public class Sprt01Controller extends ApplicationController {
addCodes(commonCodes, mav, "FIM003", "FIM010", "FIM026", "FIM054"
,"FIM004","FIM005","FIM006","FIM061","FIM064");
mav.addObject("pageName", "sprt01010");// View(jsp)에서 사용할 id 뒤에 붙일 suffix
mav.addObject("pageName", "sprt01010-main");// View(jsp)에서 사용할 id 뒤에 붙일 suffix
String fastBy = req.getParameter("fastBy");
String fastTerm = req.getParameter("fastTerm");
@ -224,4 +236,36 @@ public class Sprt01Controller extends ApplicationController {
return temp1 + temp2;
}
/** .
*
* @return /fims/sprt/sprt01030
*/
public ModelAndView inputEtcCnMain(String... crdnIds) {
ModelAndView mav = new ModelAndView("fims/sprt/sprt01030-info");
mav.addObject("crdnIds", toJson(crdnIds));
return mav;
}
/** .
* @param etcCn , crdnIds ID
* @return jsonView
* <pre><code> {
* "affected":
* "saved": true, false
* }</code></pre>
*/
public ModelAndView inputEtcCn(String etcCn, String... crdnIds) {
ModelAndView mav = new ModelAndView("jsonView");
boolean saved = false;
saved = sprt01Service.updateEtcCn(etcCn, crdnIds);
mav.addObject("saved", saved);
return mav;
}
}

@ -330,23 +330,36 @@ public class CmnController {
}
@Controller
@RequestMapping(name = "통합 조회", value = "/sprt/sprt01")
@RequestMapping(name = "통합 조회", value = Sprt01Controller.CLASS_URL)
class Sprt01Controller extends cokr.xit.fims.sprt.web.Sprt01Controller {
/** .
* @return fims/sprt/sprt01010-main
*/
@Override
@RequestMapping(name="통합조회 메인", value="/010/main.do")
@RequestMapping(name="통합조회 메인", value=METHOD_URL.integrationSearchMain)
public ModelAndView integrationSearchMain(HttpServletRequest req) {
return super.integrationSearchMain(req);
}
@Override
@RequestMapping(name="통합조회 자료 목록", value="/010/list.do")
@RequestMapping(name="통합조회 자료 목록", value=METHOD_URL.getIntegrationDataList)
public ModelAndView getIntegrationDataList(SprtQuery query, HttpServletRequest req) {
return super.getIntegrationDataList(query, req);
}
@Override
@RequestMapping(name="특기사항 일괄 입력 화면", value=METHOD_URL.inputEtcCnMain)
public ModelAndView inputEtcCnMain(String... crdnIds) {
return super.inputEtcCnMain(crdnIds);
}
@Override
@RequestMapping(name="특기사항 일괄 입력", value=METHOD_URL.inputEtcCn)
public ModelAndView inputEtcCn(String etcCn, String... crdnIds) {
return super.inputEtcCn(etcCn, crdnIds);
}
}
@Controller

@ -112,6 +112,14 @@
WHERE CRDN_ID = #{crdnId} /* 단속 ID */
</update>
<update id="updateEtcCn" parameterType="cokr.xit.fims.crdn.Crdn">
/* 단속 기타사항 수정(crdnUpdtMapper.updateEtcCn) */
UPDATE TB_CRDN
SET MDFCN_DT = <include refid="utility.now" /> /* 수정일시 */
, MDFR = #{modifiedBy} /* 수정자 */
, ETC_CN = #{etcCn}
WHERE CRDN_ID = #{crdnId} /* 단속 ID */
</update>
<update id="updateEditCrdn" parameterType="map">/* 단속 정보 수정(crdnUpdtMapper.updateEditCrdn) */
UPDATE TB_CRDN

@ -314,6 +314,65 @@ integrationSearch.fnCopyPyrNo = (updown) => {
}
}
//특기사항관리
integrationSearch.fnManageEtcCn = (updown) => {
var cur;
if(updown == "up"){
cur = integrationSearchControl.updataset.getCurrent();
} else {
cur = integrationSearchControl.downdataset.getCurrent();
}
if(cur != null){
}
}
//특기사항일괄입력
integrationSearch.fnInputEtcCn = (updown) => {
var cur;
if(updown == "up"){
cur = integrationSearchControl.updataset;
} else {
cur = integrationSearchControl.downdataset;
}
if(cur == null && cur.length <= 0){
return;
}
var list = cur.getDataset();
var grouped = Object.groupBy(list, ({ CRDN_ID }) => CRDN_ID);
var crdnIds = Object.keys(grouped);
var url = wctx.url("/sprt/sprt01/030/info.do");
var dialogId = "inputEtcCnDialog";
ajax.get({
url : url
, data : { crdnIds : crdnIds.join(",") }
, success : resp => {
dialog.open({
id : dialogId
, title : "특기사항입력-일괄"
, size : "xl"
, content : resp
, init : () => {
$("#"+dialogId).find("input[name='dialogId']").val(dialogId);
var found = $("#"+dialogId).find("template")[0].innerHTML;
var trs = cur.inStrings(found, null);
$("#"+dialogId).find("tbody").html(trs.join());
}
, onClose : () => { }
});
}
});
}
//개별총정보 dialog
integrationSearch.getInfo = (taskSeCd, crdnId) => {
if (crdnId == undefined || crdnId == null || crdnId == "") {
@ -357,6 +416,13 @@ integrationSearch.setEvent = () => {
$("#btnUpCopyPyrNo--${pageName}").on("click", function(){ integrationSearch.fnCopyPyrNo("up"); });
$("#btnDownCopyPyrNo--${pageName}").on("click", function(){ integrationSearch.fnCopyPyrNo("down"); });
$("#btnUpManageEtcCn--${pageName}").on("click", function(){ integrationSearch.fnManageEtcCn("up"); });
$("#btnDownManageEtcCn--${pageName}").on("click", function(){ integrationSearch.fnManageEtcCn("down"); });
$("#btnUpInputEtcCn--${pageName}").on("click", function(){ integrationSearch.fnInputEtcCn("up"); });
$("#btnDownInputEtcCn--${pageName}").on("click", function(){ integrationSearch.fnInputEtcCn("down"); });
//$("#btn").on("click", function(){ });

@ -33,11 +33,11 @@
title="납부자번호복사">
납부자번호복사
</button>
<button type="button" id="" class="btn btn-primary"
<button type="button" id="btnUpManageEtcCn--${pageName}" class="btn btn-primary"
title="특기사항관리">
특기사항관리
</button>
<button type="button" id="" class="btn btn-primary"
<button type="button" id="btnUpInputEtcCn--${pageName}" class="btn btn-primary"
title="특기사항입력-일괄">
특기사항입력-일괄
</button>

@ -41,11 +41,11 @@
title="납부자번호복사">
납부자번호복사
</button>
<button type="button" id="" class="btn btn-primary"
<button type="button" id="btnDownManageEtcCn--${pageName}" class="btn btn-primary"
title="특기사항관리">
특기사항관리
</button>
<button type="button" id="" class="btn btn-primary"
<button type="button" id="btnDownInputEtcCn--${pageName}" class="btn btn-primary"
title="특기사항입력-일괄">
특기사항입력-일괄
</button>

@ -0,0 +1,5 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<c:set var="prefixName" scope="request">특기사항관리</c:set>

@ -0,0 +1,102 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<c:set var="prefixName" scope="request">특기사항입력-일괄</c:set>
<div class="d-flex flex-row justify-content-evenly">
<div class="card">
<div class="card-datatable text-nowrap">
<div class="dataTables_wrapper dt-bootstrap5 no-footer">
<div class="table-responsive"
style="overflow-x:scroll; height:300px; overflow-y:scroll;" >
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer"
id="table--${pageName}" aria-describedby="DataTables_Table_0_info">
<thead class="sticky-thead" >
<tr id="theadTr--${pageName}">
<th>시군구명</th>
<th style="width:180px">과태료명</th>
<th style="width:200px">단속일시</th>
<th>차량번호</th>
<th>대체차량번호</th>
<th>성명</th>
<th>처리상태</th>
</tr>
</thead>
<tbody id="tbody--${pageName}">
</tbody>
<template id="found--${pageName}">
<tr>
<td>{SGG_NM}</td>
<td>{TASK_SE_NM}</td>
<td>{CRDN_YMD_TM}</td>
<td>{VHRNO}</td>
<td>{RPM_SZR_VHRNO}</td>
<td>{RTPYR_NM}</td>
<td>{CRDN_STTS_NM}</td>
</tr>
</template>
</table>
</div>
</div>
</div>
<form id="frmEdit--${pageName}">
<input type="text" name="dialogId" hidden />
<div class="row g-1 mt-2">
<div class="col-md-12">
<label class="bg-lighter px-2 col-form-label">특기사항</label>
<input type="text" id="etcCn--${pageName}" name="etcCn" class="form-control w-px-700" required />
</div>
</div>
<div class="row mt-4 justify-content-end mb-3">
<div class="col-md-12">
<div class="float-end pe-4">
<button type="button" id="btnInputEtcCn--${pageName}" class="btn btn-primary">특기사항등록(일괄)</button>
</div>
</div>
</div>
</form>
</div>
</div>
<script>
pageObject["${pageName}"] = {};
$(document).ready(function(){
var $P = pageObject["${pageName}"];
$P.crdnIds = ${crdnIds};
$P.fnInputEtcCn = () => {
var etcCn = $("#etcCn--${pageName}").val();
if(etcCn == ""){
alert("특기사항을 입력하세요.");
return;
}
ajax.get({
url : wctx.url("/sprt/sprt01/030/update.do"),
data : {
crdnIds : $P.crdnIds.join(","),
etcCn : etcCn
},
success : resp => {
if(resp.saved){
alert("저장되었습니다.");
var dialogId = $("#frmEdit--${pageName}").find("input[name='dialogId']").val();
dialog.close(dialogId);
}
}
});
}
$("#btnInputEtcCn--${pageName}").on("click", () => $P.fnInputEtcCn() );
});
</script>
Loading…
Cancel
Save