Code snippet of the parameter ing set in the project

Source: Internet
Author: User

1. In the questionnairesservice class:

/*** Obtain the ing between the job ID and the questionnaire ID. A job may correspond to two papers (performance and attitude) ** @ return */Public multimap <long, long> getpostquestmap () {// The current evaluation cycle appraisalperiod period = testingservice. getlast (). getappraisalperiod (); multimap <long, long> postquestmap = arraylistmultimap. create (); List <questionnaires> questlist = questionnairesdao. findall (new questionnaires (). enable (); For (questionnaires quest: questlist) {If (quest. getpost () ! = NULL & quest. getappraisalcycle (). getappraisalperiod (). equals (period) {postquestmap. put (quest. getpost (). GETID (), quest. GETID () ;}} return postquestmap ;}

2. jxuserservice

/*** Obtain the ing (userid, postid) of user ID-post ID ** @ return */Public Map <long, long> getuserpostmap (list <jxuser> userlist) {Map <long, long> userpostmap = new hashmap <long, long> (); For (jxuser user User: userlist) userpostmap. put (user. GETID (), user. getpost (). GETID (); Return userpostmap ;}

3. jxuserservice

/*** Obtain the position ID-User ID multi-key ing (postid, userid) ** @ return */Public multimap <long, long> getpostusersmap (list <jxuser> userlist) {multimap <long, long> postusersmap = arraylistmultimap. create (); For (jxuser User: userlist) postusersmap. put (user. getpost (). GETID (), user. GETID (); Return postusersmap ;}

4. jxuserservice

/*** Evaluated user ID-rated user ID, post rating relationship postscorerelation ing table * @ return */Public multikeymap <long, postscorerelation> findtestingparam () {// output object multikeymap <long, postscorerelation> multimap = new multikeymap <long, postscorerelation> (); List <jxuser> userlist = userdao. findall (New jxuser (). enable (); // post-user (postid, userids) multimap <long, long> postusersmap = getpostusersmap (userlist); Map <long, collection <long> postusers = postusersmap. ASMAP (); // user-post (userid, postid) Map <long, long> userpostmap = getuserpostmap (userlist); // user-Questionnaire (postid, questionnaireids) multimap <long, long> postquestmap = questservice. getpostquestmap (); Map <long, collection <long> postquests = postquestmap. ASMAP (); // obtain the Score list <postscorerelation> psrlist = postservice. findpsrs (); For (postscorerelation PSR: psrlist) {// traverses collection based on the post scoring relationship <long> userids = postusers. get (PSR. getpost (). GETID (); // ID of the position to be evaluated-> userids of the user to be evaluated; collection <long> questids = postquests. get (PSR. getpost (). GETID (); // the ID of the position to be evaluated-> questionnaire questids; For (long questid: questids) {// The post exam of the user to be evaluated traverse for (long userid: userids) {// retrieved collection by the evaluated user <long> eavluserids = postusers. get (PSR. getpostmap (). GETID (); // rating position idfor (long eavluserid: eavluserids) {multimap. put (userid, eavluserid, questid, PSR); // user ID to be evaluated-User ID to be graded-questionnaire, post scoring relationship }}}return multimap ;}

Code snippet of the parameter ing set in the project

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.