fo bo 머지작업(sopmal)
This commit is contained in:
@@ -1,19 +1,26 @@
|
||||
package com.wb.domainserver.domain.crm.coupon.controller;
|
||||
|
||||
import com.wb.domainserver.common.msg.GconeMessageSource;
|
||||
import com.wb.domainserver.common.mvc.tags.ui.pagination.PaginationInfo;
|
||||
import com.wb.domainserver.common.prop.PaginationProperties;
|
||||
import com.wb.domainserver.domain.crm.cnslt.vo.CrmCnsltVO;
|
||||
import com.wb.domainserver.domain.crm.coupon.vo.CrmCouponVO;
|
||||
import com.wb.domainserver.domain.gcone.common.service.BOCommonService;
|
||||
import com.wb.domainserver.domain.gcone.promtn.coupon.service.BOCouponService;
|
||||
import com.wb.domainserver.domain.gcone.promtn.coupon.vo.BODwldCouponVO;
|
||||
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.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;
|
||||
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;
|
||||
@@ -23,6 +30,10 @@ import org.springframework.web.bind.annotation.CookieValue;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
* CRM 쿠폰
|
||||
@@ -55,6 +66,14 @@ public class CrmCouponController {
|
||||
@Autowired
|
||||
private GconeMessageSource gconeMessageSource;
|
||||
|
||||
@Autowired
|
||||
private BOCouponService service;
|
||||
|
||||
@Autowired
|
||||
private PaginationProperties paginationProperties;
|
||||
|
||||
@Autowired
|
||||
private BOCommonService commonService;
|
||||
|
||||
/**
|
||||
* 쿠폰내역 목록 폼 이동
|
||||
@@ -62,14 +81,33 @@ public class CrmCouponController {
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value = "/selectHoldCouponDtlsForm")
|
||||
public String selectHoldCouponDtlsForm(CrmCnsltVO vo, CrmCouponVO couponVO, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
couponVO.setSopmalCd(authSopmalCd);
|
||||
public String selectHoldCouponDtlsForm(CrmCnsltVO vo, BODwldCouponVO dwldCouponVO, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
dwldCouponVO.setSopmalCd(authSopmalCd);
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
dwldCouponVO.setSopmalCd(user.getSopmalCd()); // 쇼핑몰 코드
|
||||
dwldCouponVO.setMbrDvCd(user.getMbrDvCd()); // 회원 구분 코드
|
||||
dwldCouponVO.setMbrInnb(Integer.valueOf(user.getUserInnb())); // 회원 고유번호
|
||||
}
|
||||
dwldCouponVO.setRegusr(user.getUserInnb()); // 등록자
|
||||
dwldCouponVO.setUpdusr(user.getUserInnb()); // 수정자
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/promtn/coupon/selectBOHoldCouponDtlsForm", couponVO),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
log.debug("couponPkSndngVO : {}", dwldCouponVO);
|
||||
|
||||
// Map객체에 필요 정보 할당
|
||||
Map<String, Object> content = new HashMap<>();
|
||||
|
||||
content = service.selectBOMyCouponListCnt(dwldCouponVO);
|
||||
content.put("paramVO", dwldCouponVO);
|
||||
|
||||
model.addAttribute("", content);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/promtn/coupon/selectBOHoldCouponDtlsForm", couponVO),
|
||||
// model,
|
||||
// "resultMap"
|
||||
// );
|
||||
model.addAttribute("cnsltVO",vo);
|
||||
return "crm/coupon/HoldCouponDtlsRForm";
|
||||
}
|
||||
@@ -81,14 +119,49 @@ public class CrmCouponController {
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value = "/selectHoldCouponDtlsInqire")
|
||||
public String selectHoldCouponDtlsInqire(CrmCouponVO couponVO, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
couponVO.setSopmalCd(authSopmalCd);
|
||||
public String selectHoldCouponDtlsInqire(BODwldCouponVO dwldCouponVO, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
dwldCouponVO.setSopmalCd(authSopmalCd);
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
dwldCouponVO.setSopmalCd(user.getSopmalCd()); // 쇼핑몰 코드
|
||||
dwldCouponVO.setMbrDvCd(user.getMbrDvCd()); // 회원 구분 코드
|
||||
dwldCouponVO.setMbrInnb(Integer.valueOf(user.getUserInnb())); // 회원 고유번호
|
||||
} else {
|
||||
dwldCouponVO.setServerDv("admin");
|
||||
}
|
||||
dwldCouponVO.setRegusr(user.getUserInnb()); // 등록자
|
||||
dwldCouponVO.setUpdusr(user.getUserInnb()); // 수정자
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/promtn/coupon/selectBOCouponUsePosblDtlsInqire", couponVO),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
log.debug("couponPkSndngVO : {}", dwldCouponVO);
|
||||
|
||||
// 페이징 객체 생성 & 페이징정보 할당
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(dwldCouponVO.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(dwldCouponVO.getPageUnit());
|
||||
paginationInfo.setPageSize(paginationProperties.getPageSize());
|
||||
|
||||
dwldCouponVO.setPaginationInfo(paginationInfo);
|
||||
dwldCouponVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
dwldCouponVO.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
dwldCouponVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
// 목록 조회
|
||||
List<DataMap> resultList = null;
|
||||
resultList = service.selectBOCouponUsePosblDtlsInqire(dwldCouponVO);
|
||||
|
||||
// Map객체에 필요 정보 할당
|
||||
Map<String, Object> content = new HashMap<>();
|
||||
content.put("paramVO", dwldCouponVO);
|
||||
content.put("resultList", resultList);
|
||||
content.put("paginationInfo", dwldCouponVO.getPaginationInfo());
|
||||
|
||||
model.addAttribute("", content);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/promtn/coupon/selectBOCouponUsePosblDtlsInqire", couponVO),
|
||||
// model,
|
||||
// "resultMap"
|
||||
// );
|
||||
|
||||
return "crm/coupon/HoldCouponDtlsR";
|
||||
}
|
||||
@@ -100,13 +173,24 @@ public class CrmCouponController {
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value = "/selectHoldCouponDtlPopupForm")
|
||||
public String selectHoldCouponDtlPopupForm(CrmCouponVO couponVO, ModelMap model) {
|
||||
public String selectHoldCouponDtlPopupForm(BODwldCouponVO dwldCouponVO, ModelMap model) {
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/promtn/coupon/selectBOCouponInfoInqirePopup", couponVO),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
Map<String, Object> content = new HashMap<>();
|
||||
|
||||
log.debug("vo is {}", dwldCouponVO);
|
||||
|
||||
DataMap result = service.selectBOCouponInfoInqirePopup(dwldCouponVO);
|
||||
log.debug("vo is {}", result);
|
||||
content.put("dwldCouponVO", result); // 발송정보
|
||||
|
||||
model.addAttribute("", content);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/promtn/coupon/selectBOCouponInfoInqirePopup", couponVO),
|
||||
// model,
|
||||
// "resultMap"
|
||||
// );
|
||||
|
||||
return "crm/coupon/HoldCouponDtlPopupR";
|
||||
}
|
||||
@@ -117,18 +201,37 @@ public class CrmCouponController {
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value = "/updateCouponPdUpdt", method = RequestMethod.POST)
|
||||
public ResponseEntity<WnbtResponse> updateCouponPdUpdt(@Validated CrmCouponVO couponVO, BindingResult bindingResult) {
|
||||
log.debug("couponVO info inqire {}", couponVO);
|
||||
@RequestMapping(value = "/updateCouponPdUpdt", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> updateCouponPdUpdt(@Validated BODwldCouponVO dwldCouponVO, BindingResult bindingResult) {
|
||||
log.debug("couponVO info inqire {}", dwldCouponVO);
|
||||
// 정합성 검사
|
||||
if (bindingResult.hasErrors()) {
|
||||
throw new WnbtRestException(ValidateResultConverter.convert(bindingResult, gconeMessageSource));
|
||||
}
|
||||
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/promtn/coupon/updateBOCouponValidPdUpdt", couponVO),
|
||||
ReplyFromResrc::getReply
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
dwldCouponVO.setSopmalCd(user.getSopmalCd()); // 쇼핑몰 코드
|
||||
}
|
||||
dwldCouponVO.setRegusr(user.getUserInnb()); // 등록자
|
||||
dwldCouponVO.setUpdusr(user.getUserInnb()); // 수정자
|
||||
|
||||
//
|
||||
log.debug("vo 확인 : {}", dwldCouponVO);
|
||||
|
||||
Map<String, Object> message = new HashMap<>();
|
||||
message = service.updateBOCouponValidPdUpdt(dwldCouponVO);
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(message))
|
||||
.build()
|
||||
);
|
||||
// return responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/promtn/coupon/updateBOCouponValidPdUpdt", couponVO),
|
||||
// ReplyFromResrc::getReply
|
||||
// );
|
||||
}
|
||||
|
||||
|
||||
@@ -138,14 +241,48 @@ public class CrmCouponController {
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value = "/selectDwldPosblCouponDtlsInqire")
|
||||
public String selectDwldPosblCouponDtlsInqire(CrmCouponVO couponVO, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
couponVO.setSopmalCd(authSopmalCd);
|
||||
public String selectDwldPosblCouponDtlsInqire(BODwldCouponVO dwldCouponVO, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
dwldCouponVO.setSopmalCd(authSopmalCd);
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
dwldCouponVO.setSopmalCd(user.getSopmalCd()); // 쇼핑몰 코드
|
||||
dwldCouponVO.setMbrDvCd(user.getMbrDvCd()); // 회원 구분 코드
|
||||
dwldCouponVO.setMbrInnb(Integer.valueOf(user.getUserInnb())); // 회원 고유번호
|
||||
}
|
||||
dwldCouponVO.setRegusr(user.getUserInnb()); // 등록자
|
||||
dwldCouponVO.setUpdusr(user.getUserInnb()); // 수정자
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/promtn/coupon/selectBODwldCouponDtlsInqire", couponVO),
|
||||
model,
|
||||
"resultMapDwld"
|
||||
);
|
||||
|
||||
log.debug("couponPkSndngVO : {}", dwldCouponVO);
|
||||
|
||||
// 페이징 객체 생성 & 페이징정보 할당
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(dwldCouponVO.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(dwldCouponVO.getPageUnit());
|
||||
paginationInfo.setPageSize(paginationProperties.getPageSize());
|
||||
|
||||
dwldCouponVO.setPaginationInfo(paginationInfo);
|
||||
dwldCouponVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
dwldCouponVO.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
dwldCouponVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
// 목록 조회
|
||||
List<DataMap> resultList = null;
|
||||
resultList = service.selectBODwldCouponDtlsInqire(dwldCouponVO);
|
||||
log.debug(" 쿠폰 목록 확인 : {}", resultList);
|
||||
// Map객체에 필요 정보 할당
|
||||
Map<String, Object> content = new HashMap<>();
|
||||
content.put("paramVO", dwldCouponVO);
|
||||
content.put("resultList", resultList);
|
||||
content.put("paginationInfo", dwldCouponVO.getPaginationInfo());
|
||||
|
||||
model.addAttribute("", content);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/promtn/coupon/selectBODwldCouponDtlsInqire", couponVO),
|
||||
// model,
|
||||
// "resultMapDwld"
|
||||
// );
|
||||
|
||||
return "crm/coupon/DwldPosblCouponDtlsR";
|
||||
}
|
||||
@@ -156,14 +293,43 @@ public class CrmCouponController {
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value = "/insertCrmDwldCouponAllRegist")
|
||||
public ResponseEntity<WnbtResponse> insertCrmDwldCouponAllRegist(CrmCouponVO couponVO, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
couponVO.setSopmalCd(authSopmalCd);
|
||||
log.debug("CRM 쿠폰 다운로드 : {}", couponVO);
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/promtn/coupon/insertBODwldCouponAllRegist", couponVO),
|
||||
ReplyFromResrc::getReply
|
||||
@RequestMapping(value = "/insertCrmDwldCouponAllRegist", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> insertCrmDwldCouponAllRegist(BODwldCouponVO dwldCouponVO, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
dwldCouponVO.setSopmalCd(authSopmalCd);
|
||||
log.debug("CRM 쿠폰 다운로드 : {}", dwldCouponVO);
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
dwldCouponVO.setSopmalCd(user.getSopmalCd()); // 쇼핑몰 코드
|
||||
dwldCouponVO.setMbrInnb(user.getUserInnb()); // 회원 고유번호
|
||||
dwldCouponVO.setMbrDvCd(user.getMbrDvCd()); // 회원 구분 코드
|
||||
dwldCouponVO.setMbrNm(user.getMbrNm()); // 회원 명
|
||||
dwldCouponVO.setMbtlnb(user.getMbtlnb()); //전화번호
|
||||
} else {
|
||||
dwldCouponVO.setMbrInnb(dwldCouponVO.getMbrInnb()); // 회원 고유번호
|
||||
dwldCouponVO.setMbrDvCd(dwldCouponVO.getMbrDvCd()); // 회원 구분 코드
|
||||
dwldCouponVO.setMbrNm(dwldCouponVO.getMbrNm()); // 회원 명
|
||||
dwldCouponVO.setMbtlnb(dwldCouponVO.getMbtlnb()); //전화번호
|
||||
}
|
||||
dwldCouponVO.setRegusr(user.getUserInnb()); // 등록자
|
||||
dwldCouponVO.setUpdusr(user.getUserInnb()); // 수정자
|
||||
dwldCouponVO.setSecretKey(commonService.selectSecretkey());
|
||||
|
||||
log.debug("쿠폰 다운로드 쿠폰 값 확인 : {}", dwldCouponVO);
|
||||
|
||||
// service 호출
|
||||
Map<String, Object> message = new HashMap<>();
|
||||
message = service.insertBODwldCouponAllRegist(dwldCouponVO);
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(message))
|
||||
.build()
|
||||
);
|
||||
// return responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/promtn/coupon/insertBODwldCouponAllRegist", couponVO),
|
||||
// ReplyFromResrc::getReply
|
||||
// );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user