Package cn.edu.pku.dr.requirement.elicitation.data

Examples of cn.edu.pku.dr.requirement.elicitation.data.Problemsolution


                        + ")\"  style=\"padding:5px 10px 5px 10px!important;padding:4px 10px 4px 10px;height:1px;border:1px solid#7AA9DF;background-color:#EAF3FC;font-size:12px \">发表新的解决方案</a></div>");
        Problem problem = new Problem();
        problem.setProblemId(problemsolution.getProblemId());
        problem = (Problem) cdp.get(problem);
        // 找到正式的解决方案
        Problemsolution temp1 = new Problemsolution();
        temp1.setProblemId(problem.getProblemId());
        temp1.setIsVoting("C");
        ArrayList finalsolutions = cdp.query(temp1);
        // 找到正在投票的解决方案
        Problemsolution temp2 = new Problemsolution();
        temp2.setProblemId(problem.getProblemId());
        temp2.setIsVoting("Y");
        // 找到所有的解决方案
        ArrayList votingsolutions = cdp.query(temp2);
        Problemsolution temp3 = new Problemsolution();
        temp3.setProblemId(problem.getProblemId());
        ArrayList allsolutions = cdp.query(temp3);

        // 处理最终解决方案情况
        if (finalsolution_count >= 0) {
            buffer
View Full Code Here


    public String getSimpleProblemsolution(Long userId, ArrayList solutions)
            throws EasyJException {
        StringBuffer buffer = new StringBuffer();
        SingleDataProxy sdp = SingleDataProxy.getInstance();
        Problemsolution problemsolution = new Problemsolution();
        ProblemreasonSolution prs = new ProblemreasonSolution();
        ProblemreasonSolution prs2 = new ProblemreasonSolution();
        String solution = "";
        if (solutions.size() > 0) {
            for (int i = 0; i < solutions.size(); i++) {
                problemsolution = (Problemsolution) solutions.get(i);
                buffer
                        .append("<div id=\"Lg\"></div><div class=\"f14 p90 pl10\" class=\"answer_content\">"
                                + problemsolution.getProblemsolutionContent());
                buffer.append("<br><a href=\"javascript:showDetailedSolution("
                        + problemsolution.getProblemsolutionId()
                        + ")\">详细</a></div>");
                buffer
                        .append("<div align=\"right\" style=\"margin: 5px 5px 8px;\" id=\"comment_info\"><span class=\"gray\">评论者:</span><a href=\"#\">"
                                + problemsolution.getUserName()
                                + "</a><span class=\"gray\"> 时间:"
                                + problemsolution.getBuildTime()
                                + "</span></div>");
            }
        } else {
            buffer
                    .append("<div class=\"f14 p90 pl10\" class=\"answer_content\">目前暂无此类内容</div>");
View Full Code Here

                .getAttribute(Globals.SYS_USER_CACHE);
        Long userId = userCache.getUser().getUserId();
        pse.setCreatorId(userId);
        CompositeDataProxy cdp = CompositeDataProxy.getInstance();
        SingleDataProxy sdp = SingleDataProxy.getInstance();
        Problemsolution ps = new Problemsolution();
        ps.setProblemsolutionId(pse.getProblemsolutionId());
        ps = (Problemsolution) cdp.get(ps);
        StringBuffer xml = new StringBuffer("<result>");
        if (request.getParameter("flower") != null) {
            try {
                if (request.getParameter("useState").equals("C")) {
                    Finalsolution finalsolution = new Finalsolution();
                    finalsolution.setProblemsolutionId(pse
                            .getProblemsolutionId());
                    finalsolution = (Finalsolution) sdp.get(finalsolution);
                    finalsolution.setFinalgoodNum(new Long(finalsolution
                            .getFinalgoodNum().intValue() + 1));
                    sdp.update(finalsolution);
                    FinalsolutionEvaluation fse = new FinalsolutionEvaluation();
                    fse.setFinalsolutionId(finalsolution.getFinalsolutionId());
                    fse.setIsGood("Y");
                    sdp.create(fse);
                    xml
                            .append("<message>success</message><choose>flower</choose><problemsolutionId>"
                                    + pse.getProblemsolutionId()
                                    + "</problemsolutionId></result>");
                }
            } catch (EasyJException e) {
                xml.append("<message>failure</message></result>");
            }
            try {
                if (request.getParameter("useState").equals("Y")) {
                    ps.setVotingGoodNum((new Long(ps.getVotingGoodNum()
                            .intValue() + 1)));
                    cdp.update(ps);
                    pse.setStage(2);
                    pse.setIsGood("Y");
                    sdp.create(pse);
                    xml
                            .append("<message>success</message><choose>flower</choose><problemsolutionId>"
                                    + pse.getProblemsolutionId()
                                    + "</problemsolutionId></result>");
                }
            } catch (EasyJException e) {
                xml.append("<message>failure</message></result>");
            }
            try {
                if (request.getParameter("useState").equals("N")) {
                    ps.setGoodNum(new Long(ps.getGoodNum().intValue() + 1));
                    cdp.update(ps);
                    pse.setIsGood("Y");
                    pse.setStage(2);
                    sdp.create(pse);
                    xml
                            .append("<message>success</message><choose>flower</choose><problemsolutionId>"
                                    + pse.getProblemsolutionId()
                                    + "</problemsolutionId></result>");
                }
            } catch (EasyJException e) {
                xml.append("<message>failure</message></result>");
            }
        }

        if (request.getParameter("badegg") != null) {
            try {
                if (request.getParameter("useState").equals("C")) {
                    Finalsolution finalsolution = new Finalsolution();
                    finalsolution.setProblemsolutionId(pse
                            .getProblemsolutionId());
                    finalsolution = (Finalsolution) sdp.get(finalsolution);
                    finalsolution.setFinalbadNum(new Long(finalsolution
                            .getFinalbadNum().intValue() + 1));
                    sdp.update(finalsolution);
                    FinalsolutionEvaluation fse = new FinalsolutionEvaluation();
                    fse.setFinalsolutionId(finalsolution.getFinalsolutionId());
                    fse.setIsGood("N");
                    sdp.create(fse);
                    xml
                            .append("<message>success</message><choose>badegg</choose><problemsolutionId>"
                                    + pse.getProblemsolutionId()
                                    + "</problemsolutionId></result>");
                }
            } catch (EasyJException e) {
                xml.append("<message>failure</message></result>");
            }
            try {
                if (request.getParameter("useState").equals("Y")) {
                    ps.setVotingBadNum((new Long(ps.getVotingBadNum()
                            .intValue() + 1)));
                    cdp.update(ps);
                    pse.setIsGood("N");
                    sdp.create(pse);
                    xml
                            .append("<message>success</message><choose>badegg</choose><problemsolutionId>"
                                    + pse.getProblemsolutionId()
                                    + "</problemsolutionId></result>");
                }
            } catch (EasyJException e) {
                xml.append("<message>failure</message></result>");
            }
            try {
                if (request.getParameter("useState").equals("N")) {
                    ps.setBadNum(new Long(ps.getBadNum().intValue() + 1));
                    cdp.update(ps);
                    pse.setIsGood("N");
                    sdp.create(pse);
                    xml
                            .append("<message>success</message><choose>badegg</choose><problemsolutionId>"
                                    + pse.getProblemsolutionId()
                                    + "</problemsolutionId></result>");
                }
            } catch (EasyJException e) {
                xml.append("<message>failure</message></result>");
            }

        }

        try {
            if (request.getParameter("overdue") != null) {
                ProblemVersion problemversion = new ProblemVersion();
                problemversion.setProblemId(ps.getProblemId());
                Long problemversioncount = sdp.getCount(problemversion);
                ps.setProblemsolutionOverdueVersion(problemversioncount);
                ps.setIsoverdue("Y");
                cdp.update(ps);
                xml
                        .append("<message>success</message><choose>overdue</choose><problemsolutionId>"
                                + pse.getProblemsolutionId()
                                + "</problemsolutionId></result>");

            }
        } catch (EasyJException e) {
            xml.append("<message>failure</message></result>");
        }

        try {
            if (request.getParameter("decision") != null) {
                if (request.getParameter("decision").equals("voting")) {
                    ps.setIsVoting("Y");
                    sdp.update(ps);

                } else if (request.getParameter("decision").equals("best")) {
                    ps.setIsVoting("C");
                    Finalsolution fs = new Finalsolution();
                    fs.setProblemId(ps.getProblemId());
                    fs.setProblemsolutionId(ps.getProblemsolutionId());
                    fs.setCreatorId(userId);
                    fs.setFinalgoodNum(new Long("0"));
                    fs.setFinalbadNum(new Long("0"));
                    sdp.create(fs);
                    sdp.update(ps);
View Full Code Here

            }
        }

        try {
            if (request.getParameter("overdue") != null) {
                Problemsolution ps = new Problemsolution();
                ps.setProblemsolutionId(psr.getProblemsolutionId());
                ps = (Problemsolution) sdp.get(ps);
                ProblemVersion problemversion = new ProblemVersion();
                problemversion.setProblemId(ps.getProblemId());
                Long problemversioncount = sdp.getCount(problemversion);
                psr.setProblemsolutionReplyOverdueVersion(problemversioncount);
                psr.setIsoverdue("Y");
                cdp.update(psr);
                xml
View Full Code Here

        // 设置problemsolutionreply表的默认字段
        psr.setBadNum(new Long("0"));
        psr.setGoodNum(new Long("0"));
        psr.setIsoverdue("N");
        ProblemVersion pv = new ProblemVersion();
        Problemsolution ps = new Problemsolution();
        ps.setProblemsolutionId(psr.getProblemsolutionId());
        ps = (Problemsolution) sdp.get(ps);
        pv.setProblemId(ps.getProblemId());
        Long problemversioncount = sdp.getCount(pv);
        psr.setProblemsolutionReplyProblemId(problemversioncount);
        psr.setCreatorId(userId);
        try {
View Full Code Here

            /*
             * Problemsolution temp = new Problemsolution();
             * temp.setProblemsolutionId(psr.getProblemsolutionId()); temp =
             * (Problemsolution) sdp.get(temp);
             */
            Problemsolution ps = new Problemsolution();
            ps.setProblemsolutionId(psr.getProblemsolutionId());
            ps = (Problemsolution) sdp.get(ps);
            if (userId.intValue() != psr.getCreatorId().intValue()
                    && psr.getIsoverdue().equals("N") && flag
                    && ps.getIsoverdue() != "Y") {
                // 登陆者不是这个problemsolutionReply的作者,且没有评价过,且这个problemsolutionReply还没有过期,而且这个problemsolution还没有过期
                buffer
                        .append("<IMG src=\"/image/flower.gif\"> <A class=brown12 id=\"problemsolutionreply_flower"
                                + psr.getProblemsolutionReplyId()
                                + "\" href=\"javascript:ProblemsolutionReply.problemsolutionreplyFlower("
                                + psr.getProblemsolutionId()
                                + ","
                                + psr.getProblemsolutionReplyId()
                                + ","
                                + userId
                                + ")\">送鲜花</A>(得<SPAN id=\"problemsolutionreply_flowernum"
                                + psr.getProblemsolutionReplyId()
                                + "\">"
                                + psr.getGoodNum() + "</SPAN>支)");
                buffer
                        .append("<IMG height=15 src=\"/image/badegg.gif\" width=16><A id=\"problemsolutionreply_badegg"
                                + psr.getProblemsolutionReplyId()
                                + "\"class=brown12  href=\"javascript:ProblemsolutionReply.problemsolutionreplyBadegg("
                                + psr.getProblemsolutionId()
                                + ","
                                + psr.getProblemsolutionReplyId()
                                + ","
                                + userId
                                + ")\">扔鸡蛋</A>(得<SPAN class=orange12 id=\"problemsolutionreply_badeggnum"
                                + psr.getProblemsolutionReplyId()
                                + "\">"
                                + psr.getBadNum() + "</SPAN>个)");
            } else {
                buffer.append("<IMG src=\"/image/flower.gif\"> (得<SPAN>"
                        + psr.getGoodNum() + "</SPAN>支)");
                buffer
                        .append("<IMG height=15 src=\"/image/badegg.gif\" width=16>(得<SPAN class=orange12>"
                                + psr.getBadNum() + "</SPAN>个)");
            }

            if (psr.getIsoverdue().equals("N")
                    && userId.intValue() == psr.getCreatorId().intValue()) {
                // 只有是作者且还没有失效的时候才会出现实效按钮
                buffer
                        .append("<br><IMG height=15 src=\"/image/assoc_delete.gif\" width=16><A id=\"problemsolutionreply_overdue"
                                + psr.getProblemsolutionReplyId()
                                + "\" class=brown12  href=\"javascript:ProblemsolutionReply.problemsolutionreplyOverdue("
                                + psr.getProblemsolutionId()
                                + ","
                                + psr.getProblemsolutionReplyId()
                                + ","
                                + userId
                                + ")\">失效</A><span id=\"problemsolutionreply_overdue2"
                                + psr.getProblemsolutionReplyId()
                                + "\" style=\"display:none\">您已设置该回复失效</span>");
            } else if ((psr.getIsoverdue().equals("Y") || ps.getIsoverdue()
                    .equals("Y"))
                    && userId.intValue() != psr.getCreatorId().intValue()) {
                buffer
                        .append("<br><IMG height=15 src=\"/image/assoc_delete.gif\" width=16>该回复已失效");
            } else if (psr.getIsoverdue().equals("Y")
                    && userId.intValue() == psr.getCreatorId().intValue()) {
                buffer
                        .append("<br><IMG height=15 src=\"/image/assoc_delete.gif\" width=16>您已设置该回复失效");
            } else if (ps.getIsoverdue().equals("Y")) {
                buffer
                        .append("<br><IMG height=15 src=\"/image/assoc_delete.gif\" width=16>由于主贴失效,该回复失效");
            }
            buffer
                    .append("&nbsp<A class=brown12  href=\"javascript:ProblemsolutionReply.createReply("
View Full Code Here

                .getAttribute(Globals.SYS_USER_CACHE);
        Long userId = userCache.getUser().getUserId();
        String name[] = request.getParameterValues("choose_reason");
        String solutionContent = request.getParameter("solutionContent");
        Problem problem = new Problem();
        Problemsolution ps = new Problemsolution();
        ProblemreasonSolution psr = new ProblemreasonSolution();
        SingleDataProxy sdp = SingleDataProxy.getInstance();
        CompositeDataProxy cdp = CompositeDataProxy.getInstance();
        problem.setProblemId(problemsolution.getProblemId());
        Long version = new Long(cdp.getCount(problem));
        Problemsolution ps2 = new Problemsolution();
        try {
            // 需要创建新的problemsolution
            ps.setProblemId(problemsolution.getProblemId());
            ps.setProblemsolutionContent(solutionContent);
            ps.setProblemsolutionProblemId(version);
            // 设置problemsolution表默认字段
            ps.setGoodNum(new Long("0"));
            ps.setBadNum(new Long("0"));
            ps.setProblemChange("N");
            ps.setIsVoting("N");
            ps.setVotingGoodNum(new Long("0"));
            ps.setVotingBadNum(new Long("0"));
            ps.setIsoverdue("N");

            // 创建solution的时候problemversion
            ProblemVersion pv = new ProblemVersion();
            pv.setProblemId(ps.getProblemId());
            Long problemversioncount = sdp.getCount(pv);
            ps.setProblemsolutionProblemId(problemversioncount);
            ps.setCreatorId(userId);
            Object o = sdp.create(ps);
            ps2 = (Problemsolution) o;
            // 需要创建新的problemreasonSolution
            psr.setProblemId(problemsolution.getProblemId());
            psr.setProblemsolutionId(ps2.getProblemsolutionId());
            psr.setCreatorId(userId);
            if (name != null) {
                for (int i = 0; i < name.length; i++) {
                    psr.setProblemreasonId(new Long(name[i]));
                    sdp.create(psr);
View Full Code Here

    public void getProblemsolution() throws EasyJException, IOException {
        ProblemSolutionImpl targetObject = new ProblemSolutionImpl();
        ProblemSolutionInterface problemsolutionInterface = null;
        Object proxy = ProblemSolutionProxyFactory.getProxy(targetObject);
        problemsolutionInterface = (ProblemSolutionInterface) proxy;
        Problemsolution problemsolution = new Problemsolution();
        problemsolution = (Problemsolution) object;
        try {
            response.getWriter().println(
                    problemsolutionInterface.getProblemsolution(
                            problemsolution, this.request, false).toString());
View Full Code Here

    public void creatingSolution() throws EasyJException, IOException {
        ProblemSolutionImpl targetObject = new ProblemSolutionImpl();
        ProblemSolutionInterface problemsolutionInterface = null;
        Object proxy = ProblemSolutionProxyFactory.getProxy(targetObject);
        problemsolutionInterface = (ProblemSolutionInterface) proxy;
        Problemsolution ps = new Problemsolution();
        ps = (Problemsolution) object;
        returnMessage = problemsolutionInterface.creatingSolution(ps,
                this.request);
    }
View Full Code Here

    public void viewDetailedSolution() throws EasyJException, IOException {
        ProblemSolutionImpl targetObject = new ProblemSolutionImpl();
        ProblemSolutionInterface problemsolutionInterface = null;
        Object proxy = ProblemSolutionProxyFactory.getProxy(targetObject);
        problemsolutionInterface = (ProblemSolutionInterface) proxy;
        Problemsolution problemsolution = new Problemsolution();
        problemsolution = (Problemsolution) object;
        try {
            response.getWriter().println(
                    problemsolutionInterface.viewDetailedSolution(
                            problemsolution, this.request).toString());
View Full Code Here

TOP

Related Classes of cn.edu.pku.dr.requirement.elicitation.data.Problemsolution

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.