|
|
@@ -421,58 +421,82 @@ public class TsfPlanningController extends TsfBaseController {
|
|
|
* @author sowon
|
|
|
* @since 2021. 4. 2
|
|
|
*/
|
|
|
- @PostMapping("/event/poll/form")
|
|
|
+ @GetMapping("/event/poll/form")
|
|
|
public ModelAndView planningEventPollSave(Plan plan) {
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
Poll poll = new Poll();
|
|
|
plan.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
+ plan.setCustNo(TsfSession.getInfo().getCustNo());
|
|
|
plan.setFrontGb(TsfSession.getFrontGb());
|
|
|
- poll.setCustNo(TsfSession.getInfo().getCustNo());
|
|
|
+ poll = planningService.getPollQuestionInfo(plan);
|
|
|
+ String partYn = poll.getDupPartiYn();
|
|
|
+ String comYn = poll.getFstComYn();
|
|
|
+ int partiCnt = poll.getPartiCnt();
|
|
|
+ // 중복참여가 아닌경우
|
|
|
+ if(partYn.equals("N")) {
|
|
|
+ int count = planningService.getCustAnswerCount(plan);
|
|
|
+ if (count>0) {
|
|
|
+ mav.addObject("inaccessibleMsg", "이미 응모하셨습니다.");
|
|
|
+ mav.setViewName(super.getDeviceViewName("error/Inaccess"));
|
|
|
+ return mav;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (comYn.equals("Y")) {
|
|
|
+ int count = planningService.getCustAnswerPartiCount(poll);
|
|
|
+ if (count>=partiCnt) {
|
|
|
+ mav.addObject("inaccessibleMsg", "선착순 응모가 마감되었습니다.");
|
|
|
+ mav.setViewName(super.getDeviceViewName("error/Inaccess"));
|
|
|
+ return mav;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
mav.addObject("pollInfo", planningService.getPollQuestionInfo(plan));
|
|
|
mav.addObject("pollList", planningService.getPollQuestionList(plan));
|
|
|
mav.setViewName(super.getDeviceViewName("planning/PlanningEventPollForm"));
|
|
|
return mav;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 이벤트 설문조사 접근확인
|
|
|
- * @param
|
|
|
- * @return
|
|
|
- * @author sowon
|
|
|
- * @since 2021. 4. 3
|
|
|
- */
|
|
|
- @PostMapping("/event/poll/access")
|
|
|
- @ResponseBody
|
|
|
- public GagaMap planningEventPollAccess(@RequestBody Plan plan) {
|
|
|
-
|
|
|
- GagaMap result = new GagaMap();
|
|
|
- Poll poll = new Poll();
|
|
|
- plan.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
- plan.setFrontGb(TsfSession.getFrontGb());
|
|
|
- plan.setCustNo(TsfSession.getInfo().getCustNo());
|
|
|
-
|
|
|
- poll = planningService.getPollQuestionInfo(plan);
|
|
|
- String partYn = poll.getDupPartiYn();
|
|
|
- String comYn = poll.getFstComYn();
|
|
|
- int partiCnt = poll.getPartiCnt();
|
|
|
- // 중복참여가 아닌경우
|
|
|
- if(partYn.equals("N")) {
|
|
|
- int count = planningService.getCustAnswerCount(plan);
|
|
|
- if (count>0) {
|
|
|
- result.set("msg","이미 응모하셨습니다.");
|
|
|
- result.set("status","1");
|
|
|
- }
|
|
|
- }
|
|
|
- else if (comYn.equals("Y")) {
|
|
|
- int count = planningService.getCustAnswerPartiCount(poll);
|
|
|
- if (count>=partiCnt) {
|
|
|
- result.set("msg","선착순 응모가 마감되었습니다.");
|
|
|
- result.set("status","2");
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- return result;
|
|
|
- }
|
|
|
+// /**
|
|
|
+// * 이벤트 설문조사 접근확인
|
|
|
+// * @param
|
|
|
+// * @return
|
|
|
+// * @author sowon
|
|
|
+// * @since 2021. 4. 3
|
|
|
+// */
|
|
|
+// @PostMapping("/event/poll/access")
|
|
|
+// @ResponseBody
|
|
|
+// public GagaMap planningEventPollAccess(@RequestBody Plan plan) {
|
|
|
+//
|
|
|
+// GagaMap result = new GagaMap();
|
|
|
+// Poll poll = new Poll();
|
|
|
+// plan.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
+// plan.setFrontGb(TsfSession.getFrontGb());
|
|
|
+// plan.setCustNo(TsfSession.getInfo().getCustNo());
|
|
|
+//
|
|
|
+// poll = planningService.getPollQuestionInfo(plan);
|
|
|
+// String partYn = poll.getDupPartiYn();
|
|
|
+// String comYn = poll.getFstComYn();
|
|
|
+// int partiCnt = poll.getPartiCnt();
|
|
|
+// // 중복참여가 아닌경우
|
|
|
+// if(partYn.equals("N")) {
|
|
|
+// int count = planningService.getCustAnswerCount(plan);
|
|
|
+// if (count>0) {
|
|
|
+// result.set("msg","이미 응모하셨습니다.");
|
|
|
+// result.set("status","1");
|
|
|
+// }
|
|
|
+// }
|
|
|
+// else if (comYn.equals("Y")) {
|
|
|
+// int count = planningService.getCustAnswerPartiCount(poll);
|
|
|
+// if (count>=partiCnt) {
|
|
|
+// result.set("msg","선착순 응모가 마감되었습니다.");
|
|
|
+// result.set("status","2");
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+// return result;
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 이벤트 설문조사 저장
|