견문보고 리포팅툴 기능 추가.
parent
d6a750a8ad
commit
60cfdc56c3
|
|
@ -2,8 +2,10 @@ package com.dbnt.faisp.main.fpiMgt.affair;
|
||||||
|
|
||||||
import com.dbnt.faisp.config.FileInfo;
|
import com.dbnt.faisp.config.FileInfo;
|
||||||
import com.dbnt.faisp.main.authMgt.service.AuthMgtService;
|
import com.dbnt.faisp.main.authMgt.service.AuthMgtService;
|
||||||
|
import com.dbnt.faisp.main.codeMgt.model.CodeMgt;
|
||||||
import com.dbnt.faisp.main.codeMgt.service.CodeMgtService;
|
import com.dbnt.faisp.main.codeMgt.service.CodeMgtService;
|
||||||
import com.dbnt.faisp.main.fpiMgt.affair.model.AffairBoard;
|
import com.dbnt.faisp.main.fpiMgt.affair.model.AffairBoard;
|
||||||
|
import com.dbnt.faisp.main.fpiMgt.affair.model.AffairFile;
|
||||||
import com.dbnt.faisp.main.fpiMgt.affair.model.AffairRating;
|
import com.dbnt.faisp.main.fpiMgt.affair.model.AffairRating;
|
||||||
import com.dbnt.faisp.main.fpiMgt.affair.model.TypeStatistics;
|
import com.dbnt.faisp.main.fpiMgt.affair.model.TypeStatistics;
|
||||||
import com.dbnt.faisp.main.fpiMgt.affair.service.AffairService;
|
import com.dbnt.faisp.main.fpiMgt.affair.service.AffairService;
|
||||||
|
|
@ -18,6 +20,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.ServletOutputStream;
|
import javax.servlet.ServletOutputStream;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
@ -156,7 +159,7 @@ public class AffairController { // 첩보수집활동 > 외사경찰 견문관
|
||||||
public ModelAndView affairViewModal(@AuthenticationPrincipal UserInfo loginUser, AffairBoard affairBoard){
|
public ModelAndView affairViewModal(@AuthenticationPrincipal UserInfo loginUser, AffairBoard affairBoard){
|
||||||
ModelAndView mav = new ModelAndView("igActivities/fpiMgt/affair/affairViewModal");
|
ModelAndView mav = new ModelAndView("igActivities/fpiMgt/affair/affairViewModal");
|
||||||
affairBoard = affairService.selectAffairBoard(affairBoard.getAffairKey());
|
affairBoard = affairService.selectAffairBoard(affairBoard.getAffairKey());
|
||||||
affairBoard.setAffairStatus(getAffairRating(affairBoard, loginUser.getOgCd()).getAffairStatus());;
|
affairBoard.setAffairStatus(getAffairRating(affairBoard, loginUser.getOgCd()).getAffairStatus());
|
||||||
|
|
||||||
mav.addObject("affair", affairBoard);
|
mav.addObject("affair", affairBoard);
|
||||||
mav.addObject("userSeq",loginUser.getUserSeq());
|
mav.addObject("userSeq",loginUser.getUserSeq());
|
||||||
|
|
@ -169,6 +172,46 @@ public class AffairController { // 첩보수집활동 > 외사경찰 견문관
|
||||||
mav.addObject("apprvAuth", apprvAuth);
|
mav.addObject("apprvAuth", apprvAuth);
|
||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
|
@GetMapping("/affairBoardJson")
|
||||||
|
public AffairBoard affairBoardJson(AffairBoard affair, HttpSession session){
|
||||||
|
Map<String, List<CodeMgt>> codeMap = (Map<String, List<CodeMgt>>) session.getAttribute("commonCode");
|
||||||
|
affair = affairService.selectAffairBoard(affair.getAffairKey());
|
||||||
|
affair.setWrtPart(Utils.searchCodeValue(affair.getWrtPart(), codeMap.get(affair.getWrtOrgan())));
|
||||||
|
affair.setWrtUserGrd(Utils.searchCodeValue(affair.getWrtUserGrd(), codeMap.get("JT")));
|
||||||
|
affair.setAffairType1(Utils.searchCodeValue(affair.getAffairType1(), codeMap.get("DC01")));
|
||||||
|
affair.setAffairType2(Utils.searchCodeValue(affair.getAffairType2(), codeMap.get("DC02")));
|
||||||
|
affair.setAffairType3(Utils.searchCodeValue(affair.getAffairType3(), codeMap.get("DC03")));
|
||||||
|
affair.setAffairType4(Utils.searchCodeValue(affair.getAffairType4(), codeMap.get("DC04")));
|
||||||
|
AffairRating rating = getAffairRating(affair, affair.getWrtOrgan());
|
||||||
|
affair.setSectionNm(rating.getSectionNm());
|
||||||
|
affair.setHeadNm(rating.getHeadNm());
|
||||||
|
affair.setOrganUp(rating.getOrganUp().equals("T")?"O":"");
|
||||||
|
affair.setLastEtc(Utils.isEmpty(rating.getSectionEtc())?rating.getHeadEtc():rating.getSectionEtc());
|
||||||
|
affair.setReference(rating.getRatingOrgan().equals("OG027")?"경비작전과장":"정보외사과장");
|
||||||
|
if(rating.getRatingOrgan().equals("OG001")){
|
||||||
|
affair.setReception("해양경찰청장");
|
||||||
|
}else if(rating.getRatingOrgan().equals("OG027")){
|
||||||
|
affair.setReception("서해5도특별경비단장");
|
||||||
|
}else{
|
||||||
|
String organNm = Utils.searchCodeValue(rating.getRatingOrgan(), codeMap.get("OG"));
|
||||||
|
if(organNm.endsWith("청")){
|
||||||
|
affair.setReception(organNm.substring(0, organNm.length()-1)+"지방청장");
|
||||||
|
}else{
|
||||||
|
affair.setReception(organNm.substring(0, organNm.length()-1)+"경찰서장");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
switch (rating.getAffairRate()){
|
||||||
|
case "AAR001": affair.setAffairRate1("O");break;
|
||||||
|
case "AAR003": affair.setAffairRate2("O");break;
|
||||||
|
case "AAR004": affair.setAffairRate3("O");break;
|
||||||
|
case "AAR006": affair.setAffairRate4("O");break;
|
||||||
|
case "AAR008": affair.setAffairRate5("O");break;
|
||||||
|
}
|
||||||
|
for(AffairFile file: affair.getFileList()){
|
||||||
|
file.setOrigNm(file.getOrigNm()+"."+file.getFileExtn());
|
||||||
|
}
|
||||||
|
return affair;
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/saveAffair")
|
@PostMapping("/saveAffair")
|
||||||
public Integer saveAffair(AffairBoard affairBoard,
|
public Integer saveAffair(AffairBoard affairBoard,
|
||||||
|
|
|
||||||
|
|
@ -66,14 +66,35 @@ public class AffairBoard extends BaseModel {
|
||||||
@Column(name = "doc_no")
|
@Column(name = "doc_no")
|
||||||
private String docNo;
|
private String docNo;
|
||||||
|
|
||||||
@Transient
|
|
||||||
private String organUp;
|
|
||||||
@Transient
|
|
||||||
private String affairRate;
|
|
||||||
@Transient
|
@Transient
|
||||||
private String affairStatus;
|
private String affairStatus;
|
||||||
@Transient
|
@Transient
|
||||||
private String ratingOrgan;
|
private String ratingOrgan;
|
||||||
|
@Transient
|
||||||
|
private String affairRate;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
private String reception;
|
||||||
|
@Transient
|
||||||
|
private String reference;
|
||||||
|
@Transient
|
||||||
|
private String affairRate1;
|
||||||
|
@Transient
|
||||||
|
private String affairRate2;
|
||||||
|
@Transient
|
||||||
|
private String affairRate3;
|
||||||
|
@Transient
|
||||||
|
private String affairRate4;
|
||||||
|
@Transient
|
||||||
|
private String affairRate5;
|
||||||
|
@Transient
|
||||||
|
private String organUp;
|
||||||
|
@Transient
|
||||||
|
private String sectionNm;
|
||||||
|
@Transient
|
||||||
|
private String headNm;
|
||||||
|
@Transient
|
||||||
|
private String lastEtc;
|
||||||
|
|
||||||
@Transient
|
@Transient
|
||||||
private String hashTags;
|
private String hashTags;
|
||||||
|
|
|
||||||
|
|
@ -226,7 +226,28 @@ $(document).on('click', '#fileDownBtn', function (){
|
||||||
})
|
})
|
||||||
|
|
||||||
$(document).on('click', '#printBtn', function (){
|
$(document).on('click', '#printBtn', function (){
|
||||||
window.open(location.origin+"/affair/print?affairKey="+$(this).attr("data-affairkey"));
|
// window.open(location.origin+"/affair/print?affairKey="+$(this).attr("data-affairkey"));
|
||||||
|
$.ajax({
|
||||||
|
url: '/affair/affairBoardJson',
|
||||||
|
type: 'GET',
|
||||||
|
data: {affairKey: $(this).attr('data-affairkey')},
|
||||||
|
dataType:"json",
|
||||||
|
success: function(data){
|
||||||
|
var url = $("#printUrl").attr("data-printurl")+"/affairBoard.jsp";
|
||||||
|
var title = "견문 보고서 인쇄";
|
||||||
|
var status = "width=900px,height=800px,scrollbars=yes";
|
||||||
|
window.open("", title, status);
|
||||||
|
const form = $("#printForm")[0];
|
||||||
|
form.target = title;
|
||||||
|
form.action = url;
|
||||||
|
form.affair.value = JSON.stringify(data);
|
||||||
|
form.method = "post";
|
||||||
|
form.submit();
|
||||||
|
},
|
||||||
|
error:function(e){
|
||||||
|
ajaxErrorAction(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
function getAffairViewModal(affairKey){
|
function getAffairViewModal(affairKey){
|
||||||
|
|
|
||||||
|
|
@ -120,20 +120,17 @@ $(document).on('click', '#printBtn', function (){
|
||||||
for(let i=0; i<data.apprvList.length; i++){
|
for(let i=0; i<data.apprvList.length; i++){
|
||||||
const apprv = data.apprvList[i];
|
const apprv = data.apprvList[i];
|
||||||
switch (apprv.state) {
|
switch (apprv.state) {
|
||||||
case "DST003":
|
|
||||||
plan.sectionApprv = apprv.userNm+"(반려)"
|
|
||||||
break;
|
|
||||||
case "DST004":
|
case "DST004":
|
||||||
plan.sectionApprv = apprv.userNm
|
plan.sectionApprv = apprv.userNm
|
||||||
break;
|
break;
|
||||||
case "DST005":
|
|
||||||
plan.headApprv = apprv.userNm+"(반려)"
|
|
||||||
break;
|
|
||||||
case "DST006":
|
case "DST006":
|
||||||
plan.headApprv = apprv.userNm
|
plan.headApprv = apprv.userNm
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(plan.sectionApprv === plan.headApprv){
|
||||||
|
plan.sectionApprv = "전결"
|
||||||
|
}
|
||||||
const planInfoSummery = [];
|
const planInfoSummery = [];
|
||||||
const planInfoDetail = [];
|
const planInfoDetail = [];
|
||||||
for(let i=0; i<data.mainInfoList.length; i++){
|
for(let i=0; i<data.mainInfoList.length; i++){
|
||||||
|
|
@ -160,7 +157,6 @@ $(document).on('click', '#printBtn', function (){
|
||||||
form.target = title;
|
form.target = title;
|
||||||
form.action = url;
|
form.action = url;
|
||||||
form.plan.value = JSON.stringify(plan);
|
form.plan.value = JSON.stringify(plan);
|
||||||
/*form.plan = '{"contentTitle":"2023년 3월 계획보고서 수정3","planDt":"2023-03-01","wrtOrgan":"서해청 ","wrtPart":"","wrtUserGrd":"경위 ","wrtUserNm":"사용자002","planInfoSummery":[{"planInfo":"계획1"},{"planInfo":"계획2"}],"planInfoDetail":[{"planInfo":"계획1\\r\\n - ㅁㄴㅇㄻㄴㅇㄻㄴㅇㄻㄴㅇㄻㄴㅇㄹ\\r\\n - ㅁㄴㅇㄻㄴㅇㄻㄴㄹㅇ\\r\\n - ㅁㄴㅇㄻㄴㅇㄹ"},{"planInfo":"계획2\\r\\n - ㅂㅈㄷㄱㅂㅈㄷㄱㅂㅈㄷㄱ\\r\\n - ㅂㅈㄷㄱㅂㅈㄷㄱㅂㅈㄷㄱ\\r\\n - ㅂㅈㄷㄱㅂㅈㄷㄱ\\r\\n - ㅂㅈㄷㄱ\\r\\n - ㅂㅈㄷㄱ"}],"fileList":[{"origNm":"IMG_20211114_134753"},{"origNm":"IMG_20211114_144306"},{"origNm":"IMG_20211114_144707"}]}'*/
|
|
||||||
form.method = "post";
|
form.method = "post";
|
||||||
form.submit();
|
form.submit();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -307,5 +307,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="d-none">
|
||||||
|
<form id="printForm">
|
||||||
|
<input type="hidden" name="affair">
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -333,7 +333,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer bg-light">
|
<div class="modal-footer bg-light">
|
||||||
<button type="button" class="btn btn-secondary" id="printBtn" th:data-affairkey="${affair.affairKey}">인쇄</button>
|
<th:block th:if="${affair.affairStatus eq 'DST006'}">
|
||||||
|
<button type="button" class="btn btn-secondary" id="printBtn" th:data-affairkey="${affair.affairKey}">인쇄</button>
|
||||||
|
</th:block>
|
||||||
<th:block th:if="${userOrgan eq 'OG001' and accessAuth eq 'ACC003'}">
|
<th:block th:if="${userOrgan eq 'OG001' and accessAuth eq 'ACC003'}">
|
||||||
<!--본청 관리자 상시 수정 허용-->
|
<!--본청 관리자 상시 수정 허용-->
|
||||||
<button type="button" class="btn btn-warning" id="modifyRatingViewBtn">결재정보수정</button>
|
<button type="button" class="btn btn-warning" id="modifyRatingViewBtn">결재정보수정</button>
|
||||||
|
|
|
||||||
|
|
@ -194,5 +194,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="d-none">
|
||||||
|
<form id="printForm">
|
||||||
|
<input type="hidden" name="plan">
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -164,12 +164,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer bg-light">
|
<div class="modal-footer bg-light">
|
||||||
<div class="d-none">
|
<th:block th:if="${plan.planState eq 'DST006'}">
|
||||||
<form id="printForm">
|
<button type="button" class="btn btn-secondary" id="printBtn" th:data-plankey="${plan.planKey}">인쇄</button>
|
||||||
<input type="hidden" name="plan">
|
</th:block>
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<button type="button" class="btn btn-secondary" id="printBtn" th:data-plankey="${plan.planKey}">인쇄</button>
|
|
||||||
<th:block th:unless="${plan.planState eq 'DST004' or plan.planState eq 'DST006'}"><!--승인 상태일때는 수정 불가-->
|
<th:block th:unless="${plan.planState eq 'DST004' or plan.planState eq 'DST006'}"><!--승인 상태일때는 수정 불가-->
|
||||||
<th:block th:if="${userSeq eq plan.wrtUserSeq or accessAuth eq 'ACC003'}"><!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용-->
|
<th:block th:if="${userSeq eq plan.wrtUserSeq or accessAuth eq 'ACC003'}"><!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용-->
|
||||||
<button type="button" class="btn btn-warning" id="editPlanBtn">수정</button>
|
<button type="button" class="btn btn-warning" id="editPlanBtn">수정</button>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue