외사활동 인쇄기능 작업중.
parent
de34ecd775
commit
e0cc1e7413
|
|
@ -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.service.ActivityCaseService;
|
||||
import com.dbnt.faisp.main.userInfo.model.UserInfo;
|
||||
import com.dbnt.faisp.util.Utils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
|
|
@ -108,6 +111,14 @@ public class ActivityCaseController {
|
|||
mav.addObject("accessAuth", accessAuth);
|
||||
mav.addObject("activityCase", activityCase);
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
@ -159,4 +170,14 @@ public class ActivityCaseController {
|
|||
mav.addObject("searchParams", activityCase);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@
|
|||
count(*) as reportCnt,
|
||||
max(case_key) as case_key
|
||||
from activity_case_info
|
||||
where status <> 'DST008'
|
||||
group by receipt_key
|
||||
) b on a.receipt_key = b.receipt_key
|
||||
inner join activity_case_info c
|
||||
|
|
|
|||
|
|
@ -89,6 +89,48 @@ $(document).on('click', '.apprvBtn', function (){
|
|||
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){
|
||||
$.ajax({
|
||||
url: '/counterIntelligence/activityCaseEditModal',
|
||||
|
|
@ -322,3 +364,11 @@ function contentCheck(){
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function makeActivityCasePrintData(data){
|
||||
const activityCase = {
|
||||
|
||||
}
|
||||
return activityCase;
|
||||
}
|
||||
|
|
@ -193,6 +193,9 @@
|
|||
</div>
|
||||
<th:block th:if="${modalType ne 'viewOnly'}">
|
||||
<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}">
|
||||
<button type="button" class="btn btn-danger" id="deleteInfoBtn">삭제</button>
|
||||
</th:block>
|
||||
|
|
|
|||
Loading…
Reference in New Issue