diff --git a/WebContent/WEB-INF/templates/sch1.ftl b/WebContent/WEB-INF/templates/sch1.ftl index d1c8b12ae4232214091c78bc7c7afc4bf01ff1c5..da0d6bf583ff355602a70df3ba5c38d8648ae2c7 100644 --- a/WebContent/WEB-INF/templates/sch1.ftl +++ b/WebContent/WEB-INF/templates/sch1.ftl @@ -1148,7 +1148,7 @@ -${coursemode.score}/${coursemode.time} +${coursemode.score}/${coursemode.hour}(${coursemode.dispersehour})/${coursemode.week}(${coursemode.disperseweek})周 @@ -1207,7 +1207,7 @@ -${course.score}/${course.time}/${course.semester} +${course.score}/${course.hour}/${course.semester} @@ -1390,7 +1390,7 @@ -${course.score}/${course.time}/${course.semester} +${course.score}/${course.hour}/${course.semester} @@ -1539,7 +1539,7 @@ -${coursemode.score}/${coursemode.time} +${coursemode.score}/${coursemode.hour}/${coursemode.week}周 @@ -1598,7 +1598,7 @@ -${course.score}/${course.time}/${course.semester} +${course.score}/${course.hour}/${course.semester} @@ -1782,7 +1782,7 @@ -${course.score}/${course.time}/${course.semester} +${course.score}/${course.hour}/${course.semester} @@ -1949,7 +1949,7 @@ -${coursemode.score}/${coursemode.time} +${coursemode.score}/${coursemode.hour}/${coursemode.week}周 @@ -2006,7 +2006,7 @@ -${course.score}/${course.time}/${course.semester} +${course.score}/${course.hour}/${course.semester} @@ -2190,7 +2190,7 @@ -${course.score}/${course.time}/${course.semester} +${course.score}/${course.hour}/${course.semester} @@ -2342,7 +2342,7 @@ -${coursemode.score}/${coursemode.time} +${coursemode.score}/${coursemode.hour}/${coursemode.week}周 @@ -2399,7 +2399,7 @@ -${course.score}/${course.time}/${course.semester} +${course.score}/${course.hour}/${course.semester} @@ -2581,7 +2581,7 @@ -${course.score}/${course.time}/${course.semester} +${course.score}/${course.hour}/${course.semester} @@ -2681,7 +2681,7 @@ -${total_coursetype_compulsory_theoretical_score}/${total_coursetype_compulsory_theoretical_time+total_coursetype_compulsory_experiement_time} ${total_coursetype_compulsory_practice_score}/${total_coursetype_compulsory_practice_time} +${total_coursetype_compulsory_theoretical_score}学分/${total_coursetype_compulsory_theoretical_hour+total_coursetype_compulsory_experiement_hour}(${total_coursetype_compulsory_disperse_theoretical_hour+total_coursetype_compulsory_disperse_experiement_hour})学时/${total_coursetype_compulsory_theoretical_week + total_coursetype_compulsory_experiement_week}(${total_coursetype_compulsory_disperse_theoretical_week + total_coursetype_compulsory_disperse_experiement_week})周 ${total_coursetype_compulsory_practice_score}学分/${total_coursetype_compulsory_practice_hour}(${total_coursetype_compulsory_disperse_practice_hour})学时/${total_coursetype_compulsory_practice_week}(${total_coursetype_compulsory_disperse_practice_week})周 @@ -2751,7 +2751,7 @@ -${total_coursemode_elective_theoretical_score}/${total_coursetype_elective_theoretical_time + total_coursetype_elective_experiement_time} ${total_coursemode_elective_practice_score}/${total_coursetype_elective_practice_time} +${total_coursemode_elective_theoretical_score}学分/${total_coursetype_elective_theoretical_hour + total_coursetype_elective_experiement_hour}(${total_coursetype_elective_disperse_theoretical_hour + total_coursetype_elective_disperse_experiement_hour})学时/${total_coursetype_elective_theoretical_week + total_coursetype_elective_experiement_week}(${total_coursetype_elective_disperse_experiement_hour + total_coursetype_elective_disperse_experiement_week})周 ${total_coursemode_elective_practice_score}学分/${total_coursetype_elective_practice_hour}(${total_coursetype_elective_disperse_practice_hour})学时${total_coursetype_elective_practice_week}(${total_coursetype_elective_disperse_practice_week})周 @@ -2841,7 +2841,7 @@ -${totaltheoreticalscore + totalpracticescore}/${totaltheoreticaltime + totalexperiementtime + totalpracticetime} ${totaltheoreticalscore}/${totaltheoreticaltime + totalexperiementtime} ${totalpracticescore}/${totalpracticetime} +${totaltheoreticalscore + totalpracticescore}学分/${totaltheoreticalhour + totalexperiementhour + totalpracticehour}(${totaltheoreticaldispersehour + totalexperiementdispersehour + totalpracticedispersehour})学时/${totaltheoreticalweek + totalexperiementweek + totalpracticeweek}(${totaltheoreticaldisperseweek + totalexperiementdisperseweek + totalpracticedisperseweek})周 ${totaltheoreticalscore}学分/${totaltheoreticalhour + totalexperiementhour}(${totaltheoreticaldispersehour + totalexperiementdispersehour})学时 ${totalpracticescore}学分/${totalpracticehour}(${totalpracticedispersehour})学时/${totalpracticeweek}/(${totalpracticedisperseweek})周 diff --git a/WebContent/generatorConfig.xml b/WebContent/generatorConfig.xml index 6f9e60b2d395405307ecbcf7aa05ecbad4f2e04d..607fa85cc3c66bf05f8ca19892510e18f537eee3 100644 --- a/WebContent/generatorConfig.xml +++ b/WebContent/generatorConfig.xml @@ -100,7 +100,7 @@ --> - +
diff --git a/WebContent/jsp/QueryCurriculums.jsp b/WebContent/jsp/QueryCurriculums.jsp index fde79c4f1de737fc46f25a419ba92be2269ddf1d..d1681a6251db153cdcdd8db6a16303d3f0fc5813 100644 --- a/WebContent/jsp/QueryCurriculums.jsp +++ b/WebContent/jsp/QueryCurriculums.jsp @@ -39,8 +39,14 @@ set_dnd(); set_editable(); + + init(); }) + function init(){ + + } + var dragSrcEl = null; var $dragSrcEl = null; var dragSrcTBODY = null; @@ -145,35 +151,101 @@ } function compute_total($whichbody){ - var total = new Array() + var total = new Array(); + var total_disperse = 0;//小计分散 + var theoretical_disperse = 0;//小计理论分散 + var experiment_disperse = 0;//小计实验分散 + var total_hpw = 0;//每周学时数 + var total_week = 0;//总周 + var total_week_disperse = 0;//总分散周 + var $dest_trs = $whichbody.children('tr'); //var $dest_trs_avaliable = $(":checkbox:checked").closest("tr"); - var $dest_trs_avaliable =$whichbody.find(":checkbox:checked").closest("tr"); + var $dest_trs_avaliable = $whichbody.find("input[class='available']:checked").closest("tr"); + var $dest_trs_disperse = $whichbody.find("input[class='disperse']:checked").closest("tr"); - //初始化小计的数量 - for(var i = 0; i < 20 ; i++){ - total[i] = 0; + //设置分散的括号============================================== + for(var i = 0;i < $dest_trs.length; i++){//所有行,先清除分散括号 + $dest_tds = $($dest_trs[i]).children(); + + for(var j = 4 ; j <= 8; j++){ + str = $($dest_tds[j]).text(); + var s = str.replace("(",""); + s = s.replace(")",""); + + $($dest_tds[j]).text(s); + } } - //先根据理论学时 + 实验学时 计算机总学时 + //先根据理论学时 + 实验学时 计算总学时 for(var i = 0;i < $dest_trs.length; i++){//所有行 var $dest_tds = $($dest_trs[i]).children(); - if(i < $dest_trs.length - 1){//前面的行 + if(i < $dest_trs.length - 1){//前面的行 除了最后一行小计 + //计算出总学时(理论学时+实验学时) $dest_tds[4].innerHTML = parseInt($dest_tds[5].innerHTML) + parseInt($dest_tds[6].innerHTML); + ""; } } - //计算开课的小计 + for(var j = 0;j < $dest_trs.length; j++){//所有分散课 + var $dest__tds = $($dest_trs[j]).children(); + if($($dest__tds[12]).text() == '1'){//如果单位为周 + $($dest__tds[7]).text($dest__tds[4].innerHTML); + }else{//单位为学时 + + } + } + + //=========================================================== + //初始化小计的数量 + for(var i = 0; i < 20 ; i++){ + total[i] = 0; + } + + //计算开课、分散的小计 var $dest_tds = undefined; - for(var i = 0;i < $dest_trs_avaliable.length; i++){//所有行 - $dest_tds = $($dest_trs_avaliable[i]).children(); - - for(var j = 0; j < $dest_tds.length ; j ++ ){ - if(j >= 3 && j <= 7){ - total[j] += parseInt($dest_tds[j].innerHTML); + for(var i = 0;i < $dest_trs_avaliable.length; i++){//所有开课行 + for(var j = 0;j < $dest_trs_disperse.length; j++){//所有分散课 + if($dest_trs_avaliable[i] == $dest_trs_disperse[j]){//开课,并分散进行 + var $dest_disperse_tds = $($dest_trs_disperse[j]).children(); + total_disperse += parseInt($($dest_disperse_tds[4]).text()); + theoretical_disperse += parseInt($($dest_disperse_tds[5]).text()); + experiment_disperse += parseInt($($dest_disperse_tds[6]).text()); + + if($($dest_disperse_tds[12]).text() == '1'){//如果单位为周 + total_week_disperse += (parseFloat($($dest_disperse_tds[7]).text()));//总分散周数 + } + + } + } + } + //计算开课、未分散的小计 + for(var i = 0;i < $dest_trs_avaliable.length; i++){//所有开课行 + var found_same = false; + for(var j = 0;j < $dest_trs_disperse.length; j++){//所有分散课 + if($dest_trs_avaliable[i] == $dest_trs_disperse[j]){//开课,并分散进行 + found_same = true; + break; + } + } + //所有开课,计算学分学时 + $dest_tdss = $($dest_trs_avaliable[i]).children(); + //没有找到相同的,计算 + if(!found_same){ + for(var k = 0; k < $dest_tdss.length ; k ++ ){ + if(k >= 3 && k < 7){ + total[k] += parseInt($dest_tdss[k].innerHTML); + } + } + + if($($dest_tdss[12]).text() == '1'){//如果单位为周 + total_week += (parseFloat($($dest_tdss[7]).text()));//总周数 + }else{ + total[7] += parseInt($dest_tdss[7].innerHTML) } + } + } //设置小计的内容 @@ -181,6 +253,61 @@ for(var j = 0; j < $dest_tds.length ; j ++ ){ if(j >= 3 && j <= 7){ $dest_tds[j].innerHTML = total[j] + ""; + if(j == 4){//总学时数 + if(total_disperse > 0){ + $dest_tds[j].innerHTML = $dest_tds[j].innerHTML + "(" + total_disperse + ")"; + } + } + + if(j == 5){//总理论学时数 + if(total_disperse > 0){ + $dest_tds[j].innerHTML = $dest_tds[j].innerHTML + "(" + theoretical_disperse + ")"; + } + } + + if(j == 6){//总实验学时数 + if(total_disperse > 0){ + $dest_tds[j].innerHTML = $dest_tds[j].innerHTML + "(" + experiment_disperse + ")"; + } + } + + if(j == 7){//周学时 + if(total_week > 0 || total_week_disperse > 0){ + $dest_tds[7].innerHTML += "/"; + } + + if(total_week > 0){ + $dest_tds[7].innerHTML += total_week; + } + + if(total_week_disperse > 0){ + $dest_tds[7].innerHTML += "(" + total_week_disperse + ")"; + } + + if(total_week > 0 || total_week_disperse > 0){ + $dest_tds[7].innerHTML += "周"; + } + } + } + } + + //对于分散的课学时,加上括号表示 + for(var i = 0 ; i < $dest_trs_disperse.length; i++){// + var $dest_disperse_tds = $($dest_trs_disperse[i]).children(); + for(var j = 4 ; j <= 6; j++){ + $dest_disperse_tds[j].innerHTML = "(" + $dest_disperse_tds[j].innerHTML + ")"; + } + + if($($dest_disperse_tds[12]).text() == '1'){//如果单位为周 + $($dest_disperse_tds[7]).text("(" + $($dest_disperse_tds[7]).text() + ")" +"周"); + } + } + //单位为周的,加上单位 + for(var i = 0 ; i < $dest_trs.length - 1; i++){// + var $tds = $($dest_trs[i]).children(); + + if($($tds[12]).text() == '1'){//如果单位为周 + $($tds[7]).text($($tds[4]).text() +"周"); } } @@ -261,6 +388,7 @@ obj['hpw'] = parseInt($(tds[7]).text()); obj['sort'] = 0; obj['available'] = tds[10].firstChild.checked; + obj['disperse'] = tds[11].firstChild.checked; // curriculums.push(obj); } @@ -346,7 +474,9 @@ 0 1 17 - + + + ${course.unit} @@ -394,6 +524,7 @@ 起始周 结束周 开课 + 分散 @@ -409,10 +540,15 @@ ${curriculum.hpw } ${curriculum.start } ${curriculum.end } - checked="checked" onclick="checkboxOnclick(this);" /> - + + checked="checked" + onclick="checkboxOnclick(this);" /> + + ${curriculum.unit} @@ -427,6 +563,7 @@ ---- ---- ---- + ---- @@ -449,6 +586,7 @@ 起始周 结束周 开课 + 分散 @@ -464,10 +602,15 @@ ${curriculum.hpw } ${curriculum.start } ${curriculum.end } - checked="checked" onclick="checkboxOnclick(this);" /> - + + checked="checked" + onclick="checkboxOnclick(this);" /> + + ${curriculum.unit} @@ -482,6 +625,7 @@ ---- ---- ---- + ---- @@ -505,6 +649,7 @@ 起始周 结束周 开课 + 分散 @@ -520,10 +665,15 @@ ${curriculum.hpw } ${curriculum.start } ${curriculum.end } - checked="checked" onclick="checkboxOnclick(this);" /> - + + checked="checked" + onclick="checkboxOnclick(this);" /> + + ${curriculum.unit} @@ -538,6 +688,7 @@ ---- ---- ---- + ---- @@ -561,6 +712,7 @@ 起始周 结束周 开课 + 分散 @@ -576,10 +728,15 @@ ${curriculum.hpw } ${curriculum.start } ${curriculum.end } - checked="checked" onclick="checkboxOnclick(this);" /> - + + checked="checked" + onclick="checkboxOnclick(this);" /> + + ${curriculum.unit} @@ -594,6 +751,7 @@ ---- ---- ---- + ---- @@ -615,6 +773,7 @@ 起始周 结束周 开课 + 分散 @@ -630,10 +789,15 @@ ${curriculum.hpw } ${curriculum.start } ${curriculum.end } - checked="checked" onclick="checkboxOnclick(this);" /> - + + checked="checked" + onclick="checkboxOnclick(this);" /> + + ${curriculum.unit} @@ -648,6 +812,7 @@ ---- ---- ---- + ---- @@ -667,6 +832,7 @@ 起始周 结束周 开课 + 分散 @@ -682,10 +848,15 @@ ${curriculum.hpw } ${curriculum.start } ${curriculum.end } - checked="checked" onclick="checkboxOnclick(this);" /> - + + checked="checked" + onclick="checkboxOnclick(this);" /> + + ${curriculum.unit} @@ -700,6 +871,7 @@ ---- ---- ---- + ---- @@ -719,6 +891,7 @@ 起始周 结束周 开课 + 分散 @@ -734,10 +907,15 @@ ${curriculum.hpw } ${curriculum.start } ${curriculum.end } - checked="checked" onclick="checkboxOnclick(this);" /> - + + checked="checked" + onclick="checkboxOnclick(this);" /> + + ${curriculum.unit} @@ -752,6 +930,7 @@ ---- ---- ---- + ---- @@ -771,6 +950,7 @@ 起始周 结束周 开课 + 分散 @@ -786,10 +966,15 @@ ${curriculum.hpw } ${curriculum.start } ${curriculum.end } - checked="checked" onclick="checkboxOnclick(this);" /> - + + checked="checked" + onclick="checkboxOnclick(this);" /> + + ${curriculum.unit} @@ -804,6 +989,7 @@ ---- ---- ---- + ---- diff --git a/WebContent/jsp/QueryCurriculums2.jsp b/WebContent/jsp/QueryCurriculums2.jsp new file mode 100644 index 0000000000000000000000000000000000000000..67031805ff620a7fbd3f455ac6268aa041abb428 --- /dev/null +++ b/WebContent/jsp/QueryCurriculums2.jsp @@ -0,0 +1,885 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> + + + + + + + 实施进程表 + + + + + + + + + + + + + + + + + +
+
+ + +
+
+
+

备选课程

+
+
+
+ + +
+ + + + +
+ + +
+ +
+ + +
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
ID课程名称
${course.id }${course.name}----${course.score}0${course.theoretical}${course.experiement}0117
+
+
+
+
+ + +
+ +
+
+

实施进程表

+
+
+ + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ID课程名称课程编号学分学期学时理论学时实验学时周学时起始周结束周开课分散
${curriculum.id }${curriculum.name }${curriculum.identifier }${curriculum.score }${curriculum.time }${curriculum.theoretical }${curriculum.experiement }${curriculum.hpw }${curriculum.start }${curriculum.end } checked="checked" + onclick="checkboxOnclick(this);" /> + checked="checked" + onclick="checkboxOnclick(this);" /> +
##小计----00000----------------
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ID课程名称课程编号学分学期学时理论学时实验学时周学时起始周结束周开课分散
${curriculum.id }${curriculum.name }${curriculum.identifier }${curriculum.score }${curriculum.time }${curriculum.theoretical }${curriculum.experiement }${curriculum.hpw }${curriculum.start }${curriculum.end } checked="checked" + onclick="checkboxOnclick(this);" /> + checked="checked" + onclick="checkboxOnclick(this);" /> +
##小计----00000----------------
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ID课程名称课程编号学分学期学时理论学时实验学时周学时起始周结束周开课分散
${curriculum.id }${curriculum.name }${curriculum.identifier }${curriculum.score }${curriculum.time }${curriculum.theoretical }${curriculum.experiement }${curriculum.hpw }${curriculum.start }${curriculum.end } checked="checked" + onclick="checkboxOnclick(this);" /> + checked="checked" + onclick="checkboxOnclick(this);" /> +
##小计----00000----------------
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ID课程名称课程编号学分学期学时理论学时实验学时周学时起始周结束周开课分散
${curriculum.id }${curriculum.name }${curriculum.identifier }${curriculum.score }${curriculum.time }${curriculum.theoretical }${curriculum.experiement }${curriculum.hpw }${curriculum.start }${curriculum.end } checked="checked" + onclick="checkboxOnclick(this);" /> + checked="checked" + onclick="checkboxOnclick(this);" /> +
##小计----00000----------------
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ID课程名称课程编号学分学期学时理论学时实验学时周学时起始周结束周开课分散
${curriculum.id }${curriculum.name }${curriculum.identifier }${curriculum.score }${curriculum.time }${curriculum.theoretical }${curriculum.experiement }${curriculum.hpw }${curriculum.start }${curriculum.end } checked="checked" + onclick="checkboxOnclick(this);" /> + checked="checked" + onclick="checkboxOnclick(this);" /> +
##小计----00000----------------
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ID课程名称课程编号学分学期学时理论学时实验学时周学时起始周结束周开课分散
${curriculum.id }${curriculum.name }${curriculum.identifier }${curriculum.score }${curriculum.time }${curriculum.theoretical }${curriculum.experiement }${curriculum.hpw }${curriculum.start }${curriculum.end } checked="checked" + onclick="checkboxOnclick(this);" /> + checked="checked" + onclick="checkboxOnclick(this);" /> +
##小计----00000----------------
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ID课程名称课程编号学分学期学时理论学时实验学时周学时起始周结束周开课分散
${curriculum.id }${curriculum.name }${curriculum.identifier }${curriculum.score }${curriculum.time }${curriculum.theoretical }${curriculum.experiement }${curriculum.hpw }${curriculum.start }${curriculum.end } checked="checked" + onclick="checkboxOnclick(this);" /> + checked="checked" + onclick="checkboxOnclick(this);" /> +
##小计----00000----------------
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ID课程名称课程编号学分学期学时理论学时实验学时周学时起始周结束周开课分散
${curriculum.id }${curriculum.name }${curriculum.identifier }${curriculum.score }${curriculum.time }${curriculum.theoretical }${curriculum.experiement }${curriculum.hpw }${curriculum.start }${curriculum.end } checked="checked" + onclick="checkboxOnclick(this);" /> + checked="checked" + onclick="checkboxOnclick(this);" /> +
##小计----00000----------------
+
+
+ +
+ + +
+ +
+
+ +
+
+ + + + + \ No newline at end of file diff --git a/build/classes/cn/edu/hrbcu/curriculum/controller/CurriculumController.class b/build/classes/cn/edu/hrbcu/curriculum/controller/CurriculumController.class index ec43fe519f13fef1727ff91beb4ec1378fdc274c..9db0881e5082ea98a3dd72b74c476b3daf460022 100644 Binary files a/build/classes/cn/edu/hrbcu/curriculum/controller/CurriculumController.class and b/build/classes/cn/edu/hrbcu/curriculum/controller/CurriculumController.class differ diff --git a/build/classes/cn/edu/hrbcu/curriculum/mapper/CurriculumMapper.xml b/build/classes/cn/edu/hrbcu/curriculum/mapper/CurriculumMapper.xml index d677f7068e3901753cd41b92b6244612c9cea83f..489dff6b8c7f19276d0d323adc737ff58e79d50d 100644 --- a/build/classes/cn/edu/hrbcu/curriculum/mapper/CurriculumMapper.xml +++ b/build/classes/cn/edu/hrbcu/curriculum/mapper/CurriculumMapper.xml @@ -11,6 +11,7 @@ + @@ -71,7 +72,7 @@ - id, specialityid, courseid, semester, start, end, hpw, sort, available + id, specialityid, courseid, semester, start, end, hpw, sort, available, disperse @@ -208,6 +217,9 @@ available = #{record.available,jdbcType=BIT}, + + disperse = #{record.disperse,jdbcType=BIT}, + @@ -223,7 +235,8 @@ end = #{record.end,jdbcType=INTEGER}, hpw = #{record.hpw,jdbcType=DOUBLE}, sort = #{record.sort,jdbcType=INTEGER}, - available = #{record.available,jdbcType=BIT} + available = #{record.available,jdbcType=BIT}, + disperse = #{record.disperse,jdbcType=BIT} @@ -255,6 +268,9 @@ available = #{available,jdbcType=BIT}, + + disperse = #{disperse,jdbcType=BIT}, + where id = #{id,jdbcType=BIGINT} @@ -267,7 +283,8 @@ end = #{end,jdbcType=INTEGER}, hpw = #{hpw,jdbcType=DOUBLE}, sort = #{sort,jdbcType=INTEGER}, - available = #{available,jdbcType=BIT} + available = #{available,jdbcType=BIT}, + disperse = #{disperse,jdbcType=BIT} where id = #{id,jdbcType=BIGINT} \ No newline at end of file diff --git a/build/classes/cn/edu/hrbcu/curriculum/pojo/Curriculum.class b/build/classes/cn/edu/hrbcu/curriculum/pojo/Curriculum.class index 290da053239cfbc29850606898ab2ee57df0775b..34bd745e8ef3babbcb9b2d9223b8a436f83d54d0 100644 Binary files a/build/classes/cn/edu/hrbcu/curriculum/pojo/Curriculum.class and b/build/classes/cn/edu/hrbcu/curriculum/pojo/Curriculum.class differ diff --git a/build/classes/cn/edu/hrbcu/curriculum/pojo/CurriculumExample$Criteria.class b/build/classes/cn/edu/hrbcu/curriculum/pojo/CurriculumExample$Criteria.class index f6ff913ec0237b17c2c45b790b413505f0958d7e..2d23f5afb18f421a1ee8edb829c9b272b690064f 100644 Binary files a/build/classes/cn/edu/hrbcu/curriculum/pojo/CurriculumExample$Criteria.class and b/build/classes/cn/edu/hrbcu/curriculum/pojo/CurriculumExample$Criteria.class differ diff --git a/build/classes/cn/edu/hrbcu/curriculum/pojo/CurriculumExample$Criterion.class b/build/classes/cn/edu/hrbcu/curriculum/pojo/CurriculumExample$Criterion.class index 054b2ddeed6b3fce0db9fe6d4f24cfc16468e7c9..86176c796911f2e8a3eabdf5394edbf0d9174ef6 100644 Binary files a/build/classes/cn/edu/hrbcu/curriculum/pojo/CurriculumExample$Criterion.class and b/build/classes/cn/edu/hrbcu/curriculum/pojo/CurriculumExample$Criterion.class differ diff --git a/build/classes/cn/edu/hrbcu/curriculum/pojo/CurriculumExample$GeneratedCriteria.class b/build/classes/cn/edu/hrbcu/curriculum/pojo/CurriculumExample$GeneratedCriteria.class index 598af37939294f3a07830d299383a1d7dbdcfd21..74430a06fb8cf5b6ef6eda97c7a13df2f3e0c33f 100644 Binary files a/build/classes/cn/edu/hrbcu/curriculum/pojo/CurriculumExample$GeneratedCriteria.class and b/build/classes/cn/edu/hrbcu/curriculum/pojo/CurriculumExample$GeneratedCriteria.class differ diff --git a/build/classes/cn/edu/hrbcu/curriculum/service/CurriculumServiceImpl.class b/build/classes/cn/edu/hrbcu/curriculum/service/CurriculumServiceImpl.class index 0761bb5c3abb4368892b0a6f8589a8e2f20f6279..dc4c80f51f9af93f3381756343f6c9a573b64b2c 100644 Binary files a/build/classes/cn/edu/hrbcu/curriculum/service/CurriculumServiceImpl.class and b/build/classes/cn/edu/hrbcu/curriculum/service/CurriculumServiceImpl.class differ diff --git a/src/cn/edu/hrbcu/curriculum/controller/CurriculumController.java b/src/cn/edu/hrbcu/curriculum/controller/CurriculumController.java index 5c521fb82d14411934e50e98462ef8761525934b..a6505e9b905666cdd1e12d063a93c199caf9e5ad 100644 --- a/src/cn/edu/hrbcu/curriculum/controller/CurriculumController.java +++ b/src/cn/edu/hrbcu/curriculum/controller/CurriculumController.java @@ -108,10 +108,12 @@ public class CurriculumController { c.put("time", course.getTheoretical() + course.getExperiement()); c.put("theoretical", course.getTheoretical()); c.put("experiement", course.getExperiement()); + c.put("unit", course.getUnit()); c.put("hpw", curriculum.getHpw()); c.put("start", curriculum.getStart()); c.put("end", curriculum.getEnd()); c.put("avaliable", curriculum.getAvailable()); + c.put("disperse", curriculum.getDisperse()); curriculums.add(c); } @@ -167,10 +169,12 @@ public class CurriculumController { c.put("time", course.getTheoretical() + course.getExperiement()); c.put("theoretical", course.getTheoretical()); c.put("experiement", course.getExperiement()); + c.put("unit", course.getUnit()); c.put("hpw", curriculum.getHpw()); c.put("start", curriculum.getStart()); c.put("end", curriculum.getEnd()); c.put("avaliable", curriculum.getAvailable()); + c.put("disperse", curriculum.getDisperse()); curriculums.add(c); } @@ -261,29 +265,72 @@ public class CurriculumController { List> curriculums = new ArrayList>(); //保存小计信息 Map total = new HashMap(); - double[] t = new double[10]; + double[] t = new double[10];//所有时小计 + double[] t_w = new double[10];//所有周小计 + double[] d = new double[10];//开课,分散时小计 + double[] d_w = new double[10];//开课,分散周小计 List curriculums_ = curriculumService.selectAllCurriculumBySpecialityandSemester(specialityId, i); if (curriculums_ != null && curriculums_.size() > 0) { for (Curriculum curriculum : curriculums_) { + if(!curriculum.getAvailable()){//课程没有开课,跳过 + continue; + } + Map c = new HashMap(); Course course = courseService.selectCourseById(curriculum.getCourseid()); + Boolean isDisperse = curriculum.getDisperse(); + int unit = course.getUnit(); c.put("id", course.getId()); c.put("name", course.getName()); c.put("identifier", course.getIdentifier()); - c.put("score", course.getScore()); + + c.put("score", course.getScore()); + if(!isDisperse){ t[0] += (course.getScore()==null) ? 0 : course.getScore(); + }else{ + d[0] += (course.getScore()==null) ? 0 : course.getScore(); + } + c.put("time", course.getTheoretical() + course.getExperiement()); + if(!isDisperse){ t[1] += (course.getTheoretical() == null || course.getExperiement() == null) ? 0 : course.getTheoretical() + course.getExperiement() ; + }else{ + d[1] += (course.getTheoretical() == null || course.getExperiement() == null) ? 0 : course.getTheoretical() + course.getExperiement() ; + } + c.put("theoretical", course.getTheoretical()); + if(!isDisperse){ t[2] += (course.getTheoretical()==null) ? 0 : course.getTheoretical(); + }else{ + d[2] += (course.getTheoretical()==null) ? 0 : course.getTheoretical(); + } + c.put("experiement", course.getExperiement()); + if(!isDisperse){ t[3] += (course.getExperiement()==null) ? 0 : course.getExperiement(); + }else{ + d[3] += (course.getExperiement()==null) ? 0 : course.getExperiement(); + } + c.put("unit", course.getUnit()); c.put("hpw", curriculum.getHpw()); - t[4] += (curriculum.getHpw()==null) ? 0 : curriculum.getHpw(); + if(!isDisperse){ + if(unit == 0){ + t[4] += (curriculum.getHpw()==null) ? 0 : curriculum.getHpw(); + }else{ + t_w[4] += (curriculum.getHpw()==null) ? 0 : curriculum.getHpw(); + } + }else{ + if(unit == 0){ + d[4] += (curriculum.getHpw()==null) ? 0 : curriculum.getHpw(); + }else{ + d_w[4] += (curriculum.getHpw()==null) ? 0 : curriculum.getHpw(); + } + } c.put("start", curriculum.getStart()); c.put("end", curriculum.getEnd()); c.put("available", curriculum.getAvailable()); + c.put("disperse", curriculum.getDisperse()); if(available){//若果只查已开课的 if(curriculum.getAvailable()){ @@ -295,17 +342,42 @@ public class CurriculumController { } } //保存学期的小计信息 - total.put("score", t[0]); - total.put("time", t[1]); - total.put("theoretical", t[2]); - total.put("experiement", t[3]); - total.put("hpw", t[4]); + total.put("score", t[0] + d[0]);//学分不分是否分散,全部统计 + total.put("time", double2String(t[1])); + if(d[1] > 0D){ + total.put("time", double2String(t[1]) + "(" + double2String(d[1]) + ")");// + } + + total.put("theoretical", double2String(t[2])); + if(d[2] > 0D){ + total.put("theoretical", double2String(t[2]) + "(" + double2String(d[2]) + ")"); + } + + total.put("experiement", double2String(t[3])); + if(d[3] > 0D){ + total.put("experiement", double2String(t[3]) + "(" + double2String(d[3]) + ")"); + } + + if(t_w[4] > 0D || d_w[4] > 0D){ + total.put("hpw", double2String(t[4]) + "/"); + if(t_w[4] > 0D){ + total.put("hpw", (String)total.get("hpw") + double2String(t_w[4])); + } + + if(d_w[4] > 0D){ + total.put("hpw", (String)total.get("hpw") + "(" + double2String(t_w[4]) + ")"); + } + + total.put("hpw", (String)total.get("hpw") + "周" ); + }else{ + total.put("hpw",double2String(t[4])); + } semester.put("course", curriculums); semester.put("total", total); - all_curriculums.put("semester"+i, semester); + all_curriculums.put("semester" + i, semester); } return all_curriculums; @@ -342,11 +414,13 @@ public class CurriculumController { t[2] += (course.getTheoretical()==null) ? 0 : course.getTheoretical(); c.put("experiement", course.getExperiement()); t[3] += (course.getExperiement()==null) ? 0 : course.getExperiement(); + c.put("unit", course.getUnit()); c.put("hpw", curriculum.getHpw()); t[4] += (curriculum.getHpw()==null) ? 0 : curriculum.getHpw(); c.put("start", curriculum.getStart()); c.put("end", curriculum.getEnd()); c.put("available", curriculum.getAvailable()); + c.put("disperse", curriculum.getDisperse()); c.put("semester", CharacterUtil.num2roman(curriculum.getSemester())); curriculums.add(c); @@ -428,13 +502,12 @@ public class CurriculumController { } private Map querySchedule(Long specialityId, Boolean is){ - /*double total_time = 0;//总学时 - double total_theoretical_time = 0;//理论总学时 - double total_experiement_time = 0;//实验总学时 - double total_score = 0;//总学分 - */ - double coursemode_theoretical_time = 0;//课程模式理论学时 - double coursemode_experiement_time = 0;//课程模式实验学时 + double coursemode_theoretical_hour = 0;//课程模式理论学时 + double coursemode_theoretical_disperse_hour = 0;//课程模式理论分散学时 + double coursemode_experiement_hour = 0;//课程模式实验学时 + double coursemode_experiement_disperse_hour = 0;//课程模式实验分散学时 + double coursemode_practice_week = 0;//课程模式实验学时 + double coursemode_practice_disperse_week = 0;//课程模式实验分散学时 double coursemode_score = 0;//课程模式学分 List> platforms = new ArrayList>(); List speciality_curriculums = curriculumService.selectAllCurriculumBySpeciality(specialityId, is); @@ -460,8 +533,8 @@ public class CurriculumController { List> coursemodes = new ArrayList>(); if(cms != null && cms.size() > 0){ for (Coursemode cm : cms) { - coursemode_theoretical_time = 0D; - coursemode_experiement_time = 0D; + coursemode_theoretical_hour = 0D; + coursemode_experiement_hour = 0D; coursemode_score = 0D; //(4) 查询该模式下所有的课程 // selectCourseBy @@ -477,25 +550,52 @@ public class CurriculumController { Map obj = new HashMap(); List curs = curriculumService.selectAllCurriculumBySpecialityandCourse(specialityId, course.getId()); if(curs != null && curs.size() > 0){ - obj.put("semester", CharacterUtil.num2roman(curs.get(0).getSemester())); + String rets = ""; + for(int k = 0; k < curs.size() ; k++){ + rets += CharacterUtil.num2roman(curs.get(0).getSemester()); + if(k < curs.size() - 1){ + rets += ","; + } + + if(course.getUnit() == null || course.getUnit() == 0){ + if(curs.get(k).getDisperse()){//分散 + coursemode_theoretical_disperse_hour += ((course.getTheoretical()==null) ? 0 : course.getTheoretical()) ; + coursemode_experiement_disperse_hour += + ((course.getExperiement()==null) ? 0 : course.getExperiement()) ; + }else{ + coursemode_theoretical_hour += ((course.getTheoretical()==null) ? 0 : course.getTheoretical()) ; + coursemode_experiement_hour += + ((course.getExperiement()==null) ? 0 : course.getExperiement()) ; + } + obj.put("hour", (((course.getTheoretical()==null) ? 0 : course.getTheoretical()) + ((course.getExperiement()==null) ? 0 : course.getExperiement())));//课程总学时 + }else{ + if(curs.get(k).getDisperse()){//分散 + coursemode_practice_disperse_week += (((course.getTheoretical()==null) ? 0 : course.getTheoretical()) + ((course.getExperiement()==null) ? 0 : course.getExperiement())); + }else{ + coursemode_practice_disperse_week += (((course.getTheoretical()==null) ? 0 : course.getTheoretical()) + ((course.getExperiement()==null) ? 0 : course.getExperiement())); + } + obj.put("hour", (((course.getTheoretical()==null) ? 0 : course.getTheoretical()) + ((course.getExperiement()==null) ? 0 : course.getExperiement())) + "周");//课程总学时 + } + } + obj.put("semester", rets); obj.put("available", curs.get(0).getAvailable()); }else{ obj.put("semester", ""); obj.put("available", ""); } - - + + if(course.getUnit() == null || course.getUnit() == 0){ + obj.put("hour", (((course.getTheoretical()==null) ? 0 : course.getTheoretical()) + ((course.getExperiement()==null) ? 0 : course.getExperiement())));//课程总学时 + }else{ + obj.put("hour", (((course.getTheoretical()==null) ? 0 : course.getTheoretical()) + ((course.getExperiement()==null) ? 0 : course.getExperiement())) + "周");//课程总学时 + } obj.put("name", course.getName()); obj.put("score", course.getScore()); - obj.put("time", ((course.getTheoretical()==null) ? 0 : course.getTheoretical()) + ((course.getExperiement()==null) ? 0 : course.getExperiement())); - obj.put("theoretical", course.getTheoretical()); - obj.put("experiement", course.getExperiement()); + obj.put("theoretical", course.getTheoretical());//课程的理论学时 + obj.put("experiement", course.getExperiement());//课程的时间学时 + list.add(obj); ///////////////////////////////////////////////////////////////// - coursemode_theoretical_time += ((course.getTheoretical()==null) ? 0 : course.getTheoretical()) ; - coursemode_experiement_time += + ((course.getExperiement()==null) ? 0 : course.getExperiement()) ; coursemode_score += ((course.getScore()==null) ? 0 : course.getScore()) ; } @@ -504,18 +604,23 @@ public class CurriculumController { Map coursemode = new HashMap(); coursemode.put("courses", list);//所有课程 + 其他信息 //coursemode.put("courses", courses);//所有课程 - coursemode.put("theoretical", coursemode_theoretical_time);//理论学时 - coursemode.put("experiement", coursemode_experiement_time);//实验学时 - coursemode.put("time", coursemode_theoretical_time + coursemode_experiement_time); + coursemode.put("theoretical", coursemode_theoretical_hour);//理论学时 + coursemode.put("dispersetheoretical", coursemode_theoretical_disperse_hour);//理论学时 + coursemode.put("experiement", coursemode_experiement_hour);//实验学时 + coursemode.put("vexperiement", coursemode_experiement_disperse_hour);//实验学时 + coursemode.put("hour", coursemode_theoretical_hour + coursemode_experiement_hour); + coursemode.put("dispersehour", coursemode_theoretical_disperse_hour + coursemode_experiement_disperse_hour); + coursemode.put("week", coursemode_practice_week); + coursemode.put("disperseweek", coursemode_practice_disperse_week); coursemode.put("name", cm.getName());//名称 coursemode.put("score", coursemode_score);//学分 coursemodes.add(coursemode); //统计总计信息 - /*total_theoretical_time += coursemode_theoretical_time; - total_experiement_time += coursemode_experiement_time; + /*total_theoretical_hour += coursemode_theoretical_hour; + total_experiement_hour += coursemode_experiement_hour; total_score += coursemode_score; - total_time += (coursemode_theoretical_time + coursemode_experiement_time);*/ + total_hour += (coursemode_theoretical_hour + coursemode_experiement_hour);*/ } } } @@ -542,9 +647,15 @@ public class CurriculumController { private Map queryCourseTimeScore(Long specialityId, Boolean is){ Map ts = new HashMap(); - double[][] theoretical_times = new double[20][10];//理论课学时 - double[][] experiement_times = new double[20][10];//实验课学时 + double[][] theoretical_hours = new double[20][10];//理论课学时 + double[][] experiement_hours = new double[20][10];//实验课学时 + double[][] theoretical_weeks = new double[20][10];//理论课学周 + double[][] experiement_weeks = new double[20][10];//实验课学周 double[][] scores = new double[20][10];//学分 + double[][] theoretical_disperse_hours = new double[20][10];//分散理论课学时 + double[][] experiement_disperse_hours = new double[20][10];//分散实验课学时 + double[][] theoretical_disperse_weeks = new double[20][10];//分散理论课学周 + double[][] experiement_disperse_weeks = new double[20][10];//分散实验课学周 List curriculums = curriculumService.selectAllCurriculumBySpeciality(specialityId,is); if(curriculums != null && curriculums.size() > 0){ @@ -552,79 +663,200 @@ public class CurriculumController { if(is.equals(new Boolean(true))){//是否考虑已开 if(curriculum.getAvailable().equals(is)){//如果已开,则统计 Course theCourse = courseService.selectCourseById(curriculum.getCourseid()); - theoretical_times[theCourse.getCoursetypeid().intValue()][theCourse.getCoursemodeid().intValue()] += ((theCourse.getTheoretical()==null)?0:theCourse.getTheoretical()); - experiement_times[theCourse.getCoursetypeid().intValue()][theCourse.getCoursemodeid().intValue()] += ((theCourse.getExperiement()==null)?0:theCourse.getExperiement()); + if(theCourse.getUnit() == null || theCourse.getUnit() == 0){//统计学时 + if(curriculum.getDisperse()){//分散 + theoretical_disperse_hours[theCourse.getCoursetypeid().intValue()][theCourse.getCoursemodeid().intValue()] += ((theCourse.getTheoretical()==null)?0:theCourse.getTheoretical()); + experiement_disperse_hours[theCourse.getCoursetypeid().intValue()][theCourse.getCoursemodeid().intValue()] += ((theCourse.getExperiement()==null)?0:theCourse.getExperiement()); + }else{ + theoretical_hours[theCourse.getCoursetypeid().intValue()][theCourse.getCoursemodeid().intValue()] += ((theCourse.getTheoretical()==null)?0:theCourse.getTheoretical()); + experiement_hours[theCourse.getCoursetypeid().intValue()][theCourse.getCoursemodeid().intValue()] += ((theCourse.getExperiement()==null)?0:theCourse.getExperiement()); + } + + }else{//统计学周 + if(curriculum.getDisperse()){//分散 + theoretical_disperse_weeks[theCourse.getCoursetypeid().intValue()][theCourse.getCoursemodeid().intValue()] += ((theCourse.getTheoretical()==null)?0:theCourse.getTheoretical()); + experiement_disperse_weeks[theCourse.getCoursetypeid().intValue()][theCourse.getCoursemodeid().intValue()] += ((theCourse.getExperiement()==null)?0:theCourse.getExperiement()); + }else{ + theoretical_weeks[theCourse.getCoursetypeid().intValue()][theCourse.getCoursemodeid().intValue()] += ((theCourse.getTheoretical()==null)?0:theCourse.getTheoretical()); + experiement_weeks[theCourse.getCoursetypeid().intValue()][theCourse.getCoursemodeid().intValue()] += ((theCourse.getExperiement()==null)?0:theCourse.getExperiement()); + } + } + //学分全统计 scores[theCourse.getCoursetypeid().intValue()][theCourse.getCoursemodeid().intValue()] += ((theCourse.getScore()==null)?0:theCourse.getScore()); } }else{ Course theCourse = courseService.selectCourseById(curriculum.getCourseid()); - theoretical_times[theCourse.getCoursetypeid().intValue()][theCourse.getCoursemodeid().intValue()] += ((theCourse.getTheoretical()==null)?0:theCourse.getTheoretical()); - experiement_times[theCourse.getCoursetypeid().intValue()][theCourse.getCoursemodeid().intValue()] += ((theCourse.getExperiement()==null)?0:theCourse.getExperiement()); + if(theCourse.getUnit() == null || theCourse.getUnit() == 0){//统计学时 + if(curriculum.getDisperse()){//分散 + theoretical_disperse_hours[theCourse.getCoursetypeid().intValue()][theCourse.getCoursemodeid().intValue()] += ((theCourse.getTheoretical()==null)?0:theCourse.getTheoretical()); + experiement_disperse_hours[theCourse.getCoursetypeid().intValue()][theCourse.getCoursemodeid().intValue()] += ((theCourse.getExperiement()==null)?0:theCourse.getExperiement()); + }else{ + theoretical_hours[theCourse.getCoursetypeid().intValue()][theCourse.getCoursemodeid().intValue()] += ((theCourse.getTheoretical()==null)?0:theCourse.getTheoretical()); + experiement_hours[theCourse.getCoursetypeid().intValue()][theCourse.getCoursemodeid().intValue()] += ((theCourse.getExperiement()==null)?0:theCourse.getExperiement()); + } + }else{//统计学周 + if(curriculum.getDisperse()){//分散 + theoretical_disperse_weeks[theCourse.getCoursetypeid().intValue()][theCourse.getCoursemodeid().intValue()] += ((theCourse.getTheoretical()==null)?0:theCourse.getTheoretical()); + experiement_disperse_weeks[theCourse.getCoursetypeid().intValue()][theCourse.getCoursemodeid().intValue()] += ((theCourse.getExperiement()==null)?0:theCourse.getExperiement()); + }else{ + theoretical_weeks[theCourse.getCoursetypeid().intValue()][theCourse.getCoursemodeid().intValue()] += ((theCourse.getTheoretical()==null)?0:theCourse.getTheoretical()); + experiement_weeks[theCourse.getCoursetypeid().intValue()][theCourse.getCoursemodeid().intValue()] += ((theCourse.getExperiement()==null)?0:theCourse.getExperiement()); + } + } scores[theCourse.getCoursetypeid().intValue()][theCourse.getCoursemodeid().intValue()] += ((theCourse.getScore()==null)?0:theCourse.getScore()); } } } + //必修课 + double total_compulsory_theoretical_hour = 0; + double total_compulsory_experiement_hour = 0; + double total_compulsory_practice_hour = 0; + double total_compulsory_theoretical_week = 0; + double total_compulsory_experiement_week = 0; + double total_compulsory_practice_week = 0; + + double total_compulsory_disperse_theoretical_hour = 0; + double total_compulsory_disperse_experiement_hour = 0; + double total_compulsory_disperse_practice_hour = 0; + double total_compulsory_disperse_theoretical_week = 0; + double total_compulsory_disperse_experiement_week = 0; + double total_compulsory_disperse_practice_week = 0; - double total_compulsory_theoretical_time = 0; - double total_compulsory_experiement_time = 0; - double total_compulsory_practice_time = 0; double total_compulsory_theoretical_score = 0; double total_compulsory_practice_score = 0; + //选修课 + double total_elective_theoretical_hour = 0; + double total_elective_experiement_hour = 0; + double total_elective_practice_hour = 0; + double total_elective_theoretical_week = 0; + double total_elective_experiement_week = 0; + double total_elective_practice_week = 0; - double total_elective_theoretical_time = 0; - double total_elective_experiement_time = 0; - double total_elective_practice_time = 0; double total_elective_theoretical_score = 0; double total_elective_practice_score = 0; + double total_elective_disperse_theoretical_hour = 0; + double total_elective_disperse_experiement_hour = 0; + double total_elective_disperse_practice_hour = 0; + double total_elective_disperse_theoretical_week = 0; + double total_elective_disperse_experiement_week = 0; + double total_elective_disperse_practice_week = 0; + for(int coursemode = 1 ; coursemode <= 3; coursemode ++){ if(coursemode == 1){//必修课 for(int coursetype = 1; coursetype <= 19; coursetype ++){ if(coursetype == 8 || coursetype == 9){//实践课 - total_compulsory_practice_time += theoretical_times[coursetype][coursemode] + experiement_times[coursetype][coursemode]; - total_compulsory_practice_score += scores[coursetype][coursemode] + experiement_times[coursetype][coursemode]; + //统计学时 + total_compulsory_practice_hour += theoretical_hours[coursetype][coursemode] + experiement_hours[coursetype][coursemode]; + total_compulsory_disperse_practice_hour += theoretical_disperse_hours[coursetype][coursemode] + experiement_disperse_hours[coursetype][coursemode]; + //统计学分 + total_compulsory_practice_score += scores[coursetype][coursemode] + experiement_hours[coursetype][coursemode]; + //统计学周 + total_compulsory_practice_week += theoretical_weeks[coursetype][coursemode] + experiement_weeks[coursetype][coursemode]; + total_compulsory_disperse_practice_week += theoretical_disperse_weeks[coursetype][coursemode] + experiement_disperse_weeks[coursetype][coursemode]; }else{//理论课 - total_compulsory_theoretical_time += theoretical_times[coursetype][coursemode]; - total_compulsory_experiement_time += experiement_times[coursetype][coursemode]; + //统计学时 + total_compulsory_theoretical_hour += theoretical_hours[coursetype][coursemode]; + total_compulsory_disperse_theoretical_hour += theoretical_disperse_hours[coursetype][coursemode]; + total_compulsory_experiement_hour += experiement_hours[coursetype][coursemode]; + total_compulsory_disperse_experiement_hour += experiement_disperse_hours[coursetype][coursemode]; + //统计学周 + total_compulsory_theoretical_week += theoretical_weeks[coursetype][coursemode]; + total_compulsory_disperse_theoretical_week += theoretical_disperse_weeks[coursetype][coursemode]; + total_compulsory_experiement_week += experiement_weeks[coursetype][coursemode]; + total_compulsory_disperse_experiement_week += experiement_disperse_weeks[coursetype][coursemode]; + //统计学分 total_compulsory_theoretical_score += scores[coursetype][coursemode]; } } }else{//选修课 for(int coursetype = 1; coursetype <= 19; coursetype ++){ if(coursetype == 8 || coursetype == 9){//实践课 - total_elective_practice_time += theoretical_times[coursetype][coursemode] + experiement_times[coursetype][coursemode]; - total_elective_practice_score += scores[coursetype][coursemode] + experiement_times[coursetype][coursemode]; + //统计学时 + total_elective_practice_hour += theoretical_hours[coursetype][coursemode] + experiement_hours[coursetype][coursemode]; + total_elective_disperse_practice_hour += theoretical_disperse_hours[coursetype][coursemode] + experiement_disperse_hours[coursetype][coursemode]; + total_elective_practice_score += scores[coursetype][coursemode] + experiement_hours[coursetype][coursemode]; + //统计学周 + total_elective_practice_week += theoretical_weeks[coursetype][coursemode] + experiement_weeks[coursetype][coursemode]; + total_elective_disperse_practice_week += theoretical_disperse_weeks[coursetype][coursemode] + experiement_disperse_weeks[coursetype][coursemode]; }else{//理论课 - total_elective_theoretical_time += theoretical_times[coursetype][coursemode]; - total_elective_experiement_time += experiement_times[coursetype][coursemode]; + //统计学时 + total_elective_theoretical_hour += theoretical_hours[coursetype][coursemode]; + total_elective_disperse_theoretical_hour += theoretical_disperse_hours[coursetype][coursemode]; + total_elective_experiement_hour += experiement_hours[coursetype][coursemode]; + total_elective_disperse_experiement_hour += experiement_disperse_hours[coursetype][coursemode]; + //统计学周 + total_elective_theoretical_week += theoretical_weeks[coursetype][coursemode]; + total_elective_disperse_theoretical_week += theoretical_disperse_weeks[coursetype][coursemode]; + total_elective_experiement_week += experiement_weeks[coursetype][coursemode]; + total_elective_disperse_experiement_week += experiement_disperse_weeks[coursetype][coursemode]; + //统计学分 total_elective_theoretical_score += scores[coursetype][coursemode]; } } } } //必修课 - ts.put("total_coursetype_compulsory_theoretical_time", total_compulsory_theoretical_time);//必修课总理论课的学时 - ts.put("total_coursetype_compulsory_experiement_time", total_compulsory_experiement_time);//必修课总实验课的学时 - ts.put("total_coursetype_compulsory_practice_time", total_compulsory_practice_time);//选修课总实践课的学时 + ts.put("total_coursetype_compulsory_theoretical_hour", total_compulsory_theoretical_hour);//必修课总理论课的学时 + ts.put("total_coursetype_compulsory_experiement_hour", total_compulsory_experiement_hour);//必修课总实验课的学时 + ts.put("total_coursetype_compulsory_practice_hour", total_compulsory_practice_hour);//选修课总实践课的学时 + ts.put("total_coursetype_compulsory_theoretical_week", total_compulsory_theoretical_week);//必修课总理论课的学周 + ts.put("total_coursetype_compulsory_experiement_week", total_compulsory_experiement_week);//必修课总实验课的学周 + ts.put("total_coursetype_compulsory_practice_week", total_compulsory_practice_week);//必修课总实践课的学周 ts.put("total_coursetype_compulsory_theoretical_score", total_compulsory_theoretical_score);//必修课总理论课的学分 ts.put("total_coursetype_compulsory_practice_score", total_compulsory_practice_score);//选修课总实践课的学分 + + ts.put("total_coursetype_compulsory_disperse_theoretical_hour", total_compulsory_disperse_theoretical_hour);//必修课总理论课的分散学时 + ts.put("total_coursetype_compulsory_disperse_experiement_hour", total_compulsory_disperse_experiement_hour);//必修课总实验课的分散学时 + ts.put("total_coursetype_compulsory_disperse_practice_hour", total_compulsory_disperse_practice_hour);//选修课总实践课的分散学时 + ts.put("total_coursetype_compulsory_disperse_theoretical_week", total_compulsory_disperse_theoretical_week);//必修课总理论课的分散学周 + ts.put("total_coursetype_compulsory_disperse_experiement_week", total_compulsory_disperse_experiement_week);//必修课总实验课的分散学周 + ts.put("total_coursetype_compulsory_disperse_practice_week", total_compulsory_disperse_practice_week);//必修课总实践课的分散学周 + //选修课 - ts.put("total_coursetype_elective_theoretical_time", total_elective_theoretical_time);//选修课总理论课的学时 - ts.put("total_coursetype_elective_experiement_time", total_elective_experiement_time);//选修课总实验课的学时 - ts.put("total_coursetype_elective_practice_time", total_elective_practice_time);//选修课总实践课的学时 + ts.put("total_coursetype_elective_theoretical_hour", total_elective_theoretical_hour);//选修课总理论课的学时 + ts.put("total_coursetype_elective_experiement_hour", total_elective_experiement_hour);//选修课总实验课的学时 + ts.put("total_coursetype_elective_practice_hour", total_elective_practice_hour);//选修课总实践课的学时 + ts.put("total_coursetype_elective_theoretical_week", total_elective_theoretical_week);//选修课总理论课的学周 + ts.put("total_coursetype_elective_experiement_week", total_elective_experiement_week);//选修课总实验课的学周 + ts.put("total_coursetype_elective_practice_week", total_elective_practice_week);//选修课总实践课的学周 ts.put("total_coursemode_elective_theoretical_score", total_elective_theoretical_score);//选修课理论课总的学分 ts.put("total_coursemode_elective_practice_score", total_elective_practice_score);//选修课实践课总的学分 + ts.put("total_coursetype_elective_disperse_theoretical_hour", total_elective_disperse_theoretical_hour);//选修课总理论课的分散学时 + ts.put("total_coursetype_elective_disperse_experiement_hour", total_elective_disperse_experiement_hour);//选修课总实验课的分散学时 + ts.put("total_coursetype_elective_disperse_practice_hour", total_elective_disperse_practice_hour);//选修课总实践课的分散学时 + ts.put("total_coursetype_elective_disperse_theoretical_week", total_elective_disperse_theoretical_week);//选修课总理论课的分散学周 + ts.put("total_coursetype_elective_disperse_experiement_week", total_elective_disperse_experiement_week);//选修课总实验课的分散学周 + ts.put("total_coursetype_elective_disperse_practice_week", total_elective_disperse_practice_week);//选修课总实践课的分散学周 - ts.put("totaltheoreticaltime", total_compulsory_theoretical_time);//总的理论学时 - ts.put("totalexperiementtime", total_compulsory_experiement_time);//总的实验学时 + //课堂教学 + ts.put("totaltheoreticalhour", total_compulsory_theoretical_hour + total_elective_theoretical_hour);//总的理论学时 + ts.put("totalexperiementhour", total_compulsory_experiement_hour + total_elective_experiement_hour);//总的实验学时 + ts.put("totaltheoreticalweek", total_compulsory_theoretical_week + total_elective_theoretical_week);//总的理论学周 + ts.put("totalexperiementweek", total_compulsory_experiement_week + total_elective_experiement_week);//总的实验学周 ts.put("totaltheoreticalscore", total_compulsory_theoretical_score + total_elective_theoretical_score);//总的学分 - ts.put("totalpracticetime", total_compulsory_practice_time + total_elective_practice_time);//总的实践学时 + ts.put("totaltheoreticaldispersehour", total_compulsory_disperse_theoretical_hour + total_elective_disperse_theoretical_hour);//总的理论分散学时 + ts.put("totalexperiementdispersehour", total_compulsory_disperse_experiement_hour + total_elective_disperse_experiement_hour);//总的实验分散学时 + ts.put("totaltheoreticaldisperseweek", total_compulsory_disperse_theoretical_week + total_elective_disperse_theoretical_week);//总的理论分散学周 + ts.put("totalexperiementdisperseweek", total_compulsory_disperse_experiement_week + total_elective_disperse_experiement_week);//总的实验分散学周 + //实践教学 + ts.put("totalpracticehour", total_compulsory_disperse_practice_hour + total_elective_disperse_practice_hour);//总的实践学时 + ts.put("totalpracticeweek", total_compulsory_disperse_practice_week + total_elective_disperse_practice_week);//总的实践学周 ts.put("totalpracticescore", total_compulsory_practice_score + total_elective_practice_score);//总的实践学分 + ts.put("totalpracticedispersehour", total_compulsory_disperse_practice_hour + total_elective_disperse_practice_hour);//总的实践学时 + ts.put("totalpracticedisperseweek", total_compulsory_disperse_practice_week + total_elective_disperse_practice_week);//总的实践学周 return ts; } + private String double2String(double num){ + if(new Double(num).intValue() - num == 0){//判断是否符合取整条件 + return String.valueOf(new Double(num).intValue()); + }else{ + return String.valueOf(new Double(num)); + } + } } diff --git a/src/cn/edu/hrbcu/curriculum/mapper/CurriculumMapper.xml b/src/cn/edu/hrbcu/curriculum/mapper/CurriculumMapper.xml index d677f7068e3901753cd41b92b6244612c9cea83f..489dff6b8c7f19276d0d323adc737ff58e79d50d 100644 --- a/src/cn/edu/hrbcu/curriculum/mapper/CurriculumMapper.xml +++ b/src/cn/edu/hrbcu/curriculum/mapper/CurriculumMapper.xml @@ -11,6 +11,7 @@ + @@ -71,7 +72,7 @@ - id, specialityid, courseid, semester, start, end, hpw, sort, available + id, specialityid, courseid, semester, start, end, hpw, sort, available, disperse @@ -208,6 +217,9 @@ available = #{record.available,jdbcType=BIT}, + + disperse = #{record.disperse,jdbcType=BIT}, + @@ -223,7 +235,8 @@ end = #{record.end,jdbcType=INTEGER}, hpw = #{record.hpw,jdbcType=DOUBLE}, sort = #{record.sort,jdbcType=INTEGER}, - available = #{record.available,jdbcType=BIT} + available = #{record.available,jdbcType=BIT}, + disperse = #{record.disperse,jdbcType=BIT} @@ -255,6 +268,9 @@ available = #{available,jdbcType=BIT}, + + disperse = #{disperse,jdbcType=BIT}, + where id = #{id,jdbcType=BIGINT} @@ -267,7 +283,8 @@ end = #{end,jdbcType=INTEGER}, hpw = #{hpw,jdbcType=DOUBLE}, sort = #{sort,jdbcType=INTEGER}, - available = #{available,jdbcType=BIT} + available = #{available,jdbcType=BIT}, + disperse = #{disperse,jdbcType=BIT} where id = #{id,jdbcType=BIGINT} \ No newline at end of file diff --git a/src/cn/edu/hrbcu/curriculum/pojo/Curriculum.java b/src/cn/edu/hrbcu/curriculum/pojo/Curriculum.java index 02d76b4f733c63532294fee019244da2da062650..b9401a236a3f3f82a4c2043d1e690c56d56ced48 100644 --- a/src/cn/edu/hrbcu/curriculum/pojo/Curriculum.java +++ b/src/cn/edu/hrbcu/curriculum/pojo/Curriculum.java @@ -21,6 +21,8 @@ public class Curriculum implements Serializable { private Boolean available; + private Boolean disperse; + private static final long serialVersionUID = 1L; public Long getId() { @@ -94,4 +96,12 @@ public class Curriculum implements Serializable { public void setAvailable(Boolean available) { this.available = available; } + + public Boolean getDisperse() { + return disperse; + } + + public void setDisperse(Boolean disperse) { + this.disperse = disperse; + } } \ No newline at end of file diff --git a/src/cn/edu/hrbcu/curriculum/pojo/CurriculumExample.java b/src/cn/edu/hrbcu/curriculum/pojo/CurriculumExample.java index 2cab381085fbd9e50ca0c82eff7ed420615a20d9..6905b01831a00d31f433fca401232f1e8cdabfb5 100644 --- a/src/cn/edu/hrbcu/curriculum/pojo/CurriculumExample.java +++ b/src/cn/edu/hrbcu/curriculum/pojo/CurriculumExample.java @@ -643,6 +643,66 @@ public class CurriculumExample { addCriterion("available not between", value1, value2, "available"); return (Criteria) this; } + + public Criteria andDisperseIsNull() { + addCriterion("disperse is null"); + return (Criteria) this; + } + + public Criteria andDisperseIsNotNull() { + addCriterion("disperse is not null"); + return (Criteria) this; + } + + public Criteria andDisperseEqualTo(Boolean value) { + addCriterion("disperse =", value, "disperse"); + return (Criteria) this; + } + + public Criteria andDisperseNotEqualTo(Boolean value) { + addCriterion("disperse <>", value, "disperse"); + return (Criteria) this; + } + + public Criteria andDisperseGreaterThan(Boolean value) { + addCriterion("disperse >", value, "disperse"); + return (Criteria) this; + } + + public Criteria andDisperseGreaterThanOrEqualTo(Boolean value) { + addCriterion("disperse >=", value, "disperse"); + return (Criteria) this; + } + + public Criteria andDisperseLessThan(Boolean value) { + addCriterion("disperse <", value, "disperse"); + return (Criteria) this; + } + + public Criteria andDisperseLessThanOrEqualTo(Boolean value) { + addCriterion("disperse <=", value, "disperse"); + return (Criteria) this; + } + + public Criteria andDisperseIn(List values) { + addCriterion("disperse in", values, "disperse"); + return (Criteria) this; + } + + public Criteria andDisperseNotIn(List values) { + addCriterion("disperse not in", values, "disperse"); + return (Criteria) this; + } + + public Criteria andDisperseBetween(Boolean value1, Boolean value2) { + addCriterion("disperse between", value1, value2, "disperse"); + return (Criteria) this; + } + + public Criteria andDisperseNotBetween(Boolean value1, Boolean value2) { + addCriterion("disperse not between", value1, value2, "disperse"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/src/cn/edu/hrbcu/curriculum/service/CurriculumServiceImpl.java b/src/cn/edu/hrbcu/curriculum/service/CurriculumServiceImpl.java index 76516c17f6c852bb4239da6f7f3ffb19915afc63..97f0230966877705cc973b67cc34458ed1571e2d 100644 --- a/src/cn/edu/hrbcu/curriculum/service/CurriculumServiceImpl.java +++ b/src/cn/edu/hrbcu/curriculum/service/CurriculumServiceImpl.java @@ -108,6 +108,7 @@ public class CurriculumServiceImpl implements CurriculumService{ curriculum_update.setEnd(curriculum_all_new.getEnd()); curriculum_update.setHpw(curriculum_all_new.getHpw()); curriculum_update.setAvailable(curriculum_all_new.getAvailable()); + curriculum_update.setDisperse(curriculum_all_new.getDisperse()); foundSame = true; break; }