Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -15,9 +15,7 @@ import com.wb.domainserver.domain.gcone.ntcn.mssage.service.BOMssageService;
|
||||
import com.wb.domainserver.domain.gcone.ordr.ordr.service.BOOrdrService;
|
||||
import com.wb.domainserver.domain.gcone.ordr.ordr.vo.BOCrmDlvylcVO;
|
||||
import com.wb.domainserver.domain.gcone.promtn.coupon.service.BOCouponService;
|
||||
import com.wb.domainserver.domain.sopmal.main.vo.MaSopmalVO;
|
||||
import com.wb.domainserver.domain.sopmal.mbr.vo.MbrVO;
|
||||
import com.wb.domainserver.domain.sopmal.mpage.mbr.vo.MyMbrPwdChngVO;
|
||||
import com.wb.domainserver.exception.WnbtRestException;
|
||||
import com.wb.domainserver.realm.util.UrlExtractor;
|
||||
import com.wb.domainserver.response.WnbtResponse;
|
||||
@@ -27,8 +25,6 @@ import com.wb.domainserver.security.authentication.AnonymousUser;
|
||||
import com.wb.domainserver.security.authentication.MemberJwtContextHolder;
|
||||
import com.wb.domainserver.security.authorization.annotation.AuthPolicy;
|
||||
import com.wb.domainserver.security.authorization.annotation.Policy;
|
||||
import com.wb.domainserver.util.communicate.RESRC;
|
||||
import com.wb.domainserver.util.communicate.ReplyFromResrc;
|
||||
import com.wb.domainserver.util.communicate.SendToResrc;
|
||||
import com.wb.domainserver.util.communicate.ValidateResultConverter;
|
||||
import com.wb.domainserver.util.dataaccess.DataMap;
|
||||
@@ -39,6 +35,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpSession;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
@@ -284,7 +281,7 @@ public class MbrController {
|
||||
* @author 이대환
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/insertPhoneAuth")
|
||||
@RequestMapping(value="/insertPhoneAuth", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> insertPhoneAuth(BOMbrVO vo, BindingResult bindingResult){
|
||||
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
@@ -348,7 +345,7 @@ public class MbrController {
|
||||
* @author 이대환
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectPhoneAuth")
|
||||
@RequestMapping(value="/selectPhoneAuth", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> selectPhoneAuth(BOMbrVO vo, BindingResult bindingResult){
|
||||
|
||||
DataMap content = new DataMap();
|
||||
@@ -366,7 +363,7 @@ public class MbrController {
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/insertUsrJoinRegist")
|
||||
@RequestMapping(value="/insertUsrJoinRegist", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> insertUsrJoinRegist(HttpServletRequest request, HttpServletResponse response, @Validated BOMbrVO vo, BindingResult bindingResult){
|
||||
|
||||
HttpSession session = request.getSession();
|
||||
@@ -549,7 +546,7 @@ public class MbrController {
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectMbrwithdrawalSearch")
|
||||
@RequestMapping(value="/selectMbrwithdrawalSearch", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> selectMbrwithdrawalSearch(BOMbrVO vo, BindingResult bindingResult){
|
||||
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
@@ -581,7 +578,7 @@ public class MbrController {
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectIdDplctCnfirm")
|
||||
@RequestMapping(value="/selectIdDplctCnfirm", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> selectIdDplctCnfirm(BOMbrVO vo, BindingResult bindingResult){
|
||||
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
@@ -618,7 +615,7 @@ public class MbrController {
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectUsrLogin")
|
||||
@RequestMapping(value="/selectUsrLogin", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> selectUsrLogin(BOMbrVO vo, BindingResult bindingResult){
|
||||
|
||||
Map<String, Object> content = new HashMap<>();
|
||||
@@ -637,7 +634,7 @@ public class MbrController {
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectNmbrOrdrInqire")
|
||||
@RequestMapping(value="/selectNmbrOrdrInqire", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> selectNmbrOrdrInqire(BOMbrVO vo, BindingResult bindingResult){
|
||||
|
||||
Map<String, Object> content = new HashMap<>();
|
||||
@@ -666,7 +663,7 @@ public class MbrController {
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectPasswordSearch")
|
||||
@RequestMapping(value="/selectPasswordSearch", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> selectIdPasswordSearch(BOMbrVO vo){
|
||||
|
||||
List<Map<String, String>> errorList = new ArrayList<>();
|
||||
@@ -730,7 +727,7 @@ public class MbrController {
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectIdSearch")
|
||||
@RequestMapping(value="/selectIdSearch", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> selectIdSearch(BOMbrVO vo){
|
||||
|
||||
List<Map<String, String>> errorList = new ArrayList<>();
|
||||
@@ -807,7 +804,7 @@ public class MbrController {
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/insertMbrLoginInfo")
|
||||
@RequestMapping(value="/insertMbrLoginInfo", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> insertMbrLoginInfo(BOMbrVO vo){
|
||||
//쇼핑몰코드 set
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
@@ -878,8 +875,8 @@ public class MbrController {
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping("/updatePasswordChng")
|
||||
public ResponseEntity<WnbtResponse> passWordChng(@Validated MyMbrPwdChngVO mymbrVO, @Validated BOMbrVO vo, BindingResult bindingResult) {
|
||||
@RequestMapping(value = "/updatePasswordChng", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> passWordChng(@Validated BOMbrVO mymbrVO, @Validated BOMbrVO vo, BindingResult bindingResult) {
|
||||
// 정합성 검사
|
||||
if (bindingResult.hasErrors()) {
|
||||
throw new WnbtRestException(ValidateResultConverter.convert(bindingResult, gconeMessageSource));
|
||||
@@ -887,9 +884,9 @@ public class MbrController {
|
||||
|
||||
//비밀번호 변경시
|
||||
/*1 비밀번호 변경 시 현재 비밀번호 확인*/
|
||||
Map<String, Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/mbr/mbr/selectBOMbrPasswordCnfirm", mymbrVO)
|
||||
);
|
||||
// Map<String, Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/mbr/mbr/selectBOMbrPasswordCnfirm", mymbrVO)
|
||||
// );
|
||||
|
||||
// 사용자 정보 추출 및 적용
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
@@ -957,7 +954,7 @@ public class MbrController {
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping("/updatePasswordChngLater")
|
||||
@RequestMapping(value = "/updatePasswordChngLater", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> passWordChngLater(BOMbrVO vo) {
|
||||
// 사용자 정보 추출 및 적용
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
@@ -988,8 +985,6 @@ public class MbrController {
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping("/selectMbrMarktAgreePopup")
|
||||
public String selectMbrMarktAgreePopup(HttpServletRequest request, BOMaSopmalVO vo, ModelMap model) {
|
||||
|
||||
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
|
||||
@@ -1017,7 +1012,7 @@ public class MbrController {
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping("/updateMarkRecptnAgreUpdt")
|
||||
@RequestMapping(value = "/updateMarkRecptnAgreUpdt", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> updateMarkRecptnAgreUpdt(BOMbrVO vo) {
|
||||
|
||||
//마케팅 수신동의 수정
|
||||
@@ -1031,7 +1026,6 @@ public class MbrController {
|
||||
vo.setRegusr(user.getUserInnb());
|
||||
vo.setUpdusr(user.getUserInnb());
|
||||
|
||||
|
||||
Map<String, Object> content = new HashMap<>();
|
||||
|
||||
DataMap dataMap = new DataMap();
|
||||
@@ -1060,13 +1054,12 @@ public class MbrController {
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 코드 디코딩
|
||||
* @param code
|
||||
* @return ResponseEntity<?>
|
||||
* @return int
|
||||
*/
|
||||
public int code2seq(String code) {
|
||||
// HEX 제외 문자 배열
|
||||
|
||||
@@ -1,25 +1,52 @@
|
||||
package com.wb.domainserver.domain.sopmal.mpage.act.controller;
|
||||
|
||||
import com.wb.domainserver.common.msg.GconeMessageSource;
|
||||
import com.wb.domainserver.domain.sopmal.csc.vo.GnrlBbscttVO;
|
||||
import com.wb.domainserver.domain.sopmal.mpage.act.vo.RvwVO;
|
||||
import com.wb.domainserver.common.mvc.tags.ui.pagination.PaginationInfo;
|
||||
import com.wb.domainserver.common.prop.PaginationProperties;
|
||||
import com.wb.domainserver.domain.gcone.bbs.bbs.service.BOBbsService;
|
||||
import com.wb.domainserver.domain.gcone.bbs.bbs.vo.BOBbsVO;
|
||||
import com.wb.domainserver.domain.gcone.bbs.gnrlbbsctt.service.BOGnrlbbscttService;
|
||||
import com.wb.domainserver.domain.gcone.bbs.gnrlbbsctt.vo.BODelInfoVO;
|
||||
import com.wb.domainserver.domain.gcone.bbs.gnrlbbsctt.vo.BOGnrlbbscttVO;
|
||||
import com.wb.domainserver.domain.gcone.common.service.BOCommonService;
|
||||
import com.wb.domainserver.domain.gcone.goods.goods.service.BOGoodsService;
|
||||
import com.wb.domainserver.domain.gcone.goods.goods.vo.BOGoodsVO;
|
||||
import com.wb.domainserver.domain.gcone.mbr.mbr.service.BOMbrService;
|
||||
import com.wb.domainserver.domain.gcone.mbr.mbr.vo.BOMbrVO;
|
||||
import com.wb.domainserver.domain.gcone.mbr.mlg.service.BOMlgService;
|
||||
import com.wb.domainserver.domain.gcone.mbr.mlg.vo.BOMlgVO;
|
||||
import com.wb.domainserver.domain.gcone.setup.site.service.BOSiteService;
|
||||
import com.wb.domainserver.domain.gcone.setup.site.vo.BOSiteVO;
|
||||
import com.wb.domainserver.response.WnbtResponse;
|
||||
import com.wb.domainserver.response.WnbtResponseBody;
|
||||
import com.wb.domainserver.response.WnbtWebClientResponseHandler;
|
||||
import com.wb.domainserver.security.authentication.AnonymousUser;
|
||||
import com.wb.domainserver.security.authentication.MemberJwtContextHolder;
|
||||
import com.wb.domainserver.security.authorization.annotation.AuthPolicy;
|
||||
import com.wb.domainserver.security.authorization.annotation.Policy;
|
||||
import com.wb.domainserver.util.communicate.*;
|
||||
import com.wb.domainserver.util.communicate.SendToResrc;
|
||||
import com.wb.domainserver.util.dataaccess.DataMap;
|
||||
import com.wb.domainserver.util.file.service.FileStorageService;
|
||||
import com.wb.domainserver.util.util.Util;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* MyActController Class (back)
|
||||
*
|
||||
@@ -55,30 +82,53 @@ public class MyActController {
|
||||
@Autowired
|
||||
private FileStorageService filestore;
|
||||
|
||||
/**
|
||||
|
||||
@Autowired
|
||||
private BOGnrlbbscttService service;
|
||||
@Autowired
|
||||
private BOBbsService bbsService;
|
||||
@Autowired
|
||||
private BOMlgService mlgService;
|
||||
@Autowired
|
||||
private BOGoodsService goodsService;
|
||||
@Autowired
|
||||
private BOMbrService boMbrService;
|
||||
@Autowired
|
||||
private BOCommonService boCommonService;
|
||||
@Autowired
|
||||
private PaginationProperties paginationProperties;
|
||||
@Autowired
|
||||
private BOSiteService boSiteService;
|
||||
|
||||
|
||||
/**
|
||||
* 상품 Q&A 조회
|
||||
* @param bbsctt
|
||||
* @return String
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectGoodsQnaInqire")
|
||||
public String selectGoodsQnaInqire(HttpServletRequest request, ModelMap model, GnrlBbscttVO bbsctt){
|
||||
public String selectGoodsQnaInqire(HttpServletRequest request, ModelMap model, BOGnrlbbscttVO bbsctt, BOMbrVO vo){
|
||||
bbsctt.setBbsTyCd("05");
|
||||
bbsctt.setServerDv("sopmal");
|
||||
bbsctt.setReqUrl("mpage");
|
||||
//BO에서 API 호출
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/selectBOBbscttListInqire",bbsctt),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
DataMap content = selectBOBbscttListInqire(bbsctt);
|
||||
model.addAttribute("resultMap", content);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/selectBOBbscttListInqire",bbsctt),
|
||||
// model,
|
||||
// "resultMap"
|
||||
// );
|
||||
|
||||
Map<String, Object> content2 = selectBOMpageInfoInqire(vo);
|
||||
// 마이페이지 > 상단 회원 정보 ( 등금, 이름, 마일리지, 쿠폰, 위시리스트, 배송중, 등급산정기준 )
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/mbr/mbr/selectBOMpageInfoInqire",bbsctt),
|
||||
model,
|
||||
"mpageResultMap"
|
||||
);
|
||||
model.addAttribute("mpageResultMap", content2);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/mbr/mbr/selectBOMpageInfoInqire",bbsctt),
|
||||
// model,
|
||||
// "mpageResultMap"
|
||||
// );
|
||||
|
||||
return Util.getDeviceType(request)+"/mpage/act/MyGoodsQaR";
|
||||
}
|
||||
@@ -88,16 +138,23 @@ public class MyActController {
|
||||
* @return String
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectGoodsQnaInqireAjax")
|
||||
public ResponseEntity<?> selectGoodsQnaInqireAjax(GnrlBbscttVO bbsctt){
|
||||
@RequestMapping(value="/selectGoodsQnaInqireAjax", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<?> selectGoodsQnaInqireAjax(BOGnrlbbscttVO bbsctt){
|
||||
bbsctt.setBbsTyCd("05");
|
||||
bbsctt.setServerDv("sopmal");
|
||||
bbsctt.setReqUrl("mpage");
|
||||
//게시글 노출 항목 설정값과 게시판 목록 조회
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/selectBOBbscttListInqire",bbsctt),
|
||||
ReplyFromResrc::getReply
|
||||
|
||||
DataMap content = selectBOBbscttListInqire(bbsctt);
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
// return responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/selectBOBbscttListInqire",bbsctt),
|
||||
// ReplyFromResrc::getReply
|
||||
// );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,14 +163,25 @@ public class MyActController {
|
||||
* @return String
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectFileInfo")
|
||||
public ResponseEntity<?> selectFileInfo(HttpServletRequest request, ModelMap model, GnrlBbscttVO bbsctt){
|
||||
@RequestMapping(value="/selectFileInfo", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<?> selectFileInfo(HttpServletRequest request, ModelMap model, BOGnrlbbscttVO bbsctt){
|
||||
bbsctt.setServerDv("sopmal");
|
||||
//BO에서 API 호출
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/selectBOFileInfo",bbsctt),
|
||||
ReplyFromResrc::getReply
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if ("01".equals(user.getSysDvCd())) {
|
||||
bbsctt.setSopmalCd(user.getSopmalCd());
|
||||
}
|
||||
DataMap content = new DataMap();
|
||||
content.put("fileInfo", service.selectFileInfo(bbsctt));
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
// return responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/selectBOFileInfo",bbsctt),
|
||||
// ReplyFromResrc::getReply
|
||||
// );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -123,22 +191,73 @@ public class MyActController {
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectGoodsQnaDtlUpdtForm")
|
||||
public String selectGoodsQnaDtlUpdtForm(HttpServletRequest request, ModelMap model,GnrlBbscttVO bbsctt){
|
||||
public String selectGoodsQnaDtlUpdtForm(HttpServletRequest request, ModelMap model,BOGnrlbbscttVO bbsctt, BOMbrVO vo){
|
||||
bbsctt.setServerDv("sopmal");
|
||||
//BO에서 API 호출
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/selectBOBbscttUpdtPopupForm",bbsctt),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if ("01".equals(user.getSysDvCd())) {
|
||||
bbsctt.setSopmalCd(user.getSopmalCd());
|
||||
}
|
||||
;
|
||||
if (user.getUserInnb() > 0) {
|
||||
if ("mngr".equals(bbsctt.getServerDv())) {
|
||||
bbsctt.setRegusrDvCd("02"); //관리자
|
||||
} else {
|
||||
bbsctt.setRegusrDvCd("01"); //회원
|
||||
bbsctt.setAnswMbtlnb(user.getMbtlnb());
|
||||
}
|
||||
} else {
|
||||
bbsctt.setRegusrDvCd("99");//비회원
|
||||
}
|
||||
bbsctt.setSecretKey(boCommonService.selectSecretkey());
|
||||
// 게시판 설정 정보
|
||||
BOBbsVO bbsVO = new BOBbsVO();
|
||||
// bbsVO에 쇼핑몰코드, 해당 게시판 set
|
||||
bbsVO.setSopmalCd(bbsctt.getSopmalCd());
|
||||
bbsVO.setBbsId(bbsctt.getBbsId());
|
||||
bbsVO.setBbsTyCd(bbsctt.getBbsTyCd());
|
||||
DataMap bbsInfo = new DataMap();
|
||||
bbsInfo = bbsService.selectBOBbsSetupInfo(bbsVO);
|
||||
|
||||
// 게시글 상세 조회
|
||||
Map<String, Object> bbscttInfo = new HashMap<String, Object>();
|
||||
bbscttInfo = service.selectBOBbscttUpdt(bbsctt);
|
||||
|
||||
// 분류 조회
|
||||
List<DataMap> itmList = new ArrayList<>();
|
||||
itmList = service.selectBOBbscttItmInqire(bbsctt);
|
||||
|
||||
//추가 항목 조회, 추가항목 항목 조회
|
||||
Map<String, Object> qesitmList = new HashMap<String, Object>();
|
||||
qesitmList = service.selectBOBbscttRegistPopupForm(bbsctt);
|
||||
|
||||
//리뷰항목 리스트, 리뷰항목 항목 리스트
|
||||
Map<String, Object> rvwQesitmList = new HashMap<String, Object>();
|
||||
rvwQesitmList = service.selectBOStarItm(bbsctt);
|
||||
|
||||
Map<String, Object> content = new HashMap<String, Object>();
|
||||
content.put("bbsInfo", bbsInfo);
|
||||
content.put("bbscttVO", bbsctt);
|
||||
content.put("bbscttInfo", bbscttInfo);
|
||||
content.put("itmList", itmList);
|
||||
content.put("qesitmList", qesitmList);
|
||||
content.put("rvwQesitmList", rvwQesitmList);
|
||||
|
||||
model.addAttribute("resultMap", content);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/selectBOBbscttUpdtPopupForm",bbsctt),
|
||||
// model,
|
||||
// "resultMap"
|
||||
// );
|
||||
model.addAttribute("bbsctt", bbsctt);
|
||||
|
||||
// 마이페이지 > 상단 회원 정보 ( 등금, 이름, 마일리지, 쿠폰, 위시리스트, 배송중, 등급산정기준 )
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/mbr/mbr/selectBOMpageInfoInqire",bbsctt),
|
||||
model,
|
||||
"mpageResultMap"
|
||||
);
|
||||
Map<String, Object> content2 = selectBOMpageInfoInqire(vo);
|
||||
model.addAttribute("mpageResultMap", content2);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/mbr/mbr/selectBOMpageInfoInqire",bbsctt),
|
||||
// model,
|
||||
// "mpageResultMap"
|
||||
// );
|
||||
|
||||
return Util.getDeviceType(request)+"/mpage/act/MyGoodsQnaDtlUpdtU";
|
||||
}
|
||||
@@ -150,20 +269,29 @@ public class MyActController {
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectMyRvwInqireForm")
|
||||
public String selectMyRvwInqireForm(HttpServletRequest request, ModelMap model,GnrlBbscttVO bbsctt){
|
||||
//BO에서 API 호출
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/selectBORvwBnefInfo",bbsctt),
|
||||
model,
|
||||
"mlgAccmlNtc"
|
||||
);
|
||||
public String selectMyRvwInqireForm(HttpServletRequest request, ModelMap model,BOGnrlbbscttVO bbsctt, BOMbrVO vo){
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
bbsctt.setSopmalCd(user.getSopmalCd());
|
||||
|
||||
/*리뷰 조회 폼*/
|
||||
DataMap rvwBnefInfo = new DataMap();
|
||||
rvwBnefInfo = service.selectBORvwBnefInfo(bbsctt);
|
||||
|
||||
model.addAttribute("mlgAccmlNtc", rvwBnefInfo);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/selectBORvwBnefInfo",bbsctt),
|
||||
// model,
|
||||
// "mlgAccmlNtc"
|
||||
// );
|
||||
|
||||
// 마이페이지 > 상단 회원 정보 ( 등금, 이름, 마일리지, 쿠폰, 위시리스트, 배송중, 등급산정기준 )
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/mbr/mbr/selectBOMpageInfoInqire",bbsctt),
|
||||
model,
|
||||
"mpageResultMap"
|
||||
);
|
||||
Map<String, Object> content2 = selectBOMpageInfoInqire(vo);
|
||||
model.addAttribute("mpageResultMap", content2);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/mbr/mbr/selectBOMpageInfoInqire",bbsctt),
|
||||
// model,
|
||||
// "mpageResultMap"
|
||||
// );
|
||||
model.addAttribute("vo",bbsctt);
|
||||
return Util.getDeviceType(request)+"/mpage/act/MyRvwRForm";
|
||||
}
|
||||
@@ -174,15 +302,17 @@ public class MyActController {
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectWritngPosblRvwInqire")
|
||||
public String selectWritngPosblRvwInqire(HttpServletRequest request, ModelMap model,RvwVO rvwVO){
|
||||
public String selectWritngPosblRvwInqire(HttpServletRequest request, ModelMap model,BOGnrlbbscttVO rvwVO){
|
||||
rvwVO.setRvwBbscttDv("rvw");
|
||||
rvwVO.setServerDv("sopmal");
|
||||
//BO에서 API 호출
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/selectBOWritPosblRvw",rvwVO),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
Map<String, Object> content = selectBOWritPosblRvw(rvwVO);
|
||||
model.addAttribute("resultMap", content);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/selectBOWritPosblRvw",rvwVO),
|
||||
// model,
|
||||
// "resultMap"
|
||||
// );
|
||||
return Util.getDeviceType(request)+"/mpage/act/WritngPosblRvwR";
|
||||
}
|
||||
/**
|
||||
@@ -191,15 +321,21 @@ public class MyActController {
|
||||
* @return String
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectWritngPosblRvwInqireAjax")
|
||||
public ResponseEntity<?> selectWritngPosblRvwInqireAjax(RvwVO rvwVO){
|
||||
@RequestMapping(value="/selectWritngPosblRvwInqireAjax", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<?> selectWritngPosblRvwInqireAjax(BOGnrlbbscttVO rvwVO){
|
||||
rvwVO.setRvwBbscttDv("rvw");
|
||||
rvwVO.setServerDv("sopmal");
|
||||
//BO에서 API 호출
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/selectBOWritPosblRvw",rvwVO),
|
||||
ReplyFromResrc::getReply
|
||||
|
||||
Map<String, Object> content = selectBOWritPosblRvw(rvwVO);
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
// return responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/selectBOWritPosblRvw",rvwVO),
|
||||
// ReplyFromResrc::getReply
|
||||
// );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -209,16 +345,18 @@ public class MyActController {
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectMyRvwInqire")
|
||||
public String selectMyRvwInqire(HttpServletRequest request, ModelMap model,RvwVO rvwVO){
|
||||
public String selectMyRvwInqire(HttpServletRequest request, ModelMap model,BOGnrlbbscttVO rvwVO){
|
||||
rvwVO.setReqUrl("mpage");
|
||||
rvwVO.setServerDv("sopmal");
|
||||
rvwVO.setUseAt("Y");
|
||||
//BO에서 API 호출
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/selectBOMyRvwListInqire",rvwVO),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
DataMap content = selectBOMyRvwListInqire(rvwVO);
|
||||
model.addAttribute("resultMap", content);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/selectBOMyRvwListInqire",rvwVO),
|
||||
// model,
|
||||
// "resultMap"
|
||||
// );
|
||||
return Util.getDeviceType(request)+"/mpage/act/MyRvwR";
|
||||
}
|
||||
|
||||
@@ -228,16 +366,22 @@ public class MyActController {
|
||||
* @return String
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectMyRvwInqireAjax")
|
||||
public ResponseEntity<?> selectMyRvwInqireAjax(RvwVO rvwVO){
|
||||
@RequestMapping(value="/selectMyRvwInqireAjax", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<?> selectMyRvwInqireAjax(BOGnrlbbscttVO rvwVO){
|
||||
rvwVO.setReqUrl("mpage");
|
||||
rvwVO.setServerDv("sopmal");
|
||||
rvwVO.setUseAt("Y");
|
||||
//BO에서 API 호출
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/selectBOMyRvwListInqire",rvwVO),
|
||||
ReplyFromResrc::getReply
|
||||
|
||||
DataMap content = selectBOMyRvwListInqire(rvwVO);
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
// return responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/selectBOMyRvwListInqire",rvwVO),
|
||||
// ReplyFromResrc::getReply
|
||||
// );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -247,15 +391,18 @@ public class MyActController {
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value = "/selectRvwWritngPopupForm")
|
||||
public String selectRvwWritngPopupForm(HttpServletRequest request, ModelMap model, RvwVO rvwVO){
|
||||
public String selectRvwWritngPopupForm(HttpServletRequest request, ModelMap model, BOGnrlbbscttVO rvwVO){
|
||||
rvwVO.setRvwBbscttDv("rvw");
|
||||
rvwVO.setServerDv("sopmal");
|
||||
//리뷰 등록 가능 여부 true시 등록폼 호출
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/selectBOBbscttRegistPopupForm",rvwVO),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
Map<String, Object> content = selectBOBbscttRegistPopupForm(rvwVO);
|
||||
model.addAttribute("resultMap", content);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/selectBOBbscttRegistPopupForm",rvwVO),
|
||||
// model,
|
||||
// "resultMap"
|
||||
// );
|
||||
|
||||
return Util.getDeviceType(request)+"/mpage/act/RvwWritngPopupC";
|
||||
}
|
||||
@@ -267,15 +414,120 @@ public class MyActController {
|
||||
* @return ResponseEntity
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value = "/deleteRvwBbscttDel", method = RequestMethod.POST)
|
||||
public ResponseEntity<WnbtResponse> deleteRvwBbscttDel(@RequestBody GnrlBbscttVO bbsctt) {
|
||||
@RequestMapping(value = "/deleteRvwBbscttDel", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> deleteRvwBbscttDel(@RequestBody BOGnrlbbscttVO bbsctt) {
|
||||
bbsctt.setServerDv("sopmal");
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if ("01".equals(user.getSysDvCd())) {
|
||||
bbsctt.setSopmalCd(user.getSopmalCd());
|
||||
}
|
||||
|
||||
//BO에서 API 호출
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/updateBOBbscttDel",bbsctt),
|
||||
ReplyFromResrc::getReply
|
||||
// 작성자 정보 추출
|
||||
if (user.getUserInnb() > 0) { //회원 , 관리자
|
||||
bbsctt.setUpdusr(user.getUserInnb());
|
||||
} else { // 비회원
|
||||
bbsctt.setUpdusr(0);
|
||||
}
|
||||
|
||||
Map<String, Object> content = new HashMap<>();
|
||||
|
||||
/*게시글 삭제*/
|
||||
DataMap bbscttDelResult = service.updateBOBbscttDel(bbsctt);
|
||||
content.put("result", bbscttDelResult);
|
||||
/*삭제 성공 시*/
|
||||
if ("success".equals(bbscttDelResult.get("result"))) {
|
||||
//리뷰 관련 처리
|
||||
if ("06".equals(bbsctt.getBbsTyCd()) || "07".equals(bbsctt.getBbsTyCd())) {
|
||||
if (!CollectionUtils.isEmpty(bbsctt.getDelInfoArr())) {
|
||||
/*해당 정보로 마일리지 금액 조회하기*/
|
||||
List<Object> accmlmnyAmtInfoArr = new ArrayList<>();
|
||||
BOMlgVO mlgVo = new BOMlgVO();
|
||||
for (BODelInfoVO delInfo : bbsctt.getDelInfoArr()) {
|
||||
if ("01".equals(delInfo.getRegusrDvCd())) {
|
||||
if ("03".equals(user.getSysDvCd())) { //관리자 삭제시 마일리지 회수
|
||||
/*공통 파라미터*/
|
||||
mlgVo.setMbrInnb(String.valueOf(delInfo.getRegusr()));
|
||||
mlgVo.setMbrDvCd(delInfo.getMbrDvCd());
|
||||
mlgVo.setSopmalCd(bbsctt.getSopmalCd());
|
||||
mlgVo.setBbscttInnb(BigInteger.valueOf(delInfo.getBbscttInnb()));
|
||||
mlgVo.setMlgApplcDvCd("06");
|
||||
mlgVo.setMlgApplcResn("[회수]리뷰(구매후기) 삭제에 의한 마일리지 차감");
|
||||
mlgVo.setRegusrDvCd("02");
|
||||
mlgVo.setUpdusrDvCd("02");
|
||||
mlgVo.setRegusr(user.getUserInnb());
|
||||
mlgVo.setUpdusr(user.getUserInnb());
|
||||
|
||||
/*마일리지 수동 회수 여부*/
|
||||
if ("N".equals(bbsctt.getMlgPassivRtrvlAt())) { // 선택 삭제시
|
||||
DataMap accmlmnyAmtInfo = new DataMap();
|
||||
accmlmnyAmtInfo = mlgService.selectBOMlgByBbscttInnb(mlgVo);
|
||||
if (accmlmnyAmtInfo != null) {
|
||||
mlgVo.setMbrInnb(String.valueOf(accmlmnyAmtInfo.get("regusr")));
|
||||
mlgVo.setMbrDvCd((String) accmlmnyAmtInfo.get("mbrDvCd"));
|
||||
mlgVo.setSopmalCd((String) accmlmnyAmtInfo.get("sopmalCd"));
|
||||
mlgVo.setBbscttInnb((BigInteger) accmlmnyAmtInfo.get("bbscttInnb"));
|
||||
mlgVo.setAccmlmnyAmt((BigDecimal) accmlmnyAmtInfo.get("accmlmnyAmt"));
|
||||
mlgService.insertBOMngrMlgDn(mlgVo);
|
||||
}
|
||||
} else { //단독 삭제시*/
|
||||
if (delInfo.getRtrvlMlgAmt() != null) {
|
||||
if (delInfo.getRtrvlMlgAmt().compareTo(BigDecimal.valueOf(0)) > 0) {
|
||||
mlgVo.setAccmlmnyAmt(delInfo.getRtrvlMlgAmt());
|
||||
mlgService.insertBOMngrMlgDn(mlgVo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//회원 관련
|
||||
if (delInfo.getRegusr() != null) {
|
||||
BOGnrlbbscttVO mbrSite = new BOGnrlbbscttVO();
|
||||
mbrSite.setSopmalCd(bbsctt.getSopmalCd());
|
||||
if ("sopmal".equals(bbsctt.getServerDv())) {
|
||||
mbrSite.setRegusr(user.getUserInnb());
|
||||
mbrSite.setMbrDvCd(user.getMbrDvCd());
|
||||
} else {
|
||||
mbrSite.setRegusr(delInfo.getRegusr());
|
||||
mbrSite.setMbrDvCd(delInfo.getMbrDvCd());
|
||||
}
|
||||
service.updateBORvwWritngCnt(mbrSite);
|
||||
}
|
||||
}
|
||||
|
||||
//상품관련 집계와 회원관련 집계는 관리자혹은 사용자가 모두 삭제 시 처리가 되어야해
|
||||
//상품 관련
|
||||
if (delInfo.getGoodsInnb() != null) {
|
||||
BOGoodsVO goodsVO = new BOGoodsVO();
|
||||
goodsVO.setGoodsInnb(String.valueOf(delInfo.getGoodsInnb()));
|
||||
goodsVO.setSopmalCd(bbsctt.getSopmalCd());
|
||||
/*상품정보 > 상품후기건수 차감*/
|
||||
goodsService.updateRvwRelateSm(goodsVO);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ("05".equals(bbsctt.getBbsTyCd())) {//상품qna는 상품문의 집계만
|
||||
//상품 관련
|
||||
if (!CollectionUtils.isEmpty(bbsctt.getGoodsInnbArr())) {
|
||||
for (String goodsInnb : bbsctt.getGoodsInnbArr()) {
|
||||
BOGoodsVO goodsVO = new BOGoodsVO();
|
||||
goodsVO.setGoodsInnb(goodsInnb);
|
||||
goodsVO.setSopmalCd(bbsctt.getSopmalCd());
|
||||
|
||||
/*상품정보 > 상품후기건수 차감*/
|
||||
goodsService.updateGoodsInqryCnt(goodsVO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
// return responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/updateBOBbscttDel",bbsctt),
|
||||
// ReplyFromResrc::getReply
|
||||
// );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -286,14 +538,263 @@ public class MyActController {
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value = "/selectRvwEasyRegistForm", method = RequestMethod.POST)
|
||||
public String selectRvwEasyRegistForm(@RequestBody RvwVO vo, ModelMap model, HttpServletRequest request) {
|
||||
public String selectRvwEasyRegistForm(@RequestBody BOGnrlbbscttVO vo, ModelMap model, HttpServletRequest request) {
|
||||
vo.setRvwBbscttDv("rvw");
|
||||
//BO에서 API 호출
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/selectBOBbscttRegistPopupForm", vo),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
Map<String, Object> content = selectBOBbscttRegistPopupForm(vo);
|
||||
model.addAttribute("resultMap", content);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/gnrlbbsctt/selectBOBbscttRegistPopupForm", vo),
|
||||
// model,
|
||||
// "resultMap"
|
||||
// );
|
||||
return Util.getDeviceType(request)+"/mpage/act/RvwEasyRegistC";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* bo로직 게시글 목록 조회
|
||||
*
|
||||
*/
|
||||
public DataMap selectBOBbscttListInqire(BOGnrlbbscttVO bbsctt) {
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
|
||||
if ("01".equals(user.getSysDvCd())) {//사용자 조회 일 경우
|
||||
bbsctt.setSopmalCd(user.getSopmalCd());
|
||||
}
|
||||
|
||||
if (!"crm".equals(bbsctt.getReqUrl())) {
|
||||
if (user.getUserInnb() > 0) {
|
||||
bbsctt.setRegusr(user.getUserInnb());
|
||||
if ("sopmal".equals(bbsctt.getServerDv())) {
|
||||
bbsctt.setRegusrDvCd("01");
|
||||
} else {
|
||||
bbsctt.setRegusrDvCd("02");
|
||||
}
|
||||
} else {
|
||||
bbsctt.setRegusr(0);
|
||||
bbsctt.setRegusrDvCd("99");
|
||||
}
|
||||
}
|
||||
// pagination
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(bbsctt.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(bbsctt.getPageUnit());
|
||||
paginationInfo.setPageSize(paginationProperties.getPageSize());
|
||||
|
||||
bbsctt.setPaginationInfo(paginationInfo);
|
||||
bbsctt.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
bbsctt.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
bbsctt.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
// 게시글 목록조회
|
||||
Map<String, Object> resultList = new HashMap<String, Object>();
|
||||
resultList = service.selectBOBbscttListInqire(bbsctt);
|
||||
|
||||
// 게시판 설정 정보 조회
|
||||
BOBbsVO bbsVO = new BOBbsVO();
|
||||
// bbsVO에 쇼핑몰코드, 해당 게시판 set
|
||||
bbsVO.setSopmalCd(bbsctt.getSopmalCd());
|
||||
bbsVO.setBbsId(bbsctt.getBbsId());
|
||||
bbsVO.setBbsTyCd(bbsctt.getBbsTyCd());
|
||||
DataMap bbsInfo = new DataMap();
|
||||
bbsInfo = bbsService.selectBOBbsSetupInfo(bbsVO);
|
||||
DataMap content = new DataMap();
|
||||
|
||||
content.put("bbsInfo", bbsInfo);
|
||||
content.put("bbsctt", bbsctt);
|
||||
content.put("resultList", resultList);
|
||||
content.put("paginationInfo", bbsctt.getPaginationInfo());
|
||||
return content;
|
||||
}
|
||||
|
||||
/**
|
||||
* bo로직 사이트 메인페이지 등급, 마일리지, 쿠폰, 위시리스트, 배송중 정보 조회
|
||||
*
|
||||
*/
|
||||
public Map<String, Object> selectBOMpageInfoInqire(BOMbrVO vo) {
|
||||
// 사용자 정보 추출 및 적용
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
vo.setMbrInnb(String.valueOf(user.getUserInnb()));
|
||||
vo.setMbrDvCd(user.getMbrDvCd());
|
||||
|
||||
// 상품 옵션 조회
|
||||
Map<String, Object> message = new HashMap<>();
|
||||
message = boMbrService.selectBOMpageInfoInqire(vo);
|
||||
|
||||
BOSiteVO siteVO = new BOSiteVO();
|
||||
siteVO.setSopmalCd(vo.getSopmalCd());
|
||||
siteVO.setCookieValArr(vo.getCookieValArr());
|
||||
|
||||
List<DataMap> recentGoods = null;
|
||||
if (vo.getCookieValArr() != null) {
|
||||
recentGoods = boSiteService.selectBOMainRecentGoods(siteVO);
|
||||
message.put("recentGoods", recentGoods);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* bo로직 작성 가능한 리뷰
|
||||
*
|
||||
*/
|
||||
public Map<String, Object> selectBOWritPosblRvw(BOGnrlbbscttVO bbsctt) {
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
bbsctt.setSopmalCd(user.getSopmalCd());
|
||||
bbsctt.setRegusr(user.getUserInnb());
|
||||
bbsctt.setMbrDvCd(user.getMbrDvCd());
|
||||
// pagination
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(bbsctt.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(bbsctt.getPageUnit());
|
||||
paginationInfo.setPageSize(paginationProperties.getPageSize());
|
||||
|
||||
bbsctt.setPaginationInfo(paginationInfo);
|
||||
bbsctt.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
bbsctt.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
bbsctt.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
List<DataMap> resultList = new ArrayList<>();
|
||||
resultList = service.selectBOWritPosblRvw(bbsctt);
|
||||
|
||||
Map<String, Object> content = new HashMap<>();
|
||||
content.put("bbscttVO", bbsctt);
|
||||
content.put("resultList", resultList);
|
||||
content.put("paginationInfo", bbsctt.getPaginationInfo());
|
||||
return content;
|
||||
}
|
||||
|
||||
/**
|
||||
* bo로직 마이페이지 > 나의 활동 > 나의리뷰 조회
|
||||
*
|
||||
*/
|
||||
public DataMap selectBOMyRvwListInqire(BOGnrlbbscttVO bbsctt) {
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if ("01".equals(user.getSysDvCd())) {
|
||||
bbsctt.setSopmalCd(user.getSopmalCd());
|
||||
}
|
||||
if (!"crm".equals(bbsctt.getReqUrl())) {
|
||||
bbsctt.setRegusr(user.getUserInnb());
|
||||
}
|
||||
// pagination
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(bbsctt.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(bbsctt.getPageUnit());
|
||||
paginationInfo.setPageSize(paginationProperties.getPageSize());
|
||||
|
||||
bbsctt.setPaginationInfo(paginationInfo);
|
||||
bbsctt.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
bbsctt.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
bbsctt.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
// 게시글 목록조회
|
||||
Map<String, Object> resultList = new HashMap<String, Object>();
|
||||
resultList = service.selectBOMyRvwListInqire(bbsctt);
|
||||
|
||||
DataMap content = new DataMap();
|
||||
content.put("bbscttVO", bbsctt);
|
||||
content.put("resultList", resultList);
|
||||
content.put("paginationInfo", bbsctt.getPaginationInfo());
|
||||
return content;
|
||||
}
|
||||
|
||||
/**
|
||||
* 게시글 등록 팝업
|
||||
*/
|
||||
public Map<String, Object> selectBOBbscttRegistPopupForm(BOGnrlbbscttVO bbsctt) {
|
||||
Map<String, Object> content = new HashMap<String, Object>();
|
||||
// 작성자 정보 추출
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
|
||||
if ("01".equals(user.getSysDvCd())) {
|
||||
bbsctt.setSopmalCd(user.getSopmalCd());
|
||||
}
|
||||
;
|
||||
|
||||
BOGnrlbbscttVO regusrInfo = new BOGnrlbbscttVO();
|
||||
DataMap mbrInfo = new DataMap();
|
||||
if (user.getUserInnb() > 0) {
|
||||
bbsctt.setRegusr(user.getUserInnb());
|
||||
if (!"01".equals(user.getSysDvCd())) {
|
||||
bbsctt.setRegusrDvCd("02"); //관리자
|
||||
} else {
|
||||
bbsctt.setRegusrDvCd("01"); //회원
|
||||
bbsctt.setMbrDvCd(user.getMbrDvCd());
|
||||
DataMap mbr = new DataMap();
|
||||
mbr.put("mbrInnb", String.valueOf(bbsctt.getRegusr()));
|
||||
mbr.put("mbrDvCd", bbsctt.getMbrDvCd());
|
||||
mbr.put("secretKey", boCommonService.selectSecretkey());
|
||||
mbr.put("sopmalCd", bbsctt.getSopmalCd());
|
||||
mbrInfo = boMbrService.selectSimpleMbrInfo(mbr);
|
||||
regusrInfo.setAnswMbtlnb((String) mbrInfo.get("mbtlnb"));
|
||||
}
|
||||
regusrInfo.setRegusrNm(user.getMbrNm());
|
||||
regusrInfo.setRegusrId(user.getMbrId());
|
||||
regusrInfo.setRegusr(user.getUserInnb());
|
||||
regusrInfo.setRegusrDvCd(bbsctt.getRegusrDvCd());
|
||||
} else {
|
||||
regusrInfo.setRegusr(0);
|
||||
regusrInfo.setRegusrDvCd("99");//비회원
|
||||
}
|
||||
|
||||
// 게시판 설정 정보
|
||||
BOBbsVO bbsVO = new BOBbsVO();
|
||||
// bbsVO에 쇼핑몰코드, 해당 게시판 set
|
||||
bbsVO.setSopmalCd(bbsctt.getSopmalCd());
|
||||
bbsVO.setBbsId(bbsctt.getBbsId());
|
||||
bbsVO.setBbsTyCd(bbsctt.getBbsTyCd());
|
||||
DataMap bbsInfo = new DataMap();
|
||||
bbsInfo = bbsService.selectBOBbsSetupInfo(bbsVO);
|
||||
|
||||
// 분류
|
||||
List<DataMap> itmList = new ArrayList<>();
|
||||
itmList = service.selectBOBbscttItmInqire(bbsctt);
|
||||
|
||||
//리뷰항목 리스트, 리뷰항목 항목 리스트
|
||||
Map<String, Object> rvwQesitmList = new HashMap<String, Object>();
|
||||
rvwQesitmList = service.selectBOStarItm(bbsctt);
|
||||
|
||||
//추가항목 리스트, 추가항목 항목 리스트
|
||||
Map<String, Object> qesitmList = new HashMap<String, Object>();
|
||||
qesitmList = service.selectBOBbscttRegistPopupForm(bbsctt);
|
||||
|
||||
//사용자 > 리뷰 상품 조회
|
||||
DataMap rvwGoodsInfo = new DataMap();
|
||||
DataMap mlgInfo = new DataMap();
|
||||
if ("sopmal".equals(bbsctt.getServerDv())) {
|
||||
if ("rvw".equals(bbsctt.getRvwBbscttDv())) {
|
||||
rvwGoodsInfo = service.selectBORvwGoods(bbsctt);
|
||||
content.put("rvwGoodsInfo", rvwGoodsInfo);
|
||||
mlgInfo = service.selectBORvwBnefInfo(bbsctt);
|
||||
content.put("mlgInfo", mlgInfo);
|
||||
|
||||
List<DataMap> rvwItmList = new ArrayList<>();
|
||||
List<DataMap> starItmList = new ArrayList<>();
|
||||
//사용자 별표 평점 역으로 리스트 set(퍼블리싱으로 인한 역처리)
|
||||
if (rvwQesitmList.get("starItmCnList") != null) {
|
||||
rvwItmList = (List<DataMap>) rvwQesitmList.get("starItmCnList");
|
||||
for (int i = rvwItmList.size() - 1; i >= 0; i--) {
|
||||
starItmList.add(rvwItmList.get(i));
|
||||
}
|
||||
content.put("starItmList", starItmList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//사용자 > 상품q&a 상품 조회
|
||||
DataMap qnaGoodsInfo = new DataMap();
|
||||
if ("sopmal".equals(bbsctt.getServerDv())) {
|
||||
if ("modal".equals(bbsctt.getReqUrl())) {
|
||||
qnaGoodsInfo = service.selectTargetGoodsInfo(bbsctt);
|
||||
}
|
||||
}
|
||||
content.put("qnaGoodsInfo", qnaGoodsInfo);
|
||||
content.put("regusrInfo", regusrInfo);
|
||||
content.put("bbscttVO", bbsctt);
|
||||
content.put("itmList", itmList);
|
||||
content.put("bbsInfo", bbsInfo);
|
||||
content.put("qesitmList", qesitmList);
|
||||
content.put("rvwQesitmList", rvwQesitmList);
|
||||
return content;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,28 +1,51 @@
|
||||
package com.wb.domainserver.domain.sopmal.nmbr.controller;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.wb.domainserver.common.msg.GconeMessageSource;
|
||||
import com.wb.domainserver.domain.sopmal.nmbr.vo.MyDlivyVO;
|
||||
import com.wb.domainserver.domain.sopmal.nmbr.vo.MyOrdrDlvyVO;
|
||||
import com.wb.domainserver.domain.sopmal.nmbr.vo.MyOrdrVO;
|
||||
import com.wb.domainserver.response.WnbtResponse;
|
||||
import com.wb.domainserver.response.WnbtWebClientResponseHandler;
|
||||
import com.wb.domainserver.security.authorization.annotation.AuthPolicy;
|
||||
import com.wb.domainserver.security.authorization.annotation.Policy;
|
||||
import com.wb.domainserver.util.communicate.RESRC;
|
||||
import com.wb.domainserver.util.communicate.ReplyFromResrc;
|
||||
import com.wb.domainserver.util.communicate.SendToResrc;
|
||||
import com.wb.domainserver.util.util.Util;
|
||||
import com.wb.domainserver.common.msg.GconeMessageSource;
|
||||
import com.wb.domainserver.domain.admin.sys.comncd.service.BOMaComncdService;
|
||||
import com.wb.domainserver.domain.admin.sys.comncd.vo.BOMaComncdVO;
|
||||
import com.wb.domainserver.domain.gcone.common.service.BOCommonService;
|
||||
import com.wb.domainserver.domain.gcone.goods.purchs.vo.BOOrderLogVO;
|
||||
import com.wb.domainserver.domain.gcone.ordr.dlivy.service.BODlivyService;
|
||||
import com.wb.domainserver.domain.gcone.ordr.dlivy.vo.BODlivyUpdtVO;
|
||||
import com.wb.domainserver.domain.gcone.ordr.dlivy.vo.BODlivyVO;
|
||||
import com.wb.domainserver.domain.gcone.ordr.ordr.service.BOOrdrService;
|
||||
import com.wb.domainserver.domain.gcone.ordr.ordr.vo.BOOrdrDlvyVO;
|
||||
import com.wb.domainserver.domain.gcone.ordr.ordr.vo.BOOrdrShippingVO;
|
||||
import com.wb.domainserver.domain.gcone.ordr.ordr.vo.BOOrdrVO;
|
||||
import com.wb.domainserver.domain.gcone.ordr.pay.vo.BOPayVO;
|
||||
import com.wb.domainserver.domain.gcone.ordr.rtngudrefnd.service.BORtngudrefndService;
|
||||
import com.wb.domainserver.domain.gcone.ordr.rtngudrefnd.vo.BORtngudrefndVO;
|
||||
import com.wb.domainserver.domain.gcone.ordr.selngpruf.service.BOSelngprufService;
|
||||
import com.wb.domainserver.domain.gcone.ordr.selngpruf.vo.BOSelngprufVO;
|
||||
import com.wb.domainserver.domain.gcone.setup.dlvygrp.service.BODlvygrpService;
|
||||
import com.wb.domainserver.domain.gcone.setup.nbkk.service.BONbkkService;
|
||||
import com.wb.domainserver.domain.gcone.setup.nbkk.vo.BOSetupNbkkVO;
|
||||
import com.wb.domainserver.exception.WnbtRestException;
|
||||
import com.wb.domainserver.response.WnbtResponse;
|
||||
import com.wb.domainserver.response.WnbtResponseBody;
|
||||
import com.wb.domainserver.response.WnbtWebClientResponseHandler;
|
||||
import com.wb.domainserver.security.authentication.AnonymousUser;
|
||||
import com.wb.domainserver.security.authentication.MemberJwtContextHolder;
|
||||
import com.wb.domainserver.security.authorization.annotation.AuthPolicy;
|
||||
import com.wb.domainserver.security.authorization.annotation.Policy;
|
||||
import com.wb.domainserver.util.communicate.SendToResrc;
|
||||
import com.wb.domainserver.util.dataaccess.DataMap;
|
||||
import com.wb.domainserver.util.util.Util;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/sopmal/nmbr/ordr")
|
||||
@@ -38,19 +61,75 @@ public class MyOrdrNmbrController {
|
||||
@Autowired
|
||||
private GconeMessageSource gconeMessageSource;
|
||||
|
||||
@Autowired
|
||||
private BOOrdrService service;
|
||||
@Autowired
|
||||
private BOMaComncdService bOMaComncdService;
|
||||
@Autowired
|
||||
private BONbkkService nbkkService;
|
||||
@Autowired
|
||||
private BOCommonService commonService;
|
||||
@Autowired
|
||||
private BODlvygrpService dlvyGroupService;
|
||||
@Autowired
|
||||
private BODlivyService dlivyService;
|
||||
@Autowired
|
||||
private BOSelngprufService boSelngprufService;
|
||||
@Autowired
|
||||
private BORtngudrefndService boRtngudrefndService;
|
||||
|
||||
|
||||
/**
|
||||
* 비회원 주문 상세 조회 > 주문 취소 상태 수정
|
||||
* @param ordrDlvyVO
|
||||
* @return ResponseEntity<WnbtResponse>
|
||||
* @throws JsonProcessingException
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/updateCanclOrdr")
|
||||
public ResponseEntity<WnbtResponse> updateCanclOrdr(MyOrdrDlvyVO ordrDlvyVO) throws JsonProcessingException {
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/ordr/updateBOCanclOrdr", ordrDlvyVO),
|
||||
ReplyFromResrc::getReply
|
||||
@RequestMapping(value="/updateCanclOrdr", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> updateCanclOrdr(BOOrdrDlvyVO ordrDlvyVO) {
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
BOPayVO payVO = new BOPayVO();
|
||||
//주문 취소 상태 수정
|
||||
// Map<String, Object> message = service.updateCanclOrdr(ordrDlvyVO);
|
||||
Map<String, Object> message = new HashMap<>(); {{
|
||||
message.put("status", "0");
|
||||
message.put("message", "");
|
||||
}};
|
||||
|
||||
try {
|
||||
BOOrdrVO ordrVO = new BOOrdrVO();
|
||||
String[] ordrInnbs = {ordrDlvyVO.getOrdrInnb()};
|
||||
ordrVO.setSopmalCd(ordrDlvyVO.getSopmalCd()); // 쇼핑몰코드
|
||||
ordrVO.setOrdrInnbs(ordrInnbs); // 주문고유번호
|
||||
ordrVO.setOrdrSttusCd("95"); // 상태코드
|
||||
ordrVO.setMbrDvCd(user.getMbrDvCd());;
|
||||
ordrVO.setOrdrrNm(user.getMbrNm());;
|
||||
ordrVO.setCurrOrdrSttusCd(ordrDlvyVO.getCurrOrdrSttusCd());
|
||||
service.updateOrdrSttusCd(ordrVO);
|
||||
} catch (Exception e) {
|
||||
message.put("status", "1");
|
||||
message.put("message", "주문 취소를 실패하였습니다");
|
||||
};
|
||||
|
||||
// 회원 사이트정보 갱신
|
||||
try {
|
||||
payVO.setSopmalCd(user.getSopmalCd());
|
||||
payVO.setMbrInnb(String.valueOf(user.getUserInnb()));
|
||||
payVO.setMbrDvCd(user.getMbrDvCd());
|
||||
service.updateMbrSiteUpdtOrdrRefund(payVO);
|
||||
} catch (Exception e) {
|
||||
log.error("회원 사이트정보 갱신 실패!");
|
||||
}
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(message))
|
||||
.build()
|
||||
);
|
||||
// return responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/ordr/updateBOCanclOrdr", ordrDlvyVO),
|
||||
// ReplyFromResrc::getReply
|
||||
// );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,27 +139,81 @@ public class MyOrdrNmbrController {
|
||||
* @throws JsonProcessingException
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/updatePurchsDcsnByItem")
|
||||
public ResponseEntity<WnbtResponse> updatePurchsDcsnByItem(MyOrdrVO ordrVO) throws JsonProcessingException {
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/ordr/updatePurchsDcsnByItem", ordrVO),
|
||||
ReplyFromResrc::getReply
|
||||
@RequestMapping(value="/updatePurchsDcsnByItem", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> updatePurchsDcsnByItem(BOOrdrVO ordrVO) throws JsonProcessingException {
|
||||
Map<String, Object> content = new HashMap<>() {{
|
||||
put("status", "0");
|
||||
put("message", "구매확정을 완료 하였습니다.");
|
||||
}};
|
||||
|
||||
BODlivyUpdtVO boDlivyVO = new BODlivyUpdtVO();
|
||||
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if ("01".equals(user.getSysDvCd())) {
|
||||
boDlivyVO.setSopmalCd(user.getSopmalCd());
|
||||
}
|
||||
boDlivyVO.setRegusr(user.getUserInnb()); // 등록자
|
||||
boDlivyVO.setUpdusr(user.getUserInnb()); // 수정자
|
||||
boDlivyVO.setOpetrNm(user.getMbrNm()); // 처리자 명
|
||||
boDlivyVO.setMbrDvCd(user.getMbrDvCd()); // 회원 구분
|
||||
boDlivyVO.setMbrInnb(String.valueOf(user.getUserInnb())); // 회원 고유번호
|
||||
|
||||
try {
|
||||
boDlivyVO.setOrdrGoodsOptnInnb(ordrVO.getOrdrGoodsOptnInnb());
|
||||
boDlivyVO.setOptnTy(ordrVO.getOptnTy());
|
||||
boDlivyVO.setOrdrInnb(ordrVO.getOrdrInnb());
|
||||
|
||||
dlivyService.updateBOPurchsDcsnSttusUpdt(boDlivyVO);
|
||||
} catch (WnbtRestException wre) {
|
||||
content = new HashMap<>() {{
|
||||
put("status", "1");
|
||||
put("message", wre.getMessage());
|
||||
}};
|
||||
} catch (Exception e) {
|
||||
|
||||
|
||||
content = new HashMap<>() {{
|
||||
put("status", "1");
|
||||
put("message", "구매확정을 실패하였습니다.\n관리자에게 문의하시기 바랍니다.");
|
||||
}};
|
||||
}
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
// return responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/ordr/updatePurchsDcsnByItem", ordrVO),
|
||||
// ReplyFromResrc::getReply
|
||||
// );
|
||||
}
|
||||
|
||||
/**
|
||||
* 비회원 주문 상세 조회 > 배송지 조회
|
||||
* @param param
|
||||
* @param vo
|
||||
* @return ResponseEntity<WnbtResponse>
|
||||
* @throws JsonProcessingException
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectOrdrDlvylc")
|
||||
public ResponseEntity<WnbtResponse> selectOrdrDlvylc(MyOrdrDlvyVO ordrDlvyVO){
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/ordr/selectBOOrdrDlvylc", ordrDlvyVO),
|
||||
ReplyFromResrc::getReply
|
||||
@RequestMapping(value="/selectOrdrDlvylc", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> selectOrdrDlvylc(BOOrdrShippingVO vo){
|
||||
Map<String, Object> content = new HashMap<>();
|
||||
String secretKey = null;
|
||||
secretKey = commonService.selectSecretkey();
|
||||
vo.setSecretKey(secretKey);
|
||||
content.put("dlvyInfo", service.selectBOOrdrDlvylc(vo));
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
// return responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/ordr/selectBOOrdrDlvylc", ordrDlvyVO),
|
||||
// ReplyFromResrc::getReply
|
||||
// );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -90,17 +223,51 @@ public class MyOrdrNmbrController {
|
||||
* @throws JsonProcessingException
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/updateDlvylc")
|
||||
public ResponseEntity<WnbtResponse> updateDlvylc(MyOrdrDlvyVO ordrDlvyVO){
|
||||
if("01".equals(ordrDlvyVO.getDlvylcAdresDvCd())){//주소구분에 따라 지번,도로명주소 set
|
||||
ordrDlvyVO.setDlvylcRnmAdres(ordrDlvyVO.getAdres());
|
||||
}else{
|
||||
ordrDlvyVO.setDlvylcLnbAdres(ordrDlvyVO.getAdres());
|
||||
}
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/ordr/updateBODlvylc", ordrDlvyVO),
|
||||
ReplyFromResrc::getReply
|
||||
@RequestMapping(value="/updateDlvylc", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> updateDlvylc(DataMap param){
|
||||
if("01".equals(param.get("dlvylcAdresDvCd"))){//주소구분에 따라 지번,도로명주소 set
|
||||
param.put("dlvylcRnmAdres", param.get("adres"));
|
||||
}else{
|
||||
param.put("dlvylcLnbAdres", param.get("adres"));
|
||||
}
|
||||
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
param.put("mbrInnb", user.getUserInnb());
|
||||
param.put("mbrDvCd", user.getMbrDvCd());
|
||||
if ("01".equals(user.getSysDvCd())) {
|
||||
param.put("sopmalCd", user.getSopmalCd());
|
||||
}
|
||||
Map<String, Object> message = service.updateDlvylc(param);
|
||||
|
||||
// 배송지 정보 변경 주문 로그
|
||||
BOOrderLogVO logVO = new BOOrderLogVO();
|
||||
logVO.setOrdrInnb(BigInteger.valueOf(Long.valueOf((String) param.get("ordrInnb"))));
|
||||
logVO.setSopmalCd((String) param.get("sopmalCd"));
|
||||
if ("0".equals(message.get("status"))) {
|
||||
logVO.setLogSj("배송지 정보 변경");
|
||||
logVO.setLogDtlCn("배송지 정보 변경을 처리하였습니다.");
|
||||
} else {
|
||||
logVO.setLogSj("배송지 정보 변경 실패");
|
||||
logVO.setLogDtlCn("배송지 정보 변경을 실패하였습니다.");
|
||||
}
|
||||
logVO.setLogDvCd("02");
|
||||
if ("01".equals(user.getSysDvCd())) {
|
||||
logVO.setDvCd("01");
|
||||
} else {
|
||||
logVO.setDvCd("02");
|
||||
}
|
||||
logVO.setOpetrNm(user.getMbrNm());
|
||||
service.updateDlvylcInfoLogRegist(logVO);
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(message))
|
||||
.build()
|
||||
);
|
||||
// return responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/ordr/updateBODlvylc", ordrDlvyVO),
|
||||
// ReplyFromResrc::getReply
|
||||
// );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,12 +276,14 @@ public class MyOrdrNmbrController {
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectSetleCanclPopupForm")
|
||||
public String selectSetleCanclPopupForm(HttpServletRequest request,ModelMap model, MyOrdrDlvyVO ordrDlvyVO) {
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/ordr/selectBOSetleCanclRefndRegist", ordrDlvyVO),
|
||||
model,
|
||||
"data"
|
||||
);
|
||||
public String selectSetleCanclPopupForm(HttpServletRequest request,ModelMap model, BOOrdrVO ordrVO) {
|
||||
Map<String, Object> content = selectBOSetleCanclRefndRegist(ordrVO);
|
||||
model.addAttribute("data", content);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/ordr/selectBOSetleCanclRefndRegist", ordrDlvyVO),
|
||||
// model,
|
||||
// "data"
|
||||
// );
|
||||
|
||||
return Util.getDeviceType(request) + "/mpage/ordr/OrdrSetleCanclPopup";
|
||||
}
|
||||
@@ -123,15 +292,47 @@ public class MyOrdrNmbrController {
|
||||
* 비회원 주문 상세 조회 > 결제취소 등록
|
||||
* @param param
|
||||
* @return ResponseEntity<WnbtResponse>
|
||||
* @throws JsonProcessingException
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/insertSetleCanclRegist")
|
||||
public ResponseEntity<WnbtResponse> registSetleCancl(@RequestBody HashMap<String, Object> param) throws JsonProcessingException {
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/ordr/insertBOSetleCanclRegist", param),
|
||||
ReplyFromResrc::getReply
|
||||
@RequestMapping(value="/insertSetleCanclRegist", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> registSetleCancl(@RequestBody DataMap param) {
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if ("01".equals(user.getSysDvCd())) {
|
||||
param.put("sopmalCd", user.getSopmalCd());
|
||||
param.put("mbrInnb", user.getUserInnb());
|
||||
} else {
|
||||
param.put("mngrInnb", user.getUserInnb());
|
||||
}
|
||||
param.put("updusr", user.getUserInnb());
|
||||
param.put("mbrDvCd", user.getMbrDvCd());
|
||||
param.put("userName", user.getMbrNm());
|
||||
param.put("mbrNm", user.getMbrNm());
|
||||
|
||||
|
||||
log.debug("반품신청 테스트 param 확인 : {}", param);
|
||||
Map<String, Object> message = service.insertSetleCanclRegist(param);
|
||||
|
||||
// 회원 사이트정보 갱신 ==============================================================
|
||||
try {
|
||||
BOPayVO payVO = new BOPayVO();
|
||||
payVO.setSopmalCd(user.getSopmalCd());
|
||||
payVO.setMbrInnb(String.valueOf(user.getUserInnb()));
|
||||
payVO.setMbrDvCd(user.getMbrDvCd());
|
||||
service.updateMbrSiteUpdtOrdrRefund(payVO);
|
||||
} catch (Exception e) {
|
||||
/*주문은 성공처리를 위해 throw하지 않음*/
|
||||
log.error("회원 사이트정보 갱신 실패!");
|
||||
}
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(message))
|
||||
.build()
|
||||
);
|
||||
// return responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/ordr/insertBOSetleCanclRegist", param),
|
||||
// ReplyFromResrc::getReply
|
||||
// );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -140,12 +341,22 @@ public class MyOrdrNmbrController {
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectDlvyInqire")
|
||||
public String selectDlvyInqire(MyDlivyVO dlivyVO, ModelMap model, HttpServletRequest request){
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/dlivy/selectBOOrdrDlvyDtlsInqire", dlivyVO),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
public String selectDlvyInqire(BODlivyVO boDlivyVO, ModelMap model, HttpServletRequest request){
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
boDlivyVO.setSopmalCd(user.getSopmalCd()); // 쇼핑몰 코드
|
||||
}
|
||||
|
||||
Map<String, Object> content = new HashMap<>();
|
||||
content = dlivyService.selectBOOrdrDlvyDtlsInqire(boDlivyVO);
|
||||
|
||||
model.addAttribute("resultMap", content);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/dlivy/selectBOOrdrDlvyDtlsInqire", dlivyVO),
|
||||
// model,
|
||||
// "resultMap"
|
||||
// );
|
||||
|
||||
return Util.getDeviceType(request) + "/mpage/ordr/DlvyInqireR";
|
||||
}
|
||||
@@ -157,12 +368,14 @@ public class MyOrdrNmbrController {
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectRetrunRegistPopupForm")
|
||||
public String selectRetrunRegistPopupForm(HttpServletRequest request,ModelMap model, MyOrdrDlvyVO ordrDlvyVO) {
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/ordr/selectBOSetleCanclRefndRegist", ordrDlvyVO),
|
||||
model,
|
||||
"data"
|
||||
);
|
||||
public String selectRetrunRegistPopupForm(HttpServletRequest request,ModelMap model, BOOrdrVO ordrVO) {
|
||||
Map<String, Object> content = selectBOSetleCanclRefndRegist(ordrVO);
|
||||
model.addAttribute("data", content);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/ordr/selectBOSetleCanclRefndRegist", ordrDlvyVO),
|
||||
// model,
|
||||
// "data"
|
||||
// );
|
||||
return Util.getDeviceType(request) + "/mpage/ordr/RefundRegistPopupC";
|
||||
}
|
||||
|
||||
@@ -172,23 +385,127 @@ public class MyOrdrNmbrController {
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/updateCashReceipt")
|
||||
public ResponseEntity<WnbtResponse> updateCashReceipt (MyOrdrVO vo){
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/selngpruf/updateCashReceipt", vo),
|
||||
ReplyFromResrc::getReply
|
||||
@RequestMapping(value="/updateCashReceipt", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> updateCashReceipt (BOSelngprufVO vo){
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
}
|
||||
Map<String, Object> message = boSelngprufService.updateCashReceipt(vo);
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(message))
|
||||
.build()
|
||||
);
|
||||
// return responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/selngpruf/updateCashReceipt", vo),
|
||||
// ReplyFromResrc::getReply
|
||||
// );
|
||||
}
|
||||
/**
|
||||
* 비회원 반품/환불 상세 조회 > 반품 취소 환불 정보 수정
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/updateRtngudCanclRefndUpdt")
|
||||
public ResponseEntity<WnbtResponse> updateRtngudCanclRefndUpdt( com.wb.domainserver.domain.sopmal.mpage.ordr.vo.MyRefundVO refundVO, ModelMap model){
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/Rtngudrefnd/updateBOOrderReUpdt", refundVO),
|
||||
ReplyFromResrc::getReply
|
||||
@RequestMapping(value="/updateRtngudCanclRefndUpdt", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> updateRtngudCanclRefndUpdt(BORtngudrefndVO boRtngudrefndVO, ModelMap model){
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
boRtngudrefndVO.setSopmalCd(user.getSopmalCd()); // 쇼핑몰코드
|
||||
}
|
||||
boRtngudrefndVO.setRegusr(user.getUserInnb()); // 등록자
|
||||
boRtngudrefndVO.setUpdusr(user.getUserInnb()); // 수정자
|
||||
boRtngudrefndVO.setMbrDvCd(user.getMbrDvCd()); // 회원 구문 코드
|
||||
boRtngudrefndVO.setMbrNm(user.getMbrNm()); // 회원 명
|
||||
log.debug("넘겨받은 파라미터 확인 : {}", boRtngudrefndVO);
|
||||
// 반품 환불 수정
|
||||
Map<String, Object> message = new HashMap<>();
|
||||
|
||||
message = boRtngudrefndService.updateBOOrderReUpdt(boRtngudrefndVO);
|
||||
log.debug("환불 저장 컨트롤러 message : {}", message);
|
||||
// 10. 회원 사이트정보 갱신 ==============================================================
|
||||
try {
|
||||
BOPayVO payVO = new BOPayVO();
|
||||
if ("01".equals(user.getSysDvCd())) {
|
||||
payVO.setSopmalCd(user.getSopmalCd());
|
||||
payVO.setMbrInnb(String.valueOf(user.getUserInnb()));
|
||||
payVO.setMbrDvCd(user.getMbrDvCd());
|
||||
}else{
|
||||
payVO.setSopmalCd(String.valueOf(boRtngudrefndVO.getSopmalCd()));
|
||||
payVO.setMbrInnb(String.valueOf(boRtngudrefndVO.getSiteMbrInnb()));
|
||||
payVO.setMbrDvCd(String.valueOf(boRtngudrefndVO.getSiteMbrDvCd()));
|
||||
}
|
||||
service.updateMbrSiteUpdtOrdrRefund(payVO);
|
||||
} catch (Exception e) {
|
||||
log.error("회원 사이트정보 갱신 실패!");
|
||||
}
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(message))
|
||||
.build()
|
||||
);
|
||||
// return responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/Rtngudrefnd/updateBOOrderReUpdt", refundVO),
|
||||
// ReplyFromResrc::getReply
|
||||
// );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* bo로직 관리자 > 주문 > 주문관리 > 전체 주문 조회 > 전체주문상세 조회 > 결제취소/환불신청 정보 조회
|
||||
*/
|
||||
public Map<String, Object> selectBOSetleCanclRefndRegist(BOOrdrVO ordrVO) {
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if ("01".equals(user.getSysDvCd())) {
|
||||
ordrVO.setSopmalCd(user.getSopmalCd());
|
||||
ordrVO.setSysDvCd("S"); // 쇼핑몰
|
||||
} else {
|
||||
ordrVO.setSysDvCd("A"); // 관리자
|
||||
}
|
||||
|
||||
Map<String, Object> content = service.selectBOSetleCanclRefndRegist(ordrVO);
|
||||
content.put("mbrInnb", user.getUserInnb());
|
||||
|
||||
// 공통코드 호출
|
||||
BOMaComncdVO bOMaComncdVO = new BOMaComncdVO();
|
||||
bOMaComncdVO.setGroupCd("KCP_BANK_CD"); // KCP은행코드
|
||||
List<?> kcpBankCdList = bOMaComncdService.selectBOCommcdDetailList(bOMaComncdVO);
|
||||
|
||||
bOMaComncdVO.setGroupCd("TOSS_BANK_CD"); // TOSS은행코드
|
||||
List<?> toosBankCdList = bOMaComncdService.selectBOCommcdDetailList(bOMaComncdVO);
|
||||
|
||||
DataMap order = (DataMap) content.get("order"); // TODO : ( 2024-08-22 ) 통장 코드 환불 선택해서 입력 Npay , 에스크로, 페이코 고려되어있지않음 확인시 수정 필요
|
||||
log.debug("order : {} ", order);
|
||||
if (order != null && ("gcpay".equals(order.get("pgCmpnyNm")) || "toss".equals(order.get("pgCmpnyNm")) || "tosspay".equals(order.get("pgCmpnyNm")))) {
|
||||
content.put("bankCdList", toosBankCdList);
|
||||
} else if (order != null && ("kcp".equals(order.get("pgCmpnyNm")))) {
|
||||
content.put("bankCdList", kcpBankCdList);
|
||||
} else {
|
||||
content.put("bankCdList", toosBankCdList);
|
||||
}
|
||||
|
||||
|
||||
// 무통장 계좌 정보
|
||||
BOSetupNbkkVO boShopSetupVO = new BOSetupNbkkVO();
|
||||
boShopSetupVO.setSopmalCd(ordrVO.getSopmalCd());
|
||||
boShopSetupVO.setUseAt("Y");
|
||||
Map<String, Object> setupJson = nbkkService.selectBOSopmalSetupList(boShopSetupVO);
|
||||
List<Object> sopmalSetupVO = (List<Object>) setupJson.get("refundAcntSetup");
|
||||
log.debug("반품 배송비 계좌 json : {}", sopmalSetupVO);
|
||||
|
||||
content.put("bankAccount", sopmalSetupVO);
|
||||
|
||||
DataMap returnDataMap = new DataMap();
|
||||
returnDataMap = dlvyGroupService.selectBOReturnAddressInqire(ordrVO);
|
||||
|
||||
String returnAddress = "";
|
||||
returnAddress = returnDataMap.get("rtnlcAdres") + " " + returnDataMap.get("rtnlcDtlAdres");
|
||||
content.put("returnAddress", returnAddress);
|
||||
log.debug("반송지 : {}", content.get("returnAddress"));
|
||||
|
||||
return content;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,27 @@
|
||||
package com.wb.domainserver.domain.sopmal.npay.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.wb.domainserver.util.util.Util;
|
||||
import com.wb.domainserver.domain.admin.store.sopmal.service.BOMaSopmalService;
|
||||
import com.wb.domainserver.domain.gcone.goods.goods.mapper.BOGoodsMapper;
|
||||
import com.wb.domainserver.domain.gcone.goods.goods.service.BOGoodsService;
|
||||
import com.wb.domainserver.domain.gcone.goods.goods.vo.BOGoodsVO;
|
||||
import com.wb.domainserver.domain.gcone.ordr.npay.service.*;
|
||||
import com.wb.domainserver.domain.gcone.ordr.npay.vo.BOIfLogVO;
|
||||
import com.wb.domainserver.domain.gcone.ordr.npay.vo.BONpayConfigVO;
|
||||
import com.wb.domainserver.domain.gcone.ordr.npay.vo.ItemStack;
|
||||
import com.wb.domainserver.domain.gcone.ordr.npay.vo.NpayZzim;
|
||||
import com.wb.domainserver.domain.sopmal.ordr.vo.SpbkVO;
|
||||
import com.wb.domainserver.response.WnbtResponse;
|
||||
import com.wb.domainserver.response.WnbtResponseBody;
|
||||
import com.wb.domainserver.response.WnbtWebClientResponseHandler;
|
||||
import com.wb.domainserver.security.authentication.AnonymousUser;
|
||||
import com.wb.domainserver.security.authentication.MemberJwtContextHolder;
|
||||
import com.wb.domainserver.security.authorization.annotation.AuthPolicy;
|
||||
import com.wb.domainserver.security.authorization.annotation.Policy;
|
||||
import com.wb.domainserver.util.communicate.SendToResrc;
|
||||
import com.wb.domainserver.util.dataaccess.DataMap;
|
||||
import com.wb.domainserver.util.util.Util;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
@@ -18,20 +34,10 @@ import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.reactive.function.client.WebClient;
|
||||
|
||||
import com.wb.domainserver.domain.sopmal.ordr.vo.SpbkVO;
|
||||
import com.wb.domainserver.response.WnbtResponse;
|
||||
import com.wb.domainserver.response.WnbtWebClientResponseHandler;
|
||||
import com.wb.domainserver.security.authentication.AnonymousUser;
|
||||
import com.wb.domainserver.security.authentication.MemberJwtContextHolder;
|
||||
import com.wb.domainserver.security.authorization.annotation.AuthPolicy;
|
||||
import com.wb.domainserver.security.authorization.annotation.Policy;
|
||||
import com.wb.domainserver.util.communicate.RESRC;
|
||||
import com.wb.domainserver.util.communicate.ReplyFromResrc;
|
||||
import com.wb.domainserver.util.communicate.SendToResrc;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 샘플 Controller
|
||||
@@ -72,12 +78,45 @@ public class NPayController {
|
||||
@Value("${naverpay.order.real-mobile-Url}")
|
||||
String orderMobileRealUrl;
|
||||
|
||||
@Value("${naverpay.zzim.test-url}")
|
||||
String zzimTestUrl;
|
||||
|
||||
@Value("${naverpay.zzim.test-url}")
|
||||
String zzimRealUrl;
|
||||
|
||||
@Value("${host.img}")
|
||||
String imgUrl;
|
||||
|
||||
@Autowired
|
||||
private BoOrderXmlService orderXmlservice;
|
||||
|
||||
@Autowired
|
||||
private BoProductXmlService productXmlService;
|
||||
|
||||
@Autowired
|
||||
private BOGoodsService goodsService;
|
||||
|
||||
@Autowired
|
||||
private BoIfLogService boIfLogService;
|
||||
|
||||
@Autowired
|
||||
private BONpayConfigService bONpayConfigService;
|
||||
|
||||
@Autowired
|
||||
private BOGoodsMapper mapper;
|
||||
|
||||
@Autowired
|
||||
private BoApiService boApiService;
|
||||
|
||||
@Autowired
|
||||
BOMaSopmalService bOMaSopmalService;
|
||||
|
||||
/**
|
||||
* 구매정보 연동(네이버페이 버튼 클릭시 동작)
|
||||
* 주문정보등록 -> 네이버페이 주문서페이지 redirect
|
||||
*
|
||||
* @param model
|
||||
* @param benefitVO
|
||||
* @param map
|
||||
* @return String
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@@ -117,10 +156,70 @@ public class NPayController {
|
||||
map.put("products", products);
|
||||
|
||||
log.debug("sending map info > " + map.toString());
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/send",map)
|
||||
);
|
||||
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
String orderXml = "";
|
||||
String status = "";
|
||||
String response = "";
|
||||
|
||||
try {
|
||||
log.debug("bo Controller receive map info > " + map.toString());
|
||||
|
||||
resultMap.put("status", "success!!");
|
||||
|
||||
orderXml = orderXmlservice.createOrderXml(map, request);
|
||||
log.debug("작성된 ORDER XML result > " + orderXml);
|
||||
|
||||
//GC_NPAY_CONFIG에서 npay정보 가져오기
|
||||
BONpayConfigVO param = new BONpayConfigVO();
|
||||
param.setSopmalCd(map.get("sopmalCd").toString());
|
||||
DataMap detail = bONpayConfigService.loadNpayConfigDetail(param);
|
||||
BONpayConfigVO rvo = (BONpayConfigVO) detail.get("npayConfigDetail");
|
||||
|
||||
// webClient 기본 설정
|
||||
String orderUrl;
|
||||
if("TEST".equals(rvo.getEnvrn())){
|
||||
orderUrl = orderTestUrl;
|
||||
}else{
|
||||
orderUrl = orderRealUrl;
|
||||
}
|
||||
WebClient webClient = WebClient.builder().baseUrl(orderUrl).build();
|
||||
|
||||
// naver pay api 요청
|
||||
response =
|
||||
webClient.post().uri(
|
||||
uriBuilder -> uriBuilder.path("o/customer/api/order/v20/register").build())
|
||||
.contentType(MediaType.APPLICATION_XML)
|
||||
//.accept(MediaType.APPLICATION_XML)
|
||||
.bodyValue(orderXml)
|
||||
.retrieve().bodyToMono(String.class).block();
|
||||
|
||||
status = "SUCCESS";
|
||||
|
||||
System.out.println("result > " + response);
|
||||
resultMap.put("status", "success!!");
|
||||
resultMap.put("result", response);
|
||||
}catch(Exception e) {
|
||||
System.out.println("에러 e.getMessage() 출력 > " + e.getMessage());
|
||||
response = e.getMessage();
|
||||
status = "FAIL";
|
||||
}finally {
|
||||
|
||||
log.debug("map.toString() > " + map.toString());
|
||||
|
||||
// logging 수행
|
||||
BOIfLogVO vo = new BOIfLogVO();
|
||||
vo.setSopmalCd(map.get("sopmalCd").toString());
|
||||
vo.setIfKndCd("order");
|
||||
vo.setSendParam(orderXml);
|
||||
vo.setReceiveParam(response);
|
||||
vo.setIfSttusCd(status);
|
||||
boIfLogService.insertBoIfLog(vo);
|
||||
}
|
||||
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/send",map)
|
||||
// );
|
||||
|
||||
//agent 정보
|
||||
String userAgent = request.getHeader("User-Agent");
|
||||
@@ -135,11 +234,17 @@ public class NPayController {
|
||||
log.debug("currentUrl.toString() > " + currentUrl.toString());
|
||||
|
||||
//GC_NPAY_CONFIG에서 npay정보 가져오기
|
||||
Map<String, Object> param = new HashMap<String, Object>();
|
||||
param.put("sopmalCd", user.getSopmalCd());
|
||||
Map<String,Object> naverKey = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofGetWithParam(RESRC.GCONEBO, "/gcone/ordr/npay/config/loadNpayConfigDetail", param)
|
||||
);
|
||||
BONpayConfigVO vo = new BONpayConfigVO();
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
// Map<String, Object> param = new HashMap<String, Object>();
|
||||
// param.put("sopmalCd", user.getSopmalCd());
|
||||
DataMap naverKey = new DataMap();
|
||||
naverKey = bONpayConfigService.loadNpayConfigDetail(vo);
|
||||
naverKey.put("naverPayYn", bOMaSopmalService.selectBONpayUseAtByShop(vo.getSopmalCd()));
|
||||
// Map<String,Object> naverKey = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofGetWithParam(RESRC.GCONEBO, "/gcone/ordr/npay/config/loadNpayConfigDetail", param)
|
||||
// );
|
||||
|
||||
Map<String,Object> naverMap = (Map<String, Object>) naverKey.get("npayConfigDetail");
|
||||
|
||||
// 환경정보
|
||||
@@ -180,12 +285,94 @@ public class NPayController {
|
||||
}
|
||||
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/zzim")
|
||||
@RequestMapping(value="/zzim", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> zzim(HttpServletRequest request, ModelMap model, @RequestParam Map map) throws Exception {
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/zzim", map),
|
||||
ReplyFromResrc::getReply
|
||||
//주문상품 내역으로 items 데이터를 생성한다. ==> DB에서 읽어옴
|
||||
ItemStack items[] = new ItemStack[1];
|
||||
|
||||
// 상품 변수 세팅 처리
|
||||
String goodsCd = map.get("goodsInnb").toString();
|
||||
String sopmalCd = map.get("sopmalCd").toString();
|
||||
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
|
||||
BOGoodsVO vo = new BOGoodsVO();
|
||||
vo.setGoodsInnb(goodsCd); // request 변수 세팅해야함.
|
||||
vo.setSopmalCd(sopmalCd); // request 변수 세팅해야함.
|
||||
DataMap goodsInfo = goodsService.selectBOGoodsDtl(vo);
|
||||
|
||||
//상품 일반옵션 getting
|
||||
List<DataMap> optnList = mapper.selectBOGoodsOptionList(vo);
|
||||
DataMap data = optnList.get(0);
|
||||
|
||||
// 이미지 정보 getting 이거 이렇게 하는게 맞는것인지 확인 필요
|
||||
vo.setImgKnd("03");
|
||||
vo.setCutNb("1");
|
||||
List<DataMap> imgList = mapper.selectBOGoodsImg(vo);
|
||||
log.debug("imgList.size() > " + imgList.size());
|
||||
DataMap imgInfo = imgList.get(0);
|
||||
|
||||
// 상품 ID , 상품명 , 가격 , image url, 상품 상세 정보 url
|
||||
items[0] = new ItemStack(
|
||||
goodsInfo.get("goodsInnb").toString()
|
||||
, goodsInfo.get("goodsNm").toString()
|
||||
, Integer.parseInt(data.get("slepric").toString())
|
||||
, imgUrl + imgInfo.get("img").toString()
|
||||
, imgUrl + imgInfo.get("img").toString()
|
||||
, request.getHeader("X-Original-Host") + "/sopmal/goods/selectGoodsDtl?goodsInnb="+goodsInfo.get("goodsInnb").toString()
|
||||
);
|
||||
|
||||
//GC_NPAY_CONFIG에서 npay정보 가져오기
|
||||
BONpayConfigVO param = new BONpayConfigVO();
|
||||
param.setSopmalCd(sopmalCd);
|
||||
DataMap detail = bONpayConfigService.loadNpayConfigDetail(param);
|
||||
BONpayConfigVO rvo = (BONpayConfigVO) detail.get("npayConfigDetail");
|
||||
|
||||
String shopId = rvo.getShopId();
|
||||
String certificationKey = rvo.getCertificationKey();
|
||||
|
||||
String zzimUrl;
|
||||
// 테스트 https://test-pay.naver.com/customer/api/wishlist.nhn
|
||||
// 서비스 https://pay.naver.com/customer/api/wishlist.nhn
|
||||
if("TEST".equals(rvo.getEnvrn())){
|
||||
zzimUrl = zzimTestUrl;
|
||||
}else{
|
||||
zzimUrl = zzimRealUrl;
|
||||
}
|
||||
|
||||
NpayZzim npayZzim = new NpayZzim(zzimUrl+"/customer/api/wishlist.nhn");
|
||||
//ItemStack[] items
|
||||
String[] prodSeqs = npayZzim.sendZzim(shopId, certificationKey, items);
|
||||
//여기서 얻은prodSeqs로 zzim popup을 띄운다.
|
||||
System.out.println("prodSeqs value > " + Arrays.toString(prodSeqs));
|
||||
System.out.println("prodSeqs.toString() > " + prodSeqs.toString());
|
||||
|
||||
String key = Arrays.toString(prodSeqs).replace("[", "").replace("]", "");
|
||||
System.out.println("key value > " + key);
|
||||
|
||||
BOIfLogVO object = new BOIfLogVO();
|
||||
object.setSopmalCd(sopmalCd);
|
||||
object.setIfKndCd("zzim");
|
||||
object.setSendParam(map.toString());
|
||||
object.setReceiveParam(key );
|
||||
object.setIfSttusCd("SUCCESS");
|
||||
boIfLogService.insertBoIfLog(object);
|
||||
DataMap message = new DataMap();
|
||||
log.debug("BO zzim 호출 종료 확인 !!");
|
||||
message.put("message", "success");
|
||||
message.put("prodSeqs", key);
|
||||
message.put("shopId", shopId);
|
||||
message.put("certificationKey", certificationKey);
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(message))
|
||||
.build()
|
||||
);
|
||||
// return responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/zzim", map),
|
||||
// ReplyFromResrc::getReply
|
||||
// );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -200,11 +387,21 @@ public class NPayController {
|
||||
|
||||
String[] orderArr = map.get("orderList").toString().split(",");
|
||||
map.put("orderList", orderArr);
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/loadGetProductOrderInfoListRev",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
map.put("sopmalCd", user.getSopmalCd());
|
||||
Map<String, Object> result = boApiService.loadGetProductOrderInfoListRev(map);
|
||||
log.debug("result > " + result.toString());
|
||||
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
response.get("ProductOrderInfoList"); // 조회 성공한 상품 주문 정보 목록
|
||||
response.get("FailedProductOrderIDList>"); // 조회 실패한 상품 주문 정보 목록
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/loadGetProductOrderInfoListRev",map)
|
||||
// );
|
||||
log.debug("result.toString() > " + result.toString());
|
||||
log.debug("FO /loadGetProductOrderInfoListRev E N D");
|
||||
}
|
||||
|
||||
@@ -235,14 +432,52 @@ public class NPayController {
|
||||
@RequestMapping(value = "/loadGetChangedProductOrderList")
|
||||
public void loadGetChangedProductOrderList(HttpServletRequest request, @RequestParam Map map) throws Exception {
|
||||
log.debug("FO /loadGetChangedProductOrderList START");
|
||||
|
||||
//log.debug("map.get(\"LastChangedStatusCode\").toString() > " + map.get("LastChangedStatusCode").toString());
|
||||
//log.debug("map.get(\"InquiryExtraData\").toString() > " + map.get("InquiryExtraData").toString());
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/loadGetChangedProductOrderList",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
|
||||
/* example start */
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("YYYY-MM-DD 'T' hh:mm:ss");
|
||||
Calendar fromDate = Calendar.getInstance(); // 조회 시작 일자
|
||||
log.debug("fromDate > " + dateFormat.format(fromDate.getTime()));
|
||||
|
||||
Calendar endDate = Calendar.getInstance(); // 조회 종료 일자
|
||||
endDate.set(Calendar.HOUR_OF_DAY, 23);
|
||||
endDate.set(Calendar.MINUTE, 59);
|
||||
endDate.set(Calendar.SECOND, 59);
|
||||
log.debug("endDate > " + dateFormat.format(endDate.getTime()));
|
||||
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
BONpayConfigVO param = new BONpayConfigVO();
|
||||
param.setSopmalCd(user.getSopmalCd());
|
||||
DataMap detail = bONpayConfigService.loadNpayConfigDetail(param);
|
||||
BONpayConfigVO rvo = (BONpayConfigVO) detail.get("npayConfigDetail");
|
||||
|
||||
map.put("InquiryTimeFrom", map.get("InquiryTimeFrom").toString());
|
||||
if(map.get("InquiryExtraData") != null) {
|
||||
map.put("InquiryExtraData", map.get("InquiryExtraData").toString());
|
||||
}else {
|
||||
map.put("InquiryExtraData", "");
|
||||
}
|
||||
|
||||
if(map.get("LastChangedStatusCode") != null) {
|
||||
map.put("LastChangedStatusCode", map.get("LastChangedStatusCode").toString());
|
||||
}else {
|
||||
map.put("LastChangedStatusCode", "");
|
||||
}
|
||||
|
||||
map.put("MallID", rvo.getShopId());
|
||||
map.put("sopmalCd", user.getSopmalCd());
|
||||
/* example end */
|
||||
|
||||
Map<String, Object> result = boApiService.loadGetChangedProductOrderList(map);
|
||||
|
||||
log.debug("result > " + result.toString());
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
response.get("changedProductOrderInfoList"); // 변경 상품 주문 내역
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/loadGetChangedProductOrderList",map)
|
||||
// );
|
||||
log.debug("result.toString() > " + result.toString());
|
||||
log.debug("FO /loadGetChangedProductOrderList E N D");
|
||||
}
|
||||
|
||||
@@ -254,14 +489,56 @@ public class NPayController {
|
||||
@RequestMapping(value = "/loadGetChangedProductOrderListRev")
|
||||
public void loadGetChangedProductOrderListRev(HttpServletRequest request, @RequestParam Map map) throws Exception {
|
||||
log.debug("FO /loadGetChangedProductOrderListRev START");
|
||||
|
||||
//log.debug("map.get(\"LastChangedStatusCode\").toString() > " + map.get("LastChangedStatusCode").toString());
|
||||
//log.debug("map.get(\"InquiryExtraData\").toString() > " + map.get("InquiryExtraData").toString());
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/loadGetChangedProductOrderListRev",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
|
||||
/* example start */
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:sss");
|
||||
Calendar fromDate = Calendar.getInstance(); // 조회 시작 일자
|
||||
|
||||
// 조회조건은 무조건 하루만 됨
|
||||
fromDate.set(Calendar.HOUR_OF_DAY, 00);
|
||||
fromDate.set(Calendar.MINUTE, 00);
|
||||
fromDate.set(Calendar.SECOND, 00);
|
||||
log.debug("fromDate > " + dateFormat.format(fromDate.getTime()));
|
||||
|
||||
Calendar endDate = Calendar.getInstance(); // 조회 종료 일자
|
||||
endDate.set(Calendar.HOUR_OF_DAY, 23);
|
||||
endDate.set(Calendar.MINUTE, 59);
|
||||
endDate.set(Calendar.SECOND, 59);
|
||||
log.debug("endDate > " + dateFormat.format(endDate.getTime()));
|
||||
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
BONpayConfigVO param = new BONpayConfigVO();
|
||||
param.setSopmalCd(user.getSopmalCd());
|
||||
DataMap detail = bONpayConfigService.loadNpayConfigDetail(param);
|
||||
BONpayConfigVO rvo = (BONpayConfigVO) detail.get("npayConfigDetail");
|
||||
|
||||
map.put("InquiryTimeFrom", map.get("InquiryTimeFrom").toString());
|
||||
//map.put("InquiryTimeTo", endDate);
|
||||
if(map.get("InquiryExtraData") != null) {
|
||||
map.put("InquiryExtraData", map.get("InquiryExtraData").toString());
|
||||
}else {
|
||||
map.put("InquiryExtraData", "");
|
||||
}
|
||||
//map.put("LastChangedStatusCode", map.get("LastChangedStatusCode").toString());
|
||||
if (Optional.ofNullable(map.get("LastChangedStatusCode")).isEmpty()) {
|
||||
map.put("LastChangedStatusCode", "");
|
||||
} else {
|
||||
map.put("LastChangedStatusCode", map.get("LastChangedStatusCode").toString());
|
||||
}
|
||||
map.put("MallID", rvo.getShopId());
|
||||
map.put("sopmalCd", user.getSopmalCd());
|
||||
/* example end */
|
||||
|
||||
Map<String, Object> result = boApiService.loadGetChangedProductOrderListRev(map);
|
||||
|
||||
log.debug("result > " + result.toString());
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
response.get("changedProductOrderInfoList"); // 변경 상품 주문 내역
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/loadGetChangedProductOrderListRev",map)
|
||||
// );
|
||||
log.debug("result.toString() > " + result.toString());
|
||||
log.debug("FO /loadGetChangedProductOrderListRev E N D");
|
||||
}
|
||||
|
||||
@@ -274,11 +551,19 @@ public class NPayController {
|
||||
@RequestMapping(value = "/loadGetMigratedProductOrderList")
|
||||
public void loadGetMigratedProductOrderList(HttpServletRequest request, @RequestParam Map map) throws Exception {
|
||||
log.debug("FO /loadGetMigratedProductOrderList START");
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/loadGetMigratedProductOrderList",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
map.put("sopmalCd", user.getSopmalCd());
|
||||
|
||||
Map<String, Object> result = boApiService.loadGetMigratedProductOrderList(map);
|
||||
log.debug("result > " + result.toString());
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
response.get("migratedProductOrderList"); // (신) 상품 준문 번호 목록
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/loadGetMigratedProductOrderList",map)
|
||||
// );
|
||||
log.debug("result.toString() > " + result.toString());
|
||||
log.debug("FO /loadGetMigratedProductOrderList E N D");
|
||||
}
|
||||
|
||||
@@ -292,11 +577,16 @@ public class NPayController {
|
||||
public void loadGetPurchaseReviewList(HttpServletRequest request, @RequestParam Map map) throws Exception {
|
||||
log.debug("FO /loadGetPurchaseReviewList START");
|
||||
//map.put("param", "test1");
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/loadGetPurchaseReviewList",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
|
||||
Map<String, Object> result = boApiService.loadGetPurchaseReviewList(map);
|
||||
log.debug("result > " + result.toString());
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
response.get("purchaseReviewList"); // 리뷰 내역
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/loadGetPurchaseReviewList",map)
|
||||
// );
|
||||
log.debug("result.toString() > " + result.toString());
|
||||
log.debug("FO /loadGetPurchaseReviewList E N D");
|
||||
}
|
||||
|
||||
@@ -310,11 +600,15 @@ public class NPayController {
|
||||
public void createPlaceProductOrder(HttpServletRequest request, @RequestParam Map map) throws Exception {
|
||||
log.debug("FO /createPlaceProductOrder START");
|
||||
//map.put("param", "test1");
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createPlaceProductOrder",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
|
||||
Map<String, Object> result = boApiService.createPlaceProductOrder(map);
|
||||
log.debug("result > " + result.toString());
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createPlaceProductOrder",map)
|
||||
// );
|
||||
log.debug("result.toString() > " + result.toString());
|
||||
log.debug("FO /createPlaceProductOrder E N D");
|
||||
}
|
||||
|
||||
@@ -328,11 +622,15 @@ public class NPayController {
|
||||
public void createDelayProductOrder(HttpServletRequest request, @RequestParam Map map) throws Exception {
|
||||
log.debug("FO /createDelayProductOrder START");
|
||||
//map.put("param", "test1");
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createDelayProductOrder",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
|
||||
Map<String, Object> result = boApiService.createDelayProductOrder(map);
|
||||
log.debug("result > " + result.toString());
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createDelayProductOrder",map)
|
||||
// );
|
||||
log.debug("result.toString() > " + result.toString());
|
||||
log.debug("FO /createDelayProductOrder E N D");
|
||||
}
|
||||
|
||||
@@ -345,11 +643,18 @@ public class NPayController {
|
||||
public void createCancelSale(HttpServletRequest request, @RequestParam Map map) throws Exception {
|
||||
log.debug("FO /createCancelSale START");
|
||||
//map.put("param", "test1");
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createCancelSale",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
map.put("sopmalCd", user.getSopmalCd());
|
||||
|
||||
Map<String, Object> result = boApiService.createCancelSale(map);
|
||||
log.debug("result > " + result.toString());
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createCancelSale",map)
|
||||
// );
|
||||
log.debug("result.toString() > " + result.toString());
|
||||
log.debug("FO /createCancelSale E N D");
|
||||
}
|
||||
|
||||
@@ -361,10 +666,15 @@ public class NPayController {
|
||||
@RequestMapping(value = "/createApproveCancelApplication")
|
||||
public void createApproveCancelApplication(HttpServletRequest request, @RequestParam Map map) throws Exception {
|
||||
log.debug("FO /createApproveCancelApplication START");
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createApproveCancelApplication",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
|
||||
Map<String, Object> result = boApiService.createApproveCancelApplication(map);
|
||||
log.debug("result > " + result.toString());
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createApproveCancelApplication",map)
|
||||
// );
|
||||
log.debug("result.toString() > " + result.toString());
|
||||
log.debug("FO /createApproveCancelApplication E N D");
|
||||
}
|
||||
|
||||
@@ -377,11 +687,15 @@ public class NPayController {
|
||||
public void createRequestReturn(HttpServletRequest request, @RequestParam Map map) throws Exception {
|
||||
log.debug("FO /createRequestReturn START");
|
||||
//map.put("param", "test1");
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createRequestReturn",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
|
||||
Map<String, Object> result = boApiService.createRequestReturn(map);
|
||||
log.debug("result > " + result.toString());
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createRequestReturn",map)
|
||||
// );
|
||||
log.debug("result.toString() > " + result.toString());
|
||||
log.debug("FO /createRequestReturn E N D");
|
||||
}
|
||||
|
||||
@@ -394,11 +708,15 @@ public class NPayController {
|
||||
public void createApproveReturnApplication(HttpServletRequest request, @RequestParam Map map) throws Exception {
|
||||
log.debug("FO /createApproveReturnApplication START");
|
||||
// map.put("param", "test1");
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createApproveReturnApplication",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
|
||||
Map<String, Object> result = boApiService.createApproveReturnApplication(map);
|
||||
log.debug("result > " + result.toString());
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createApproveReturnApplication",map)
|
||||
// );
|
||||
log.debug("result.toString() > " + result.toString());
|
||||
log.debug("FO /createApproveReturnApplication E N D");
|
||||
}
|
||||
|
||||
@@ -411,11 +729,15 @@ public class NPayController {
|
||||
public void createApproveCollectedExchange(HttpServletRequest request, @RequestParam Map map) throws Exception {
|
||||
log.debug("FO /createApproveCollectedExchange START");
|
||||
//map.put("param", "test1");
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createApproveCollectedExchange",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
|
||||
Map<String, Object> result = boApiService.createApproveCollectedExchange(map);
|
||||
log.debug("result > " + result.toString());
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createApproveCollectedExchange",map)
|
||||
// );
|
||||
log.debug("result.toString() > " + result.toString());
|
||||
log.debug("FO /createApproveCollectedExchange E N D");
|
||||
}
|
||||
|
||||
@@ -429,11 +751,15 @@ public class NPayController {
|
||||
public void createReDeliveryExchange(HttpServletRequest request, @RequestParam Map map) throws Exception {
|
||||
log.debug("FO /createReDeliveryExchange START");
|
||||
//map.put("param", "test1");
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createReDeliveryExchange",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
|
||||
Map<String, Object> result = boApiService.createReDeliveryExchange(map);
|
||||
log.debug("result > " + result.toString());
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createReDeliveryExchange",map)
|
||||
// );
|
||||
log.debug("result.toString() > " + result.toString());
|
||||
log.debug("FO /createReDeliveryExchange E N D");
|
||||
}
|
||||
|
||||
@@ -446,11 +772,15 @@ public class NPayController {
|
||||
public void createRejectReturn(HttpServletRequest request, @RequestParam Map map) throws Exception {
|
||||
log.debug("FO /createRejectReturn START");
|
||||
//map.put("param", "test1");
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createRejectReturn",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
|
||||
Map<String, Object> result = boApiService.createRejectReturn(map);
|
||||
log.debug("result > " + result.toString());
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createRejectReturn",map)
|
||||
// );
|
||||
log.debug("result.toString() > " + result.toString());
|
||||
log.debug("FO /createRejectReturn E N D");
|
||||
}
|
||||
|
||||
@@ -464,11 +794,15 @@ public class NPayController {
|
||||
public void createWithholdReturn(HttpServletRequest request, @RequestParam Map map) throws Exception {
|
||||
log.debug("FO /createWithholdReturn START");
|
||||
//map.put("param", "test1");
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createWithholdReturn",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
|
||||
Map<String, Object> result = boApiService.createWithholdReturn(map);
|
||||
log.debug("result > " + result.toString());
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createWithholdReturn",map)
|
||||
// );
|
||||
log.debug("result.toString() > " + result.toString());
|
||||
log.debug("FO /createWithholdReturn E N D");
|
||||
}
|
||||
|
||||
@@ -481,11 +815,15 @@ public class NPayController {
|
||||
public void createReleaseReturnHold(HttpServletRequest request, @RequestParam Map map) throws Exception {
|
||||
log.debug("FO /createReleaseReturnHold START");
|
||||
//map.put("param", "test1");
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createReleaseReturnHold",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
|
||||
Map<String, Object> result = boApiService.createReleaseReturnHold(map);
|
||||
log.debug("result > " + result.toString());
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createReleaseReturnHold",map)
|
||||
// );
|
||||
log.debug("result.toString() > " + result.toString());
|
||||
log.debug("FO /createReleaseReturnHold E N D");
|
||||
}
|
||||
|
||||
@@ -499,11 +837,14 @@ public class NPayController {
|
||||
public void createRejectExchange(HttpServletRequest request, @RequestParam Map map) throws Exception {
|
||||
log.debug("FO /createRejectExchange START");
|
||||
//map.put("param", "test1");
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createRejectExchange",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
|
||||
Map<String, Object> result = boApiService.createRejectExchange(map);
|
||||
log.debug("result > " + result.toString());
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createRejectExchange",map)
|
||||
// );
|
||||
log.debug("FO /createRejectExchange E N D");
|
||||
}
|
||||
|
||||
@@ -517,11 +858,14 @@ public class NPayController {
|
||||
public void createWithholdExchange(HttpServletRequest request, @RequestParam Map map) throws Exception {
|
||||
log.debug("FO /createWithholdExchange START");
|
||||
//map.put("param", "test1");
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createWithholdExchange",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
|
||||
Map<String, Object> result = boApiService.createWithholdExchange(map);
|
||||
log.debug("result > " + result.toString());
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createWithholdExchange",map)
|
||||
// );
|
||||
log.debug("FO /createWithholdExchange E N D");
|
||||
}
|
||||
|
||||
@@ -534,11 +878,14 @@ public class NPayController {
|
||||
public void createReleaseExchangeHold(HttpServletRequest request, @RequestParam Map map) throws Exception {
|
||||
log.debug("FO /createReleaseExchangeHold START");
|
||||
//map.put("param", "test1");
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createReleaseExchangeHold",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
|
||||
Map<String, Object> result = boApiService.createReleaseExchangeHold(map);
|
||||
log.debug("result > " + result.toString());
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createReleaseExchangeHold",map)
|
||||
// );
|
||||
log.debug("FO /createReleaseExchangeHold E N D");
|
||||
}
|
||||
|
||||
@@ -553,11 +900,26 @@ public class NPayController {
|
||||
public void loadGetCustomerInquiryList(HttpServletRequest request, @RequestParam Map map) throws Exception {
|
||||
log.debug("FO /loadGetCustomerInquiryList START");
|
||||
map.put("param", "test1");
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/loadGetCustomerInquiryList",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
|
||||
// example
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:sss");
|
||||
Calendar endDate = Calendar.getInstance();
|
||||
log.debug("c.getTime() > " + endDate.getTime());
|
||||
Calendar fromDate = Calendar.getInstance();
|
||||
fromDate.add(Calendar.MONTH, -1);
|
||||
log.debug("fromDate > " + dateFormat.format(fromDate.getTime()));
|
||||
map.put("InquiryTimeFrom", fromDate); //조회 시작 일시
|
||||
map.put("InquiryTimeTo", endDate); //조회 종료 일시
|
||||
map.put("IsAnswered", false); //답변 여부 true or false
|
||||
map.put("MallID", "np_bgbcp347244"); //가맹점 ID
|
||||
|
||||
Map<String, Object> result = boApiService.loadGetCustomerInquiryList(map);
|
||||
log.debug("result > " + result.toString());
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/loadGetCustomerInquiryList",map)
|
||||
// );
|
||||
log.debug("FO /loadGetCustomerInquiryList E N D");
|
||||
}
|
||||
|
||||
@@ -578,13 +940,21 @@ public class NPayController {
|
||||
map.put("AnswerContent", "test1");
|
||||
map.put("AnswerContentID", "test1");
|
||||
map.put("ActionType", "test1");
|
||||
|
||||
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createAnswerCustomerInquiry",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
|
||||
// example
|
||||
map.put("InquiryID", "0001"); //쇼핑 문의 번호 Npay_ANSW_NB
|
||||
map.put("AnswerContent", "조치해 드리겠습니다."); //답변 내용
|
||||
map.put("AnswerContentID", "1"); //답변 번호 (답변 메시지를 수정하는 경우에는 필수)
|
||||
map.put("MallID", "np_bgbcp347244"); //가맹점 ID
|
||||
map.put("ActionType", "INSERT"); //명령어 타입 코드("A.2.3 명령어 타입 코드" 참고) INSERT : 답변 등록 , UPDATE : 답변 수정
|
||||
|
||||
Map<String, Object> result = boApiService.createAnswerCustomerInquiry(map);
|
||||
log.debug("result > " + result.toString());
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createAnswerCustomerInquiry",map)
|
||||
// );
|
||||
log.debug("FO /createAnswerCustomerInquiry E N D");
|
||||
}
|
||||
|
||||
@@ -592,10 +962,7 @@ public class NPayController {
|
||||
/**
|
||||
* naverPay측에서 request 함
|
||||
* 네이버페이 API는 취소 요청, 반품 요청 등이 발생했을 때 가맹점에 이를 알리기 위한 알림(callback)을 제공한다.
|
||||
*
|
||||
*
|
||||
* @param model
|
||||
* @param benefitVO
|
||||
* @return String
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@@ -612,12 +979,40 @@ public class NPayController {
|
||||
}else if(type.equals("CANCEL")){
|
||||
// ... 시 처리 로직 수행
|
||||
}
|
||||
|
||||
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/pruduct", map)
|
||||
);
|
||||
|
||||
String productXml = "";
|
||||
String response = "";
|
||||
String status = "";
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("status", "success!!");
|
||||
|
||||
log.debug("pruduct input param > " + map.toString());
|
||||
|
||||
try {
|
||||
List products = (List) map.get("searchList");
|
||||
log.debug("전달 받은 상품조회 List > " + products.size());
|
||||
|
||||
response = productXmlService.createProductXml(map, request);
|
||||
log.debug("생성된 XML CODE > " + response);
|
||||
resultMap.put("xml", response);
|
||||
status = "SUCCESS";
|
||||
}catch(Exception e) {
|
||||
log.debug("네이버 페이 ProductXML 에러 메세지 출력 > " + e.getMessage());
|
||||
response = e.getMessage();
|
||||
status = "FAIL";
|
||||
}finally {
|
||||
BOIfLogVO vo = new BOIfLogVO();
|
||||
vo.setSopmalCd(map.get("sopmalCd").toString());
|
||||
vo.setIfKndCd("product");
|
||||
vo.setSendParam(map.toString());
|
||||
vo.setReceiveParam(response);
|
||||
vo.setIfSttusCd(status);
|
||||
|
||||
boIfLogService.insertBoIfLog(vo);
|
||||
}
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/pruduct", map)
|
||||
// );
|
||||
|
||||
log.debug("FO /nPayCallback E N D");
|
||||
|
||||
@@ -640,11 +1035,14 @@ public class NPayController {
|
||||
public void createShipProductOrder(HttpServletRequest request, @RequestParam Map map) throws Exception {
|
||||
log.debug("FO /createShipProductOrder START");
|
||||
//map.put("param", "test1");
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createShipProductOrder",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
|
||||
Map<String, Object> result = boApiService.createShipProductOrder(map);
|
||||
log.debug("result > " + result.toString());
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/createShipProductOrder",map)
|
||||
// );
|
||||
log.debug("FO /createShipProductOrder E N D");
|
||||
}
|
||||
|
||||
@@ -658,11 +1056,18 @@ public class NPayController {
|
||||
public void loadGetProductOrderIDList(HttpServletRequest request, @RequestParam Map map) throws Exception {
|
||||
log.debug("FO /loadGetProductOrderIDList START");
|
||||
map.put("param", "test1");
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/loadGetProductOrderIDList",map)
|
||||
);
|
||||
log.debug("resultMap.toString() > " + resultMap.toString());
|
||||
|
||||
// example
|
||||
map.put("OrderID", "20241014-0001"); // 주문 번호
|
||||
map.put("MallID", "np_bgbcp347244"); // 가맹점 아이디
|
||||
|
||||
Map<String, Object> result = boApiService.loadGetProductOrderIDList(map);
|
||||
log.debug("result > " + result.toString());
|
||||
Map<String, Object> response = (Map<String, Object>) result.get("response");
|
||||
log.debug("처리 결과 > " + response.get("responseType").toString());
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/npay/api/loadGetProductOrderIDList",map)
|
||||
// );
|
||||
log.debug("FO /loadGetProductOrderIDList E N D");
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,17 +5,24 @@ import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.wb.domainserver.domain.gcone.ordr.pay.service.BOPayService;
|
||||
import com.wb.domainserver.domain.gcone.ordr.pay.vo.BOPayVO;
|
||||
import com.wb.domainserver. exception.code.ErrCode;
|
||||
import com.wb.domainserver.exception.WnbtException;
|
||||
import com.wb.domainserver.response.ApiResponse;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
import org.json.simple.parser.ParseException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
@@ -45,6 +52,8 @@ public class PayController {
|
||||
@Autowired
|
||||
private SendToResrc sendToResrc;
|
||||
|
||||
@Autowired
|
||||
private BOPayService service;
|
||||
/* *********************************************
|
||||
* 토스 결제 관련
|
||||
********************************************* */
|
||||
@@ -170,11 +179,11 @@ public class PayController {
|
||||
* @author 이경숙
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/tossPayWidgetSuccss")
|
||||
@RequestMapping(value="/tossPayWidgetSuccss",produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> confirmPaymentWiget(@RequestBody String jsonBody) throws Exception {
|
||||
|
||||
JSONParser parser = new JSONParser();
|
||||
PayVO payVO = new PayVO();
|
||||
BOPayVO payVO = new BOPayVO();
|
||||
try {
|
||||
// 클라이언트에서 받은 JSON 요청 바디입니다.
|
||||
JSONObject requestData = (JSONObject) parser.parse(jsonBody);
|
||||
@@ -185,10 +194,16 @@ public class PayController {
|
||||
throw new RuntimeException(e);
|
||||
};
|
||||
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/pay/tossPayProc", payVO),
|
||||
ReplyFromResrc::getReply
|
||||
Map<String, Object> content = insertTossPay(payVO);
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
// return responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/pay/tossPayProc", payVO),
|
||||
// ReplyFromResrc::getReply
|
||||
// );
|
||||
}
|
||||
|
||||
|
||||
@@ -200,18 +215,18 @@ public class PayController {
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/tossPaySuccss")
|
||||
public String confirmPayment(HttpServletRequest request, ModelMap model) throws Exception {
|
||||
|
||||
PayVO payVO = new PayVO();
|
||||
|
||||
BOPayVO payVO = new BOPayVO();
|
||||
payVO.setOrderId(request.getParameter("orderId"));
|
||||
payVO.setPaymentKey(request.getParameter("paymentKey"));
|
||||
payVO.setAmount(request.getParameter("amount"));
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/pay/tossPayProc", payVO),
|
||||
model,
|
||||
"message"
|
||||
);
|
||||
Map<String, Object> content = insertTossPay(payVO);
|
||||
model.addAttribute("message", content);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/pay/tossPayProc", payVO),
|
||||
// model,
|
||||
// "message"
|
||||
// );
|
||||
|
||||
return "sopmal/ordr/PayTossPaySucsC";
|
||||
}
|
||||
@@ -224,13 +239,24 @@ public class PayController {
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/tossPayKeyinSuccss")
|
||||
public String confirmPaymentKeyin(PayVO payVO,ModelMap model) {
|
||||
public String confirmPaymentKeyin(BOPayVO payVO,ModelMap model) {
|
||||
Map<String, Object> message;
|
||||
String sopmalCd = payVO.getSopmalCd();
|
||||
try {
|
||||
message = service.insertTossPayKeyin(payVO);
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/pay/tossPayKeyinProc", payVO),
|
||||
model,
|
||||
"message"
|
||||
);
|
||||
} catch (Exception e) {
|
||||
message = new HashMap<>() {{
|
||||
put("response", "결제를 실패하였습니다.\n관리자에게 문의하시기 바랍니다.");
|
||||
}};
|
||||
}
|
||||
|
||||
model.addAttribute("message", message);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/pay/tossPayKeyinProc", payVO),
|
||||
// model,
|
||||
// "message"
|
||||
// );
|
||||
|
||||
return "sopmal/ordr/PayTossPaySucsC";
|
||||
}
|
||||
@@ -243,13 +269,24 @@ public class PayController {
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/tossPayCancel")
|
||||
public String cancelTossPay(PayVO payVO,ModelMap model) {
|
||||
public String cancelTossPay(BOPayVO payVO,ModelMap model) {
|
||||
Map<String, Object> message;
|
||||
String sopmalCd = payVO.getSopmalCd();
|
||||
try {
|
||||
message = service.cancelTossPay(payVO);
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/pay/cancelTossPay", payVO),
|
||||
model,
|
||||
"message"
|
||||
);
|
||||
} catch (Exception e) {
|
||||
message = new HashMap<>() {{
|
||||
put("response", "결제취소를 실패하였습니다.\n관리자에게 문의하시기 바랍니다.");
|
||||
}};
|
||||
}
|
||||
|
||||
model.addAttribute("message", message);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/pay/cancelTossPay", payVO),
|
||||
// model,
|
||||
// "message"
|
||||
// );
|
||||
|
||||
return "sopmal/ordr/PayTossPaySucsC";
|
||||
}
|
||||
@@ -307,7 +344,7 @@ public class PayController {
|
||||
@RequestMapping(value="/kcpPaySuccss")
|
||||
public String confirmPaymentKcp(HttpServletRequest request, ModelMap model) throws Exception {
|
||||
|
||||
PayVO payVO = new PayVO();
|
||||
BOPayVO payVO = new BOPayVO();
|
||||
|
||||
payVO.setOrderId(request.getParameter("ordr_idxx"));
|
||||
payVO.setAmount(request.getParameter("good_mny"));
|
||||
@@ -317,11 +354,23 @@ public class PayController {
|
||||
payVO.setEncData(request.getParameter("enc_data"));
|
||||
payVO.setTranCd(request.getParameter("tran_cd"));
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/pay/kcpPayProc", payVO),
|
||||
model,
|
||||
"message"
|
||||
);
|
||||
Map<String, Object> message;
|
||||
String sopmalCd = payVO.getSopmalCd();
|
||||
try {
|
||||
message = service.insertKcpPay(payVO);
|
||||
|
||||
} catch (Exception e) {
|
||||
message = new HashMap<>() {{
|
||||
put("response", "결제를 실패하였습니다.\n관리자에게 문의하시기 바랍니다.");
|
||||
}};
|
||||
}
|
||||
|
||||
model.addAttribute("message", message);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/pay/kcpPayProc", payVO),
|
||||
// model,
|
||||
// "message"
|
||||
// );
|
||||
|
||||
return "sopmal/ordr/PayKcpSucsC";
|
||||
}
|
||||
@@ -335,13 +384,24 @@ public class PayController {
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/kcpPayKeyinSuccss")
|
||||
public String confirmPaymentKcpKeyin(PayVO payVO,ModelMap model) {
|
||||
public String confirmPaymentKcpKeyin(BOPayVO payVO,ModelMap model) {
|
||||
Map<String, Object> message;
|
||||
String sopmalCd = payVO.getSopmalCd();
|
||||
try {
|
||||
message = service.insertKcpPayKeyin(payVO);
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/pay/kcpPayKeyinProc", payVO),
|
||||
model,
|
||||
"message"
|
||||
);
|
||||
} catch (Exception e) {
|
||||
message = new HashMap<>() {{
|
||||
put("response", "결제를 실패하였습니다.\n관리자에게 문의하시기 바랍니다.");
|
||||
}};
|
||||
}
|
||||
|
||||
model.addAttribute("message", message);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/pay/kcpPayKeyinProc", payVO),
|
||||
// model,
|
||||
// "message"
|
||||
// );
|
||||
|
||||
return "sopmal/ordr/PayKcpSucsC";
|
||||
}
|
||||
@@ -353,12 +413,27 @@ public class PayController {
|
||||
* @author 이경숙
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/kcpPayCancel")
|
||||
public ResponseEntity<WnbtResponse> cancelKcpPay(PayVO payVO) {
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/pay/cancelKcpPay", payVO),
|
||||
ReplyFromResrc::getReply
|
||||
@RequestMapping(value="/kcpPayCancel",produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> cancelKcpPay(BOPayVO payVO) {
|
||||
Map<String, Object> message;
|
||||
String sopmalCd = payVO.getSopmalCd();
|
||||
try {
|
||||
message = service.cancelKcpPay(payVO);
|
||||
} catch (Exception e) {
|
||||
message = new HashMap<>() {{
|
||||
put("response", "KCP 결제 취소를 실패하였습니다.\n관리자에게 문의하시기 바랍니다.");
|
||||
}};
|
||||
}
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(message))
|
||||
.build()
|
||||
);
|
||||
// return responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/pay/cancelKcpPay", payVO),
|
||||
// ReplyFromResrc::getReply
|
||||
// );
|
||||
}
|
||||
|
||||
|
||||
@@ -409,12 +484,31 @@ public class PayController {
|
||||
* @author 이경숙
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/CashReceipt")
|
||||
public ResponseEntity<WnbtResponse> insertCashReceipt(PayVO payVO) {
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/pay/cashReceipt", payVO),
|
||||
ReplyFromResrc::getReply
|
||||
@RequestMapping(value="/CashReceipt",produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> insertCashReceipt(BOPayVO payVO) {
|
||||
Map<String, Object> message;
|
||||
String sopmalCd = payVO.getSopmalCd();
|
||||
try {
|
||||
//쇼핑몰에 따라 pg사 구분함
|
||||
if(sopmalCd.equals("NC")) {
|
||||
message = service.insertKcpCashReceipt(payVO); //kcp
|
||||
}else {
|
||||
message = service.insertTossCashReceipt(payVO); //토스
|
||||
}
|
||||
} catch (Exception e) {
|
||||
message = new HashMap<>() {{
|
||||
put("response", "현금영수증 발급을 실패하였습니다.\n관리자에게 문의하시기 바랍니다.");
|
||||
}};
|
||||
}
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(message))
|
||||
.build()
|
||||
);
|
||||
// return responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/pay/cashReceipt", payVO),
|
||||
// ReplyFromResrc::getReply
|
||||
// );
|
||||
}
|
||||
|
||||
|
||||
@@ -423,12 +517,31 @@ public class PayController {
|
||||
* @author 이경숙
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/CashReceiptCancel")
|
||||
public ResponseEntity<WnbtResponse> cancelCashReceipt(PayVO payVO) {
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/pay/cashReceiptCancel", payVO),
|
||||
ReplyFromResrc::getReply
|
||||
@RequestMapping(value="/CashReceiptCancel",produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> cancelCashReceipt(BOPayVO payVO) {
|
||||
Map<String, Object> message;
|
||||
String sopmalCd = payVO.getSopmalCd();
|
||||
try {
|
||||
//쇼핑몰에 따라 pg사 구분함
|
||||
if(sopmalCd.equals("NC")) {
|
||||
message = service.cancelKcpCashReceipt(payVO); //kcp
|
||||
}else {
|
||||
message = service.cancelTossCashReceipt(payVO); //토스
|
||||
}
|
||||
} catch (Exception e) {
|
||||
message = new HashMap<>() {{
|
||||
put("response", "현금영수증 발급취소를 실패하였습니다.\n관리자에게 문의하시기 바랍니다.");
|
||||
}};
|
||||
}
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(message))
|
||||
.build()
|
||||
);
|
||||
// return responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/ordr/pay/cashReceiptCancel", payVO),
|
||||
// ReplyFromResrc::getReply
|
||||
// );
|
||||
}
|
||||
|
||||
|
||||
@@ -496,12 +609,25 @@ public class PayController {
|
||||
} catch (WnbtException e) {
|
||||
throw new WnbtException(ErrCode.BAD_REQUEST, e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return ResponseEntity.status(code).body(jsonObject);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* bo로직 토스뱅크 결제
|
||||
*/
|
||||
public Map<String, Object> insertTossPay(BOPayVO payVO) {
|
||||
Map<String, Object> message;
|
||||
String sopmalCd = payVO.getSopmalCd();
|
||||
try {
|
||||
message = service.insertTossPay(payVO);
|
||||
|
||||
} catch (Exception e) {
|
||||
message = new HashMap<>() {{
|
||||
put("response", "결제를 실패하였습니다.\n관리자에게 문의하시기 바랍니다.");
|
||||
}};
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user