Просмотр исходного кода

Merge branch 'sowon' into develop

sowon4187 5 лет назад
Родитель
Сommit
ad5818c443

+ 32 - 26
src/main/java/com/style24/admin/biz/service/TsaPlanService.java

@@ -414,40 +414,46 @@ public class TsaPlanService {
 			if (ind < 10) {
 				imgInd = "0" + imgInd;
 			}
-			String planUploadPath = env.getProperty("upload.default.target.path");
-			String yearMonth = GagaDateUtil.getToday().substring(0, 6);
-			planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, "/planning");
-			File newFile = new File(GagaFileUtil.getConcatenationPath(planUploadPath, param.getMainPimg()));
-			planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, yearMonth);
-			String newFilename = "PLANNING_" + GagaDateUtil.getTodayDateTime() + "_" + imgInd + "." + StringUtils.getFilenameExtension(param.getMainPimg());
-			File uniqueFile = GagaFileUtil.getUniqueFile(new File(GagaFileUtil.getConcatenationPath(planUploadPath, newFilename)));
-			// Rename a file
-			File path = new File(planUploadPath);
-			if (!path.exists()) {
-				path.mkdir();
+			if (!param.getMainPimg().contains("planning")) {
+				String planUploadPath = env.getProperty("upload.default.target.path");
+				String yearMonth = GagaDateUtil.getToday().substring(0, 6);
+				planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, "/planning");
+				File newFile = new File(GagaFileUtil.getConcatenationPath(planUploadPath, param.getMainPimg()));
+				planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, yearMonth);
+				String newFilename = "PLANNING_" + GagaDateUtil.getTodayDateTime() + "_" + imgInd + "." + StringUtils.getFilenameExtension(param.getMainPimg());
+				File uniqueFile = GagaFileUtil.getUniqueFile(new File(GagaFileUtil.getConcatenationPath(planUploadPath, newFilename)));
+				// Rename a file
+				File path = new File(planUploadPath);
+				if (!path.exists()) {
+					path.mkdir();
+				}
+				newFile.renameTo(uniqueFile);
+				param.setMainPimg("/planning/" + yearMonth + "/" + newFilename);
 			}
-			newFile.renameTo(uniqueFile);
-			param.setMainPimg("/planning/" + yearMonth + "/" + newFilename);
+			
 		}
 		if(param.getMainMimg() != null && !"".equals(param.getMainMimg())){
 			String imgInd = String.valueOf(ind);
 			if (ind < 10) {
 				imgInd = "0" + imgInd;
 			}
-			String planUploadPath = env.getProperty("upload.default.target.path");
-			String yearMonth = GagaDateUtil.getToday().substring(0, 6);
-			planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, "/planning");
-			File newFile = new File(GagaFileUtil.getConcatenationPath(planUploadPath, param.getMainMimg()));
-			planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, yearMonth);
-			String newFilename = "PLANNING_" + GagaDateUtil.getTodayDateTime() + "_" + imgInd + "." + StringUtils.getFilenameExtension(param.getMainMimg());
-			File uniqueFile = GagaFileUtil.getUniqueFile(new File(GagaFileUtil.getConcatenationPath(planUploadPath, newFilename)));
-			// Rename a file
-			File path = new File(planUploadPath);
-			if (!path.exists()) {
-				path.mkdir();
+			if(!param.getMainMimg().contains("planning")) {
+				String planUploadPath = env.getProperty("upload.default.target.path");
+				String yearMonth = GagaDateUtil.getToday().substring(0, 6);
+				planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, "/planning");
+				File newFile = new File(GagaFileUtil.getConcatenationPath(planUploadPath, param.getMainMimg()));
+				planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, yearMonth);
+				String newFilename = "PLANNING_" + GagaDateUtil.getTodayDateTime() + "_" + imgInd + "." + StringUtils.getFilenameExtension(param.getMainMimg());
+				File uniqueFile = GagaFileUtil.getUniqueFile(new File(GagaFileUtil.getConcatenationPath(planUploadPath, newFilename)));
+				// Rename a file
+				File path = new File(planUploadPath);
+				if (!path.exists()) {
+					path.mkdir();
+				}
+				newFile.renameTo(uniqueFile);
+				param.setMainMimg("/planning/" + yearMonth + "/" + newFilename);
 			}
-			newFile.renameTo(uniqueFile);
-			param.setMainMimg("/planning/" + yearMonth + "/" + newFilename);
+			
 		}
 		// 최종업데이트 
 		planDao.updatePlanInfo(param);

+ 2 - 5
src/main/java/com/style24/admin/biz/service/TsaPollService.java

@@ -42,7 +42,7 @@ public class TsaPollService {
 
 		// POLL 마스터
 		Poll pollInfo = new Poll();
-		pollInfo.setPollSq(params.iterator().next().getPollSq());
+		pollInfo.setPollSqTemp(params.iterator().next().getPollSq());
 		pollInfo.setPollTitle(params.iterator().next().getPollTitle());
 		pollInfo.setSiteCd(params.iterator().next().getSiteCd());
 		pollInfo.setDupPartiYn(params.iterator().next().getDupPartiYn());
@@ -53,10 +53,7 @@ public class TsaPollService {
 		pollInfo.setRegNo(userNo);
 		pollInfo.setUpdNo(userNo);
 		
-		if(params.iterator().next().getPollSq()== null) {
-			pollDao.savePoll(pollInfo);
-		}
-		
+		pollDao.savePoll(pollInfo);
 
 		int pollSq = params.iterator().next().getPollSq() == null ? pollInfo.getPollSqTemp() : params.iterator().next().getPollSq();
 

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

@@ -204,7 +204,7 @@
 	<!-- POLL관리 투표자 목록 조회 -->
 	<select id="getPollVoterList" parameterType="Poll" resultType="Poll">
 		/* TsaPoll.getPollVoterList */
-		SELECT B.CUST_NM          AS VOTER_NM    
+		SELECT B.CUST_ID         AS VOTER_NM    
 		     , A.ANS_CUST_NO      AS ANS_CUST_NO 
 		     , A.REG_DT			  AS VOTE_DT   
 		     , A.DUMMY		      AS DUMMY  

+ 11 - 5
src/main/webapp/WEB-INF/views/marketing/PlanDetailPopupForm.html

@@ -24,6 +24,8 @@
 	<!-- 기획전 웹 수정 -->
 		<div class="panelContent" th:if="${mode == 'U'}">
 		<form th:object="${planInfo}" id="planUpdateForm" name="planUpdateForm" action="#" th:method="post">
+			<input type="hidden" name="pImg" th:value="*{mainPimg}"/>
+			<input type="hidden" name="mImg" th:value="*{mainMimg}"/>
 			<input type="hidden" name="mode" th:value="${mode}"/>
 			<input type="hidden" name="planSq" th:value="*{planSq}"/>
 
@@ -1281,8 +1283,8 @@
 							,siteCd :$('#planUpdateForm select[name=siteCd]').val()
 							,dispOrd : $('#planUpdateForm input[name=dispOrd]').val()
 							,replyYn : $('#planUpdateForm select[name=replyYn]').val()
-							,mainPimg :$('#planUpdateForm input[name=mainPimg]').val()
-							,mainMimg : $('#planUpdateForm input[name=mainMimg]').val()
+							,mainPimg :$('#planUpdateForm input[name=pImg]').val()
+							,mainMimg : $('#planUpdateForm input[name=mImg]').val()
 							,fsrcPc :  $('#planUpdateForm input[name=fsrcPc]').val()
 							,fsrcMobile : $('#planUpdateForm input[name=fsrcMobile]').val()
 							,replyImg : $('#planUpdateForm input[name=replyImg]').val()
@@ -1314,11 +1316,16 @@
 		gagajf.ajaxFileUpload('/common/file/upload?subDir=/planning'
 				, file
 				, function(result) {
-					if (name == 'registerMainPimg')
+					if (name == 'registerMainPimg'){
 						$('input[name=mainPimg]').val(result.newFileName);
+						$('input[name=pImg]').val(result.newFileName);
+					}
 
-					if (name == 'registerMainMimg')
+					if (name == 'registerMainMimg'){
 						$('input[name=mainMimg]').val(result.newFileName);
+						$('input[name=mimg]').val(result.newFileName);
+					}
+						
 
 					if (name == 'registerDtlPimg')
 						$('input[name=dtlPimg]').val(result.newFileName);
@@ -1333,7 +1340,6 @@
 		);
 	});
 
-
 	var fnChangePlanGb = function(obj) {
 		if($(obj).val()=='E'){
 			$("#questionEventInsert").show();

+ 14 - 2
src/main/webapp/WEB-INF/views/marketing/PollListForm.html

@@ -68,7 +68,12 @@
 				</li>
 				<li style="width:40%">
 					<div class="panelBar">
+						<ul class="panelBar">
 						<h4 id="pollQtitle">투표자 수</h4>
+							<li class="right">
+								<button type="button" class="btn btn-default btn-lg" id="btnExcel">엑셀다운로드</button>
+							</li>
+						</ul>
 					</div>
 					<div id="gridListVote" style="width: 100%; height: 500px; float: right;" class="ag-theme-balham"></div>
 				</li>
@@ -285,14 +290,14 @@
 		},
 		 {headerName: '문항유형'		, field:'pollQtypeNm', width:100, cellClass: 'text-center'},
 		 {headerName: '문항제목'		, field:'pollQtitle', width:230, cellClass: 'text-center'},
-		 {headerName: '등록일'		, field:'regDt'	, width:80, cellClass: 'text-center'},
+		 {headerName: '등록일'		, field:'regDt'	, width:200, cellClass: 'text-center'},
 		/*{headerName: '투표율'		, field:'voteRate'	, width:80, cellClass: 'text-center'
 			, cellRenderer : function(params) { return gagajf.isNull(params.value) ? '0%' : params.value + '%'; }
 		}, */
 	];
 
 	var columnDefsVote = [
-		{headerName: '투표자'		, field:'voterNm'	, width:150, cellClass: 'text-center'},
+		{headerName: '투표자ID'		, field:'voterNm'	, width:150, cellClass: 'text-center'},
 		{headerName: '답변'	, field:'dummy'	, width:200, cellClass: 'text-center'},
 		{headerName: '투표자회원번호'	, field:'ansCustNo'	, width:200, cellClass: 'text-center'},
 		{headerName: '투표일시'		, field:'voteDt'	, width:200, cellClass: 'text-center'},
@@ -402,6 +407,7 @@
 			$("#partiCnt").attr("disabled",false);
 		}else{
 			$("#partiCnt").attr("disabled",true);
+			$("#partiCnt").val('');
 		}
 	}
 
@@ -417,6 +423,7 @@
 			$("#partiCnt").attr("disabled",false);
 		}else{
 			$("#partiCnt").attr("disabled",true);
+			$("#partiCnt").val('');
 		}
 		
 	})
@@ -708,6 +715,11 @@
 		});
 
 	}
+	
+	// 엑셀다운로드
+	$('#btnExcel').on('click', function() {
+		gagaAgGrid.exportToExcel('투표자 목록', gridOptionsVote);
+	});
 
 	$(document).ready(function() {