답변내용 미리보기 팝업 추가

main
이범준 1 year ago
parent 8858cf80a2
commit 9dd90bfc94

@ -22,6 +22,7 @@ public class CrdnQuery extends QueryRequest {
private String grid;
private String thisDay;
private String currentUserId;
private String currentInstitute;
private String inspectionDataType;
private String crdnId;
private String[] crdnIDs;
@ -30,6 +31,7 @@ public class CrdnQuery extends QueryRequest {
private String schDateFrom;
private String schDateTo;
private String vhrno;
private String cvlcptPrcsPicNm;
private String schCvlcptRcptYmdFrom;
private String schCvlcptRcptYmdTo;
@ -106,6 +108,15 @@ public class CrdnQuery extends QueryRequest {
return self();
}
public String getCurrentInstitute() {
return ifEmpty(currentInstitute, () -> null);
}
public <T extends CrdnQuery> T setCurrentInstitute(String currentInstitute) {
this.currentInstitute = currentInstitute;
return self();
}
public String getInspectionDataType() {
return ifEmpty(inspectionDataType, () -> null);
}

@ -17,24 +17,24 @@ public interface Crdn01Mapper extends AbstractMapper {
/** .<br />
* {@link cokr.xit.fims.crdn.service.bean.Crdn01ServiceBean#getCrackdownList(CrdnQuery)}
* @param req
* @param query
* @return
*/
List<DataObject> selectCivilComplaintList(CrdnQuery req);
List<DataObject> selectCivilComplaintList(CrdnQuery query);
/** .<br />
* {@link cokr.xit.fims.crdn.service.bean.Crdn01ServiceBean#getCrackdownList(CrdnQuery)}
* @param req
* @param query
* @return
*/
List<DataObject> selectCivilComplaintReceiptDataList(CrdnQuery req);
List<DataObject> selectCivilComplaintReceiptDataList(CrdnQuery query);
/** .<br />
* {@link cokr.xit.fims.crdn.service.bean.Crdn01ServiceBean#getCrackdownList(CrdnQuery)}
* @param req
* @param query
* @return
*/
List<DataObject> selectCivilComplaintAnswerTargetDataList(CrdnQuery req);
List<DataObject> selectCivilComplaintAnswerTargetDataList(CrdnQuery query);
/** .
* @param params
@ -46,15 +46,21 @@ public interface Crdn01Mapper extends AbstractMapper {
int removeCivilComplaint(Crdn crdn);
/** .
* @param req
* @param query
* @return
*/
DataObject selectCivilComplaintOriginalInfo(CrdnQuery req);
DataObject selectCivilComplaintOriginalInfo(CrdnQuery query);
/** .
* @param req
* @param query
* @return
*/
DataObject selectCivilComplaintOriginalInfoHwp(CrdnQuery req);
DataObject selectCivilComplaintOriginalInfoHwp(CrdnQuery query);
/** .
* @param query
* @return
*/
DataObject selectAnswerPreview(CrdnQuery query);
}

@ -28,11 +28,13 @@ public class Crdn01Bean extends AbstractComponent {
return crdn01Mapper.removeCivilComplaint(crdn) == 1 ? true : false;
}
public DataObject getCivilComplaintOriginalInfo(CrdnQuery req) {
if(ifEmpty(req.getView(), () -> "").equals("hwp")) {
return crdn01Mapper.selectCivilComplaintOriginalInfoHwp(req);
public DataObject getCivilComplaintOriginalInfo(CrdnQuery crdnQuery) {
if(ifEmpty(crdnQuery.getView(), () -> "").equals("hwp")) {
return crdn01Mapper.selectCivilComplaintOriginalInfoHwp(crdnQuery);
}
return crdn01Mapper.selectCivilComplaintOriginalInfo(req);
return crdn01Mapper.selectCivilComplaintOriginalInfo(crdnQuery);
}
}

@ -145,6 +145,10 @@ public class Crdn01ServiceBean extends AbstractServiceBean implements CrdnServic
}
}
public DataObject getAnswerPreview(CrdnQuery req) {
return crdn01Mapper.selectAnswerPreview(req);
}
}

@ -186,4 +186,24 @@ public class Crdn01Controller extends ApplicationController {
return crdn01Service.makeFileFromHwpFormat(crdnQuery, baseFormatFilePath, attachFormatFilePath);
}
/** .
* @return
*/
@RequestMapping(name="민원답변내용 미리보기", value="/060/info.do")
public ModelAndView answerPreviewInfo(CrdnQuery req, HttpServletRequest request) {
boolean json = jsonResponse();
ModelAndView mav = new ModelAndView(json ? "jsonView" : "fims/crdn/crdn01060-info");
mav.addObject("pageName", "crdn01060-info");
String urlTaskSeCd = request.getServletPath().split("/")[1];
mav.addObject("taskSeCd", urlTaskSeCd);
req.setTaskSeCd(urlTaskSeCd);
DataObject cvlcptInfo = crdn01Service.getAnswerPreview(req);
mav.addObject("cvlcptInfo", json ? cvlcptInfo : toJson(cvlcptInfo));
return mav;
}
}

@ -277,7 +277,7 @@ AND (SELECT VLTN_ARTCL FROM TB_VLTN_INFO WHERE VLTN_ID = C.VLTN_ID) LIKE CONCAT(
)
</update>
<select id="selectCivilComplaintOriginalInfo" parameterType="cokr.xit.fims.crdn.Crdn" resultType="dataobject">
<select id="selectCivilComplaintOriginalInfo" parameterType="map" resultType="dataobject">
/* 민원내역 원본 보기(crdn01Mapper.selectCivilComplaintOriginalInfo) */
SELECT C.CRDN_ID <!-- 단속 ID -->
, CC.CVLCPT_RCPT_NO <!-- 민원 접수 번호 -->
@ -292,7 +292,7 @@ SELECT C.CRDN_ID <!-- 단속 ID -->
AND C.CRDN_ID = #{crdnId}
</select>
<select id="selectCivilComplaintOriginalInfoHwp" parameterType="cokr.xit.fims.crdn.Crdn" resultType="dataobject">
<select id="selectCivilComplaintOriginalInfoHwp" parameterType="map" resultType="dataobject">
/* 민원내역 원본 보기(한글 파일)(crdn01Mapper.selectCivilComplaintOriginalInfoHwp) */
SELECT C.CRDN_ID <!-- 단속 ID -->
, CC.CVLCPT_RCPT_NO <!-- 민원 접수 번호 -->
@ -305,4 +305,18 @@ SELECT C.CRDN_ID <!-- 단속 ID -->
WHERE C.DEL_YN = 'N' AND CC.DEL_YN = 'N'
AND C.CRDN_ID = #{crdnId}
</select>
<select id="selectAnswerPreview" parameterType="map" resultType="dataobject">
/* 민원답변 미리보기(crdn01Mapper.selectAnswerPreview) */
SELECT C.CRDN_ID <!-- 단속 ID -->
, CC.CVLCPT_APLY_CN <!-- 민원 신청 내용 -->
, CC.CVLCPT_PRCS_RSLT_CN
FROM TB_CRDN C
INNER JOIN TB_CRDN_CVLCPT CC ON (C.CRDN_ID = CC.CRDN_ID AND CC.DEL_YN = 'N')
WHERE C.DEL_YN = 'N'
AND C.CRDN_ID = #{crdnId}
</select>
</mapper>

@ -0,0 +1,155 @@
<%@ 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" title="민원답변내용미리보기">
<form id="frmEdit--${pageName}">
<input id="crdnId--${pageName}" name="crdnId" type="hidden" data-map="CRDN_ID" />
<div class="row g-1">
<div class="col-md-6">
<label for="cvlcptAplyCn--${pageName}" class="w-px-150 bg-lighter pe-2 col-form-label text-sm-center">
민원 내용
</label>
</div>
<div class="col-md-6 text-end">
<input type="text" id="countStauts--${pageName}" class="form-control w-px-150 text-center fw-bold" readonly />
<button type="button" class="w-px-50" id="btnPrev--${pageName}">◀</button>
<button type="button" class="w-px-50" id="btnNext--${pageName}">▶</button>
</div>
<div class="col-md-12">
<div class="px-2">
<textarea rows="10" style="width:100%" id="cvlcptAplyCn--${pageName}" name="cvlcptAplyCn" data-map="CVLCPT_APLY_CN"
></textarea>
</div>
</div>
<div class="col-md-12">
<label for="cvlcptPrcsRsltCn--${pageName}" class="w-px-150 bg-lighter pe-2 col-form-label text-sm-center">
답변 내용
</label>
</div>
<div class="col-md-12">
<div class="px-2">
<textarea rows="10" style="width:100%" id="cvlcptPrcsRsltCn--${pageName}" name="cvlcptPrcsRsltCn" data-map="CVLCPT_PRCS_RSLT_CN"
></textarea>
</div>
</div>
<div class="col-md-6">
변경할내용이있으면 수정하시오.
</div>
<div class="col-md-6 text-end">
<button type="button" class="btn btn-primary">변경 내용 저장</button>
</div>
</div>
</form>
</div>
</div>
<script>
pageObject["${pageName}"] = {};
pageObject["${pageName}"].parentRes = {};
pageObject.childReq = [];
pageObject.childReq.push({
getCountStatus : function(){},
getNextKey : function(){},
getPrevKey : function(){},
selectRow : function(){}
});
$(document).ready(function() {
var $P = pageObject["${pageName}"];
$P.taskSeCd = "${taskSeCd}";
if(pageObject.parentRes.length > 0){
$P.parentRes = pageObject.parentRes.pop();
} else {
$P.parentRes = pageObject.childReq.pop();
}
/**************************************************************************
* DatasetControl, Dataset, FormFields
**************************************************************************/
$P.formFields = new FimsFormFields("#frmEdit--${pageName}");
$P.cvlcptControl = new DatasetControl({
prefix:"cvlcpt", prefixName:"민원", infoSize:"xl",
urls : { load : "", getInfo : wctx.url("/"+$P.taskSeCd+"/crdn/crdn01/060/info.do") },
keymapper:info => info ? info.CRDN_ID : "",
dataGetter:obj => obj.cvlcptInfo,
formats: {
CVLCPT_RCPT_YMD : dateFormat,
CVLCPT_PRCS_PRNMNT_DT : dateFormat
}
});
/**************************************************************************
* DatasetControl.on, Dataset.on
**************************************************************************/
$P.cvlcptControl.onCurrentChange = (item) => {
$P.formFields.set(item);
}
/**************************************************************************
* pageObject.function
**************************************************************************/
$P.fnPrev = () => {
var prevKey = $P.parentRes.getPrevKey($("#crdnId--${pageName}").val());
if(prevKey != ""){
$P.fnGo(prevKey);
}
}
$P.fnNext = () => {
var nextKey = $P.parentRes.getNextKey($("#crdnId--${pageName}").val());
if(nextKey != ""){
$P.fnGo(nextKey);
}
}
$P.fnGo = (crdnId) => {
ajax.get({
url: $P.cvlcptControl.urls.getInfo,
data: { "crdnId" : crdnId },
headers: {
Accept: "application/json; charset=utf-8"
},
success : resp => {
var cvlcptInfo = resp.cvlcptInfo;
cvlcptInfo.CVLCPT_APLY_CN = escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN);
$P.cvlcptControl.setData([cvlcptInfo]);
var cs = $P.parentRes.getCountStatus($("#crdnId--${pageName}").val());
$("#countStauts--${pageName}").val(cs);
$P.parentRes.selectRow(crdnId);
}
});
}
/**************************************************************************
* element.on
**************************************************************************/
$("#btnPrev--${pageName}").on("click", () => $P.fnPrev() );
$("#btnNext--${pageName}").on("click", () => $P.fnNext() );
/**************************************************************************
* 초기화
**************************************************************************/
var cvlcptInfo = ${cvlcptInfo};
cvlcptInfo.CVLCPT_APLY_CN = escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN);
$P.cvlcptControl.setData([cvlcptInfo]);
var cs = $P.parentRes.getCountStatus($("#crdnId--${pageName}").val());
$("#countStauts--${pageName}").val(cs);
});
</script>
Loading…
Cancel
Save