Przeglądaj źródła

[ST24PRJ-711][결함] 투표 저장 기능 오류

sshong 4 lat temu
rodzic
commit
9f09f4451a

+ 1 - 1
src/main/java/com/style24/front/biz/dao/TsfPlanningDao.java

@@ -297,7 +297,7 @@ public interface TsfPlanningDao {
 	 * @author sowon
 	 * @date 2021. 6. 18
 	 */
-	int getPollCustAnswerIndex();
+	Integer  getPollCustAnswerIndex();
 
 	/**
 	 * 설문조사 중복카운트

+ 6 - 4
src/main/java/com/style24/front/biz/service/TsfPlanningService.java

@@ -10,6 +10,8 @@ import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import com.gagaframework.web.util.GagaDateUtil;
+import com.gagaframework.web.util.GagaFileUtil;
 import com.style24.front.biz.dao.TsfCommonDao;
 import com.style24.front.biz.dao.TsfPlanningDao;
 import com.style24.front.support.security.session.TsfSession;
@@ -21,9 +23,6 @@ import com.style24.persistence.domain.Review;
 
 import lombok.extern.slf4j.Slf4j;
 
-import com.gagaframework.web.util.GagaDateUtil;
-import com.gagaframework.web.util.GagaFileUtil;
-
 /**
  * 기획전 Service
  *
@@ -391,7 +390,10 @@ public class TsfPlanningService {
 	public void savePollCustAnswer(Poll poll) {
 		poll.setCustNo(TsfSession.getInfo().getCustNo());
 		// 단수형
-		int ansIndex = planningDao.getPollCustAnswerIndex();
+		Integer  ansIndex = planningDao.getPollCustAnswerIndex();
+		if(ansIndex == null) {
+			ansIndex = 1;
+		}
 		if (poll.getPollQsq_10() != null && poll.getPollQsq_10() != "") {
 			String[] pollQsq_10 = poll.getPollQsq_10().split("/");
 			for (int i = 0; i < pollQsq_10.length; i++) {

+ 1 - 1
src/main/java/com/style24/persistence/mybatis/shop/TsfPlanning.xml

@@ -1381,7 +1381,7 @@
 		       )	
 	</insert>
 	
-	<select id="getPollCustAnswerIndex" parameterType="Plan" resultType="int">
+	<select id="getPollCustAnswerIndex" parameterType="Plan" resultType="Integer">
 		/* TsfPlanning.getPollCustAnswerIndex */
 		SELECT MAX(ANS_INDEX)+1 AS ANS_INDEX 
 		FROM TB_POLL_ANSWER