m0_37592628 2017-11-05 01:16 采纳率: 0%
浏览 3181
已结题

在线等,着急,项目与专家实现9v9的关系,若有的好的方法可以追加500C币

最近在有一个专家给项目打分的需求,要求一个专家随机打9个项目,一个项目随机被9个专家打,业务规则如下(专家不能给本部门发起的项目和合作单位发起的项目打分),
如:
项目GGGG是A部门申请的,合作单位是B,C,D,那么A、B、C、D部门的专家不能给项目GGG打分。
1、项目和专家的个数一致的 。
2、部门申请的项目总数和部门的专家数是一样的。
下边是小弟写的代码,老是爆数组越界错误。
List businessDataList=(List)argMap.get("businessDataList");
Map expertMap=new HashMap();
Map userCodeMap=new HashMap();

    try {
        y:for (int i = 0; i <= businessDataList.size(); i++) {
            TPairJudgeBusinessData businessData=businessDataList.get(i);
            List<TPairJudgeExpeortRelation> relations=this.getPairJudgeDDao().queryAllExpeortRelation(businessData.getPairJudgeId());

// List expertList = this.getPairJudgeDDao().findExpertcodeByorgname("", "");//所有专家
List expertList = this.getPairJudgeDDao().findExpertcodeByorgname("", businessData.getDeclareDeptName());//所有专家
int count=0;//记录项目拥有的专家数[虞春明, 网运中心, 13901346687, ycm]
n:for (Object obj : expertList) {
Object[] tExpertInfo = (Object[])obj;
int sumexpert = this.getPairJudgeDDao().findPairJudgeScore(tExpertInfo[3].toString(),businessData.getProcessId());//查询专家拥有的项目数
System.out.println("专家有的项目的总数:"+sumexpert);

                //判断专家是否拥有9个项目
                if(sumexpert==9){
                    continue n;
                }

// //判断专家和项目是否是同部门或者合作部门
if(businessData.getFinishDeptName().indexOf(tExpertInfo[1].toString())!=-1){
continue n;
}
//判断项目是否有9个专家
int countexpert = this.getPairJudgeDDao().findPairJudgeScoreByJudgeId(businessData.getPairJudgeId(),businessData.getProcessId());//查询专家拥有的项目数
System.out.println("项目有的专家数:"+countexpert);
if(countexpert==9 && sumexpert==9){
continue y;
}
// if(count==9){
// continue y;
// }
if (sumexpert<=9) {
TPairJudgeScore pairJudgeScore=new TPairJudgeScore();
pairJudgeScore.setProcessId(businessData.getProcessId());
pairJudgeScore.setPairFirstJudgeId(ObjectUtils.toString(businessData.getId(),""));
pairJudgeScore.setPairjudgeName(businessData.getPairJudgeName());
pairJudgeScore.setPrizeLevel("");
pairJudgeScore.setMarkerDate(new Date(System.currentTimeMillis()));
pairJudgeScore.setMarkerCode(tExpertInfo[3].toString());
pairJudgeScore.setMarker(tExpertInfo[0].toString());
pairJudgeScore.setPairJudgeId(ObjectUtils.toString(businessData.getPairJudgeId(),""));
if ("成果应用奖 ".equals(businessData.getDeclarePrize())) {
pairJudgeScore.setPairJudgeType("1");
}else if("科技进步奖".equals(businessData.getDeclarePrize())){
pairJudgeScore.setPairJudgeType("2");
}else{
pairJudgeScore.setPairJudgeType("3");
}
pairJudgeScore.setDeclarePrize(businessData.getDeclarePrize());
pairJudgeScore.setType("0");
this.getPairJudgeDDao().insertIntoJudgeScore(pairJudgeScore);
count++;
}

            }

        }
    } catch (Exception e) {
        System.out.println("1111111111111111111");
        e.printStackTrace();
    }
  • 写回答

7条回答 默认 最新

  • devmiao 2017-11-05 02:08
    关注

    你先加上500C。我先回答这么多,若追加的多,可以进一步回答。

    评论

报告相同问题?

悬赏问题

  • ¥15 数据库数据成问号了,前台查询正常,数据库查询是?号
  • ¥15 算法使用了tf-idf,用手肘图确定k值确定不了,第四轮廓系数又太小才有0.006088746097507285,如何解决?(相关搜索:数据处理)
  • ¥15 彩灯控制电路,会的加我QQ1482956179
  • ¥200 相机拍直接转存到电脑上 立拍立穿无线局域网传
  • ¥15 (关键词-电路设计)
  • ¥15 如何解决MIPS计算是否溢出
  • ¥15 vue中我代理了iframe,iframe却走的是路由,没有显示该显示的网站,这个该如何处理
  • ¥15 操作系统相关算法中while();的含义
  • ¥15 CNVcaller安装后无法找到文件
  • ¥15 visual studio2022中文乱码无法解决