diff --git a/src/main/java/kcc/let/uat/uia/service/SocialCertVO.java b/src/main/java/kcc/let/uat/uia/service/SocialCertVO.java new file mode 100644 index 00000000..f25b4626 --- /dev/null +++ b/src/main/java/kcc/let/uat/uia/service/SocialCertVO.java @@ -0,0 +1,26 @@ +package kcc.let.uat.uia.service; + +import java.io.Serializable; + +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@NoArgsConstructor +public class SocialCertVO implements Serializable{ + + private static final long serialVersionUID = 1L; + + + private String name; + private String phone; + private String birth; + + private String receiptID; + private String status; + + + +} diff --git a/src/main/java/kcc/let/uat/uia/web/SocialCertController.java b/src/main/java/kcc/let/uat/uia/web/SocialCertController.java index 0039287a..20262c39 100644 --- a/src/main/java/kcc/let/uat/uia/web/SocialCertController.java +++ b/src/main/java/kcc/let/uat/uia/web/SocialCertController.java @@ -1,8 +1,15 @@ package kcc.let.uat.uia.web; -import org.apache.poi.poifs.crypt.Decryptor; +import java.util.HashMap; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; @@ -11,6 +18,11 @@ import com.barocert.BarocertException; import com.barocert.kakaocert.KakaocertService; import com.barocert.navercert.NavercertService; +import kcc.let.uat.uia.service.SocialCertVO; +import seed.utils.SeedUtils; +import seed.utils.kCertDecryptor; +import seed.utils.nCertDecryptor; + /** * @packageName : kcc.let.uat.uia.web * @fileName : SocialCertController.java @@ -22,6 +34,17 @@ import com.barocert.navercert.NavercertService; * ----------------------------------------------------------- * 2024.11.21 JunHo Lee 최초 생성 */ +/** +* @packageName : kcc.let.uat.uia.web +* @fileName : SocialCertController.java +* @author : JunHo Lee +* @date : 2024.11.21 +* @description : +* =========================================================== +* DATE AUTHOR NOTE +* ----------------------------------------------------------- +* 2024.11.21 JunHo Lee 최초 생성 +*/ @Controller public class SocialCertController { @@ -37,29 +60,60 @@ public class SocialCertController { @Value("#{KAKAO_CONFIG.ClientCode}") private String KakaoClientCode; + + + /** - * 본인인증 요청 - * - * @param clientCode - * 이용기관코드 - * @param identity - * 본인인증 요청정보 - * @return ResponseVerify - * 본인인증 요청 응답정보 - * @throws BarocertException - */ - @RequestMapping(value = "/web/user/cert/nCert.do") - public String requestIdentity(Model m) throws BarocertException { + * @methodName : nCertStep1 + * @author : JunHo Lee + * @date : 2024.11.21 + * @description : + * @param m + * @return + * @throws Exception + */ + @RequestMapping(value = "/web/user/cert/nCertStep1.do") + public String nCertStep1(Model m) throws Exception { + return "uat/uia/NCertStep1"; + } + + /** + * @methodName : kCertStep1 + * @author : JunHo Lee + * @date : 2024.11.21 + * @description : + * @param m + * @return + * @throws Exception + */ + @RequestMapping(value = "/web/user/cert/kCertStep1.do") + public String kCertStep1(Model m) throws Exception { + return "uat/uia/KCertStep1"; + } + + + /** + * @methodName : nCertStep2 + * @author : JunHo Lee + * @date : 2024.11.21 + * @description : + * @param m + * @param socialCertVO + * @return + * @throws BarocertException + */ + @RequestMapping(value = "/web/user/cert/nCertStep2.do") + public String nCertStep2(Model m, SocialCertVO socialCertVO) throws BarocertException { // 본인인증 요청 정보 객체 com.barocert.navercert.identity.Identity identity = new com.barocert.navercert.identity.Identity(); // 수신자 휴대폰번호 - 11자 (하이픈 제외) - identity.setReceiverHP(navercertService.encrypt("01030266269")); + identity.setReceiverHP(navercertService.encrypt(socialCertVO.getPhone())); // 수신자 성명 - 80자 - identity.setReceiverName(navercertService.encrypt("이준호")); + identity.setReceiverName(navercertService.encrypt(socialCertVO.getName())); // 수신자 생년월일 - 8자 (yyyyMMdd) - identity.setReceiverBirthday(navercertService.encrypt("19890202")); + identity.setReceiverBirthday(navercertService.encrypt(socialCertVO.getBirth())); // 고객센터 연락처 - 최대 12자 identity.setCallCenterNum("1600-9854"); @@ -73,74 +127,41 @@ public class SocialCertController { try { com.barocert.navercert.identity.IdentityReceipt request = navercertService.requestIdentity(NaverClientCode, identity); -// Boolean test = navercertService.isUseStaticIP(); - - System.out.println("ReceiptID :: " + request.getReceiptID()); - System.out.println("Scheme :: " + request.getScheme()); - System.out.println("MarketUrl :: " + request.getMarketUrl()); - - - - /** - * 본인인증 서명검증 - * 인증되었을경우 State : 1 - * 인증안되었을경우 State : 0 - */ -// if(status.getState() == 0) { -// -// }else if(status.getState() == 1) { -// -// } - - - //서명이 되지 않았을경우 - com.barocert.navercert.identity.IdentityStatus status = navercertService.getIdentityStatus(NaverClientCode, request.getReceiptID()); - - //서명이 되었을경우 - com.barocert.navercert.identity.IdentityStatus status2 = navercertService.getIdentityStatus(NaverClientCode, request.getReceiptID()); - - com.barocert.navercert.identity.IdentityResult result = navercertService.verifyIdentity(NaverClientCode, request.getReceiptID()); - - System.out.println("Ci :: " + result.getCi()); - System.out.println("ReceiptID :: " + result.getReceiptID()); - System.out.println("ReceiverDay :: " + result.getReceiverDay()); - System.out.println("ReceiverEmail :: " + result.getReceiverEmail()); - System.out.println("ReceiverForeign :: " + result.getReceiverForeign()); - System.out.println("ReceiverGender :: " + result.getReceiverGender()); - System.out.println("ReceiverHP :: " + result.getReceiverHP()); - System.out.println("ReceiverName :: " + result.getReceiverName()); - System.out.println("ReceiverYear :: " + result.getReceiverYear()); - System.out.println("SignedData :: " + result.getSignedData()); - System.out.println("State :: " + result.getState()); - - - m.addAttribute("result", result); + m.addAttribute("request", request); } catch (BarocertException ne) { - m.addAttribute("Exception", ne); - return "exception"; + m.addAttribute("Exception", "요청에 실패했습니다."); + return "redirect:/web/user/cert/nCertStep1.do"; } - return "uat/uia/NCert"; + return "uat/uia/NCertStep2"; } -// @RequestMapping(value = "navercert/requestIdentity", method = RequestMethod.GET) - @RequestMapping(value = "/web/user/cert/kCert.do") - public String requestIdentity_k(Model m) throws BarocertException { + /** + * @methodName : kCertStep2 + * @author : JunHo Lee + * @date : 2024.11.21 + * @description : + * @param m + * @return + * @throws BarocertException + */ + @RequestMapping(value = "/web/user/cert/kCertStep2.do") + public String kCertStep2(Model m, SocialCertVO socialCertVO) throws BarocertException { // 본인인증 요청 정보 객체 com.barocert.kakaocert.identity.Identity identity = new com.barocert.kakaocert.identity.Identity(); // 수신자 휴대폰번호 - 11자 (하이픈 제외) - identity.setReceiverHP(kakaocertService.encrypt("01012341234")); + identity.setReceiverHP(kakaocertService.encrypt(socialCertVO.getPhone())); // 수신자 성명 - 80자 - identity.setReceiverName(kakaocertService.encrypt("홍길동")); + identity.setReceiverName(kakaocertService.encrypt(socialCertVO.getName())); // 수신자 생년월일 - 8자 (yyyyMMdd) - identity.setReceiverBirthday(kakaocertService.encrypt("19700101")); + identity.setReceiverBirthday(kakaocertService.encrypt(socialCertVO.getBirth())); // 인증요청 메시지 제목 - 최대 40자 - identity.setReqTitle("본인인증 요청 메시지 제목"); + identity.setReqTitle("분쟁조정사건처리시스템 본인인증"); // 커스텀 메시지 - 최대 500자 - identity.setExtraMessage(kakaocertService.encrypt("본인인증 커스텀 메시지")); + identity.setExtraMessage(kakaocertService.encrypt("한국공정거래조정원 분쟁조정사건처리시스템 본인인증 요청입니다.")); // 인증요청 만료시간 - 최대 1,000(초)까지 입력 가능 identity.setExpireIn(1000); // 서명 원문 - 최대 40자 까지 입력가능 @@ -152,36 +173,172 @@ public class SocialCertController { try { - com.barocert.kakaocert.identity.IdentityReceipt result = kakaocertService.requestIdentity(KakaoClientCode, identity); - m.addAttribute("result", result); + com.barocert.kakaocert.identity.IdentityReceipt request = kakaocertService.requestIdentity(KakaoClientCode, identity); + m.addAttribute("request", request); } catch (BarocertException ke) { m.addAttribute("Exception", ke); - return "exception"; + return "redirect:/web/user/cert/kCertStep1.do"; } - return "uat/uia/KCert"; + return "uat/uia/KCertStep2"; + } + + + /** + * @methodName : nCertStep3Ajax + * @author : JunHo Lee + * @date : 2024.11.21 + * @description : + * @param reqeust + * @param repn + * @return + * @throws BarocertException + */ + @RequestMapping(value = "/web/user/cert/nCertStep3Ajax.do") + public ResponseEntity nCertStep3Ajax(HttpServletRequest reqeust, HttpServletResponse repn, SocialCertVO socialCertVO) { + + Map returnData = new HashMap(); + + com.barocert.navercert.identity.IdentityStatus status = null; + try { + status = navercertService.getIdentityStatus(NaverClientCode, socialCertVO.getReceiptID()); + } catch (BarocertException e) { + returnData.put("result", "requestFail"); + returnData.put("msg", "인증과정에 문제가 발생했습니다. 화면을 새로고침 후 다시 시도해 주세요."); + + return new ResponseEntity<>(returnData, HttpStatus.OK); + } + + if(status != null && status.getState() == 1) { + + com.barocert.navercert.identity.IdentityResult result = null; + try { + result = navercertService.verifyIdentity(NaverClientCode, socialCertVO.getReceiptID()); + } catch (BarocertException e) { + returnData.put("result", "requestFail"); + returnData.put("msg", "인증과정에 문제가 발생했습니다. 화면을 새로고침 후 다시 시도해 주세요."); + + return new ResponseEntity<>(returnData, HttpStatus.OK); + } + + System.out.println("getReceiptID()); :: " + result.getReceiptID()); + System.out.println("getReceiverDay()); :: " + nDecrypt(result.getReceiverDay())); + System.out.println("getReceiverEmail()); :: " + nDecrypt(result.getReceiverEmail())); + System.out.println("getReceiverForeign()); :: " + nDecrypt(result.getReceiverForeign())); + System.out.println("getReceiverGender()); :: " + nDecrypt(result.getReceiverGender())); + System.out.println("getReceiverHP()); :: " + nDecrypt(result.getReceiverHP())); + System.out.println("getReceiverName()); :: " + nDecrypt(result.getReceiverName())); + System.out.println("getReceiverYear()); :: " + nDecrypt(result.getReceiverYear())); + System.out.println("getSignedData()); :: " + result.getSignedData()); + System.out.println("getState()); :: " + result.getState()); + System.out.println("getCi()); :: " + nDecrypt(result.getCi())); + + returnData.put("result", "success"); + returnData.put("msg", "인증되었습니다."); + + return new ResponseEntity<>(returnData, HttpStatus.OK); + }else { + returnData.put("result", "fail"); + returnData.put("msg", "인증 후 다시 클릭해 주세요."); + + return new ResponseEntity<>(returnData, HttpStatus.OK); + } + } + + + @RequestMapping(value = "/web/user/cert/kCertStep3Ajax.do") + public ResponseEntity kCertStep3Ajax(HttpServletRequest reqeust, HttpServletResponse repn, SocialCertVO socialCertVO) { + + Map returnData = new HashMap(); + + com.barocert.kakaocert.identity.IdentityStatus status = null; + try { + status = kakaocertService.getIdentityStatus(KakaoClientCode, socialCertVO.getReceiptID()); + } catch (BarocertException e) { + returnData.put("result", "requestFail"); + returnData.put("msg", "인증과정에 문제가 발생했습니다. 화면을 새로고침 후 다시 시도해 주세요."); + + return new ResponseEntity<>(returnData, HttpStatus.OK); + } + + if(status != null && status.getState() == 1) { + + com.barocert.kakaocert.identity.IdentityResult result = null; + try { + result = kakaocertService.verifyIdentity(KakaoClientCode, socialCertVO.getReceiptID()); + } catch (BarocertException e) { + returnData.put("result", "requestFail"); + returnData.put("msg", "인증과정에 문제가 발생했습니다. 화면을 새로고침 후 다시 시도해 주세요."); + + return new ResponseEntity<>(returnData, HttpStatus.OK); + } + + System.out.println("getReceiptID()); :: " + result.getReceiptID()); + System.out.println("getState()); :: " +result.getState()); + System.out.println("getSignedData()); :: " + result.getSignedData()); + System.out.println("getCi()); :: " + kDecrypt(result.getCi())); + System.out.println("getReceiverName()); :: " + kDecrypt(result.getReceiverName())); + System.out.println("getReceiverYear()); :: " + kDecrypt(result.getReceiverYear())); + System.out.println("getReceiverDay()); :: " + kDecrypt(result.getReceiverDay())); + System.out.println("getReceiverHP()); :: " + kDecrypt(result.getReceiverHP())); + System.out.println("getReceiverGender()); :: " + kDecrypt(result.getReceiverGender())); + + + returnData.put("result", "success"); + returnData.put("msg", "인증되었습니다."); + + return new ResponseEntity<>(returnData, HttpStatus.OK); + }else { + returnData.put("result", "fail"); + returnData.put("msg", "인증 후 다시 클릭해 주세요."); + + return new ResponseEntity<>(returnData, HttpStatus.OK); + } } - private String decryptNaver() { - - //복호화 키 - String secretKey = "LqZ8a…"; - // 초기화 벡터 (고정값) - String iv = "6C2Syq8t…"; - // 암호문 - String cipherText = "6MXhzI8yDVdCDktJ/Qdz9S…"; + private String nDecrypt(String param){ + try { + // 복호화 키 + String secretKey = "0lOKtGZ_wu"; + + // 초기화 벡터 + String iv = "6C2Syq8tbK3eApue"; + + // 암호문 + String cipherText = SeedUtils.setReplaceNull(param); + + nCertDecryptor decryptor = new nCertDecryptor(); + String decryptedCI = decryptor.decrypt(secretKey, iv, cipherText); + + return decryptedCI; + + } catch (Exception e) { + System.out.println("복호화 실패!!!"); + return param; + } + } + + private String kDecrypt(String param) { + // 복호화 키 + String secretKey = "+EJwVvo37PY1v4zcENdmGezYXwCdmtUlbaNVI0kvrFM="; + // 초기화 벡터 + String iv = "uG+F70tIcBb3z1lh8RcVDQ=="; + // 암호문 + String cipherText = SeedUtils.setReplaceNull(param); try { // 복호화 -// Decryptor decryptor = new Decryptor(); -// String decryptedCI = decryptor.decrypt(secretKey, iv, cipherText); -// System.out.println(decryptedCI); + kCertDecryptor decryptor = new kCertDecryptor(); + String decryptedCI = decryptor.decrypt(secretKey, iv, cipherText); + System.out.println(decryptedCI); + return decryptedCI; } catch (Exception e) { e.printStackTrace(); + System.out.println("복호화 실패!!!"); + return param; } - return ""; } } diff --git a/src/main/java/seed/com/user/mediation/WebMediationController.java b/src/main/java/seed/com/user/mediation/WebMediationController.java index 6cecdaf1..33b60ca6 100644 --- a/src/main/java/seed/com/user/mediation/WebMediationController.java +++ b/src/main/java/seed/com/user/mediation/WebMediationController.java @@ -2581,7 +2581,9 @@ public class WebMediationController { paramMap.put("joiningAmount", SeedUtils.setReplaceNull(paramMap.get("joiningAmount")).toString().replaceAll(",", "")); paramMap.put("joiningAmount", SeedUtils.setReplaceNull(paramMap.get("joiningAmount")).toString().replaceAll(",", "")); + //하도급거래 - 시공능력 평가액, paramMap.put("subCntrAmount", SeedUtils.setReplaceNull(paramMap.get("subCntrAmount")).toString().replaceAll(",", "")); + paramMap.put("distbTotSales", SeedUtils.setReplaceNull(paramMap.get("distbTotSales")).toString().replaceAll(",", "")); service.rceUpdate(paramMap); @@ -2697,9 +2699,1050 @@ public class WebMediationController { } + @RequestMapping("/web/user/mediation/{siteIdx}/05/{siteMenuIdx}/writeAjax04.do") + public ResponseEntity writeAjax04(ModelMap map, HttpServletRequest request, HttpSession session, HttpServletRequest httpServletRequest, + @RequestParam Map paramMap, + @PathVariable(value="siteIdx") String siteIdx, + @PathVariable(value="siteMenuIdx") Integer siteMenuIdx){ + + // CI 체크 + if(!ciCheck(map, session)) { + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + + /*----권한체크----*/ + setSessionMessageRemove(session); + + Integer memberIdx = Integer.valueOf(SeedUtils.setReplaceNull(session.getAttribute("memberIdx"),"0")); + String memberGrant = (memberIdx == 0) ? "N" : SeedUtils.setReplaceNull(managerMemberService.getMemberMapForm(memberIdx, new String[] {"memberGrant"}).get("_memberGrant"), "N"); + boolean memberAuthM = managerSiteManagerService.getSiteManagerListCnt(siteIdx, memberIdx); + boolean memberAuth = managerSiteMenuManagerService.getSiteMenuManagerListCnt(siteMenuIdx, memberIdx); + + //메뉴 권한설정 + + boolean b_ret = true; + b_ret = FairnetUtils.hasUserAuth(memberIdx, memberGrant, memberAuth, session, map); + + if (!b_ret) { + /* return new ModelAndView("/_common/jsp/message"); */ + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + + Map tSiteMenuDB = managerSiteMenuService.getSiteMenuMapForm(siteMenuIdx, + new String[] {"siteMenuName", "siteMenuParentTitle", "siteMenuStatus", "siteMenuType", "siteMenuLinkUrl", "siteMenuCharge", "siteMenuCharge", "siteMenuSNS", + "siteMenuTitle", "siteMenuRegDate", "siteMenuModDate", "siteMenuNameType", "siteMenuIdxs", "siteMenuDepth", "siteMenuSatisfaction", "siteMenuIdx1", + "tSite.siteActiveMenuWidth", "tSite.siteService", "tSite.siteServiceSdate", "tSite.siteServiceSdate"}); + + if(!memberGrant.equals("S") && !memberAuthM && !memberAuth){ + if(!SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuStatus")).equals("U")){ + map.put("message", "common.message.no.siteMenu"); + map.put("self", "history"); + /* return new ModelAndView("/_common/jsp/umessage"); */ + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + } + + if(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteService")).equals("Y")){ + + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + + try{ + + Date getDate = new Date(); + + Date sDate = formatter.parse(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteServiceSdate"))); + Date eDate = formatter.parse(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteServiceEdate"))); + + if((sDate.compareTo(formatter.parse(formatter.format(getDate))) > 0 && eDate.compareTo(formatter.parse(formatter.format(getDate))) > 0) || + (sDate.compareTo(formatter.parse(formatter.format(getDate))) < 0 && eDate.compareTo(formatter.parse(formatter.format(getDate))) < 0)){ + /* return new ModelAndView("redirect:/user/common/service/"+siteIdx+".do"); */ + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + + }catch(ParseException e){ + log.error("CHECK ERROR:",e); + } + } + + if(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuType")).equals("F") || + SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuType")).equals("L")){ +// return new ModelAndView("redirect:"+SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuLinkUrl"))); + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + + String siteMenuManager = "N"; + StringBuffer siteMenuManagerIdx = new StringBuffer(); + String siteMenuCharge = SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuCharge"), "N"); + + List> siteMenuManagerList = + managerSiteMenuManagerService.getSiteMenuManagerMapList(siteMenuIdx, new String[] {"siteMenuManagerStatus", "tMember.memberIdx"}); + + for(int i=0; i tSiteMenuManagerDB = siteMenuManagerList.get(i); + + if(SeedUtils.setReplaceNull(tSiteMenuManagerDB.get("_siteMenuManagerStatus")).equals("U")){ + + if(!memberIdx.equals(0) && + memberIdx.equals(Integer.parseInt(SeedUtils.setReplaceNull(tSiteMenuManagerDB.get("_memberIdx"), "0"))) && + siteMenuManager.equals("N")){ + siteMenuManager = "Y"; + } + siteMenuManagerIdx.append(SeedUtils.setReplaceNull(tSiteMenuManagerDB.get("_memberIdx")).toString()); + siteMenuManagerIdx.append(","); + } + } + + if(memberGrant.equals("S") || memberAuthM){ + siteMenuManager = "Y"; + } + + //편집 권한 + map.put("siteMenuManager", siteMenuManager); + //담당자 보기 설정 + map.put("siteMenuCharge", siteMenuCharge); + //담당자 이름 + map.put("siteMenuManagerIdx", siteMenuManagerIdx.toString()); + //만족도 설정 + map.put("siteMenuSatisfaction", SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuSatisfaction"), "N")); + + map.put("siteMenuSubTitle", managerSiteMenuService.getSiteMenuSubTitleForm(siteIdx, SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuIdx1")))); + + String siteMenuTitle = managerSiteMenuService.getSiteMenuParentName(siteIdx, SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuIdxs")), "edit").replaceAll("》", "|") + + " | " + SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuName")); + + map.put("siteMenuTitle", siteMenuTitle); + + //부모메뉴 타이틀 설정한 경우 해당 글의 부모 타이틀을 가져옴 + if(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuParentTitle") ,"N").equals("Y")){ + String[] siteMenuTitles = siteMenuTitle.split("\\|"); + tSiteMenuDB.put("_siteMenuName", siteMenuTitles[Integer.parseInt(tSiteMenuDB.get("_siteMenuDepth").toString())-1]); + } + + map.put("tSiteMenuDB", tSiteMenuDB); + + map.put("memberAuthM", memberAuthM); + map.put("seedMenuAuth", managerGroupService.getGroupList(siteIdx, memberIdx, memberMerge, memberMergeSiteIdx)); + /*----권한체크 종료----*/ + + /*서비스 로직*/ + try{ + + paramMap.put("rceptNo", service.getNumber()); + map.put("rceptNo", paramMap.get("rceptNo")); + map.put("applcntCompany", paramMap.get("applcntCompany")); + map.put("hpCi1", session.getAttribute("hpCi1")); + + //접수마스터 INSERT + service.rceptmstInsert(paramMap); + + //신청인정보 INSERT +// int appCnt = Integer.parseInt(SeedUtils.setReplaceNull(paramMap.get("appCnt"))); + int appCnt; + if("".equals(SeedUtils.setReplaceNull(paramMap.get("appCnt")))) { + appCnt = 0; + }else { + appCnt = Integer.parseInt(SeedUtils.setReplaceNull(paramMap.get("appCnt"))); + } + for(int i = 1; i <= appCnt; i++){ + paramMap.put("applcntCompany", paramMap.get("applcntCompany_"+i)); + paramMap.put("companyCeo", paramMap.get("companyCeo_"+i)); + paramMap.put("companyGubun", paramMap.get("companyGubun_"+i)); + paramMap.put("addrZip", paramMap.get("addrZip_"+i)); + paramMap.put("addr1", paramMap.get("addr1_"+i)); + paramMap.put("addr2", paramMap.get("addr2_"+i)); + paramMap.put("roadAddr1", paramMap.get("roadAddr1_"+i)); + paramMap.put("roadAddr2", paramMap.get("roadAddr2_"+i)); + + String tel1 = SeedUtils.setReplaceNull(paramMap.get("tel1_"+i)); + String tel2 = SeedUtils.setReplaceNull(paramMap.get("tel2_"+i)); + String tel3 = SeedUtils.setReplaceNull(paramMap.get("tel3_"+i)); + String tel = tel1 + "-" + tel2 + "-" + tel3; + paramMap.put("tel", tel); + + String fax1 = SeedUtils.setReplaceNull(paramMap.get("fax1_"+i)); + String fax2 = SeedUtils.setReplaceNull(paramMap.get("fax2_"+i)); + String fax3 = SeedUtils.setReplaceNull(paramMap.get("fax3_"+i)); + String fax = fax1 + "-" + fax2 + "-" + fax3; + paramMap.put("fax", fax); + + paramMap.put("bizrNo", paramMap.get("bizrNo_"+i)); + paramMap.put("cprNo", paramMap.get("cprNo_"+i)); + service.applcntInsert(paramMap); + } + //접수현황 빈 값 insert. 추후 04_2에서 update 처리로 정보 입력 + service.rceInsert(paramMap); + paramMap.put("sts", "success"); + + }catch (Exception e) { + log.error("CHECK ERROR:",e); + paramMap.put("sts", "fail"); + } + + + map.put("siteIdx", "case"); + map.put("url", "/web/user/mypage/case/01/169/myMediationList.do"); + map.put("message", "user.message.medi.temp"); + map.put("opener", ""); + map.put("append", ""); + map.put("self", ""); + +// return new ModelAndView("/_common/jsp/umessage"); + + return new ResponseEntity<>(paramMap, HttpStatus.OK); + //return new ModelAndView("/_extra/web/user/mediation/mediationStep05"); + } + + @RequestMapping("/web/user/mediation/{siteIdx}/05/{siteMenuIdx}/updateAjax04_1.do") + public ResponseEntity updateAjax04_1(ModelMap map, HttpServletRequest request, HttpSession session,@RequestParam Map paramMap, + @PathVariable(value="siteIdx") String siteIdx, + @PathVariable(value="siteMenuIdx") Integer siteMenuIdx){ + + + // CI 체크 + if(!ciCheck(map, session)) { + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + /*----권한체크----*/ + setSessionMessageRemove(session); + + Integer memberIdx = Integer.valueOf(SeedUtils.setReplaceNull(session.getAttribute("memberIdx"),"0")); + String memberGrant = (memberIdx == 0) ? "N" : SeedUtils.setReplaceNull(managerMemberService.getMemberMapForm(memberIdx, new String[] {"memberGrant"}).get("_memberGrant"), "N"); + boolean memberAuthM = managerSiteManagerService.getSiteManagerListCnt(siteIdx, memberIdx); + boolean memberAuth = managerSiteMenuManagerService.getSiteMenuManagerListCnt(siteMenuIdx, memberIdx); + +// //메뉴 권한설정 + + boolean b_ret = true; + b_ret = FairnetUtils.hasUserAuth(memberIdx, memberGrant, memberAuth, session, map); + + if (!b_ret) { + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + + Map tSiteMenuDB = managerSiteMenuService.getSiteMenuMapForm(siteMenuIdx, + new String[] {"siteMenuName", "siteMenuParentTitle", "siteMenuStatus", "siteMenuType", "siteMenuLinkUrl", "siteMenuCharge", "siteMenuCharge", "siteMenuSNS", + "siteMenuTitle", "siteMenuRegDate", "siteMenuModDate", "siteMenuNameType", "siteMenuIdxs", "siteMenuDepth", "siteMenuSatisfaction", "siteMenuIdx1", + "tSite.siteActiveMenuWidth", "tSite.siteService", "tSite.siteServiceSdate", "tSite.siteServiceSdate"}); + + if(!memberGrant.equals("S") && !memberAuthM && !memberAuth){ + if(!SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuStatus")).equals("U")){ + map.put("message", "common.message.no.siteMenu"); + map.put("self", "history"); + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + } + + if(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteService")).equals("Y")){ + + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + + try{ + + Date getDate = new Date(); + + Date sDate = formatter.parse(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteServiceSdate"))); + Date eDate = formatter.parse(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteServiceEdate"))); + + if((sDate.compareTo(formatter.parse(formatter.format(getDate))) > 0 && eDate.compareTo(formatter.parse(formatter.format(getDate))) > 0) || + (sDate.compareTo(formatter.parse(formatter.format(getDate))) < 0 && eDate.compareTo(formatter.parse(formatter.format(getDate))) < 0)){ + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + + }catch(ParseException e){ + log.error("CHECK ERROR:",e); + } + } + + if(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuType")).equals("F") || + SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuType")).equals("L")){ + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + + String siteMenuManager = "N"; + StringBuffer siteMenuManagerIdx = new StringBuffer(); + String siteMenuCharge = SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuCharge"), "N"); + + List> siteMenuManagerList = + managerSiteMenuManagerService.getSiteMenuManagerMapList(siteMenuIdx, new String[] {"siteMenuManagerStatus", "tMember.memberIdx"}); + + for(int i=0; i tSiteMenuManagerDB = siteMenuManagerList.get(i); + + if(SeedUtils.setReplaceNull(tSiteMenuManagerDB.get("_siteMenuManagerStatus")).equals("U")){ + + if(!memberIdx.equals(0) && + memberIdx.equals(Integer.parseInt(SeedUtils.setReplaceNull(tSiteMenuManagerDB.get("_memberIdx"), "0"))) && + siteMenuManager.equals("N")){ + siteMenuManager = "Y"; + } + siteMenuManagerIdx.append(SeedUtils.setReplaceNull(tSiteMenuManagerDB.get("_memberIdx")).toString()); + siteMenuManagerIdx.append(","); + } + } + + if(memberGrant.equals("S") || memberAuthM){ + siteMenuManager = "Y"; + } + + //편집 권한 + map.put("siteMenuManager", siteMenuManager); + //담당자 보기 설정 + map.put("siteMenuCharge", siteMenuCharge); + //담당자 이름 + map.put("siteMenuManagerIdx", siteMenuManagerIdx.toString()); + //만족도 설정 + map.put("siteMenuSatisfaction", SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuSatisfaction"), "N")); + + map.put("siteMenuSubTitle", managerSiteMenuService.getSiteMenuSubTitleForm(siteIdx, SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuIdx1")))); + + String siteMenuTitle = managerSiteMenuService.getSiteMenuParentName(siteIdx, SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuIdxs")), "edit").replaceAll("》", "|") + + " | " + SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuName")); + + map.put("siteMenuTitle", siteMenuTitle); + + //부모메뉴 타이틀 설정한 경우 해당 글의 부모 타이틀을 가져옴 + if(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuParentTitle") ,"N").equals("Y")){ + String[] siteMenuTitles = siteMenuTitle.split("\\|"); + tSiteMenuDB.put("_siteMenuName", siteMenuTitles[Integer.parseInt(tSiteMenuDB.get("_siteMenuDepth").toString())-1]); + } + + map.put("tSiteMenuDB", tSiteMenuDB); + + map.put("memberAuthM", memberAuthM); + map.put("seedMenuAuth", managerGroupService.getGroupList(siteIdx, memberIdx, memberMerge, memberMergeSiteIdx)); + /*----권한체크 종료----*/ + + /*서비스 로직*/ + try{ + + //피신청인정보 INSERT + /*업데이트전 폼 삭제된 피신청인 db에서 제거*/ + String resDelSeq = SeedUtils.setReplaceNull(paramMap.get("resDelSeq")); + String[] delSeqList = null; + if(!resDelSeq.equals("")){ + delSeqList = resDelSeq.split(","); + + for(int i = 0; i < delSeqList.length; i++){ + System.out.println("delSeqList[i]:" + delSeqList[i]); + paramMap.put("seqNo", delSeqList[i]); + service.resDelete(paramMap); + } + } + + /*수정시 이미 존재하는 피신청인 갯수*/ + String tempDataCnt = SeedUtils.setReplaceNull(paramMap.get("existDataCnt")); + int existDataCnt = 0; + if(!tempDataCnt.equals("")){ + existDataCnt = Integer.parseInt(tempDataCnt); + } + int recCnt; + if("".equals(SeedUtils.setReplaceNull(paramMap.get("recCnt")))) { + recCnt = 0; + }else { + recCnt = Integer.parseInt(SeedUtils.setReplaceNull(paramMap.get("recCnt"))); + } + + for(int i = 1; i <= recCnt; i++){ + + paramMap.put("resCompany", paramMap.get("resCompany_"+i)); + paramMap.put("resCeo", paramMap.get("resCeo_"+i)); + paramMap.put("resGunbun", paramMap.get("resGunbun_"+i)); + paramMap.put("resZip", paramMap.get("resZip_"+i)); + paramMap.put("resAddr1", paramMap.get("resAddr1_"+i)); + paramMap.put("resAddr2", paramMap.get("resAddr2_"+i)); + paramMap.put("resRoadAddr1", paramMap.get("resRoadAddr1_"+i)); + paramMap.put("resRoadAddr2", paramMap.get("resRoadAddr2_"+i)); + + String resTel1 = SeedUtils.setReplaceNull(paramMap.get("resTel1_"+i)); + String resTel2 = SeedUtils.setReplaceNull(paramMap.get("resTel2_"+i)); + String resTel3 = SeedUtils.setReplaceNull(paramMap.get("resTel3_"+i)); + String resTel = resTel1 + "-" + resTel2 + "-" + resTel3; + paramMap.put("resTel", resTel); + + String resFax1 = SeedUtils.setReplaceNull(paramMap.get("resFax1_"+i)); + String resFax2 = SeedUtils.setReplaceNull(paramMap.get("resFax2_"+i)); + String resFax3 = SeedUtils.setReplaceNull(paramMap.get("resFax3_"+i)); + String resFax = resFax1 + "-" + resFax2 + "-" +resFax3; + paramMap.put("resFax", resFax); + + paramMap.put("resBizrNo", paramMap.get("resBizrNo_"+i)); + paramMap.put("resCprNo", paramMap.get("resCprNo_"+i)); + //existDataCnt가 0보다 크면 피신청인 존재...UPDATE문으로 + if(existDataCnt > 0){ + //i가existDataCnt와 같아지면 새로입력하는 피신청인 + if(i <= existDataCnt){ + String seqNo = (String)paramMap.get("seqNo_"+i); + paramMap.put("seqNo", seqNo); + service.resUpdate(paramMap); + }else{ + service.resInsert(paramMap); + } + }else{ + service.resInsert(paramMap); + } + } + + paramMap.put("sts", "success"); + + }catch (Exception e) { + log.error("CHECK ERROR:",e); + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + + map.put("rceptNo", paramMap.get("rceptNo")); + map.put("siteIdx", "case"); + map.put("url", "/user/mypage/case/01/169/myMediationList.do"); + map.put("message", "user.message.medi.temp"); + map.put("opener", ""); + map.put("append", ""); + map.put("self", ""); + + return new ResponseEntity<>(paramMap, HttpStatus.OK); + //return new ModelAndView("/_extra/web/user/mediation/mediationStep05"); + } + + @RequestMapping("/web/user/mediation/{siteIdx}/05/{siteMenuIdx}/updateAjax04_2.do") + public ResponseEntity updateAjax04_2(ModelMap map, HttpServletRequest request, HttpSession session,@RequestParam Map paramMap, + @PathVariable(value="siteIdx") String siteIdx, + @PathVariable(value="siteMenuIdx") Integer siteMenuIdx){ + + + // CI 체크 + if(!ciCheck(map, session)) { + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + /*----권한체크----*/ + setSessionMessageRemove(session); + + Integer memberIdx = Integer.valueOf(SeedUtils.setReplaceNull(session.getAttribute("memberIdx"),"0")); + String memberGrant = (memberIdx == 0) ? "N" : SeedUtils.setReplaceNull(managerMemberService.getMemberMapForm(memberIdx, new String[] {"memberGrant"}).get("_memberGrant"), "N"); + boolean memberAuthM = managerSiteManagerService.getSiteManagerListCnt(siteIdx, memberIdx); + boolean memberAuth = managerSiteMenuManagerService.getSiteMenuManagerListCnt(siteMenuIdx, memberIdx); + +// //메뉴 권한설정 + + boolean b_ret = true; + b_ret = FairnetUtils.hasUserAuth(memberIdx, memberGrant, memberAuth, session, map); + + if (!b_ret) { + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + + Map tSiteMenuDB = managerSiteMenuService.getSiteMenuMapForm(siteMenuIdx, + new String[] {"siteMenuName", "siteMenuParentTitle", "siteMenuStatus", "siteMenuType", "siteMenuLinkUrl", "siteMenuCharge", "siteMenuCharge", "siteMenuSNS", + "siteMenuTitle", "siteMenuRegDate", "siteMenuModDate", "siteMenuNameType", "siteMenuIdxs", "siteMenuDepth", "siteMenuSatisfaction", "siteMenuIdx1", + "tSite.siteActiveMenuWidth", "tSite.siteService", "tSite.siteServiceSdate", "tSite.siteServiceSdate"}); + + if(!memberGrant.equals("S") && !memberAuthM && !memberAuth){ + if(!SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuStatus")).equals("U")){ + map.put("message", "common.message.no.siteMenu"); + map.put("self", "history"); + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + } + + if(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteService")).equals("Y")){ + + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + + try{ + + Date getDate = new Date(); + + Date sDate = formatter.parse(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteServiceSdate"))); + Date eDate = formatter.parse(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteServiceEdate"))); + + if((sDate.compareTo(formatter.parse(formatter.format(getDate))) > 0 && eDate.compareTo(formatter.parse(formatter.format(getDate))) > 0) || + (sDate.compareTo(formatter.parse(formatter.format(getDate))) < 0 && eDate.compareTo(formatter.parse(formatter.format(getDate))) < 0)){ + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + + }catch(ParseException e){ + log.error("CHECK ERROR:",e); + } + } + + if(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuType")).equals("F") || + SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuType")).equals("L")){ + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + + String siteMenuManager = "N"; + StringBuffer siteMenuManagerIdx = new StringBuffer(); + String siteMenuCharge = SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuCharge"), "N"); + + List> siteMenuManagerList = + managerSiteMenuManagerService.getSiteMenuManagerMapList(siteMenuIdx, new String[] {"siteMenuManagerStatus", "tMember.memberIdx"}); + + for(int i=0; i tSiteMenuManagerDB = siteMenuManagerList.get(i); + + if(SeedUtils.setReplaceNull(tSiteMenuManagerDB.get("_siteMenuManagerStatus")).equals("U")){ + + if(!memberIdx.equals(0) && + memberIdx.equals(Integer.parseInt(SeedUtils.setReplaceNull(tSiteMenuManagerDB.get("_memberIdx"), "0"))) && + siteMenuManager.equals("N")){ + siteMenuManager = "Y"; + } + siteMenuManagerIdx.append(SeedUtils.setReplaceNull(tSiteMenuManagerDB.get("_memberIdx")).toString()); + siteMenuManagerIdx.append(","); + } + } + + if(memberGrant.equals("S") || memberAuthM){ + siteMenuManager = "Y"; + } + + //편집 권한 + map.put("siteMenuManager", siteMenuManager); + //담당자 보기 설정 + map.put("siteMenuCharge", siteMenuCharge); + //담당자 이름 + map.put("siteMenuManagerIdx", siteMenuManagerIdx.toString()); + //만족도 설정 + map.put("siteMenuSatisfaction", SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuSatisfaction"), "N")); + + map.put("siteMenuSubTitle", managerSiteMenuService.getSiteMenuSubTitleForm(siteIdx, SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuIdx1")))); + + String siteMenuTitle = managerSiteMenuService.getSiteMenuParentName(siteIdx, SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuIdxs")), "edit").replaceAll("》", "|") + + " | " + SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuName")); + + map.put("siteMenuTitle", siteMenuTitle); + + //부모메뉴 타이틀 설정한 경우 해당 글의 부모 타이틀을 가져옴 + if(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuParentTitle") ,"N").equals("Y")){ + String[] siteMenuTitles = siteMenuTitle.split("\\|"); + tSiteMenuDB.put("_siteMenuName", siteMenuTitles[Integer.parseInt(tSiteMenuDB.get("_siteMenuDepth").toString())-1]); + } + + map.put("tSiteMenuDB", tSiteMenuDB); + + map.put("memberAuthM", memberAuthM); + map.put("seedMenuAuth", managerGroupService.getGroupList(siteIdx, memberIdx, memberMerge, memberMergeSiteIdx)); + /*----권한체크 종료----*/ + + /*서비스 로직*/ + try{ + + + // 대리인정보 INSERT + String tel1 = SeedUtils.setReplaceNull(paramMap.get("agentHp01")); + String tel2 = SeedUtils.setReplaceNull(paramMap.get("agentHp02")); + String tel3 = SeedUtils.setReplaceNull(paramMap.get("agentHp03")); + String tel = tel1 + "-" + tel2 + "-" + tel3; + + paramMap.put("agentHp", tel); + service.agentInsert(paramMap); + + // 사건현황, 협의회별 상세 현황 INSERT + + //콤마 제거하기 +// paramMap.put("rceCapital", paramMap.get("rceCapital").toString().replaceAll(",", "")); +// paramMap.put("rceTotAssets", paramMap.get("rceTotAssets").toString().replaceAll(",", "")); +// paramMap.put("rceTotSales", paramMap.get("rceTotSales").toString().replaceAll(",", "")); +// paramMap.put("rceBp", paramMap.get("rceBp").toString().replaceAll(",", "")); + + if(paramMap.get("rceCapital") != null) { + paramMap.put("rceCapital", paramMap.get("rceCapital").toString().replaceAll(",", "")); + } + if(paramMap.get("rceTotAssets") != null) { + paramMap.put("rceTotAssets", paramMap.get("rceTotAssets").toString().replaceAll(",", "")); + } + if(paramMap.get("rceTotSales") != null) { + paramMap.put("rceTotSales", paramMap.get("rceTotSales").toString().replaceAll(",", "")); + } + if(paramMap.get("rceBp") != null) { + paramMap.put("rceBp", paramMap.get("rceBp").toString().replaceAll(",", "")); + } + + String rcePh1 = SeedUtils.setReplaceNull(paramMap.get("rcePh1")); + String rcePh2 = SeedUtils.setReplaceNull(paramMap.get("rcePh2")); + String rcePh3 = SeedUtils.setReplaceNull(paramMap.get("rcePh3")); + String rcePh = rcePh1 + "-" + rcePh2 + "-" + rcePh3; + paramMap.put("rcePh", rcePh); + + String rceFax1 = SeedUtils.setReplaceNull(paramMap.get("rceFax1")); + String rceFax2 = SeedUtils.setReplaceNull(paramMap.get("rceFax2")); + String rceFax3 = SeedUtils.setReplaceNull(paramMap.get("rceFax3")); + String rceFax = rceFax1 + "-" + rceFax2 + "-" + rceFax3; + paramMap.put("rceFax", rceFax); + + paramMap.put("joiningAmount", SeedUtils.setReplaceNull(paramMap.get("joiningAmount")).toString().replaceAll(",", "")); + paramMap.put("joiningAmount", SeedUtils.setReplaceNull(paramMap.get("joiningAmount")).toString().replaceAll(",", "")); + + + service.rceUpdate(paramMap); + + if(!"".equals(SeedUtils.setReplaceNull(paramMap.get("fileFuncType")))) { + fileService.fileInsert(paramMap, request, session); + } +// fileService.fileInsert(paramMap, request, session); + fileService.caseFileDel(paramMap); + + paramMap.put("sts", "success"); + + }catch (Exception e) { + log.error("CHECK ERROR:",e); + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + + map.put("rceptNo", paramMap.get("rceptNo")); + map.put("siteIdx", "case"); + map.put("url", "/user/mypage/case/01/169/myMediationList.do"); + map.put("message", "user.message.medi.temp"); + map.put("opener", ""); + map.put("append", ""); + map.put("self", ""); + + return new ResponseEntity<>(paramMap, HttpStatus.OK); + //return new ModelAndView("/_extra/web/user/mediation/mediationStep05"); + } + @RequestMapping("/web/user/mediation/{siteIdx}/05/{siteMenuIdx}/updateAjax04_3.do") + public ResponseEntity updateAjax04_3(ModelMap map, HttpServletRequest request, HttpSession session,@RequestParam Map paramMap, + @PathVariable(value="siteIdx") String siteIdx, + @PathVariable(value="siteMenuIdx") Integer siteMenuIdx){ + + + // CI 체크 + if(!ciCheck(map, session)) { + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + /*----권한체크----*/ + setSessionMessageRemove(session); + + Integer memberIdx = Integer.valueOf(SeedUtils.setReplaceNull(session.getAttribute("memberIdx"),"0")); + String memberGrant = (memberIdx == 0) ? "N" : SeedUtils.setReplaceNull(managerMemberService.getMemberMapForm(memberIdx, new String[] {"memberGrant"}).get("_memberGrant"), "N"); + boolean memberAuthM = managerSiteManagerService.getSiteManagerListCnt(siteIdx, memberIdx); + boolean memberAuth = managerSiteMenuManagerService.getSiteMenuManagerListCnt(siteMenuIdx, memberIdx); + +// //메뉴 권한설정 + + boolean b_ret = true; + b_ret = FairnetUtils.hasUserAuth(memberIdx, memberGrant, memberAuth, session, map); + + if (!b_ret) { + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + + Map tSiteMenuDB = managerSiteMenuService.getSiteMenuMapForm(siteMenuIdx, + new String[] {"siteMenuName", "siteMenuParentTitle", "siteMenuStatus", "siteMenuType", "siteMenuLinkUrl", "siteMenuCharge", "siteMenuCharge", "siteMenuSNS", + "siteMenuTitle", "siteMenuRegDate", "siteMenuModDate", "siteMenuNameType", "siteMenuIdxs", "siteMenuDepth", "siteMenuSatisfaction", "siteMenuIdx1", + "tSite.siteActiveMenuWidth", "tSite.siteService", "tSite.siteServiceSdate", "tSite.siteServiceSdate"}); + + if(!memberGrant.equals("S") && !memberAuthM && !memberAuth){ + if(!SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuStatus")).equals("U")){ + map.put("message", "common.message.no.siteMenu"); + map.put("self", "history"); + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + } + + if(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteService")).equals("Y")){ + + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + + try{ + + Date getDate = new Date(); + + Date sDate = formatter.parse(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteServiceSdate"))); + Date eDate = formatter.parse(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteServiceEdate"))); + + if((sDate.compareTo(formatter.parse(formatter.format(getDate))) > 0 && eDate.compareTo(formatter.parse(formatter.format(getDate))) > 0) || + (sDate.compareTo(formatter.parse(formatter.format(getDate))) < 0 && eDate.compareTo(formatter.parse(formatter.format(getDate))) < 0)){ + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + + }catch(ParseException e){ + log.error("CHECK ERROR:",e); + } + } + + if(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuType")).equals("F") || + SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuType")).equals("L")){ + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + + String siteMenuManager = "N"; + StringBuffer siteMenuManagerIdx = new StringBuffer(); + String siteMenuCharge = SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuCharge"), "N"); + + List> siteMenuManagerList = + managerSiteMenuManagerService.getSiteMenuManagerMapList(siteMenuIdx, new String[] {"siteMenuManagerStatus", "tMember.memberIdx"}); + + for(int i=0; i tSiteMenuManagerDB = siteMenuManagerList.get(i); + + if(SeedUtils.setReplaceNull(tSiteMenuManagerDB.get("_siteMenuManagerStatus")).equals("U")){ + + if(!memberIdx.equals(0) && + memberIdx.equals(Integer.parseInt(SeedUtils.setReplaceNull(tSiteMenuManagerDB.get("_memberIdx"), "0"))) && + siteMenuManager.equals("N")){ + siteMenuManager = "Y"; + } + siteMenuManagerIdx.append(SeedUtils.setReplaceNull(tSiteMenuManagerDB.get("_memberIdx")).toString()); + siteMenuManagerIdx.append(","); + } + } + + if(memberGrant.equals("S") || memberAuthM){ + siteMenuManager = "Y"; + } + + //편집 권한 + map.put("siteMenuManager", siteMenuManager); + //담당자 보기 설정 + map.put("siteMenuCharge", siteMenuCharge); + //담당자 이름 + map.put("siteMenuManagerIdx", siteMenuManagerIdx.toString()); + //만족도 설정 + map.put("siteMenuSatisfaction", SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuSatisfaction"), "N")); + + map.put("siteMenuSubTitle", managerSiteMenuService.getSiteMenuSubTitleForm(siteIdx, SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuIdx1")))); + + String siteMenuTitle = managerSiteMenuService.getSiteMenuParentName(siteIdx, SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuIdxs")), "edit").replaceAll("》", "|") + + " | " + SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuName")); + + map.put("siteMenuTitle", siteMenuTitle); + + //부모메뉴 타이틀 설정한 경우 해당 글의 부모 타이틀을 가져옴 + if(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuParentTitle") ,"N").equals("Y")){ + String[] siteMenuTitles = siteMenuTitle.split("\\|"); + tSiteMenuDB.put("_siteMenuName", siteMenuTitles[Integer.parseInt(tSiteMenuDB.get("_siteMenuDepth").toString())-1]); + } + + map.put("tSiteMenuDB", tSiteMenuDB); + + map.put("memberAuthM", memberAuthM); + map.put("seedMenuAuth", managerGroupService.getGroupList(siteIdx, memberIdx, memberMerge, memberMergeSiteIdx)); + /*----권한체크 종료----*/ + + /*서비스 로직*/ + try{ + + service.rceUpdate(paramMap); + + if(!"".equals(SeedUtils.setReplaceNull(paramMap.get("fileFuncType")))) { + fileService.fileInsert(paramMap, request, session); + } +// fileService.fileInsert(paramMap, request, session); + fileService.caseFileDel(paramMap); + + + // 하도급내역 UPDATE + + /*업데이트전 폼 삭제된 내역 db에서 제거*/ + String subCntrDelSeq = SeedUtils.setReplaceNull(paramMap.get("subCntrDelSeq")); + String[] subCntrSeqList = null; + if(!subCntrDelSeq.equals("")){ + subCntrSeqList = subCntrDelSeq.split(","); + + for(int i = 0; i < subCntrSeqList.length; i++){ + paramMap.put("seqNo", subCntrSeqList[i]); + service.subCntrDelete(paramMap); + } + } + /*end*/ + + String tempaCnt = SeedUtils.setReplaceNull(paramMap.get("aCnt")); + String tempExistASubCntrData = SeedUtils.setReplaceNull(paramMap.get("existASubCntrData")); + int aCnt = 0; + int existASubCntrData = 0; + if(!tempaCnt.equals("")){ + aCnt = Integer.parseInt(tempaCnt); + } + if(!tempExistASubCntrData.equals("")){ + existASubCntrData = Integer.parseInt(tempExistASubCntrData); + } + + paramMap.put("cntrGubun", "A"); + for(int i = 1; i <= aCnt; i++){ + paramMap.put("subCntrCubun", SeedUtils.setReplaceNull(paramMap.get("subCntrCubun_"+i))); + paramMap.put("subCntrDt", SeedUtils.setReplaceNull(paramMap.get("subCntrDt_"+i))); + paramMap.put("subCntrSttAmount", SeedUtils.setReplaceNull(paramMap.get("subCntrAmount_"+i)).toString().replaceAll(",", "")); + paramMap.put("subCntrCashDt", SeedUtils.setReplaceNull(paramMap.get("subCntrCashDt_"+i))); + paramMap.put("subCntrCashAmount", SeedUtils.setReplaceNull(paramMap.get("subCntrCashAmount_"+i)).toString().replaceAll(",", "")); + paramMap.put("subCntrBillPayDay", SeedUtils.setReplaceNull(paramMap.get("subCntrBillPayDay_"+i))); + paramMap.put("subCntrBillLimit", SeedUtils.setReplaceNull(paramMap.get("subCntrBillLimit_"+i))); + paramMap.put("subCntrBillAmount", SeedUtils.setReplaceNull(paramMap.get("subCntrBillAmount_"+i)).toString().replaceAll(",", "")); + paramMap.put("subCntrTotAmount", SeedUtils.setReplaceNull(paramMap.get("subCntrTotAmount_"+i)).toString().replaceAll(",", "")); + paramMap.put("subCntrNonPayment", SeedUtils.setReplaceNull(paramMap.get("subCntrNonPayment_"+i)).toString().replaceAll(",", "")); + paramMap.put("subCntrNote", SeedUtils.setReplaceNull(paramMap.get("subCntrNote_"+i))); + + if(i <= existASubCntrData){ + paramMap.put("seqNo", SeedUtils.setReplaceNull(paramMap.get("subCntrSeqNoA_"+i))); + service.subCntrUpdate(paramMap); + }else{ + service.subCntrInsert(paramMap); + } + } + + String temprCnt = SeedUtils.setReplaceNull(paramMap.get("rCnt")); + String tempExistRSubCntrData = SeedUtils.setReplaceNull(paramMap.get("existRSubCntrData")); + int rCnt = 0; + int existRSubCntrData = 0; + if(!temprCnt.equals("")){ + rCnt = Integer.parseInt(temprCnt); + } + if(!tempExistRSubCntrData.equals("")){ + existRSubCntrData = Integer.parseInt(tempExistRSubCntrData); + } + + paramMap.put("cntrGubun", "R"); + for(int i = 1; i <= rCnt; i++){ + paramMap.put("subCntrCubun", SeedUtils.setReplaceNull(paramMap.get("r_subCntrCubun_"+i))); + paramMap.put("subCntrDt", SeedUtils.setReplaceNull(paramMap.get("r_subCntrDt_"+i))); + paramMap.put("subCntrSttAmount", SeedUtils.setReplaceNull(paramMap.get("r_subCntrAmount_"+i)).toString().replaceAll(",", "")); + paramMap.put("subCntrCashDt", SeedUtils.setReplaceNull(paramMap.get("r_subCntrCashDt_"+i))); + paramMap.put("subCntrCashAmount", SeedUtils.setReplaceNull(paramMap.get("r_subCntrCashAmount_"+i)).toString().replaceAll(",", "")); + paramMap.put("subCntrBillPayDay", SeedUtils.setReplaceNull(paramMap.get("r_subCntrBillPayDay_"+i))); + paramMap.put("subCntrBillLimit", SeedUtils.setReplaceNull(paramMap.get("r_subCntrBillLimit_"+i))); + paramMap.put("subCntrBillAmount", SeedUtils.setReplaceNull(paramMap.get("r_subCntrBillAmount_"+i)).toString().replaceAll(",", "")); + paramMap.put("subCntrTotAmount", SeedUtils.setReplaceNull(paramMap.get("r_subCntrTotAmount_"+i)).toString().replaceAll(",", "")); + paramMap.put("subCntrNonPayment", SeedUtils.setReplaceNull(paramMap.get("r_subCntrNonPayment_"+i)).toString().replaceAll(",", "")); + paramMap.put("subCntrNote", SeedUtils.setReplaceNull(paramMap.get("r_subCntrNote_"+i))); + + + if(i <= existRSubCntrData){ + paramMap.put("seqNo", SeedUtils.setReplaceNull(paramMap.get("subCntrSeqNoB_"+i))); + service.subCntrUpdate(paramMap); + }else{ + service.subCntrInsert(paramMap); + } + } + + service.reasonInsert(paramMap); + paramMap.put("sts", "success"); + + }catch (Exception e) { + log.error("CHECK ERROR:",e); + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + + map.put("rceptNo", paramMap.get("rceptNo")); + map.put("siteIdx", "case"); + map.put("url", "/user/mypage/case/01/169/myMediationList.do"); + map.put("message", "user.message.medi.temp"); + map.put("opener", ""); + map.put("append", ""); + map.put("self", ""); + + return new ResponseEntity<>(paramMap, HttpStatus.OK); + //return new ModelAndView("/_extra/web/user/mediation/mediationStep05"); + } + @RequestMapping("/web/user/mediation/{siteIdx}/05/{siteMenuIdx}/updateAjax04_4.do") + public ResponseEntity updateAjax04_4(ModelMap map, HttpServletRequest request, HttpSession session,@RequestParam Map paramMap, + @PathVariable(value="siteIdx") String siteIdx, + @PathVariable(value="siteMenuIdx") Integer siteMenuIdx){ + + + // CI 체크 + if(!ciCheck(map, session)) { + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + /*----권한체크----*/ + setSessionMessageRemove(session); + + Integer memberIdx = Integer.valueOf(SeedUtils.setReplaceNull(session.getAttribute("memberIdx"),"0")); + String memberGrant = (memberIdx == 0) ? "N" : SeedUtils.setReplaceNull(managerMemberService.getMemberMapForm(memberIdx, new String[] {"memberGrant"}).get("_memberGrant"), "N"); + boolean memberAuthM = managerSiteManagerService.getSiteManagerListCnt(siteIdx, memberIdx); + boolean memberAuth = managerSiteMenuManagerService.getSiteMenuManagerListCnt(siteMenuIdx, memberIdx); + +// //메뉴 권한설정 + + boolean b_ret = true; + b_ret = FairnetUtils.hasUserAuth(memberIdx, memberGrant, memberAuth, session, map); + + if (!b_ret) { + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + + Map tSiteMenuDB = managerSiteMenuService.getSiteMenuMapForm(siteMenuIdx, + new String[] {"siteMenuName", "siteMenuParentTitle", "siteMenuStatus", "siteMenuType", "siteMenuLinkUrl", "siteMenuCharge", "siteMenuCharge", "siteMenuSNS", + "siteMenuTitle", "siteMenuRegDate", "siteMenuModDate", "siteMenuNameType", "siteMenuIdxs", "siteMenuDepth", "siteMenuSatisfaction", "siteMenuIdx1", + "tSite.siteActiveMenuWidth", "tSite.siteService", "tSite.siteServiceSdate", "tSite.siteServiceSdate"}); + + if(!memberGrant.equals("S") && !memberAuthM && !memberAuth){ + if(!SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuStatus")).equals("U")){ + map.put("message", "common.message.no.siteMenu"); + map.put("self", "history"); + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + } + + if(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteService")).equals("Y")){ + + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + + try{ + + Date getDate = new Date(); + + Date sDate = formatter.parse(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteServiceSdate"))); + Date eDate = formatter.parse(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteServiceEdate"))); + + if((sDate.compareTo(formatter.parse(formatter.format(getDate))) > 0 && eDate.compareTo(formatter.parse(formatter.format(getDate))) > 0) || + (sDate.compareTo(formatter.parse(formatter.format(getDate))) < 0 && eDate.compareTo(formatter.parse(formatter.format(getDate))) < 0)){ + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + + }catch(ParseException e){ + log.error("CHECK ERROR:",e); + } + } + + if(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuType")).equals("F") || + SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuType")).equals("L")){ + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + + String siteMenuManager = "N"; + StringBuffer siteMenuManagerIdx = new StringBuffer(); + String siteMenuCharge = SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuCharge"), "N"); + + List> siteMenuManagerList = + managerSiteMenuManagerService.getSiteMenuManagerMapList(siteMenuIdx, new String[] {"siteMenuManagerStatus", "tMember.memberIdx"}); + + for(int i=0; i tSiteMenuManagerDB = siteMenuManagerList.get(i); + + if(SeedUtils.setReplaceNull(tSiteMenuManagerDB.get("_siteMenuManagerStatus")).equals("U")){ + + if(!memberIdx.equals(0) && + memberIdx.equals(Integer.parseInt(SeedUtils.setReplaceNull(tSiteMenuManagerDB.get("_memberIdx"), "0"))) && + siteMenuManager.equals("N")){ + siteMenuManager = "Y"; + } + siteMenuManagerIdx.append(SeedUtils.setReplaceNull(tSiteMenuManagerDB.get("_memberIdx")).toString()); + siteMenuManagerIdx.append(","); + } + } + + if(memberGrant.equals("S") || memberAuthM){ + siteMenuManager = "Y"; + } + + //편집 권한 + map.put("siteMenuManager", siteMenuManager); + //담당자 보기 설정 + map.put("siteMenuCharge", siteMenuCharge); + //담당자 이름 + map.put("siteMenuManagerIdx", siteMenuManagerIdx.toString()); + //만족도 설정 + map.put("siteMenuSatisfaction", SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuSatisfaction"), "N")); + + map.put("siteMenuSubTitle", managerSiteMenuService.getSiteMenuSubTitleForm(siteIdx, SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuIdx1")))); + + String siteMenuTitle = managerSiteMenuService.getSiteMenuParentName(siteIdx, SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuIdxs")), "edit").replaceAll("》", "|") + + " | " + SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuName")); + + map.put("siteMenuTitle", siteMenuTitle); + + //부모메뉴 타이틀 설정한 경우 해당 글의 부모 타이틀을 가져옴 + if(SeedUtils.setReplaceNull(tSiteMenuDB.get("_siteMenuParentTitle") ,"N").equals("Y")){ + String[] siteMenuTitles = siteMenuTitle.split("\\|"); + tSiteMenuDB.put("_siteMenuName", siteMenuTitles[Integer.parseInt(tSiteMenuDB.get("_siteMenuDepth").toString())-1]); + } + + map.put("tSiteMenuDB", tSiteMenuDB); + + map.put("memberAuthM", memberAuthM); + map.put("seedMenuAuth", managerGroupService.getGroupList(siteIdx, memberIdx, memberMerge, memberMergeSiteIdx)); + /*----권한체크 종료----*/ + + /*서비스 로직*/ + try{ + + + //접수마스터 UPDATE + service.rceptmstUpdate(paramMap); + + // 사건현황, 협의회별 상세 현황 INSERT + + //콤마 제거하기 +// paramMap.put("rceCapital", paramMap.get("rceCapital").toString().replaceAll(",", "")); +// paramMap.put("rceTotAssets", paramMap.get("rceTotAssets").toString().replaceAll(",", "")); +// paramMap.put("rceTotSales", paramMap.get("rceTotSales").toString().replaceAll(",", "")); +// paramMap.put("rceBp", paramMap.get("rceBp").toString().replaceAll(",", "")); + + if(paramMap.get("rceCapital") != null) { + paramMap.put("rceCapital", paramMap.get("rceCapital").toString().replaceAll(",", "")); + } + if(paramMap.get("rceTotAssets") != null) { + paramMap.put("rceTotAssets", paramMap.get("rceTotAssets").toString().replaceAll(",", "")); + } + if(paramMap.get("rceTotSales") != null) { + paramMap.put("rceTotSales", paramMap.get("rceTotSales").toString().replaceAll(",", "")); + } + if(paramMap.get("rceBp") != null) { + paramMap.put("rceBp", paramMap.get("rceBp").toString().replaceAll(",", "")); + } + + paramMap.put("joiningAmount", SeedUtils.setReplaceNull(paramMap.get("joiningAmount")).toString().replaceAll(",", "")); + paramMap.put("joiningAmount", SeedUtils.setReplaceNull(paramMap.get("joiningAmount")).toString().replaceAll(",", "")); + + //하도급거래 - 시공능력 평가액, + paramMap.put("subCntrAmount", SeedUtils.setReplaceNull(paramMap.get("subCntrAmount")).toString().replaceAll(",", "")); + + paramMap.put("distbTotSales", SeedUtils.setReplaceNull(paramMap.get("distbTotSales")).toString().replaceAll(",", "")); + + service.rceUpdate(paramMap); + + paramMap.put("sts", "success"); + + }catch (Exception e) { + log.error("CHECK ERROR:",e); + paramMap.put("sts", "fail"); + return new ResponseEntity<>(paramMap, HttpStatus.OK); + } + + map.put("rceptNo", paramMap.get("rceptNo")); + map.put("siteIdx", "case"); + map.put("url", "/web/user/mypage/case/01/169/myMediationList.do"); + map.put("message", "user.message.medi.temp"); + map.put("opener", ""); + map.put("append", ""); + map.put("self", ""); + + return new ResponseEntity<>(paramMap, HttpStatus.OK); + //return new ModelAndView("/_extra/web/user/mediation/mediationStep05"); + } private Boolean ciCheck(ModelMap map, HttpSession session) { String ci = SeedUtils.setReplaceNull(session.getAttribute("hpCi1")); diff --git a/src/main/java/seed/utils/kCertBase64.java b/src/main/java/seed/utils/kCertBase64.java new file mode 100644 index 00000000..5b60f718 --- /dev/null +++ b/src/main/java/seed/utils/kCertBase64.java @@ -0,0 +1,107 @@ +package seed.utils; + +public class kCertBase64 { + + private static final char[] encodeTable = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', + 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', + '4', '5', '6', '7', '8', '9', '+', '/' }; + + public static char getEncode(int i) { + return encodeTable[i & 0x3F]; + } + + public static String encode(byte[] input) { + char[] result = new char[((input.length + 2) / 3) * 4]; + + int resultIndex = 0; + int checkLength = 0; + + for (int i = 0; i < input.length; i = i + 3) { + checkLength = input.length - i; + if (checkLength == 2) { + result[resultIndex++] = getEncode(input[i] >> 2); + result[resultIndex++] = getEncode(((input[i] & 0x3) << 4) | ((input[i + 1] >> 4) & 0xF)); + result[resultIndex++] = getEncode((input[i + 1] & 0xF) << 2); + result[resultIndex++] = '='; + } else if (checkLength == 1) { + result[resultIndex++] = getEncode(input[i] >> 2); + result[resultIndex++] = getEncode(((input[i]) & 0x3) << 4); + result[resultIndex++] = '='; + result[resultIndex++] = '='; + } else { + result[resultIndex++] = getEncode(input[i] >> 2); + result[resultIndex++] = getEncode(((input[i] & 0x3) << 4) | ((input[i + 1] >> 4) & 0xF)); + result[resultIndex++] = getEncode(((input[i + 1] & 0xF) << 2) | ((input[i + 2] >> 6) & 0x3)); + result[resultIndex++] = getEncode(input[i + 2] & 0x3F); + } + } + + return new String(result); + } + + private static final byte[] decodeTable = new byte[128]; + private static final byte PADDING = 127; + + static { + for (int i = 0; i < decodeTable.length; i++) { + decodeTable[i] = -1; + } + for (int i = 0; i < encodeTable.length; i++) { + decodeTable[encodeTable[i]] = (byte) i; + } + decodeTable['='] = PADDING; + } + + public static byte[] decode(String input) { + int resultLength = getResultLength(input); + + byte[] result = new byte[resultLength]; + int resultIndex = 0; + + byte[] splitBuff = new byte[4]; + int bufIndex = 0; + + for (int i = 0; i < input.length(); i++) { + char inputChar = input.charAt(i); + byte decodeValue = decodeTable[inputChar]; + + if (decodeValue != -1) { + splitBuff[bufIndex++] = decodeValue; + } + + if (bufIndex == 4) { + result[resultIndex++] = (byte) ((splitBuff[0] << 2) | (splitBuff[1] >> 4)); + if (splitBuff[2] != PADDING) + result[resultIndex++] = (byte) ((splitBuff[1] << 4) | (splitBuff[2] >> 2)); + if (splitBuff[3] != PADDING) + result[resultIndex++] = (byte) ((splitBuff[2] << 6) | (splitBuff[3])); + bufIndex = 0; + } + } + return result; + } + + private static int getResultLength(String input) { + final int inputLength = input.length(); + + int paddingCheck = inputLength - 1; + int paddingSize = 0; + + for (; paddingCheck >= 0; paddingCheck--) { + byte code = decodeTable[input.charAt(paddingCheck)]; + if (code == PADDING) + continue; + if (code == -1) { + return input.length() / 4 * 3; + } + break; + } + + paddingCheck++; + paddingSize = inputLength - paddingCheck; + + return input.length() / 4 * 3 - paddingSize; + } + +} \ No newline at end of file diff --git a/src/main/java/seed/utils/kCertDecryptor.java b/src/main/java/seed/utils/kCertDecryptor.java new file mode 100644 index 00000000..c90cba9f --- /dev/null +++ b/src/main/java/seed/utils/kCertDecryptor.java @@ -0,0 +1,41 @@ +package seed.utils; + +import java.security.MessageDigest; + +import javax.crypto.Cipher; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +public class kCertDecryptor { + public String decrypt(String secretKey, String iv, String cipher) throws Exception { + + // 암호화 알고리즘/모드/패딩 + String algorithm = "AES/CTR/NoPadding"; + + // 비밀 키 디코딩 + byte[] decodedSecretKey = kCertBase64.decode(secretKey); + + // 초기화 벡터 디코딩 + byte[] decodedIv = kCertBase64.decode(iv); + + // 암호문 디코딩 + byte[] decodecCipher = kCertBase64.decode(cipher); + + // 복호화 객체 생성 + Cipher decipherInstance = Cipher.getInstance(algorithm); + + // 복호화 스펙 정의 + SecretKeySpec keySpec = new SecretKeySpec(decodedSecretKey, "AES"); + IvParameterSpec ivSpec = new IvParameterSpec(decodedIv); + + // 복호화 객체 초기화 + decipherInstance.init(Cipher.DECRYPT_MODE, keySpec, ivSpec); + + // 복호화 + byte[] plain = decipherInstance.doFinal(decodecCipher); + + // 복호화 된 평문(byte[])을 문자로 변환 + return new String(plain, "UTF-8"); + + } +} \ No newline at end of file diff --git a/src/main/java/seed/utils/nCertBase64.java b/src/main/java/seed/utils/nCertBase64.java new file mode 100644 index 00000000..dde873f2 --- /dev/null +++ b/src/main/java/seed/utils/nCertBase64.java @@ -0,0 +1,107 @@ +package seed.utils; + +public class nCertBase64 { + + private static final char[] encodeTable = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', + 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', + '4', '5', '6', '7', '8', '9', '+', '/' }; + + public static char getEncode(int i) { + return encodeTable[i & 0x3F]; + } + + public static String encode(byte[] input) { + char[] result = new char[((input.length + 2) / 3) * 4]; + + int resultIndex = 0; + int checkLength = 0; + + for (int i = 0; i < input.length; i = i + 3) { + checkLength = input.length - i; + if (checkLength == 2) { + result[resultIndex++] = getEncode(input[i] >> 2); + result[resultIndex++] = getEncode(((input[i] & 0x3) << 4) | ((input[i + 1] >> 4) & 0xF)); + result[resultIndex++] = getEncode((input[i + 1] & 0xF) << 2); + result[resultIndex++] = '='; + } else if (checkLength == 1) { + result[resultIndex++] = getEncode(input[i] >> 2); + result[resultIndex++] = getEncode(((input[i]) & 0x3) << 4); + result[resultIndex++] = '='; + result[resultIndex++] = '='; + } else { + result[resultIndex++] = getEncode(input[i] >> 2); + result[resultIndex++] = getEncode(((input[i] & 0x3) << 4) | ((input[i + 1] >> 4) & 0xF)); + result[resultIndex++] = getEncode(((input[i + 1] & 0xF) << 2) | ((input[i + 2] >> 6) & 0x3)); + result[resultIndex++] = getEncode(input[i + 2] & 0x3F); + } + } + + return new String(result); + } + + private static final byte[] decodeTable = new byte[128]; + private static final byte PADDING = 127; + + static { + for (int i = 0; i < decodeTable.length; i++) { + decodeTable[i] = -1; + } + for (int i = 0; i < encodeTable.length; i++) { + decodeTable[encodeTable[i]] = (byte) i; + } + decodeTable['='] = PADDING; + } + + public static byte[] decode(String input) { + int resultLength = getResultLength(input); + + byte[] result = new byte[resultLength]; + int resultIndex = 0; + + byte[] splitBuff = new byte[4]; + int bufIndex = 0; + + for (int i = 0; i < input.length(); i++) { + char inputChar = input.charAt(i); + byte decodeValue = decodeTable[inputChar]; + + if (decodeValue != -1) { + splitBuff[bufIndex++] = decodeValue; + } + + if (bufIndex == 4) { + result[resultIndex++] = (byte) ((splitBuff[0] << 2) | (splitBuff[1] >> 4)); + if (splitBuff[2] != PADDING) + result[resultIndex++] = (byte) ((splitBuff[1] << 4) | (splitBuff[2] >> 2)); + if (splitBuff[3] != PADDING) + result[resultIndex++] = (byte) ((splitBuff[2] << 6) | (splitBuff[3])); + bufIndex = 0; + } + } + return result; + } + + private static int getResultLength(String input) { + final int inputLength = input.length(); + + int paddingCheck = inputLength - 1; + int paddingSize = 0; + + for (; paddingCheck >= 0; paddingCheck--) { + byte code = decodeTable[input.charAt(paddingCheck)]; + if (code == PADDING) + continue; + if (code == -1) { + return input.length() / 4 * 3; + } + break; + } + + paddingCheck++; + paddingSize = inputLength - paddingCheck; + + return input.length() / 4 * 3 - paddingSize; + } + +} \ No newline at end of file diff --git a/src/main/java/seed/utils/nCertDecryptor.java b/src/main/java/seed/utils/nCertDecryptor.java new file mode 100644 index 00000000..f5e6f434 --- /dev/null +++ b/src/main/java/seed/utils/nCertDecryptor.java @@ -0,0 +1,59 @@ +package seed.utils; + +import java.security.MessageDigest; + +import javax.crypto.Cipher; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +public class nCertDecryptor { + public static int BLOCK_SIZE = 16; + + public String decrypt(String secretKey, String iv, String cipher) throws Exception { + + // 암호화 알고리즘/모드/패딩 + String algorithm = "AES/CBC/PKCS5PADDING"; + + // 비밀 키 디코딩 + byte[] decodedSecretKey = keyInstance(secretKey, BLOCK_SIZE); + + // 초기화 벡터 디코딩 + byte[] decodedIv = iv.getBytes("UTF-8"); + + // 암호문 디코딩 + byte[] decodecCipher = nCertBase64.decode(cipher); + + // 복호화 객체 생성 + Cipher decipherInstance = Cipher.getInstance(algorithm); + + // 복호화 스펙 정의 + SecretKeySpec keySpec = new SecretKeySpec(decodedSecretKey, "AES"); + IvParameterSpec ivSpec = new IvParameterSpec(decodedIv); + + // 복호화 객체 초기화 + decipherInstance.init(Cipher.DECRYPT_MODE, keySpec, ivSpec); + + // 복호화 + byte[] plain = decipherInstance.doFinal(decodecCipher); + + // 복호화 된 평문(byte[])을 문자로 변환 + return new String(plain, "UTF-8"); + + } + + public byte[] keyInstance(String secretkey, int size) { + + byte[] retHashValue = new byte[size]; + + try { + MessageDigest md = MessageDigest.getInstance("SHA1"); + byte[] hash = md.digest(secretkey.getBytes("UTF-8")); + size = Math.min(size, hash.length); + System.arraycopy(hash, 0, retHashValue, 0, size); + }catch(Exception e) { + e.printStackTrace(); + } + + return retHashValue; + } +} \ No newline at end of file diff --git a/src/main/resources/egovframework/sqlmap/config/mappers/mediation/mediation_sql.xml b/src/main/resources/egovframework/sqlmap/config/mappers/mediation/mediation_sql.xml index 502d8fd5..82413321 100644 --- a/src/main/resources/egovframework/sqlmap/config/mappers/mediation/mediation_sql.xml +++ b/src/main/resources/egovframework/sqlmap/config/mappers/mediation/mediation_sql.xml @@ -45,7 +45,9 @@ MOD_DT, MOD_ID, DEL_GUBUN, - DOC_CHECK + DOC_CHECK, + CONSIGNMENT_GUBUN, + CASE_DATE ,FTC_CHECK @@ -82,7 +84,9 @@ '', '', 'N', - '5101000000' + '5101000000', + #{consignmentGubun}, + SYSDATE , 'N' @@ -350,8 +354,12 @@ UPDATE C_RCEPTMST SET + CASE_GUBUN = #{caseGubun}, + + CASE_REASON1 = #{caseReason1}, + CASE_REASON2 = #{caseReason2}, @@ -432,55 +440,154 @@ UPDATE C_RCEPTSTTUS SET - CAPITAL = #{rceCapital, jdbcType=VARCHAR}, - TOTAL_ASSETS = #{rceTotAssets, jdbcType=VARCHAR}, - TOTAL_SALES = #{rceTotSales, jdbcType=VARCHAR}, - BUSINESS_PROFITS = #{rceBp, jdbcType=VARCHAR}, - FIRST_CONTRACT_DT = #{rceFirstContract, jdbcType=VARCHAR}, - START_CONTRACT = #{rceStartContract, jdbcType=VARCHAR}, - END_CONTRACT = #{rceEndContract, jdbcType=VARCHAR}, - CONTRACT_FILE = '', - PERSON_CHARGE = #{rcePersonCharge, jdbcType=VARCHAR}, - CONTACT_TEL = #{rceTel, jdbcType=VARCHAR}, - CONTACT_HP = #{rcePh, jdbcType=VARCHAR}, - CONTACT_FAX = #{rceFax, jdbcType=VARCHAR}, - CONTACT_OFCPS = #{rceOfcps, jdbcType=VARCHAR}, - CONTACT_EMAIL = #{rceEmail, jdbcType=VARCHAR}, - LAWSUIT_CHECK = #{rceLawCheck, jdbcType=VARCHAR}, - CONFERENCE_RESULT = #{rceConferenceResult, jdbcType=VARCHAR}, - ARBITRATION_CHECK = #{rceArbCheck, jdbcType=VARCHAR}, - REGULATING_ORGAN = #{rceRegulatingOrgan, jdbcType=VARCHAR}, - FTC_INVESTIGATION = #{rceFtcInvestigation, jdbcType=VARCHAR}, - APPLICATION_OBJ = #{editorParam_rceAppObj, jdbcType=VARCHAR}, - APPLICATION_REASON = #{editorParam_rceAppReason, jdbcType=VARCHAR}, - SUBCNTR_NUM = #{subcntrNum, jdbcType=INTEGER}, - SUBCNTR_GUBUN = #{subcntrGubun, jdbcType=VARCHAR}, - SUBCNTR_CON = #{subcntrCon, jdbcType=VARCHAR}, - SUBCNTR_AMOUNT = #{subCntrAmount, jdbcType=VARCHAR}, - MRHST_NUM = #{mrhstNum, jdbcType=INTEGER}, - MRHST_TYPE = #{mrhstType, jdbcType=VARCHAR}, - MRHST_BRAND_NM = #{mrhstBrand, jdbcType=VARCHAR}, - MRHST_INFO_CHECK = #{mrhstInfoCheck, jdbcType=VARCHAR}, - MRHST_BALANCE_CHECK = #{mrhstBalance, jdbcType=VARCHAR}, - MRHST_NAME = #{mrhstName, jdbcType=VARCHAR}, - MRHST_START_CONTRACT = #{mrhstStart, jdbcType=VARCHAR}, - MRHST_END_CONTRACT = #{mrhstEnd, jdbcType=VARCHAR}, - MRHST_FIRST_CONTRACT_DT = #{mrhstFirst, jdbcType=VARCHAR}, - MRHST_INFO_DT = #{mrhstInfoDt, jdbcType=VARCHAR}, - JOINING_AMOUNT = #{joiningAmount, jdbcType=VARCHAR}, - JOINING_AMOUNT_DT = #{joiningAmountDt, jdbcType=VARCHAR}, - JOINING_AMOUNT_BALANCE = #{joiningAmountBalance, jdbcType=VARCHAR}, - JOINING_AMOUNT_ORG = #{joiningAmountOrg, jdbcType=VARCHAR}, - DISTB_NUM = #{distbNum, jdbcType=INTEGER}, - DISTB_MAK_SHARE = #{distbMakShare, jdbcType=VARCHAR}, - DISTB_SHOP_GROSSAREA = #{distbShopGrossarea, jdbcType=VARCHAR}, - DISTB_TOTAL_SALES = #{distbTotSales, jdbcType=VARCHAR}, - DISTB_FTC = #{distbFtc, jdbcType=VARCHAR}, - LAWSUT_NOTE = #{rceLawNot, jdbcType=VARCHAR}, - ARBITRATION_NOTE = #{rceArbNote, jdbcType=VARCHAR}, - CONFERENCE_NOTE = #{rceConferenceResultNot, jdbcType=VARCHAR}, - REGULATING_NOTE = #{rceRegulatingOrganNote, jdbcType=VARCHAR}, - FTC_NOTE = #{rceFtcInvestigationNote, jdbcType=VARCHAR} + + CAPITAL = #{rceCapital, jdbcType=VARCHAR}, + + + TOTAL_ASSETS = #{rceTotAssets, jdbcType=VARCHAR}, + + + TOTAL_SALES = #{rceTotSales, jdbcType=VARCHAR}, + + + BUSINESS_PROFITS = #{rceBp, jdbcType=VARCHAR}, + + + FIRST_CONTRACT_DT = #{rceFirstContract, jdbcType=VARCHAR}, + + + START_CONTRACT = #{rceStartContract, jdbcType=VARCHAR}, + + + END_CONTRACT = #{rceEndContract, jdbcType=VARCHAR}, + + + PERSON_CHARGE = #{rcePersonCharge, jdbcType=VARCHAR}, + + + CONTACT_TEL = #{rceTel, jdbcType=VARCHAR}, + + + CONTACT_HP = #{rcePh, jdbcType=VARCHAR}, + + + CONTACT_FAX = #{rceFax, jdbcType=VARCHAR}, + + + CONTACT_OFCPS = #{rceOfcps, jdbcType=VARCHAR}, + + + CONTACT_EMAIL = #{rceEmail, jdbcType=VARCHAR}, + + + LAWSUIT_CHECK = #{rceLawCheck, jdbcType=VARCHAR}, + + + CONFERENCE_RESULT = #{rceConferenceResult, jdbcType=VARCHAR}, + + + ARBITRATION_CHECK = #{rceArbCheck, jdbcType=VARCHAR}, + + + REGULATING_ORGAN = #{rceRegulatingOrgan, jdbcType=VARCHAR}, + + + FTC_INVESTIGATION = #{rceFtcInvestigation, jdbcType=VARCHAR}, + + + APPLICATION_OBJ = #{editorParam_rceAppObj, jdbcType=VARCHAR}, + + + APPLICATION_REASON = #{editorParam_rceAppReason, jdbcType=VARCHAR}, + + + SUBCNTR_NUM = #{subcntrNum, jdbcType=INTEGER}, + + + SUBCNTR_GUBUN = #{subcntrGubun, jdbcType=VARCHAR}, + + + SUBCNTR_CON = #{subcntrCon, jdbcType=VARCHAR}, + + + SUBCNTR_AMOUNT = #{subCntrAmount, jdbcType=VARCHAR}, + + + MRHST_NUM = #{mrhstNum, jdbcType=INTEGER}, + + + MRHST_TYPE = #{mrhstType, jdbcType=VARCHAR}, + + + MRHST_BRAND_NM = #{mrhstBrand, jdbcType=VARCHAR}, + + + MRHST_INFO_CHECK = #{mrhstInfoCheck, jdbcType=VARCHAR}, + + + MRHST_BALANCE_CHECK = #{mrhstBalance, jdbcType=VARCHAR}, + + + MRHST_NAME = #{mrhstName, jdbcType=VARCHAR}, + + + MRHST_START_CONTRACT = #{mrhstStart, jdbcType=VARCHAR}, + + + MRHST_END_CONTRACT = #{mrhstEnd, jdbcType=VARCHAR}, + + + MRHST_FIRST_CONTRACT_DT = #{mrhstFirst, jdbcType=VARCHAR}, + + + MRHST_INFO_DT = #{mrhstInfoDt, jdbcType=VARCHAR}, + + + JOINING_AMOUNT = #{joiningAmount, jdbcType=VARCHAR}, + + + JOINING_AMOUNT_DT = #{joiningAmountDt, jdbcType=VARCHAR}, + + + JOINING_AMOUNT_BALANCE = #{joiningAmountBalance, jdbcType=VARCHAR}, + + + JOINING_AMOUNT_ORG = #{joiningAmountOrg, jdbcType=VARCHAR}, + + + DISTB_NUM = #{distbNum, jdbcType=INTEGER}, + + + DISTB_MAK_SHARE = #{distbMakShare, jdbcType=VARCHAR}, + + + DISTB_SHOP_GROSSAREA = #{distbShopGrossarea, jdbcType=VARCHAR}, + + + DISTB_TOTAL_SALES = #{distbTotSales, jdbcType=VARCHAR}, + + + DISTB_FTC = #{distbFtc, jdbcType=VARCHAR}, + + + LAWSUT_NOTE = #{rceLawNot, jdbcType=VARCHAR}, + + + LAWSUT_CASENUM = #{rceLawCaseNum, jdbcType=VARCHAR}, + + + ARBITRATION_NOTE = #{rceArbNote, jdbcType=VARCHAR}, + + + CONFERENCE_NOTE = #{rceConferenceResultNot, jdbcType=VARCHAR}, + + + REGULATING_NOTE = #{rceRegulatingOrganNote, jdbcType=VARCHAR}, + + + FTC_NOTE = #{rceFtcInvestigationNote, jdbcType=VARCHAR}, + + RCEPT_NO = #{rceptNo} WHERE RCEPT_NO = #{rceptNo} diff --git a/src/main/resources/egovframework/sqlmap/config/mappers/mypage/mypage_sql.xml b/src/main/resources/egovframework/sqlmap/config/mappers/mypage/mypage_sql.xml index ba90316b..58984d2f 100644 --- a/src/main/resources/egovframework/sqlmap/config/mappers/mypage/mypage_sql.xml +++ b/src/main/resources/egovframework/sqlmap/config/mappers/mypage/mypage_sql.xml @@ -120,7 +120,8 @@ (SELECT CODE_NAME FROM C_CODE WHERE CODE_IDXS = CR.CASE_REASON3) AS CASE_REASON3_NAME, CASE_REASON1, CASE_REASON2, - CASE_REASON3 + CASE_REASON3, + CONSIGNMENT_GUBUN FROM C_RCEPTMST CR WHERE RCEPT_NO = #{rceptNo} diff --git a/src/main/webapp/WEB-INF/decorators.xml b/src/main/webapp/WEB-INF/decorators.xml index 083f4ee6..10d8cf61 100644 --- a/src/main/webapp/WEB-INF/decorators.xml +++ b/src/main/webapp/WEB-INF/decorators.xml @@ -175,4 +175,9 @@ */web/* + + + + /web/user/cert/* + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/_extra/web/user/mediation/mediationStep02.jsp b/src/main/webapp/WEB-INF/jsp/_extra/web/user/mediation/mediationStep02.jsp index c57d3676..ab8c2425 100644 --- a/src/main/webapp/WEB-INF/jsp/_extra/web/user/mediation/mediationStep02.jsp +++ b/src/main/webapp/WEB-INF/jsp/_extra/web/user/mediation/mediationStep02.jsp @@ -363,7 +363,7 @@ 개인정보 수집·이용·제공등과 관련하여 문의사항이 있는 경우 1588-1490번으로 연락주시기 바랍니다.

- +
diff --git a/src/main/webapp/WEB-INF/jsp/_extra/web/user/mediation/mediationStep04.jsp b/src/main/webapp/WEB-INF/jsp/_extra/web/user/mediation/mediationStep04.jsp index a297c6c9..2eede2ed 100644 --- a/src/main/webapp/WEB-INF/jsp/_extra/web/user/mediation/mediationStep04.jsp +++ b/src/main/webapp/WEB-INF/jsp/_extra/web/user/mediation/mediationStep04.jsp @@ -15,8 +15,6 @@ $(document).ready(function(){ addTabB(); // 신청인 등록폼 추가 delTabB(); - addTabC(); // 피신청인 등록폼 추가 - delTabC(); }); //신청인 추가 @@ -268,163 +266,9 @@ // }); } - function addTabC(){ - $('.btnAddTabC').on('click',function(){ - var areaCount = $('.subTab_c').length + 1; - - if(areaCount > 5) { - alert("피신청인은 최대 5명까지 등록 가능합니다."); - return false; - } - - $("#recCnt").val(areaCount);//피신청인 여러번 저장하기 위해 신청인 갯수 전달 - var mark = ""; - mark += "
"; - mark += "" - mark += "
" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "" - mark += "
피신청인 등록폼 "+areaCount+"번째폼: 피신청인의 상호, 대표자, 개인/법인, 우편번호, 지번주소, 도로명주소, 대표전화번호(휴대폰), FAX, 사업자등록번호, 법인등록번호
피신청인" - mark += "필수입력" - mark += "" - mark += "" - mark += "" - mark += "필수입력" - mark += "" - mark += "" - mark += "
" - mark += "필수입력" - mark += "" - mark += "" - mark += "
" - mark += "필수입력" - mark += "" - mark += "" - mark += ""; - mark += "
" - mark += "필수입력" - mark += "" - mark += "" - mark += "
" - mark += "" - mark += "
" - mark += "필수입력" - mark += "" - mark += "" - mark += "
" - mark += "" - mark += "
" - mark += "필수입력
(휴대폰)" - mark += "
" - mark += "" - mark += " - - " - mark += "" - mark += "" - mark += "" - mark += " - - " - mark += "
" - mark += "필수입력
('-'제외)" - mark += "
" - mark += "" - mark += "" - mark += "
('-'제외)" - mark += "
" - mark += "" - mark += "
" - mark += "
" - mark += "
" - $('.subTab_c_wrap').append(mark); - cpGubunCombo(areaCount); - $(document).on('click','button.subTab_c_tit',function(event){ - //event.preventDefault(); - event.stopImmediatePropagation(); - $(this).toggleClass('subTab_c_tit_on'); - $(this).next().slideToggle('fast'); - }); - }); - } - - function delTabC(){ - $(".btnDelTabC").click(function(){ - var areaCount = $('.subTab_c').length - if(areaCount > 1){ - var delSeqArr = ""; - - if( $("#seqNo_"+areaCount).val() != "" && $("#seqNo_"+areaCount).val() != undefined){ - if($("#resDelSeq").val() == ""){ - delSeqArr = $("#seqNo_"+areaCount).val(); - }else{ - delSeqArr = $("#resDelSeq").val() + "," + $("#seqNo_"+areaCount).val(); - } - - /*임시저장 피신청인 카운트*/ - $("#existDataCnt").val(Number($("#existDataCnt").val()) - 1);//삭제된 갯수 빼주기 - } - - /*전체 피신청인 카운트*/ - $("#recCnt").val(Number($("#recCnt").val()) - 1);//삭제된 갯수 빼주기 - - $("#resDelSeq").val(delSeqArr); - $(".outerBoxC"+areaCount).remove(); - } - }); - } - - - - - var doubleSubmitFlag = false; - + //신규 우편번호 function jusoCallBack(roadFullAddr,roadAddrPart1,addrDetail,roadAddrPart2,engAddr, jibunAddr, zipNo, admCd, rnMgtSn, bdMgtSn, command){ var f = document.applyForm; @@ -455,7 +299,7 @@ $("input:text[name=resRoadAddr2_"+command+"]").val(addrDetail); } /*피신청인 주소는 동적이기 때문에 따로처리*/ - } + } function goJuso(command){ var pop = window.open("/user/extra/case/zipCode/jusoPopup/jsp/Page.do?command="+command,"pop","width=570,height=420, scrollbars=yes, resizable=yes"); @@ -492,34 +336,6 @@ return retValue; } - function managerInsert(funcType){ - if(funcType == "same"){ - $("#rcePersonCharge").val($("#agentCeo").val()); - $("#rceTel").val($("#agentTel").val()); - $("#rcePh1").val($("#agentHp01").val()); - $("#rcePh2").val($("#agentHp02").val()); - $("#rcePh3").val($("#agentHp03").val()); - $("#rceEmail").val($("#agentEmail").val()); - $("#rceZip").val($("#agentZip").val()); - $("#rceAddr1").val($("#agentAddr1").val()); - $("#rceAddr2").val($("#agentAddr2").val()); - $("#rceRoadAddr1").val($("#agentRoadAddr1").val()); - $("#rceRoadAddr2").val($("#agentRoadAddr2").val()); - }else if(funcType == "nsame"){ - $("#rcePersonCharge").val(""); - $("#rceTel").val(""); - $("#rcePh1").val(""); - $("#rcePh2").val(""); - $("#rcePh3").val(""); - $("#rceEmail").val(""); - $("#rceZip").val(""); - $("#rceAddr1").val(""); - $("#rceAddr2").val(""); - $("#rceRoadAddr1").val(""); - $("#rceRoadAddr2").val(""); - } - } - function insertA(funcType){ if(funcType == 'in'){ var childLength = $(".ACnt").size()+1; @@ -1053,66 +869,40 @@ return false; } } + + function tempAppBtn_step(div){ - function applyBtn(){ - if(doubleSubmitFlag){ - alert("분쟁조정 신청 중입니다."); - return false; - } else { - // 세션 체크 후 인증팝업 호출 - var sessionchk = false; - $.ajax({ - url: '/user/case/userCheck/setCheckCode/sessioncheck.do', - type: 'POST', - dataType: 'json', - data: '', - async: false, - success: function(r) { - if(!r.status){ - alert(r.message); - sessionchk = true; - var url = "/user/case/userCheck/mediation/auth.do" - window.open( url, "pop", "width=570, height=602, status=no,toolbar=no,scrollbars=no"); + /*신청사유 및 유형 유효성 */ + if($("#caseGubun").val() == ""){ + alert("조정유형을 선택해 주세요"); + doubleSubmitFlag = false; + return false; + } + + if($("#caseReason1").length > 0 && $("#caseReason1").val() == ""){ + alert("신청사유를 선택해 주세요"); + doubleSubmitFlag = false; + return false; + } + if($("#caseReason2").length > 0 && $("#caseReason2").val() == ""){ + alert("신청사유를 선택해 주세요"); + doubleSubmitFlag = false; + return false; + } + if($("#caseReason3").length > 0 && $("#caseReason3").val() == ""){ + alert("신청사유를 선택해 주세요"); + doubleSubmitFlag = false; + return false; } - } - }); - if(sessionchk){ - return false; - } - - doubleSubmitFlag = true; - - if($("#rceTel").val().length > 15){ - alert("전화번호가 너무 깁니다."); - doubleSubmitFlag = false; - return false; - } - - if($("#rceOfcps").val().length > 10){ - alert("부서/직위는 10자를 넘을 수 없습니다"); - doubleSubmitFlag = false; - return false; - } - - /*신청인 유효성 */ - if($("#caseGubun").val() == ""){ - alert("조정유형을 선택해 주세요"); - doubleSubmitFlag = false; - return false; - } - - if($("#caseReason1").val() == ""){ - alert("신청사유를 선택해 주세요"); - doubleSubmitFlag = false; - return false; - } - - if($("#caseGubun option:selected").val() == '0203000000' && $("#consignmentGubun option:selected").val() == ""){ - alert("하도급 위탁유형을 선택해 주세요"); - doubleSubmitFlag = false; - return false; - } + if($("#caseGubun option:selected").val() == '0203000000' && $("#consignmentGubun option:selected").val() == ""){ + alert("하도급 위탁유형을 선택해 주세요"); + doubleSubmitFlag = false; + return false; + } + /*신청사유 및 유형 유효성 END*/ + + /*신청인 유효성 */ var appList = $(".applcntCompany"); for(var i = 0; i < appList.length; i++){ if(appList[i].value == ""){ @@ -1122,7 +912,7 @@ return false; } } - + appList = $(".companyCeo"); for(var i = 0; i < appList.length; i++){ if(appList[i].value == ""){ @@ -1132,476 +922,88 @@ return false; } } - + appList = $(".companyGubun"); for(var i = 0; i < appList.length; i++){ if(appList[i].value == ""){ alert((i+1) + ". 신청인 개입/법인을 선택해 주세요"); - doubleSubmitFlag = false; - appList[i].focus(); - return false; - } + doubleSubmitFlag = false; + appList[i].focus(); + return false; + } } - + appList = $(".addrZip"); for(var i = 0; i < appList.length; i++){ - if(appList[i].value == "" && $("#s_foreignCountry-"+(i+1)).is(":checked") == false){ - alert((i+1) + ". 신청인 주소를 검색해 주세요"); - doubleSubmitFlag = false; - appList[i].focus(); - return false; - } + if(appList[i].value == "" && $("#s_foreignCountry-"+(i+1)).is(":checked") == false){ + alert((i+1) + ". 신청인 주소를 검색해 주세요"); + doubleSubmitFlag = false; + appList[i].focus(); + return false; + } } - + appList = $(".tel2"); for(var i = 0; i < appList.length; i++){ - if(appList[i].value == ""){ - alert((i+1) + ". 신청인 대표 전화번호를 입력해 주세요"); - doubleSubmitFlag = false; - appList[i].focus(); - return false; - } + if(appList[i].value == ""){ + alert((i+1) + ". 신청인 대표 전화번호를 입력해 주세요"); + doubleSubmitFlag = false; + appList[i].focus(); + return false; + } } - - appList = $(".email1"); - for(var i = 0; i < appList.length; i++){ - if(appList[i].value == ""){ - alert((i+1) + ". 신청인 이메일을 입력해 주세요"); - doubleSubmitFlag = false; - appList[i].focus(); - return false; - } - } - - appList = $(".email2"); - for(var i = 0; i < appList.length; i++){ - if(appList[i].value == ""){ - alert((i+1) + ". 신청인 이메일을 입력해 주세요"); - doubleSubmitFlag = false; - appList[i].focus(); - return false; - } - } - appList = $(".tel3"); for(var i = 0; i < appList.length; i++){ - if(appList[i].value == ""){ - alert((i+1) + ". 신청인 대표 전화번호를 입력해 주세요"); - doubleSubmitFlag = false; - appList[i].focus(); - return false; - } + if(appList[i].value == ""){ + alert((i+1) + ". 신청인 대표 전화번호를 입력해 주세요"); + doubleSubmitFlag = false; + appList[i].focus(); + return false; + } } - + + appList = $(".email1"); + for(var i = 0; i < appList.length; i++){ + if(appList[i].value == ""){ + alert((i+1) + ". 신청인 이메일을 입력해 주세요"); + doubleSubmitFlag = false; + appList[i].focus(); + return false; + } + } + + appList = $(".email2"); + for(var i = 0; i < appList.length; i++){ + if(appList[i].value == ""){ + alert((i+1) + ". 신청인 이메일을 입력해 주세요"); + doubleSubmitFlag = false; + appList[i].focus(); + return false; + } + } + + appList = $(".tel3"); + for(var i = 0; i < appList.length; i++){ + if(appList[i].value == ""){ + alert((i+1) + ". 신청인 대표 전화번호를 입력해 주세요"); + doubleSubmitFlag = false; + appList[i].focus(); + return false; + } + } + appList = $(".bizrNo"); for(var i = 0; i < appList.length; i++){ - if(appList[i].value == ""){ - alert((i+1) + ". 신청인 사업자등록번호를 입력해 주세요"); - doubleSubmitFlag = false; - appList[i].focus(); - return false; - } + if(appList[i].value == ""){ + alert((i+1) + ". 신청인 사업자등록번호를 입력해 주세요"); + doubleSubmitFlag = false; + appList[i].focus(); + return false; + } } + /*신청인 유효성 END*/ - /*신청인 유효성 END*/ - - /*피신청인 유효성 검사*/ - var resList = $(".resCompany"); - for(var i = 0; i < resList.length; i++){ - if(resList[i].value == ""){ - alert((i+1) + ". 피신청인 상호를 입력해 주세요"); - doubleSubmitFlag = false; - resList[i].focus(); - return false; - } - } - - resList = $(".resCeo"); - for(var i = 0; i < resList.length; i++){ - if(resList[i].value == ""){ - alert((i+1) + ". 피신청인 대표자를 입력해 주세요"); - doubleSubmitFlag = false; - resList[i].focus(); - return false; - } - } - - resList = $(".resGunbun"); - for(var i = 0; i < resList.length; i++){ - if(resList[i].value == ""){ - alert((i+1) + ". 피신청인 개인/법인을 선택해 주세요"); - doubleSubmitFlag = false; - resList[i].focus(); - return false; - } - } - - resList = $(".resZip"); - for(var i = 0; i < resList.length; i++){ - if(resList[i].value == "" && $("#res_foreignCountry-"+(i+1)).is(":checked") == false){ - alert((i+1) + ". 피신청인 주소를 검색해 주세요"); - doubleSubmitFlag = false; - resList[i].focus(); - return false; - } - } - - resList = $(".resTel2"); - for(var i = 0; i < resList.length; i++){ - if(resList[i].value == ""){ - alert((i+1) + ". 피신청인 대표 전화번호를 입력해 주세요"); - doubleSubmitFlag = false; - resList[i].focus(); - return false; - } - } - - resList = $(".resTel3"); - for(var i = 0; i < resList.length; i++){ - if(resList[i].value == ""){ - alert((i+1) + ". 피신청인 대표 전화번호를 입력해 주세요"); - doubleSubmitFlag = false; - resList[i].focus(); - return false; - } - } - - resList = $(".resBizrNo"); - for(var i = 0; i < resList.length; i++){ - if(resList[i].value == ""){ - alert((i+1) + ". 피신청인 사업자등록번호를 입력해 주세요"); - doubleSubmitFlag = false; - resList[i].focus(); - return false; - } - } - /*피신청인 유효성 검사 END*/ - - /*담당자 유효성 검사*/ - if($("#rceEmail").val() == ""){ - alert("담당자 이메일을 입력 해 주세요"); - doubleSubmitFlag = false; - $("#rceEmail").focus(); - return false; - } - /*담당자 유효성 검사 END*/ - if(!$("input[name=applyCheck]").is(":checked")){ - alert("신청 확인사항을 선택해 주세요"); - doubleSubmitFlag = false; - $("input[name=applyCheck]:eq(1)").focus(); - return false; - } - /*기타확인사항 유효성 검사*/ - if(!$("input:radio[name=rceLawCheck]").is(":checked")){ - alert("소송 진행 여부를 선택해 주세요"); - doubleSubmitFlag = false; - $("input:radio[name=rceLawCheck]").focus(); - return false; - }else{ - if($("input:radio[name=rceLawCheck]:checked").val() == "Y"){ - if($("#rceLawNot").val() == ""){ - alert("법원명을 입력해 주세요"); - doubleSubmitFlag = false; - $("#rceLawNot").focus(); - return false; - } - if($("#rceLawCaseNum").val() == ""){ - alert("사건번호를 입력해 주세요"); - doubleSubmitFlag = false; - $("#rceLawCaseNum").focus(); - return false; - } - if(!$("input:radio[name=rceLawCheckSame]").is(":checked")){ - alert("소송 내용이 조정신청 내용과 동일한지를 선택해 주세요"); - doubleSubmitFlag = false; - $("input:radio[name=rceLawCheckSame]").focus(); - return false; - } - } - } - - if(!$("input:radio[name=rceConferenceResult]").is(":checked")){ - alert("타 협의회 조정 여부를 선택해 주세요"); - doubleSubmitFlag = false; - $("input:radio[name=rceConferenceResult]").focus(); - return false; - }else{ - if($("input:radio[name=rceConferenceResult]:checked").val() == "Y"){ - if($("#rceConferenceResultNot").val() == ""){ - alert("협의회명을 입력 해 주세요"); - doubleSubmitFlag = false; - } - } - } - - if(!$("input:radio[name=rceArbCheck]").is(":checked")){ - alert("중재 여부를 선택해 주세요"); - doubleSubmitFlag = false; - $("input:radio[name=rceArbCheck]").focus(); - return false; - }else{ - if($("input:radio[name=rceArbCheck]:checked").val() == "Y"){ - if($("#rceArbNote").val() == ""){ - alert("중재기관명을 입력 해 주세요"); - doubleSubmitFlag = false; - } - } - } - - if(!$("input:radio[name=rceRegulatingOrgan]").is(":checked")){ - alert("타 조정기구 조정 여부를 선택해 주세요"); - doubleSubmitFlag = false; - $("input:radio[name=rceRegulatingOrgan]").focus(); - return false; - }else{ - if($("input:radio[name=rceRegulatingOrgan]:checked").val() == "Y"){ - if($("#rceRegulatingOrganNote").val() == ""){ - alert("조정기구명을 입력 해 주세요"); - doubleSubmitFlag = false; - } - } - } - - if(!$("input:radio[name=rceFtcInvestigation]").is(":checked")){ - alert("공정거래위원회 조사 여부를 선택해 주세요"); - doubleSubmitFlag = false; - $("input:radio[name=rceFtcInvestigation]").focus(); - return false; - }else{ - if($("input:radio[name=rceFtcInvestigation]:checked").val() == "Y"){ - if($("#rceFtcInvestigationNote").val() == ""){ - alert("담당부서명을 입력 해 주세요"); - doubleSubmitFlag = false; - } - } - } - - - if(!$("input:radio[name=rceFtcCorrect]").is(":checked")){ - alert("동일사안 공정거래위원회 시정조치 여부를 선택해 주세요"); - doubleSubmitFlag = false; - $("input:radio[name=rceFtcCorrect]").focus(); - return false; - }else{ - if($("input:radio[name=rceFtcCorrect]:checked").val() == "Y"){ - if($("#rceFtcCorrectNote").val() == ""){ - alert("의결번호를 입력 해 주세요"); - doubleSubmitFlag = false; - } - } - } - - - - if(!$("input:radio[name=rceParAgreement]").is(":checked")){ - alert("당사자간 합의가 완료되어 조정조서 작성을 요청하는 사안인지 여부"); - doubleSubmitFlag = false; - return false; - } - - - if($("#editorParam_rceAppObj").val().length > 1300){ - alert("신청취지는 1300자 이하로 작성해 주세요"); - doubleSubmitFlag = false; - return false; - } - - if($("#editorParam_rceAppReason").val().length > 1300){ - alert("신청이유는 1300자 이하로 작성해 주세요"); - doubleSubmitFlag = false; - return false; - } - - if($("#editorParam_rceAppObj").val() == ""){ - alert("신청취지를 입력해 주세요"); - doubleSubmitFlag = false; - return false; - } - - if($("#editorParam_rceAppReason").val() == ""){ - alert("신청이유를 입력해 주세요"); - doubleSubmitFlag = false; - return false; - } - - //해외체크시 기타로 입력 start - // 신청인 - if($("#s_foreignCountry-1").is(":checked") == true){ - var f = document.applyForm; - f.addrZip_1.value="기타"; - f.addr1_1.value="기타"; - f.addr2_1.value="기타"; - f.roadAddr1_1.value="기타"; - f.roadAddr2_1.value="기타"; - } - - //대리인 - if($("#agent_foreignCountry-1").is(":checked") == true){ - var f = document.applyForm; - f.agentZip.value="기타"; - f.agentAddr1.value="기타"; - f.agentAddr2.value="기타"; - f.agentRoadAddr1.value="기타"; - f.agentRoadAddr2.value="기타"; - } - - //담당자 - if($("#rce_foreignCountry-1").is(":checked") == true){ - var f = document.applyForm; - f.rceZip.value="기타"; - f.rceAddr1.value="기타"; - f.rceAddr2.value="기타"; - f.rceRoadAddr1.value="기타"; - f.rceRoadAddr2.value="기타"; - } - - //피신청인 - var resListJuso = $(".resZip"); - for(var i = 0; i < resListJuso.length; i++){ - if($("#res_foreignCountry-"+(i+1)).is(":checked") == true){ - $("input:text[name=resZip_"+(i+1)+"]").val("기타"); - $("input:text[name=resAddr1_"+(i+1)+"]").val("기타"); - $("input:text[name=resAddr2_"+(i+1)+"]").val("기타"); - $("input:text[name=resRoadAddr1_"+(i+1)+"]").val("기타"); - $("input:text[name=resRoadAddr2_"+(i+1)+"]").val("기타"); - } - } - //해외체크시 기타로 입력 end - $("#requestCheck").val('1602000000'); - if('${rceptNo}' != ''){ - var frmAction = "/user/mediation/${siteIdx}/05/${siteMenuIdx}/update.do"; - $("#applyForm").attr("action", frmAction); - } - - var caseGubunVal = $("#caseGubun option:selected").val(); - if(caseGubunVal == "0201000000"){//공정거래 - $("#presidentAssign").val("1004000000"); - }else if(caseGubunVal == "0202000000"){//가맹사업거래 - $("#presidentAssign").val("1005000000"); - }else if(caseGubunVal == "0203000000"){//하도급거래 - if($("#consignmentGubun option:selected").val() == "5901000000" || - $("#consignmentGubun option:selected").val() == "5904000000"){//위탁유형 제조, 용역 - $("#presidentAssign").val("1007000000");//제조하도급 - }else{ - $("#presidentAssign").val("1006000000");//건설하도급 - } - }else if(caseGubunVal == "0204000000"){//대규모유통거래 - $("#presidentAssign").val("1030000000"); - }else if(caseGubunVal == "0205000000"){//약관거래 - $("#presidentAssign").val("1008000000"); - }else if(caseGubunVal == "0206000000"){//대리점거래 - $("#presidentAssign").val("1009000000"); - } - - $("#applyForm").submit(); - } - } - - function tempAppBtn(){ - - /* var sessionchk = false; - $.ajax({ - url: '/user/case/userCheck/setCheckCode/sessioncheck.do', - type: 'POST', - dataType: 'json', - data: '', - async: false, - success: function(r) { - if(!r.status){ - alert(r.message); - sessionchk = true; - } - } - }); - if(sessionchk){ - return false; - } */ - - if($("#rceTel").val().length > 15){ - alert("전화번호가 너무 깁니다."); - return false; - } - - if(!$("input[name=applyCheck]").is(":checked")){ - alert("신청 확인사항을 선택해 주세요"); - $("input[name=applyCheck]:eq(1)").focus(); - return false; - } - - if($("#editorParam_rceAppObj").val() == ""){ - alert("신청취지를 입력해 주세요"); - return false; - } - - if($("#editorParam_rceAppReason").val() == ""){ - alert("신청이유를 입력해 주세요"); - return false; - } - - if($("#editorParam_rceAppObj").val().length > 1300){ - alert("신청취지는 1300자 이하로 작성해 주세요"); - return false; - } - - if($("#editorParam_rceAppReason").val().length > 1300){ - alert("신청이유는 1300자 이하로 작성해 주세요"); - return false; - } - - //해외체크시 기타로 입력 start - // 신청인 - if($("#s_foreignCountry-1").is(":checked") == true){ - var f = document.applyForm; - f.addrZip_1.value="기타"; - f.addr1_1.value="기타"; - f.addr2_1.value="기타"; - f.roadAddr1_1.value="기타"; - f.roadAddr2_1.value="기타"; - } - - //대리인 - if($("#agent_foreignCountry-1").is(":checked") == true){ - var f = document.applyForm; - f.agentZip.value="기타"; - f.agentAddr1.value="기타"; - f.agentAddr2.value="기타"; - f.agentRoadAddr1.value="기타"; - f.agentRoadAddr2.value="기타"; - } - - //담당자 - if($("#rce_foreignCountry-1").is(":checked") == true){ - var f = document.applyForm; - f.rceZip.value="기타"; - f.rceAddr1.value="기타"; - f.rceAddr2.value="기타"; - f.rceRoadAddr1.value="기타"; - f.rceRoadAddr2.value="기타"; - } - - //피신청인 - var resListJuso = $(".resZip"); - for(var i = 0; i < resListJuso.length; i++){ - if($("#res_foreignCountry-"+(i+1)).is(":checked") == true){ - $("input:text[name=resZip_"+(i+1)+"]").val("기타"); - $("input:text[name=resAddr1_"+(i+1)+"]").val("기타"); - $("input:text[name=resAddr2_"+(i+1)+"]").val("기타"); - $("input:text[name=resRoadAddr1_"+(i+1)+"]").val("기타"); - $("input:text[name=resRoadAddr2_"+(i+1)+"]").val("기타"); - } - } - //해외체크시 기타로 입력 end - $("#requestCheck").val('1601000000'); - if('${rceptNo}' != ''){ - var frmAction = "/web/user/mediation/${siteIdx}/05/${siteMenuIdx}/update.do"; - $("#applyForm").attr("action", frmAction); - } - - $("#applyForm").submit(); - } - - function tempAppBtn_step(div){ - + //해외체크시 기타로 입력 start // 신청인 if($("#s_foreignCountry-1").is(":checked") == true){ @@ -1615,7 +1017,8 @@ //해외체크시 기타로 입력 end $("#requestCheck").val('1601000000'); - var frmAction = "/web/user/mediation/${siteIdx}/05/${siteMenuIdx}/writeAjax.do"; + /* var frmAction = "/web/user/mediation/${siteIdx}/05/${siteMenuIdx}/writeAjax.do" */; + var frmAction = "/web/user/mediation/${siteIdx}/05/${siteMenuIdx}/writeAjax04.do"; if(document.applyForm.rceptNo.value != ''){ var frmAction = "/web/user/mediation/${siteIdx}/05/${siteMenuIdx}/updateAjax.do"; // $("#applyForm").attr("action", frmAction); diff --git a/src/main/webapp/WEB-INF/jsp/_extra/web/user/mediation/mediationStep04_1.jsp b/src/main/webapp/WEB-INF/jsp/_extra/web/user/mediation/mediationStep04_1.jsp index c14e8c78..fa54c6a7 100644 --- a/src/main/webapp/WEB-INF/jsp/_extra/web/user/mediation/mediationStep04_1.jsp +++ b/src/main/webapp/WEB-INF/jsp/_extra/web/user/mediation/mediationStep04_1.jsp @@ -308,174 +308,6 @@ return retValue; } - function managerInsert(funcType){ - if(funcType == "same"){ - $("#rcePersonCharge").val($("#agentCeo").val()); - $("#rceTel").val($("#agentTel").val()); - $("#rcePh1").val($("#agentHp01").val()); - $("#rcePh2").val($("#agentHp02").val()); - $("#rcePh3").val($("#agentHp03").val()); - $("#rceEmail").val($("#agentEmail").val()); - $("#rceZip").val($("#agentZip").val()); - $("#rceAddr1").val($("#agentAddr1").val()); - $("#rceAddr2").val($("#agentAddr2").val()); - $("#rceRoadAddr1").val($("#agentRoadAddr1").val()); - $("#rceRoadAddr2").val($("#agentRoadAddr2").val()); - }else if(funcType == "nsame"){ - $("#rcePersonCharge").val(""); - $("#rceTel").val(""); - $("#rcePh1").val(""); - $("#rcePh2").val(""); - $("#rcePh3").val(""); - $("#rceEmail").val(""); - $("#rceZip").val(""); - $("#rceAddr1").val(""); - $("#rceAddr2").val(""); - $("#rceRoadAddr1").val(""); - $("#rceRoadAddr2").val(""); - } - } - - function insertA(funcType){ - if(funcType == 'in'){ - var childLength = $(".ACnt").size()+1; - $("#aCnt").val(childLength); - - var innerHtmlVal = ""; - - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - - $("#insertA").prepend(innerHtmlVal); - subCntrSttGubunCombo1(childLength); - }else{ - var childLength = $(".ACnt").size(); - if(childLength > 1){ - $(".Adel_"+childLength).remove(); - $("#aCnt").val(Number($("#aCnt").val()) - 1); - - if($("#subCntrSeqNoA_"+childLength).val() != "" && $("#subCntrSeqNoA_"+childLength).val() != undefined){ - $("#existASubCntrData").val(Number($("#existASubCntrData").val()) - 1); - - var subCntrSeqArr = ""; - if($("#subCntrDelSeq").val() != ""){ - subCntrSeqArr = $("#subCntrDelSeq").val() + "," + $("#subCntrSeqNoA_"+childLength).val(); - }else{ - subCntrSeqArr = $("#subCntrSeqNoA_"+childLength).val(); - } - - $("#subCntrDelSeq").val(subCntrSeqArr); - - } - } - } - } - - function insertR(funcType){ - if(funcType == 'in'){ - var childLength = $(".RCnt").size()+1; - $("#rCnt").val(childLength); - - var innerHtmlVal = ""; - - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - innerHtmlVal += ''; - - $("#insertR").prepend(innerHtmlVal); - subCntrSttGubunCombo2(childLength); - }else{ - var childLength = $(".RCnt").size(); - if(childLength > 1){ - $(".Rdel_"+childLength).remove(); - $("#rCnt").val(Number($("#rCnt").val()) - 1); - - if($("#subCntrSeqNoR_"+childLength).val() != "" && $("#subCntrSeqNoR_"+childLength).val() != undefined){ - $("#existBSubCntrData").val(Number($("#existBSubCntrData").val()) - 1); - - var subCntrSeqArr = ""; - if($("#subCntrDelSeq").val() != ""){ - subCntrSeqArr = $("#subCntrDelSeq").val() + "," + $("#subCntrSeqNoR_"+childLength).val(); - }else{ - subCntrSeqArr = $("#subCntrSeqNoR_"+childLength).val(); - } - - $("#subCntrDelSeq").val(subCntrSeqArr); - } - } - } - } - - //조정유형 function caseGubunCombo(){ @@ -869,555 +701,81 @@ return false; } } - - function applyBtn(){ - if(doubleSubmitFlag){ - alert("분쟁조정 신청 중입니다."); - return false; - } else { - // 세션 체크 후 인증팝업 호출 - var sessionchk = false; - $.ajax({ - url: '/user/case/userCheck/setCheckCode/sessioncheck.do', - type: 'POST', - dataType: 'json', - data: '', - async: false, - success: function(r) { - if(!r.status){ - alert(r.message); - sessionchk = true; - var url = "/user/case/userCheck/mediation/auth.do" - window.open( url, "pop", "width=570, height=602, status=no,toolbar=no,scrollbars=no"); - } - } - }); - if(sessionchk){ - return false; - } - - doubleSubmitFlag = true; - - if($("#rceTel").val().length > 15){ - alert("전화번호가 너무 깁니다."); - doubleSubmitFlag = false; - return false; - } - - if($("#rceOfcps").val().length > 10){ - alert("부서/직위는 10자를 넘을 수 없습니다"); - doubleSubmitFlag = false; - return false; - } - - /*신청인 유효성 */ - if($("#caseGubun").val() == ""){ - alert("조정유형을 선택해 주세요"); - doubleSubmitFlag = false; - return false; - } - - if($("#caseReason1").val() == ""){ - alert("신청사유를 선택해 주세요"); - doubleSubmitFlag = false; - return false; - } - - if($("#caseGubun option:selected").val() == '0203000000' && $("#consignmentGubun option:selected").val() == ""){ - alert("하도급 위탁유형을 선택해 주세요"); - doubleSubmitFlag = false; - return false; - } - - var appList = $(".applcntCompany"); - for(var i = 0; i < appList.length; i++){ - if(appList[i].value == ""){ - alert((i+1) + ". 신청인 상호를 입력해 주세요"); - doubleSubmitFlag = false; - appList[i].focus(); - return false; - } - } - - appList = $(".companyCeo"); - for(var i = 0; i < appList.length; i++){ - if(appList[i].value == ""){ - alert((i+1) + ". 신청인 대표자를 입력해 주세요"); - doubleSubmitFlag = false; - appList[i].focus(); - return false; - } - } - - appList = $(".companyGubun"); - for(var i = 0; i < appList.length; i++){ - if(appList[i].value == ""){ - alert((i+1) + ". 신청인 개입/법인을 선택해 주세요"); - doubleSubmitFlag = false; - appList[i].focus(); - return false; - } - } - - appList = $(".addrZip"); - for(var i = 0; i < appList.length; i++){ - if(appList[i].value == "" && $("#s_foreignCountry-"+(i+1)).is(":checked") == false){ - alert((i+1) + ". 신청인 주소를 검색해 주세요"); - doubleSubmitFlag = false; - appList[i].focus(); - return false; - } - } - - appList = $(".tel2"); - for(var i = 0; i < appList.length; i++){ - if(appList[i].value == ""){ - alert((i+1) + ". 신청인 대표 전화번호를 입력해 주세요"); - doubleSubmitFlag = false; - appList[i].focus(); - return false; - } - } - - appList = $(".email1"); - for(var i = 0; i < appList.length; i++){ - if(appList[i].value == ""){ - alert((i+1) + ". 신청인 이메일을 입력해 주세요"); - doubleSubmitFlag = false; - appList[i].focus(); - return false; - } - } - - appList = $(".email2"); - for(var i = 0; i < appList.length; i++){ - if(appList[i].value == ""){ - alert((i+1) + ". 신청인 이메일을 입력해 주세요"); - doubleSubmitFlag = false; - appList[i].focus(); - return false; - } - } - - appList = $(".tel3"); - for(var i = 0; i < appList.length; i++){ - if(appList[i].value == ""){ - alert((i+1) + ". 신청인 대표 전화번호를 입력해 주세요"); - doubleSubmitFlag = false; - appList[i].focus(); - return false; - } - } - - appList = $(".bizrNo"); - for(var i = 0; i < appList.length; i++){ - if(appList[i].value == ""){ - alert((i+1) + ". 신청인 사업자등록번호를 입력해 주세요"); - doubleSubmitFlag = false; - appList[i].focus(); - return false; - } - } - - /*신청인 유효성 END*/ - - /*피신청인 유효성 검사*/ - var resList = $(".resCompany"); - for(var i = 0; i < resList.length; i++){ - if(resList[i].value == ""){ - alert((i+1) + ". 피신청인 상호를 입력해 주세요"); - doubleSubmitFlag = false; - resList[i].focus(); - return false; - } - } - - resList = $(".resCeo"); - for(var i = 0; i < resList.length; i++){ - if(resList[i].value == ""){ - alert((i+1) + ". 피신청인 대표자를 입력해 주세요"); - doubleSubmitFlag = false; - resList[i].focus(); - return false; - } - } - - resList = $(".resGunbun"); - for(var i = 0; i < resList.length; i++){ - if(resList[i].value == ""){ - alert((i+1) + ". 피신청인 개인/법인을 선택해 주세요"); - doubleSubmitFlag = false; - resList[i].focus(); - return false; - } - } - - resList = $(".resZip"); - for(var i = 0; i < resList.length; i++){ - if(resList[i].value == "" && $("#res_foreignCountry-"+(i+1)).is(":checked") == false){ - alert((i+1) + ". 피신청인 주소를 검색해 주세요"); - doubleSubmitFlag = false; - resList[i].focus(); - return false; - } - } - - resList = $(".resTel2"); - for(var i = 0; i < resList.length; i++){ - if(resList[i].value == ""){ - alert((i+1) + ". 피신청인 대표 전화번호를 입력해 주세요"); - doubleSubmitFlag = false; - resList[i].focus(); - return false; - } - } - - resList = $(".resTel3"); - for(var i = 0; i < resList.length; i++){ - if(resList[i].value == ""){ - alert((i+1) + ". 피신청인 대표 전화번호를 입력해 주세요"); - doubleSubmitFlag = false; - resList[i].focus(); - return false; - } - } - - resList = $(".resBizrNo"); - for(var i = 0; i < resList.length; i++){ - if(resList[i].value == ""){ - alert((i+1) + ". 피신청인 사업자등록번호를 입력해 주세요"); - doubleSubmitFlag = false; - resList[i].focus(); - return false; - } - } - /*피신청인 유효성 검사 END*/ - - /*담당자 유효성 검사*/ - if($("#rceEmail").val() == ""){ - alert("담당자 이메일을 입력 해 주세요"); - doubleSubmitFlag = false; - $("#rceEmail").focus(); - return false; - } - /*담당자 유효성 검사 END*/ - if(!$("input[name=applyCheck]").is(":checked")){ - alert("신청 확인사항을 선택해 주세요"); - doubleSubmitFlag = false; - $("input[name=applyCheck]:eq(1)").focus(); - return false; - } - /*기타확인사항 유효성 검사*/ - if(!$("input:radio[name=rceLawCheck]").is(":checked")){ - alert("소송 진행 여부를 선택해 주세요"); - doubleSubmitFlag = false; - $("input:radio[name=rceLawCheck]").focus(); - return false; - }else{ - if($("input:radio[name=rceLawCheck]:checked").val() == "Y"){ - if($("#rceLawNot").val() == ""){ - alert("법원명을 입력해 주세요"); - doubleSubmitFlag = false; - $("#rceLawNot").focus(); - return false; - } - if($("#rceLawCaseNum").val() == ""){ - alert("사건번호를 입력해 주세요"); - doubleSubmitFlag = false; - $("#rceLawCaseNum").focus(); - return false; - } - if(!$("input:radio[name=rceLawCheckSame]").is(":checked")){ - alert("소송 내용이 조정신청 내용과 동일한지를 선택해 주세요"); - doubleSubmitFlag = false; - $("input:radio[name=rceLawCheckSame]").focus(); - return false; - } - } - } - - if(!$("input:radio[name=rceConferenceResult]").is(":checked")){ - alert("타 협의회 조정 여부를 선택해 주세요"); - doubleSubmitFlag = false; - $("input:radio[name=rceConferenceResult]").focus(); - return false; - }else{ - if($("input:radio[name=rceConferenceResult]:checked").val() == "Y"){ - if($("#rceConferenceResultNot").val() == ""){ - alert("협의회명을 입력 해 주세요"); - doubleSubmitFlag = false; - } - } - } - - if(!$("input:radio[name=rceArbCheck]").is(":checked")){ - alert("중재 여부를 선택해 주세요"); - doubleSubmitFlag = false; - $("input:radio[name=rceArbCheck]").focus(); - return false; - }else{ - if($("input:radio[name=rceArbCheck]:checked").val() == "Y"){ - if($("#rceArbNote").val() == ""){ - alert("중재기관명을 입력 해 주세요"); - doubleSubmitFlag = false; - } - } - } - - if(!$("input:radio[name=rceRegulatingOrgan]").is(":checked")){ - alert("타 조정기구 조정 여부를 선택해 주세요"); - doubleSubmitFlag = false; - $("input:radio[name=rceRegulatingOrgan]").focus(); - return false; - }else{ - if($("input:radio[name=rceRegulatingOrgan]:checked").val() == "Y"){ - if($("#rceRegulatingOrganNote").val() == ""){ - alert("조정기구명을 입력 해 주세요"); - doubleSubmitFlag = false; - } - } - } - - if(!$("input:radio[name=rceFtcInvestigation]").is(":checked")){ - alert("공정거래위원회 조사 여부를 선택해 주세요"); - doubleSubmitFlag = false; - $("input:radio[name=rceFtcInvestigation]").focus(); - return false; - }else{ - if($("input:radio[name=rceFtcInvestigation]:checked").val() == "Y"){ - if($("#rceFtcInvestigationNote").val() == ""){ - alert("담당부서명을 입력 해 주세요"); - doubleSubmitFlag = false; - } - } - } - - - if(!$("input:radio[name=rceFtcCorrect]").is(":checked")){ - alert("동일사안 공정거래위원회 시정조치 여부를 선택해 주세요"); - doubleSubmitFlag = false; - $("input:radio[name=rceFtcCorrect]").focus(); - return false; - }else{ - if($("input:radio[name=rceFtcCorrect]:checked").val() == "Y"){ - if($("#rceFtcCorrectNote").val() == ""){ - alert("의결번호를 입력 해 주세요"); - doubleSubmitFlag = false; - } - } - } - - - - if(!$("input:radio[name=rceParAgreement]").is(":checked")){ - alert("당사자간 합의가 완료되어 조정조서 작성을 요청하는 사안인지 여부"); - doubleSubmitFlag = false; - return false; - } - - - if($("#editorParam_rceAppObj").val().length > 1300){ - alert("신청취지는 1300자 이하로 작성해 주세요"); - doubleSubmitFlag = false; - return false; - } - - if($("#editorParam_rceAppReason").val().length > 1300){ - alert("신청이유는 1300자 이하로 작성해 주세요"); - doubleSubmitFlag = false; - return false; - } - - if($("#editorParam_rceAppObj").val() == ""){ - alert("신청취지를 입력해 주세요"); - doubleSubmitFlag = false; - return false; - } - - if($("#editorParam_rceAppReason").val() == ""){ - alert("신청이유를 입력해 주세요"); - doubleSubmitFlag = false; - return false; - } - - //해외체크시 기타로 입력 start - // 신청인 - if($("#s_foreignCountry-1").is(":checked") == true){ - var f = document.applyForm; - f.addrZip_1.value="기타"; - f.addr1_1.value="기타"; - f.addr2_1.value="기타"; - f.roadAddr1_1.value="기타"; - f.roadAddr2_1.value="기타"; - } - - //대리인 - if($("#agent_foreignCountry-1").is(":checked") == true){ - var f = document.applyForm; - f.agentZip.value="기타"; - f.agentAddr1.value="기타"; - f.agentAddr2.value="기타"; - f.agentRoadAddr1.value="기타"; - f.agentRoadAddr2.value="기타"; - } - - //담당자 - if($("#rce_foreignCountry-1").is(":checked") == true){ - var f = document.applyForm; - f.rceZip.value="기타"; - f.rceAddr1.value="기타"; - f.rceAddr2.value="기타"; - f.rceRoadAddr1.value="기타"; - f.rceRoadAddr2.value="기타"; - } - - //피신청인 - var resListJuso = $(".resZip"); - for(var i = 0; i < resListJuso.length; i++){ - if($("#res_foreignCountry-"+(i+1)).is(":checked") == true){ - $("input:text[name=resZip_"+(i+1)+"]").val("기타"); - $("input:text[name=resAddr1_"+(i+1)+"]").val("기타"); - $("input:text[name=resAddr2_"+(i+1)+"]").val("기타"); - $("input:text[name=resRoadAddr1_"+(i+1)+"]").val("기타"); - $("input:text[name=resRoadAddr2_"+(i+1)+"]").val("기타"); - } - } - //해외체크시 기타로 입력 end - $("#requestCheck").val('1602000000'); - if('${rceptNo}' != ''){ - var frmAction = "/user/mediation/${siteIdx}/05/${siteMenuIdx}/update.do"; - $("#applyForm").attr("action", frmAction); - } - - var caseGubunVal = $("#caseGubun option:selected").val(); - if(caseGubunVal == "0201000000"){//공정거래 - $("#presidentAssign").val("1004000000"); - }else if(caseGubunVal == "0202000000"){//가맹사업거래 - $("#presidentAssign").val("1005000000"); - }else if(caseGubunVal == "0203000000"){//하도급거래 - if($("#consignmentGubun option:selected").val() == "5901000000" || - $("#consignmentGubun option:selected").val() == "5904000000"){//위탁유형 제조, 용역 - $("#presidentAssign").val("1007000000");//제조하도급 - }else{ - $("#presidentAssign").val("1006000000");//건설하도급 - } - }else if(caseGubunVal == "0204000000"){//대규모유통거래 - $("#presidentAssign").val("1030000000"); - }else if(caseGubunVal == "0205000000"){//약관거래 - $("#presidentAssign").val("1008000000"); - }else if(caseGubunVal == "0206000000"){//대리점거래 - $("#presidentAssign").val("1009000000"); - } - - $("#applyForm").submit(); - } - } - - function tempAppBtn(){ - - /* var sessionchk = false; - $.ajax({ - url: '/user/case/userCheck/setCheckCode/sessioncheck.do', - type: 'POST', - dataType: 'json', - data: '', - async: false, - success: function(r) { - if(!r.status){ - alert(r.message); - sessionchk = true; - } - } - }); - if(sessionchk){ - return false; - } */ - - if($("#rceTel").val().length > 15){ - alert("전화번호가 너무 깁니다."); - return false; - } - - if(!$("input[name=applyCheck]").is(":checked")){ - alert("신청 확인사항을 선택해 주세요"); - $("input[name=applyCheck]:eq(1)").focus(); - return false; - } - - if($("#editorParam_rceAppObj").val() == ""){ - alert("신청취지를 입력해 주세요"); - return false; - } - - if($("#editorParam_rceAppReason").val() == ""){ - alert("신청이유를 입력해 주세요"); - return false; - } - - if($("#editorParam_rceAppObj").val().length > 1300){ - alert("신청취지는 1300자 이하로 작성해 주세요"); - return false; - } - - if($("#editorParam_rceAppReason").val().length > 1300){ - alert("신청이유는 1300자 이하로 작성해 주세요"); - return false; - } - - //해외체크시 기타로 입력 start - // 신청인 - if($("#s_foreignCountry-1").is(":checked") == true){ - var f = document.applyForm; - f.addrZip_1.value="기타"; - f.addr1_1.value="기타"; - f.addr2_1.value="기타"; - f.roadAddr1_1.value="기타"; - f.roadAddr2_1.value="기타"; - } - - //대리인 - if($("#agent_foreignCountry-1").is(":checked") == true){ - var f = document.applyForm; - f.agentZip.value="기타"; - f.agentAddr1.value="기타"; - f.agentAddr2.value="기타"; - f.agentRoadAddr1.value="기타"; - f.agentRoadAddr2.value="기타"; - } - - //담당자 - if($("#rce_foreignCountry-1").is(":checked") == true){ - var f = document.applyForm; - f.rceZip.value="기타"; - f.rceAddr1.value="기타"; - f.rceAddr2.value="기타"; - f.rceRoadAddr1.value="기타"; - f.rceRoadAddr2.value="기타"; - } - - //피신청인 - var resListJuso = $(".resZip"); - for(var i = 0; i < resListJuso.length; i++){ - if($("#res_foreignCountry-"+(i+1)).is(":checked") == true){ - $("input:text[name=resZip_"+(i+1)+"]").val("기타"); - $("input:text[name=resAddr1_"+(i+1)+"]").val("기타"); - $("input:text[name=resAddr2_"+(i+1)+"]").val("기타"); - $("input:text[name=resRoadAddr1_"+(i+1)+"]").val("기타"); - $("input:text[name=resRoadAddr2_"+(i+1)+"]").val("기타"); - } - } - //해외체크시 기타로 입력 end - $("#requestCheck").val('1601000000'); - if('${rceptNo}' != ''){ - var frmAction = "/web/user/mediation/${siteIdx}/05/${siteMenuIdx}/update.do"; - $("#applyForm").attr("action", frmAction); - } - - $("#applyForm").submit(); - } function tempAppBtn_step(div){ + /*피신청인 유효성 검사*/ + var resList = $(".resCompany"); + for(var i = 0; i < resList.length; i++){ + if(resList[i].value == ""){ + alert((i+1) + ". 피신청인 상호를 입력해 주세요"); + doubleSubmitFlag = false; + resList[i].focus(); + return false; + } + } + + resList = $(".resCeo"); + for(var i = 0; i < resList.length; i++){ + if(resList[i].value == ""){ + alert((i+1) + ". 피신청인 대표자를 입력해 주세요"); + doubleSubmitFlag = false; + resList[i].focus(); + return false; + } + } + + resList = $(".resGunbun"); + for(var i = 0; i < resList.length; i++){ + if(resList[i].value == ""){ + alert((i+1) + ". 피신청인 개인/법인을 선택해 주세요"); + doubleSubmitFlag = false; + resList[i].focus(); + return false; + } + } + + resList = $(".resZip"); + for(var i = 0; i < resList.length; i++){ + if(resList[i].value == "" && $("#res_foreignCountry-"+(i+1)).is(":checked") == false){ + alert((i+1) + ". 피신청인 주소를 검색해 주세요"); + doubleSubmitFlag = false; + resList[i].focus(); + return false; + } + } + + resList = $(".resTel2"); + for(var i = 0; i < resList.length; i++){ + if(resList[i].value == ""){ + alert((i+1) + ". 피신청인 대표 전화번호를 입력해 주세요"); + doubleSubmitFlag = false; + resList[i].focus(); + return false; + } + } + + resList = $(".resTel3"); + for(var i = 0; i < resList.length; i++){ + if(resList[i].value == ""){ + alert((i+1) + ". 피신청인 대표 전화번호를 입력해 주세요"); + doubleSubmitFlag = false; + resList[i].focus(); + return false; + } + } + + resList = $(".resBizrNo"); + for(var i = 0; i < resList.length; i++){ + if(resList[i].value == ""){ + alert((i+1) + ". 피신청인 사업자등록번호를 입력해 주세요"); + doubleSubmitFlag = false; + resList[i].focus(); + return false; + } + } + /*피신청인 유효성 검사 END*/ + //해외체크시 기타로 입력 start //피신청인 var resListJuso = $(".resZip"); @@ -1432,7 +790,8 @@ } //해외체크시 기타로 입력 end $("#requestCheck").val('1601000000'); - var frmAction = "/web/user/mediation/${siteIdx}/05/${siteMenuIdx}/updateAjax.do"; + /* var frmAction = "/web/user/mediation/${siteIdx}/05/${siteMenuIdx}/updateAjax.do"; */ + var frmAction = "/web/user/mediation/${siteIdx}/05/${siteMenuIdx}/updateAjax04_1.do"; $.ajax({ url: frmAction, @@ -1907,7 +1266,6 @@
  • -
  • @@ -2060,13 +1418,13 @@

    *필수입력

    상호 - +

    *필수입력

    대표자 - + @@ -2074,7 +1432,7 @@

    *필수입력

    개인/법인 - @@ -2147,9 +1505,9 @@ - - + - - + FAX @@ -2166,7 +1524,7 @@

    *필수입력

    사업자등록번호
    ('-'제외) - + 법인등록번호
    ('-'제외) diff --git a/src/main/webapp/WEB-INF/jsp/_extra/web/user/mediation/mediationStep04_2.jsp b/src/main/webapp/WEB-INF/jsp/_extra/web/user/mediation/mediationStep04_2.jsp index 0cfbc4b4..1bd3cf55 100644 --- a/src/main/webapp/WEB-INF/jsp/_extra/web/user/mediation/mediationStep04_2.jsp +++ b/src/main/webapp/WEB-INF/jsp/_extra/web/user/mediation/mediationStep04_2.jsp @@ -13,6 +13,11 @@
    @@ -50,13 +58,13 @@
  • -
  • - diff --git a/src/main/webapp/WEB-INF/jsp/layout/popupLayout.jsp b/src/main/webapp/WEB-INF/jsp/layout/popupLayout.jsp new file mode 100644 index 00000000..c5733efd --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/layout/popupLayout.jsp @@ -0,0 +1,33 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator"%> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> + + + + + + + 한국공정거래조정원 온라인분쟁조정시스템 > 마이페이지 > 본인인증 > 간편인증 + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/uat/uia/KCert.jsp b/src/main/webapp/WEB-INF/jsp/uat/uia/KCert.jsp deleted file mode 100644 index 04a2f03a..00000000 --- a/src/main/webapp/WEB-INF/jsp/uat/uia/KCert.jsp +++ /dev/null @@ -1,9 +0,0 @@ -<%@ 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="kc" uri="/WEB-INF/tlds/kcc_tld.tld"%> - -kakaoCert \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/uat/uia/KCertStep1.jsp b/src/main/webapp/WEB-INF/jsp/uat/uia/KCertStep1.jsp new file mode 100644 index 00000000..af3a40b0 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/uat/uia/KCertStep1.jsp @@ -0,0 +1,98 @@ +<%@ 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="form" uri="http://www.springframework.org/tags/form"%> + + + + + +
    +
    +
    +

    카카오 간편인증

    +
    +
    +
    + + + + + + + + + + + + + + + + + + + +
    이름
    휴대전화
    생년월일
    +
    + +
      +
    • +
      + +
      + +
    • +
    • +
      + +
      + +
    • +
    +
    + + +
    +
    +
    +
    \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/uat/uia/KCertStep2.jsp b/src/main/webapp/WEB-INF/jsp/uat/uia/KCertStep2.jsp new file mode 100644 index 00000000..39ad48f8 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/uat/uia/KCertStep2.jsp @@ -0,0 +1,57 @@ +<%@ 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="kc" uri="/WEB-INF/tlds/kcc_tld.tld"%> + + + +
    + + +
    +
    +

    카카오 간편인증

    +
    +
    + +

    인증을 진행해주세요.

    + +
    + 입력하신 휴대폰으로 인증 요청 메시지를 보냈습니다.
    + 앱에서 인증을 진행해 주세요. +
    + +
    + + +
    +
    +
    +
    \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/uat/uia/NCert.jsp b/src/main/webapp/WEB-INF/jsp/uat/uia/NCert.jsp deleted file mode 100644 index cc7be38f..00000000 --- a/src/main/webapp/WEB-INF/jsp/uat/uia/NCert.jsp +++ /dev/null @@ -1,20 +0,0 @@ -<%@ 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="kc" uri="/WEB-INF/tlds/kcc_tld.tld"%> - -
    -

    Response

    -
    -
    - ${requestScope['javax.servlet.forward.request_uri']} -
      -
    • 접수아이디 (ReceiptID) : ${result.receiptID}
    • -
    • 앱스킴 (Scheme) : ${result.scheme}
    • -
    • 앱다운로드URL (MarketURL) : ${result.marketUrl}
    • -
    -
    -
    \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/uat/uia/NCertStep1.jsp b/src/main/webapp/WEB-INF/jsp/uat/uia/NCertStep1.jsp new file mode 100644 index 00000000..eba66309 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/uat/uia/NCertStep1.jsp @@ -0,0 +1,98 @@ +<%@ 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="form" uri="http://www.springframework.org/tags/form"%> + + + + + +
    +
    +
    +

    네이버 간편인증

    +
    +
    +
    + + + + + + + + + + + + + + + + + + + +
    이름
    휴대전화
    생년월일
    +
    + +
      +
    • +
      + +
      + +
    • +
    • +
      + +
      + +
    • +
    +
    + + +
    +
    +
    +
    \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/uat/uia/NCertStep2.jsp b/src/main/webapp/WEB-INF/jsp/uat/uia/NCertStep2.jsp new file mode 100644 index 00000000..7f189786 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/uat/uia/NCertStep2.jsp @@ -0,0 +1,57 @@ +<%@ 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="kc" uri="/WEB-INF/tlds/kcc_tld.tld"%> + + + +
    + + +
    +
    +

    네이버 간편인증

    +
    +
    + +

    인증을 진행해주세요.

    + +
    + 입력하신 휴대폰으로 인증 요청 메시지를 보냈습니다.
    + 앱에서 인증을 진행해 주세요. +
    + +
    + + +
    +
    +
    +
    \ No newline at end of file diff --git a/src/main/webapp/kofair_case_seed/usr/scripts/common.js b/src/main/webapp/kofair_case_seed/usr/scripts/common.js index 23baaae7..473c5b38 100644 --- a/src/main/webapp/kofair_case_seed/usr/scripts/common.js +++ b/src/main/webapp/kofair_case_seed/usr/scripts/common.js @@ -1,578 +1,578 @@ -$(function () { - if ($(".input_calendar").length > 0) { - setTimeout(function () { - calendar(); - }, 100) - - } - - -}) - -// header, footer 공통 영역 불러오기 -window.addEventListener('load', function () { - var allElements = document.getElementsByTagName('*'); - Array.prototype.forEach.call(allElements, function (el) { - var includePath = el.dataset.includePath; - if (includePath) { - var xhttp = new XMLHttpRequest(); - xhttp.onreadystatechange = function () { - if (this.readyState == 4 && this.status == 200) { - header(); - el.outerHTML = this.responseText; - - } - }; - xhttp.open('GET', includePath, true); - xhttp.send(); - } - }); -}); +$(function () { + if ($(".input_calendar").length > 0) { + setTimeout(function () { + calendar(); + }, 100) -document.addEventListener('DOMContentLoaded', function () { - var calendarEl = document.getElementById('calendar'); - - if ($(".wrap").find("#calendar").length > 0) { - var calendar = new FullCalendar.Calendar(calendarEl, { - initialView: 'dayGridMonth', - titleFormat: function (date) { - year = date.date.year; - month = date.date.month + 1; - - return year + "년 " + month + "월"; - }, - locale: "ko", - buttonText: { - today: "오늘" - }, - height: "auto", - dayCellContent: function (info) { - var number = document.createElement('a'); - number.classList.add('fc-daygrid-day-number'); - number.innerHTML = info.dayNumberText.replace("일", ""); - if (info.view.type === 'dayGridMonth') { - return { - html: number.outerHTML - }; - } - return { - domNodes: [] - } - }, - events: [{ - title: '조정절차 관련 일정', - start: '2024-10-15', - }] - }); - calendar.render(); - } - -}); - -// 달력팝업 -function calendar() { - - // 캘린더 고유 클래스 추가 - $(".input_calendar").not(".start_date,.end_date").each(function (idx, itm) { - idx += 1; - $(itm).addClass("input_calendar" + idx); - }); - - $(".start_date").each(function (idx, itm) { - idx += 1; - $(itm).addClass("start_date" + idx); - $(itm).attr("id", "start_date" + idx); - }); - - $(".end_date").each(function (idx, itm) { - idx += 1; - $(itm).addClass("end_date" + idx); - $(itm).attr("id", "end_date" + idx); - $(itm).find(".duet-date__input").attr("id", "end_date" + idx); - }); - - setTimeout(function () { - - calendarTitle(); // 달력 타이틀 - calednarCaption(); // 달력 caption - }, 100) - - - - // input value 값 추가, 검색 시 input value 값 안없어지게. - var start_duetValue = $("duet-date-picker.start_date").val(); - var end_duetValue = $("duet-date-picker.end_date").val(); - var startcalendar_name = $(".start_date").attr("name"); - var endcalendar_name = $(".end_date").attr("name"); - - //달력 입력창 최대 입력 수 10자 제한('.' 포함) - $("input.duet-date__input").attr("maxlength", "10"); - - var DATE_FORMAT = /^(\d{1,2})\.(\d{1,2})\.(\d{4})$/ - var duetdateleng = $("duet-date-picker").length + 1; - - var calendarNum = []; - var startDateNum = []; - var endDateNum = []; - setTimeout(function () { - for (var i = 1; i < duetdateleng; i++) { - calendarNum[i] = document.querySelector(".input_calendar" + i); - if (calendarNum[i] !== null) { - calendarNum[i].dateAdapter = { - parse: function parse() { - var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "" - var createDate = arguments.length > 1 ? arguments[1] : undefined - var matches = value.match(DATE_FORMAT) - - if (matches) { - return createDate(matches[3], matches[2], matches[1]) - } - }, - format: function format(date) { - if (date.getMonth() < 9) { - if (date.getDate() < 10) { - return "" - .concat(date.getFullYear(), ".") - .concat('0', date.getMonth() + 1, ".") - .concat('0', date.getDate()) - } else { - return "" - .concat(date.getFullYear(), ".") - .concat('0', date.getMonth() + 1, ".") - .concat(date.getDate()) - } - } else { - if (date.getDate() < 10) { - return "" - .concat(date.getFullYear(), ".") - .concat(date.getMonth() + 1, ".") - .concat('0', date.getDate()) - } else { - return "" - .concat(date.getFullYear(), ".") - .concat(date.getMonth() + 1, ".") - .concat(date.getDate()) - } - } - }, - } - - // 달력 플러그인 실행 - calendarNum[i].localization = { - placeholder: '날짜 입력', - selectedDateMessage: 'Selected date is', - prevMonthLabel: '이전 달 보기', - nextMonthLabel: '다음 달 보기', - monthSelectLabel: '달 선택', - yearSelectLabel: '년도 선택', - closeLabel: '달력 닫기', - dayNames: ['일', '월', '화', '수', '목', '금', '토'], - monthNames: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], - monthNamesShort: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], - identifier: "input_date", - name: "input_date" - } - - // 달력 닫았을 때 input, input[type=hidden]에 value 값 넣어주기 - calendarNum[i].addEventListener("duetClose", function (e) { - startDt = e.target; - startDtVal = e.target.value; - startSub = startDtVal.replace(/\-/g, ''); - var inputName = $(this).attr("name"); - }); - - setTimeout(function () { - $("duet-date-picker").not(".start_date,.end_date").find(".duet-date__input").each(function (idx, itm) { - idx += 1; - $(itm).attr("name", "input_date" + idx); - $(itm).attr("id", "input_date" + idx); - }); - $("duet-date-picker .duet-date__input").attr('onkeydown', 'this.value=dateSetting(this.value);'); - }, 100) - } - - - - } - - // 시작날짜 - - for (var i = 1; i < duetdateleng; i++) { - startDateNum[i] = document.querySelector(".start_date" + i); - if (startDateNum[i] !== null) { - startDateNum[i].dateAdapter = { - parse: function parse() { - var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "" - var createDate = arguments.length > 1 ? arguments[1] : undefined - var matches = value.match(DATE_FORMAT) - - if (matches) { - return createDate(matches[3], matches[2], matches[1]) - } - }, - format: function format(date) { - if (date.getMonth() < 9) { - if (date.getDate() < 10) { - return "" - .concat(date.getFullYear(), ".") - .concat('0', date.getMonth() + 1, ".") - .concat('0', date.getDate()) - } else { - return "" - .concat(date.getFullYear(), ".") - .concat('0', date.getMonth() + 1, ".") - .concat(date.getDate()) - } - } else { - if (date.getDate() < 10) { - return "" - .concat(date.getFullYear(), ".") - .concat(date.getMonth() + 1, ".") - .concat('0', date.getDate()) - } else { - return "" - .concat(date.getFullYear(), ".") - .concat(date.getMonth() + 1, ".") - .concat(date.getDate()) - } - } - }, - } - - // 달력 플러그인 실행 - startDateNum[i].localization = { - placeholder: '날짜 입력', - selectedDateMessage: 'Selected date is', - prevMonthLabel: '이전 달 보기', - nextMonthLabel: '다음 달 보기', - monthSelectLabel: '달 선택', - yearSelectLabel: '년도 선택', - closeLabel: '달력 닫기', - dayNames: ['일', '월', '화', '수', '목', '금', '토'], - monthNames: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], - monthNamesShort: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], - identifier: "start_date", - name: "start_date" - } - - - // 달력 닫았을 때 input, input[type=hidden]에 value 값 넣어주기 - startDateNum[i].addEventListener("duetClose", function (e) { - startDt = e.target; - startDtVal = e.target.value; - startSub = startDtVal.replace(/\-/g, ''); - var inputName = $(startDt).attr("id"); - $(".start_date").each(function (idx, itm) { - $(this).find(".duet-date__input").attr("id", inputName); - $(this).find(".duet-date__input").attr("name", inputName); - $(this).find(".duet-date__input").attr("value", startDtVal); - $(this).find(".duet-date__input").next().attr("name", inputName + "_submit"); - $(this).find(".duet-date__input").next().attr("value", startSub); - }); - }); - - //날짜 값 바꼈을 때 시작일, 종료일 찾아 alert 띄우기 - startDateNum[i].addEventListener("duetChange", function (e) { - startDt = e.target; - var startDateNum = startDt.id; - startDateNum = startDateNum.replace("start_date", ""); - startDtVal = e.target.value; - // var n = i - 1; - var endDtVal = $(".end_date" + startDateNum).find(".duet-date__input").val(); - endDtVal = endDtVal.replace(/[.]/gi, ''); - startDtVal = startDtVal.replace(/[.]/gi, ''); - if (startDtVal > endDtVal && endDtVal != "") { - e.target.value = ""; - alert("시작일이 종료일보다 클 수 없습니다."); - } else {} - }); - - setTimeout(function () { - $("duet-date-picker.start_date .duet-date__input").each(function (idx, itm) { - idx += 1; - $(itm).attr("name", "start_date" + idx); - $(itm).attr("id", "start_date" + idx); - }); - $("duet-date-picker .duet-date__input").attr('onkeydown', 'this.value=dateSetting(this.value);'); - }, 100) - - startDateNum[i].addEventListener("duetFocus", function (e) { - calendarSetting(); - }); - } - - } - - // 종료날짜 - - for (var i = 1; i < duetdateleng; i++) { - endDateNum[i] = document.querySelector(".end_date" + i); - if (endDateNum[i] !== null) { - endDateNum[i].dateAdapter = { - parse: function parse() { - var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "" - var createDate = arguments.length > 1 ? arguments[1] : undefined - var matches = value.match(DATE_FORMAT) - - if (matches) { - return createDate(matches[3], matches[2], matches[1]) - } - }, - format: function format(date) { - if (date.getMonth() < 9) { - if (date.getDate() < 10) { - return "" - .concat(date.getFullYear(), ".") - .concat('0', date.getMonth() + 1, ".") - .concat('0', date.getDate()) - } else { - return "" - .concat(date.getFullYear(), ".") - .concat('0', date.getMonth() + 1, ".") - .concat(date.getDate()) - } - } else { - if (date.getDate() < 10) { - return "" - .concat(date.getFullYear(), ".") - .concat(date.getMonth() + 1, ".") - .concat('0', date.getDate()) - } else { - return "" - .concat(date.getFullYear(), ".") - .concat(date.getMonth() + 1, ".") - .concat(date.getDate()) - } - } - }, - } - - // 달력 플러그인 실행 - endDateNum[i].localization = { - placeholder: '날짜 입력', - selectedDateMessage: 'Selected date is', - prevMonthLabel: '이전 달 보기', - nextMonthLabel: '다음 달 보기', - monthSelectLabel: '달 선택', - yearSelectLabel: '년도 선택', - closeLabel: '달력 닫기', - dayNames: ['일', '월', '화', '수', '목', '금', '토'], - monthNames: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], - monthNamesShort: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], - identifier: "end_date", - name: "end_date" - } - - // 달력 닫았을 때 input, input[type=hidden]에 value 값 넣어주기 - endDateNum[i].addEventListener("duetClose", function (e) { - endDt = e.target; - endDtVal = e.target.value; - endSub = endDtVal.replace(/\-/g, ''); - var inputName = $(this).attr("name"); - console.log(inputName) - $(".end_date").each(function (idx, itm) { - $(itm).find(".duet-date__input").attr("id", inputName); - $(itm).find(".duet-date__input").attr("name", inputName); - $(itm).find(".duet-date__input").attr("value", endDtVal); - $(itm).find(".duet-date__input").next().attr("name", inputName + "_submit"); - $(itm).find(".duet-date__input").next().attr("value", endSub); - }); - }); - - //날짜 값 바꼈을 때 시작일, 종료일 찾아 alert 띄우기 - endDateNum[i].addEventListener("duetChange", function (e) { - endDt = e.target; - endDtVal = e.target.value; - var endDateNum = endDt.id; - endDateNum = endDateNum.replace("end_date", ""); - // var n = i - 1 - var startDtVal = $(".start_date" + endDateNum).find(".duet-date__input").val(); - startDtVal = startDtVal.replace(/[.]/gi, ''); - endDtVal = endDtVal.replace(/[.]/gi, ''); - //console.log(startDtVal,endDtVal) - //console.log("2",startDtVal,endDtVal); - if (endDtVal < startDtVal) { - e.target.value = ""; - alert("종료일이 시작일보다 작을 수 없습니다."); - } else {} - }); - - setTimeout(function () { - $("duet-date-picker.end_date").each(function (idx, itm) { - idx += 1; - $(itm).attr("name", "end_date" + idx); - $(itm).attr("id", "end_date" + idx); - }); - $("duet-date-picker .duet-date__input").attr('onkeydown', 'this.value=dateSetting(this.value);'); - }, 100) - - endDateNum[i].addEventListener("duetFocus", function (e) { - calendarSetting(); - }); - } - - } - - //input에 value 값 추가 - $(".duet-date__input").focusout(function () { - var thisVal = $(this).val(); - $(this).closest(".hydrated").attr("value", thisVal); - $(this).attr("value", thisVal); - $(this).next('input[type=hidden]').attr("value", thisVal); - /*var startVal = $('.startDate .duet-date__input').val(); - var endVal = $('.endDate .duet-date__input').val();*/ - - var startName, endName; - - - if ($(this).closest(".hydrated").is(".start_date")) { - var startNum = $(this).closest(".start_date").attr("id"); - startNum = startNum.replace("start_date", ""); - var startVal = $('#start_date' + startNum).find('.duet-date__input').val(); - var endVal = $('#end_date' + startNum).find('.duet-date__input').val(); - startName = $('#start_date' + startNum); - endName = $('#end_date' + startNum); - calendarMsgKey(this, startVal, endVal, startName, endName); - } else if ($(this).closest(".hydrated").is(".end_date")) { - var endNum = $(this).closest(".end_date").attr("id"); - endNum = endNum.replace("end_date", ""); - var startVal = $('#start_date' + endNum).find('.duet-date__input').val(); - var endVal = $('#end_date' + endNum).find('.duet-date__input').val(); - startName = $('#start_date' + endNum).attr("id"); - endName = $('#end_date' + endNum).attr("id"); - calendarMsgKey(this, startVal, endVal, startName, endName); - } - }); - - - - }, 10) - - function calendarMsgKey(ipt, startVal, endVal, startName, endName) { - startVal = startVal.replace(/[-]/gi, ''); - endVal = endVal.replace(/[-]/gi, ''); - if ($(ipt).closest(".input_calendar").is(".start_date") > 0) { - if (startVal > endVal && $(ipt).closest(".input_calendar").is(".start_date") == true && endVal != "") { - alert("시작일이 종료일보다 클 수 없습니다."); - ipt.value = ""; - } else if (startVal > endVal && $(ipt).is(".end_date") == true && startVal != "") { - if ($("duet-date-picker.end_date").val() == "") { - - } else { - alert("종료일이 시작일보다 작을 수 없습니다."); - ipt.value = ""; - } - } else {} - } else { - if (startVal > endVal && $(ipt).is("#" + startName) == true && endVal != "") { - alert("시작일이 종료일보다 클 수 없습니다."); - ipt.value = ""; - } else if (startVal > endVal && $(ipt).is("#" + endName) == true && startVal != "") { - if ($("duet-date-picker.end_date").val() == "") { - - } else { - alert("종료일이 시작일보다 작을 수 없습니다."); - ipt.value = ""; - } - } else {} - } - - } - - function dateSetting(objValue) { - var v = objValue.replace("--", "-"); - //console.log(event.keyCode); // 한글쪽 - 189, 숫자키 쪽 109 - if (v.match(/^\d{4}$/) !== null) { - if (event.keyCode == "8") { - // 백스페이스 키를 누를 때 '.' 안생기게 - } else { - v = v + '-'; - } - } else if (v.match(/^\d{4}\-\d{2}$/) !== null) { - if (event.keyCode == "8") { - // 백스페이스 키를 누를 때 '.' 안생기게 - } else { - v = v + '-'; - } - } - - // '-' 막기 - if (event.keyCode == "190" || event.keyCode == "110") { - event.preventDefault(); - return v; - } else {} - - - return v; - } - - -} - - -function calendarSetting() { - $('.calendar_wrap').each(function () { - $(this).find('.duet-date__input').attr('onkeydown', 'this.value=dateSetting(this.value);'); - $(this).find('.duet-date__input').attr('onblur', 'this.value=dateSetting(this.value);'); - }); -} - -function dateSetting(objValue) { - var v = objValue.replace("--", "-"); - //console.log(event.keyCode); // 한글쪽 - 189, 숫자키 쪽 109 - if (v.match(/^\d{4}$/) !== null) { - if (event.keyCode == "8") { - // 백스페이스 키를 누를 때 '.' 안생기게 - } else { - v = v + '-'; - } - } else if (v.match(/^\d{4}\-\d{2}$/) !== null) { - if (event.keyCode == "8") { - // 백스페이스 키를 누를 때 '.' 안생기게 - } else { - v = v + '-'; - } - } - - // '-' 막기 - if (event.keyCode == "190" || event.keyCode == "110") { - event.preventDefault(); - return v; - } else {} - - - return v; -} - -function calednarCaption() { - // 이전, 다음달 클릭 시 table caption 변경 - $(".duet-date__prev").on("click", function () { - var monthText = $(this).closest(".duet-date__dialog-content").find(".duet-date__select--month").val(); - var yearText = $(this).closest(".duet-date__dialog-content").find(".duet-date__select--year").val(); - monthText = Number(monthText) + 1; - monthText = monthText + "월"; - yearText = yearText + "년 "; - $(this).closest(".duet-date__dialog-content").find(".duet-date__table caption").remove(); - $(this).closest(".duet-date__dialog-content").find(".duet-date__table").prepend("" + yearText + monthText + " 달력입니다."); - }); - - $(".duet-date__next").on("click", function () { - var monthText = $(this).closest(".duet-date__dialog-content").find(".duet-date__select--month").val(); - var yearText = $(this).closest(".duet-date__dialog-content").find(".duet-date__select--year").val(); - monthText = Number(monthText) + 1; - monthText = monthText + "월"; - yearText = yearText + "년 "; - $(this).closest(".duet-date__dialog-content").find(".duet-date__table caption").remove(); - $(this).closest(".duet-date__dialog-content").find(".duet-date__table").prepend("" + yearText + monthText + " 달력입니다."); - }); -} - -function calendarTitle() { - setTimeout(function () { - $(".start_date .duet-date__input").attr("title", "시작날짜를 YYYY.MM.DD 형식으로 입력해주세요"); - $(".end_date .duet-date__input").attr("title", "종료날짜를 YYYY.MM.DD 형식으로 입력해주세요"); - - //웹접근성>달력 버튼 title추가 - $(".duet-date__input-wrapper .duet-date__toggle").attr("title", "달력팝업 열림"); - }, 100) + } + + +}) + +// header, footer 공통 영역 불러오기 +window.addEventListener('load', function () { + var allElements = document.getElementsByTagName('*'); + Array.prototype.forEach.call(allElements, function (el) { + var includePath = el.dataset.includePath; + if (includePath) { + var xhttp = new XMLHttpRequest(); + xhttp.onreadystatechange = function () { + if (this.readyState == 4 && this.status == 200) { + header(); + el.outerHTML = this.responseText; + + } + }; + xhttp.open('GET', includePath, true); + xhttp.send(); + } + }); +}); + +document.addEventListener('DOMContentLoaded', function () { + var calendarEl = document.getElementById('calendar'); + + if ($(".wrap").find("#calendar").length > 0) { + var calendar = new FullCalendar.Calendar(calendarEl, { + initialView: 'dayGridMonth', + titleFormat: function (date) { + year = date.date.year; + month = date.date.month + 1; + + return year + "년 " + month + "월"; + }, + locale: "ko", + buttonText: { + today: "오늘" + }, + height: "auto", + dayCellContent: function (info) { + var number = document.createElement('a'); + number.classList.add('fc-daygrid-day-number'); + number.innerHTML = info.dayNumberText.replace("일", ""); + if (info.view.type === 'dayGridMonth') { + return { + html: number.outerHTML + }; + } + return { + domNodes: [] + } + }, + events: [{ + title: '조정절차 관련 일정', + start: '2024-10-15', + }] + }); + calendar.render(); + } + +}); + +// 달력팝업 +function calendar() { + + // 캘린더 고유 클래스 추가 + $(".input_calendar").not(".start_date,.end_date").each(function (idx, itm) { + idx += 1; + $(itm).addClass("input_calendar" + idx); + }); + + $(".start_date").each(function (idx, itm) { + idx += 1; + $(itm).addClass("start_date" + idx); + $(itm).attr("id", "start_date" + idx); + }); + + $(".end_date").each(function (idx, itm) { + idx += 1; + $(itm).addClass("end_date" + idx); + $(itm).attr("id", "end_date" + idx); + $(itm).find(".duet-date__input").attr("id", "end_date" + idx); + }); + + setTimeout(function () { + + calendarTitle(); // 달력 타이틀 + calednarCaption(); // 달력 caption + }, 100) + + + + // input value 값 추가, 검색 시 input value 값 안없어지게. + var start_duetValue = $("duet-date-picker.start_date").val(); + var end_duetValue = $("duet-date-picker.end_date").val(); + var startcalendar_name = $(".start_date").attr("name"); + var endcalendar_name = $(".end_date").attr("name"); + + //달력 입력창 최대 입력 수 10자 제한('.' 포함) + $("input.duet-date__input").attr("maxlength", "10"); + + var DATE_FORMAT = /^(\d{1,2})\.(\d{1,2})\.(\d{4})$/ + var duetdateleng = $("duet-date-picker").length + 1; + + var calendarNum = []; + var startDateNum = []; + var endDateNum = []; + setTimeout(function () { + for (var i = 1; i < duetdateleng; i++) { + calendarNum[i] = document.querySelector(".input_calendar" + i); + if (calendarNum[i] !== null) { + calendarNum[i].dateAdapter = { + parse: function parse() { + var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "" + var createDate = arguments.length > 1 ? arguments[1] : undefined + var matches = value.match(DATE_FORMAT) + + if (matches) { + return createDate(matches[3], matches[2], matches[1]) + } + }, + format: function format(date) { + if (date.getMonth() < 9) { + if (date.getDate() < 10) { + return "" + .concat(date.getFullYear(), ".") + .concat('0', date.getMonth() + 1, ".") + .concat('0', date.getDate()) + } else { + return "" + .concat(date.getFullYear(), ".") + .concat('0', date.getMonth() + 1, ".") + .concat(date.getDate()) + } + } else { + if (date.getDate() < 10) { + return "" + .concat(date.getFullYear(), ".") + .concat(date.getMonth() + 1, ".") + .concat('0', date.getDate()) + } else { + return "" + .concat(date.getFullYear(), ".") + .concat(date.getMonth() + 1, ".") + .concat(date.getDate()) + } + } + }, + } + + // 달력 플러그인 실행 + calendarNum[i].localization = { + placeholder: '날짜 입력', + selectedDateMessage: 'Selected date is', + prevMonthLabel: '이전 달 보기', + nextMonthLabel: '다음 달 보기', + monthSelectLabel: '달 선택', + yearSelectLabel: '년도 선택', + closeLabel: '달력 닫기', + dayNames: ['일', '월', '화', '수', '목', '금', '토'], + monthNames: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], + monthNamesShort: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], + identifier: "input_date", + name: "input_date" + } + + // 달력 닫았을 때 input, input[type=hidden]에 value 값 넣어주기 + calendarNum[i].addEventListener("duetClose", function (e) { + startDt = e.target; + startDtVal = e.target.value; + startSub = startDtVal.replace(/\-/g, ''); + var inputName = $(this).attr("name"); + }); + + setTimeout(function () { + $("duet-date-picker").not(".start_date,.end_date").find(".duet-date__input").each(function (idx, itm) { + idx += 1; + $(itm).attr("name", "input_date" + idx); + $(itm).attr("id", "input_date" + idx); + }); + $("duet-date-picker .duet-date__input").attr('onkeydown', 'this.value=dateSetting(this.value);'); + }, 100) + } + + + + } + + // 시작날짜 + + for (var i = 1; i < duetdateleng; i++) { + startDateNum[i] = document.querySelector(".start_date" + i); + if (startDateNum[i] !== null) { + startDateNum[i].dateAdapter = { + parse: function parse() { + var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "" + var createDate = arguments.length > 1 ? arguments[1] : undefined + var matches = value.match(DATE_FORMAT) + + if (matches) { + return createDate(matches[3], matches[2], matches[1]) + } + }, + format: function format(date) { + if (date.getMonth() < 9) { + if (date.getDate() < 10) { + return "" + .concat(date.getFullYear(), ".") + .concat('0', date.getMonth() + 1, ".") + .concat('0', date.getDate()) + } else { + return "" + .concat(date.getFullYear(), ".") + .concat('0', date.getMonth() + 1, ".") + .concat(date.getDate()) + } + } else { + if (date.getDate() < 10) { + return "" + .concat(date.getFullYear(), ".") + .concat(date.getMonth() + 1, ".") + .concat('0', date.getDate()) + } else { + return "" + .concat(date.getFullYear(), ".") + .concat(date.getMonth() + 1, ".") + .concat(date.getDate()) + } + } + }, + } + + // 달력 플러그인 실행 + startDateNum[i].localization = { + placeholder: '날짜 입력', + selectedDateMessage: 'Selected date is', + prevMonthLabel: '이전 달 보기', + nextMonthLabel: '다음 달 보기', + monthSelectLabel: '달 선택', + yearSelectLabel: '년도 선택', + closeLabel: '달력 닫기', + dayNames: ['일', '월', '화', '수', '목', '금', '토'], + monthNames: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], + monthNamesShort: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], + identifier: "start_date", + name: "start_date" + } + + + // 달력 닫았을 때 input, input[type=hidden]에 value 값 넣어주기 + startDateNum[i].addEventListener("duetClose", function (e) { + startDt = e.target; + startDtVal = e.target.value; + startSub = startDtVal.replace(/\-/g, ''); + var inputName = $(startDt).attr("id"); + $(".start_date").each(function (idx, itm) { + $(this).find(".duet-date__input").attr("id", inputName); + /*$(this).find(".duet-date__input").attr("name", inputName);*/ + $(this).find(".duet-date__input").attr("value", startDtVal); + /*$(this).find(".duet-date__input").next().attr("name", inputName + "_submit");*/ + $(this).find(".duet-date__input").next().attr("value", startSub); + }); + }); + + //날짜 값 바꼈을 때 시작일, 종료일 찾아 alert 띄우기 + startDateNum[i].addEventListener("duetChange", function (e) { + startDt = e.target; + var startDateNum = startDt.id; + startDateNum = startDateNum.replace("start_date", ""); + startDtVal = e.target.value; + // var n = i - 1; + var endDtVal = $(".end_date" + startDateNum).find(".duet-date__input").val(); + endDtVal = endDtVal.replace(/[.]/gi, ''); + startDtVal = startDtVal.replace(/[.]/gi, ''); + if (startDtVal > endDtVal && endDtVal != "") { + e.target.value = ""; + alert("시작일이 종료일보다 클 수 없습니다."); + } else {} + }); + + setTimeout(function () { + $("duet-date-picker.start_date .duet-date__input").each(function (idx, itm) { + idx += 1; + $(itm).attr("name", "start_date" + idx); + $(itm).attr("id", "start_date" + idx); + }); + $("duet-date-picker .duet-date__input").attr('onkeydown', 'this.value=dateSetting(this.value);'); + }, 100) + + startDateNum[i].addEventListener("duetFocus", function (e) { + calendarSetting(); + }); + } + + } + + // 종료날짜 + + for (var i = 1; i < duetdateleng; i++) { + endDateNum[i] = document.querySelector(".end_date" + i); + if (endDateNum[i] !== null) { + endDateNum[i].dateAdapter = { + parse: function parse() { + var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "" + var createDate = arguments.length > 1 ? arguments[1] : undefined + var matches = value.match(DATE_FORMAT) + + if (matches) { + return createDate(matches[3], matches[2], matches[1]) + } + }, + format: function format(date) { + if (date.getMonth() < 9) { + if (date.getDate() < 10) { + return "" + .concat(date.getFullYear(), ".") + .concat('0', date.getMonth() + 1, ".") + .concat('0', date.getDate()) + } else { + return "" + .concat(date.getFullYear(), ".") + .concat('0', date.getMonth() + 1, ".") + .concat(date.getDate()) + } + } else { + if (date.getDate() < 10) { + return "" + .concat(date.getFullYear(), ".") + .concat(date.getMonth() + 1, ".") + .concat('0', date.getDate()) + } else { + return "" + .concat(date.getFullYear(), ".") + .concat(date.getMonth() + 1, ".") + .concat(date.getDate()) + } + } + }, + } + + // 달력 플러그인 실행 + endDateNum[i].localization = { + placeholder: '날짜 입력', + selectedDateMessage: 'Selected date is', + prevMonthLabel: '이전 달 보기', + nextMonthLabel: '다음 달 보기', + monthSelectLabel: '달 선택', + yearSelectLabel: '년도 선택', + closeLabel: '달력 닫기', + dayNames: ['일', '월', '화', '수', '목', '금', '토'], + monthNames: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], + monthNamesShort: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], + identifier: "end_date", + name: "end_date" + } + + // 달력 닫았을 때 input, input[type=hidden]에 value 값 넣어주기 + endDateNum[i].addEventListener("duetClose", function (e) { + endDt = e.target; + endDtVal = e.target.value; + endSub = endDtVal.replace(/\-/g, ''); + var inputName = $(this).attr("name"); + console.log(inputName) + $(".end_date").each(function (idx, itm) { + $(itm).find(".duet-date__input").attr("id", inputName); + /*$(itm).find(".duet-date__input").attr("name", inputName);*/ + $(itm).find(".duet-date__input").attr("value", endDtVal); + /*$(itm).find(".duet-date__input").next().attr("name", inputName + "_submit");*/ + $(itm).find(".duet-date__input").next().attr("value", endSub); + }); + }); + + //날짜 값 바꼈을 때 시작일, 종료일 찾아 alert 띄우기 + endDateNum[i].addEventListener("duetChange", function (e) { + endDt = e.target; + endDtVal = e.target.value; + var endDateNum = endDt.id; + endDateNum = endDateNum.replace("end_date", ""); + // var n = i - 1 + var startDtVal = $(".start_date" + endDateNum).find(".duet-date__input").val(); + startDtVal = startDtVal.replace(/[.]/gi, ''); + endDtVal = endDtVal.replace(/[.]/gi, ''); + //console.log(startDtVal,endDtVal) + //console.log("2",startDtVal,endDtVal); + if (endDtVal < startDtVal) { + e.target.value = ""; + alert("종료일이 시작일보다 작을 수 없습니다."); + } else {} + }); + + setTimeout(function () { + $("duet-date-picker.end_date").each(function (idx, itm) { + idx += 1; + /*$(itm).attr("name", "end_date" + idx);*/ + $(itm).attr("id", "end_date" + idx); + }); + $("duet-date-picker .duet-date__input").attr('onkeydown', 'this.value=dateSetting(this.value);'); + }, 100) + + endDateNum[i].addEventListener("duetFocus", function (e) { + calendarSetting(); + }); + } + + } + + //input에 value 값 추가 + $(".duet-date__input").focusout(function () { + var thisVal = $(this).val(); + $(this).closest(".hydrated").attr("value", thisVal); + $(this).attr("value", thisVal); + $(this).next('input[type=hidden]').attr("value", thisVal); + /*var startVal = $('.startDate .duet-date__input').val(); + var endVal = $('.endDate .duet-date__input').val();*/ + + var startName, endName; + + + if ($(this).closest(".hydrated").is(".start_date")) { + var startNum = $(this).closest(".start_date").attr("id"); + startNum = startNum.replace("start_date", ""); + var startVal = $('#start_date' + startNum).find('.duet-date__input').val(); + var endVal = $('#end_date' + startNum).find('.duet-date__input').val(); + startName = $('#start_date' + startNum); + endName = $('#end_date' + startNum); + calendarMsgKey(this, startVal, endVal, startName, endName); + } else if ($(this).closest(".hydrated").is(".end_date")) { + var endNum = $(this).closest(".end_date").attr("id"); + endNum = endNum.replace("end_date", ""); + var startVal = $('#start_date' + endNum).find('.duet-date__input').val(); + var endVal = $('#end_date' + endNum).find('.duet-date__input').val(); + startName = $('#start_date' + endNum).attr("id"); + endName = $('#end_date' + endNum).attr("id"); + calendarMsgKey(this, startVal, endVal, startName, endName); + } + }); + + + + }, 10) + + function calendarMsgKey(ipt, startVal, endVal, startName, endName) { + startVal = startVal.replace(/[-]/gi, ''); + endVal = endVal.replace(/[-]/gi, ''); + if ($(ipt).closest(".input_calendar").is(".start_date") > 0) { + if (startVal > endVal && $(ipt).closest(".input_calendar").is(".start_date") == true && endVal != "") { + alert("시작일이 종료일보다 클 수 없습니다."); + ipt.value = ""; + } else if (startVal > endVal && $(ipt).closest(".input_calendar").is(".end_date") == true && startVal != "") { + if ($("duet-date-picker.end_date").val() == "") { + + } else { + alert("종료일이 시작일보다 작을 수 없습니다."); + ipt.value = ""; + } + } else {} + } else { + if (startVal > endVal && $(ipt).is("#" + startName) == true && endVal != "") { + alert("시작일이 종료일보다 클 수 없습니다."); + ipt.value = ""; + } else if (startVal > endVal && $(ipt).is("#" + endName) == true && startVal != "") { + if ($("duet-date-picker.end_date").val() == "") { + + } else { + alert("종료일이 시작일보다 작을 수 없습니다."); + ipt.value = ""; + } + } else {} + } + + } + + function dateSetting(objValue) { + var v = objValue.replace("--", "-"); + //console.log(event.keyCode); // 한글쪽 - 189, 숫자키 쪽 109 + if (v.match(/^\d{4}$/) !== null) { + if (event.keyCode == "8") { + // 백스페이스 키를 누를 때 '.' 안생기게 + } else { + v = v + '-'; + } + } else if (v.match(/^\d{4}\-\d{2}$/) !== null) { + if (event.keyCode == "8") { + // 백스페이스 키를 누를 때 '.' 안생기게 + } else { + v = v + '-'; + } + } + + // '-' 막기 + if (event.keyCode == "190" || event.keyCode == "110") { + event.preventDefault(); + return v; + } else {} + + + return v; + } + + +} + + +function calendarSetting() { + $('.calendar_wrap').each(function () { + $(this).find('.duet-date__input').attr('onkeydown', 'this.value=dateSetting(this.value);'); + $(this).find('.duet-date__input').attr('onblur', 'this.value=dateSetting(this.value);'); + }); +} + +function dateSetting(objValue) { + var v = objValue.replace("--", "-"); + //console.log(event.keyCode); // 한글쪽 - 189, 숫자키 쪽 109 + if (v.match(/^\d{4}$/) !== null) { + if (event.keyCode == "8") { + // 백스페이스 키를 누를 때 '.' 안생기게 + } else { + v = v + '-'; + } + } else if (v.match(/^\d{4}\-\d{2}$/) !== null) { + if (event.keyCode == "8") { + // 백스페이스 키를 누를 때 '.' 안생기게 + } else { + v = v + '-'; + } + } + + // '-' 막기 + if (event.keyCode == "190" || event.keyCode == "110") { + event.preventDefault(); + return v; + } else {} + + + return v; +} + +function calednarCaption() { + // 이전, 다음달 클릭 시 table caption 변경 + $(".duet-date__prev").on("click", function () { + var monthText = $(this).closest(".duet-date__dialog-content").find(".duet-date__select--month").val(); + var yearText = $(this).closest(".duet-date__dialog-content").find(".duet-date__select--year").val(); + monthText = Number(monthText) + 1; + monthText = monthText + "월"; + yearText = yearText + "년 "; + $(this).closest(".duet-date__dialog-content").find(".duet-date__table caption").remove(); + $(this).closest(".duet-date__dialog-content").find(".duet-date__table").prepend("" + yearText + monthText + " 달력입니다."); + }); + + $(".duet-date__next").on("click", function () { + var monthText = $(this).closest(".duet-date__dialog-content").find(".duet-date__select--month").val(); + var yearText = $(this).closest(".duet-date__dialog-content").find(".duet-date__select--year").val(); + monthText = Number(monthText) + 1; + monthText = monthText + "월"; + yearText = yearText + "년 "; + $(this).closest(".duet-date__dialog-content").find(".duet-date__table caption").remove(); + $(this).closest(".duet-date__dialog-content").find(".duet-date__table").prepend("" + yearText + monthText + " 달력입니다."); + }); +} + +function calendarTitle() { + setTimeout(function () { + $(".start_date .duet-date__input").attr("title", "시작날짜를 YYYY.MM.DD 형식으로 입력해주세요"); + $(".end_date .duet-date__input").attr("title", "종료날짜를 YYYY.MM.DD 형식으로 입력해주세요"); + + //웹접근성>달력 버튼 title추가 + $(".duet-date__input-wrapper .duet-date__toggle").attr("title", "달력팝업 열림"); + }, 100) } \ No newline at end of file