이준호 전자조정시스템 커밋
- ocr 개발 중
This commit is contained in:
parent
90cd1855ae
commit
00cc5e7a6c
@ -978,6 +978,22 @@ public class AdjReqMgrOffLineController {
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* 조정신청 양식에 맞는 첨부파일을
|
||||
* OCR로 읽어온다
|
||||
*
|
||||
* */
|
||||
@RequestMapping("/kccadr/adjReqMgOff/adjReqMgrOffOcrPopAjax.do")
|
||||
public String adjReqMgrOffOcrPopAjax(@ModelAttribute("adjReqMgrOffLineVO") AdjReqMgrOffLineVO adjReqMgrOffLineVO, ModelMap model) throws Exception {
|
||||
|
||||
// AdjReqMgrOffLineVO master = adjReqMgrOffLineService.selectAdjstReqMgrOffMasterInfo(adjReqMgrOffLineVO);
|
||||
// model.addAttribute("master", master);
|
||||
|
||||
return "kccadr/adjReqMgrOff/popup/adjReqMgrOffOcrPop";
|
||||
}
|
||||
|
||||
public void decryptInfomation(List<AdjReqMgrOffLineVO> list, AdjReqMgrOffLineVO info){
|
||||
if(CollectionUtils.isNotEmpty(list)){
|
||||
for(AdjReqMgrOffLineVO model : list){
|
||||
|
||||
@ -28,5 +28,9 @@ public interface TextSenseService {
|
||||
public void updateTextSenseModify(TextSenseVO textSenseVO) throws Exception;
|
||||
|
||||
public void deleteTextSense(TextSenseVO textSenseVO) throws Exception;
|
||||
|
||||
public void insertTextSenseModify(TextSenseVO textSenseVO) throws Exception;
|
||||
|
||||
public TextSenseVO selectTextSenseModify(TextSenseVO textSenseVO) throws Exception;
|
||||
|
||||
}
|
||||
@ -3,6 +3,7 @@ package kcc.kccadr.textsense.service;
|
||||
import java.io.Serializable;
|
||||
|
||||
import kcc.com.cmm.ComDefaultVO;
|
||||
import kcc.let.utl.fcc.service.EgovStringUtil;
|
||||
|
||||
public class TextSenseVO extends ComDefaultVO implements Serializable{
|
||||
|
||||
@ -48,6 +49,9 @@ public class TextSenseVO extends ComDefaultVO implements Serializable{
|
||||
private String lastUpdusrId;
|
||||
private String lastUpdtPnttm;
|
||||
|
||||
private String excelYn;
|
||||
|
||||
private String filePath;
|
||||
|
||||
public String getApiUrl() {
|
||||
return apiUrl;
|
||||
@ -241,5 +245,18 @@ public class TextSenseVO extends ComDefaultVO implements Serializable{
|
||||
public void setLastUpdtPnttm(String lastUpdtPnttm) {
|
||||
this.lastUpdtPnttm = lastUpdtPnttm;
|
||||
}
|
||||
public String getExcelYn() {
|
||||
return excelYn;
|
||||
}
|
||||
public void setExcelYn(String excelYn) {
|
||||
this.excelYn = excelYn;
|
||||
}
|
||||
public String getFilePath() {
|
||||
return filePath;
|
||||
}
|
||||
public void setFilePath(String filePath) {
|
||||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -131,4 +131,17 @@ public class TextSenseDAO extends EgovAbstractDAO{
|
||||
}
|
||||
}
|
||||
|
||||
public void insertTextSenseModify(TextSenseVO textSenseVO) throws Exception{
|
||||
try {
|
||||
|
||||
update("textSenseDAO.insertTextSenseModify", textSenseVO);
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println("insertTextSenseModify Service DAO Error !!! " + e);
|
||||
}
|
||||
}
|
||||
|
||||
public TextSenseVO selectTextSenseModify(TextSenseVO textSenseVO) throws Exception{
|
||||
return (TextSenseVO) select("textSenseDAO.selectTextSenseModify", textSenseVO);
|
||||
}
|
||||
}
|
||||
|
||||
@ -150,5 +150,18 @@ public class TextSenseServiceImpl implements TextSenseService{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertTextSenseModify(TextSenseVO textSenseVO) throws Exception{
|
||||
try {
|
||||
textSenseDAO.insertTextSenseModify(textSenseVO);
|
||||
} catch (Exception e) {
|
||||
System.out.println("insertTextSenseModify Service DAO Error !!! " + e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextSenseVO selectTextSenseModify(TextSenseVO textSenseVO) throws Exception{
|
||||
return textSenseDAO.selectTextSenseModify(textSenseVO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -26,13 +26,11 @@ public class TextSenseAPIComm {
|
||||
|
||||
try {
|
||||
|
||||
String apiUrl = textSenseVO.getApiUrl(); //"http://222.231.43.29:7777/textsense/api/job/build";
|
||||
String inputUri = textSenseVO.getInputUri(); //"http://119.193.215.98:8081/kccadrPb/usr/image/common/top_logo.png";
|
||||
String outputUri = textSenseVO.getOutputUri(); //"ftp://woo:dkagh@119.193.215.98/usr/ePapyrus/testocr.json";
|
||||
//String outputUri = "http://119.193.215.98:8081/web/main/textsence/testOutputUriPage.do";
|
||||
String taskName = textSenseVO.getTaskName();//"textsense-test1";
|
||||
String callbackUri = textSenseVO.getCallbackUri();//"http://119.193.215.98:8081/web/main/textsence/testCallbackUriPage.do";
|
||||
//String extraJobs = "";
|
||||
String apiUrl = textSenseVO.getApiUrl();
|
||||
String inputUri = textSenseVO.getInputUri();
|
||||
String outputUri = textSenseVO.getOutputUri();
|
||||
String taskName = textSenseVO.getTaskName();
|
||||
String callbackUri = textSenseVO.getCallbackUri();
|
||||
|
||||
JSONObject jsonOptObj = new JSONObject();
|
||||
jsonOptObj.put("withoutConversion", true);
|
||||
@ -65,8 +63,6 @@ public class TextSenseAPIComm {
|
||||
extraJobs.add(jsonJobs);
|
||||
|
||||
jsonObject.put("extraJobs", extraJobs);
|
||||
|
||||
System.out.println("+++++++++++++++++ json ::: "+jsonObject.toJSONString());
|
||||
|
||||
HttpClient httpClient = HttpClientBuilder.create().build();
|
||||
HttpPost httpPost = new HttpPost(apiUrl);
|
||||
@ -87,15 +83,12 @@ public class TextSenseAPIComm {
|
||||
Object obj = parser.parse(result);
|
||||
JSONObject object = (JSONObject) obj;
|
||||
|
||||
System.out.println("result ::: "+result);
|
||||
|
||||
returnJson = object;
|
||||
|
||||
returnJson.put("resultSts", "success");
|
||||
|
||||
}else {
|
||||
|
||||
returnJson.put("resultSts", "fail");
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
@ -3,6 +3,7 @@ package kcc.kccadr.textsense.web;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@ -10,14 +11,10 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import javax.ws.rs.POST;
|
||||
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
@ -27,7 +24,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.google.api.client.http.HttpRequest;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
||||
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
||||
@ -239,7 +236,12 @@ public class TextSenseController {
|
||||
//TextSense API 요청 처리
|
||||
TextSenseVO apiTextSenseVO = new TextSenseVO();
|
||||
String outputFileExt = "text";
|
||||
String outputFileNm = "ePapy_" + EgovStringUtil.getTimeStamp() + "_OCR." + (outputFileExt == "text" ? "txt" : outputFileExt);
|
||||
if(StringUtil.isNotEmpty(textSenseVO.getExcelYn()) && "Y".equals(textSenseVO.getExcelYn())) {
|
||||
outputFileExt = "excel";
|
||||
}
|
||||
String outputFileExtFileExt = extConversion(outputFileExt);
|
||||
|
||||
String outputFileNm = "ePapy_" + EgovStringUtil.getTimeStamp() + "_OCR." + outputFileExtFileExt;
|
||||
|
||||
String apiUrl = textSenseApiUrl + "/textsense/api/job/build";
|
||||
String taskName = textSenseVO.getTaskName();
|
||||
@ -290,6 +292,7 @@ public class TextSenseController {
|
||||
modelAndView.addObject("id", id);
|
||||
modelAndView.addObject("name", taskName);
|
||||
modelAndView.addObject("status", status);
|
||||
modelAndView.addObject("outputFileNm", outputFileNm);
|
||||
|
||||
}else {
|
||||
|
||||
@ -488,7 +491,7 @@ public class TextSenseController {
|
||||
|
||||
@POST
|
||||
@RequestMapping(value="/kccadr/textsence/textSenseResponse.do")
|
||||
public HttpResponse textSenseResponse(HttpServletRequest req, HttpServletResponse res, @RequestBody @Valid String test) throws Exception{
|
||||
public ResponseEntity<?> textSenseResponse(HttpServletRequest req, HttpServletResponse res, @RequestBody @Valid String pram) throws Exception{
|
||||
|
||||
JSONObject returnObject = new JSONObject();
|
||||
|
||||
@ -496,22 +499,34 @@ public class TextSenseController {
|
||||
|
||||
try {
|
||||
JSONParser parser = new JSONParser();
|
||||
Object obj = parser.parse(test);
|
||||
Object obj = parser.parse(pram);
|
||||
JSONObject object = (JSONObject) obj;
|
||||
|
||||
String USER_1 = EgovStringUtil.isNullToString(object.get("USER_1"));
|
||||
String ADDRESS_1 = EgovStringUtil.isNullToString(object.get("ADDRESS_1"));
|
||||
String PHONE_1 = EgovStringUtil.isNullToString(object.get("PHONE_1"));
|
||||
String MOBILE_1 = EgovStringUtil.isNullToString(object.get("MOBILE_1"));
|
||||
String MAIL_1 = EgovStringUtil.isNullToString(object.get("MAIL_1"));
|
||||
String USER_2 = EgovStringUtil.isNullToString(object.get("USER_2"));
|
||||
String ADDRESS_2 = EgovStringUtil.isNullToString(object.get("ADDRESS_2"));
|
||||
String PHONE_2 = EgovStringUtil.isNullToString(object.get("PHONE_2"));
|
||||
String MOBILE_2 = EgovStringUtil.isNullToString(object.get("MOBILE_2"));
|
||||
String MAIL_2 = EgovStringUtil.isNullToString(object.get("MAIL_2"));
|
||||
String PURPOSE = EgovStringUtil.isNullToString(object.get("PURPOSE"));
|
||||
String REASON = EgovStringUtil.isNullToString(object.get("REASON"));
|
||||
String ATTACHMENT = EgovStringUtil.isNullToString(object.get("ATTACHMENT"));
|
||||
String fileName = EgovStringUtil.isNullToString(object.get("fileName"));
|
||||
String filePath = EgovStringUtil.isNullToString(object.get("filePath"));
|
||||
|
||||
System.out.println( EgovStringUtil.isNullToString(object.get("user_1")));
|
||||
System.out.println( EgovStringUtil.isNullToString(object.get("address_1")));
|
||||
System.out.println( EgovStringUtil.isNullToString(object.get("phone_1")));
|
||||
System.out.println( EgovStringUtil.isNullToString(object.get("mobile_1")));
|
||||
System.out.println( EgovStringUtil.isNullToString(object.get("mail_1")));
|
||||
System.out.println( EgovStringUtil.isNullToString(object.get("user_2")));
|
||||
System.out.println( EgovStringUtil.isNullToString(object.get("address_2")));
|
||||
System.out.println( EgovStringUtil.isNullToString(object.get("phone_2")));
|
||||
System.out.println( EgovStringUtil.isNullToString(object.get("mobile_2")));
|
||||
System.out.println( EgovStringUtil.isNullToString(object.get("mail_2")));
|
||||
System.out.println( EgovStringUtil.isNullToString(object.get("purpose")));
|
||||
System.out.println( EgovStringUtil.isNullToString(object.get("reason")));
|
||||
System.out.println( EgovStringUtil.isNullToString(object.get("attachment")));
|
||||
|
||||
|
||||
TextSenseVO textSenseVO = new TextSenseVO();
|
||||
|
||||
textSenseVO.setFileName(fileName);
|
||||
textSenseVO.setFilePath(filePath);
|
||||
textSenseVO.setFileContents(object.toString());
|
||||
|
||||
textSenseService.insertTextSenseModify(textSenseVO);
|
||||
|
||||
result = "success";
|
||||
|
||||
@ -522,22 +537,68 @@ public class TextSenseController {
|
||||
|
||||
returnObject.put("result", result);
|
||||
|
||||
HttpPost httpPost = new HttpPost();
|
||||
httpPost.setEntity(new StringEntity(returnObject.toString(), "UTF-8"));
|
||||
httpPost.addHeader("Content-type", "application/json");
|
||||
httpPost.addHeader("Accept", "application/json");
|
||||
|
||||
System.out.println(httpPost.getMethod());
|
||||
System.out.println(httpPost.getEntity());
|
||||
System.out.println(httpPost.getAllHeaders());
|
||||
System.out.println(httpPost.getURI());
|
||||
|
||||
HttpClient httpClient = HttpClientBuilder.create().build();
|
||||
|
||||
return httpClient.execute(httpPost);
|
||||
|
||||
return ResponseEntity.ok(returnObject);
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@RequestMapping(value="/kccadr/textsence/textSenseProcessChkAjax.do")
|
||||
public ModelAndView textSenseProcessChkAjax(TextSenseVO textSenseVO) throws Exception{
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
|
||||
|
||||
textSenseVO.setLastUpdusrId(user.getId());
|
||||
|
||||
if(user == null) {
|
||||
modelAndView.addObject("result", "FAIL");
|
||||
modelAndView.addObject("message", "다시 로그인 해주세요.");
|
||||
return modelAndView;
|
||||
|
||||
}
|
||||
try {
|
||||
TextSenseVO resultVO = new TextSenseVO();
|
||||
resultVO = textSenseService.selectTextSenseModify(textSenseVO);
|
||||
|
||||
System.out.println("resultVO.getFileContents() :: " + resultVO.getFileContents());
|
||||
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
Map<String, String> map = mapper.readValue(resultVO.getFileContents(), Map.class);
|
||||
|
||||
modelAndView.addObject("result", "SUCCESS");
|
||||
modelAndView.addObject("data", map);
|
||||
} catch (Exception e) {
|
||||
modelAndView.addObject("result", "FAIL");
|
||||
modelAndView.addObject("message", "저장에 실패했습니다.");
|
||||
}
|
||||
|
||||
return modelAndView;
|
||||
|
||||
}
|
||||
|
||||
private String extConversion(String outputFileExt) {
|
||||
|
||||
String outputFileExtFileExt = "";
|
||||
|
||||
switch (outputFileExt) {
|
||||
case "text":
|
||||
outputFileExtFileExt = "txt";
|
||||
break;
|
||||
case "excel":
|
||||
outputFileExtFileExt = "xlsx";
|
||||
break;
|
||||
case "json":
|
||||
outputFileExtFileExt = "json";
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return outputFileExtFileExt;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -194,5 +194,31 @@
|
||||
|
||||
</update>
|
||||
|
||||
<insert id="textSenseDAO.insertTextSenseModify" parameterClass="TextSenseVO">
|
||||
|
||||
INSERT
|
||||
INTO adr_textsense_ocr_textdata
|
||||
(
|
||||
filename
|
||||
, filepath
|
||||
, filecontents
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
#fileName#
|
||||
, #filePath#
|
||||
, #fileContents#
|
||||
)
|
||||
|
||||
</insert>
|
||||
|
||||
<select id="textSenseDAO.selectTextSenseModify" parameterClass="TextSenseVO" resultClass="TextSenseVO">
|
||||
|
||||
select a.filename as fileName
|
||||
, a.filepath as filePath
|
||||
, a.filecontents as fileContents
|
||||
from adr_textsense_ocr_textdata a
|
||||
where a.filename = #fileName#
|
||||
|
||||
</select>
|
||||
</sqlMap>
|
||||
@ -127,7 +127,7 @@
|
||||
<pattern>/web/kccadr/payment/inipay/*</pattern> <!-- 결재 모듈 테스트 -->
|
||||
<pattern>/kccadr/adjPgrMgr/drtCtr/drtCtrReg_for_ApprovManageEndDetail.do</pattern>
|
||||
<pattern>/web/kccadr/adjst/adjstProgressTutorial.do</pattern>
|
||||
|
||||
<pattern>/kccadr/textsence/textSenseResponse.do</pattern>
|
||||
|
||||
|
||||
</decorator>
|
||||
|
||||
@ -1632,6 +1632,7 @@ function openExampleAdminPop(exmpCd) {
|
||||
<form:input type="hidden" path="reqPerTotCnt" id="reqPerTotCnt" value="${reqPerTotCnt}"/> --%>
|
||||
<div class="cont">
|
||||
<div class="btn_wrap" style="text-align: right; margin-bottom: 10px;">
|
||||
<button type="button" class="btnType06 btn_adj_add" onclick="popOpen('/kccadr/adjReqMgOff/adjReqMgrOffOcrPopAjax.do','조정신청 OCR','660','440')">조정신청 OCR</button>
|
||||
<button type="button" class="btnType06 btn_adj_add" onclick="popOpen('/kccadr/adjReqMgOff/adjReqMgrOffHistoryPopAjax.do','이전신청 불러오기','660','440')">이전신청 불러오기</button>
|
||||
</div>
|
||||
<!-- list_상세 -->
|
||||
|
||||
@ -0,0 +1,368 @@
|
||||
<%@ page contentType="text/html; charset=utf-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
|
||||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||
<%@ taglib prefix="kc" uri="/WEB-INF/tlds/kcc_tld.tld"%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<title>오프라인 조정신청 이전신청 목록</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
|
||||
<!-- css -->
|
||||
<link rel="stylesheet" href="/kccadrPb/adm/css/reset.css">
|
||||
<link rel="stylesheet" href="/kccadrPb/adm/css/font.css">
|
||||
<link rel="stylesheet" href="/kccadrPb/adm/css/common.css">
|
||||
<link rel="stylesheet" href="/kccadrPb/adm/css/content.css">
|
||||
<link rel="stylesheet" href="/kccadrPb/adm/css/content_media.css">
|
||||
<link rel="stylesheet" href="/kccadrPb/adm/css/popup.css">
|
||||
|
||||
<script src="/kccadrPb/adm/script/jquery-3.5.0.js"></script>
|
||||
<script src="/kccadrPb/adm/script/common.js"></script>
|
||||
<script src="/kccadrPb/adm/script/content.js"></script>
|
||||
<script src="/js/ncms_common.js"></script>
|
||||
<script src="/js/kccadr/kccadrCom.js"></script>
|
||||
<script type="text/javascript" src="/kccadrPb/adm/script/popup.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="<c:url value='/js/EgovMultiFile.js'/>"></script>
|
||||
|
||||
|
||||
<script type="text/javaScript" language="javascript">
|
||||
|
||||
$( document ).ready(function(){
|
||||
//첨부파일 버튼 처리
|
||||
$("#filebutton").click(function(){
|
||||
$("#file_temp").trigger("click");
|
||||
});
|
||||
});
|
||||
|
||||
function fnAdjstReqOffDataChoice(adrSeq){
|
||||
|
||||
opener.callHistoryData(adrSeq);
|
||||
window.close();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 1. 로딩 바 show
|
||||
* 2. 파일을 가지고 ocr 요청
|
||||
* 3. 5초 마다 결과 조회 총 12번 호출, 호출횟수 > 12 = fail
|
||||
* 4. 결과 성공 시 부모 창에 알맞게 set
|
||||
*
|
||||
*/
|
||||
|
||||
function requestOcr(){
|
||||
var cnt = 0;
|
||||
var responResult;
|
||||
|
||||
// 1. 로딩 바 show
|
||||
showLodingBar();
|
||||
|
||||
// 2. 파일을 가지고 ocr 요청
|
||||
var outputFileNm = ocrAjaxCall();
|
||||
|
||||
if(outputFileNm = ''){
|
||||
alert('ocr 요청을 다시 시도해 주세요.');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 3. 5초 마다 결과 조회 총 12번 호출, 호출횟수 > 12 = fail
|
||||
const intervalId = setInterval(() =>
|
||||
{
|
||||
|
||||
responResult = ocrResultAjaxCall(outputFileNm);
|
||||
|
||||
try {
|
||||
if(responResult != null){
|
||||
clearInterval(intervalId);
|
||||
deleteLodingBar();
|
||||
|
||||
console.log('responResult ::',responResult);
|
||||
|
||||
// 4. 결과 성공 시 부모 창에 알맞게 set
|
||||
window.opener.adrVO.rppl0101Nm.value = 'test';
|
||||
|
||||
window.close();
|
||||
}
|
||||
if(cnt > 5){
|
||||
clearInterval(intervalId);
|
||||
deleteLodingBar();
|
||||
alertMessage("요청 가능 시간을 초과했습니다. 다시 시도해 주세요.");
|
||||
}
|
||||
cnt += 1;
|
||||
}
|
||||
catch (e) {
|
||||
console.log("error :: ",e);
|
||||
deleteLodingBar();
|
||||
clearInterval(intervalId);
|
||||
}
|
||||
}
|
||||
, 5000);
|
||||
}
|
||||
|
||||
function ocrAjaxCall(){
|
||||
|
||||
var outputFileNm = "";
|
||||
|
||||
document.writeForm.taskName.value = self.crypto.randomUUID();
|
||||
|
||||
var form = document.writeForm;
|
||||
var data = new FormData(form);
|
||||
//첨부파일 등록 처리
|
||||
_fileForm2.forEach(function(obj, idx) {
|
||||
if (obj) data.append("file"+idx, obj.fileObj);
|
||||
});
|
||||
|
||||
if(!confirm("OCR 처리 요청을 진행하시겠습니까?")) return false;
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
enctype: 'multipart/form-data',
|
||||
url: "/kccadr/textsence/textSenseRequestAjax.do",
|
||||
data: data,
|
||||
dataType:'json',
|
||||
async: false,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
cache: false,
|
||||
success: function (returnData, status) {
|
||||
if(status == 'success'){
|
||||
var result = returnData.result;
|
||||
|
||||
if(result == 'loginFail'){
|
||||
alert("로그인이 필요합니다.");
|
||||
return false;
|
||||
}else if(result == 'success'){
|
||||
alert("OCR 처리요청이 완료되었습니다.");
|
||||
outputFileNm = returnData.outputFileNm;
|
||||
}
|
||||
|
||||
} else if(status== 'fail'){
|
||||
alert("저장에 실패하였습니다.");
|
||||
}
|
||||
},
|
||||
error: function (e) { alert("저장에 실패하였습니다."); console.log("ERROR : ", e); }
|
||||
});
|
||||
|
||||
return outputFileNm;
|
||||
}
|
||||
|
||||
function ocrResultAjaxCall(outputFileNm){
|
||||
|
||||
var data;
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
enctype: 'multipart/form-data',
|
||||
url: "/kccadr/textsence/textSenseProcessChkAjax.do",
|
||||
data: {"outputFileNm": outputFileNm},
|
||||
dataType:'json',
|
||||
async: false,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
cache: false,
|
||||
success: function (returnData, status) {
|
||||
if(status == 'success'){
|
||||
result = returnData.result;
|
||||
|
||||
if(result == 'loginFail'){
|
||||
alert("로그인이 필요합니다.");
|
||||
return false;
|
||||
}else if(result == 'success'){
|
||||
// alert("OCR 처리요청이 완료되었습니다.");
|
||||
data = returnData.data;
|
||||
}
|
||||
|
||||
} else if(status== 'fail'){
|
||||
alert("저장에 실패하였습니다.");
|
||||
}
|
||||
},
|
||||
error: function (e) { alert("저장에 실패하였습니다."); console.log("ERROR : ", e); }
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function alertMessage(msg){
|
||||
alert(msg);
|
||||
}
|
||||
|
||||
function showLodingBar(){
|
||||
var width = 0;
|
||||
var height = 0;
|
||||
var left = 0;
|
||||
var top = 0;
|
||||
|
||||
width = 30;
|
||||
height = 30;
|
||||
top = ( $(window).height() - height ) / 2 + $(window).scrollTop();
|
||||
left = ( $(window).width() - width ) / 2 + $(window).scrollLeft();
|
||||
|
||||
if($("#div_ajax_load_image").length != 0) {
|
||||
$("#div_ajax_load_image").css({
|
||||
"top": top+"px",
|
||||
"left": left+"px"
|
||||
});
|
||||
$("#div_ajax_load_image").show();
|
||||
}else{
|
||||
$('body').append('<div id="div_ajax_load_image" style="position:absolute; top:' + top + 'px; left:' + left + 'px; width:' + width + 'px; height:' + height + 'px; z-index:9999; background:#f0f0f0; filter:alpha(opacity=0); opacity:alpha*0.5; margin:auto; padding:0; "><img src="/direct/img/lodingBar.gif"></div>');
|
||||
}
|
||||
}
|
||||
|
||||
function deleteLodingBar(){
|
||||
if($("#div_ajax_load_image").length != 0) {
|
||||
$("#div_ajax_load_image").remove() ;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<form name="writeForm" enctype="multipart/form-data" method="post">
|
||||
<input type="hidden" name="limitcount" value="1" />
|
||||
|
||||
<input type="hidden" name="pageIndex" value="<c:out value='${adjReqMgrOffLineVO.pageIndex}' />"/>
|
||||
<input type="hidden" name="searchSortCnd" value="<c:out value="${adjReqMgrOffLineVO.searchSortCnd}" />" />
|
||||
<input type="hidden" name="searchSortOrd" value="<c:out value="${adjReqMgrOffLineVO.searchSortOrd}" />" />
|
||||
<input type="hidden" name="excelYn" value="Y" />
|
||||
|
||||
|
||||
<input type="hidden" id="taskName" name="taskName" value="">
|
||||
|
||||
<div class="popup_cont">
|
||||
<tr>
|
||||
<th class="req_text">
|
||||
<p>첨부파일</p>
|
||||
</th>
|
||||
<td class="upload_area">
|
||||
<!-- <input type="text" id="fileNm" size="30" class="file_input" readonly> --><!-- <button type="button" class="btnType01 btn_add_file">파일 첨부하기</button> -->
|
||||
<input type="file" id="file_temp" name="file_temp" class="uploadFile" style="display:none"/>
|
||||
<button type="button" id="filebutton" class="btnType01 btn_add_file">파일 첨부하기</button>
|
||||
<div class="file_wrap file_upload_box no_img_box">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col style="width: 60%;">
|
||||
<col style="width: auto;">
|
||||
<col style="width: 20%;">
|
||||
<col style="width: 10%;">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<!-- <th>
|
||||
<input type="checkbox" id="all_check"><label for="all_check"></label>
|
||||
</th> -->
|
||||
<th>파일 명</th>
|
||||
<th>종류</th>
|
||||
<th>크기</th>
|
||||
<th>삭제</th>
|
||||
</thead>
|
||||
<tbody class="tb_file_before">
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<p>첨부하실 파일을 <span>마우스로 끌어서</span> 넣어주세요.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="file_wrap fileAfter file_list_div">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col style="width: 60%">
|
||||
<col style="width: 10%">
|
||||
<col style="width: 20%">
|
||||
<col style="width: 10%">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<!-- <th>
|
||||
<input type="checkbox" id="all_check"><label for="all_check"></label>
|
||||
</th> -->
|
||||
<th>파일 명</th>
|
||||
<th>종류</th>
|
||||
<th>크기</th>
|
||||
<th>삭제</th>
|
||||
</thead>
|
||||
<tbody id="tbody_fiielist" class="tb_file_after">
|
||||
<c:forEach var="fileList" items="${fileList}" varStatus="status">
|
||||
<tr class="item_<c:out value='${fileList.atchFileId}' />_<c:out value='${fileList.fileSn}' /> uploaded_obj">
|
||||
<input type="hidden" name="fileSize" class="item_file_size" value="<c:out value='${fileList.fileSize}' />">
|
||||
<td class="td_filename">
|
||||
<!-- <img src="/direct/img/upload_hwp_img.png" alt="" /> -->
|
||||
<span class="file_name_text"><c:out value='${fileList.orignlFileNm}' /></span>
|
||||
</td>
|
||||
<td class="td_filesort">
|
||||
<span class="file_filesort_text" value="<c:out value="${fileList.fileExtsn}"/>"><c:out value="${fileList.fileExtsn}"/></span>
|
||||
</td>
|
||||
<%-- <td class="td_filesize">
|
||||
<span class="file_size_text" value="<c:out value="${fileList.fileMg}"/>"><c:out value="${fileList.fileMg}"/></span>
|
||||
</td> --%>
|
||||
<td>
|
||||
<button type="button" class="btn_del" onclick="delAtchFile('<c:out value='${fileList.atchFileId}' />', '<c:out value='${fileList.fileSn}' />'); return false;"><i></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<c:if test="${!empty fmsFileList[0].fmsId }">
|
||||
<tr>
|
||||
<th class="td_title1"><span class="star_t"></span>첨부이미지 링크</th>
|
||||
<td colspan="3">
|
||||
<c:forEach var="result" items="${fmsFileList}" varStatus="status">
|
||||
<c:if test="${result.fileExtsn eq 'jpg' ||
|
||||
result.fileExtsn eq 'jpeg' ||
|
||||
result.fileExtsn eq 'png' ||
|
||||
result.fileExtsn eq 'bmp' ||
|
||||
result.fileExtsn eq 'gif' ||
|
||||
result.fileExtsn eq 'img' }">
|
||||
<span class="item_<c:out value='${result.fmsImageFile}' />_<c:out value='${result.fileSn}' />">
|
||||
<a href='<c:out value='${result.fmsLink}' />' target="_blank"><c:out value='${result.fmsLink}' /></a>
|
||||
(<c:out value='${result.orignlFileNm}' />)
|
||||
</br>
|
||||
</span>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="td_title1"><span class="star_t"></span>첨부다운로드 링크</th>
|
||||
<td colspan="3">
|
||||
<c:forEach var="result" items="${fmsFileList}" varStatus="status">
|
||||
<span class="item_<c:out value='${result.fmsImageFile}' />_<c:out value='${result.fileSn}' />">
|
||||
<a href='<c:out value='${result.fmsDownLink}' />'><c:out value='${result.fmsDownLink}' /></a>
|
||||
<c:if test="${listExist}">(</c:if>
|
||||
<c:out value='${result.orignlFileNm}' />
|
||||
<c:if test="${listExist}">)</c:if>
|
||||
</br>
|
||||
</span>
|
||||
</c:forEach>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="td_title1"><span class="star_t"></span>최종수정일</th>
|
||||
<td colspan="3">
|
||||
<c:out value='${fmsFileList[0].moddt }' />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th class="td_title1"><span class="star_t"></span>작성자</th>
|
||||
<td colspan="3">
|
||||
<c:out value='${fmsFileList[0].registerId }' />
|
||||
</td>
|
||||
</tr>
|
||||
</c:if>
|
||||
<div class="btn_wrap">
|
||||
<button type="button" class="btnType01" onclick="requestOcr(); return false;">변환요청</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@ -232,52 +232,52 @@ function fileUploadPopup(){
|
||||
</td>
|
||||
</tr>
|
||||
<c:if test="${!empty fmsFileList[0].fmsId }">
|
||||
<tr>
|
||||
<th class="td_title1"><span class="star_t"></span>첨부이미지 링크</th>
|
||||
<td colspan="3">
|
||||
<c:forEach var="result" items="${fmsFileList}" varStatus="status">
|
||||
<c:if test="${result.fileExtsn eq 'jpg' ||
|
||||
result.fileExtsn eq 'jpeg' ||
|
||||
result.fileExtsn eq 'png' ||
|
||||
result.fileExtsn eq 'bmp' ||
|
||||
result.fileExtsn eq 'gif' ||
|
||||
result.fileExtsn eq 'img' }">
|
||||
<tr>
|
||||
<th class="td_title1"><span class="star_t"></span>첨부이미지 링크</th>
|
||||
<td colspan="3">
|
||||
<c:forEach var="result" items="${fmsFileList}" varStatus="status">
|
||||
<c:if test="${result.fileExtsn eq 'jpg' ||
|
||||
result.fileExtsn eq 'jpeg' ||
|
||||
result.fileExtsn eq 'png' ||
|
||||
result.fileExtsn eq 'bmp' ||
|
||||
result.fileExtsn eq 'gif' ||
|
||||
result.fileExtsn eq 'img' }">
|
||||
<span class="item_<c:out value='${result.fmsImageFile}' />_<c:out value='${result.fileSn}' />">
|
||||
<a href='<c:out value='${result.fmsLink}' />' target="_blank"><c:out value='${result.fmsLink}' /></a>
|
||||
(<c:out value='${result.orignlFileNm}' />)
|
||||
</br>
|
||||
</span>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="td_title1"><span class="star_t"></span>첨부다운로드 링크</th>
|
||||
<td colspan="3">
|
||||
<c:forEach var="result" items="${fmsFileList}" varStatus="status">
|
||||
<span class="item_<c:out value='${result.fmsImageFile}' />_<c:out value='${result.fileSn}' />">
|
||||
<a href='<c:out value='${result.fmsLink}' />' target="_blank"><c:out value='${result.fmsLink}' /></a>
|
||||
(<c:out value='${result.orignlFileNm}' />)
|
||||
<a href='<c:out value='${result.fmsDownLink}' />'><c:out value='${result.fmsDownLink}' /></a>
|
||||
<c:if test="${listExist}">(</c:if>
|
||||
<c:out value='${result.orignlFileNm}' />
|
||||
<c:if test="${listExist}">)</c:if>
|
||||
</br>
|
||||
</span>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="td_title1"><span class="star_t"></span>첨부다운로드 링크</th>
|
||||
<td colspan="3">
|
||||
<c:forEach var="result" items="${fmsFileList}" varStatus="status">
|
||||
<span class="item_<c:out value='${result.fmsImageFile}' />_<c:out value='${result.fileSn}' />">
|
||||
<a href='<c:out value='${result.fmsDownLink}' />'><c:out value='${result.fmsDownLink}' /></a>
|
||||
<c:if test="${listExist}">(</c:if>
|
||||
<c:out value='${result.orignlFileNm}' />
|
||||
<c:if test="${listExist}">)</c:if>
|
||||
</br>
|
||||
</span>
|
||||
</c:forEach>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="td_title1"><span class="star_t"></span>최종수정일</th>
|
||||
<td colspan="3">
|
||||
<c:out value='${fmsFileList[0].moddt }' />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th class="td_title1"><span class="star_t"></span>작성자</th>
|
||||
<td colspan="3">
|
||||
<c:out value='${fmsFileList[0].registerId }' />
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="td_title1"><span class="star_t"></span>최종수정일</th>
|
||||
<td colspan="3">
|
||||
<c:out value='${fmsFileList[0].moddt }' />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th class="td_title1"><span class="star_t"></span>작성자</th>
|
||||
<td colspan="3">
|
||||
<c:out value='${fmsFileList[0].registerId }' />
|
||||
</td>
|
||||
</tr>
|
||||
</c:if>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user