fix : 관리자 구독서비스 등록(복사)
This commit is contained in:
@@ -170,7 +170,7 @@ public class SubsvcController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 상품 수정(상품이미지)
|
||||
* 구독서비스 수정
|
||||
* @param vo
|
||||
* @param request
|
||||
* @return
|
||||
@@ -218,6 +218,97 @@ public class SubsvcController {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 구독서비스 등록(복사)품
|
||||
* @param vo
|
||||
* @return SubsvcC.jsp
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectSubsvcRegistForm")
|
||||
public String selectSubsvcRegistForm(BOSubsvcVO vo, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if ("01".equals(user.getSysDvCd())) {
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
}
|
||||
|
||||
Map<String, Object> content = new HashMap<>();
|
||||
content.put("paramVO", vo);
|
||||
|
||||
// 구독서비스 상세조회
|
||||
DataMap subsvcDtl = service.selectBOSubsvcDetail(vo);
|
||||
content.put("subsvcDtl", subsvcDtl);
|
||||
|
||||
//판매상태
|
||||
BOMaComncdVO param = new BOMaComncdVO();
|
||||
param.setGroupCd("GOODS_STTUS");
|
||||
List<?> subsvcSttusList = boMaComncdService.selectBOCommcdDetailList(param);
|
||||
content.put("subsvcSttusList", subsvcSttusList);
|
||||
|
||||
//노출구분
|
||||
param.setGroupCd("EXPSR_DV");
|
||||
List<?> expsrDvList = boMaComncdService.selectBOCommcdDetailList(param);
|
||||
content.put("expsrDvList", expsrDvList);
|
||||
|
||||
//가용재고정책
|
||||
param.setGroupCd("INVNTRY_POLICY");
|
||||
List<?> invntryPolicyList = boMaComncdService.selectBOCommcdDetailList(param);
|
||||
content.put("invntryPolicyList", invntryPolicyList);
|
||||
|
||||
model.addAttribute("resultMap", content);
|
||||
return "mngr/goods/subsvc/SubsvcC";
|
||||
}
|
||||
|
||||
/**
|
||||
* 구독서비스 등록
|
||||
* @param vo
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value = "/insertSubsvc", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> insertSubsvc(BOSubsvcVO vo, HttpServletRequest request, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
vo.setRegusr(user.getUserInnb());
|
||||
if ("01".equals(user.getSysDvCd())) {
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
}
|
||||
|
||||
//파일 업로드 관련 START
|
||||
List<HashMap<String, Object>> uploadFileMap = new ArrayList<HashMap<String, Object>>();
|
||||
|
||||
request.setAttribute("shopCd", vo.getSopmalCd());
|
||||
request.setAttribute("pathGubun", "GDIG"); //이미지구분코드 - 상품
|
||||
|
||||
try {
|
||||
/*파일 업로드 후 경로 추출하여 vo에 셋팅*/
|
||||
uploadFileMap = filestore.fileUpload(request);
|
||||
if(uploadFileMap.size() == 1){
|
||||
FileVo thumbNail = (FileVo) uploadFileMap.get(0).get("thumbNail");
|
||||
vo.setImg( uploadFileMap.get(0).get("filePath")+ File.separator + thumbNail.getFileName());
|
||||
}
|
||||
} catch (WnbtRestException wre) {
|
||||
log.error(wre.getMessage(), wre);
|
||||
throw new WnbtRestException("파일 업로드에 실패했습니다." + wre.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new WnbtRestException("파일 업로드에 실패했습니다." + e.getMessage());
|
||||
}
|
||||
//파일 업로드 관련 END
|
||||
|
||||
Map<String, Object> message = new HashMap<>();
|
||||
String result = service.insertBOMngrSubsvc(vo);
|
||||
message.put("message",result);
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(message))
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 구독서비스 목록 조회 리스트
|
||||
* @param vo
|
||||
@@ -262,6 +353,32 @@ public class SubsvcController {
|
||||
return "mngr/goods/subsvc/SubsvcList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 구독서비스명 중복체크
|
||||
* @param vo
|
||||
* @return ResponseEntity<WnbtResponse>
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value = "/selectSubsvcNmDupCheck", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> selectSubsvcNmDupCheck(BOSubsvcVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if("01".equals(user.getSysDvCd())){
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
}
|
||||
|
||||
DataMap message = new DataMap();
|
||||
String result = service.selectBOMngrSubsvcNmDupCheck(vo);
|
||||
message.put("message", result);
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(message))
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 구독서비스 선택삭제
|
||||
* @param vo
|
||||
|
||||
Reference in New Issue
Block a user