Merge branch 'jsp'
This commit is contained in:
commit
def32be69e
106
src/main/java/kcc/com/cmm/JsonResult.java
Normal file
106
src/main/java/kcc/com/cmm/JsonResult.java
Normal file
@ -0,0 +1,106 @@
|
||||
package kcc.com.cmm;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 공용 JSON 리턴 모델
|
||||
* @author wimy
|
||||
*
|
||||
*/
|
||||
public class JsonResult implements Serializable{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -6362971805582357050L;
|
||||
|
||||
private boolean success;
|
||||
|
||||
private String code;
|
||||
|
||||
private String message;
|
||||
|
||||
private Object data;
|
||||
|
||||
private String redirectUrl = "";
|
||||
|
||||
/**
|
||||
* json 성공 여부
|
||||
* @return
|
||||
*/
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* json 성공 여부
|
||||
* @param success
|
||||
*/
|
||||
public void setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 코드
|
||||
* @return
|
||||
*/
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 코드
|
||||
* @param code
|
||||
*/
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 메시지
|
||||
* @return
|
||||
*/
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* 메시지
|
||||
* @param message
|
||||
*/
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* JSON 데이터
|
||||
* @return
|
||||
*/
|
||||
public Object getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* JSON 데이터
|
||||
* @param data
|
||||
*/
|
||||
public void setData(Object data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 리다이렉트 URL
|
||||
* @return
|
||||
*/
|
||||
public String getRedirectUrl() {
|
||||
return redirectUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 리다이렉트 URL
|
||||
* @param redirectUrl
|
||||
*/
|
||||
public void setRedirectUrl(String redirectUrl) {
|
||||
this.redirectUrl = redirectUrl;
|
||||
}
|
||||
|
||||
}
|
||||
@ -12,6 +12,8 @@ public interface AdrPrsctLinkService {
|
||||
|
||||
void adrPrsctLinkInsert(AdrPrsctLinkVO adrPrsctLinkVO) throws Exception;
|
||||
|
||||
void adrPrsctLinkListInsert(List<AdrPrsctLinkVO> adrPrsctLinkList) throws Exception;
|
||||
|
||||
int adrPrsctLinkUpdate(AdrPrsctLinkVO adrPrsctLinkVO) throws Exception;
|
||||
|
||||
int adrPrsctLinkDelete(AdrPrsctLinkVO aprvlLineMgrVO) throws Exception;
|
||||
|
||||
@ -7,6 +7,7 @@ import javax.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import kcc.kccadr.adrpr.service.AdrPrsctLinkService;
|
||||
import kcc.kccadr.adrpr.service.AdrPrsctLinkVO;
|
||||
|
||||
@ -16,6 +17,10 @@ public class AdrPrsctLinkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
@Resource(name = "adrPrsctLinkDAO")
|
||||
private AdrPrsctLinkDAO adrPrsctLinkDAO;
|
||||
|
||||
// PRSCT_SEQ
|
||||
@Resource(name="adrPrsctLinkIdgenService")
|
||||
private EgovIdGnrService adrPrsctLinkIdgenService;
|
||||
|
||||
public AdrPrsctLinkVO selectAdrPrsctLinkDetail(AdrPrsctLinkVO adrPrsctLinkVO) throws Exception {
|
||||
return adrPrsctLinkDAO.selectAdrPrsctLinkDetail(adrPrsctLinkVO);
|
||||
}
|
||||
@ -29,14 +34,27 @@ public class AdrPrsctLinkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
return adrPrsctLinkDAO.selectAdrPrsctLinkListCount(aprvlLineMgrVO);
|
||||
}
|
||||
|
||||
//저장
|
||||
public void adrPrsctLinkInsert(AdrPrsctLinkVO adrPrsctLinkVO) throws Exception {
|
||||
adrPrsctLinkDAO.adrPrsctLinkInsert(adrPrsctLinkVO);
|
||||
}
|
||||
|
||||
//엑셀업로드 멀티저장
|
||||
public void adrPrsctLinkListInsert(List<AdrPrsctLinkVO> adrPrsctLinkList) throws Exception {
|
||||
for(AdrPrsctLinkVO adrPrsctLinkVO : adrPrsctLinkList) {
|
||||
// 인서트
|
||||
String nextId = adrPrsctLinkIdgenService.getNextStringId();
|
||||
adrPrsctLinkVO.setPrsctSeq(nextId);
|
||||
adrPrsctLinkInsert(adrPrsctLinkVO);
|
||||
}
|
||||
}
|
||||
|
||||
//업데이트
|
||||
public int adrPrsctLinkUpdate(AdrPrsctLinkVO adrPrsctLinkVO) throws Exception{
|
||||
return adrPrsctLinkDAO.adrPrsctLinkUpdate(adrPrsctLinkVO);
|
||||
}
|
||||
|
||||
//삭제
|
||||
public int adrPrsctLinkDelete(AdrPrsctLinkVO adrPrsctLinkVO) throws Exception{
|
||||
return adrPrsctLinkDAO.adrPrsctLinkDelete(adrPrsctLinkVO);
|
||||
}
|
||||
|
||||
@ -1,20 +1,32 @@
|
||||
package kcc.kccadr.adrpr.web;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.poi.openxml4j.opc.OPCPackage;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFCell;
|
||||
import org.apache.poi.xssf.usermodel.XSSFRow;
|
||||
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
||||
import kcc.com.cmm.JsonResult;
|
||||
import kcc.com.cmm.LoginVO;
|
||||
import kcc.com.cmm.spring.data.util.ExcelUtil;
|
||||
import kcc.com.cmm.util.StringUtil;
|
||||
@ -108,6 +120,18 @@ public class AdrPrsctLinkController {
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 검찰연계 엑셀등록 화면
|
||||
* date : 2023.10.23
|
||||
*/
|
||||
@RequestMapping(value = "/kccadr/adrpr/popup/adrPrsctLinkExcelRegistPop.do")
|
||||
public String adjstReqOpenExamplePop(@ModelAttribute("adrPrsctLinkVO") AdrPrsctLinkVO adrPrsctLinkVO
|
||||
, ModelMap model) throws Exception {
|
||||
|
||||
|
||||
return "kccadr/adrpr/popup/adrPrsctLinkExcelRegistPop";
|
||||
}
|
||||
|
||||
/**
|
||||
* 검찰연계 등록 화면
|
||||
* date : 2023.10.23
|
||||
@ -140,7 +164,7 @@ public class AdrPrsctLinkController {
|
||||
// 저장
|
||||
if (StringUtil.isEmpty(adrPrsctLinkVO.getPrsctSeq())) {
|
||||
// 인서트
|
||||
String nextId =adrPrsctLinkIdgenService.getNextStringId();
|
||||
String nextId = adrPrsctLinkIdgenService.getNextStringId();
|
||||
adrPrsctLinkVO.setPrsctSeq(nextId);
|
||||
adrPrsctLinkService.adrPrsctLinkInsert(adrPrsctLinkVO);
|
||||
}
|
||||
@ -193,4 +217,306 @@ public class AdrPrsctLinkController {
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 문자 발송 - 엑셀파일 불러오기
|
||||
* @param body
|
||||
* @param uploadFile
|
||||
* @param search
|
||||
* @param result
|
||||
* @param model
|
||||
* @param request
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/kccadr/adrpr/adrPrsctLinkSendExelAjax.do")
|
||||
@ResponseBody
|
||||
public Object adrPrsctLinkSendExelAjax(final MultipartHttpServletRequest multiRequest) throws Exception {
|
||||
|
||||
//로그인 정보 획득 - ssoLoginVO 사용
|
||||
LoginVO loginVO = checkLoginUtil.getLoginVO();
|
||||
|
||||
JsonResult jr = new JsonResult();
|
||||
jr.setSuccess(false);
|
||||
jr.setMessage("엑셀 파일만 업로드할 수 있습니다.");
|
||||
|
||||
try {
|
||||
if (loginVO != null) {
|
||||
List<MultipartFile> files = (List<MultipartFile>) multiRequest.getFiles("file0");
|
||||
|
||||
// 파일명에 .이 있을경우 오류 => Ex) 테스트6.20.xlsx
|
||||
int fileNameSplitCnt = 0;
|
||||
|
||||
if(!files.isEmpty()) {
|
||||
fileNameSplitCnt = files.get(0).getOriginalFilename().split("[.]").length;
|
||||
|
||||
if (files.get(0).getSize() > 0
|
||||
&& (files.get(0).getContentType().indexOf("spreadsheetml") > -1)
|
||||
|| files.get(0).getContentType().indexOf("ms-excel") > -1
|
||||
|| files.get(0).getOriginalFilename().split("[.]")[fileNameSplitCnt-1].indexOf("xlsx") > -1
|
||||
|| files.get(0).getOriginalFilename().split("[.]")[fileNameSplitCnt-1].indexOf("xls") > -1) {
|
||||
|
||||
// 엑셀 파일 용량 3MB이상 시 10만건 이상으로 서버가 다운되는 증상 발생
|
||||
long fileSize = multiRequest.getFile("file0").getSize();
|
||||
|
||||
if(fileSize > 3374653) {
|
||||
jr.setMessage("엑셀 파일은 3MB를 넘을수 없습니다.");
|
||||
return jr;
|
||||
}
|
||||
|
||||
String Ext = files.get(0).getOriginalFilename().split("[.]")[1];
|
||||
String errMessage = "";
|
||||
String cellValue = "";
|
||||
|
||||
int errItemCnt = 0;
|
||||
String errItemLine = "";
|
||||
|
||||
//엑셀 확장자에 따른 처리 로직 분리
|
||||
//확장자가 xlsx
|
||||
if(Ext.equals("xlsx")) {
|
||||
OPCPackage opcPackage = OPCPackage.open(files.get(0).getInputStream());
|
||||
XSSFWorkbook workbook = new XSSFWorkbook(opcPackage);
|
||||
XSSFSheet sheet = workbook.getSheetAt(0); // 첫번째 시트 불러오기
|
||||
opcPackage.close();
|
||||
|
||||
int totRowDataCnt = 0;
|
||||
for(int r=1; r<sheet.getPhysicalNumberOfRows(); r++) {
|
||||
XSSFRow tmpRow = sheet.getRow(r);
|
||||
XSSFCell cell = null;
|
||||
if(tmpRow.getCell(1) != null) {
|
||||
cell = tmpRow.getCell(1); //이름/핸드폰/변환1/변환2/변환3/변환4/변환5
|
||||
if(cell != null && !cell.toString().trim().equals("")) {
|
||||
totRowDataCnt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(totRowDataCnt > 20001) {
|
||||
errMessage = "20000건 이상의 업로드는 데이터 부하로 업로드 할수 없습니다.";
|
||||
jr.setSuccess(false);
|
||||
jr.setMessage(errMessage);
|
||||
return jr;
|
||||
}
|
||||
|
||||
List<HashMap<String, String>> hashMapList = new ArrayList<HashMap<String, String>>();
|
||||
for(int i=2; i< sheet.getLastRowNum() + 2; i++){ //먼저 밸리데이션 체크(1줄은 생략)
|
||||
XSSFRow row = sheet.getRow(i); //열읽기
|
||||
if(null == row) {
|
||||
continue;
|
||||
}
|
||||
|
||||
HashMap<String, String> hashMap = new HashMap<>();
|
||||
// 행의 두번째 열(이름부터 받아오기)
|
||||
XSSFCell cell = null;
|
||||
boolean errSts = true;
|
||||
|
||||
for(int j = 0 ; j <= 7; j++){ //행읽기(6행까지나 2행까지만 필요)
|
||||
cellValue = "";
|
||||
cell = row.getCell(j); //이름/핸드폰/변환1/변환2/변환3/변환4/변환5
|
||||
if(null == cell || "".equals(cell.toString().trim())) { //셀에 값이 없으면
|
||||
if(j == 1) {
|
||||
if (sheet.getLastRowNum() == i) {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(null != cell){
|
||||
switch(cell.getCellType()){ //숫자타임을 문자로 변환
|
||||
case Cell.CELL_TYPE_NUMERIC:
|
||||
cell.setCellType(Cell.CELL_TYPE_STRING);
|
||||
}
|
||||
cellValue = StringUtil.getString(cell.getStringCellValue().trim()) ;
|
||||
}
|
||||
|
||||
// 항목 체크
|
||||
if(j == 0) {
|
||||
//배당일
|
||||
if(getItemChk("dividendDate", cellValue) && errSts) {
|
||||
hashMap.put("dividendDate", cellValue);
|
||||
}else {
|
||||
errItemCnt++;
|
||||
errItemLine += (i+1) + "행(배당일) ";
|
||||
errSts = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(j == 1) {
|
||||
//본사건번호
|
||||
if(getItemChk("prsctNo", cellValue) && errSts) {
|
||||
hashMap.put("prsctNo", cellValue);
|
||||
}else {
|
||||
errItemCnt++;
|
||||
errItemLine += (i+1) + "행(본사건번호) ";
|
||||
errSts = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(j == 2) {
|
||||
//조정사건번호
|
||||
if(getItemChk("prsctAdrNo", cellValue) && errSts) {
|
||||
hashMap.put("prsctAdrNo", cellValue);
|
||||
}else {
|
||||
errItemCnt++;
|
||||
errItemLine += (i+1) + "행(조정사건번호) ";
|
||||
errSts = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(j == 3) {
|
||||
//원고 이름
|
||||
if(getItemChk("plntfNm", cellValue) && errSts) {
|
||||
hashMap.put("plntfNm", cellValue);
|
||||
}else {
|
||||
errItemCnt++;
|
||||
errItemLine += (i+1) + "행(원고 이름) ";
|
||||
errSts = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(j == 4) {
|
||||
//원고 연락처
|
||||
if(getItemChk("plntfPhone", cellValue) && errSts) {
|
||||
hashMap.put("plntfPhone", cellValue);
|
||||
}else {
|
||||
errItemCnt++;
|
||||
errItemLine += (i+1) + "행(원고 연락처) ";
|
||||
errSts = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(j == 5) {
|
||||
//피고 이름
|
||||
if(getItemChk("dfndnNm", cellValue) && errSts) {
|
||||
hashMap.put("dfndnNm", cellValue);
|
||||
}else {
|
||||
errItemCnt++;
|
||||
errItemLine += (i+1) + "행(피고 이름) ";
|
||||
errSts = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(j == 6) {
|
||||
//피고 연락처
|
||||
if(getItemChk("dfndnPhone", cellValue) && errSts) {
|
||||
hashMap.put("dfndnPhone", cellValue);
|
||||
}else {
|
||||
errItemCnt++;
|
||||
errItemLine += (i+1) + "행(피고 연락처) ";
|
||||
errSts = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(j == 7) {
|
||||
//사건내용
|
||||
if(getItemChk("prsctCn", cellValue) && errSts) {
|
||||
hashMap.put("prsctCn", cellValue);
|
||||
}else {
|
||||
errItemCnt++;
|
||||
errItemLine += (i+1) + "행(사건내용) ";
|
||||
errSts = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(errSts) {
|
||||
hashMapList.add(hashMap);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//jr.setData(hashMapList);
|
||||
jr.setSuccess(true);
|
||||
|
||||
if(errItemCnt > 0) {
|
||||
jr.setMessage("유효하지 않은 형식의 데이터가 " + errItemCnt +"건입니다.\n" + errItemLine.trim());
|
||||
}else {
|
||||
jr.setMessage("");
|
||||
|
||||
//Step1. 데이터 변환
|
||||
List<AdrPrsctLinkVO> adrPrsctLinkList = new ArrayList<AdrPrsctLinkVO>();
|
||||
// List foreach 문
|
||||
for (HashMap<String, String> item : hashMapList) {
|
||||
AdrPrsctLinkVO adrPrsctLinkVO = new AdrPrsctLinkVO();
|
||||
adrPrsctLinkVO.setDividendDate(item.get("dividendDate"));
|
||||
adrPrsctLinkVO.setPrsctNo(item.get("prsctNo"));
|
||||
adrPrsctLinkVO.setPrsctAdrNo(item.get("prsctAdrNo"));
|
||||
adrPrsctLinkVO.setPlntfNm(item.get("plntfNm"));
|
||||
adrPrsctLinkVO.setPlntfPhone(item.get("plntfPhone"));
|
||||
adrPrsctLinkVO.setDfndnNm(item.get("dfndnNm"));
|
||||
adrPrsctLinkVO.setDfndnPhone(item.get("dfndnPhone"));
|
||||
adrPrsctLinkVO.setPrsctCn(item.get("prsctCn"));
|
||||
adrPrsctLinkVO.setFrstRegisterId(loginVO.getUniqId());
|
||||
adrPrsctLinkVO.setLastUpdusrId(loginVO.getUniqId());
|
||||
|
||||
//List Add
|
||||
adrPrsctLinkList.add(adrPrsctLinkVO);
|
||||
}
|
||||
|
||||
//Step2. 데이터 저장
|
||||
adrPrsctLinkService.adrPrsctLinkListInsert(adrPrsctLinkList);
|
||||
}
|
||||
} //xlsx 처리 끝
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
jr.setSuccess(false);
|
||||
jr.setMessage("로그인후 이용해주세요.");
|
||||
}
|
||||
|
||||
return jr;
|
||||
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
System.out.println("+++++++++++++++++ adrPrsctLinkSendExelAjax Controller Error !!! " + e.getMessage());
|
||||
jr.setSuccess(false);
|
||||
jr.setMessage("엑셀 데이터에 오류가 있습니다. 엑셀 데이터를 확인해 주세요.");
|
||||
return jr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 엑셀 항목 체크
|
||||
public boolean getItemChk(String type, String value) {
|
||||
boolean rtnVal = true;
|
||||
String dateRegExp = "^(19|20)[\\d]{2}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$";
|
||||
String phoneRegExp = "^(050[234567]{1}|01[016789]{1})-?[0-9]{3,4}-?[0-9]{4}$";
|
||||
|
||||
/*
|
||||
try {
|
||||
if(type.equals("dividendDate")) {
|
||||
//배당일
|
||||
if(!value.matches(dateRegExp)) {
|
||||
rtnVal = false;
|
||||
}
|
||||
}
|
||||
else if(type.equals("plntfPhone")) {
|
||||
//원고 연락처
|
||||
if(!value.matches(phoneRegExp)) {
|
||||
rtnVal = false;
|
||||
}
|
||||
}
|
||||
else if(type.equals("dfndnPhone")) {
|
||||
//피고 연락처
|
||||
if(!value.matches(phoneRegExp)) {
|
||||
rtnVal = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception e) {
|
||||
rtnVal = false;
|
||||
|
||||
System.out.println("엑셀 항목 체크");
|
||||
System.out.println("type : " + type);
|
||||
System.out.println("value : " + value);
|
||||
System.out.println("getItemChk : " + e.getMessage());
|
||||
}
|
||||
*/
|
||||
|
||||
return rtnVal;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2913,7 +2913,7 @@
|
||||
<bean name="prsctStrategy"
|
||||
class="egovframework.rte.fdl.idgnr.impl.strategy.EgovIdGnrStrategyImpl">
|
||||
<property name="prefix" value="PRSCT_" />
|
||||
<property name="cipers" value="13" />
|
||||
<property name="cipers" value="14" />
|
||||
<property name="fillChar" value="0" />
|
||||
</bean>
|
||||
|
||||
|
||||
@ -72,17 +72,18 @@ function fncExcel() {
|
||||
}
|
||||
}
|
||||
|
||||
function AppReq(){
|
||||
var form = $('<form id="payform"></form>');
|
||||
form.append($('<input/>', {type: 'hidden', name: 'mltApprSeq', value: 'test'}));
|
||||
form.appendTo('body');
|
||||
commonPopWindowopenForm("/kccadr/adrpr/adrPrsctLinkExcelPop.do" , "850", "700", "AppExcelPopup", form);
|
||||
form.remove();
|
||||
//엑셀 업로드
|
||||
function openExcelUploadPop() {
|
||||
window.open('/kccadr/adrpr/popup/adrPrsctLinkExcelRegistPop.do', 'openExcelUploadPop', 'width=700px,height=410px,scrollbars=no');
|
||||
}
|
||||
|
||||
</script>
|
||||
<title>검찰연계 목록</title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="pop" name="pop" method="post" onsubmit="return false;">
|
||||
</form>
|
||||
|
||||
<form id="listForm" name="listForm" method="post" onsubmit="return false;">
|
||||
<input type="hidden" name="pageIndex" value="<c:out value='${adrPrsctLinkVO.pageIndex}' default='1' />"/>
|
||||
<input type="hidden" name="searchSortCnd" value="<c:out value="${adrPrsctLinkVO.searchSortCnd}" />" />
|
||||
@ -155,7 +156,10 @@ function AppReq(){
|
||||
<div class="list_top">
|
||||
<div class="list_util">
|
||||
<div class="btn_wrap right">
|
||||
<%--
|
||||
<button type="button" class="btn_down_excel" onclick="fncExcel(); return false;">엑셀 다운로드</button>
|
||||
--%>
|
||||
<button type="button" class="btn_down_excel" onclick="openExcelUploadPop(); return false;">엑셀 업로드</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -197,9 +201,7 @@ function AppReq(){
|
||||
<c:out value="${(adrPrsctLinkVO.pageIndex - 1) * adrPrsctLinkVO.pageUnit + status.count}"/>
|
||||
</c:if>
|
||||
</td>
|
||||
<td>
|
||||
${list.prsctNo}
|
||||
</td>
|
||||
<td><a href="#none" onclick="fncGoDetail('${list.prsctSeq}');">${list.prsctNo}</a></td>
|
||||
<td><a href="#none" onclick="fncGoDetail('${list.prsctSeq}');">${list.prsctAdrNo}</a></td>
|
||||
<td>
|
||||
${list.plntfNm}
|
||||
|
||||
@ -0,0 +1,195 @@
|
||||
<!DOCTYPE html>
|
||||
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ 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="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<link href="<c:url value='/'/>css/jstree/themes/default/style.min.css" rel="stylesheet" type="text/css">
|
||||
<style>
|
||||
body {overflow: hidden;}
|
||||
</style>
|
||||
<script type="text/javascript" src="<c:url value="/validator.do"/>"></script>
|
||||
<script type="text/javascript" src="<c:url value='/js/EgovMultiFile.js'/>"></script>
|
||||
<script src="<c:url value='/js/jquery-1.12.4.min.js' />"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
$( document ).ready(function() {
|
||||
|
||||
//첨부파일 등록 하기(첨부파일 등록버튼처리)
|
||||
$('#filebutton').click(function (e) {
|
||||
e.preventDefault();
|
||||
$('#file_temp').click();
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
//엑셀 파일 저장
|
||||
function setExcelUploadSave(){
|
||||
var data = new FormData(document.excelForm);
|
||||
|
||||
//첨부파일 등록 체크
|
||||
if(!data.get("fileSize")){
|
||||
alert("첨부파일을 등록해 주세요");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(confirm("엑셀 등록을 진행하시겠습니까?")){
|
||||
_fileForm2.forEach(function(obj, idx) {
|
||||
if (obj) data.append("file0", obj.fileObj);
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
enctype: 'multipart/form-data',
|
||||
url: "/kccadr/adrpr/adrPrsctLinkSendExelAjax.do",
|
||||
data: data,
|
||||
dataType:'json',
|
||||
async: true,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
cache: false,
|
||||
//timeout: 600000,
|
||||
success: function (returnData) {
|
||||
//alert(JSON.stringify(returnData));
|
||||
if(returnData.success) {
|
||||
if(returnData.message != '' ){
|
||||
alert(returnData.message);
|
||||
}
|
||||
else {
|
||||
alert("저장에 성공했습니다.");
|
||||
|
||||
//부모창 새로고침후 닫기
|
||||
opener.location.reload();
|
||||
self.close();
|
||||
}
|
||||
}
|
||||
else{
|
||||
alert(returnData.message);
|
||||
return;
|
||||
}
|
||||
|
||||
},
|
||||
error: function (e) {
|
||||
alert("오류가 발생하였습니다.\n" + e);
|
||||
console.log("ERROR : ", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//닫기
|
||||
function fncGoClose() {
|
||||
self.close();
|
||||
}
|
||||
|
||||
</script>
|
||||
<title>검찰연계 엑셀 업로드</title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="excelForm" name="excelForm" onsubmit="return false;" method="post">
|
||||
<input type="hidden" name="limitcount" value="1" />
|
||||
<!-- cont -->
|
||||
<div class="cont_wrap">
|
||||
|
||||
<div style="float: right; padding-right: 40px;">
|
||||
<a href="">업로드 양식 다운로드</a>
|
||||
</div>
|
||||
|
||||
<div class="cont">
|
||||
<div class="tbType02">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col style="width: 20%;">
|
||||
<col style="width: 80%;">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>첨부파일</th>
|
||||
<td class="upload_area">
|
||||
<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>파일 명</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>파일 명</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_${fileList.atchFileId}_${fileList.fileSn} uploaded_obj">
|
||||
<input type="hidden" name="fileSize" class="item_file_size" value="${fileList.fileSize}">
|
||||
<td class="td_filename">
|
||||
<!-- <img src="/direct/img/upload_hwp_img.png" alt="" /> -->
|
||||
<span class="file_name_text">${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>
|
||||
<button type="button" class="btn_del" onclick="delAtchFile('${fileList.atchFileId}', '${fileList.fileSn}'); return false;"><i></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="btn_wrap btn_layout01">
|
||||
<div class="area_left" style="width: 350px;"></div>
|
||||
<div class="area_right">
|
||||
<button class="btnType06" onclick="setExcelUploadSave(); return false;">저장</button>
|
||||
<button type="button" class="btnType03" onclick="fncGoClose();">닫기</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue
Block a user