From 3d13d96f9d30ba36df3e1a7c1cfada5ebf6b7a30 Mon Sep 17 00:00:00 2001
From: maskxman <523204707@qq.com>
Date: Sun, 2 May 2021 09:24:58 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E6=B5=8B=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../edu/hit/education/dao/ScheduleMapper.java | 2 +
.../dialog/SeparateCourseDialog.java | 53 ++++++++++++----
.../hit/education/mapper/ScheduleMapper.xml | 3 +
.../education/service/IScheduleService.java | 30 +++++-----
.../service/ScheduleServiceImpl.java | 60 +++++++++++--------
.../hit/education/view/CourseExploreView.java | 48 +++++++++++++--
6 files changed, 138 insertions(+), 58 deletions(-)
diff --git a/src/cn/edu/hit/education/dao/ScheduleMapper.java b/src/cn/edu/hit/education/dao/ScheduleMapper.java
index 03284e1..e8ccd78 100644
--- a/src/cn/edu/hit/education/dao/ScheduleMapper.java
+++ b/src/cn/edu/hit/education/dao/ScheduleMapper.java
@@ -93,4 +93,6 @@ public interface ScheduleMapper {
* @mbggenerated Tue Apr 27 10:55:58 CST 2021
*/
int updateByPrimaryKey(Schedule record);
+
+ Schedule queryCourseByCourseId(int courseId);
}
\ No newline at end of file
diff --git a/src/cn/edu/hit/education/dialog/SeparateCourseDialog.java b/src/cn/edu/hit/education/dialog/SeparateCourseDialog.java
index ae626fe..d9a8e5b 100644
--- a/src/cn/edu/hit/education/dialog/SeparateCourseDialog.java
+++ b/src/cn/edu/hit/education/dialog/SeparateCourseDialog.java
@@ -3,6 +3,7 @@ package cn.edu.hit.education.dialog;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -21,6 +22,9 @@ import org.eclipse.swt.widgets.Text;
public class SeparateCourseDialog extends TitleAreaDialog {
private Text text;
private Text text_1;
+ private Text text_2;
+ private Text text_3;
+
public SeparateCourseDialog(Shell parentShell) {
super(parentShell);
@@ -29,33 +33,58 @@ public class SeparateCourseDialog extends TitleAreaDialog {
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite)super.createDialogArea(parent);
- composite.setLayout(new GridLayout(2, false));
+ createContentPane(composite);
+ return composite;
+
+ }
+ private void createContentPane(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NULL);
+ composite.setLayout(new GridLayout(3, false));
+ //gd_composite.widthHint = 174;
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
new Label(composite, SWT.NONE);
- Label label = new Label(composite, SWT.NONE);
- label.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
- label.setText("本学期安排课时");
+ Label lblNewLabel = new Label(composite, SWT.NONE);
+ lblNewLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+ lblNewLabel.setText("本学期课程学分:");
text = new Text(composite, SWT.BORDER);
text.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
+ new Label(composite, SWT.NONE);
- Label lblNewLabel = new Label(composite, SWT.NONE);
- lblNewLabel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
- lblNewLabel.setText("本学期安排学分");
+ Label lblNewLabel_1 = new Label(composite, SWT.NONE);
+ lblNewLabel_1.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+ lblNewLabel_1.setText("本学期课程学时:");
text_1 = new Text(composite, SWT.BORDER);
text_1.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
+ new Label(composite, SWT.NONE);
- this.setTitle("请输入该课程本学期分散的课时与学分");
- this.setMessage("课时与学分",IMessageProvider.INFORMATION);
+ Label lblNewLabel_2 = new Label(composite, SWT.NONE);
+ lblNewLabel_2.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+ lblNewLabel_2.setText("本学期课程理论学时:");
- return composite;
+ text_2 = new Text(composite, SWT.BORDER);
+ text_2.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
+ new Label(composite, SWT.NONE);
+
+ Label lblNewLabel_3 = new Label(composite, SWT.NONE);
+ lblNewLabel_3.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+ lblNewLabel_3.setText("本学期课程实验学时:");
+
+ text_3 = new Text(composite, SWT.BORDER);
+ text_3.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
+ this.setTitle("请输入本学期该课程授课:");
+ this.setMessage("学分,学时,理论学时,实验学时",IMessageProvider.INFORMATION);
}
+
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
newShell.setText("分散课程设置");
}
-
-
+ protected Point getInitialSize() {
+ // TODO 自动生成的方法存根
+ return new Point(300,300);
+ }
}
diff --git a/src/cn/edu/hit/education/mapper/ScheduleMapper.xml b/src/cn/edu/hit/education/mapper/ScheduleMapper.xml
index ac70667..8c498d2 100644
--- a/src/cn/edu/hit/education/mapper/ScheduleMapper.xml
+++ b/src/cn/edu/hit/education/mapper/ScheduleMapper.xml
@@ -345,6 +345,9 @@
where id = #{id,jdbcType=INTEGER}
+