Merge branch 'jsp'
This commit is contained in:
commit
74adb80629
@ -33,11 +33,9 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import egovframework.rte.psl.dataaccess.util.EgovMap;
|
||||
import seed.com.gtm.util.CommonsCompress;
|
||||
import seed.com.gtm.util.JSPUtil;
|
||||
|
||||
import egovframework.rte.psl.dataaccess.util.EgovMap;
|
||||
|
||||
import seed.utils.SeedDateUtil;
|
||||
import seed.utils.SeedProperties;
|
||||
import seed.utils.SeedUtils;
|
||||
@ -91,7 +89,7 @@ public class SeedFileController {
|
||||
|
||||
SeedProperties seedProperties = new SeedProperties();
|
||||
String tempPath = "";
|
||||
if(funcType.equals("trublchargermng")){
|
||||
if(funcType.equals("trublchargermng") || funcType.equals("trublchargermng2")){
|
||||
tempPath = globalRootPath;
|
||||
}else{
|
||||
tempPath = globalTempPath;
|
||||
@ -132,7 +130,7 @@ public class SeedFileController {
|
||||
reFileName = reFileName+"."+fileType;
|
||||
File makeFile = null;
|
||||
|
||||
if(funcType.equals("trublchargermng")){
|
||||
if(funcType.equals("trublchargermng") || funcType.equals("trublchargermng2")){
|
||||
//위원회 사지파일만 site 밑으로 저장
|
||||
makeFile = new File(tempPath+"/"+siteIdx+"/upload/tempFiles/"+funcType+"/"+reFileName);
|
||||
}else{
|
||||
|
||||
@ -47,138 +47,138 @@ public class SeedFileService {
|
||||
private String globalRootPath;
|
||||
|
||||
public void fileInsert(Map<String, Object> paramMap, HttpServletRequest request, HttpSession session){
|
||||
|
||||
String siteIdx = SeedUtils.setReplaceNull(session.getAttribute("siteIdx"));
|
||||
if(siteIdx.equals("")){
|
||||
siteIdx = SeedUtils.setReplaceNull(request.getParameter("siteIdx"));
|
||||
}
|
||||
String fileFuncType = (String)paramMap.get("fileFuncType");
|
||||
String fileChgType = (String)paramMap.get("fileChgType");
|
||||
|
||||
SeedProperties seedProperties = new SeedProperties();
|
||||
|
||||
/*AS-IS 분쟁조정 첨부파일 경로 설정*/
|
||||
/*String rootPath = null;
|
||||
String tempPath = seedProperties.getConfigValue("file.temp.path");
|
||||
if(fileFuncType.equals("trublchargermng")){
|
||||
rootPath = seedProperties.getConfigValue("root.path");
|
||||
}else{
|
||||
rootPath = seedProperties.getConfigValue("file.real.path");
|
||||
}*/
|
||||
|
||||
String rootPath = null;
|
||||
String tempPath = globalTempPath;
|
||||
if(fileFuncType.equals("trublchargermng") || fileFuncType.indexOf("X-")>-1){ //gw 연동용 파일
|
||||
rootPath = globalRootPath;
|
||||
}else{
|
||||
rootPath = globalRealPath;
|
||||
}
|
||||
|
||||
|
||||
|
||||
SeedDateUtil seedDateUtil = new SeedDateUtil();
|
||||
String toDate = seedDateUtil.getSimpleDateFormat(new Date(), "yyyyMMdd");
|
||||
String renameDate = seedDateUtil.getSimpleDateFormat(new Date(), "yyyyMMddHHmmss");
|
||||
|
||||
SeedUtils.setSeedMkDirs(rootPath + "/"+siteIdx+"/"+ fileFuncType);
|
||||
|
||||
int fileCnt = 0;
|
||||
|
||||
String[] uploadFileName = request.getParameterValues("uploadFileName");
|
||||
String[] uploadFileReName = request.getParameterValues("uploadFileReName");
|
||||
String[] copyContractYnList = request.getParameterValues("copyContractYn");
|
||||
System.out.println(">>>>>>> fileInsert Start <<<<<<<<<");
|
||||
|
||||
try {
|
||||
System.out.println("uploadFileName");
|
||||
/*System.out.println(uploadFileName.length); */
|
||||
}catch(Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
if(uploadFileName!=null && uploadFileName.length > 0){
|
||||
|
||||
for(int i=0; i<uploadFileName.length; i++){
|
||||
|
||||
String uploadFileNameData = uploadFileName[i];
|
||||
String uploadFileReNameData = uploadFileReName[i];
|
||||
String copyContractYn = "";
|
||||
if(copyContractYnList != null){
|
||||
copyContractYn = copyContractYnList[i];
|
||||
}
|
||||
|
||||
String fileType = uploadFileNameData.substring(uploadFileNameData.lastIndexOf(".")+1, uploadFileNameData.length());
|
||||
String reFileName = renameDate + "_" + SeedUtils.getSeedMD5Code(String.valueOf(SeedUtils.getRandom(999,1)));
|
||||
|
||||
File oldFile = null;
|
||||
if(fileFuncType.equals("trublchargermng") || fileFuncType.indexOf("X-")>-1){
|
||||
oldFile = new File(rootPath + "/"+siteIdx+"/upload/tempFiles/"+fileFuncType+ "/" + uploadFileReNameData);
|
||||
}else{
|
||||
oldFile = new File(tempPath + "/"+siteIdx+"/"+fileFuncType+ "/" + uploadFileReNameData);
|
||||
}
|
||||
|
||||
System.out.println(oldFile.getAbsolutePath());
|
||||
|
||||
|
||||
if(oldFile.exists()){
|
||||
Long fileSize = oldFile.length();
|
||||
String filePath ="";
|
||||
if(fileFuncType.equals("trublchargermng") || fileFuncType.indexOf("X-")>-1){
|
||||
SeedUtils.setSeedFileCopy(rootPath + "/"+siteIdx+"/upload/tempFiles/"+fileFuncType+ "/" + uploadFileReNameData,
|
||||
rootPath + "/"+siteIdx+"/upload/uploadFiles/"+fileFuncType+"/"+reFileName+"."+fileType);
|
||||
|
||||
filePath = rootPath + "/"+siteIdx+"/upload/uploadFiles/"+fileFuncType+"/"+reFileName+"."+fileType;
|
||||
String siteIdx = SeedUtils.setReplaceNull(session.getAttribute("siteIdx"));
|
||||
if(siteIdx.equals("")){
|
||||
siteIdx = SeedUtils.setReplaceNull(request.getParameter("siteIdx"));
|
||||
}
|
||||
String fileFuncType = (String)paramMap.get("fileFuncType");
|
||||
String fileChgType = (String)paramMap.get("fileChgType");
|
||||
|
||||
SeedProperties seedProperties = new SeedProperties();
|
||||
|
||||
/*AS-IS 분쟁조정 첨부파일 경로 설정*/
|
||||
/*String rootPath = null;
|
||||
String tempPath = seedProperties.getConfigValue("file.temp.path");
|
||||
if(fileFuncType.equals("trublchargermng")){
|
||||
rootPath = seedProperties.getConfigValue("root.path");
|
||||
}else{
|
||||
rootPath = seedProperties.getConfigValue("file.real.path");
|
||||
}*/
|
||||
|
||||
String rootPath = null;
|
||||
String tempPath = globalTempPath;
|
||||
if(fileFuncType.equals("trublchargermng") || fileFuncType.equals("trublchargermng2") || fileFuncType.indexOf("X-")>-1){ //gw 연동용 파일
|
||||
rootPath = globalRootPath;
|
||||
}else{
|
||||
rootPath = globalRealPath;
|
||||
}
|
||||
|
||||
|
||||
|
||||
SeedDateUtil seedDateUtil = new SeedDateUtil();
|
||||
String toDate = seedDateUtil.getSimpleDateFormat(new Date(), "yyyyMMdd");
|
||||
String renameDate = seedDateUtil.getSimpleDateFormat(new Date(), "yyyyMMddHHmmss");
|
||||
|
||||
SeedUtils.setSeedMkDirs(rootPath + "/"+siteIdx+"/"+ fileFuncType);
|
||||
|
||||
int fileCnt = 0;
|
||||
|
||||
String[] uploadFileName = request.getParameterValues("uploadFileName");
|
||||
String[] uploadFileReName = request.getParameterValues("uploadFileReName");
|
||||
String[] copyContractYnList = request.getParameterValues("copyContractYn");
|
||||
if(fileFuncType.equals("trublchargermng2")){
|
||||
uploadFileName = request.getParameterValues("uploadFileName2");
|
||||
uploadFileReName = request.getParameterValues("uploadFileReName2");
|
||||
}
|
||||
|
||||
try {
|
||||
System.out.println("uploadFileName");
|
||||
/*System.out.println(uploadFileName.length); */
|
||||
}catch(Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
if(uploadFileName!=null && uploadFileName.length > 0){
|
||||
|
||||
for(int i=0; i<uploadFileName.length; i++){
|
||||
|
||||
String uploadFileNameData = uploadFileName[i];
|
||||
String uploadFileReNameData = uploadFileReName[i];
|
||||
String copyContractYn = "";
|
||||
if(copyContractYnList != null){
|
||||
copyContractYn = copyContractYnList[i];
|
||||
}
|
||||
|
||||
String fileType = uploadFileNameData.substring(uploadFileNameData.lastIndexOf(".")+1, uploadFileNameData.length());
|
||||
String reFileName = renameDate + "_" + SeedUtils.getSeedMD5Code(String.valueOf(SeedUtils.getRandom(999,1)));
|
||||
|
||||
File oldFile = null;
|
||||
if(fileFuncType.equals("trublchargermng") || fileFuncType.equals("trublchargermng2") || fileFuncType.indexOf("X-")>-1){
|
||||
oldFile = new File(rootPath + "/"+siteIdx+"/upload/tempFiles/"+fileFuncType+ "/" + uploadFileReNameData);
|
||||
}else{
|
||||
|
||||
//241029 - 첨부파일 복사를 위해 real 파일 생성 처리
|
||||
/* File makeFile = null;
|
||||
makeFile = new File(rootPath + "/"+siteIdx+"/"+fileFuncType+"/"+reFileName);
|
||||
if(! makeFile.exists()){
|
||||
//경로에 해당하는 디렉토리들을 생성
|
||||
if(makeFile.getParentFile().mkdirs()){
|
||||
try {
|
||||
makeFile.createNewFile(); //이후 파일 생성
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
SeedUtils.setSeedFileCopy(tempPath + "/"+siteIdx+"/"+fileFuncType + "/" + uploadFileReNameData,
|
||||
rootPath + "/"+siteIdx+"/"+fileFuncType+"/"+reFileName+"."+fileType);
|
||||
|
||||
filePath = rootPath + "/"+siteIdx+"/"+fileFuncType+"/"+reFileName+"."+fileType;
|
||||
oldFile = new File(tempPath + "/"+siteIdx+"/"+fileFuncType+ "/" + uploadFileReNameData);
|
||||
}
|
||||
|
||||
System.out.println(oldFile.getAbsolutePath());
|
||||
|
||||
paramMap.put("uploadFileNameData", uploadFileNameData);
|
||||
paramMap.put("reFileName", reFileName+"."+fileType);
|
||||
paramMap.put("fileSize", fileSize);
|
||||
paramMap.put("fileType", fileType);
|
||||
paramMap.put("filePath", filePath);
|
||||
paramMap.put("copyContractYn", copyContractYn);
|
||||
//파일타입에 따라서 sql분기
|
||||
if(fileFuncType.equals("mediation")){
|
||||
System.out.println(oldFile.getAbsolutePath());
|
||||
dao.caseInsert(paramMap);
|
||||
}else{
|
||||
System.out.println(oldFile.getAbsolutePath());
|
||||
|
||||
if (!"".equals(fileChgType)) {
|
||||
paramMap.put("fileFuncType", fileChgType);
|
||||
System.out.println("oldFile.getAbsolutePath() 1 : " + oldFile.getAbsolutePath());
|
||||
|
||||
if(oldFile.exists()){
|
||||
Long fileSize = oldFile.length();
|
||||
String filePath ="";
|
||||
if(fileFuncType.equals("trublchargermng") || fileFuncType.equals("trublchargermng2") || fileFuncType.indexOf("X-")>-1){
|
||||
SeedUtils.setSeedFileCopy(rootPath + "/"+siteIdx+"/upload/tempFiles/"+fileFuncType+ "/" + uploadFileReNameData,
|
||||
rootPath + "/"+siteIdx+"/upload/uploadFiles/"+fileFuncType+"/"+reFileName+"."+fileType);
|
||||
|
||||
filePath = rootPath + "/"+siteIdx+"/upload/uploadFiles/"+fileFuncType+"/"+reFileName+"."+fileType;
|
||||
}else{
|
||||
|
||||
SeedUtils.setSeedFileCopy(tempPath + "/"+siteIdx+"/"+fileFuncType + "/" + uploadFileReNameData,
|
||||
rootPath + "/"+siteIdx+"/"+fileFuncType+"/"+reFileName+"."+fileType);
|
||||
|
||||
filePath = rootPath + "/"+siteIdx+"/"+fileFuncType+"/"+reFileName+"."+fileType;
|
||||
}
|
||||
|
||||
System.out.println(paramMap.get("fileText").toString());
|
||||
System.out.println("oldFile.getAbsolutePath() 2 : " + oldFile.getAbsolutePath());
|
||||
|
||||
dao.fileInsert(paramMap);
|
||||
paramMap.put("uploadFileNameData", uploadFileNameData);
|
||||
paramMap.put("reFileName", reFileName+"."+fileType);
|
||||
paramMap.put("fileSize", fileSize);
|
||||
paramMap.put("fileType", fileType);
|
||||
paramMap.put("filePath", filePath);
|
||||
paramMap.put("copyContractYn", copyContractYn);
|
||||
//파일타입에 따라서 sql분기
|
||||
if(fileFuncType.equals("mediation")){
|
||||
System.out.println("mediation : " + oldFile.getAbsolutePath());
|
||||
dao.caseInsert(paramMap);
|
||||
}else{
|
||||
System.out.println("etc : " + oldFile.getAbsolutePath());
|
||||
System.out.println("fileChgType : " + fileChgType);
|
||||
|
||||
if (!"".equals(fileChgType)) {
|
||||
paramMap.put("fileFuncType", fileChgType);
|
||||
}
|
||||
|
||||
//System.out.println("fileText : " + paramMap.get("fileText").toString());
|
||||
|
||||
dao.fileInsert(paramMap);
|
||||
}
|
||||
|
||||
System.out.println("oldFile.delete()");
|
||||
oldFile.delete();
|
||||
fileCnt = fileCnt+1;
|
||||
}
|
||||
|
||||
oldFile.delete();
|
||||
fileCnt = fileCnt+1;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("fileInsert Error : " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
|
||||
System.out.println(">>>>>>> fileInsert End <<<<<<<<<");
|
||||
}
|
||||
|
||||
public void fileInsertEgov(EgovMap paramMap, HttpServletRequest request, HttpSession session)throws Exception {
|
||||
|
||||
@ -15,8 +15,8 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import seed.com.gtm.seedfile.SeedFileService;
|
||||
import seed.com.gtm.util.PageMaker;
|
||||
import seed.com.gtm.util.Criteria;
|
||||
import seed.com.gtm.util.PageMaker;
|
||||
import seed.utils.SeedUtils;
|
||||
|
||||
@Controller
|
||||
@ -81,9 +81,26 @@ public class TrublchargermngController {
|
||||
|
||||
paramMap.put("dataIdx", paramMap.get("seq"));
|
||||
|
||||
fileService.fileInsert(paramMap, request, session);
|
||||
|
||||
//명함이미지 추가
|
||||
String fileFuncType = (String)paramMap.get("fileFuncType");
|
||||
if(fileFuncType.equals("trublchargermng")){
|
||||
paramMap.put("fileFuncType", fileFuncType);
|
||||
paramMap.put("fileChgType", fileFuncType);
|
||||
|
||||
System.out.println("=====> 명함이미지 추가");
|
||||
fileService.fileInsert(paramMap, request, session);
|
||||
}
|
||||
|
||||
//도장이미지 추가
|
||||
String fileFuncType2 = (String)paramMap.get("fileFuncType2");
|
||||
if(fileFuncType2.equals("trublchargermng2")){
|
||||
paramMap.put("fileFuncType", fileFuncType2);
|
||||
paramMap.put("fileChgType", fileFuncType2);
|
||||
|
||||
System.out.println("=====> 도장이미지 추가");
|
||||
fileService.fileInsert(paramMap, request, session);
|
||||
}
|
||||
|
||||
map.put("message", "common.message.reg");
|
||||
map.put("url", "/gtm/case/trublchargermng/list.do");
|
||||
|
||||
@ -182,12 +199,18 @@ public class TrublchargermngController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//명함사진 List
|
||||
paramMap.put("dataIdx", paramMap.get("memberNo"));
|
||||
paramMap.put("fileFuncType", "trublchargermng");
|
||||
List<Map<String, Object>> fileList = fileService.fileList(paramMap);
|
||||
model.addAttribute("fileList", fileList);
|
||||
|
||||
//도장사진 List
|
||||
paramMap.put("dataIdx", paramMap.get("memberNo"));
|
||||
paramMap.put("fileFuncType", "trublchargermng2");
|
||||
List<Map<String, Object>> fileList2 = fileService.fileList(paramMap);
|
||||
model.addAttribute("fileList2", fileList2);
|
||||
|
||||
return "/seed/_extra/gtm/trublchargermng/edit";
|
||||
}
|
||||
|
||||
@ -240,10 +263,33 @@ public class TrublchargermngController {
|
||||
//성별은 MEMBER_ITEM_B2, 등급은 MEMBER_ITEM_C3, 비고 MEMBER_ITEM_D4
|
||||
|
||||
service.trublchargermngUpdate(paramMap);
|
||||
|
||||
|
||||
paramMap.put("dataIdx", paramMap.get("memberNo"));
|
||||
fileService.fileInsert(paramMap, request, session);
|
||||
fileService.fileDel(paramMap);
|
||||
//명함이미지 추가
|
||||
String fileFuncType = (String)paramMap.get("fileFuncType");
|
||||
if(fileFuncType.equals("trublchargermng")){
|
||||
paramMap.put("fileFuncType", fileFuncType);
|
||||
paramMap.put("fileChgType", fileFuncType);
|
||||
|
||||
System.out.println("=====> 명함이미지 추가");
|
||||
fileService.fileInsert(paramMap, request, session);
|
||||
fileService.fileDel(paramMap);
|
||||
}
|
||||
|
||||
//도장이미지 추가
|
||||
String fileFuncType2 = (String)paramMap.get("fileFuncType2");
|
||||
String uploadFileCnt2 = (String)paramMap.get("uploadFileCnt2");
|
||||
String deleteFileData2 = (String)paramMap.get("deleteFileData2");
|
||||
if(fileFuncType2.equals("trublchargermng2")){
|
||||
paramMap.put("fileFuncType", fileFuncType2);
|
||||
paramMap.put("fileChgType", fileFuncType2);
|
||||
paramMap.put("uploadFileCnt", uploadFileCnt2);
|
||||
paramMap.put("deleteFileData", deleteFileData2);
|
||||
|
||||
System.out.println("=====> 도장이미지 추가");
|
||||
fileService.fileInsert(paramMap, request, session);
|
||||
fileService.fileDel(paramMap);
|
||||
}
|
||||
|
||||
map.put("message", "common.message.mod");
|
||||
map.put("url", "/gtm/case/trublchargermng/list.do");
|
||||
|
||||
@ -125,7 +125,7 @@
|
||||
</div>
|
||||
|
||||
<div class="bbs-view-item">
|
||||
<p class="item-title"><span style="color: red">*</span> 사진</p>
|
||||
<p class="item-title"><span style="color: red">*</span> 사진(명함)</p>
|
||||
<div class="item-box">
|
||||
<ul class="upFileHtml cs_file_list w100per" id="upFileHtml" style="margin:0;">
|
||||
<li style="display: block;"><img src="/site/case/upload/uploadFiles/trublchargermng/${fileList[0].EXTRA_FILE_RENAME}" id="trubleImg" style="width:140px;height:180px;" alt="사진이미지"></li>
|
||||
@ -151,6 +151,33 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bbs-view-item">
|
||||
<p class="item-title"><span style="color: red">*</span> 사진(도장)</p>
|
||||
<div class="item-box">
|
||||
<ul class="upFileHtml cs_file_list w100per" id="upFileHtml2" style="margin:0;">
|
||||
<li style="display: block;"><img src="/site/case/upload/uploadFiles/trublchargermng2/${fileList2[0].EXTRA_FILE_RENAME}" id="trubleImg2" style="width:140px;height:180px;" alt="사진이미지"></li>
|
||||
<c:forEach items="${fileList2}" var="list" varStatus="status">
|
||||
<li id="fileUploadP${status.count}" class="bbsFileHtml file_row" style="display:flex;background:#f4f5f6;margin:0;">
|
||||
<img src="/kofair_case_seed/adm/images/component/icon_file_clip_blue.png">
|
||||
<span><a href="/seed/extra/down/file.do?dataIdx=${list.EXTRA_FILE_IDX}&funcType=${list.EXTRA_FUNC_TYPE}&pathKey1=${siteIdx}">${list.EXTRA_FILE_NAME}</a></span>
|
||||
<a href="javascript:;" onclick="javascript:jf_delete_file2('${status.count}', '${list.EXTRA_FILE_SIZE}');deleteImg2();" class="del ml7 btn_file_del"><i></i></a>
|
||||
<input type="hidden" name="fileIdx2" value="${list.EXTRA_FILE_IDX}" class="fileIdxClass"/>
|
||||
</li>
|
||||
</c:forEach>
|
||||
</ul>
|
||||
<div class="temp-file-area cs_file_box">
|
||||
<p style="display: inline-block;">
|
||||
- 본인의 도장사진을 등록해주세요.<br>
|
||||
- gif, jpg 파일만 등록 가능합니다.
|
||||
</p>
|
||||
<label for="upFile2" class="btn btn_text blue_border btn_36 temp-file-button" style="display:flex;justify-content:center;align-items:center;">첨부파일</label>
|
||||
</div>
|
||||
<input type="hidden" name="fileFuncType2" value="trublchargermng2" />
|
||||
<input type="hidden" name="uploadFileCnt2" value="0" id="uploadFileCntId2" />
|
||||
<input type="hidden" name="deleteFileData2" value="" id="deleteFileDataId2" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bbs-view-item">
|
||||
<p class="item-title"><span style="color: red">*</span> 이메일</p>
|
||||
<div class="item-box">
|
||||
@ -328,6 +355,14 @@
|
||||
<input type="file" name="upFile" id="upFile" class="essential temp-file-hideen" onchange="checkFileNo();" required title="첨부파일" value="" style="ime-mode: disabled;" >
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form id="fileTempUpFrm2" action="/seed/extra/temp/file.do" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="fileFuncType" value="trublchargermng2" />
|
||||
<div class="temp-file-area">
|
||||
<input type="file" name="upFile2" id="upFile2" class="essential temp-file-hideen" onchange="checkFileNo2();;" required title="첨부파일" value="" style="ime-mode: disabled;" >
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form name="paramFrm" id="paramFrm" action="/gtm/case/trublchargermng/list.do" method="get">
|
||||
<input type="hidden" name="searchGubun" value="${param.searchGubun}">
|
||||
<input type="hidden" name="searchName" value="${param.searchName}">
|
||||
@ -632,11 +667,27 @@
|
||||
|
||||
}
|
||||
|
||||
function checkFileNo2(){
|
||||
var liSize = $("#upFileHtml2 li").size();
|
||||
|
||||
if(liSize > 1){
|
||||
alert("이미지는 한개만 업로드 가능합니다. 삭제후 업로드 해 주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
fileTempUp2('trublchargermng2');
|
||||
|
||||
}
|
||||
|
||||
function deleteImg(){
|
||||
$("#trubleImg").attr("src","");
|
||||
}
|
||||
|
||||
function deleteImg2(){
|
||||
$("#trubleImg2").attr("src","");
|
||||
}
|
||||
</script>
|
||||
<script src="/js/jquery.form.js"></script>
|
||||
<script src="/js/seedFileUtil.js"></script>
|
||||
<script src="/js/seedFileUtil.js?date=202505191001"></script>
|
||||
</body>
|
||||
</html>
|
||||
@ -125,7 +125,7 @@
|
||||
</div>
|
||||
|
||||
<div class="bbs-view-item">
|
||||
<p class="item-title"><span style="color: red">*</span> 사진</p>
|
||||
<p class="item-title"><span style="color: red">*</span> 사진(명함)</p>
|
||||
<div class="item-box">
|
||||
<img src="" id="trubleImg" style="width:140px;height:180px " alt="사진이미지">
|
||||
<p style="display:inline-block;">
|
||||
@ -146,6 +146,28 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bbs-view-item">
|
||||
<p class="item-title"><span style="color: red">*</span> 사진(도장)</p>
|
||||
<div class="item-box">
|
||||
<img src="" id="trubleImg2" style="width:140px;height:180px " alt="사진이미지">
|
||||
<p style="display:inline-block;">
|
||||
- 본인의 도장사진을 등록해주세요.<br>
|
||||
- gif, jpg 파일만 등록 가능합니다.
|
||||
</p>
|
||||
<div class="temp-file-area">
|
||||
<label for="upFile2" class="temp-file-button btn btn_text btn_36 blue_border" style="display:flex;justify-content:center;align-items:center;">첨부파일</label>
|
||||
</div>
|
||||
<ul class="upFileHtml" id="upFileHtml2">
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<input type="hidden" name="fileFuncType2" value="trublchargermng2" />
|
||||
<input type="hidden" name="uploadFileCnt2" value="0" id="uploadFileCntId2" />
|
||||
<input type="hidden" name="deleteFileData2" value="" id="deleteFileDataId2" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bbs-view-item">
|
||||
<p class="item-title"><span style="color: red">*</span> 이메일</p>
|
||||
<div class="item-box email_wrap">
|
||||
@ -313,6 +335,13 @@
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form id="fileTempUpFrm2" action="/seed/extra/temp/file.do" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="fileFuncType" value="trublchargermng2" />
|
||||
<div class="temp-file-area">
|
||||
<input type="file" name="upFile2" id="upFile2" class="essential temp-file-hideen" onchange="fileTempUp2('trublchargermng2');" required title="첨부파일" value="" style="ime-mode: disabled;" >
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form name="paramFrm" id="paramFrm" action="/gtm/case/trublchargermng/list.do" method="get">
|
||||
<input type="hidden" name="searchGubun" value="${param.searchGubun}">
|
||||
<input type="hidden" name="searchName" value="${param.searchName}">
|
||||
@ -547,6 +576,6 @@
|
||||
|
||||
</script>
|
||||
<script src="/js/jquery.form.js"></script>
|
||||
<script src="/js/seedFileUtil.js"></script>
|
||||
<script src="/js/seedFileUtil.js?date=202505191001"></script>
|
||||
</body>
|
||||
</html>
|
||||
@ -39,7 +39,44 @@ function fileTempUp(fileFuncType){
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#fileTempUpFrm").submit();
|
||||
$("#fileTempUpFrm").submit();
|
||||
}
|
||||
|
||||
function fileTempUp2(fileFuncType){
|
||||
|
||||
if($("#upFile2").val() == ""){
|
||||
alert("파일을 선택해 주세요");
|
||||
$("#upFile").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
var val = $("#upFile2").val().split("\\");
|
||||
var fileName = val[val.length-1]; //마지막 화일명
|
||||
var fileType = fileName.substring(fileName.lastIndexOf("."));//확장자빼오기
|
||||
|
||||
var extArray = null;
|
||||
if(fileFuncType == "trublchargermng2"){
|
||||
extArray = new Array("jpeg","jpg","gif");
|
||||
}else{
|
||||
extArray = new Array("txt","jpeg","jpg","png","gif","bmp","mp3","mp4","hwp","doc","docx","xls","xlsx","ppt","pptx","pdf","zip","alz","hwpx");
|
||||
}
|
||||
|
||||
|
||||
var extChk = false;
|
||||
|
||||
for(var f=0; f<extArray.length; f++){
|
||||
if("."+extArray[f] == fileType.toLowerCase()){
|
||||
extChk = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!extChk){
|
||||
alert("업로드 할 수 없는 파일 형식 입니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#fileTempUpFrm2").submit();
|
||||
}
|
||||
|
||||
$(function(){
|
||||
@ -62,6 +99,25 @@ $(function(){
|
||||
alert("작업이 실패 했습니다.");
|
||||
}
|
||||
});
|
||||
|
||||
$('#fileTempUpFrm2').ajaxForm({
|
||||
//보내기전 validation check가 필요할경우
|
||||
beforeSubmit: function (data, form, option) {
|
||||
//alert("전송전!!");
|
||||
//return false;
|
||||
},
|
||||
//submit이후의 처리
|
||||
success: function(response, status){
|
||||
jf_upload_set2(response.fileName, response.reFileName, response.fileSize, response.fileType);
|
||||
if(response.funcType == "trublchargermng2"){
|
||||
$("#trubleImg2").attr("src","/site/case/upload/tempFiles/trublchargermng2/"+response.reFileName);
|
||||
}
|
||||
},
|
||||
//ajax error
|
||||
error: function(){
|
||||
alert("작업이 실패 했습니다.");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var fileCountFix = 0;
|
||||
@ -100,6 +156,41 @@ function jf_upload_set(fileName, reFileName, fileSize, fileType){
|
||||
$("#upFileHtml").append(fileHtml);
|
||||
}
|
||||
|
||||
function jf_upload_set2(fileName, reFileName, fileSize, fileType){
|
||||
|
||||
var sizeData = parseInt(fileSize);
|
||||
sizeData = sizeData/1024/1024;
|
||||
var totFileSize = sizeData;
|
||||
sizeData = sizeData.toFixed(2);
|
||||
|
||||
if(totFileSize > 500){
|
||||
alert("첨부파일 크기가 500Mbyte를 넘었습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var upFileLiLength = parseInt($("#uploadFileCntId2").val());
|
||||
upFileLiLength = upFileLiLength+1;
|
||||
$("#uploadFileCntId2").val(upFileLiLength);
|
||||
|
||||
if(fileCountFix==0){
|
||||
fileCountFix = upFileLiLength;
|
||||
}
|
||||
|
||||
fileCountFix = fileCountFix+1;
|
||||
|
||||
var fileHtml = "<li id=\"fileUploadP"+fileCountFix+"\">";
|
||||
fileHtml = fileHtml+"<img src=\"/img/user/bbs/icon_file.gif\" alt=\"gif\"> ";
|
||||
fileHtml = fileHtml+fileName+" ("+sizeData+")";
|
||||
fileHtml = fileHtml+" ";
|
||||
fileHtml = fileHtml+"<a href=\"javascript:;\" onclick=\"javascript:jf_delete_file2('"+fileCountFix+"', '"+sizeData+"');\"><img src=\"/img/user/bbs/btn_file_del.png\" alt=\"삭제\"></a>";
|
||||
fileHtml = fileHtml+"<input type=\"hidden\" name=\"fileIdx2\" value=\"\" class=\"fileIdxClass\"/>";
|
||||
fileHtml = fileHtml+"<input type=\"hidden\" name=\"uploadFileName2\" value=\""+fileName+"\" />";
|
||||
fileHtml = fileHtml+"<input type=\"hidden\" name=\"uploadFileReName2\" value=\""+reFileName+"\" />";
|
||||
fileHtml = fileHtml+"</li>";
|
||||
$("#upFileHtml2").append(fileHtml);
|
||||
}
|
||||
|
||||
function jf_delete_file(deleteNum, sizeData){
|
||||
|
||||
var fileIdx = $("#upFileHtml > #fileUploadP"+deleteNum).children(".fileIdxClass").val();
|
||||
@ -124,3 +215,28 @@ function jf_delete_file(deleteNum, sizeData){
|
||||
totFileSize = 0;
|
||||
}
|
||||
}
|
||||
|
||||
function jf_delete_file2(deleteNum, sizeData){
|
||||
|
||||
var fileIdx = $("#upFileHtml2 > #fileUploadP"+deleteNum).children(".fileIdxClass").val();
|
||||
|
||||
if(fileIdx != ""){
|
||||
var deleteFileData = $("#deleteFileDataId2").val();
|
||||
if(deleteFileData != ""){
|
||||
deleteFileData = deleteFileData+","+fileIdx;
|
||||
}else{
|
||||
deleteFileData = fileIdx;
|
||||
}
|
||||
|
||||
$("#deleteFileDataId2").val(deleteFileData);
|
||||
|
||||
}
|
||||
|
||||
$("#upFileHtml2 > #fileUploadP"+deleteNum).remove();
|
||||
|
||||
totFileSize = totFileSize-sizeData;
|
||||
|
||||
if(totFileSize < 0){
|
||||
totFileSize = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user