Development notes of scoring module of Performance Appraisal System of tobacco bureau

Source: Internet
Author: User

Development notes of scoring module of Performance Appraisal System of tobacco bureau

The difficulty and complexity of developing a performance appraisal system is not the difficulty of developing a permission system with complicated functions. The author will announce the original design and some technical details here, hoping to exchange and learn with you.
Background: for the original system design scheme, see overall design scheme of Performance Appraisal System of a tobacco bureau.
Requirement: Indicator tree hierarchy for scoring.
Environment: Windows XP 5.1sp2, ie6.0, JDK (JRE) 1.6u0, myeclipse5.1.0, tomcat5.5, Oracle9i, PL/SQL 7.0.
Technical details: temporary tables and stored procedures support tree structure query + cursor + recursive query.
Technical difficulties: Write and call the stored procedure of the returned result set, and connect the temporary table with the Java program.
Some page effects and some source code are as follows:
1,Indicator library interface:


Index database data structure:


2,Job indicator Interface:


Position indicator data structure:


3,SQL statement for creating temporary tables:

-- Create Table <br/> Create global temporary table jxkh_temp_role_guideline <br/> (<br/> ID number (15), <br/> FID number (15 ), <br/> roleid number (15), <br/> rolename varchar2 (50), <br/> guidelineid number (15), <br/> guidelinename varchar2 (50 ), <br/> isatomic number (1), <br/> guidefid number (15), <br/> guideseq number (4), <br/> guidelevel number (1 ), <br/> Notes varchar2 (1000), <br/> maximum number (5, 2), <br/> minimum number (5, 2 ), <br/> childnum number <br/>) <br/> On commit Delete rows; 
4,Evaluation Score list page:


5,Objective: To evaluate the score page:


Source code (part) of Static Page Performance Evaluation):

<Table class = "ntable" cellspacing = "1" cellpadding = "1" align = "center" border = "0" id = "gvinfo" style = "border-style: none; width: 100%; "> <br/> <tr class =" skytdtopline "align =" center "> <br/> <TH scope =" col "> metrics </Th> <TH Scope = "col"> indicator class </Th> <TH scope = "col"> Indicator Name </Th> <TH scope = "col"> description </Th> <th scope = "col"> Minimum value </Th> <TH scope = "col"> maximum value </Th> <TH scope = "col"> single score </Th> <br /> </tr> <tr class = "skytdline" align = "center"> </P> <p> <! -- Level 1 indicator --> <br/> <TD rowspan = "2"> economic indicator </TD> </P> <p> <! -- Secondary indicator --> <br/> <TD rowspan = "1"> Investment Management </TD> </P> <p> <! -- Level 3 metrics --> <br/> <TD> <br/> <Div style = "width: 200px; "> <br/> <span id =" gvinfo_ctl02_label1 "> provincial/Bureau projects </span> </div> <br/> </TD> <a href =" /jxkh/atomicguideline. do? Method = getnotes "mce_href =" jxkh/atomicguideline. do? Method = getnotes "target =" _ blank "> description </a> </TD> <br/> <input class = 'classn1' name =" sky_10351 "Type = "text" style = "width: 30px; "value ="-50 "readonly =" readonly "> <br/> </TD> <br/> <input class = 'classn2' name =" sky_10352" type = "text" style = "width: 30px; "value =" 0 "readonly =" readonly "> <br/> </TD> <br/> <input name =" marks "id =" marks "Type = "text" style = "width: 80px; "value =" 0 "maxlength =" 4 "> <! -- Onblur = "skychange (this, '20140901 '); "--> <br/> <input name =" guideids "id =" guideids "type =" hidden "value =" 1076 "> <br/> <input name =" guidenames "id =" guidenames "type =" hidden "value =" Provincial/Municipal Project "> <br/> <input type =" hidden "name =" markids "id =" markids "Value = ""/> <br/> </TD> </P> <p> </tr> <tr class = "skytdline" align = "center"> </P> <p> <! -- Secondary indicator --> <br/> <TD rowspan = "1"> Conference Organization </TD> </P> <p> <! -- Level 3 metrics --> <br/> <TD> <br/> <Div style = "width: 200px; "> <br/> <span id =" gvinfo_ctl02_label1 "> formulate the Conference Management System </span> </div> <br/> </TD> <a href = "/jxkh/atomicguideline. do? Method = getnotes "mce_href =" jxkh/atomicguideline. do? Method = getnotes "target =" _ blank "> description </a> </TD> <br/> <input class = 'classn1' name =" sky_10351 "Type = "text" style = "width: 30px; "value ="-2 "readonly =" readonly "> <br/> </TD> <br/> <input class = 'classn2' name =" sky_10352" type = "text" style = "width: 30px; "value =" 0 "readonly =" readonly "> <br/> </TD> <br/> <input name =" marks "id =" marks "Type = "text" style = "width: 80px; "value =" 0 "maxlength =" 4 "> <! -- Onblur = "skychange (this, '20140901 '); "--> <br/> <input name =" guideids "id =" guideids "type =" hidden "value =" 1075 "> <br/> <input name =" guidenames "id =" guidenames "type =" hidden "value =" formulate meeting management system "> <br/> <input type =" hidden "name =" markids "id =" markids "value =" "/> <br/> </TD> </P> <p> </tr> <tr class =" skytdline "align =" center "> </P> <p> <! -- Level 1 indicator --> <br/> <TD rowspan = "4"> work quality indicator </TD> </P> <p> <! -- Secondary indicator --> <br/> <TD rowspan = "1"> Conference Organization </TD> </P> <p> <! -- Level 3 metrics --> <br/> <TD> <br/> <Div style = "width: 200px; "> <br/> <span id =" gvinfo_ctl02_label1 "> timely organization </span> </div> <br/> </TD> <a href =" /jxkh/atomicguideline. do? Method = getnotes "mce_href =" jxkh/atomicguideline. do? Method = getnotes "target =" _ blank "> description </a> </TD> <br/> <input class = 'classn1' name =" sky_10351 "Type = "text" style = "width: 30px; "value ="-10 "readonly =" readonly "> <br/> </TD> <br/> <input class = 'classn2' name =" sky_10352" type = "text" style = "width: 30px; "value =" 0 "readonly =" readonly "> <br/> </TD> <br/> <input name =" marks "id =" marks "Type = "text" style = "width: 80px; "value =" 0 "maxlength =" 4 "> <! -- Onblur = "skychange (this, '20140901 '); "--> <br/> <input name =" guideids "id =" guideids "type =" hidden "value =" 1140 "> <br/> <input name =" guidenames "id =" guidenames "type =" hidden "value =" timely organization "> <br/> <input type =" hidden "name =" markids "id =" markids "Value = ""/> <br/> </TD> </P> <p> </tr> <tr class = "skytdline" align = "center"> </P> <p> <! -- Secondary indicator --> <br/> <TD rowspan = "3"> Office Supplies Management </TD> </P> <p> <! -- Level 3 metrics --> <br/> <TD> <br/> <Div style = "width: 200px; "> <br/> <span id =" gvinfo_ctl02_label1 "> supplies management </span> </div> <br/> </TD> <a href =" /jxkh/atomicguideline. do? Method = getnotes "mce_href =" jxkh/atomicguideline. do? Method = getnotes "target =" _ blank "> description </a> </TD> <br/> <input class = 'classn1' name =" sky_10351 "Type = "text" style = "width: 30px; "value ="-4 "readonly =" readonly "> <br/> </TD> <br/> <input class = 'classn2' name =" sky_10352" type = "text" style = "width: 30px; "value =" 0 "readonly =" readonly "> <br/> </TD> <br/> <input name =" marks "id =" marks "Type = "text" style = "width: 80px; "value =" 0 "maxlength =" 4 "> <! -- Onblur = "skychange (this, '20140901 '); "--> <br/> <input name =" guideids "id =" guideids "type =" hidden "value =" 1141 "> <br/> <input name =" guidenames "id =" guidenames "type =" hidden "value =" Supplies Management "> <br/> <input type =" hidden "name =" markids "id =" markids "Value = ""/> <br/> </TD> </P> <p> </tr> <tr class = "skytdline" align = "center"> </P> <p> <! -- Level 3 metrics --> <br/> <TD> <br/> <Div style = "width: 200px; "> <br/> <span id =" gvinfo_ctl02_label1 "> office supplies </span> </div> <br/> </TD> <a href =" /jxkh/atomicguideline. do? Method = getnotes "mce_href =" jxkh/atomicguideline. do? Method = getnotes "target =" _ blank "> description </a> </TD> <br/> <input class = 'classn1' name =" sky_10351 "Type = "text" style = "width: 30px; "value ="-5 "readonly =" readonly "> <br/> </TD> <br/> <input class = 'classn2' name =" sky_10352" type = "text" style = "width: 30px; "value =" 0 "readonly =" readonly "> <br/> </TD> <br/> <input name =" marks "id =" marks "Type = "text" style = "width: 80px; "value =" 0 "maxlength =" 4 "> <! -- Onblur = "skychange (this, '20140901 '); "--> <br/> <input name =" guideids "id =" guideids "type =" hidden "value =" 1142 "> <br/> <input name =" guidenames "id =" guidenames "type =" hidden "value =" office supplies "> <br/> <input type =" hidden "name =" markids "id =" markids "Value = ""/> <br/> </TD> </P> <p> </tr> <tr class = "skytdline" align = "center"> </P> <p> <! -- Level 3 metrics --> <br/> <TD> <br/> <Div style = "width: 200px; "> <br/> <span id =" gvinfo_ctl02_label1 "> office management </span> </div> <br/> </TD> <a href =" /jxkh/atomicguideline. do? Method = getnotes "mce_href =" jxkh/atomicguideline. do? Method = getnotes "target =" _ blank "> description </a> </TD> <br/> <input class = 'classn1' name =" sky_10351 "Type = "text" style = "width: 30px; "value ="-8 "readonly =" readonly "> <br/> </TD> <br/> <input class = 'classn2' name =" sky_10352" type = "text" style = "width: 30px; "value =" 0 "readonly =" readonly "> <br/> </TD> <br/> <input name =" marks "id =" marks "Type = "text" style = "width: 80px; "value =" 0 "maxlength =" 4 "> <! -- Onblur = "skychange (this, '20140901 '); "--> <br/> <input name =" guideids "id =" guideids "type =" hidden "value =" 1143 "> <br/> <input name =" guidenames "id =" guidenames "type =" hidden "value =" office management "> <br/> <input type =" hidden "name =" markids "id =" markids "Value = ""/> <br/> </TD> </P> <p> </tr> <tr class = "skytdline" align = "center"> 
6,Compile the source code of the jxkh_guidele_child_num Stored Procedure:

Create or replace procedure jxkh_guidele_child_num (<br/> role_id _ jxkh_role_guideline.roleid % type, <br/> ref_cursor out sys_refcursor <br/>) <br/> as <br/> num _ number; <br/> cursor c_role_guide is select * From v_jxkh_role_guideline; --- declare a cursor at this time, Oracle does not execute the SELECT statement, but only declares <br/> v_emp v_jxkh_role_guideline % rowtype; <br/> begin <br/> num _: = 0; <br/> open c_role_guide; -- select is executed only when the cursor is opened in Oracle. <br/> fetch c_role_guide into v_emp; <br/> while c_role_guide % found loop <br/> -- exit when (c_role_guide % notfound ); <br/> If v_emp.guidelevel = 1 then -- level 1 Classification <br/> select count (*) into num _ from orders where FID in (select guidelineid from orders where FID = direction and roleid = role_id _); <br/> insert into values (v_emp.id, v_emp.fid, v_emp.roleid, v_emp.rolename, struct, v_emp.guidelinename, v_emp.isatomic, v_emp.guidefid, v_emp.guideseq, struct, v_emp.notes, v_emp.maximum, v_emp.minimum, num _); <br/> elsif v_emp.guidelevel = 2 then -- secondary classification <br/> select count (*) into num _ from v_jxkh_role_guideline where FID = v_emp.guidelineid and roleid = role_id _; <br/> insert into values (v_emp.id, v_emp.fid, values, v_emp.rolename, values, values, v_emp.isatomic, values, v_emp.guideseq, values, v_emp.notes, values, values, num _); <br/> else -- Tertiary classification <br/> insert into values (v_emp.id, v_emp.fid, values, v_emp.rolename, values, values, v_emp.isatomic, values, v_emp.guideseq, values, v_emp.notes, v_emp.maximum, v_emp.minimum, num _); <br/> end if; <br/> num _: = 0; -- counters cleared <br/> fetch c_role_guide into v_emp; <br/> end loop; <br/> close c_role_guide; <br/> open ref_cursor for select * from (select * From jxkh_temp_role_guideline T1 where t1.roleid = role_id _) t2 start with t2.fid = 0 connect by prior t2.guidelineid = t2.fid; -- returned result set of Stored Procedure <br/> end; 
Java source code for calling the jxkh_guidele_child_num Stored Procedure:

/** <Br/> * based on the input role ID, call the Stored Procedure jxkh_guidele_child_num to return all metric tasks assigned by the role <br/> */<br/> public list <atomicguideline> getroleguideline (string roleid) {</P> <p> List <atomicguideline> List = new arraylist <atomicguideline> (); <br/> connection conn = NULL; <br/> callablestatement stmt = NULL; <br/> resultset rs = NULL; </P> <p> try {<br/> dbconnectionmanager DCM = dbconnectionmanager. getinstance (); <br/> conn = DCM. Getconnection ("oracle"); <br/> Conn. setautocommit (false); // here it is required, otherwise the "ORA-08103" error will be reported <br/> stmt = Conn. preparecall ("begin jxkh_guidele_child_num (?,?); End; "); <br/> stmt. setint (1, integer. parseint (roleid); <br/> stmt. registeroutparameter (2,-10/* oracletypes. cursor =-10 */); // ref cursor (oracletypes. cursor =-10) <br/> stmt.exe cute (); <br/> rs = (resultset) stmt. getObject (2); <br/> while (RS. next () {<br/> atomicguideline = new atomicguideline (); <br/> atomicguideline. setid (RS. getstring ("guidelineid"); <br/> atomicguideline. setfid (RS. g Etstring ("FID"); <br/> atomicguideline. setguidename (RS. getstring ("guidelinename"); <br/> atomicguideline. setguideseq (RS. getstring ("guideseq"); <br/> atomicguideline. setguidelevel (RS. getstring ("guidelevel"); <br/> atomicguideline. setnotes (RS. getstring ("Notes"); <br/> atomicguideline. setmaximum (RS. getstring ("maximum"); <br/> atomicguideline. setminimum (RS. getstring ("minimum"); <br/> atomicguideline. s Etchildnum (RS. getstring ("childnum"); <br/> atomicguideline. setguidemark ("0"); <br/> list. add (atomicguideline); <br/>}< br/> Conn. commit (); </P> <p >}catch (sqlexception e) {<br/> // todo auto-generated Catch Block <br/> E. printstacktrace (); <br/>}finally {<br/> If (RS! = NULL) {<br/> try {<br/> Rs. close (); <br/>}catch (sqlexception e) {<br/> // todo auto-generated Catch Block <br/> E. printstacktrace (); <br/>}< br/> If (stmt! = NULL) {<br/> try {<br/> stmt. close (); <br/>}catch (sqlexception e) {<br/> // todo auto-generated Catch Block <br/> E. printstacktrace (); <br/>}< br/> If (Conn! = NULL) {<br/> try {<br/> Conn. close (); <br/>}catch (sqlexception e) {<br/> // todo auto-generated Catch Block <br/> E. printstacktrace (); <br/>}</P> <p> return list; <br/>} 
Any questions about Performance Appraisal System Design and stored procedure result set calling are welcome to communicate with the author online, MSN: defonds@hotmail.com.

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: info-contact@alibabacloud.com 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.