Selaa lähdekoodia

#暂停问卷,也能回答问题

KeYuan 8 vuotta sitten
vanhempi
commit
45e6b5d2e6

+ 24 - 6
src/main/java/com/key/dwsurvey/action/nologin/SurveyAction.java

@@ -45,7 +45,8 @@ import com.opensymphony.xwork2.ActionSupport;
 	@Result(name=SurveyAction.INDEXJSP,location="/index.jsp",type=Struts2Utils.DISPATCHER),
 	@Result(name=SurveyAction.ANSERSURVEY,location="/WEB-INF/page/content/diaowen-design/answer-survey.jsp",type=Struts2Utils.DISPATCHER),
 	@Result(name=SurveyAction.ANSERSURVEY_MOBILE,location="/WEB-INF/page/content/diaowen-design/answer-survey-mobile.jsp",type=Struts2Utils.DISPATCHER),
-	@Result(name=SurveyAction.SURVEYMODEL,location="/WEB-INF/page/content/diaowen-create/survey-model.jsp",type=Struts2Utils.DISPATCHER)
+	@Result(name=SurveyAction.SURVEYMODEL,location="/WEB-INF/page/content/diaowen-create/survey-model.jsp",type=Struts2Utils.DISPATCHER),
+	@Result(name = ResponseAction.RESPONSE_MSG, location = "/WEB-INF/page/content/diaowen-answer/response-msg.jsp", type = Struts2Utils.DISPATCHER)
 })
 
 @AllowedMethods({"answerSurvey","answerSurveryMobile","surveyModel","answerTD","ajaxCheckSurvey"})
@@ -92,24 +93,41 @@ public class SurveyAction extends ActionSupport{
 
 	//问卷的动态访问方式
 	public String answerSurvey() throws Exception {
-		buildSurvey();
+		HttpServletRequest request = Struts2Utils.getRequest();
+		SurveyDirectory survey=surveyDirectoryManager.getSurvey(surveyId);
+		// 如果是非发布状态
+		if (survey.getSurveyQuNum() <= 0 || survey.getSurveyState() != 1) {
+			request.setAttribute("surveyName", "目前该问卷已暂停收集,请稍后再试");
+			request.setAttribute("msg", "目前该问卷已暂停收集,请稍后再试");
+			return ResponseAction.RESPONSE_MSG;
+		}
+		buildSurvey(survey);
 		return ANSERSURVEY;
 	}
 	//问卷动态访问-移动端
 	public String answerSurveryMobile() throws Exception {
-	    buildSurvey();
+		HttpServletRequest request = Struts2Utils.getRequest();
+		SurveyDirectory survey=surveyDirectoryManager.getSurvey(surveyId);
+		// 如果是非发布状态
+		if (survey.getSurveyQuNum() <= 0 || survey.getSurveyState() != 1) {
+			request.setAttribute("surveyName", "目前该问卷已暂停收集,请稍后再试");
+			request.setAttribute("msg", "目前该问卷已暂停收集,请稍后再试");
+			return ResponseAction.RESPONSE_MSG;
+		}
+		buildSurvey(survey);
 	    return ANSERSURVEY_MOBILE;
 	}
 
 	//创建时卷模板
 	public String surveyModel() throws Exception {
 		HttpServletRequest request=Struts2Utils.getRequest();
-		buildSurvey();
+		buildSurvey(null);
 		return SURVEYMODEL;
 	}
 	
-	private void buildSurvey() {
-		SurveyDirectory survey=surveyDirectoryManager.getSurvey(surveyId);
+	private void buildSurvey(SurveyDirectory survey) {
+		if (survey==null)
+		survey=surveyDirectoryManager.getSurvey(surveyId);
 		survey.setQuestions(questionManager.findDetails(surveyId, "2"));
 		Struts2Utils.setReqAttribute("survey", survey);
 		SurveyStyle surveyStyle=surveyStyleManager.getBySurveyId(surveyId);

+ 1 - 1
src/main/webapp/WEB-INF/page/content/diaowen-answer/response-failure.jsp

@@ -24,7 +24,7 @@
 		</div>
 		
 		<div class="footer-copyright" style="color: gray;">
-				 <a href="http://www.diaowen.net" style="text-decoration: none;color: rgb(53, 117, 136);">调问网</a> 提供支持
+			Powered by <a href="http://www.diaowen.net" style="text-decoration: none;color: rgb(53, 117, 136);">DWSurvey</a>
 		</div>
 	</div>
 	

+ 1 - 1
src/main/webapp/WEB-INF/page/content/diaowen-answer/response-input-error.jsp

@@ -22,7 +22,7 @@
 		</div>
 		
 		<div class="footer-copyright" style="color: gray;">
-				 <a href="http://www.diaowen.net" style="text-decoration: none;color: rgb(53, 117, 136);">调问网</a> 提供支持
+			Powered by <a href="http://www.diaowen.net" style="text-decoration: none;color: rgb(53, 117, 136);">DWSurvey</a>
 		</div>
 	</div>
 	

+ 64 - 0
src/main/webapp/WEB-INF/page/content/diaowen-answer/response-msg-m.jsp

@@ -0,0 +1,64 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+    pageEncoding="UTF-8"%>
+ <%@include file="/common/taglibs.jsp" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>完成问卷</title>
+<link rel="stylesheet" href="${ctx }/js/plugs/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.css">
+<script type="text/javascript" src="${ctx }/js/plugs/jquery-ui-1.10.3.custom/js/jquery-1.10.1.js"></script>
+<script src="${ctx }/js/plugs/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.js"></script>
+<link href="${ctx }/js/plugs/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet">
+<style type="text/css">
+.ui-page {
+	background:white;
+}
+.ui-header{
+	/* background-color: #3D586C! important; */
+	text-shadow:0 1px 0 #5C4242! important;
+	background-color: #5693C0! important;
+}
+.ui-content{
+	padding: 40px 1em;
+	text-align: center;
+}
+.ui-footer{
+	color: #3D586C! important;
+	background: none! important;
+}
+.ui-header, .ui-footer{
+	border: none! important;
+}
+.starRating{
+	font-size: 26px;
+}
+.starRating .fa{
+	cursor: pointer;
+}
+.starRating .fa-star{
+	color: #3388CC;
+}
+</style>
+</head>
+<body>
+
+<div data-role="page">
+  <div data-role="header" >
+    <h1 style="color:rgb(244, 234, 195);">${directory.surveyName }</h1>
+  </div>
+
+  <div data-role="content">
+   <p>${msg }</p>
+  </div>
+
+  <div data-role="footer">
+  <h3>Powered by <a href="http://www.diaowen.net/index-m.jsp" style="text-decoration: none;" rel="external">DWSurvey</a> </h3>
+  </div>
+</div> 
+
+<%@ include file="/WEB-INF/page/layouts/other.jsp"%>
+
+</body>
+</html>

+ 2 - 1
src/main/webapp/WEB-INF/page/content/diaowen-answer/response-msg.jsp

@@ -20,7 +20,8 @@
 		</div>
 		
 		<div class="footer-copyright" style="color: gray;">
-				 <a href="http://www.diaowen.net" style="text-decoration: none;color: rgb(53, 117, 136);">调问网</a> 提供支持
+			<%--请委必保留以下内容,自觉保留优先技术支持。--%>
+				Powered by <a href="http://www.diaowen.net" style="text-decoration: none;color: rgb(53, 117, 136);">DWSurvey</a>
 		</div>
 	</div>
 	

+ 1 - 1
src/main/webapp/WEB-INF/page/content/diaowen-answer/response-success-m.jsp

@@ -54,7 +54,7 @@
   </div>
 
   <div data-role="footer">
-  <h3><a href="${ctx }/index-m.jsp" style="text-decoration: none;" rel="external">调问网</a> 提供支持</h3>
+      <h3>Powered by <a href="http://www.diaowen.net/index-m.jsp" style="text-decoration: none;" rel="external">DWSurvey</a> </h3>
   </div>
 </div> 
 

+ 1 - 1
src/main/webapp/WEB-INF/page/content/diaowen-answer/response-success.jsp

@@ -25,7 +25,7 @@
 		</div>
 		
 		<div class="footer-copyright" style="color: gray;">
-				 <a href="http://www.diaowen.net" style="text-decoration: none;color: rgb(53, 117, 136);">调问网</a> 提供支持
+			Powered by <a href="http://www.diaowen.net" style="text-decoration: none;color: rgb(53, 117, 136);">DWSurvey</a>
 		</div>
 	</div>
 	

+ 2 - 1
src/main/webapp/WEB-INF/page/content/diaowen-design/answer-survey-mobile.jsp

@@ -819,7 +819,8 @@ $(document).ready(function(){
   </div>
 
   <div data-role="footer">
-  	<h3><a href="http://diaowen.net/index-m.jsp" style="text-decoration: none;" rel="external">调问网</a> 提供支持</h3>
+	  <%--请委必保留以下内容,自觉保留优先技术支持。--%>
+  	<h3>Powered by <a href="http://diaowen.net/index-m.jsp" style="text-decoration: none;" rel="external">DWSurvey</a></h3>
   </div>
 </div>
 

+ 3 - 2
src/main/webapp/WEB-INF/page/content/diaowen-design/answer-survey.jsp

@@ -1871,8 +1871,9 @@ label.error{
 
 </div>
 
-<div class="footer-copyright" style="color: gray;">
-	<a href="http://www.diaowen.net" style="text-decoration: none;color: rgb(53, 117, 136);">调问网</a> 提供支持
+<div class="footer-copyright" style="color: gray;padding-bottom: 5px;">
+	<%--请委必保留以下内容,自觉保留优先技术支持。--%>
+		Powered by <a href="http://www.diaowen.net" style="text-decoration: none;color: gray;">DWSurvey</a>
 </div>
 		
 <div id="fixedMsg" style="position: fixed;top: 0px;width: 100%;padding: 10px;text-align: center;font-size: 18px;letter-spacing: 4px;line-height: 56px;background-color: #111;background-color: rgba(17,17,17,0.5);color: #fff;color: rgba(255,255,255,0.5);z-index: 200;display: none;"></div>