Quellcode durchsuchen

修改移动端扫描码问题

keyuan vor 4 Jahren
Ursprung
Commit
6c04feef34
2 geänderte Dateien mit 21 neuen und 8 gelöschten Zeilen
  1. 10 4
      README.md
  2. 11 4
      src/main/java/com/key/dwsurvey/action/survey/SurveyAction.java

+ 10 - 4
README.md

@@ -2,12 +2,18 @@
 
 DWSurvey是一款方便、高效、实用的调研问卷系统,一款基于 JAVA WEB 的开源问卷表单系统。
 
-![DWSurveyDesign](http://file.diaowen.net/images/gif/dwsurvey-2.gif)
-
+![可视化问卷设计](http://file.diaowen.net/images/gif/dwsurvey-2.gif "可视化问卷编辑器")
 
 ## 演示地址
 
-[http://www.diaowen.net](http://www.diaowen.net)
+开源版服务,开放源代码,可独立部署。
+
+ 地址:[http://www.diaowen.net](http://www.diaowen.net)
+
+企业版在线服务,功能更丰富,不需要部署,可直接发布问卷进行数据收集。
+
+ 地址:[https://www.surveyform.cn](https://www.surveyform.cn)
+
 
 ## 安装
 
@@ -15,7 +21,7 @@ DWSurvey是一款方便、高效、实用的调研问卷系统,一款基于 JA
 
 ### 安装说明
 
-	服务器必须安装由 JAVA 1.6+、MySQL、Apache Tomcat 构成的环境
+	服务器必须安装由 JAVA 1.6+、MySQL、Apache Tomcat 8.0 构成的环境
 
 	由于引用的外部jar在你本地maven仓库中可能没有,这时只要您本地有maven环境,执行下bin目录下面的文件就可以自动导入。
 

+ 11 - 4
src/main/java/com/key/dwsurvey/action/survey/SurveyAction.java

@@ -41,14 +41,14 @@ import java.io.ByteArrayOutputStream;
 
 @AllowedMethods({"answerSurvey","answerSurveryMobile","surveyModel","answerTD","ajaxCheckSurvey"})
 public class SurveyAction extends ActionSupport{
-	
+
 	protected final static String INDEXJSP="indexJsp";
 	protected final static String ANSERSURVEY="answerSurvey";
 	protected final static String ANSERSURVEY_MOBILE="answerSurveyMobile";
 	protected final static String SURVEYMODEL="surveyModel";
 	protected final static String ANSWER_INPUT_ERROR = "answerInputError";//已经答过,在间隔时间内
 	protected final static String ANSWER_INPUT_RULE = "answer_input_rule";//令牌
-	
+
 	@Autowired
 	private SurveyDirectoryManager surveyDirectoryManager;
 	@Autowired
@@ -87,7 +87,7 @@ public class SurveyAction extends ActionSupport{
 		buildSurvey(survey);
 	    return ANSERSURVEY_MOBILE;
 	}
-	
+
 	private void buildSurvey(SurveyDirectory survey) {
 		if (survey==null)
 		survey=surveyDirectoryManager.getSurvey(surveyId);
@@ -102,7 +102,7 @@ public class SurveyAction extends ActionSupport{
 	public String answerTD() throws Exception{
 	    	HttpServletRequest request=Struts2Utils.getRequest();
 	    	HttpServletResponse response=Struts2Utils.getResponse();
-	    	
+
 	    	String down=request.getParameter("down");
 
 			String baseUrl = "";
@@ -111,6 +111,13 @@ public class SurveyAction extends ActionSupport{
 					+ request.getContextPath();
 
 	    	try{
+
+	    		if(sid==null && surveyId!=null){
+	    			SurveyDirectory surveyDirectory = surveyDirectoryManager.getSurvey(surveyId);
+	    			if(surveyDirectory!=null){
+						sid = surveyDirectory.getSid();
+					}
+				}
 				String encoderContent=baseUrl+"/dwsurvey/"+sid+".html";
 				ByteArrayOutputStream jpegOutputStream = new ByteArrayOutputStream();
 				BufferedImage twoDimensionImg = ZxingUtil.qRCodeCommon(encoderContent, "jpg", 7);