fo bo 머지작업
This commit is contained in:
@@ -2,23 +2,35 @@ package com.wb.domainserver.domain.mngr.bbs.bbsmngr.controller;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
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.gcone.bbs.bbs.service.BOBbsService;
|
||||
import com.wb.domainserver.domain.gcone.bbs.bbs.vo.BOBbsSetupVO;
|
||||
import com.wb.domainserver.domain.gcone.bbs.bbs.vo.BOBbsVO;
|
||||
import com.wb.domainserver.domain.mngr.bbs.bbsmngr.vo.BbsmngrVO;
|
||||
import com.wb.domainserver.exception.WnbtRestException;
|
||||
import com.wb.domainserver.exception.code.ErrorCode;
|
||||
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 com.wb.domainserver.util.string.StringUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.CookieValue;
|
||||
@@ -71,143 +83,344 @@ public class BbsmngrController {
|
||||
@Value("${mngrfo.common.board.nc.ntcntalkSndngFormInnb02}")
|
||||
private String ntcntalkSndngFormInnb2;
|
||||
|
||||
@Autowired
|
||||
private BOBbsService service;
|
||||
|
||||
@Autowired
|
||||
private PaginationProperties paginationProperties;
|
||||
|
||||
|
||||
/**
|
||||
* 게시판 화면
|
||||
* @param BbsmngrVO 게시판 등록 파라미터 VO
|
||||
* @param vo 게시판 등록 파라미터 VO
|
||||
* @return String JSP 경로
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectBbsListInqireForm")
|
||||
public String selectBbsListInqireForm(BbsmngrVO vo, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
public String selectBbsListInqireForm(BOBbsVO vo, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/bbs/selectBOBbsListInqireFrom", vo),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
}
|
||||
|
||||
log.debug(" 검색 파라미터 확인 : {}", vo);
|
||||
|
||||
DataMap content = new DataMap();
|
||||
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(vo.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(vo.getPageUnit());
|
||||
paginationInfo.setPageSize(paginationProperties.getPageSize());
|
||||
|
||||
vo.setPaginationInfo(paginationInfo);
|
||||
vo.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
vo.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
vo.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
List<DataMap> formList = new ArrayList<>();
|
||||
DataMap fromMap = new DataMap();
|
||||
fromMap = service.selectBOBbsListInqireFrom(vo);
|
||||
formList.add(fromMap);
|
||||
|
||||
List<DataMap> srchList = new ArrayList<>();
|
||||
DataMap srchData = new DataMap();
|
||||
srchData.put("srchWord", vo.getSrchWord());
|
||||
srchData.put("srchBbsTyCd", vo.getSrchBbsTyCd());
|
||||
srchData.put("srchSknTyCd", vo.getSrchSknTyCd());
|
||||
srchData.put("pageUnit", vo.getPageUnit());
|
||||
srchData.put("pageIndex", vo.getPageIndex());
|
||||
srchData.put("pageDv", vo.getPageDv());
|
||||
srchList.add(srchData);
|
||||
|
||||
content.put("srchList", srchList);
|
||||
content.put("formList", formList);
|
||||
content.put("boBbsVo", vo);
|
||||
|
||||
model.addAttribute("resultMap", content);
|
||||
|
||||
return "mngr/bbs/bbsmngr/BbsListRForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* 게시판 목록 조회
|
||||
* @param BbsmngrVO 게시판 등록 파라미터 VO
|
||||
* @param vo 게시판 등록 파라미터 VO
|
||||
* @return String JSP 경로
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectBbsListInqire")
|
||||
public String selectBbsListInqire(BbsmngrVO vo, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
public String selectBbsListInqire(BOBbsVO vo, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/bbs/selectBOBbsListInqire", vo),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
}
|
||||
// 쇼핑몰코드
|
||||
|
||||
DataMap content = new DataMap();
|
||||
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(vo.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(vo.getPageUnit());
|
||||
paginationInfo.setPageSize(paginationProperties.getPageSize());
|
||||
|
||||
vo.setPaginationInfo(paginationInfo);
|
||||
vo.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
vo.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
vo.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
DataMap srchMap = new DataMap();
|
||||
if (!ObjectUtils.isEmpty(vo.getSrchSknTyCdArr())) {
|
||||
srchMap.put("srchSknTyCd", String.join(",", vo.getSrchSknTyCdArr()));
|
||||
} else {
|
||||
srchMap.put("srchSknTyCd", "");
|
||||
}
|
||||
if (!ObjectUtils.isEmpty(vo.getSrchBbsTyCdArr())) {
|
||||
srchMap.put("srchBbsTyCd", String.join(",", vo.getSrchBbsTyCdArr()));
|
||||
} else {
|
||||
srchMap.put("srchBbsTyCd", "");
|
||||
}
|
||||
if (!StringUtil.isEmpty(vo.getSrchWord())) {
|
||||
srchMap.put("srchWord", vo.getSrchWord());
|
||||
} else {
|
||||
srchMap.put("srchWord", "");
|
||||
}
|
||||
List<DataMap> srchList = new ArrayList<>();
|
||||
srchList.add(srchMap);
|
||||
content.put("srchList", srchList);
|
||||
|
||||
List<DataMap> bbsList = new ArrayList<>();
|
||||
bbsList = service.selectBOBbsListInqire(vo);
|
||||
content.put("bbsList", bbsList);
|
||||
content.put("boBbsVo", vo);
|
||||
content.put("paginationInfo", vo.getPaginationInfo());
|
||||
|
||||
model.addAttribute("resultMap",content);
|
||||
|
||||
return "mngr/bbs/bbsmngr/BbsListR";
|
||||
}
|
||||
|
||||
/**
|
||||
* 안내 허용 도메인 파일 팝업
|
||||
* @param BbsmngrVO 게시판 등록 파라미터 VO
|
||||
* @param model 모델객체
|
||||
* @param vo 게시판 등록 파라미터 VO
|
||||
* @return String JSP 경로
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectGuidancePermDomnFilPopup", method = RequestMethod.GET)
|
||||
public ResponseEntity<WnbtResponse> selectGuidancePermDomnFilPopup(BbsmngrVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
@RequestMapping(value="/selectGuidancePermDomnFilPopup", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> selectGuidancePermDomnFilPopup(BOBbsVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/bbs/selectBOSlangDftSetupPopupForm", vo),
|
||||
ReplyFromResrc::getReply
|
||||
);
|
||||
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
} // 쇼핑몰코드
|
||||
|
||||
DataMap content = new DataMap();
|
||||
BOBbsSetupVO stVo = new BOBbsSetupVO();
|
||||
|
||||
stVo = service.selectBOSlangDftSetupPopupForm(vo);
|
||||
content.put("boBbsSetupVo", stVo);
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
}
|
||||
/**
|
||||
* 안내 허용 도메인 파일 수정
|
||||
* @param BbsmngrVO 게시판 등록 파라미터 VO
|
||||
* @param vo 게시판 등록 파라미터 VO
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/updateGuidancePermDomnFil" , method = RequestMethod.POST)
|
||||
public ResponseEntity<WnbtResponse> updateGuidancePermDomnFil(BbsmngrVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
@RequestMapping(value="/updateGuidancePermDomnFil" , method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> updateGuidancePermDomnFil(BOBbsVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/bbs/updateBOSlangSetupRegist", vo),
|
||||
ReplyFromResrc::getReply
|
||||
);
|
||||
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
} // 쇼핑몰코드
|
||||
vo.setRegusr(user.getUserInnb()); // 등록자
|
||||
vo.setUpdusr(user.getUserInnb()); // 수정자
|
||||
|
||||
DataMap content = new DataMap();
|
||||
|
||||
String message = service.updateBOSlangSetupRegist(vo);
|
||||
BOBbsSetupVO stVo = new BOBbsSetupVO();
|
||||
stVo = service.selectBOSlangDftSetupPopupForm(vo);
|
||||
content.put("boBbsSetupVo", stVo);
|
||||
content.put("message", message);
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
}
|
||||
/**
|
||||
* 비속어 기본 설정 팝업
|
||||
* @param BbsmngrVO 게시판 등록 파라미터 VO
|
||||
* @param vo 게시판 등록 파라미터 VO
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectSlangDftSetupPopupForm", method = RequestMethod.GET)
|
||||
public ResponseEntity<WnbtResponse> selectSlangDftSetupPopupForm(BbsmngrVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
@RequestMapping(value="/selectSlangDftSetupPopupForm", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> selectSlangDftSetupPopupForm(BOBbsVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/bbs/selectBOSlangDftSetupPopupForm", vo),
|
||||
ReplyFromResrc::getReply
|
||||
);
|
||||
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
} // 쇼핑몰코드
|
||||
|
||||
DataMap content = new DataMap();
|
||||
BOBbsSetupVO stVo = new BOBbsSetupVO();
|
||||
|
||||
stVo = service.selectBOSlangDftSetupPopupForm(vo);
|
||||
content.put("boBbsSetupVo", stVo);
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
}
|
||||
/**
|
||||
* 비속어 설정 저장
|
||||
* @param BbsmngrVO 게시판 등록 파라미터 VO
|
||||
* @param vo 게시판 등록 파라미터 VO
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/updateSlangSetupRegist" , method = RequestMethod.POST)
|
||||
public ResponseEntity<WnbtResponse> updateSlangSetupRegist(BbsmngrVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
@RequestMapping(value="/updateSlangSetupRegist" , method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> updateSlangSetupRegist(BOBbsVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/bbs/updateBOSlangSetupRegist", vo),
|
||||
ReplyFromResrc::getReply
|
||||
);
|
||||
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
} // 쇼핑몰코드
|
||||
vo.setRegusr(user.getUserInnb()); // 등록자
|
||||
vo.setUpdusr(user.getUserInnb()); // 수정자
|
||||
|
||||
DataMap content = new DataMap();
|
||||
|
||||
String message = service.updateBOSlangSetupRegist(vo);
|
||||
BOBbsSetupVO stVo = new BOBbsSetupVO();
|
||||
stVo = service.selectBOSlangDftSetupPopupForm(vo);
|
||||
content.put("boBbsSetupVo", stVo);
|
||||
content.put("message", message);
|
||||
|
||||
content.put("boBbsSetupVo", stVo);
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
}
|
||||
/**
|
||||
* 게시판 등록화면
|
||||
* @param BbsmngrVO 게시판 등록 파라미터 VO
|
||||
* @param vo 게시판 등록 파라미터 VO
|
||||
* @return String JSP 경로
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectBbsRegistForm")
|
||||
public String selectBbsRegistForm(BbsmngrVO vo, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
public String selectBbsRegistForm(BOBbsVO vo, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
|
||||
vo.setNtcntalkSndngFormInnbArr(new String[] {ntcntalkSndngFormInnb1, ntcntalkSndngFormInnb2});
|
||||
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/bbs/selectBOBbsRegistForm",vo)
|
||||
);
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
}
|
||||
// 쇼핑몰코드
|
||||
vo.setRegusr(user.getUserInnb()); // 등록자
|
||||
vo.setUpdusr(user.getUserInnb()); // 수정자
|
||||
|
||||
DataMap codeMap = new DataMap();
|
||||
codeMap = service.selectCommonCode();
|
||||
|
||||
List<DataMap> codeList = new ArrayList<>();
|
||||
codeList.add(codeMap);
|
||||
List<DataMap> mbrGradList = new ArrayList<>();
|
||||
|
||||
vo.setMbrGradGroupInnb("1");
|
||||
mbrGradList = service.selectBOBbsRegistForm(vo);
|
||||
|
||||
List<DataMap> updBbsList = new ArrayList<>();
|
||||
updBbsList = service.selectUpdBbsList(vo);
|
||||
|
||||
List<DataMap> messageList = new ArrayList<>();
|
||||
DataMap sms = new DataMap();
|
||||
sms = service.selectBOBbsSmsFormList(vo);
|
||||
|
||||
DataMap kakao = new DataMap();
|
||||
kakao = service.selectBOBbsKakaoFormList(vo);
|
||||
|
||||
List<DataMap> srchList = new ArrayList<>();
|
||||
DataMap srchData = new DataMap();
|
||||
srchData.put("pageIndex", vo.getPageIndex());
|
||||
srchData.put("pageUnit", vo.getPageUnit());
|
||||
srchData.put("srchWord", vo.getSrchWord());
|
||||
srchData.put("srchSknTyCd", vo.getSrchSknTyCd());
|
||||
srchData.put("srchBbsTyCd", vo.getSrchBbsTyCd());
|
||||
srchList.add(srchData);
|
||||
|
||||
DataMap content = new DataMap();
|
||||
content.put("mbrGradList", mbrGradList);
|
||||
content.put("codeContent", codeList);
|
||||
content.put("bOBbsVo", vo);
|
||||
content.put("srchList", srchList);
|
||||
content.put("updBbsList", updBbsList);
|
||||
content.put("sms", sms);
|
||||
content.put("kakao", kakao);
|
||||
|
||||
// Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/bbs/selectBOBbsRegistForm",vo)
|
||||
// );
|
||||
//
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
try {
|
||||
resultMap.put("updBbsList", objectMapper.writeValueAsString(resultMap.get("updBbsList")));
|
||||
content.put("updBbsList", objectMapper.writeValueAsString(content.get("updBbsList")));
|
||||
|
||||
} catch (WnbtRestException wre){
|
||||
throw new WnbtRestException(wre.getMessage());
|
||||
log.error(wre.getMessage(), wre);
|
||||
throw new WnbtRestException(ErrorCode.INTERNAL_SERVER_ERROR);
|
||||
} catch(Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new WnbtRestException(ErrorCode.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
model.addAttribute("resultMap", resultMap);
|
||||
|
||||
model.addAttribute("resultMap", content);
|
||||
|
||||
return "mngr/bbs/bbsmngr/BbsRegistC";
|
||||
}
|
||||
|
||||
/**
|
||||
* 게시판 등록
|
||||
* @param BbsmngrVO 게시판 등록 파라미터 VO
|
||||
* @param vo 게시판 등록 파라미터 VO
|
||||
* @param bindingResult 바인딩 및 정합성 점검결과 객체
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/insertBbsRegist", method = RequestMethod.POST)
|
||||
public ResponseEntity<WnbtResponse> insertBbsRegist(@Validated BbsmngrVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd, BindingResult bindingResult){
|
||||
@RequestMapping(value="/insertBbsRegist", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> insertBbsRegist(@Validated BOBbsVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd, BindingResult bindingResult){
|
||||
|
||||
if(bindingResult.hasErrors()) {
|
||||
throw new WnbtRestException(ValidateResultConverter.convert(bindingResult, gconeMessageSource));
|
||||
}
|
||||
List<Map<String, String>> errorList = new ArrayList<>();
|
||||
if (vo.getPgeVtcCnt() <= 0) {
|
||||
if (vo.getPgeVtcCnt() == null || Integer.parseInt(vo.getPgeVtcCnt() )<= 0) {
|
||||
errorList.add(ValidateResultConverter.setErrorMap("pgeVtcCnt", gconeMessageSource.getMessage("errors.required", new Object[]{"페이지세로건수는 최소 1 입니다."})));
|
||||
}
|
||||
//메시지 문자 내용 없을 시
|
||||
@@ -238,20 +451,34 @@ public class BbsmngrController {
|
||||
throw new WnbtRestException(ValidateResultConverter.convertCustomValidate(errorList));
|
||||
}
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/bbs/insertBOBbsRegist", vo),
|
||||
ReplyFromResrc::getReply
|
||||
);
|
||||
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
}// 쇼핑몰코드
|
||||
vo.setRegusr(user.getUserInnb()); // 등록자
|
||||
vo.setUpdusr(user.getUserInnb()); // 수정자
|
||||
|
||||
DataMap content = new DataMap();
|
||||
content = service.insertBOBbsRegist(vo);
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
|
||||
}
|
||||
/**
|
||||
* 게시판 아이디 중복확인
|
||||
* @param BbsmngrVO 게시판 등록 파라미터 VO
|
||||
* @param bindingResult 바인딩 및 정합성 점검결과 객체
|
||||
* @param vo 게시판정보 VO
|
||||
* @param authSopmalCd 몰코드
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectBbsIdDplctCnfirm", method = RequestMethod.GET)
|
||||
public ResponseEntity<WnbtResponse> selectBbsIdDplctCnfirm(BbsmngrVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
public ResponseEntity<WnbtResponse> selectBbsIdDplctCnfirm(BOBbsVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
|
||||
List<Map<String, String>> errorList = new ArrayList<>();
|
||||
final String REGEX_ID = "^[A-Za-z[0-9]-_$]{6,30}$";
|
||||
@@ -263,14 +490,22 @@ public class BbsmngrController {
|
||||
throw new WnbtRestException(ValidateResultConverter.convertCustomValidate(errorList));
|
||||
}
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/bbs/selectBOBbsIdDplctCnfirm", vo),
|
||||
ReplyFromResrc::getReply
|
||||
);
|
||||
|
||||
String result = service.selectBOBbsIdDplctCnfirm(vo);
|
||||
|
||||
DataMap content = new DataMap();
|
||||
content.put("paramVO", vo);
|
||||
content.put("message", result);
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
}
|
||||
/**
|
||||
* 게시판 수정 폼
|
||||
* @param BbsmngrVO 게시판 등록 파라미터 VO
|
||||
* @param vo 게시판 등록 파라미터 VO
|
||||
* @param model 모델객체
|
||||
* @return String JSP 경로
|
||||
*/
|
||||
@@ -284,7 +519,9 @@ public class BbsmngrController {
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/bbs/selectBOBbsDtlUpdtForm",vo)
|
||||
);
|
||||
);
|
||||
|
||||
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
try {
|
||||
resultMap.put("updBbsList", objectMapper.writeValueAsString(resultMap.get("updBbsList")));
|
||||
@@ -298,14 +535,15 @@ public class BbsmngrController {
|
||||
|
||||
return "mngr/bbs/bbsmngr/BbsDtlUpdtU";
|
||||
}
|
||||
|
||||
/**
|
||||
* 게시판 수정
|
||||
* @param BbsmngrVO 게시판 등록 파라미터 VO
|
||||
* @param vo 게시판 등록 파라미터 VO
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/updateBbsUpdt")
|
||||
public ResponseEntity<WnbtResponse> updateBbsUpdt(@Validated BbsmngrVO vo, BindingResult bindingResult, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
@RequestMapping(value="/updateBbsUpdt", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> updateBbsUpdt(@Validated BOBbsVO vo, BindingResult bindingResult, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
if(bindingResult.hasErrors()) {
|
||||
throw new WnbtRestException(ValidateResultConverter.convert(bindingResult, gconeMessageSource));
|
||||
}
|
||||
@@ -349,36 +587,107 @@ public class BbsmngrController {
|
||||
}
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/bbs/updateBOBbsUpdt", vo),
|
||||
ReplyFromResrc::getReply
|
||||
);
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
}// 쇼핑몰코드
|
||||
vo.setRegusr(user.getUserInnb()); // 등록자
|
||||
vo.setUpdusr(user.getUserInnb()); // 수정자
|
||||
|
||||
log.debug(" 게시판 수정 파라미터 확인 : {}", vo);
|
||||
|
||||
DataMap content = new DataMap();
|
||||
content = service.updateBOBbsUpdt(vo);
|
||||
|
||||
List<DataMap> srchList = new ArrayList<>();
|
||||
DataMap srchData = new DataMap();
|
||||
srchData.put("srchWord", vo.getSrchWord());
|
||||
srchData.put("srchBbsTyCd", vo.getSrchBbsTyCd());
|
||||
srchData.put("srchSknTyCd", vo.getSrchSknTyCd());
|
||||
srchData.put("pageUnit", vo.getPageUnit());
|
||||
srchData.put("pageIndex", vo.getPageIndex());
|
||||
srchData.put("pageDv", vo.getPageDv());
|
||||
srchList.add(srchData);
|
||||
content.put("srchList", srchList);
|
||||
content.put("vo", vo);
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
}
|
||||
/**
|
||||
* 게시판 복사 폼
|
||||
* @param BbsmngrVO 게시판 등록 파라미터 VO
|
||||
* @param vo 게시판 등록 파라미터 VO
|
||||
* @param model 모델객체
|
||||
* @return String JSP 경로
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectBbsCopyForm")
|
||||
public String selectBbsCopyForm(BbsmngrVO vo, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
public String selectBbsCopyForm(BOBbsVO vo, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
|
||||
vo.setNtcntalkSndngFormInnbArr(new String[] {ntcntalkSndngFormInnb1, ntcntalkSndngFormInnb2});
|
||||
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/bbs/selectBOBbsDtlUpdtForm",vo)
|
||||
);
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
} // 쇼핑몰코드
|
||||
vo.setRegusr(user.getUserInnb()); // 등록자
|
||||
vo.setUpdusr(user.getUserInnb()); // 수정자
|
||||
|
||||
DataMap codeMap = new DataMap();
|
||||
codeMap = service.selectCommonCode(); // 공통 코드
|
||||
|
||||
List<DataMap> codeList = new ArrayList<>();
|
||||
codeList.add(codeMap);
|
||||
|
||||
List<DataMap> mbrGradList = new ArrayList<>();
|
||||
mbrGradList = service.selectBOBbsRegistForm(vo); //해당 쇼핑몰 회원 등급 조회
|
||||
|
||||
List<DataMap> updBbsList = new ArrayList<>();
|
||||
updBbsList = service.selectUpdBbsList(vo); // 해당 쇼핑몰 게시판 목록 조회
|
||||
|
||||
List<DataMap> messageList = new ArrayList<>();
|
||||
DataMap sms = new DataMap();
|
||||
sms = service.selectBOBbsSmsFormList(vo); // 메시지 폼
|
||||
|
||||
DataMap kakao = new DataMap();
|
||||
kakao = service.selectBOBbsKakaoFormList(vo); // 카카오 폼
|
||||
|
||||
List<DataMap> srchList = new ArrayList<>();
|
||||
DataMap srchData = new DataMap();
|
||||
srchData.put("srchWord", vo.getSrchWord());
|
||||
srchData.put("srchBbsTyCd", vo.getSrchBbsTyCd());
|
||||
srchData.put("srchSknTyCd", vo.getSrchSknTyCd());
|
||||
srchData.put("pageUnit", vo.getPageUnit());
|
||||
srchData.put("pageIndex", vo.getPageIndex());
|
||||
srchData.put("pageDv", vo.getPageDv());
|
||||
srchList.add(srchData);
|
||||
|
||||
DataMap resultMap = new DataMap();
|
||||
resultMap = service.selectBOBbsDtlUpdtInqire(vo); // 게시판 상세 조회
|
||||
resultMap.put("mbrGradList", mbrGradList);
|
||||
resultMap.put("codeContent", codeList);
|
||||
resultMap.put("srchList", srchList);
|
||||
resultMap.put("updBbsList", updBbsList);
|
||||
resultMap.put("sms", sms);
|
||||
resultMap.put("kakao", kakao);
|
||||
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
try {
|
||||
resultMap.put("updBbsList", objectMapper.writeValueAsString(resultMap.get("updBbsList")));
|
||||
|
||||
} catch (WnbtRestException wre){
|
||||
log.error(wre.getMessage(), wre);
|
||||
throw new WnbtRestException(wre.getMessage());
|
||||
} catch(Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new WnbtRestException(ErrorCode.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
model.addAttribute("resultMap", resultMap);
|
||||
|
||||
@@ -386,34 +695,57 @@ public class BbsmngrController {
|
||||
}
|
||||
/**
|
||||
* 게시판 삭제
|
||||
* @param BbsmngrVO 게시판 등록 파라미터 VO
|
||||
* @param vo 게시판 정보 VO
|
||||
* @return String JSP 경로
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/deleteBbsDel")
|
||||
public ResponseEntity<WnbtResponse> deleteBbsDel(BbsmngrVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
@RequestMapping(value="/deleteBbsDel", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> deleteBbsDel(BOBbsVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/bbs/updateBOBbsDel", vo),
|
||||
ReplyFromResrc::getReply
|
||||
);
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
} // 쇼핑몰코드
|
||||
vo.setRegusr(user.getUserInnb()); // 등록자
|
||||
vo.setUpdusr(user.getUserInnb()); // 수정자
|
||||
|
||||
String result = service.updateBOBbsDel(vo);
|
||||
|
||||
DataMap content = new DataMap();
|
||||
content.put("paramVO", vo);
|
||||
content.put("message", result);
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
}
|
||||
/**
|
||||
* 게시글 대시보드 조회폼
|
||||
* @param BbsmngrVO 게시판 등록 파라미터 VO
|
||||
* @param vo 게시판 등록 파라미터 VO
|
||||
* @param model 모델객체
|
||||
* @return String JSP 경로
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectBbscttDshboardInqireForm")
|
||||
public String selectBbscttDshboardInqireForm(BbsmngrVO vo, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
public String selectBbscttDshboardInqireForm(BOBbsVO vo, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/bbs/selectBOBbscttDshboardInqireForm",vo)
|
||||
);
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
}
|
||||
// 쇼핑몰코드
|
||||
vo.setRegusr(user.getUserInnb()); // 등록자
|
||||
vo.setUpdusr(user.getUserInnb()); // 수정자
|
||||
|
||||
DataMap resultMap = new DataMap();
|
||||
resultMap = service.selectBOBbscttDshboardInqireForm(vo);
|
||||
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
@@ -421,9 +753,11 @@ public class BbsmngrController {
|
||||
resultMap.put("updBbsList", objectMapper.writeValueAsString(resultMap.get("updBbsList")));
|
||||
|
||||
} catch (WnbtRestException wre){
|
||||
log.error(wre.getMessage(), wre);
|
||||
throw new WnbtRestException(wre.getMessage());
|
||||
} catch(Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new WnbtRestException(ErrorCode.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
model.addAttribute("resultMap", resultMap);
|
||||
|
||||
@@ -431,53 +765,97 @@ public class BbsmngrController {
|
||||
}
|
||||
/**
|
||||
* 게시글 대시보드 조회
|
||||
* @param BbsmngrVO 게시판 등록 파라미터 VO
|
||||
* @param vo 게시판 등록 파라미터 VO
|
||||
* @param model 모델객체
|
||||
* @return String JSP 경로
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectBbscttDshboardInqire")
|
||||
public String selectBbscttDshboardInqire(BbsmngrVO vo, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
public String selectBbscttDshboardInqire(BOBbsVO vo, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/bbs/selectBOBbscttDshboardInqire", vo),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
} // 쇼핑몰코드
|
||||
vo.setRegusr(user.getUserInnb()); // 등록자
|
||||
vo.setUpdusr(user.getUserInnb()); // 수정자
|
||||
|
||||
DataMap content = new DataMap();
|
||||
content = service.selectBOBbscttDshboardInqire(vo);
|
||||
model.addAttribute("resultMap",content);
|
||||
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/bbs/selectBOBbscttDshboardInqire", vo),
|
||||
// model,
|
||||
// "resultMap"
|
||||
// );
|
||||
|
||||
return "mngr/bbs/bbsmngr/BbscttDshboardR";
|
||||
}
|
||||
|
||||
/**
|
||||
* 주요 게시판 보기 설정 팝업
|
||||
* @param BbsmngrVO
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMainBbsExpsrSetupPopupForm")
|
||||
public ResponseEntity<WnbtResponse> selectMainBbsExpsrSetupPopupForm(BbsmngrVO vo, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
@RequestMapping(value="/selectMainBbsExpsrSetupPopupForm", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> selectMainBbsExpsrSetupPopupForm(BOBbsVO vo, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
} // 쇼핑몰코드
|
||||
vo.setRegusr(user.getUserInnb()); // 등록자
|
||||
vo.setUpdusr(user.getUserInnb()); // 수정자
|
||||
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/bbs/selectBOMainBbsExpsrSetupPopupForm", vo),
|
||||
ReplyFromResrc::getReply
|
||||
);
|
||||
DataMap content = new DataMap();
|
||||
|
||||
content = service.selectBOMainBbsExpsrSetupPopupForm(vo);
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
// return responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/bbs/selectBOMainBbsExpsrSetupPopupForm", vo),
|
||||
// ReplyFromResrc::getReply
|
||||
// );
|
||||
}
|
||||
/**
|
||||
* 주요 게시판 보기 설정 수정
|
||||
* @param BbsmngrVO 게시판 등록 파라미터 VO
|
||||
* @param vo 게시판 등록 파라미터 VO
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/updateMainBbsExpsrSetupUpdt" , method = RequestMethod.POST)
|
||||
public ResponseEntity<WnbtResponse> updateMainBbsExpsrSetupUpdt(BbsmngrVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
@RequestMapping(value="/updateMainBbsExpsrSetupUpdt" , method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> updateMainBbsExpsrSetupUpdt(BOBbsVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
} // 쇼핑몰코드
|
||||
vo.setRegusr(user.getUserInnb()); // 등록자
|
||||
vo.setUpdusr(user.getUserInnb()); // 수정자
|
||||
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/bbs/updateBOMainBbsExpsrSetupUpdt", vo),
|
||||
ReplyFromResrc::getReply
|
||||
);
|
||||
DataMap content = new DataMap();
|
||||
|
||||
content = service.updateBOMainBbsExpsrSetupUpdt(vo);
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
// return responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/bbs/updateBOMainBbsExpsrSetupUpdt", vo),
|
||||
// ReplyFromResrc::getReply
|
||||
// );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,15 +1,27 @@
|
||||
package com.wb.domainserver.domain.mngr.bbs.cnslt.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.admin.sys.comncd.service.BOMaComncdService;
|
||||
import com.wb.domainserver.domain.admin.sys.comncd.vo.BOMaComncdVO;
|
||||
import com.wb.domainserver.domain.gcone.bbs.cnslt.service.BOCnsltService;
|
||||
import com.wb.domainserver.domain.gcone.bbs.cnslt.vo.BOCnsltVO;
|
||||
import com.wb.domainserver.domain.gcone.common.service.BOCommonService;
|
||||
import com.wb.domainserver.domain.mngr.bbs.cnslt.vo.CnsltVO;
|
||||
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.*;
|
||||
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;
|
||||
@@ -19,6 +31,7 @@ import org.springframework.web.bind.annotation.CookieValue;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -38,20 +51,44 @@ public class CnsltController {
|
||||
@Autowired
|
||||
private GconeMessageSource gconeMessageSource;
|
||||
|
||||
|
||||
@Autowired
|
||||
private BOCnsltService service;
|
||||
|
||||
@Autowired
|
||||
private BOMaComncdService bOMaComncdService;
|
||||
|
||||
@Autowired
|
||||
private PaginationProperties paginationProperties;
|
||||
|
||||
@Autowired
|
||||
private BOCommonService boCommonService;
|
||||
|
||||
/**
|
||||
* 고객상담 통합게시판 목록 이동
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectCstmrCnsltUnityBbscttListInqireForm")
|
||||
public String selectCstmrCnsltUnityBbscttListInqireForm(CnsltVO cnsltVO, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
public String selectCstmrCnsltUnityBbscttListInqireForm(BOCnsltVO cnsltVO, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
cnsltVO.setSopmalCd(authSopmalCd);
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/cnslt/selectBOCstmrCnsltUnityBbscttListInqireForm", cnsltVO),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
Map<String, Object> content = new HashMap<>();
|
||||
|
||||
// 공통코드 호출
|
||||
BOMaComncdVO bOMaComncdVO = new BOMaComncdVO();
|
||||
bOMaComncdVO.setGroupCd("COUNSEL_PROCS_STTUS"); // 상담처리상태
|
||||
List<?> procsSttusCdList = bOMaComncdService.selectBOCommcdDetailList(bOMaComncdVO);
|
||||
|
||||
// 공통코드와 리스트를 넣어줌
|
||||
content.put("paramVO", cnsltVO);
|
||||
content.put("procsSttusCdList", procsSttusCdList);
|
||||
|
||||
model.addAttribute("resultMap",content);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/cnslt/selectBOCstmrCnsltUnityBbscttListInqireForm", cnsltVO),
|
||||
// model,
|
||||
// "resultMap"
|
||||
// );
|
||||
|
||||
return "mngr/bbs/cnslt/CstmrCnsltUnityBbscttListRForm";
|
||||
}
|
||||
@@ -65,13 +102,48 @@ public class CnsltController {
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectCstmrCnsltUnityBbscttListInqire")
|
||||
public String selectCstmrCnsltUnityBbscttListInqire(CnsltVO cnsltVO, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
public String selectCstmrCnsltUnityBbscttListInqire(BOCnsltVO cnsltVO, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
cnsltVO.setSopmalCd(authSopmalCd);
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/cnslt/selectBOCstmrCnsltUnityBbscttListInqire", cnsltVO),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
cnsltVO.setSopmalCd(user.getSopmalCd());
|
||||
}
|
||||
Map<String, Object> content = new HashMap<>();
|
||||
|
||||
// 페이징 객체 생성 & 페이징정보 할당
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(cnsltVO.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(cnsltVO.getPageUnit());
|
||||
paginationInfo.setPageSize(paginationProperties.getPageSize());
|
||||
cnsltVO.setPaginationInfo(paginationInfo);
|
||||
|
||||
cnsltVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
cnsltVO.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
cnsltVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
// 공통코드 호출
|
||||
BOMaComncdVO bOMaComncdVO = new BOMaComncdVO();
|
||||
bOMaComncdVO.setGroupCd("COUNSEL_PROCS_STTUS"); // 상담처리상태
|
||||
List<?> procsSttusCdList = bOMaComncdService.selectBOCommcdDetailList(bOMaComncdVO);
|
||||
|
||||
cnsltVO.setSecretKey(boCommonService.selectSecretkey());
|
||||
List<DataMap> resultList = service.selectBOCstmrCnsltUnityBbscttListInqire(cnsltVO);
|
||||
|
||||
// 맵에 페이징 정보와 리스트를 넣어줌
|
||||
content.put("paramVO", cnsltVO);
|
||||
content.put("resultList", resultList);
|
||||
content.put("paginationInfo", cnsltVO.getPaginationInfo());
|
||||
content.put("procsSttusCdList", procsSttusCdList); // 상담처리상태
|
||||
|
||||
model.addAttribute("resultMap", content);
|
||||
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/cnslt/selectBOCstmrCnsltUnityBbscttListInqire", cnsltVO),
|
||||
// model,
|
||||
// "resultMap"
|
||||
// );
|
||||
|
||||
return "mngr/bbs/cnslt/CstmrCnsltUnityBbscttListR";
|
||||
}
|
||||
@@ -83,13 +155,39 @@ public class CnsltController {
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectCstmrCnsltDtlUpdtInqirePopup")
|
||||
public String selectCstmrCnsltDtlUpdtInqirePopup(CnsltVO cnsltVO, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
public String selectCstmrCnsltDtlUpdtInqirePopup(BOCnsltVO cnsltVO, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
cnsltVO.setSopmalCd(authSopmalCd);
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/cnslt/selectBOCnsltDtlUpdtInqirePopup", cnsltVO),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
cnsltVO.setSopmalCd(user.getSopmalCd());
|
||||
} // 쇼핑몰코드
|
||||
|
||||
Map<String, Object> content = new HashMap<>();
|
||||
|
||||
// 공통코드 호출
|
||||
BOMaComncdVO bOMaComncdVO = new BOMaComncdVO();
|
||||
bOMaComncdVO.setGroupCd("COUNSEL_PROCS_STTUS"); // 상담처리상태
|
||||
List<?> procsSttusCdList = bOMaComncdService.selectBOCommcdDetailList(bOMaComncdVO);
|
||||
bOMaComncdVO.setGroupCd("TELNB_DV"); // 인콜/아웃콜
|
||||
List<?> telnbDvCdList = bOMaComncdService.selectBOCommcdDetailList(bOMaComncdVO);
|
||||
|
||||
//시크릿키 set
|
||||
cnsltVO.setSecretKey(boCommonService.selectSecretkey());
|
||||
DataMap result = new DataMap();
|
||||
result = service.selectBOCnsltDtlUpdtInqirePopup(cnsltVO);
|
||||
|
||||
content.put("cnsltVO", result);
|
||||
content.put("procsSttusCdList", procsSttusCdList);
|
||||
content.put("telnbDvCdList", telnbDvCdList);
|
||||
|
||||
model.addAttribute("resultMap", content);
|
||||
// responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/cnslt/selectBOCnsltDtlUpdtInqirePopup", cnsltVO),
|
||||
// model,
|
||||
// "resultMap"
|
||||
// );
|
||||
|
||||
return "mngr/bbs/cnslt/CstmrCnsltDtlUpdtPopupU";
|
||||
}
|
||||
@@ -100,8 +198,8 @@ public class CnsltController {
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value = "/updateCstmrCnsltUpdt")
|
||||
public ResponseEntity<WnbtResponse> updateCstmrCnsltUpdt(@Validated CnsltVO cnsltVO, BindingResult bindingResult, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
@RequestMapping(value = "/updateCstmrCnsltUpdt", produces= MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> updateCstmrCnsltUpdt(@Validated BOCnsltVO cnsltVO, BindingResult bindingResult, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
// 정합성 검사
|
||||
if(bindingResult.hasErrors()) {
|
||||
throw new WnbtRestException(ValidateResultConverter.convert(bindingResult, gconeMessageSource));
|
||||
@@ -134,10 +232,27 @@ public class CnsltController {
|
||||
cnsltVO.setGoodsRvwBbscttNb(null);
|
||||
}
|
||||
cnsltVO.setSopmalCd(authSopmalCd);
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/cnslt/updateBOCnsltUpdt", cnsltVO),
|
||||
ReplyFromResrc::getReply
|
||||
|
||||
// 작성자 정보 할당
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
cnsltVO.setSopmalCd(user.getSopmalCd());
|
||||
} // 쇼핑몰코드
|
||||
cnsltVO.setUpdusr(user.getUserInnb()); // 수정자
|
||||
|
||||
Map<String, Object> message = new HashMap<>();
|
||||
message = service.updateBOCnsltUpdt(cnsltVO);
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(message))
|
||||
.build()
|
||||
);
|
||||
|
||||
// return responseHandler.handleResponse(
|
||||
// sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/bbs/cnslt/updateBOCnsltUpdt", cnsltVO),
|
||||
// ReplyFromResrc::getReply
|
||||
// );
|
||||
}
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user