StringBuffer buffer = new StringBuffer();
SingleDataProxy sdp = SingleDataProxy.getInstance();
CompositeDataProxy cdp = CompositeDataProxy.getInstance();
ProblemsolutionReply psr = new ProblemsolutionReply();
ProblemreasonSolution prs = new ProblemreasonSolution();
ProblemreasonSolution prs2 = new ProblemreasonSolution();
buffer.append("<div class=\"bc0\" style=\"padding:0px 0pt;\">");
String reason = "";
problemsolution = (Problemsolution) cdp.get(problemsolution);
prs.setProblemsolutionId(problemsolution.getProblemsolutionId());
ArrayList prss = sdp.query(prs);
ArrayList psrs = problemsolution.getProblemsolutionReplys();
buffer.append("<div id=\"Lg\" ></div>");
if (prss.size() > 0) {
for (int j = 0; j < prss.size(); j++) {
prs2 = (ProblemreasonSolution) prss.get(j);
reason = reason + "," + prs2.getProblemreasonId();
}
buffer.append("<div id=\"Lg\" ></div>"
+ "<div class=\"f14 p90 pl10\" class=\"answer_content\">"
+ problemsolution.getProblemsolutionContent() + "</div>");
buffer.append("<p></p>共有对应的原因为" + reason + "<p></p>");
} else {
buffer
.append("<div class=\"f14 p90 pl10\" class=\"answer_content\">"
+ problemsolution.getProblemsolutionContent()
+ "</div><div id=\"Lg\" ></div>");
}
// 首先显示主贴,然后显示回复,主贴需考虑solution的三个状态
// 1。已被选择为最佳解决方案。2。正在投票中的解决方案,3。一般状态的解决方案
// 1。需要显示三种投票结果
// isVoting为C表示正在第三阶段投票,isVoting为Y表示正在第二阶段投票,isVoting为N表示正在第一阶段
if (problemsolution.getIsVoting().equals("C")) {
buffer.append("<div></div>");
buffer.append("作为备选方案前的投票结果:");
buffer.append("<IMG src=\"/image/flower.gif\"> (得<SPAN>"
+ problemsolution.getGoodNum() + "</SPAN>支)");
buffer
.append("<IMG height=15 src=\"/image/badegg.gif\" width=16>(得<SPAN class=orange12>"
+ problemsolution.getBadNum() + "</SPAN>个)<br>");
buffer.append("作为备选方案时的投票结果:");
buffer.append("<IMG src=\"/image/flower.gif\"> (得<SPAN>"
+ problemsolution.getVotingGoodNum() + "</SPAN>支)");
buffer
.append("<IMG height=15 src=\"/image/badegg.gif\" width=16>(得<SPAN class=orange12>"
+ problemsolution.getVotingBadNum()
+ "</SPAN>个)<br>");
buffer.append(getContent(userId, problemsolution, null, "C"));
} else if (problemsolution.getIsVoting().equals("Y")) {
buffer
.append("<A class=brown12 href=\"javascript:Problemsolution.problemsolutionVoting("
+ problemsolution.getProblemsolutionId()
+ ",'best')\" > 选择为最佳解决方案</A><br>");
buffer.append("作为备选方案前的投票结果:");
buffer.append("<IMG src=\"/image/flower.gif\"> (得<SPAN>"
+ problemsolution.getGoodNum() + "</SPAN>支)");
buffer
.append("<IMG height=15 src=\"/image/badegg.gif\" width=16>(得<SPAN class=orange12>"
+ problemsolution.getBadNum() + "</SPAN>个)<br>");
buffer.append(getContent(userId, problemsolution, null, "Y"));
} else if (problemsolution.getIsVoting().equals("N")) {
buffer
.append("<p></p><A class=brown12 href=\"javascript:Problemsolution.problemsolutionVoting("
+ problemsolution.getProblemsolutionId()
+ ",'voting')\")>选择为备选方案</A><p></p>");
buffer.append(getContent(userId, problemsolution, null, "N"));
}
// 取得回帖的信息
for (int i = psrs.size() - 1; i >= 0; i--) {
psr = (ProblemsolutionReply) psrs.get(i);
buffer.append("<div id=\"Lg\" ></div>"
+ "<div class=\"f14 p90 pl10\" class=\"answer_content\">"
+ psr.getProblemsolutionReplyContent() + "</div>");
buffer.append(getContent(userId, null, psr, null));
}
return buffer.toString();
}