시군구 관리 화면 수정

main
이범준 11 months ago
parent def7c76dce
commit 96ef0ca9f4

@ -12,6 +12,10 @@ import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.code.service.CodeQuery;
import cokr.xit.base.code.service.bean.CodeBean;
import cokr.xit.fims.cmmn.CmmnQuery;
import cokr.xit.fims.mngt.service.TaskService;
import cokr.xit.fims.mngt.service.bean.FactionBean;
import cokr.xit.foundation.UserInfo;
import cokr.xit.foundation.data.DataObject;
@Controller
@ -19,6 +23,12 @@ public class CodeController extends cokr.xit.base.code.web.CodeController {
@Resource(name = "codeBean")
private CodeBean codeBean;
@Resource(name = "taskService")
private TaskService taskService;
@Resource(name = "factionBean")
private FactionBean factionBean;
@RequestMapping(name="모든 업무구분코드 조회",value="/getAllTaskSeCd.do")
public ModelAndView getAllTaskSeCd() {
ModelAndView mav = new ModelAndView("jsonView");
@ -33,4 +43,32 @@ public class CodeController extends cokr.xit.base.code.web.CodeController {
return mav;
}
@RequestMapping(name="시군구 업무 설정 유무 조회", value="/sggHasTask.do")
public ModelAndView sggHasTask() {
ModelAndView mav = new ModelAndView("jsonView");
UserInfo userInfo = currentUser();
if(userInfo.getInstitute().equals("default")) {
mav.addObject("sggHasTask", "Y");
} else {
factionBean.initUserInfo(userInfo);
String sggCd = (String)userInfo.getInfo().get("sggCd");
CmmnQuery req = new CmmnQuery();
req.setUseYN("Y");
req.setSggCd(sggCd);
List<DataObject> result = taskService.getTasks(req);
if(result != null && !result.isEmpty()) {
mav.addObject("taskForSgg", "Y");
} else {
mav.addObject("taskForSgg", "N");
}
}
return mav;
}
}

@ -11,6 +11,7 @@ import cokr.xit.fims.cmmn.CmmnQuery;
import cokr.xit.fims.mngt.VltnQuery;
import cokr.xit.fims.mngt.service.TaskService;
import cokr.xit.fims.mngt.service.VltnService;
import cokr.xit.foundation.data.DataObject;
/** .<br />
* { }/mngt/mngt03 .
@ -48,13 +49,13 @@ public class Mngt03Controller extends ApplicationController {
}
public ModelAndView getTasks(CmmnQuery req) {
List<?> result = taskService.getTasks(req);
List<DataObject> result = taskService.getTasks(req);
return setCollectionInfo(new ModelAndView("jsonView"), result, "task");
}
public ModelAndView getVltns(VltnQuery req) {
List<?> result = vltnService.getVltns(req);
List<DataObject> result = vltnService.getVltns(req);
return setCollectionInfo(new ModelAndView("jsonView"), result, "vltn");
}
}

@ -31,7 +31,7 @@
<label class="w-px-140 col-form-label text-sm-end pe-2" for="">
주소
</label>
<input name="instZip" type="text" class="form-control w-px-60" />
<input name="instZip" type="text" class="form-control w-px-80" />
<input name="instAddr" type="text" class="form-control w-px-300" />
<input name="instDaddr" type="text" class="form-control w-px-300" />
</div>
@ -77,7 +77,6 @@
<div id="" class="nav-align-top my-2 mx-2" style="flex-direction: row;">
<ul class="nav nav-tabs" role="tablist" id="tabButtonContainer--${pageName}">
</ul>
<button type="button" class="btn btn-darkgray ms-1">+ 과태료업무 추가</button>
</div>
<span class="tab-content" id="tabContentContainer--${pageName}">
@ -143,8 +142,6 @@
</div>
</div>
<button id="btn{task}AddVltn--${pageName}" type="button" class="btn btn-darkgray ms-2">+ 위반항목 추가</button>
<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"
@ -233,12 +230,19 @@ $(document).ready(function(){
$("#mainForm--${pageName}").find("[name='instAddr']").val($P.sggInfo.INST_ADDR);
$("#mainForm--${pageName}").find("[name='instDaddr']").val($P.sggInfo.INST_DADDR);
if(!isEmpty($P.sggInfo.OFFCS_FILE_PATH)){
$("#offcs--${pageName}").attr("alt", $P.sggInfo.OFFCS_FILE_NM);
$("#offcs--${pageName}").attr("src", $P.sggInfo.OFFCS_FILE_PATH);
}
if(!isEmpty($P.sggInfo.SYMBOL_FILE_PATH)){
$("#symbol--${pageName}").attr("alt", $P.sggInfo.SYMBOL_FILE_NM);
$("#symbol--${pageName}").attr("src", $P.sggInfo.SYMBOL_FILE_PATH);
}
if(!isEmpty($P.sggInfo.LOGO_FILE_PATH)){
$("#logo--${pageName}").attr("alt", $P.sggInfo.LOGO_FILE_NM);
$("#logo--${pageName}").attr("src", $P.sggInfo.LOGO_FILE_PATH);
}
resolve({resp, textStatus, jqXHR});
},
error: function(jqXHR, textStatus, error) {

@ -117,6 +117,26 @@
});
};
async function fnCheckSggTask(){
return new Promise((resolve, reject) => {
$.ajax({
type: "get",
url: wctx.url("/code/sggHasTask.do"),
data: {},
dataType: 'json',
success: function(resp, textStatus, jqXHR) {
if(resp.taskForSgg == "Y"){
resolve({resp, textStatus, jqXHR});
} else {
reject("시군구 업무 설정이 없습니다.");
}
},
error: function(jqXHR, textStatus, error) {
}
});
});
}
async function fnGetMyInfo(){
return new Promise((resolve, reject) => {
$.ajax({
@ -178,9 +198,8 @@
${onload}
fnGetAllTask()
.then(() => {
return fnGetMyInfo();
})
.then(() => { return fnCheckSggTask(); })
.then(() => { return fnGetMyInfo(); })
.then(() => {
var msg = "";
@ -254,6 +273,13 @@
return;
}
}).catch((msg) => {
alert(msg);
var form = $("<form action=\"/logout.do\", method=\"POST\">");
$("<input name=\"${_csrf.parameterName}\" value=\"${_csrf.token}\" type=\"hidden\">").appendTo(form);
form.appendTo("body").submit();
return;
});
});
</script>

Loading…
Cancel
Save