diff --git a/src/main/java/net/diaowen/estimate/controller/question/ResponseController.java b/src/main/java/net/diaowen/estimate/controller/question/ResponseController.java index 14d84d3d06e24c1aaf55ec48521ed1cb7a51595f..bc336214261f5ea3b53b03d2397ae214eb04c858 100644 --- a/src/main/java/net/diaowen/estimate/controller/question/ResponseController.java +++ b/src/main/java/net/diaowen/estimate/controller/question/ResponseController.java @@ -64,6 +64,7 @@ public class ResponseController { @RequestMapping("/save.do") public String save(HttpServletRequest request,HttpServletResponse response + ,String siteUrl ,String surveyId ,String estimateName ,String estimateGender @@ -73,7 +74,9 @@ public class ResponseController { ,String inspectNumber ,String source ,String sourceNumber) throws Exception { - return saveSurvey(request,response,surveyId + return saveSurvey(request,response + ,siteUrl + ,surveyId ,estimateName ,estimateGender ,estimateAge @@ -86,6 +89,7 @@ public class ResponseController { @RequestMapping("/saveMobile.do") public String saveMobile(HttpServletRequest request,HttpServletResponse response + ,String siteUrl ,String surveyId ,String estimateName ,String estimateGender @@ -95,7 +99,9 @@ public class ResponseController { ,String inspectNumber ,String source ,String sourceNumber) throws Exception { - return saveSurvey(request,response,surveyId + return saveSurvey(request,response + ,siteUrl + ,surveyId ,estimateName ,estimateGender ,estimateAge @@ -107,6 +113,7 @@ public class ResponseController { } public String saveSurvey(HttpServletRequest request,HttpServletResponse response + ,String siteUrl ,String surveyId ,String estimateName ,String estimateGender @@ -154,13 +161,13 @@ public class ResponseController { } AnswerCheckData answerCheckData = answerCheckData(request,directory, true, entity); - if(!answerCheckData.isAnswerCheck()) return answerRedirect(directory,answerCheckData.getAnswerCheckCode()); + if(!answerCheckData.isAnswerCheck()) return answerRedirect(siteUrl,directory,answerCheckData.getAnswerCheckCode()); answerSurvey(request,surveyId,entity); answerAfterUpData(request,response,surveyId,entity.getId()); - return answerRedirect(directory,6, entity.getId()); + return answerRedirect(siteUrl,directory,6, entity.getId()); } catch (Exception e) { e.printStackTrace(); - return answerRedirect(directory,5); + return answerRedirect(siteUrl,directory,5); } } @@ -465,15 +472,24 @@ public class ResponseController { return quMaps; } - public String answerRedirect(SurveyDirectory directory, int redType) throws Exception { - return answerRedirect(directory,redType,null); + public String answerRedirect(String siteUrl,SurveyDirectory directory, int redType) throws Exception { + return answerRedirect(siteUrl,directory,redType,null); } - public String answerRedirect(SurveyDirectory directory, int redType, String answerId) throws Exception { - if(directory!=null){ - return "redirect:"+DWSurveyConfig.DWSURVEY_WEB_SITE_URL+"/static/diaowen/message.html?sid="+directory.getSid()+"&respType="+redType+"&answerId="+answerId; + public String answerRedirect(String siteUrl,SurveyDirectory directory, int redType, String answerId) throws Exception { + if((StringUtils.isEmpty(siteUrl)) || (null==siteUrl)) { + if (directory != null) { + return "redirect:" + DWSurveyConfig.DWSURVEY_WEB_SITE_URL + "/static/diaowen/message.html?sid=" + directory.getSid() + "&respType=" + redType + "&answerId=" + answerId; + } + return "redirect:" + DWSurveyConfig.DWSURVEY_WEB_SITE_URL + "/static/diaowen/message.html"; + } + else + { + if (directory != null) { + return "redirect:" + siteUrl + "/static/diaowen/message.html?sid=" + directory.getSid() + "&respType=" + redType + "&answerId=" + answerId; + } + return "redirect:" + siteUrl + "/static/diaowen/message.html"; } - return "redirect:"+DWSurveyConfig.DWSURVEY_WEB_SITE_URL+"/static/diaowen/message.html"; }