대시보드 결재대기함 구현

master
강석 최 2023-04-19 12:01:10 +09:00
parent 5c0f3d069b
commit adcdb6c7e4
13 changed files with 312 additions and 46 deletions

View File

@ -135,6 +135,18 @@ public class BaseController {
setSession(loginUser, request.getSession());
return new ModelAndView("redirect:/dashboard");
}
@GetMapping("/apprvStayDocRedirect")
public ModelAndView apprvStayDocRedirect (DashboardAffair doc){
ModelAndView mav = new ModelAndView();
String url = menuMgtService.selectMenuUrl(doc.getBoard());
if(url.contains("?")){
url+="&refDocKey="+doc.getKey();
}else{
url+="?refDocKey="+doc.getKey();
}
mav.setViewName("redirect:"+url);
return mav;
}
public void setSession(@AuthenticationPrincipal UserInfo loginUser, HttpSession session){
loginUser.setDownOrganCdList(organConfigService.selectDownOrganList(loginUser.getOgCd()));

View File

@ -124,9 +124,11 @@ public class SecurityConfig{
).permitAll() // 권한 없이 접근 허용
.antMatchers(
"/dashboard",
"/resetSession",
"/selectBoxOptions",
"/apprvStayDoc",
"/myInfo/**",
"/modal/**",
"/selectBoxOptions",
"/publicBoard/**",
"/faRpt/**",
"/ivsgt/**",
@ -143,8 +145,7 @@ public class SecurityConfig{
"/counterIntelligence/**",
"/monitoring/**",
"/intelligenceNetwork/**",
"/deadline/**",
"/resetSession"
"/deadline/**"
).hasRole(Role.USER.name()) // USER 접근 허용
.antMatchers(
"/authMgt/**",

View File

@ -96,11 +96,11 @@ public class ActivityCaseController {
}
@GetMapping("/activityCaseViewModal")
public ModelAndView activityCaseViewModal(@AuthenticationPrincipal UserInfo loginUser, ActivityCase activityCase, ActivityCaseInfo activityCaseInfo){
public ModelAndView activityCaseViewModal(@AuthenticationPrincipal UserInfo loginUser, ActivityCaseInfo activityCaseInfo){
ModelAndView mav = new ModelAndView("counterIntelligence/activityCase/activityCaseViewModal");
mav.addObject("modalType", activityCase.getModalType());
activityCase = activityCaseService.selectActivityCase(activityCase.getReceiptKey());
mav.addObject("modalType", activityCaseInfo.getModalType());
activityCaseInfo = activityCaseService.selectActivityCaseInfo(activityCaseInfo.getCaseKey());
ActivityCase activityCase = activityCaseService.selectActivityCase(activityCaseInfo.getReceiptKey());
mav.addObject("viewUserSeq", loginUser.getUserSeq());
String accessAuth = authMgtService.selectAccessConfigList
(loginUser.getUserSeq(), "/counterIntelligence/activityCaseList").get(0).getAccessAuth();

View File

@ -10,9 +10,9 @@ import java.time.LocalDateTime;
@Setter
@NoArgsConstructor
public class DashboardAffair{
private String board;
private Integer board;
private Integer key;
private String title;
private String title="";
private String wrtUserNm;
private String wrtUserGrd;
private LocalDateTime wrtDt;

View File

@ -289,6 +289,224 @@
limit 8
</select>
<select id="selectApprvStayList" parameterType="DashboardAffair" resultType="DashboardAffair">
select 29 as board,
a.plan_key as key,
a.content_title as title,
a.wrt_dt
from plan_board a
where (
a.wrt_user_seq = #{userSeq}
or (
a.plan_state = 'DST002' and
( select ab.approval_auth ~ 'APC003' or ab.approval_auth ~ 'APC004'
from menu_mgt aa
left outer join approval_config ab on aa.menu_key = ab.menu_key and ab.user_seq = #{userSeq}
where aa.menu_key = 29)
)
or (
a.plan_state = 'DST004' and
( select ab.approval_auth ~ 'APC001' or ab.approval_auth ~ 'APC002'
from menu_mgt aa
left outer join approval_config ab on aa.menu_key = ab.menu_key and ab.user_seq = #{userSeq}
where aa.menu_key = 29)
)
)
union all
select 30 as board,
a.affair_key as key,
a.title,
a.wrt_dt
from affair_board a
inner join affair_rating b on a.affair_key = b.affair_key and b.rating_organ = #{ogCd}
where a.affair_category = 'CAT215'
and (
a.wrt_user_seq = #{userSeq} or
(
b.affair_status = 'DST002' and
( select ab.approval_auth ~ 'APC003' or ab.approval_auth ~ 'APC004'
from menu_mgt aa
left outer join approval_config ab on aa.menu_key = ab.menu_key and ab.user_seq = #{userSeq}
where aa.menu_key = 30)
) or (
b.affair_status = 'DST004' and
( select ab.approval_auth ~ 'APC001' or ab.approval_auth ~ 'APC002'
from menu_mgt aa
left outer join approval_config ab on aa.menu_key = ab.menu_key and ab.user_seq = #{userSeq}
where aa.menu_key = 30)
)
)
union all
select 31 as board,
a.result_key as key,
a.clear_title as title,
a.wrt_dt
from result_board a
where (
a.wrt_user_seq = #{userSeq} or (
a.result_state = 'DST002' and
( select ab.approval_auth ~ 'APC003' or ab.approval_auth ~ 'APC004'
from menu_mgt aa
left outer join approval_config ab on aa.menu_key = ab.menu_key and ab.user_seq = #{userSeq}
where aa.menu_key = 31)
) or (
a.result_state = 'DST004' and
( select ab.approval_auth ~ 'APC001' or ab.approval_auth ~ 'APC002'
from menu_mgt aa
left outer join approval_config ab on aa.menu_key = ab.menu_key and ab.user_seq = #{userSeq}
where aa.menu_key = 31)
)
)
union all
select 32 as board,
a.op_key as key,
a.op_sdate||' '||a.op_name||' 운영 계획' as title,
a.wrt_dt
from operation_plan a
where (
a.wrt_user_seq = #{userSeq}
or (
a.op_state = 'DST002' and
( select ab.approval_auth ~ 'APC003' or ab.approval_auth ~ 'APC004'
from menu_mgt aa
left outer join approval_config ab on aa.menu_key = ab.menu_key and ab.user_seq = #{userSeq}
where aa.menu_key = 32 )
) or (
a.op_state = 'DST004' and
( select ab.approval_auth ~ 'APC001' or ab.approval_auth ~ 'APC002'
from menu_mgt aa
left outer join approval_config ab on aa.menu_key = ab.menu_key and ab.user_seq = #{userSeq}
where aa.menu_key = 32
)
)
)
union all
select 33 as board,
a.affair_key as key,
a.title,
a.wrt_dt
from affair_board a
inner join affair_rating b on a.affair_key = b.affair_key and b.rating_organ = #{ogCd}
where a.affair_category = 'CAT216'
and (
a.wrt_user_seq = #{userSeq} or (
b.affair_status = 'DST002' and
( select ab.approval_auth ~ 'APC003' or ab.approval_auth ~ 'APC004'
from menu_mgt aa
left outer join approval_config ab on aa.menu_key = ab.menu_key and ab.user_seq = #{userSeq}
where aa.menu_key = 33 )
) or (
b.affair_status = 'DST004' and
( select ab.approval_auth ~ 'APC001' or ab.approval_auth ~ 'APC002'
from menu_mgt aa
left outer join approval_config ab on aa.menu_key = ab.menu_key and ab.user_seq = #{userSeq}
where aa.menu_key = 33 )
)
)
union all
select 34 as board,
a.ia_key as key,
a.ia_sdate||'~'||a.ia_edate||' 운영 실적 분석' as title,
a.wrt_dt
from intelligence_analyze a
where (
a.wrt_user_seq = #{userSeq}
or (
a.ia_state = 'DST002' and
( select ab.approval_auth ~ 'APC003' or ab.approval_auth ~ 'APC004'
from menu_mgt aa
left outer join approval_config ab on aa.menu_key = ab.menu_key and ab.user_seq = #{userSeq}
where aa.menu_key = 34 )
) or (
a.ia_state = 'DST004' and
( select ab.approval_auth ~ 'APC001' or ab.approval_auth ~ 'APC002'
from menu_mgt aa
left outer join approval_config ab on aa.menu_key = ab.menu_key and ab.user_seq = #{userSeq}
where aa.menu_key = 34 )
)
)
union all
select 35 as board,
a.fer_key as key,
b.op_name||' 해고(연장)보고' as title,
a.wrt_dt
from fire_extension_report a
inner join operation_plan b on a.op_key = b.op_key
where (
a.wrt_user_seq = #{userSeq}
or (
a.fer_state = 'DST002' and
( select ab.approval_auth ~ 'APC003' or ab.approval_auth ~ 'APC004'
from menu_mgt aa
left outer join approval_config ab on aa.menu_key = ab.menu_key and ab.user_seq = #{userSeq}
where aa.menu_key = 35 )
) or (
a.fer_state = 'DST004' and
( select ab.approval_auth ~ 'APC001' or ab.approval_auth ~ 'APC002'
from menu_mgt aa
left outer join approval_config ab on aa.menu_key = ab.menu_key and ab.user_seq = #{userSeq}
where aa.menu_key = 35 )
)
)
union all
select 36 as board,
a.md_key as key,
a.md_title as title,
a.wrt_dt
from monitoring_designation a
where (
a.wrt_user_seq = #{userSeq}
or (
a.md_state = 'DST002' and
( select ab.approval_auth ~ 'APC003' or ab.approval_auth ~ 'APC004'
from menu_mgt aa
left outer join approval_config ab on aa.menu_key = ab.menu_key and ab.user_seq = #{userSeq}
where aa.menu_key = 36)
) or (
a.md_state = 'DST004' and
( select ab.approval_auth ~ 'APC001' or ab.approval_auth ~ 'APC002'
from menu_mgt aa
left outer join approval_config ab on aa.menu_key = ab.menu_key and ab.user_seq = #{userSeq}
where aa.menu_key = 36)
)
)
union all
select 37 as board,
a.mr_key as key,
a.mr_title as title,
a.wrt_dt
from monitoring_result a
where (
a.wrt_user_seq = #{userSeq}
or (
a.mr_state = 'DST002' and
( select ab.approval_auth ~ 'APC003' or ab.approval_auth ~ 'APC004'
from menu_mgt aa
left outer join approval_config ab on aa.menu_key = ab.menu_key and ab.user_seq = #{userSeq}
where aa.menu_key = 37)
) or (
a.mr_state = 'DST004' and
( select ab.approval_auth ~ 'APC001' or ab.approval_auth ~ 'APC002'
from menu_mgt aa
left outer join approval_config ab on aa.menu_key = ab.menu_key and ab.user_seq = #{userSeq}
where aa.menu_key = 37 )
)
)
union all
select 12 as board,
b.case_key as key,
b.title,
b.wrt_dt
from activity_case a
inner join activity_case_info b on a.receipt_key = b.receipt_key
where (
a.wrt_user_seq = #{userSeq}
or b.case_key in (
select case_key
from activity_case_apprv
where user_seq = #{userSeq}
)
)
order by wrt_dt desc
limit 9
</select>
</mapper>

View File

@ -6,6 +6,15 @@ $(function(){
autoclose: true
});
})
if(location.search.includes("refDocKey")){
const params = location.search.split('&');
$.each(params, function (idx, param){
if(param.includes("refDocKey")){
const key = param.slice(param.indexOf("=")+1, param.length);
getActivityCaseViewModal(key, null);
}
})
}
$(document).on('click', '.addActivityCaseInfoBtn', function (){
getActivityCaseEditModal(null, null, $(this).attr('data-casetype'));
})
@ -58,7 +67,7 @@ $(document).on('click', '.activityCaseTr', function (){
})
$(document).on('click', '.summaryTr', function (){
getActivityCaseViewModal($(this).attr("data-receiptkey"), $(this).attr("data-casekey"), $(this).attr("data-modaltype"));
getActivityCaseViewModal($(this).attr("data-casekey"), $(this).attr("data-modaltype"));
})
$(document).on('click', '#editInfoBtn', function (){
@ -153,10 +162,10 @@ function getActivityCaseSummaryModal(receiptKey, modalType){
});
}
function getActivityCaseViewModal(receiptKey, caseKey, modalType){
function getActivityCaseViewModal(caseKey, modalType){
$.ajax({
url: '/counterIntelligence/activityCaseViewModal',
data: {receiptKey: receiptKey, caseKey: caseKey, modalType: modalType},
data: {caseKey: caseKey, modalType: modalType},
type: 'GET',
dataType:"html",
success: function(html){

View File

@ -28,28 +28,9 @@ $(document).on('click', '.faRptTr', function (){
location.href = "/faRpt/faRptBoard?activeTab=receive&refDocKey="+$(this).find('.faRptKey').val();
})
$(document).on('click', '.affairTr', function (){
switch ($(this).find('.board').val()){
case "plan1":
location.href = "/affairPlan/planMgt?refDocKey="+$(this).find(".key").val();
break;
case "affair1":
location.href = "/affair/affairMgt/myReport?affairCategory=CAT215&refDocKey="+$(this).find(".key").val();
break;
case "result":
location.href = "/affairResult/resultMgt?refDocKey="+$(this).find(".key").val();
break;
case "plan2":
/*location.href = "/affairPlan/planMgt?refDocKey="+$(this).find(".key").val();*/
break;
case "affair2":
location.href = "/affair/affairMgt/myReport?affairCategory=CAT215&refDocKey="+$(this).find(".key").val();
break;
case "analyze":
/*location.href = "/affairPlan/planMgt?refDocKey="+$(this).find(".key").val();*/
break;
case "fire":
/*location.href = "/affairPlan/planMgt?refDocKey="+$(this).find(".key").val();*/
break;
}
$(document).on('click', '.apprvStayTr', function (){
const tr = $(this);
location.href = "/apprvStayDocRedirect?board="
+tr.find(".boardNo").val()
+"&key="+tr.find(".docKey").val();
})

View File

@ -1,4 +1,13 @@
$(function(){
if(location.search.includes("refDocKey")){
const params = location.search.split('&');
$.each(params, function (idx, param){
if(param.includes("refDocKey")){
const key = param.slice(param.indexOf("=")+1, param.length);
fireExtensionReportViewModal(key);
}
})
}
$("#dateSelectorDiv").datepicker({
format: "yyyy-mm-dd",
language: "ko",

View File

@ -1,4 +1,13 @@
$(function(){
if(location.search.includes("refDocKey")){
const params = location.search.split('&');
$.each(params, function (idx, param){
if(param.includes("refDocKey")){
const key = param.slice(param.indexOf("=")+1, param.length);
getIntelligenceAnalyzeViewModal(key);
}
})
}
$("#dateSelectorDiv").datepicker({
format: "yyyy-mm-dd",
language: "ko",

View File

@ -1,4 +1,13 @@
$(function(){
if(location.search.includes("refDocKey")){
const params = location.search.split('&');
$.each(params, function (idx, param){
if(param.includes("refDocKey")){
const key = param.slice(param.indexOf("=")+1, param.length);
getOperationPlanViewModal(key);
}
})
}
$("#dateSelectorDiv").datepicker({
format: "yyyy-mm-dd",
language: "ko",

View File

@ -1,4 +1,13 @@
$(function(){
if(location.search.includes("refDocKey")){
const params = location.search.split('&');
$.each(params, function (idx, param){
if(param.includes("refDocKey")){
const key = param.slice(param.indexOf("=")+1, param.length);
getDesignationViewModal(key);
}
})
}
$("#dateSelectorDiv").datepicker({
format: "yyyy-mm-dd",
language: "ko",

View File

@ -1,4 +1,13 @@
$(function(){
if(location.search.includes("refDocKey")){
const params = location.search.split('&');
$.each(params, function (idx, param){
if(param.includes("refDocKey")){
const key = param.slice(param.indexOf("=")+1, param.length);
getResultViewModal(key);
}
})
}
$("#dateSelectorDiv").datepicker({
format: "yyyy-mm-dd",
language: "ko",

View File

@ -51,23 +51,23 @@
<col style="width: 20%">
</colgroup>
<tbody>
<!--<th:block th:if="${#lists.isEmpty(noticeList)}">
<th:block th:if="${#lists.isEmpty(apprvStayList)}">
<tr>
<td colspan="2">공지사항이 없습니다.</td>
<td colspan="2">결재대기 문서가 없습니다.</td>
</tr>
</th:block>
<th:block th:unless="${#lists.isEmpty(noticeList)}">
<tr class="noticeTr" th:each="notice:${noticeList}">
<input type="hidden" class="publicKey" th:value="${notice.publicKey}">
<th:block th:unless="${#lists.isEmpty(apprvStayList)}">
<tr class="apprvStayTr" th:each="doc:${apprvStayList}">
<input type="hidden" class="boardNo" th:value="${doc.board}">
<input type="hidden" class="docKey" th:value="${doc.key}">
<td>
<i class="bi bi-dot" style="color: #3d73d7"></i>
<th:block th:if="${#strings.length(notice.title)>20}" th:text="|${#strings.substring(notice.title, 0, 20)}...|"></th:block>
<th:block th:unless="${#strings.length(notice.title)>20}" th:text="${notice.title}"></th:block>
<th:block th:if="${#strings.length(doc.title)>20}" th:text="|${#strings.substring(doc.title, 0, 20)}...|"></th:block>
<th:block th:unless="${#strings.length(doc.title)>20}" th:text="${doc.title}"></th:block>
</td>
<td th:text="${notice.wrtUserNm}"></td>
<td th:text="${#temporals.format(notice.wrtDt, 'yyyy-MM-dd')}"></td>
<td th:text="${#temporals.format(doc.wrtDt, 'yyyy-MM-dd')}"></td>
</tr>
</th:block>-->
</th:block>
</tbody>
</table>
</dd>