외사활동 인쇄기능 작업중.

master
강석 최 2023-07-05 18:24:10 +09:00
parent de34ecd775
commit e0cc1e7413
4 changed files with 75 additions and 0 deletions

View File

@ -5,13 +5,16 @@ import com.dbnt.faisp.main.codeMgt.service.CodeMgtService;
import com.dbnt.faisp.main.counterIntelligence.activityCase.model.*; import com.dbnt.faisp.main.counterIntelligence.activityCase.model.*;
import com.dbnt.faisp.main.counterIntelligence.activityCase.service.ActivityCaseService; import com.dbnt.faisp.main.counterIntelligence.activityCase.service.ActivityCaseService;
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 java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@ -108,6 +111,14 @@ public class ActivityCaseController {
mav.addObject("accessAuth", accessAuth); mav.addObject("accessAuth", accessAuth);
mav.addObject("activityCase", activityCase); mav.addObject("activityCase", activityCase);
mav.addObject("activityCaseInfo", activityCaseInfo); mav.addObject("activityCaseInfo", activityCaseInfo);
boolean printFlag = false;
for(ActivityCaseApprv apprv: activityCaseInfo.getApprvList()){
if((!Utils.isEmpty(apprv.getApprvYn()) && apprv.getApprvYn().equals("Y"))
&& (!Utils.isEmpty(apprv.getApprvType()) && !apprv.getApprvType().equals("ACAT001"))){
printFlag = true;
}
}
mav.addObject("printFlag", printFlag);
return mav; return mav;
} }
@ -159,4 +170,14 @@ public class ActivityCaseController {
mav.addObject("searchParams", activityCase); mav.addObject("searchParams", activityCase);
return mav; return mav;
} }
@GetMapping("/activityCasePrint")
public Map<String, Object> activityCasePrint(ActivityCaseInfo info){
info = activityCaseService.selectActivityCaseInfo(info.getCaseKey());
ActivityCase activityCase = activityCaseService.selectActivityCase(info.getReceiptKey());
Map<String, Object> map = new HashMap<>();
map.put("activityCase", activityCase);
map.put("activityCaseInfo", info);
return map;
}
} }

View File

@ -97,6 +97,7 @@
count(*) as reportCnt, count(*) as reportCnt,
max(case_key) as case_key max(case_key) as case_key
from activity_case_info from activity_case_info
where status &lt;> 'DST008'
group by receipt_key group by receipt_key
) b on a.receipt_key = b.receipt_key ) b on a.receipt_key = b.receipt_key
inner join activity_case_info c inner join activity_case_info c

View File

@ -89,6 +89,48 @@ $(document).on('click', '.apprvBtn', function (){
setApprvResult($("#activityCaseViewModalBody").find("#caseKey").val(), apprvRow.find(".apprvUserSeq").val(), apprvRow.find(".instructions").val(), apprvValue); setApprvResult($("#activityCaseViewModalBody").find("#caseKey").val(), apprvRow.find(".apprvUserSeq").val(), apprvRow.find(".instructions").val(), apprvValue);
} }
}) })
$(document).on('click', '#printInfoBtn', function (){
$.ajax({
url: '/counterIntelligence/activityCasePrint',
type: 'GET',
data: {caseKey: $("#activityCaseViewModalBody").find('#caseKey').val()},
dataType:"json",
success: function(data){
const activityCase = makeActivityCasePrintData(data);
const url = $("#printUrl").attr("data-printurl")+"/singlePrint.jsp";
const status = "width=900px,height=800px,scrollbars=yes";
const form = $("#printForm")[0];
let title = "";
switch(data.caseType){
case "ACT001":
title = "청산보고서 인쇄";
form.crfName.value = "activityCase1";
break;
case "ACT002":
title = "진행보고서 인쇄";
form.crfName.value = "activityCase2";
break;
case "ACT003":
title = "결과보고서 인쇄";
form.crfName.value = "activityCase3";
break;
}
window.open("", title, status);
form.target = title;
form.action = url;
form.json.value = JSON.stringify(activityCase);
form.method = "post";
form.submit();
},
error:function(e){
ajaxErrorAction(e);
}
});
})
function getActivityCaseEditModal(receiptKey, caseKey, caseType){ function getActivityCaseEditModal(receiptKey, caseKey, caseType){
$.ajax({ $.ajax({
url: '/counterIntelligence/activityCaseEditModal', url: '/counterIntelligence/activityCaseEditModal',
@ -322,3 +364,11 @@ function contentCheck(){
} }
return true; return true;
} }
function makeActivityCasePrintData(data){
const activityCase = {
}
return activityCase;
}

View File

@ -193,6 +193,9 @@
</div> </div>
<th:block th:if="${modalType ne 'viewOnly'}"> <th:block th:if="${modalType ne 'viewOnly'}">
<div class="modal-footer bg-light"> <div class="modal-footer bg-light">
<th:block th:if="${printFlag}">
<button type="button" class="btn btn-secondary" id="printInfoBtn">인쇄</button>
</th:block>
<th:block th:if="${viewUserSeq eq activityCase.wrtUserSeq}"> <th:block th:if="${viewUserSeq eq activityCase.wrtUserSeq}">
<button type="button" class="btn btn-danger" id="deleteInfoBtn">삭제</button> <button type="button" class="btn btn-danger" id="deleteInfoBtn">삭제</button>
</th:block> </th:block>