첩보수집활동 리포팅툴 작업.
parent
1041ca0e63
commit
d473c1972d
|
|
@ -1,23 +1,24 @@
|
||||||
package com.dbnt.faisp.main.fpiMgt.affairResult;
|
package com.dbnt.faisp.main.fpiMgt.affairResult;
|
||||||
|
|
||||||
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.service.AffairService;
|
import com.dbnt.faisp.main.fpiMgt.affair.service.AffairService;
|
||||||
import com.dbnt.faisp.main.fpiMgt.affairResult.model.ResultApprv;
|
import com.dbnt.faisp.main.fpiMgt.affairResult.model.*;
|
||||||
import com.dbnt.faisp.main.fpiMgt.affairResult.model.ResultBoard;
|
|
||||||
import com.dbnt.faisp.main.fpiMgt.affairResult.model.ClearInfo;
|
|
||||||
import com.dbnt.faisp.main.fpiMgt.affairResult.model.ResultInfo;
|
|
||||||
import com.dbnt.faisp.main.fpiMgt.affairResult.service.ResultService;
|
import com.dbnt.faisp.main.fpiMgt.affairResult.service.ResultService;
|
||||||
import com.dbnt.faisp.main.userInfo.model.UserInfo;
|
import com.dbnt.faisp.main.userInfo.model.UserInfo;
|
||||||
|
import com.dbnt.faisp.util.Utils;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
|
@ -170,6 +171,7 @@ public class ResultController { // 첩보수집활동 > 외사경찰 견문관
|
||||||
resultBoard.setWrtOrgan(loginUser.getOgCd());
|
resultBoard.setWrtOrgan(loginUser.getOgCd());
|
||||||
resultBoard.setWrtPart(loginUser.getOfcCd());
|
resultBoard.setWrtPart(loginUser.getOfcCd());
|
||||||
resultBoard.setWrtUserSeq(loginUser.getUserSeq());
|
resultBoard.setWrtUserSeq(loginUser.getUserSeq());
|
||||||
|
resultBoard.setWrtUserGrd(loginUser.getTitleCd());
|
||||||
resultBoard.setWrtUserNm(loginUser.getUserNm());
|
resultBoard.setWrtUserNm(loginUser.getUserNm());
|
||||||
resultBoard.setWrtDt(LocalDateTime.now());
|
resultBoard.setWrtDt(LocalDateTime.now());
|
||||||
}
|
}
|
||||||
|
|
@ -237,4 +239,31 @@ public class ResultController { // 첩보수집활동 > 외사경찰 견문관
|
||||||
mav.addObject("info", info);
|
mav.addObject("info", info);
|
||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/resultBoardJson")
|
||||||
|
public ResultBoard resultBoardJson(ResultBoard resultBoard, HttpSession session){
|
||||||
|
Map<String, List<CodeMgt>> codeMap = (Map<String, List<CodeMgt>>) session.getAttribute("commonCode");
|
||||||
|
resultBoard = resultService.selectResultBoard(resultBoard.getResultKey());
|
||||||
|
resultBoard.setWrtPart(Utils.searchCodeValue(resultBoard.getWrtPart(), codeMap.get(resultBoard.getWrtOrgan())));
|
||||||
|
resultBoard.setWrtOrgan(Utils.searchCodeValue(resultBoard.getWrtOrgan(), codeMap.get("OG")));
|
||||||
|
resultBoard.setWrtUserGrd(Utils.searchCodeValue(resultBoard.getWrtUserGrd(), codeMap.get("JT")));
|
||||||
|
for(ClearInfo info: resultBoard.getClearInfoList()){
|
||||||
|
info.setUseCatg(Utils.searchCodeValue(info.getUseCatg(), codeMap.get("RIC")));
|
||||||
|
info.setUseDetail(Utils.searchCodeValue(info.getUseDetail(), codeMap.get("RID")));
|
||||||
|
}
|
||||||
|
for(ResultApprv apprv: resultBoard.getApprvList()){
|
||||||
|
if(apprv.getState().equals("DST004")){
|
||||||
|
resultBoard.setSectionApprv(apprv.getUserNm());
|
||||||
|
}else if(apprv.getState().equals("DST006")){
|
||||||
|
resultBoard.setHeadApprv(apprv.getUserNm());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(AffairBoard affair: resultBoard.getAffairBoardList()){
|
||||||
|
affair.setAffairRate(Utils.searchCodeValue(affair.getAffairRate(), codeMap.get("AAR"))+(affair.getOrganUp().equals("T")?"(상보)":""));
|
||||||
|
}
|
||||||
|
for(ResultFile file: resultBoard.getFileList()){
|
||||||
|
file.setOrigNm(file.getOrigNm()+"."+file.getFileExtn());
|
||||||
|
}
|
||||||
|
return resultBoard;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,4 +88,9 @@ public class ResultBoard extends BaseModel {
|
||||||
private List<ResultToAffair> affairList;
|
private List<ResultToAffair> affairList;
|
||||||
@Transient
|
@Transient
|
||||||
private List<AffairBoard> affairBoardList;
|
private List<AffairBoard> affairBoardList;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
private String sectionApprv;
|
||||||
|
@Transient
|
||||||
|
private String headApprv;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -233,14 +233,15 @@ $(document).on('click', '#printBtn', function (){
|
||||||
data: {affairKey: $(this).attr('data-affairkey')},
|
data: {affairKey: $(this).attr('data-affairkey')},
|
||||||
dataType:"json",
|
dataType:"json",
|
||||||
success: function(data){
|
success: function(data){
|
||||||
var url = $("#printUrl").attr("data-printurl")+"/affairBoard.jsp";
|
var url = $("#printUrl").attr("data-printurl")+"/singlePrint.jsp";
|
||||||
var title = "견문 보고서 인쇄";
|
var title = "견문 보고서 인쇄";
|
||||||
var status = "width=900px,height=800px,scrollbars=yes";
|
var status = "width=900px,height=800px,scrollbars=yes";
|
||||||
window.open("", title, status);
|
window.open("", title, status);
|
||||||
const form = $("#printForm")[0];
|
const form = $("#printForm")[0];
|
||||||
form.target = title;
|
form.target = title;
|
||||||
form.action = url;
|
form.action = url;
|
||||||
form.affair.value = JSON.stringify(data);
|
form.crfName.value = "affairBoard";
|
||||||
|
form.json.value = JSON.stringify(data);
|
||||||
form.method = "post";
|
form.method = "post";
|
||||||
form.submit();
|
form.submit();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -149,14 +149,15 @@ $(document).on('click', '#printBtn', function (){
|
||||||
}
|
}
|
||||||
plan.fileList = fileList;
|
plan.fileList = fileList;
|
||||||
|
|
||||||
var url = $("#printUrl").attr("data-printurl")+"/planBoard.jsp";
|
var url = $("#printUrl").attr("data-printurl")+"/singlePrint.jsp";
|
||||||
var title = "계획 보고서 인쇄";
|
var title = "계획 보고서 인쇄";
|
||||||
var status = "width=900px,height=800px,scrollbars=yes";
|
var status = "width=900px,height=800px,scrollbars=yes";
|
||||||
window.open("", title, status);
|
window.open("", title, status);
|
||||||
const form = $("#printForm")[0];
|
const form = $("#printForm")[0];
|
||||||
form.target = title;
|
form.target = title;
|
||||||
form.action = url;
|
form.action = url;
|
||||||
form.plan.value = JSON.stringify(plan);
|
form.crfName.value = "planBoard";
|
||||||
|
form.json.value = JSON.stringify(plan);
|
||||||
form.method = "post";
|
form.method = "post";
|
||||||
form.submit();
|
form.submit();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -203,14 +203,20 @@ $(document).on('click', '#printBtn', function (){
|
||||||
data: {resultKey: $(this).attr('data-resultkey')},
|
data: {resultKey: $(this).attr('data-resultkey')},
|
||||||
dataType:"json",
|
dataType:"json",
|
||||||
success: function(data){
|
success: function(data){
|
||||||
var url = $("#printUrl").attr("data-printurl")+"/resultBoard.jsp";
|
data.planPrice = priceNumberToKorean(data.planPrice);
|
||||||
|
data.usePrice = priceNumberToKorean(data.usePrice);
|
||||||
|
for(let i=0; i<data.clearInfoList.length; i++){
|
||||||
|
data.clearInfoList[i].price = "₩ "+data.clearInfoList[i].price.toLocaleString('ko-KR')
|
||||||
|
}
|
||||||
|
var url = $("#printUrl").attr("data-printurl")+"/singlePrint.jsp";
|
||||||
var title = "청산 보고서 인쇄";
|
var title = "청산 보고서 인쇄";
|
||||||
var status = "width=900px,height=800px,scrollbars=yes";
|
var status = "width=900px,height=800px,scrollbars=yes";
|
||||||
window.open("", title, status);
|
window.open("", title, status);
|
||||||
const form = $("#printForm")[0];
|
const form = $("#printForm")[0];
|
||||||
form.target = title;
|
form.target = title;
|
||||||
form.action = url;
|
form.action = url;
|
||||||
form.result.value = JSON.stringify(data);
|
form.crfName.value = "resultBoard";
|
||||||
|
form.json.value = JSON.stringify(data);
|
||||||
form.method = "post";
|
form.method = "post";
|
||||||
form.submit();
|
form.submit();
|
||||||
},
|
},
|
||||||
|
|
@ -220,6 +226,31 @@ $(document).on('click', '#printBtn', function (){
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function priceNumberToKorean(price){
|
||||||
|
const koreanNumber = ['', '일','이','삼','사','오','육','칠','팔','구'];
|
||||||
|
const tenThousandUnit = ['', '만', '억', '조'];
|
||||||
|
const tenUnit = ['', '십', '백', '천'];
|
||||||
|
var answer = '';
|
||||||
|
var unit = 10000;
|
||||||
|
var index = 0;
|
||||||
|
var division = Math.pow(unit, index);
|
||||||
|
|
||||||
|
while (Math.floor(price / division) > 0) {
|
||||||
|
const mod = Math.floor(price % (division * unit) / division);
|
||||||
|
if(mod) {
|
||||||
|
const modToArray = mod.toString().split('');
|
||||||
|
const modLength = modToArray.length - 1;
|
||||||
|
const toKorean = modToArray.reduce((a, v, i) => {
|
||||||
|
a+= `${koreanNumber[v*1]}${tenUnit[modLength - i]}`;
|
||||||
|
return a;
|
||||||
|
}, '');
|
||||||
|
answer = `${toKorean}${tenThousandUnit[index]} `+ answer;
|
||||||
|
}
|
||||||
|
division = Math.pow(unit, ++index);
|
||||||
|
}
|
||||||
|
return "壹金 "+answer+"원 整 (₩ "+price.toLocaleString('ko-KR')+")";
|
||||||
|
}
|
||||||
|
|
||||||
function getResultViewModal(resultKey){
|
function getResultViewModal(resultKey){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/affairResult/resultViewModal',
|
url: '/affairResult/resultViewModal',
|
||||||
|
|
|
||||||
|
|
@ -309,7 +309,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="d-none">
|
<div class="d-none">
|
||||||
<form id="printForm">
|
<form id="printForm">
|
||||||
<input type="hidden" name="affair">
|
<input type="hidden" name="crfName">
|
||||||
|
<input type="hidden" name="json">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="d-none">
|
<div class="d-none">
|
||||||
<form id="printForm">
|
<form id="printForm">
|
||||||
<input type="hidden" name="plan">
|
<input type="hidden" name="crfName">
|
||||||
|
<input type="hidden" name="json">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
<input type="hidden" name="resultKey" th:value="${result.resultKey}">
|
<input type="hidden" name="resultKey" th:value="${result.resultKey}">
|
||||||
<input type="hidden" name="wrtOrgan" th:value="${result.wrtOrgan}">
|
<input type="hidden" name="wrtOrgan" th:value="${result.wrtOrgan}">
|
||||||
<input type="hidden" name="wrtPart" th:value="${result.wrtPart}">
|
<input type="hidden" name="wrtPart" th:value="${result.wrtPart}">
|
||||||
|
<input type="hidden" name="wrtUserGrd" th:value="${result.wrtUserGrd}">
|
||||||
<input type="hidden" name="wrtUserSeq" th:value="${result.wrtUserSeq}">
|
<input type="hidden" name="wrtUserSeq" th:value="${result.wrtUserSeq}">
|
||||||
<input type="hidden" name="resultState" id="resultState" th:value="${result.resultState}">
|
<input type="hidden" name="resultState" id="resultState" th:value="${result.resultState}">
|
||||||
<ul class="nav nav-tabs" id="userTab" role="tablist">
|
<ul class="nav nav-tabs" id="userTab" role="tablist">
|
||||||
|
|
|
||||||
|
|
@ -200,9 +200,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="d-none">
|
<div class="d-none">
|
||||||
<form id="printForm">
|
<form id="printForm">
|
||||||
<input type="hidden" name="planList">
|
<input type="hidden" name="crfName">
|
||||||
<input type="hidden" name="affairList">
|
<input type="hidden" name="json">
|
||||||
<input type="hidden" name="result">
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -260,7 +260,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer bg-light">
|
<div class="modal-footer bg-light">
|
||||||
<th:block th:if="${result.resultState eq 'DST006'}">
|
<th:block th:if="${result.resultState eq 'DST006'}">
|
||||||
<button type="button" class="btn btn-secondary" id="printBtn" th:data-affairkey="${result.resultKey}">인쇄</button>
|
<button type="button" class="btn btn-secondary" id="printBundleBtn" th:data-resultkey="${result.resultKey}">묶음인쇄</button>
|
||||||
|
<button type="button" class="btn btn-secondary" id="printBtn" th:data-resultkey="${result.resultKey}">개별인쇄</button>
|
||||||
</th:block>
|
</th:block>
|
||||||
<th:block th:unless="${result.resultState eq 'DST004' or result.resultState eq 'DST006'}"><!--승인 상태일때는 수정 불가-->
|
<th:block th:unless="${result.resultState eq 'DST004' or result.resultState eq 'DST006'}"><!--승인 상태일때는 수정 불가-->
|
||||||
<th:block th:if="${userSeq eq result.wrtUserSeq or accessAuth eq 'ACC003'}"><!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용-->
|
<th:block th:if="${userSeq eq result.wrtUserSeq or accessAuth eq 'ACC003'}"><!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용-->
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue