설정정보(사용자,부서,시군구) 조회 추가, 교부 계좌 변경 추가

main
이범준 1 year ago
parent 718c7b98a7
commit 9e88ae3247

@ -22,6 +22,7 @@ import cokr.xit.base.user.ManagedUser;
import cokr.xit.fims.cmmn.DirectoryStructureToJson;
import cokr.xit.fims.cmmn.DirectoryStructureToJson.Node;
import cokr.xit.fims.cmmn.dao.FactionMapper;
import cokr.xit.fims.cmmn.service.bean.StngBean;
import cokr.xit.fims.crdn.service.bean.ImportServiceBean;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.interfaces.smg.service.bean.SmgServiceBean;
@ -38,6 +39,9 @@ public class UserController extends cokr.xit.base.user.web.UserController<Manage
@Resource
ImportServiceBean importServiceBean;
@Resource(name = "stngBean")
StngBean stngBean;
@Override
public ModelAndView main() {
ModelAndView mav = super.main();
@ -57,6 +61,26 @@ public class UserController extends cokr.xit.base.user.web.UserController<Manage
return mav;
}
@RequestMapping(name="설정정보 조회",value="/stngInfo.do")
public ModelAndView getStngInfo(String type) {
ModelAndView mav = new ModelAndView("jsonView");
DataObject stngInfo = stngBean.getStng(type);
mav.addObject("stngInfo",stngInfo);
return mav;
}
@RequestMapping(name="교부 계좌번호 수정",value="/updateDtbnActno.do")
public ModelAndView updateDtbnActno(String dtbnBankNm, String dtbnActno) {
ModelAndView mav = new ModelAndView("jsonView");
boolean saved = stngBean.updateDtbnActno(dtbnBankNm, dtbnActno);
mav.addObject("saved", saved);
return mav;
}
@RequestMapping(name="최고관리자 메인",value="/superUser/main.do")
public ModelAndView superUserMain(HttpServletResponse hres) {
ModelAndView mav = new ModelAndView();

@ -0,0 +1,37 @@
package cokr.xit.fims.cmmn.dao;
import java.util.Map;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.foundation.component.AbstractMapper;
import cokr.xit.foundation.data.DataObject;
@Mapper("stngMapper")
public interface StngMapper extends AbstractMapper {
/** .
* @param userId ID
* @return
*/
DataObject selectUserStng(String userId);
/** .
* @param deptCd
* @return
*/
DataObject selectDeptStng(String deptCd);
/** .
* @param sggCd
* @return
*/
DataObject selectSggStng(String sggCd);
/** .
* @param params
* @return
*/
int updateDtbnActno(Map<String, String> params);
}

@ -25,6 +25,10 @@ public class FactionBean extends AbstractComponent {
@Resource(name = "userMapper")
private UserMapper userMapper;
/**userInfo ,, .
* @param userInfo
* @return
*/
public void initUserInfo(UserInfo userInfo) {
DataObject factionInfo = factionMapper.selectFactionInfoOfUser(userInfo.getId());

@ -0,0 +1,62 @@
package cokr.xit.fims.cmmn.service.bean;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import cokr.xit.fims.cmmn.dao.StngMapper;
import cokr.xit.foundation.AbstractComponent;
import cokr.xit.foundation.UserInfo;
import cokr.xit.foundation.data.DataObject;
@Component("stngBean")
public class StngBean extends AbstractComponent {
@Resource(name = "factionBean")
FactionBean factionBean;
@Resource(name = "stngMapper")
StngMapper stngMapper;
/** .
* @param type
* @return
*/
public DataObject getStng(String type) {
if(type.equals("user")) {
return stngMapper.selectUserStng(currentUser().getId());
} else if(type.equals("dept")){
UserInfo userInfo = currentUser();
factionBean.initUserInfo(userInfo);
return stngMapper.selectDeptStng((String)userInfo.getInfo().get("deptCd"));
} else if(type.equals("sgg")){
UserInfo userInfo = currentUser();
factionBean.initUserInfo(userInfo);
return stngMapper.selectSggStng((String)userInfo.getInfo().get("sggCd"));
} else {
return null;
}
}
/** .
* @param dtbnBankNm , dtbnActno
* @return
*/
public boolean updateDtbnActno(String dtbnBankNm, String dtbnActno) {
Map<String, String> params = new HashMap<String, String>();
UserInfo userInfo = currentUser();
factionBean.initUserInfo(userInfo);
params.put("mdfr", userInfo.getId());
params.put("deptCd", (String)userInfo.getInfo().get("deptCd"));
params.put("dtbnBankNm", dtbnBankNm);
params.put("dtbnActno", dtbnActno);
return stngMapper.updateDtbnActno(params) == 1 ? true : false;
}
}

@ -47,7 +47,9 @@ public class Sprt01Controller extends ApplicationController {
printCrdnMain = "/110/info.do",
makeCrdnListFileFromHwpFormat = "/110/makeCrdnListFileFromHwpFormat.do",
makeCrdnConfirmFileFromHwpFormat = "/110/makeCrdnConfirmFileFromHwpFormat.do",
printBillMain = "/120/info.do"
printBillMain = "/120/info.do",
makeRequestForDeliveryFileFromHwpFormat = "/120/makeRequestForDeliveryFileFromHwpFormat.do",
makeReportOnClaimsFileFromHwpFormat = "/120/makeReportOnClaimsFileFromHwpFormat.do"
;
}
@ -326,4 +328,25 @@ public class Sprt01Controller extends ApplicationController {
return mav;
}
/** .
* @return hwp
*/
public ModelAndView makeRequestForDeliveryFileFromHwpFormat(PrintOption printOption, String[] crdnIds) {
ModelAndView mav = new ModelAndView("jsonView");
//TODO : 교부청구서 한글 파일 작성
return mav;
}
/** .
* @return hwp
*/
public ModelAndView makeReportOnClaimsFileFromHwpFormat(PrintOption printOption, String[] crdnIds) {
ModelAndView mav = new ModelAndView("jsonView");
//TODO : 채권신고서 한글 파일 작성
return mav;
}
}

@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.sprt.PrintOption;
import cokr.xit.fims.sprt.SprtQuery;
import cokr.xit.fims.stat.StatQuery;
@ -384,6 +385,19 @@ public class CmnController {
public ModelAndView printBillMain(String... crdnIds) {
return super.printBillMain(crdnIds);
}
@Override
@RequestMapping(name="교부청구서 한글 파일 생성", value=METHOD_URL.makeRequestForDeliveryFileFromHwpFormat)
public ModelAndView makeRequestForDeliveryFileFromHwpFormat(PrintOption printOption, String... crdnIds) {
return super.makeRequestForDeliveryFileFromHwpFormat(printOption, crdnIds);
}
@Override
@RequestMapping(name="채권신고서 한글 파일 생성", value=METHOD_URL.makeReportOnClaimsFileFromHwpFormat)
public ModelAndView makeReportOnClaimsFileFromHwpFormat(PrintOption printOption, String... crdnIds) {
return super.makeReportOnClaimsFileFromHwpFormat(printOption, crdnIds);
}
}
@Controller

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cokr.xit.fims.cmmn.dao.StngMapper">
<select id="selectUserStng" parameterType="string" resultType="dataobject">
/* 사용자 설정정보 조회 stngMapper.selectUserStng) */
SELECT USER_ID
, '' AS 'DEFAULT_TASK_SE_CD'
FROM TB_USER
WHERE USER_ID = #{userId}
</select>
<select id="selectDeptStng" parameterType="string" resultType="dataobject">
/* 부서 설정정보 조회 stngMapper.selectDeptStng) */
SELECT DEPT_CD
, DTBN_BANK_NM <!-- 교부 은행 명 -->
, DTBN_ACTNO <!-- 교부 계좌번호 -->
FROM TB_DEPT_INFO
WHERE DEPT_CD = #{deptCd}
</select>
<select id="selectSggStng" parameterType="string" resultType="dataobject">
/* 시군구 설정정보 조회 stngMapper.selectSggStng) */
SELECT SGG_CD
, OFFCS_FILE_PATH <!-- 직인 파일 경로 -->
, OFFCS_FILE_NM <!-- 직인 파일 명 -->
FROM TB_SGG_INFO
WHERE SGG_CD = #{sggCd}
</select>
<update id="updateDtbnActno" parameterType="map">
/* 교부 계좌번호 변경 stngMapper.updateDtbnActno) */
UPDATE TB_DEPT_INFO
SET MDFR = #{mdfr}
, MDFCN_DT = <include refid="utility.now" />
, DTBN_BANK_NM = #{dtbnBankNm}
, DTBN_ACTNO = #{dtbnActno}
WHERE DEPT_CD = #{deptCd}
</update>
</mapper>

@ -127,12 +127,14 @@ $(document).ready(function(){
crdnIds : $P.crdnIds.join(",")
},
success : resp => {
var a = document.createElement("a");
a.href = resp.filePath;
a.download = resp.fileName;
document.getElementById("tempArea--${pageName}").appendChild(a);
a.click();
document.getElementById("tempArea--${pageName}").removeChild(a);
if(resp.filePath != null && resp.filePath != ""){
var a = document.createElement("a");
a.href = resp.filePath;
a.download = resp.fileName;
document.getElementById("tempArea--${pageName}").appendChild(a);
a.click();
document.getElementById("tempArea--${pageName}").removeChild(a);
}
}
});
}

@ -8,8 +8,8 @@
<div class="row mb-3 justify-content-start">
<div class="col-md-12">
<div class="float-start">
<button type="button" id="" class="btn btn-info">교부청구서출력</button>
<button type="button" id="" class="btn btn-info">채권신고서출력</button>
<button type="button" id="btnPrintRequestForDelivery--${pageName}" class="btn btn-info">교부청구서출력</button>
<button type="button" id="btnPrintReportOnClaims--${pageName}" class="btn btn-info">채권신고서출력</button>
</div>
</div>
</div>
@ -126,9 +126,44 @@
</div>
</div>
</form>
<span id="tempArea--${pageName}" hidden></span>
</div>
</div>
<template id="checkActnoTemplate--${pageName}">
<form id="frmDialog--${pageName}">
<div class="card">
<div class="row g-1">
<div class="col-md-12">
<label for="dtbnBankNm--${pageName}"
class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end">은행형</label>
<input type="text" id="dtbnBankNm--${pageName}" name="dtbnBankNm" class="form-control" />
</div>
<div class="col-md-12">
<label for="dtbnActno--${pageName}"
class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end">계좌번호</label>
<input type="text" id="dtbnActno--${pageName}" name="dtbnActno" class="form-control" />
</div>
</div>
</div>
<div>
<span class="container-page-btn">
<span class="container-window-btn-right">
<button type="button" class="btn btn-primary" id="btnChangeActno--${pageName}"
title="변경">
변경
</button>
<button type="button" class="btn btn-primary" id="btnConfirmActno--${pageName}"
title="확인">
확인
</button>
</span>
</span>
</div>
</form>
</template>
<script>
pageObject["${pageName}"] = {};
@ -162,6 +197,119 @@ $(document).ready(function(){
ff.set(info);
}
//교부청구서 파일 생성
$P.fnMakeRequestForDeliveryFile = () => {
if(!customValidate($("#frmEdit--${pageName} input"))) return;
$P.checkActno();
}
//계좌번호확인
$P.checkActno = () => {
ajax.post({
url : wctx.url("/user/stngInfo.do"),
data : { type : "dept" },
success : (resp) => {
var checkActnoDialogId = "checkActnoDialog--${pageName}";
dialog.open({
id : checkActnoDialogId,
title : "계좌번호 확인",
content : document.getElementById("checkActnoTemplate--${pageName}").innerHTML,
size : "md",
init : () => {
$("#btnChangeActno--${pageName}").on("click", function(){ $P.checkActnoCallback(true,checkActnoDialogId); });
$("#btnConfirmActno--${pageName}").on("click", function(){ $P.checkActnoCallback(false,checkActnoDialogId); });
if(resp.stngInfo != null){
$("#dtbnBankNm--${pageName}").val(resp.stngInfo.DTBN_BANK_NM);
$("#dtbnActno--${pageName}").val(resp.stngInfo.DTBN_ACTNO);
}
},
onClose : () => {}
});
}
});
}
//계좌번호확인callback
$P.checkActnoCallback = (change, checkActnoDialogId) => {
var url = wctx.url("/sprt/sprt01/120/makeRequestForDeliveryFileFromHwpFormat.do");
var formFields = new FimsFormFields("#frmEdit--${pageName}");
var globalVariable = formFields.get();
var changed = false;
if(change){
var dtbnBankNm = $("#dtbnBankNm--${pageName}").val();
var dtbnActno = $("#dtbnActno--${pageName}").val();
$.ajax({
type: 'GET',
url: wctx.url('/user/updateDtbnActno.do'),
data: {
"dtbnBankNm" : dtbnBankNm,
"dtbnActno" : dtbnActno
},
async: false
}).done(function(data, textStatus, xhr) {
if(data.saved){
changed = true;
} else {
alert("교부 계좌 변경에 실패하였습니다.");
}
});
}
if(!change || changed){
dialog.close(checkActnoDialogId);
$P.fnMakeFile(url, globalVariable);
}
}
//채권신고서 파일 생성
$P.fnMakeReportOnClaimsFile = () => {
if(!customValidate($("#frmEdit--${pageName} input"))) return;
var url = wctx.url("/sprt/sprt01/120/makeReportOnClaimsFileFromHwpFormat.do");
var formFields = new FimsFormFields("#frmEdit--${pageName}");
var globalVariable = formFields.get();
$P.fnMakeFile(url, globalVariable);
}
$P.fnMakeFile = (url, globalVariable) => {
ajax.post({
url : url,
data : {
crdnIds : $P.crdnIds.join(","),
globalVariable : globalVariable
},
success : resp => {
if(resp.filePath != null && resp.filePath != ""){
var a = document.createElement("a");
a.href = resp.filePath;
a.download = resp.fileName;
document.getElementById("tempArea--${pageName}").appendChild(a);
a.click();
document.getElementById("tempArea--${pageName}").removeChild(a);
}
}
});
}
//버튼이벤트
$("#btnPrintRequestForDelivery--${pageName}").on("click", () => $P.fnMakeRequestForDeliveryFile() );
$("#btnPrintReportOnClaims--${pageName}").on("click", () => $P.fnMakeReportOnClaimsFile() );
//첫번째 줄 클릭
$("#tbody--${pageName}").find("tr:eq(0)").click();
});

Loading…
Cancel
Save