courses = courseService.queryAllCourse();
- monitor.beginTask("ʼִпγԶ......", courses.size());
- String strCourseCode = "";
- if (courses != null && courses.size() > 0) {
- for (Course course : courses) {
- strCourseCode = "";
- if (monitor.isCanceled()) // ʱǷѡ˶Իġȡť
- return;// жϴ
-
- Property property = propertyService.queryPropertyById(course.getPropertyId());
- strCourseCode += property.getCode();
- strCourseCode += df.format(9);
- strCourseCode += String.valueOf(1);
- strCourseCode += df.format(property.getNum() + 1);
- course.setNumber(strCourseCode);
-
- property.setNum(property.getNum() + 1);
- propertyService.update(property);
-
- courseService.update(course);
- monitor.worked(1);
- }
- }
- monitor.done();// ǰ
- }
- };
- try {
- // һԻrunnable
- // һƼΪtrueΪfalseUI߳潫һͣС
- // ڶtrueԻġȡťЧ
- new ProgressMonitorDialog(parentShell)
- .run(true, true, runnable);
- } catch (Exception e2) {
- e2.printStackTrace();
- }
- } catch (Exception e) {
-
- }
-
- }
-}
+/**
+ * title �� StatisticsUtil.java
+ * package �� cn.edu.hit.education.utils
+ * description ��TODO
+ * copyright �� ��������ҵ��ѧ(C) 2019
+ * company �� ��������ҵ��ѧAS&MT
+ * author �� ��ѩ�� jinxuesong@163.com
+ * date �� 2021��4��22�� ����11:28:52
+ * version �� v1.0
+ *
+ * Modification History:
+ * Date Author Version Discription
+ * -----------------------------------------------------------------------------------
+ * 2021��4��22�� ��ѩ�� 1.0 1.0
+ * Why & What is modified: <��ԭ������>
+ */
+package cn.edu.hit.education.utils;
+
+import java.text.DecimalFormat;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+
+import cn.edu.hit.education.pojo.Course;
+import cn.edu.hit.education.pojo.Property;
+import cn.edu.hit.education.service.ICourseService;
+import cn.edu.hit.education.service.IPropertyService;
+import educationschedule.Application;
+
+public class CourseUtil {
+ public static void codeCourse() {
+ DecimalFormat df = new DecimalFormat("00");
+ ICourseService courseService = (ICourseService) Application.applicationContext
+ .getBean("courseServiceImpl");
+ IPropertyService propertyService = (IPropertyService) Application.applicationContext
+ .getBean("propertyServiceImpl");
+
+ propertyService.clearPropertyNum();
+
+ List courses = courseService.queryAllCourse();
+ Shell parentShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+
+ try {
+
+ IRunnableWithProgress runnable = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) {
+ //List courses = courseService.queryAllCourse();
+ monitor.beginTask("开始编码课程......", courses.size());
+ String strCourseCode = "";
+ if (courses != null && courses.size() > 0) {
+ for (Course course : courses) {
+ strCourseCode = "";
+ if (monitor.isCanceled())
+ return;
+
+ Property property = propertyService.queryPropertyById(course.getPropertyId());
+ strCourseCode += property.getCode();
+ strCourseCode += df.format(9);
+ strCourseCode += String.valueOf(1);
+ strCourseCode += df.format(property.getNum() + 1);
+ course.setNumber(strCourseCode);
+
+ property.setNum(property.getNum() + 1);
+ propertyService.update(property);
+
+ courseService.update(course);
+ monitor.worked(1);
+ }
+ }
+ monitor.done();
+ }
+ };
+ try {
+ new ProgressMonitorDialog(parentShell)
+ .run(true, true, runnable);
+ } catch (Exception e2) {
+ e2.printStackTrace();
+ }
+ } catch (Exception e) {
+
+ }
+
+ }
+}
diff --git a/src/cn/edu/hit/education/utils/StatisticsUtil.java b/src/cn/edu/hit/education/utils/StatisticsUtil.java
index fa69f9f94c93502b68257576b4e462a31856874d..07ec2b9835fd88c7c9d2e977795dcfe666550483 100644
--- a/src/cn/edu/hit/education/utils/StatisticsUtil.java
+++ b/src/cn/edu/hit/education/utils/StatisticsUtil.java
@@ -1,256 +1,250 @@
-/**
-* title StatisticsUtil.java
-* package cn.edu.hit.education.utils
-* description TODO
-* copyright ҵѧ(C) 2019
-* company ҵѧAS&MT
-* author ѩ jinxuesong@163.com
-* date 2021422 11:28:52
-* version v1.0
-*
-* Modification History:
-* Date Author Version Discription
-* -----------------------------------------------------------------------------------
-* 2021422 ѩ 1.0 1.0
-* Why & What is modified: <ԭ>
-*/
-package cn.edu.hit.education.utils;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import cn.edu.hit.education.pojo.Course;
-import cn.edu.hit.education.pojo.ExCourse;
-
-/**
- * classname StatisticsUtil
- * description TODO
- * author ѩ jinxuesong@163.com
- * date 2021422 11:28:52
- */
-public class StatisticsUtil {
- public static void processCourseScheduleData(List courses){
- double sum_credicts = 0;
- double sum_credicts_centralize_hour = 0;
- double sum_periods_centralize_hour = 0;
- double sum_theoretical_centralize_hour = 0;
- double sum_experiment_centralize_hour = 0;
-
- double sum_credicts_centralize_week = 0;
- double sum_periods_centralize_week = 0;
- double sum_theoretical_centralize_week = 0;
- double sum_experiment_centralize_week = 0;
-
- double sum_credicts_sparse_hour = 0;
- double sum_periods_sparse_hour = 0;
- double sum_theoretical_sparse_hour = 0;
- double sum_experiment_sparse_hour = 0;
-
- double sum_credicts_sparse_week = 0;
- double sum_periods_sparse_week = 0;
- double sum_theoretical_sparse_week = 0;
- double sum_experiment_sparse_week = 0;
-
- if(courses != null && courses.size() > 0){
- for (Course course : courses) {
- sum_credicts += (course.getCredits() == null ? 0 : course.getCredits());
-
- if(course.getUnit() == null || course.getUnit().trim().equals("ʱ")){
- if(course.getMethod().trim().equals("ɢ")){
- sum_credicts_sparse_hour += course.getCredits();
- sum_periods_sparse_hour += (course.getPeriod() == null ? 0 : course.getPeriod());
- sum_theoretical_sparse_hour += (course.getTheoretical() == null ? 0 : course.getTheoretical());
- sum_experiment_sparse_hour += (course.getExperiment() == null ? 0 : course.getExperiment());
- }else{
- sum_credicts_centralize_hour += course.getCredits();
- sum_periods_centralize_hour += (course.getPeriod() == null ? 0 : course.getPeriod());
- sum_theoretical_centralize_hour += (course.getTheoretical() == null ? 0 : course.getTheoretical());
- sum_experiment_centralize_hour += (course.getExperiment() == null ? 0 : course.getExperiment());
- }
- }else if(course.getUnit().trim().equals("")){
- if(course.getMethod().trim().equals("ɢ")){
- sum_credicts_sparse_week += course.getCredits();
- sum_periods_sparse_week += (course.getPeriod() == null ? 0 : course.getPeriod());
- sum_theoretical_sparse_week += (course.getTheoretical() == null ? 0 : course.getTheoretical());
- sum_experiment_sparse_week += (course.getExperiment() == null ? 0 : course.getExperiment());
- }else{
- sum_credicts_centralize_week += course.getCredits();
- sum_periods_centralize_week += (course.getPeriod() == null ? 0 : course.getPeriod());
- sum_theoretical_centralize_week += (course.getTheoretical() == null ? 0 : course.getTheoretical());
- sum_experiment_centralize_week += (course.getExperiment() == null ? 0 : course.getExperiment());
- }
-
- }else{
-
- }
- }
-
- Course sum = new Course();
- sum.setName("С [ڿΣʱ]");
- sum.setCredits(sum_credicts_centralize_hour);
- sum.setPeriod(sum_periods_centralize_hour);
- sum.setTheoretical(sum_theoretical_centralize_hour);
- sum.setExperiment(sum_experiment_centralize_hour);
- sum.setUnit("ʱ");
- sum.setMethod("");
- courses.add(sum);
-
- sum = new Course();
- sum.setName("С [ڿΣ]");
- sum.setCredits(sum_credicts_centralize_week);
- sum.setPeriod(sum_periods_centralize_week);
- sum.setTheoretical(sum_theoretical_centralize_week);
- sum.setExperiment(sum_experiment_centralize_week);
- sum.setUnit("");
- sum.setMethod("");
- courses.add(sum);
-
- sum = new Course();
- sum.setName("С [ɢڿΣʱ]");
- sum.setCredits(sum_credicts_sparse_hour);
- sum.setPeriod(sum_periods_sparse_hour);
- sum.setTheoretical(sum_theoretical_sparse_hour);
- sum.setExperiment(sum_experiment_sparse_hour);
- sum.setUnit("ʱ");
- sum.setMethod("ɢ");
- courses.add(sum);
-
- sum = new Course();
- sum.setName("С [ɢڿΣ]");
- sum.setCredits(sum_credicts_sparse_week);
- sum.setPeriod(sum_periods_sparse_week);
- sum.setTheoretical(sum_theoretical_sparse_week);
- sum.setExperiment(sum_experiment_sparse_week);
- sum.setUnit("");
- sum.setMethod("ɢ");
- courses.add(sum);
-
- sum = new Course();
- sum.setName("С ");
- sum.setCredits(sum_credicts);
- courses.add(sum);
- }
- }
-
- public static void processCourseInformationData(List courses){
- double sum_credicts = 0;
- double sum_credicts_centralize_hour = 0;
- double sum_periods_centralize_hour = 0;
- double sum_theoretical_centralize_hour = 0;
- double sum_experiment_centralize_hour = 0;
-
- double sum_credicts_centralize_week = 0;
- double sum_periods_centralize_week = 0;
- double sum_theoretical_centralize_week = 0;
- double sum_experiment_centralize_week = 0;
-
- double sum_credicts_sparse_hour = 0;
- double sum_periods_sparse_hour = 0;
- double sum_theoretical_sparse_hour = 0;
- double sum_experiment_sparse_hour = 0;
-
- double sum_credicts_sparse_week = 0;
- double sum_periods_sparse_week = 0;
- double sum_theoretical_sparse_week = 0;
- double sum_experiment_sparse_week = 0;
-
- if(courses != null && courses.size() > 0){
- for (ExCourse course : courses) {
- if(course.getOpened() == 0)
- continue;
-
- sum_credicts += (course.getCredits() == null ? 0 : course.getCredits());
-
- if(course.getUnit() == null || course.getUnit().trim().equals("ʱ")){
- if(course.getMethod().trim().equals("ɢ")){
- sum_credicts_sparse_hour += course.getCredits();
- sum_periods_sparse_hour += (course.getPeriod() == null ? 0 : course.getPeriod());
- sum_theoretical_sparse_hour += (course.getTheoretical() == null ? 0 : course.getTheoretical());
- sum_experiment_sparse_hour += (course.getExperiment() == null ? 0 : course.getExperiment());
- }else{
- sum_credicts_centralize_hour += course.getCredits();
- sum_periods_centralize_hour += (course.getPeriod() == null ? 0 : course.getPeriod());
- sum_theoretical_centralize_hour += (course.getTheoretical() == null ? 0 : course.getTheoretical());
- sum_experiment_centralize_hour += (course.getExperiment() == null ? 0 : course.getExperiment());
- }
- }else if(course.getUnit().trim().equals("")){
- if(course.getMethod().trim().equals("ɢ")){
- sum_credicts_sparse_week += course.getCredits();
- sum_periods_sparse_week += (course.getPeriod() == null ? 0 : course.getPeriod());
- sum_theoretical_sparse_week += (course.getTheoretical() == null ? 0 : course.getTheoretical());
- sum_experiment_sparse_week += (course.getExperiment() == null ? 0 : course.getExperiment());
- }else{
- sum_credicts_centralize_week += course.getCredits();
- sum_periods_centralize_week += (course.getPeriod() == null ? 0 : course.getPeriod());
- sum_theoretical_centralize_week += (course.getTheoretical() == null ? 0 : course.getTheoretical());
- sum_experiment_centralize_week += (course.getExperiment() == null ? 0 : course.getExperiment());
- }
-
- }else{
-
- }
- }
-
- ExCourse sum = new ExCourse();
- sum.setName("С [ڿΣʱ]");
- sum.setCredits(sum_credicts_centralize_hour);
- sum.setPeriod(sum_periods_centralize_hour);
- sum.setTheoretical(sum_theoretical_centralize_hour);
- sum.setExperiment(sum_experiment_centralize_hour);
- sum.setUnit("ʱ");
- sum.setMethod("");
- courses.add(sum);
-
- sum = new ExCourse();
- sum.setName("С [ڿΣ]");
- sum.setCredits(sum_credicts_centralize_week);
- sum.setPeriod(sum_periods_centralize_week);
- sum.setTheoretical(sum_theoretical_centralize_week);
- sum.setExperiment(sum_experiment_centralize_week);
- sum.setUnit("");
- sum.setMethod("");
- courses.add(sum);
-
- sum = new ExCourse();
- sum.setName("С [ɢڿΣʱ]");
- sum.setCredits(sum_credicts_sparse_hour);
- sum.setPeriod(sum_periods_sparse_hour);
- sum.setTheoretical(sum_theoretical_sparse_hour);
- sum.setExperiment(sum_experiment_sparse_hour);
- sum.setUnit("ʱ");
- sum.setMethod("ɢ");
- courses.add(sum);
-
- sum = new ExCourse();
- sum.setName("С [ɢڿΣ]");
- sum.setCredits(sum_credicts_sparse_week);
- sum.setPeriod(sum_periods_sparse_week);
- sum.setTheoretical(sum_theoretical_sparse_week);
- sum.setExperiment(sum_experiment_sparse_week);
- sum.setUnit("");
- sum.setMethod("ɢ");
- courses.add(sum);
-
- sum = new ExCourse();
- sum.setName("С ");
- sum.setCredits(sum_credicts);
- courses.add(sum);
- }
- }
-
- public static void printTotal(List courses){
- if(courses.size() > 5){
- List subs = new ArrayList();
-
- subs.add(courses.get(courses.size() - 5));
- subs.add(courses.get(courses.size() - 4));
- subs.add(courses.get(courses.size() - 3));
- subs.add(courses.get(courses.size() - 2));
- subs.add(courses.get(courses.size() - 1));
-
- for (Course course : subs) {
- System.out.println(course.getCredits() + "/" + course.getPeriod());
- }
- }
- }
-}
+/**
+* title �� StatisticsUtil.java
+* package �� cn.edu.hit.education.utils
+* description ��TODO
+* copyright �� ��������ҵ��ѧ(C) 2019
+* company �� ��������ҵ��ѧAS&MT
+* author �� ��ѩ�� jinxuesong@163.com
+* date �� 2021��4��22�� ����11:28:52
+* version �� v1.0
+*
+* Modification History:
+* Date Author Version Discription
+* -----------------------------------------------------------------------------------
+* 2021��4��22�� ��ѩ�� 1.0 1.0
+* Why & What is modified: <��ԭ������>
+*/
+package cn.edu.hit.education.utils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import cn.edu.hit.education.pojo.Course;
+import cn.edu.hit.education.pojo.ExCourse;
+
+public class StatisticsUtil {
+ public static void processCourseScheduleData(List courses){
+ double sum_credicts = 0;
+ double sum_credicts_centralize_hour = 0;
+ double sum_periods_centralize_hour = 0;
+ double sum_theoretical_centralize_hour = 0;
+ double sum_experiment_centralize_hour = 0;
+
+ double sum_credicts_centralize_week = 0;
+ double sum_periods_centralize_week = 0;
+ double sum_theoretical_centralize_week = 0;
+ double sum_experiment_centralize_week = 0;
+
+ double sum_credicts_sparse_hour = 0;
+ double sum_periods_sparse_hour = 0;
+ double sum_theoretical_sparse_hour = 0;
+ double sum_experiment_sparse_hour = 0;
+
+ double sum_credicts_sparse_week = 0;
+ double sum_periods_sparse_week = 0;
+ double sum_theoretical_sparse_week = 0;
+ double sum_experiment_sparse_week = 0;
+
+ if(courses != null && courses.size() > 0){
+ for (Course course : courses) {
+ sum_credicts += (course.getCredits() == null ? 0 : course.getCredits());
+
+ if(course.getUnit() == null || course.getUnit().trim().equals("时")){
+ if(course.getMethod().trim().equals("分散")){
+ sum_credicts_sparse_hour += course.getCredits();
+ sum_periods_sparse_hour += (course.getPeriod() == null ? 0 : course.getPeriod());
+ sum_theoretical_sparse_hour += (course.getTheoretical() == null ? 0 : course.getTheoretical());
+ sum_experiment_sparse_hour += (course.getExperiment() == null ? 0 : course.getExperiment());
+ }else{
+ sum_credicts_centralize_hour += course.getCredits();
+ sum_periods_centralize_hour += (course.getPeriod() == null ? 0 : course.getPeriod());
+ sum_theoretical_centralize_hour += (course.getTheoretical() == null ? 0 : course.getTheoretical());
+ sum_experiment_centralize_hour += (course.getExperiment() == null ? 0 : course.getExperiment());
+ }
+ }else if(course.getUnit().trim().equals("周")){
+ if(course.getMethod().trim().equals("分散")){
+ sum_credicts_sparse_week += course.getCredits();
+ sum_periods_sparse_week += (course.getPeriod() == null ? 0 : course.getPeriod());
+ sum_theoretical_sparse_week += (course.getTheoretical() == null ? 0 : course.getTheoretical());
+ sum_experiment_sparse_week += (course.getExperiment() == null ? 0 : course.getExperiment());
+ }else{
+ sum_credicts_centralize_week += course.getCredits();
+ sum_periods_centralize_week += (course.getPeriod() == null ? 0 : course.getPeriod());
+ sum_theoretical_centralize_week += (course.getTheoretical() == null ? 0 : course.getTheoretical());
+ sum_experiment_centralize_week += (course.getExperiment() == null ? 0 : course.getExperiment());
+ }
+
+ }else{
+
+ }
+ }
+
+ Course sum = new Course();
+ sum.setName("小 计[集中,时]");
+ sum.setCredits(sum_credicts_centralize_hour);
+ sum.setPeriod(sum_periods_centralize_hour);
+ sum.setTheoretical(sum_theoretical_centralize_hour);
+ sum.setExperiment(sum_experiment_centralize_hour);
+ sum.setUnit("时");
+ sum.setMethod("集中");
+ courses.add(sum);
+
+ sum = new Course();
+ sum.setName("小 计[集中,周]");
+ sum.setCredits(sum_credicts_centralize_week);
+ sum.setPeriod(sum_periods_centralize_week);
+ sum.setTheoretical(sum_theoretical_centralize_week);
+ sum.setExperiment(sum_experiment_centralize_week);
+ sum.setUnit("周");
+ sum.setMethod("集中");
+ courses.add(sum);
+
+ sum = new Course();
+ sum.setName("小 计[分散,时]");
+ sum.setCredits(sum_credicts_sparse_hour);
+ sum.setPeriod(sum_periods_sparse_hour);
+ sum.setTheoretical(sum_theoretical_sparse_hour);
+ sum.setExperiment(sum_experiment_sparse_hour);
+ sum.setUnit("时");
+ sum.setMethod("分散");
+ courses.add(sum);
+
+ sum = new Course();
+ sum.setName("小 计[分散,时]");
+ sum.setCredits(sum_credicts_sparse_week);
+ sum.setPeriod(sum_periods_sparse_week);
+ sum.setTheoretical(sum_theoretical_sparse_week);
+ sum.setExperiment(sum_experiment_sparse_week);
+ sum.setUnit("周");
+ sum.setMethod("分散");
+ courses.add(sum);
+
+ sum = new Course();
+ sum.setName("小 计");
+ sum.setCredits(sum_credicts);
+ courses.add(sum);
+ }
+ }
+
+ public static void processCourseInformationData(List courses){
+ double sum_credicts = 0;
+ double sum_credicts_centralize_hour = 0;
+ double sum_periods_centralize_hour = 0;
+ double sum_theoretical_centralize_hour = 0;
+ double sum_experiment_centralize_hour = 0;
+
+ double sum_credicts_centralize_week = 0;
+ double sum_periods_centralize_week = 0;
+ double sum_theoretical_centralize_week = 0;
+ double sum_experiment_centralize_week = 0;
+
+ double sum_credicts_sparse_hour = 0;
+ double sum_periods_sparse_hour = 0;
+ double sum_theoretical_sparse_hour = 0;
+ double sum_experiment_sparse_hour = 0;
+
+ double sum_credicts_sparse_week = 0;
+ double sum_periods_sparse_week = 0;
+ double sum_theoretical_sparse_week = 0;
+ double sum_experiment_sparse_week = 0;
+
+ if(courses != null && courses.size() > 0){
+ for (ExCourse course : courses) {
+ if(course.getOpened() == 0)
+ continue;
+
+ sum_credicts += (course.getCredits() == null ? 0 : course.getCredits());
+
+ if(course.getUnit() == null || course.getUnit().trim().equals("时")){
+ if(course.getMethod().trim().equals("分散")){
+ sum_credicts_sparse_hour += course.getCredits();
+ sum_periods_sparse_hour += (course.getPeriod() == null ? 0 : course.getPeriod());
+ sum_theoretical_sparse_hour += (course.getTheoretical() == null ? 0 : course.getTheoretical());
+ sum_experiment_sparse_hour += (course.getExperiment() == null ? 0 : course.getExperiment());
+ }else{
+ sum_credicts_centralize_hour += course.getCredits();
+ sum_periods_centralize_hour += (course.getPeriod() == null ? 0 : course.getPeriod());
+ sum_theoretical_centralize_hour += (course.getTheoretical() == null ? 0 : course.getTheoretical());
+ sum_experiment_centralize_hour += (course.getExperiment() == null ? 0 : course.getExperiment());
+ }
+ }else if(course.getUnit().trim().equals("周")){
+ if(course.getMethod().trim().equals("分散")){
+ sum_credicts_sparse_week += course.getCredits();
+ sum_periods_sparse_week += (course.getPeriod() == null ? 0 : course.getPeriod());
+ sum_theoretical_sparse_week += (course.getTheoretical() == null ? 0 : course.getTheoretical());
+ sum_experiment_sparse_week += (course.getExperiment() == null ? 0 : course.getExperiment());
+ }else{
+ sum_credicts_centralize_week += course.getCredits();
+ sum_periods_centralize_week += (course.getPeriod() == null ? 0 : course.getPeriod());
+ sum_theoretical_centralize_week += (course.getTheoretical() == null ? 0 : course.getTheoretical());
+ sum_experiment_centralize_week += (course.getExperiment() == null ? 0 : course.getExperiment());
+ }
+
+ }else{
+
+ }
+ }
+
+ ExCourse sum = new ExCourse();
+ sum.setName("小 计[集中,时]");
+ sum.setCredits(sum_credicts_centralize_hour);
+ sum.setPeriod(sum_periods_centralize_hour);
+ sum.setTheoretical(sum_theoretical_centralize_hour);
+ sum.setExperiment(sum_experiment_centralize_hour);
+ sum.setUnit("时");
+ sum.setMethod("集中");
+ courses.add(sum);
+
+ sum = new ExCourse();
+ sum.setName("小 计[集中,周]");
+ sum.setCredits(sum_credicts_centralize_week);
+ sum.setPeriod(sum_periods_centralize_week);
+ sum.setTheoretical(sum_theoretical_centralize_week);
+ sum.setExperiment(sum_experiment_centralize_week);
+ sum.setUnit("周");
+ sum.setMethod("集中");
+ courses.add(sum);
+
+ sum = new ExCourse();
+ sum.setName("小 计[分散,时]");
+ sum.setCredits(sum_credicts_sparse_hour);
+ sum.setPeriod(sum_periods_sparse_hour);
+ sum.setTheoretical(sum_theoretical_sparse_hour);
+ sum.setExperiment(sum_experiment_sparse_hour);
+ sum.setUnit("时");
+ sum.setMethod("分散");
+ courses.add(sum);
+
+ sum = new ExCourse();
+ sum.setName("小 计[分散,时]");
+ sum.setCredits(sum_credicts_sparse_week);
+ sum.setPeriod(sum_periods_sparse_week);
+ sum.setTheoretical(sum_theoretical_sparse_week);
+ sum.setExperiment(sum_experiment_sparse_week);
+ sum.setUnit("周");
+ sum.setMethod("分散");
+ courses.add(sum);
+
+ sum = new ExCourse();
+ sum.setName("小 计");
+ sum.setCredits(sum_credicts);
+ courses.add(sum);
+ }
+ }
+
+ public static void printTotal(List courses){
+ if(courses.size() > 5){
+ List subs = new ArrayList();
+
+ subs.add(courses.get(courses.size() - 5));
+ subs.add(courses.get(courses.size() - 4));
+ subs.add(courses.get(courses.size() - 3));
+ subs.add(courses.get(courses.size() - 2));
+ subs.add(courses.get(courses.size() - 1));
+
+ for (Course course : subs) {
+ System.out.println(course.getCredits() + "/" + course.getPeriod());
+ }
+ }
+ }
+}
diff --git a/src/cn/edu/hit/education/view/CourseInformationView.java b/src/cn/edu/hit/education/view/CourseInformationView.java
index bdaa562420fdd661157ee8e28ee4997110dde041..ce25b16aaf96313c92d236badca4cde6310fcd4a 100644
--- a/src/cn/edu/hit/education/view/CourseInformationView.java
+++ b/src/cn/edu/hit/education/view/CourseInformationView.java
@@ -34,6 +34,8 @@ import org.springframework.stereotype.Component;
import cn.edu.hit.education.action.AddNewCourseAction;
import cn.edu.hit.education.action.CodeCourseAction;
+import cn.edu.hit.education.action.ExportAction;
+import cn.edu.hit.education.action.ImportAction;
import cn.edu.hit.education.contentprovider.CourseInformationContentProvider;
import cn.edu.hit.education.labelprovider.CourseInformationLabelProvider;
import cn.edu.hit.education.pojo.Course;
@@ -80,6 +82,8 @@ public class CourseInformationView extends ViewPart {
private IAction addCourseAction = null;
private IAction codeCourseAction = null;
+ private IAction importAction = null;
+ private IAction exportAction = null;
public CourseInformationView() {
}
@@ -172,7 +176,7 @@ public class CourseInformationView extends ViewPart {
MenuItem modifyItem = new MenuItem(contextMenu, SWT.None);
modifyItem.setEnabled(false);
- modifyItem.setText("Ƴ");
+ modifyItem.setText("去除");
TableViewerColumn tableViewerColumn_6 = new TableViewerColumn(tableViewer, SWT.NONE);
TableColumn tblclmnNewColumn_1 = tableViewerColumn_6.getColumn();
@@ -182,13 +186,10 @@ public class CourseInformationView extends ViewPart {
TableColumn tblclmnNewColumn_2 = new TableColumn(table, SWT.NONE);
tblclmnNewColumn_2.setWidth(100);
tblclmnNewColumn_2.setText("\u662F\u5426\u5F00\u8BFE");
- // modifyItem.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID,
- // "icons/view/modify_16px.png").createImage());
modifyItem.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
- // TODO Զɵķ
TableItem[] selections = table.getSelection();
Shell parentShell = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell();
@@ -205,13 +206,11 @@ public class CourseInformationView extends ViewPart {
}
}
- //refreshData();
}
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
- // TODO Զɵķ
}
});
@@ -244,19 +243,22 @@ public class CourseInformationView extends ViewPart {
@Override
public void setFocus() {
- // TODO Զɵķ
}
private void makeActions(){
addCourseAction = new AddNewCourseAction(tableViewer);
codeCourseAction = new CodeCourseAction();
+ importAction = new ImportAction();
+ exportAction = new ExportAction();
}
private void initializeToolBar() {
IToolBarManager toolbarManager = getViewSite().getActionBars().getToolBarManager();
toolbarManager.add(addCourseAction);
toolbarManager.add(codeCourseAction);
+ toolbarManager.add(importAction);
+ toolbarManager.add(exportAction);
}
private List queryCourseByProperty(Specialty specialty,Property property) {
@@ -275,7 +277,7 @@ public class CourseInformationView extends ViewPart {
//refreshData();
} else {
MessageDialog.openConfirm(PlatformUI.getWorkbench().getDisplay()
- .getActiveShell(), "ʾ", "̱Ѱſγ̣");
+ .getActiveShell(), "��ʾ", "���̱����Ѱ������ſγ̣�");
}
}
diff --git a/src/cn/edu/hit/education/view/CourseScheduleView.java b/src/cn/edu/hit/education/view/CourseScheduleView.java
index f95b0e5014a5d4527d0a4e1488037f45ce9349cb..54a1fec2626fbd0cf0537e4ed7f97a5a10983949 100644
--- a/src/cn/edu/hit/education/view/CourseScheduleView.java
+++ b/src/cn/edu/hit/education/view/CourseScheduleView.java
@@ -133,14 +133,11 @@ public class CourseScheduleView extends ViewPart {
MenuItem modifyItem = new MenuItem(contextMenu, SWT.None);
modifyItem.setEnabled(false);
- modifyItem.setText("Ƴ");
- // modifyItem.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID,
- // "icons/view/modify_16px.png").createImage());
+ modifyItem.setText("去除");
modifyItem.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
- // TODO Զɵķ
TableItem[] selections = table.getSelection();
Shell parentShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
if (selections.length > 0) {
@@ -163,8 +160,6 @@ public class CourseScheduleView extends ViewPart {
@Override
public void widgetDefaultSelected(SelectionEvent e) {
- // TODO Զɵķ
-
}
});
@@ -191,7 +186,6 @@ public class CourseScheduleView extends ViewPart {
@Override
public void setFocus() {
- // TODO Զɵķ
}
@@ -221,7 +215,7 @@ public class CourseScheduleView extends ViewPart {
refreshData();
} else {
MessageDialog.openConfirm(PlatformUI.getWorkbench().getDisplay()
- .getActiveShell(), "ʾ", "̱Ѱſγ̣");
+ .getActiveShell(), "提示", "培养方案表格中已安排该课程!");
}
}
diff --git a/src/educationschedule/ApplicationActionBarAdvisor.java b/src/educationschedule/ApplicationActionBarAdvisor.java
index b8ec9657809b65aa6d0f52ac3efdd0351d1dbcf2..b745ae013bcc2d382c5d07c49df54098f9954bde 100644
--- a/src/educationschedule/ApplicationActionBarAdvisor.java
+++ b/src/educationschedule/ApplicationActionBarAdvisor.java
@@ -31,7 +31,6 @@ public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
@Override
protected void makeActions(IWorkbenchWindow window) {
- // TODO Զɵķ
statisticalAction = new StatisticalScheduleAction();
//addCourseAction = new AddNewCourseAction();
super.makeActions(window);
@@ -39,7 +38,6 @@ public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
@Override
protected void fillCoolBar(ICoolBarManager coolBar) {
- // TODO Զɵķ
super.fillCoolBar(coolBar);
IToolBarManager toolbar = new ToolBarManager(coolBar.getStyle());
coolBar.add(toolbar);
diff --git a/src/educationschedule/ApplicationWorkbenchWindowAdvisor.java b/src/educationschedule/ApplicationWorkbenchWindowAdvisor.java
index e341646a21665bb71f1cac57412a254f5e4e9fa4..a973923edbcc5131b9ef64e86b3ea02879717050 100644
--- a/src/educationschedule/ApplicationWorkbenchWindowAdvisor.java
+++ b/src/educationschedule/ApplicationWorkbenchWindowAdvisor.java
@@ -22,6 +22,6 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
configurer.setInitialSize(new Point(800, 600));
configurer.setShowCoolBar(true);
configurer.setShowStatusLine(true);
- configurer.setTitle("");
+ configurer.setTitle("培养方案管理");
}
}