This commit is contained in:
myname 2022-12-09 09:20:53 +09:00
commit b4df46944e
10 changed files with 245 additions and 34 deletions

View File

@ -88,7 +88,7 @@ public class LoggerAspect {
logBuffer.append("└ [●●●●●●●●●●●●●●●●●●●●●●●●●●●●]");
log.info(logBuffer.toString(), logList.toArray());
System.out.println("Throwable Log ::: ");
System.out.println("Throwable Log ::: "+ throwable.toString());
throw throwable;
}
}

View File

@ -34,6 +34,8 @@ import com.epapyrus.pdf.pg.entity.BookMarkPage;
import com.epapyrus.pdf.pg.entity.Merge;
import com.epapyrus.pdf.pg.entity.PdfConversion;
import com.epapyrus.pdf.pg.entity.TextWatermark;
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
import kcc.com.cmm.service.EgovFileMngService;
import kcc.com.cmm.service.FileVO;
@ -1250,6 +1252,85 @@ public class AdjstReqStatusPdfController {
return modelAndView;
}
/**
* 종결사건 단권화 파일 다운르도
*/
@RequestMapping(value = "/kccadr/adjPgrMgr/apm/regStreamDocsAPI.do")
public ModelAndView regStreamDocsAPI(PdfConversionVO pdfConversionVO) {
ModelAndView modelAndView = new ModelAndView("jsonView");
// String accessToken = "eyJjdHkiOiJKV1QiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiZGlyIn0..wPlmcQ9_3F7DIUi--a5CYg.svTX0D57aaST4tDmDAmd4jXk_sAac491b51VLn49OJwT5__ytx_T4Z1Jt3qX-HY1sQS3xqaBqt9JmTyyKXSCDrai4dNnirNRHj-_tu2loFZiPNEm7oXaH50eZkU_uJQOVwvN1Zxct_MotJOOwoAI1xEIBiMCA3CjFFgbW3PEIZnCmp-Tjv1TJuVumBOgfQgCwzcNYr30EMKg6Go7ECsxkBxldFy52a7YGzMkdj6_qv0.Ez6gSV4sNmBnW1gx7U8TKw";
//alert 메세지
//결과 flag
try {
PdfConversionVO tmpPdfConversionVO = pdfConversionService.selectConversionPdf(pdfConversionVO);
/*
String request = "http://192.168.0.176:8085/streamdocs/v4/auth";
String queryParam = "?id=admin&password=streamdocs-admin";
String apiURL = request + queryParam;
HttpResponse<String> response = Unirest.post(apiURL)
.asString();
System.out.println("응답코드 : " + response.getStatus());
System.out.println("response : " + response.getBody());
*/
try {
File uFile = new File(pdfMakepathOut + tmpPdfConversionVO.getAdrSeq() +"/result/", "bookmark.pdf");
String requestUrl="http://192.168.0.176:8085/streamdocs/v4/documents";
HttpResponse<String> response=Unirest.post(requestUrl)
.field("pdf", pdfMakepathOut + tmpPdfConversionVO.getAdrSeq() +"/result/", "bookmark.pdf")
.field("name","sample.pdf")
.field("docName","singleDocsample.pdf")
.field("lifespan","1M")
.field("category","singleDocTest")
.field("description","singleDocSample")
.field("password","1234")
.field("save",false)
.asString();
/*
String requestUrl="http://192.168.0.176:8085/streamdocs/v4/documents/external-resources";
String filePath = pdfMakepathOut + tmpPdfConversionVO.getAdrSeq() +"/result/bookmark.pdf";
HttpResponse<String> response = Unirest.post(requestUrl)
.header("Content-Type", "application/json")
.body("{\"externalResource\":\"file:/"+filePath+"\"}")
.asString();
System.out.println("filePath : "+ filePath);
*/
System.out.println("!!!!!");
System.out.println(response.getStatus());
System.out.println(response.getBody());
} catch (Exception e) {
System.out.println("Exception ");
e.printStackTrace();
// TODO: handle exception
}
modelAndView.addObject("result", "success");
// modelAndView.addObject("data", response);
modelAndView.addObject("message", "성공");
}catch (Exception e) {
e.printStackTrace();
System.out.println(e.getMessage());
modelAndView.addObject("result", "fail");
modelAndView.addObject("message", "요청에 실패하였습니다.");
}
return modelAndView;
}

View File

@ -640,8 +640,8 @@ public class SMSOracleServiceImpl extends EgovAbstractServiceImpl implements SM
KakaoAtSendVO apiVO = new KakaoAtSendVO();
//msgTy별 템플릿 코드 가져오기
String msgTy = (String) map.get("msgTy");
String templateCode = msgMgrDAO.selectMsgMgrTemplateCode(msgTy);
String smsTy = (String) map.get("smsTy");
String templateCode = msgMgrDAO.selectMsgMgrTemplateCode(smsTy);
apiVO.setSendTo(rpplPhone);
apiVO.setTemplateCode(templateCode);

View File

@ -1,17 +1,23 @@
package kcc.kccadr.message;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Enumeration;
import java.util.List;
import javax.annotation.Resource;
import javax.sql.DataSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import kcc.com.cmm.aspect.LoggerAspect;
import kcc.kccadr.message.service.KakaoAtSendService;
import kcc.kccadr.message.service.KakaoAtSendVO;
import kcc.kccadr.message.web.KakaoAtSendAPI;
@ -24,8 +30,11 @@ import net.javacrumbs.shedlock.spring.annotation.EnableSchedulerLock;
@Service("SchedulerUtil")
@EnableScheduling
@EnableSchedulerLock(defaultLockAtMostFor = "PT30S") // Scheduler Lock 사용 가능 설정 (기본 30초동안 Lock)
//@EnableSchedulerLock(defaultLockAtMostFor = "PT1M") // Scheduler Lock 사용 가능 설정
public class SchedulerUtil {
private static final Logger log = LoggerFactory.getLogger(LoggerAspect.class);
@Value("#{globalSettings['Globals.BizPpurio.siteUrl']}")
private String apiUrl;
@ -40,27 +49,56 @@ public class SchedulerUtil {
//로컬 테스트용 아이피 허용
private String myLocalIp = "192.168.0.40";
//개발서버 테스트용 아이피 허용
private String devIp = "119.193.215.98";
//개발서버 테스트용 아이피 허용(외부)
private String devOutIp = "119.193.215.98";
//개발서버 테스트용 아이피 허용(내부)
private String devInIp = "119.193.215.98";
//운영 외부망 WAS1
private String dmzIp1 = "222.231.43.66";
//운영 외부망 WAS2
private String dmzIp2 = "222.231.43.69";
private String containerIp = "172.25.0.2";
//10분마다 실행
@Scheduled(cron = "0 0/10 * * * *")
@SchedulerLock(name = "kakaoAtSendPrcs", lockAtMostForString = ONE_MIN, lockAtLeastForString = ONE_MIN)
// @Scheduled(cron = "0 0/1 * * * *")
//1분마다 실행
@Scheduled(cron = "0 0/1 * * * *")
// @SchedulerLock(name = "kakaoAtSendPrcs", lockAtMostForString = ONE_MIN, lockAtLeastForString = ONE_MIN)
public void kakaoAtSendPrcs() throws Exception {
String ip = null;
System.out.println("===========at scheduler run============");
log.error("===========at scheduler run============");
String hostAddr = null;
//모든 OS에서 서버 고정 IP를 가져오기
try {
Enumeration<NetworkInterface> nienum = NetworkInterface.getNetworkInterfaces();
while (nienum.hasMoreElements()) {
NetworkInterface ni = nienum.nextElement();
Enumeration<InetAddress> kk= ni.getInetAddresses();
while (kk.hasMoreElements()) {
InetAddress inetAddress = kk.nextElement();
if (!inetAddress.isLoopbackAddress() &&
!inetAddress.isLinkLocalAddress() &&
inetAddress.isSiteLocalAddress()) {
hostAddr = inetAddress.getHostAddress().toString();
}
}
}
} catch (SocketException e) {
e.printStackTrace();
}
try {
ip = InetAddress.getLocalHost().getHostAddress();
System.out.println("===========at scheduler run============");
System.out.println("server ip ============" + ip);
if(ip.equals(myLocalIp) || ip.equals(devIp) || ip.equals(dmzIp1) || ip.equals(dmzIp2) ) {
System.out.println("server ip ============" + hostAddr);
log.error("server ip ============" + hostAddr);
// if(hostAddr.equals(myLocalIp) || hostAddr.equals(devOutIp) || hostAddr.equals(devInIp) || hostAddr.equals(dmzIp1) || hostAddr.equals(dmzIp2) || hostAddr.equals(containerIp) ) {
if(hostAddr.equals(containerIp) ) {
//접속 서버 분기처리 필요
List<KakaoAtSendVO> list = kakaoAtSendService.selectKakaoAtList();
@ -79,13 +117,15 @@ public class SchedulerUtil {
}
}
System.out.println("===========at scheduler finish============");
} catch (Exception e) {
System.out.println(e.getMessage());
}
System.out.println("===========at scheduler finish============");
log.error("===========at scheduler finish============");
}
@Bean

View File

@ -32,8 +32,8 @@ public class MsgMgrDAO extends EgovAbstractDAO {
}
//발송유형별 알림톡 템플릿 코드 가져오기
public String selectMsgMgrTemplateCode(String msgTy) throws Exception{
return (String) select("MsgMgrDAO.selectMsgMgrTemplateCode", msgTy);
public String selectMsgMgrTemplateCode(String smsTy) throws Exception{
return (String) select("MsgMgrDAO.selectMsgMgrTemplateCode", smsTy);
}

View File

@ -205,6 +205,6 @@ Globals.Kakao.Key=bf3de0d897afe0e4bef0775f7086f048
# \uce74\uce74\uc624\uc54c\ub9bc\ud1a1(\ube44\uc988\ubfcc\ub9ac\uc624) API URL
#\uac1c\ubc1c\uc11c\ubc84
#Globals.BizPpurio.siteUrl=https://dev-api.bizppurio.com
Globals.BizPpurio.siteUrl=https://dev-api.bizppurio.com
#\uc2e4\uc11c\ubc84
Globals.BizPpurio.siteUrl=https://api.bizppurio.com
#Globals.BizPpurio.siteUrl=https://api.bizppurio.com

View File

@ -75,7 +75,7 @@
TEMPLATE_CODE AS templateCode
FROM
ADR_MSG_MGR
WHERE MSG_TY = #msgTy#
WHERE MSG_TY = #smsTy#
</select>

View File

@ -74,8 +74,11 @@
commonPopWindowopenForm("/kccadr/adjPgrMgr/apm/popup/docRegPop.do" , "750", "550", "docRegPop", $("#pop"));
}
// DB 데이터 확인
function fnc_is_prcs_finish(){
var data = new FormData(document.getElementById("pop"))
var data = new FormData(document.getElementById("pop"));
console.log("data : ", data);
$.ajax({
type: "POST",
@ -102,12 +105,51 @@
error: function (e) {console.log("ERROR : ", e); }
});
}
// Pdf 뷰어솔루션
function fn_reg_streamDocs(){
var data = new FormData(document.getElementById("pop"));
console.log("data : ", data);
$.ajax({
type: "POST",
url: "/kccadr/adjPgrMgr/apm/regStreamDocsAPI.do",
data: data,
dataType:'json',
async: false,
processData: false,
contentType: false,
cache: false,
success: function (returnData, status) {
console.log('returnData : ', returnData);
// console.log('returnData : ', returnData.result);
if(returnData.result == 'success'){
// fn_read_streamDocs()();
}else{
alert(returnData.message);
}
},
error: function (e) {console.log("ERROR : ", e); }
});
}
function fnc_download_endFile(){
var adrSeq = document.pop.adrSeq.value;
window.open("<c:url value='/kccadr/adjPgrMgr/apm/adrEndPdfConversionDownload.do?adrSeq=" + adrSeq + "'/>");
}
function fn_read_streamDocs(){
var adrSeq = document.pop.adrSeq.value;
window.open("http://192.168.0.176:8085/streamdocs/view/sd;streamdocsId=-Q_zRU0tisIOGyXPQpUgZvES1CSm7zhp78sXUx_y11Q");
}
// function fn_viewPop(code) {
// console.log('code : ', code);
@ -136,9 +178,9 @@
</head>
<body>
<form id="pop" name="pop" method="post">
<input type="hidden" name="atchFileId" id="atchFileId" value="">
</form>
<%-- <form id="pop" name="pop" method="post"> --%>
<!-- <input type="hidden" name="atchFileId" id="atchFileId" value=""> -->
<%-- </form> --%>
<div class="mask" onclick="layerPopToggle();"></div>
@ -312,6 +354,7 @@
<button type="button" class="btnType02" onclick="fnc_view_download_step_1(); return false;">선택다운로드</button>
<%-- <button type="button" class="btnType02" onclick="fncDocRegPopup(); return false;">답변서 등록</button> --%>
<button type="button" class="btnType02" onclick="fncDocRegPopup(); return false;">문서 등록</button>
<!-- <button type="button" class="btnType02" onclick="fn_reg_streamDocs()(); return false;">종결 문건 단권화파일 다운로드</button> -->
<button type="button" class="btnType02" onclick="fnc_is_prcs_finish(); return false;">종결 문건 단권화파일 다운로드</button>
</div>
<!-- <div class="area_right">

View File

@ -72,12 +72,33 @@
$('#rppl01Email1').val(splEmail01[0]);
$('#rppl01Email2').val(splEmail01[1]);
var splPhone01 = [];
splPhone01 = rppl01Phone.split("-");
$('#rppl01Phone1').val(splPhone01[0]);
$('#rppl01Phone2').val(splPhone01[1]);
$('#rppl01Phone3').val(splPhone01[2]);
// 10이면 지역번호
if(rppl01Phone.indexOf('-') > -1)
{
var splPhone01 = [];
splPhone01 = rppl01Phone.split("-");
$('#rppl01Phone1').val(splPhone01[0]);
$('#rppl01Phone2').val(splPhone01[1]);
$('#rppl01Phone3').val(splPhone01[2]);
}
else if(rppl01Phone.length == 10)
{
$('#rppl01Phone1').val(rppl01Phone.substring(0, 2));
$('#rppl01Phone2').val(rppl01Phone.substring(2, 6));
$('#rppl01Phone3').val(rppl01Phone.substring(6, 10));
}
else
{
$('#rppl01Phone1').val(rppl01Phone.substring(0, 3));
$('#rppl01Phone2').val(rppl01Phone.substring(3, 7));
$('#rppl01Phone3').val(rppl01Phone.substring(7, 11));
}
//피신청인 화면 처리해주기
var reqTotCnt = $('#reqPerTotCnt').val();
@ -128,11 +149,34 @@
$('#rppl0'+ num +'Email2').val(splEmail[1]);
var splPhone = [];
splPhone = rpplPhone.split("-");
console.log('rpplPhone : ', rpplPhone);
// 10이면 지역번호
if(rpplPhone.indexOf('-') > -1)
{
splPhone01 = rpplPhone.split("-");
$('#rppl0'+ num +'Phone1').val(splPhone01[0]);
$('#rppl0'+ num +'Phone2').val(splPhone01[1]);
$('#rppl0'+ num +'Phone3').val(splPhone01[2]);
}
else if(rppl01Phone.length == 10)
{
$('#rppl0'+ num +'Phone1').val(rpplPhone.substring(0, 2));
$('#rppl0'+ num +'Phone2').val(rpplPhone.substring(2, 6));
$('#rppl0'+ num +'Phone3').val(rpplPhone.substring(6, 10));
}
else
{
$('#rppl0'+ num +'Phone1').val(rpplPhone.substring(0, 3));
$('#rppl0'+ num +'Phone2').val(rpplPhone.substring(3, 7));
$('#rppl0'+ num +'Phone3').val(rpplPhone.substring(7, 11));
}
$('#rppl0'+ num +'Phone1').val(splPhone[0]);
$('#rppl0'+ num +'Phone2').val(splPhone[1]);
$('#rppl0'+ num +'Phone3').val(splPhone[2]);
}

View File

@ -87,7 +87,9 @@
//피신청인 체크
var reqTotCnt = $('#reqPerTotCnt').val(); //총 피신청인 갯수
if(reqTotCnt == 0){ // 첫번째 피신청인 데이터 체크
console.log('reqTotCnt : ', reqTotCnt);
if(reqTotCnt > 0){ // 첫번째 피신청인 데이터 체크
var rppl02UsrTy = $("[name = 'adjReqMgrVoList[2].rpplUsrTy']:checked").val();
@ -136,6 +138,7 @@
var rppl02Phone3 = $('#rppl02Phone3').val();
$('#rppl02Phone').val(rppl02Phone1+rppl02Phone2+rppl02Phone3);
console.log('rppl02Phone1+rppl02Phone2+rppl02Phone3 : ', rppl02Phone1+rppl02Phone2+rppl02Phone3);
}