Commit 36ff5663f90187d47bbd90afd71382e7290c40fb
0 parents
Exists in
master
first
Showing
287 changed files
with
7039 additions
and
0 deletions
Show diff stats
Too many changes.
To preserve performance only 100 of 287 files displayed.
1 | +++ a/.idea/compiler.xml | |
... | ... | @@ -0,0 +1,13 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<project version="4"> | |
3 | + <component name="CompilerConfiguration"> | |
4 | + <annotationProcessing> | |
5 | + <profile name="Maven default annotation processors profile" enabled="true"> | |
6 | + <sourceOutputDir name="target/generated-sources/annotations" /> | |
7 | + <sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> | |
8 | + <outputRelativeToContentRoot value="true" /> | |
9 | + <module name="smartCampus" /> | |
10 | + </profile> | |
11 | + </annotationProcessing> | |
12 | + </component> | |
13 | +</project> | |
0 | 14 | \ No newline at end of file | ... | ... |
1 | +++ a/.idea/misc.xml | |
... | ... | @@ -0,0 +1,14 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<project version="4"> | |
3 | + <component name="ExternalStorageConfigurationManager" enabled="true" /> | |
4 | + <component name="MavenProjectsManager"> | |
5 | + <option name="originalFiles"> | |
6 | + <list> | |
7 | + <option value="$PROJECT_DIR$/pom.xml" /> | |
8 | + </list> | |
9 | + </option> | |
10 | + </component> | |
11 | + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK"> | |
12 | + <output url="file://$PROJECT_DIR$/out" /> | |
13 | + </component> | |
14 | +</project> | |
0 | 15 | \ No newline at end of file | ... | ... |
1 | +++ a/.idea/uiDesigner.xml | |
... | ... | @@ -0,0 +1,124 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<project version="4"> | |
3 | + <component name="Palette2"> | |
4 | + <group name="Swing"> | |
5 | + <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> | |
6 | + <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" /> | |
7 | + </item> | |
8 | + <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> | |
9 | + <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" /> | |
10 | + </item> | |
11 | + <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false"> | |
12 | + <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" /> | |
13 | + </item> | |
14 | + <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true"> | |
15 | + <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" /> | |
16 | + </item> | |
17 | + <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false"> | |
18 | + <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" /> | |
19 | + <initial-values> | |
20 | + <property name="text" value="Button" /> | |
21 | + </initial-values> | |
22 | + </item> | |
23 | + <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false"> | |
24 | + <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> | |
25 | + <initial-values> | |
26 | + <property name="text" value="RadioButton" /> | |
27 | + </initial-values> | |
28 | + </item> | |
29 | + <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false"> | |
30 | + <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> | |
31 | + <initial-values> | |
32 | + <property name="text" value="CheckBox" /> | |
33 | + </initial-values> | |
34 | + </item> | |
35 | + <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false"> | |
36 | + <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" /> | |
37 | + <initial-values> | |
38 | + <property name="text" value="Label" /> | |
39 | + </initial-values> | |
40 | + </item> | |
41 | + <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true"> | |
42 | + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> | |
43 | + <preferred-size width="150" height="-1" /> | |
44 | + </default-constraints> | |
45 | + </item> | |
46 | + <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true"> | |
47 | + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> | |
48 | + <preferred-size width="150" height="-1" /> | |
49 | + </default-constraints> | |
50 | + </item> | |
51 | + <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true"> | |
52 | + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> | |
53 | + <preferred-size width="150" height="-1" /> | |
54 | + </default-constraints> | |
55 | + </item> | |
56 | + <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true"> | |
57 | + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> | |
58 | + <preferred-size width="150" height="50" /> | |
59 | + </default-constraints> | |
60 | + </item> | |
61 | + <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> | |
62 | + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> | |
63 | + <preferred-size width="150" height="50" /> | |
64 | + </default-constraints> | |
65 | + </item> | |
66 | + <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> | |
67 | + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> | |
68 | + <preferred-size width="150" height="50" /> | |
69 | + </default-constraints> | |
70 | + </item> | |
71 | + <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true"> | |
72 | + <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" /> | |
73 | + </item> | |
74 | + <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false"> | |
75 | + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> | |
76 | + <preferred-size width="150" height="50" /> | |
77 | + </default-constraints> | |
78 | + </item> | |
79 | + <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false"> | |
80 | + <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3"> | |
81 | + <preferred-size width="150" height="50" /> | |
82 | + </default-constraints> | |
83 | + </item> | |
84 | + <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false"> | |
85 | + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> | |
86 | + <preferred-size width="150" height="50" /> | |
87 | + </default-constraints> | |
88 | + </item> | |
89 | + <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false"> | |
90 | + <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> | |
91 | + <preferred-size width="200" height="200" /> | |
92 | + </default-constraints> | |
93 | + </item> | |
94 | + <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false"> | |
95 | + <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> | |
96 | + <preferred-size width="200" height="200" /> | |
97 | + </default-constraints> | |
98 | + </item> | |
99 | + <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true"> | |
100 | + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> | |
101 | + </item> | |
102 | + <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false"> | |
103 | + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> | |
104 | + </item> | |
105 | + <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false"> | |
106 | + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" /> | |
107 | + </item> | |
108 | + <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> | |
109 | + <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" /> | |
110 | + </item> | |
111 | + <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false"> | |
112 | + <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1"> | |
113 | + <preferred-size width="-1" height="20" /> | |
114 | + </default-constraints> | |
115 | + </item> | |
116 | + <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false"> | |
117 | + <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" /> | |
118 | + </item> | |
119 | + <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> | |
120 | + <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" /> | |
121 | + </item> | |
122 | + </group> | |
123 | + </component> | |
124 | +</project> | |
0 | 125 | \ No newline at end of file | ... | ... |
1 | +++ a/.idea/workspace.xml | |
... | ... | @@ -0,0 +1,191 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<project version="4"> | |
3 | + <component name="ChangeListManager"> | |
4 | + <list default="true" id="932b6e74-97c1-4a67-ad8f-5fcaac9b11d7" name="Default Changelist" comment="" /> | |
5 | + <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> | |
6 | + <option name="SHOW_DIALOG" value="false" /> | |
7 | + <option name="HIGHLIGHT_CONFLICTS" value="true" /> | |
8 | + <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> | |
9 | + <option name="LAST_RESOLUTION" value="IGNORE" /> | |
10 | + </component> | |
11 | + <component name="DatabaseView"> | |
12 | + <option name="SHOW_INTERMEDIATE" value="true" /> | |
13 | + <option name="GROUP_DATA_SOURCES" value="true" /> | |
14 | + <option name="GROUP_SCHEMA" value="true" /> | |
15 | + <option name="GROUP_CONTENTS" value="false" /> | |
16 | + <option name="SORT_POSITIONED" value="false" /> | |
17 | + <option name="SHOW_EMPTY_GROUPS" value="false" /> | |
18 | + <option name="AUTO_SCROLL_FROM_SOURCE" value="false" /> | |
19 | + <option name="HIDDEN_KINDS"> | |
20 | + <set /> | |
21 | + </option> | |
22 | + <expand /> | |
23 | + <select /> | |
24 | + </component> | |
25 | + <component name="FavoritesManager"> | |
26 | + <favorites_list name="scheduleCourse" /> | |
27 | + </component> | |
28 | + <component name="FileTemplateManagerImpl"> | |
29 | + <option name="RECENT_TEMPLATES"> | |
30 | + <list> | |
31 | + <option value="Interface" /> | |
32 | + <option value="Class" /> | |
33 | + </list> | |
34 | + </option> | |
35 | + </component> | |
36 | + <component name="MavenImportPreferences"> | |
37 | + <option name="generalSettings"> | |
38 | + <MavenGeneralSettings> | |
39 | + <option name="mavenHome" value="$APPLICATION_HOME_DIR$/plugins/maven/lib/maven3" /> | |
40 | + </MavenGeneralSettings> | |
41 | + </option> | |
42 | + </component> | |
43 | + <component name="ProjectId" id="1RGHPVsHrCNMP59J9xzgPmXfAp8" /> | |
44 | + <component name="PropertiesComponent"> | |
45 | + <property name="RequestMappingsPanelOrder0" value="0" /> | |
46 | + <property name="RequestMappingsPanelOrder1" value="1" /> | |
47 | + <property name="RequestMappingsPanelOrder2" value="2" /> | |
48 | + <property name="RequestMappingsPanelWidth0" value="75" /> | |
49 | + <property name="RequestMappingsPanelWidth1" value="75" /> | |
50 | + <property name="RequestMappingsPanelWidth2" value="75" /> | |
51 | + <property name="WebServerToolWindowFactoryState" value="false" /> | |
52 | + <property name="aspect.path.notification.shown" value="true" /> | |
53 | + <property name="last_opened_file_path" value="$PROJECT_DIR$/../wgServer" /> | |
54 | + <property name="nodejs_package_manager_path" value="npm" /> | |
55 | + <property name="project.structure.last.edited" value="Facets" /> | |
56 | + <property name="project.structure.proportion" value="0.0" /> | |
57 | + <property name="project.structure.side.proportion" value="0.52528733" /> | |
58 | + <property name="settings.editor.selected.configurable" value="MavenSettings" /> | |
59 | + </component> | |
60 | + <component name="RecentsManager"> | |
61 | + <key name="CopyClassDialog.RECENTS_KEY"> | |
62 | + <recent name="com.jevon.controller" /> | |
63 | + <recent name="com.jevon" /> | |
64 | + </key> | |
65 | + <key name="CopyFile.RECENT_KEYS"> | |
66 | + <recent name="D:\scheduleCourse\src\main\resources\mapping" /> | |
67 | + <recent name="D:\scheduleCourse\src\main\resources" /> | |
68 | + </key> | |
69 | + </component> | |
70 | + <component name="RunDashboard"> | |
71 | + <option name="ruleStates"> | |
72 | + <list> | |
73 | + <RuleState> | |
74 | + <option name="name" value="ConfigurationTypeDashboardGroupingRule" /> | |
75 | + </RuleState> | |
76 | + <RuleState> | |
77 | + <option name="name" value="StatusDashboardGroupingRule" /> | |
78 | + </RuleState> | |
79 | + </list> | |
80 | + </option> | |
81 | + </component> | |
82 | + <component name="RunManager"> | |
83 | + <configuration default="true" type="JetRunConfigurationType" factoryName="Kotlin"> | |
84 | + <module name="smartCampus" /> | |
85 | + <option name="VM_PARAMETERS" /> | |
86 | + <option name="PROGRAM_PARAMETERS" /> | |
87 | + <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" /> | |
88 | + <option name="ALTERNATIVE_JRE_PATH" /> | |
89 | + <option name="PASS_PARENT_ENVS" value="true" /> | |
90 | + <option name="MAIN_CLASS_NAME" /> | |
91 | + <option name="WORKING_DIRECTORY" /> | |
92 | + <method v="2"> | |
93 | + <option name="Make" enabled="true" /> | |
94 | + </method> | |
95 | + </configuration> | |
96 | + <configuration default="true" type="KotlinStandaloneScriptRunConfigurationType" factoryName="Kotlin script"> | |
97 | + <module name="smartCampus" /> | |
98 | + <option name="filePath" /> | |
99 | + <option name="vmParameters" /> | |
100 | + <option name="alternativeJrePath" /> | |
101 | + <option name="programParameters" /> | |
102 | + <option name="passParentEnvs" value="true" /> | |
103 | + <option name="workingDirectory" /> | |
104 | + <option name="isAlternativeJrePathEnabled" value="false" /> | |
105 | + <option name="VM_PARAMETERS" /> | |
106 | + <option name="PROGRAM_PARAMETERS" /> | |
107 | + <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" /> | |
108 | + <option name="ALTERNATIVE_JRE_PATH" /> | |
109 | + <option name="PASS_PARENT_ENVS" value="true" /> | |
110 | + <option name="MAIN_CLASS_NAME" /> | |
111 | + <option name="WORKING_DIRECTORY" /> | |
112 | + <option name="filePath" /> | |
113 | + <option name="vmParameters" /> | |
114 | + <option name="alternativeJrePath" /> | |
115 | + <option name="programParameters" /> | |
116 | + <option name="passParentEnvs" value="true" /> | |
117 | + <option name="workingDirectory" /> | |
118 | + <option name="isAlternativeJrePathEnabled" value="false" /> | |
119 | + <option name="VM_PARAMETERS" /> | |
120 | + <option name="PROGRAM_PARAMETERS" /> | |
121 | + <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" /> | |
122 | + <option name="ALTERNATIVE_JRE_PATH" /> | |
123 | + <option name="PASS_PARENT_ENVS" value="true" /> | |
124 | + <option name="MAIN_CLASS_NAME" /> | |
125 | + <option name="WORKING_DIRECTORY" /> | |
126 | + <method v="2"> | |
127 | + <option name="Make" enabled="true" /> | |
128 | + </method> | |
129 | + </configuration> | |
130 | + <configuration name="Application" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" temporary="true" nameIsGenerated="true"> | |
131 | + <module name="smartCampus" /> | |
132 | + <extension name="coverage"> | |
133 | + <pattern> | |
134 | + <option name="PATTERN" value="com.jevon.*" /> | |
135 | + <option name="ENABLED" value="true" /> | |
136 | + </pattern> | |
137 | + </extension> | |
138 | + <option name="SPRING_BOOT_MAIN_CLASS" value="com.jevon.Application" /> | |
139 | + <method v="2"> | |
140 | + <option name="Make" enabled="true" /> | |
141 | + </method> | |
142 | + </configuration> | |
143 | + <recent_temporary> | |
144 | + <list> | |
145 | + <item itemvalue="Spring Boot.Application" /> | |
146 | + </list> | |
147 | + </recent_temporary> | |
148 | + </component> | |
149 | + <component name="SvnConfiguration"> | |
150 | + <configuration /> | |
151 | + </component> | |
152 | + <component name="TaskManager"> | |
153 | + <task active="true" id="Default" summary="Default task"> | |
154 | + <changelist id="932b6e74-97c1-4a67-ad8f-5fcaac9b11d7" name="Default Changelist" comment="" /> | |
155 | + <created>1569286488778</created> | |
156 | + <option name="number" value="Default" /> | |
157 | + <option name="presentableId" value="Default" /> | |
158 | + <updated>1569286488778</updated> | |
159 | + <workItem from="1569286491470" duration="20539000" /> | |
160 | + <workItem from="1569368392031" duration="245000" /> | |
161 | + <workItem from="1569370434701" duration="20115000" /> | |
162 | + <workItem from="1569455454900" duration="60878000" /> | |
163 | + <workItem from="1569740943970" duration="6366000" /> | |
164 | + <workItem from="1569754287237" duration="4133000" /> | |
165 | + <workItem from="1569801753852" duration="2859000" /> | |
166 | + <workItem from="1569811131112" duration="15346000" /> | |
167 | + <workItem from="1569912696797" duration="77075000" /> | |
168 | + <workItem from="1570428952517" duration="3907000" /> | |
169 | + <workItem from="1570493214454" duration="21743000" /> | |
170 | + <workItem from="1570584502127" duration="16160000" /> | |
171 | + <workItem from="1570666287871" duration="102203000" /> | |
172 | + <workItem from="1571184602970" duration="24262000" /> | |
173 | + <workItem from="1571278758298" duration="712000" /> | |
174 | + </task> | |
175 | + <servers /> | |
176 | + </component> | |
177 | + <component name="TypeScriptGeneratedFilesManager"> | |
178 | + <option name="version" value="1" /> | |
179 | + </component> | |
180 | + <component name="XDebuggerManager"> | |
181 | + <breakpoint-manager> | |
182 | + <breakpoints> | |
183 | + <line-breakpoint enabled="true" type="java-line"> | |
184 | + <url>file://$PROJECT_DIR$/src/main/java/com/jevon/controller/ScheduleController.java</url> | |
185 | + <line>720</line> | |
186 | + <option name="timeStamp" value="89" /> | |
187 | + </line-breakpoint> | |
188 | + </breakpoints> | |
189 | + </breakpoint-manager> | |
190 | + </component> | |
191 | +</project> | |
0 | 192 | \ No newline at end of file | ... | ... |
1 | +++ a/pom.xml | |
... | ... | @@ -0,0 +1,219 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<project xmlns="http://maven.apache.org/POM/4.0.0" | |
3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
4 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
5 | + <modelVersion>4.0.0</modelVersion> | |
6 | + | |
7 | + <groupId>com.jevon</groupId> | |
8 | + <artifactId>smartCampus</artifactId> | |
9 | + <version>1.0-SNAPSHOT</version> | |
10 | + <properties> | |
11 | + <!-- 主要依赖库的版本定义 --> | |
12 | + <!-- spring boot --> | |
13 | + <spring.boot.version>1.5.6.RELEASE</spring.boot.version> | |
14 | + </properties> | |
15 | + | |
16 | + <dependencies> | |
17 | + <dependency> | |
18 | + <groupId>org.apache.httpcomponents</groupId> | |
19 | + <artifactId>httpclient</artifactId> | |
20 | + <version>4.3</version> | |
21 | + </dependency> | |
22 | + | |
23 | + <dependency> | |
24 | + <groupId>com.microsoft.sqlserver</groupId> | |
25 | + <artifactId>mssql-jdbc</artifactId> | |
26 | + <version>6.4.0.jre8</version> | |
27 | + </dependency> | |
28 | + <!-- spring boot --> | |
29 | + <dependency> | |
30 | + <groupId>org.springframework.boot</groupId> | |
31 | + <artifactId>spring-boot-starter</artifactId> | |
32 | + <version>${spring.boot.version}</version> | |
33 | + </dependency> | |
34 | + <dependency> | |
35 | + <groupId>org.springframework.boot</groupId> | |
36 | + <artifactId>spring-boot-starter-test</artifactId> | |
37 | + <version>${spring.boot.version}</version> | |
38 | + <scope>test</scope> | |
39 | + </dependency> | |
40 | + <dependency> | |
41 | + <groupId>org.springframework.boot</groupId> | |
42 | + <artifactId>spring-boot-starter-web</artifactId> | |
43 | + <version>${spring.boot.version}</version> | |
44 | + </dependency> | |
45 | + <!-- spring boot --> | |
46 | + <dependency> | |
47 | + <groupId>org.springframework.boot</groupId> | |
48 | + <artifactId>spring-boot-starter-freemarker</artifactId> | |
49 | + <version>1.4.4.RELEASE</version> | |
50 | + </dependency> | |
51 | + <dependency> | |
52 | + <groupId>com.googlecode.rapid-framework</groupId> | |
53 | + <artifactId>rapid-core</artifactId> | |
54 | + <version>4.0.5</version> | |
55 | + </dependency> | |
56 | + | |
57 | + <dependency> | |
58 | + <groupId>org.springframework</groupId> | |
59 | + <artifactId>spring-aop</artifactId> | |
60 | + <version>4.3.10.RELEASE</version> | |
61 | + </dependency> | |
62 | + | |
63 | + <dependency> | |
64 | + <groupId>com.alibaba</groupId> | |
65 | + <artifactId>fastjson</artifactId> | |
66 | + <version>1.2.16</version> | |
67 | + </dependency> | |
68 | + | |
69 | + <dependency> | |
70 | + <groupId>org.apache.commons</groupId> | |
71 | + <artifactId>commons-lang3</artifactId> | |
72 | + <version>3.3.2</version> | |
73 | + </dependency> | |
74 | + | |
75 | + <!--只有slf4j-api依赖--> | |
76 | + <dependency> | |
77 | + <groupId>org.slf4j</groupId> | |
78 | + <artifactId>slf4j-api</artifactId> | |
79 | + <version>1.7.13</version> | |
80 | + </dependency> | |
81 | + | |
82 | + <!-- https://mvnrepository.com/artifact/commons-net/commons-net --> | |
83 | + <dependency> | |
84 | + <groupId>commons-net</groupId> | |
85 | + <artifactId>commons-net</artifactId> | |
86 | + <version>2.0</version> | |
87 | + </dependency> | |
88 | + <dependency> | |
89 | + <groupId>org.apache.poi</groupId> | |
90 | + <artifactId>poi</artifactId> | |
91 | + <version>4.1.0</version> | |
92 | + </dependency> | |
93 | + | |
94 | + <dependency> | |
95 | + <groupId>org.apache.poi</groupId> | |
96 | + <artifactId>poi-ooxml</artifactId> | |
97 | + <version>4.1.0</version> | |
98 | + </dependency> | |
99 | + | |
100 | + <!--数据库--> | |
101 | + <dependency> | |
102 | + <groupId>org.mybatis.spring.boot</groupId> | |
103 | + <artifactId>mybatis-spring-boot-starter</artifactId> | |
104 | + <version>1.3.0</version> | |
105 | + </dependency> | |
106 | + <!--swagger --> | |
107 | + <dependency> | |
108 | + <groupId>io.springfox</groupId> | |
109 | + <artifactId>springfox-swagger2</artifactId> | |
110 | + <version>2.6.1</version> | |
111 | + </dependency> | |
112 | + <dependency> | |
113 | + <groupId>io.springfox</groupId> | |
114 | + <artifactId>springfox-swagger-ui</artifactId> | |
115 | + <version>2.6.1</version> | |
116 | + </dependency> | |
117 | + <dependency> | |
118 | + <groupId>com.fasterxml.jackson.core</groupId> | |
119 | + <artifactId>jackson-core</artifactId> | |
120 | + <version>2.6.5</version> | |
121 | + </dependency> | |
122 | + <dependency> | |
123 | + <groupId>com.fasterxml.jackson.core</groupId> | |
124 | + <artifactId>jackson-databind</artifactId> | |
125 | + <version>2.6.5</version> | |
126 | + </dependency> | |
127 | + <dependency> | |
128 | + <groupId>com.fasterxml.jackson.core</groupId> | |
129 | + <artifactId>jackson-annotations</artifactId> | |
130 | + <version>2.6.5</version> | |
131 | + </dependency> | |
132 | + </dependencies> | |
133 | + | |
134 | + | |
135 | + <build> | |
136 | + <!--打包文件名--> | |
137 | + <finalName>smartCampus</finalName> | |
138 | + <!--打包方式--> | |
139 | + <plugins> | |
140 | + <!-- 设置编译版本 --> | |
141 | + <plugin> | |
142 | + <groupId>org.apache.maven.plugins</groupId> | |
143 | + <artifactId>maven-compiler-plugin</artifactId> | |
144 | + <version>3.1</version> | |
145 | + <configuration> | |
146 | + <source>1.8</source> | |
147 | + <target>1.8</target> | |
148 | + <encoding>UTF-8</encoding> | |
149 | + </configuration> | |
150 | + </plugin> | |
151 | + <!-- 打包jar文件时,配置manifest文件,加入lib包的jar依赖 --> | |
152 | + <!-- 本地启动需要注释--> | |
153 | + <plugin> | |
154 | + <groupId>org.apache.maven.plugins</groupId> | |
155 | + <artifactId>maven-jar-plugin</artifactId> | |
156 | + <configuration> | |
157 | + <archive> | |
158 | + <manifest> | |
159 | + <mainClass>com.jevon.Application</mainClass> | |
160 | + <addClasspath>true</addClasspath> | |
161 | + <classpathPrefix>lib/</classpathPrefix> | |
162 | + </manifest> | |
163 | + <manifestEntries> | |
164 | + <Class-Path>./config/</Class-Path> | |
165 | + </manifestEntries> | |
166 | + </archive> | |
167 | + <excludes> | |
168 | + <exclude>config/**</exclude> | |
169 | + </excludes> | |
170 | + <classesDirectory></classesDirectory> | |
171 | + </configuration> | |
172 | + </plugin> | |
173 | + <!-- 拷贝依赖的jar包到lib目录 --> | |
174 | + <plugin> | |
175 | + <groupId>org.apache.maven.plugins</groupId> | |
176 | + <artifactId>maven-dependency-plugin</artifactId> | |
177 | + <executions> | |
178 | + <execution> | |
179 | + <id>copy</id> | |
180 | + <phase>package</phase> | |
181 | + <goals> | |
182 | + <goal>copy-dependencies</goal> | |
183 | + </goals> | |
184 | + <configuration> | |
185 | + <outputDirectory> | |
186 | + ${project.build.directory}/lib | |
187 | + </outputDirectory> | |
188 | + </configuration> | |
189 | + </execution> | |
190 | + </executions> | |
191 | + </plugin> | |
192 | + <!-- 解决资源文件的编码问题 --> | |
193 | + <plugin> | |
194 | + <groupId>org.apache.maven.plugins</groupId> | |
195 | + <artifactId>maven-resources-plugin</artifactId> | |
196 | + <version>2.5</version> | |
197 | + <configuration> | |
198 | + <encoding>UTF-8</encoding> | |
199 | + </configuration> | |
200 | + </plugin> | |
201 | + <!-- 打包source文件为jar文件 --> | |
202 | + <plugin> | |
203 | + <artifactId>maven-source-plugin</artifactId> | |
204 | + <version>2.2</version> | |
205 | + <configuration> | |
206 | + <attach>true</attach> | |
207 | + </configuration> | |
208 | + <executions> | |
209 | + <execution> | |
210 | + <phase>compile</phase> | |
211 | + <goals> | |
212 | + <goal>jar</goal> | |
213 | + </goals> | |
214 | + </execution> | |
215 | + </executions> | |
216 | + </plugin> | |
217 | + </plugins> | |
218 | + </build> | |
219 | +</project> | |
0 | 220 | \ No newline at end of file | ... | ... |
1 | +++ a/src/main/java/com/jevon/Application.java | |
... | ... | @@ -0,0 +1,16 @@ |
1 | +package com.jevon; | |
2 | + | |
3 | +import org.mybatis.spring.annotation.MapperScan; | |
4 | +import org.springframework.boot.SpringApplication; | |
5 | +import org.springframework.boot.autoconfigure.SpringBootApplication; | |
6 | +import org.springframework.cache.annotation.EnableCaching; | |
7 | + | |
8 | +@EnableCaching | |
9 | +@SpringBootApplication | |
10 | +@MapperScan("com.jevon.mapper") | |
11 | +public class Application { | |
12 | + | |
13 | + public static void main(String[] args) { | |
14 | + SpringApplication.run(Application.class, args); | |
15 | + } | |
16 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/Swagger2.java | |
... | ... | @@ -0,0 +1,38 @@ |
1 | +package com.jevon; | |
2 | + | |
3 | +import io.swagger.annotations.ApiOperation; | |
4 | +import org.springframework.context.annotation.Bean; | |
5 | +import org.springframework.context.annotation.Configuration; | |
6 | +import springfox.documentation.builders.ApiInfoBuilder; | |
7 | +import springfox.documentation.builders.PathSelectors; | |
8 | +import springfox.documentation.builders.RequestHandlerSelectors; | |
9 | +import springfox.documentation.service.ApiInfo; | |
10 | +import springfox.documentation.spi.DocumentationType; | |
11 | +import springfox.documentation.spring.web.plugins.Docket; | |
12 | +import springfox.documentation.swagger2.annotations.EnableSwagger2; | |
13 | + | |
14 | +@EnableSwagger2 | |
15 | +@Configuration //让Spring来加载该类配置 | |
16 | +public class Swagger2 { | |
17 | + | |
18 | + @Bean | |
19 | + public Docket createRestApi() { | |
20 | + return new Docket(DocumentationType.SWAGGER_2) | |
21 | + .apiInfo(apiInfo()) | |
22 | + .enableUrlTemplating(true) | |
23 | + .select() | |
24 | + // 扫描所有有注解的api,用这种方式更灵活 | |
25 | + .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) | |
26 | + .paths(PathSelectors.any()) | |
27 | + .build(); | |
28 | + | |
29 | + } | |
30 | + private ApiInfo apiInfo() { | |
31 | + return new ApiInfoBuilder() | |
32 | + .title("Spring Boot中使用Swagger2构建RESTful APIs") | |
33 | + .description("接口文档") | |
34 | + .termsOfServiceUrl("") | |
35 | + .version("1.0") | |
36 | + .build(); | |
37 | + } | |
38 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/controller/InitController.java | |
... | ... | @@ -0,0 +1,421 @@ |
1 | +package com.jevon.controller; | |
2 | + | |
3 | +import com.alibaba.fastjson.JSONObject; | |
4 | +import com.jevon.model.*; | |
5 | +import com.jevon.service.*; | |
6 | +import com.jevon.utils.HttpClientUtils; | |
7 | +import com.jevon.vo.BaseVo; | |
8 | +import com.jevon.vo.rep.InitRepVo; | |
9 | +import com.jevon.vo.rep.ScheduleRepVo; | |
10 | +import com.jevon.vo.req.CreateScheduleReqVo; | |
11 | +import com.jevon.vo.req.InitTeacherCourseReqVo; | |
12 | +import com.jevon.vo.req.ScheduleIdReqVo; | |
13 | +import com.jevon.vo.req.UpdateScheduleReqVo; | |
14 | +import io.swagger.annotations.Api; | |
15 | +import io.swagger.annotations.ApiOperation; | |
16 | +import org.apache.commons.lang3.StringUtils; | |
17 | +import org.apache.poi.hssf.usermodel.HSSFWorkbook; | |
18 | +import org.apache.poi.ss.usermodel.*; | |
19 | +import org.apache.poi.xssf.usermodel.XSSFWorkbook; | |
20 | +import org.springframework.beans.factory.annotation.Autowired; | |
21 | +import org.springframework.transaction.annotation.Transactional; | |
22 | +import org.springframework.web.bind.annotation.RequestBody; | |
23 | +import org.springframework.web.bind.annotation.RequestMapping; | |
24 | +import org.springframework.web.bind.annotation.RequestMethod; | |
25 | +import org.springframework.web.bind.annotation.RestController; | |
26 | + | |
27 | +import javax.servlet.http.HttpServletRequest; | |
28 | +import java.io.File; | |
29 | +import java.io.FileInputStream; | |
30 | +import java.util.*; | |
31 | + | |
32 | +@RestController | |
33 | +@RequestMapping(value = "/init") | |
34 | +@Api(value = "排课表") | |
35 | +public class InitController { | |
36 | + | |
37 | + @Autowired | |
38 | + ClassModelService classModelService; | |
39 | + | |
40 | + @Autowired | |
41 | + TeacherClassService teacherClassService; | |
42 | + | |
43 | + @Autowired | |
44 | + CourseService courseService ; | |
45 | + | |
46 | + @Autowired | |
47 | + TeacherService teacherService; | |
48 | + | |
49 | + @Autowired | |
50 | + ScheduleService scheduleService; | |
51 | + | |
52 | + @Autowired | |
53 | + TeacherCourseService teacherCourseService; | |
54 | + | |
55 | + @Autowired | |
56 | + JoinClassService joinClassService; | |
57 | + | |
58 | + @Autowired | |
59 | + ClassCourseService classCourseService; | |
60 | + | |
61 | + private static String url = "http://60.190.202.57:1000"; | |
62 | + | |
63 | + private static String staticUrl = "F://wwwroot//smartcampus"; | |
64 | + | |
65 | + @ApiOperation("创建排课计划 ") | |
66 | + @RequestMapping(value = "createSchedule", method = RequestMethod.POST) | |
67 | + public ScheduleRepVo createSchedule(@RequestBody CreateScheduleReqVo createScheduleReqVo){ | |
68 | + ScheduleRepVo baseVo = new ScheduleRepVo(); | |
69 | + Schedule schedule = new Schedule(); | |
70 | + schedule.setTeam(createScheduleReqVo.getTeam()); | |
71 | + schedule.setScheduleName(createScheduleReqVo.getScheduleName()); | |
72 | + schedule.setSchoolId(createScheduleReqVo.getSchoolId()); | |
73 | + Schedule temp = scheduleService.selectBySchoolAndTeam(schedule); | |
74 | + if(temp == null){ | |
75 | + scheduleService.insert(schedule); | |
76 | + }else { | |
77 | + baseVo.setSuccess(false); | |
78 | + baseVo.setMessage("该学校该学年学期已创建了排课计划"); | |
79 | + return baseVo; | |
80 | + } | |
81 | + temp = scheduleService.selectBySchoolAndTeam(schedule); | |
82 | + initMessage(schedule.getSchoolId()); | |
83 | + baseVo.setScheduleId(temp.getId()); | |
84 | + return baseVo; | |
85 | + } | |
86 | + | |
87 | + @ApiOperation("更新计划") | |
88 | + @RequestMapping(value = "updateSchedule", method = RequestMethod.POST) | |
89 | + public BaseVo updateSchedule(@RequestBody UpdateScheduleReqVo updateScheduleReqVo){ | |
90 | + BaseVo baseVo = new BaseVo(); | |
91 | + Schedule schedule = scheduleService.selectById(updateScheduleReqVo.getScheduleId()); | |
92 | + schedule.setScheduleName(updateScheduleReqVo.getScheduleName()); | |
93 | + schedule.setTeam(updateScheduleReqVo.getTeam()); | |
94 | + scheduleService.update(schedule); | |
95 | + return baseVo; | |
96 | + } | |
97 | + | |
98 | + @ApiOperation("复制") | |
99 | + @RequestMapping(value = "copySchedule", method = RequestMethod.POST) | |
100 | + public BaseVo copySchedule(@RequestBody UpdateScheduleReqVo updateScheduleReqVo){ | |
101 | + BaseVo baseVo = new BaseVo(); | |
102 | + Schedule schedule = scheduleService.selectById(updateScheduleReqVo.getScheduleId()); | |
103 | + if(schedule == null){ | |
104 | + baseVo.setMessage("原始课表不存在"); | |
105 | + baseVo.setSuccess(false); | |
106 | + return baseVo; | |
107 | + } | |
108 | + Schedule temp = new Schedule(); | |
109 | + temp.setSchoolId(schedule.getSchoolId()); | |
110 | + temp.setTeam(updateScheduleReqVo.getTeam()); | |
111 | + Schedule result = scheduleService.selectBySchoolAndTeam(temp); | |
112 | + if(result != null){ | |
113 | + baseVo.setMessage("该学年学期已创建课表计划"); | |
114 | + baseVo.setSuccess(false); | |
115 | + return baseVo; | |
116 | + } | |
117 | + temp.setScheduleName(updateScheduleReqVo.getScheduleName()); | |
118 | + scheduleService.insert(temp); | |
119 | + Date date = new Date(); | |
120 | + //复制 classCourse teacherClass teacherCourse | |
121 | + List<ClassCourse> classCourses = classCourseService.copyClassCourse(schedule.getSchoolId(),schedule.getTeam()); | |
122 | + for(ClassCourse classCourse :classCourses){ | |
123 | + classCourse.setSchoolId(temp.getSchoolId()); | |
124 | + classCourse.setTeam(temp.getTeam()); | |
125 | + classCourse.setCreateTime(date); | |
126 | + } | |
127 | + classCourseService.insertBatch(classCourses); | |
128 | + TeacherClass teacherClass = new TeacherClass(); | |
129 | + teacherClass.setSchoolId(schedule.getSchoolId()); | |
130 | + teacherClass.setTeam(schedule.getTeam()); | |
131 | + List<TeacherClass> teacherClasses = teacherClassService.selectBySchoolAndTeam(teacherClass); | |
132 | + for(TeacherClass teacherClass1 :teacherClasses){ | |
133 | + teacherClass1.setSchoolId(temp.getSchoolId()); | |
134 | + teacherClass1.setTeam(temp.getTeam()); | |
135 | + teacherClass1.setCreateTime(date); | |
136 | + } | |
137 | + teacherClassService.insertBatch(teacherClasses); | |
138 | + | |
139 | + List<TeacherCourse> teacherCourses = teacherCourseService.selectBySchoolIdAndTeam(schedule.getSchoolId(),schedule.getTeam()); | |
140 | + for(TeacherCourse teacherCourse : teacherCourses){ | |
141 | + teacherCourse.setSchoolId(temp.getSchoolId()); | |
142 | + teacherCourse.setTeam(temp.getTeam()); | |
143 | + teacherCourse.setCreateTime(date); | |
144 | + } | |
145 | + teacherCourseService.insertBatch(teacherCourses); | |
146 | + return baseVo; | |
147 | + } | |
148 | + | |
149 | + @ApiOperation("删除排课计划") | |
150 | + @RequestMapping(value = "deleteSchedule", method = RequestMethod.POST) | |
151 | + public BaseVo deleteSchedule(@RequestBody ScheduleIdReqVo scheduleIdReqVo){ | |
152 | + BaseVo baseVo = new BaseVo(); | |
153 | + Schedule schedule = scheduleService.selectById(scheduleIdReqVo.getScheduleId()); | |
154 | + if(schedule == null){ | |
155 | + baseVo.setSuccess(false); | |
156 | + baseVo.setMessage("无排课计划"); | |
157 | + return baseVo; | |
158 | + } | |
159 | + teacherCourseService.deleteBySchoolIdAndTeam(schedule.getSchoolId(),schedule.getTeam()); | |
160 | + joinClassService.deleteBySchoolIdAndTeam(schedule.getSchoolId(),schedule.getTeam()); | |
161 | + classCourseService.deleteBySchoolIdAndTeam(schedule.getSchoolId(),schedule.getTeam()); | |
162 | + TeacherClass teacherClass = new TeacherClass(); | |
163 | + teacherClass.setSchoolId(schedule.getSchoolId()); | |
164 | + teacherClass.setTeam(schedule.getTeam()); | |
165 | + teacherClassService.deleteBySchoolAndTeam(teacherClass); | |
166 | + courseService.initSchoolId(schedule.getSchoolId()); | |
167 | + scheduleService.deleteBySchedule(schedule.getId()); | |
168 | + return baseVo; | |
169 | + } | |
170 | + | |
171 | + @ApiOperation("获取基础信息") | |
172 | + @RequestMapping(value = "getInitMessage", method = RequestMethod.POST) | |
173 | + public InitRepVo getInitMessage(@RequestBody ScheduleIdReqVo scheduleIdReqVo){ | |
174 | + InitRepVo initRepVo = new InitRepVo(); | |
175 | + Schedule schedule = scheduleService.selectById(scheduleIdReqVo.getScheduleId()); | |
176 | + if(schedule == null){ | |
177 | + initRepVo.setSuccess(false); | |
178 | + initRepVo.setMessage("没有改排课计划"); | |
179 | + return initRepVo; | |
180 | + } | |
181 | + List<Course> courses = courseService.selectBySchoolId(schedule.getSchoolId()); | |
182 | + List<Teacher> teachers = teacherService.selectBySchoolId(schedule.getSchoolId()); | |
183 | + List<ClassModel> classModels = classModelService.selectBySchoolId(schedule.getSchoolId()); | |
184 | + initRepVo.setClassNumber(classModels.size()); | |
185 | + initRepVo.setCourseNumber(courses.size()); | |
186 | + initRepVo.setTeacherNumber(teachers.size()); | |
187 | + return initRepVo; | |
188 | + } | |
189 | + | |
190 | + @Transactional | |
191 | + @ApiOperation("教师授课信息") | |
192 | + @RequestMapping(value = "initTeacherCourse", method = RequestMethod.POST) | |
193 | + public BaseVo initTeacherCourse(@RequestBody InitTeacherCourseReqVo initTeacherCourseReqVo){ | |
194 | + BaseVo baseVo = new BaseVo(); | |
195 | + Date date = new Date(); | |
196 | + try{ | |
197 | + TeacherClass temp = new TeacherClass(); | |
198 | + Schedule schedule = scheduleService.selectById(initTeacherCourseReqVo.getScheduleId()); | |
199 | + if(schedule != null && schedule.getSpeed() == 2) { | |
200 | + temp.setSchoolId(schedule.getSchoolId()); | |
201 | + temp.setTeam(schedule.getTeam()); | |
202 | + List<TeacherClass> list = teacherClassService.selectBySchoolAndTeam(temp); | |
203 | + if (list != null && list.size() > 0) { | |
204 | + teacherClassService.deleteBySchoolAndTeam(temp); | |
205 | + } | |
206 | + String fileUrl = initTeacherCourseReqVo.getUrl(); | |
207 | + fileUrl = fileUrl.replace(url, staticUrl); | |
208 | + File excelFile = new File(fileUrl); | |
209 | + // 获得工作簿 | |
210 | + String file = excelFile.getName(); | |
211 | + Workbook workbook = null; | |
212 | + if (file.endsWith("xls")) { | |
213 | + workbook = new HSSFWorkbook(new FileInputStream(excelFile)); | |
214 | + } else { | |
215 | + workbook = new XSSFWorkbook(new FileInputStream(excelFile)); | |
216 | + } | |
217 | + // 获得工作表 | |
218 | + Sheet sheet = workbook.getSheetAt(0); | |
219 | + int rows = sheet.getPhysicalNumberOfRows(); | |
220 | + Map<Integer, Course> courseTeacherMap = new HashMap<>(); | |
221 | + int courseNumber = 0; | |
222 | + List<TeacherClass> teacherClasses = new ArrayList<>(); | |
223 | + for (int i = 0; i < rows; i++) { | |
224 | + // 获取第i行数据 | |
225 | + Row sheetRow = sheet.getRow(i); | |
226 | + if (i == 0) { | |
227 | + //获取表头 | |
228 | + int j = 1; | |
229 | + while (sheetRow.getCell(2 * j) != null && StringUtils.isNotBlank(sheetRow.getCell(2 * j).getStringCellValue().trim())) { | |
230 | + Course course = courseService.selectBySchoolIdAndCourseName(schedule.getSchoolId(), sheetRow.getCell(2 * j).getStringCellValue().trim()); | |
231 | + courseTeacherMap.put(j, course); | |
232 | + j++; | |
233 | + } | |
234 | + courseNumber = j - 1; | |
235 | + } else { | |
236 | + if (StringUtils.isBlank(sheetRow.getCell(0).getStringCellValue().trim())) { | |
237 | + continue; | |
238 | + } | |
239 | + String className = sheetRow.getCell(1).getStringCellValue().trim(); | |
240 | + ClassModel classModel = new ClassModel(); | |
241 | + classModel.setSchoolId(schedule.getSchoolId()); | |
242 | + classModel.setClassName(className); | |
243 | + classModel.setGrade(sheetRow.getCell(0).getStringCellValue().trim()); | |
244 | + ClassModel resultClass = classModelService.selectBySchoolIdAndClassNameAndGrade(classModel); | |
245 | + for (int j = 1; j <= courseNumber; j++) { | |
246 | + Cell cell = sheetRow.getCell(2 * j); | |
247 | + if (cell != null) { | |
248 | + cell.setCellType(CellType.STRING); | |
249 | + String times = sheetRow.getCell(2 * j).getStringCellValue().trim(); | |
250 | + if (StringUtils.isNotBlank((times))) { | |
251 | + Course course = courseTeacherMap.get(j); | |
252 | + String teacherName = sheetRow.getCell(2 * j + 1).getStringCellValue().trim(); | |
253 | + Teacher teacher = new Teacher(); | |
254 | + teacher.setTeacherName(teacherName); | |
255 | + teacher.setSchoolId(schedule.getSchoolId()); | |
256 | + Teacher resultTeacher = teacherService.selectByTeacher(teacher); | |
257 | + if (course != null && resultTeacher != null) { | |
258 | + TeacherClass teacherClass = new TeacherClass(); | |
259 | + teacherClass.setTeam(schedule.getTeam()); | |
260 | + teacherClass.setSchoolId(schedule.getSchoolId()); | |
261 | + teacherClass.setCourseName(course.getCourseName()); | |
262 | + teacherClass.setTeacherName(resultTeacher.getTeacherName()); | |
263 | + teacherClass.setTeacherId(resultTeacher.getTeacherId()); | |
264 | + teacherClass.setGrade(sheetRow.getCell(0).getStringCellValue().trim()); | |
265 | + teacherClass.setClassId(resultClass.getClassId()); | |
266 | + String[] msg = times.split("\\+"); | |
267 | + if (msg.length > 1) { | |
268 | + //有联课 | |
269 | + teacherClass.setJoinTimes(Integer.valueOf(msg[1])); | |
270 | + teacherClass.setTimes(Integer.valueOf(msg[1]) * 2 + Integer.valueOf(msg[0])); | |
271 | + } else { | |
272 | + teacherClass.setJoinTimes(0); | |
273 | + teacherClass.setTimes(Integer.valueOf(msg[0])); | |
274 | + } | |
275 | + teacherClass.setStatus(0); | |
276 | + teacherClass.setCreateTime(date); | |
277 | + teacherClasses.add(teacherClass); | |
278 | + } else { | |
279 | + baseVo.setMessage("课程或老师缺失"); | |
280 | + baseVo.setSuccess(false); | |
281 | + return baseVo; | |
282 | + } | |
283 | + } | |
284 | + | |
285 | + } | |
286 | + } | |
287 | + } | |
288 | + } | |
289 | + teacherClassService.insertBatch(teacherClasses); | |
290 | + schedule.setSpeed(3); | |
291 | + scheduleService.updateSpeed(schedule); | |
292 | + }else { | |
293 | + baseVo.setMessage("排课计划不存在或已导入"); | |
294 | + baseVo.setSuccess(false); | |
295 | + } | |
296 | + }catch (Exception e){ | |
297 | + System.out.println(e); | |
298 | + baseVo.setSuccess(false); | |
299 | + } | |
300 | + return baseVo; | |
301 | + } | |
302 | + | |
303 | + | |
304 | + private void initMessage(int schoolId){ | |
305 | + JSONObject teacherList = HttpClientUtils.httpGet(url+"/api/EasyN/GetSchoolTeacher?SchoolId="+schoolId); | |
306 | + List<JSONObject> openTeacherList = (List<JSONObject>)teacherList.get("data"); | |
307 | + List<Teacher> teachers = new ArrayList<>(); | |
308 | + for(JSONObject json :openTeacherList){ | |
309 | + Teacher teacher = new Teacher(); | |
310 | + teacher.setSchoolId(Integer.valueOf(json.get("school_id").toString())); | |
311 | + teacher.setTeacherId(Integer.valueOf(json.get("teacher_id").toString())); | |
312 | + teacher.setTeacherName(json.get("name").toString()); | |
313 | + teachers.add(teacher); | |
314 | + } | |
315 | + initTeacher(teachers); | |
316 | + JSONObject classList = HttpClientUtils.httpGet(url+"/api/EasyN/GetSchoolClass?SchoolId="+schoolId); | |
317 | + List<JSONObject> openClasses = (List<JSONObject>)classList.get("data"); | |
318 | + List<ClassModel> classModels = new ArrayList<>(); | |
319 | + for(JSONObject json :openClasses){ | |
320 | + ClassModel classModel = new ClassModel(); | |
321 | + classModel.setSchoolId(Integer.valueOf(json.get("school_id").toString())); | |
322 | + classModel.setClassId(Integer.valueOf(json.get("class_id").toString())); | |
323 | + classModel.setGrade(json.get("gardeName").toString()); | |
324 | + classModel.setClassName(json.get("class_name").toString()); | |
325 | + classModels.add(classModel); | |
326 | + } | |
327 | + initClass(classModels); | |
328 | + JSONObject courseList = HttpClientUtils.httpGet(url+"/api/EasyN/GetSchoolSubject?SchoolId="+schoolId); | |
329 | + List<JSONObject> openCourses = (List<JSONObject>)courseList.get("data"); | |
330 | + List<Course> courses = new ArrayList<>(); | |
331 | + for(JSONObject json :openCourses){ | |
332 | + Course course = new Course(); | |
333 | + course.setSchoolId(Integer.valueOf(json.get("school_id").toString())); | |
334 | + course.setCourseId(Integer.valueOf(json.get("subject_id").toString())); | |
335 | + course.setCourseName(json.get("subject_name").toString()); | |
336 | + course.setCourseType(0); | |
337 | + courses.add(course); | |
338 | + } | |
339 | + initCourse(courses); | |
340 | + } | |
341 | + public BaseVo initCourse(List<Course> courseList){ | |
342 | + BaseVo baseVo = new BaseVo(); | |
343 | + List<Course> list = courseService.selectBySchoolId(courseList.get(0).getSchoolId()); | |
344 | + if(list != null && list.size() > 0){ | |
345 | + courseService.deleteSchoolId(courseList.get(0).getSchoolId()); | |
346 | + } | |
347 | + for(Course course : courseList){ | |
348 | + if(course.getCourseId() == 0 || StringUtils.isBlank(course.getCourseName())){ | |
349 | + baseVo.setSuccess(false); | |
350 | + baseVo.setMessage("缺少参数"); | |
351 | + break; | |
352 | + } | |
353 | + } | |
354 | + if(baseVo.isSuccess()){ | |
355 | + courseService.insertBatch(courseList); | |
356 | + baseVo.setSuccess(true); | |
357 | + return baseVo; | |
358 | + }else { | |
359 | + return baseVo; | |
360 | + } | |
361 | + } | |
362 | + | |
363 | + public BaseVo initClass(List<ClassModel> classList){ | |
364 | + BaseVo baseVo = new BaseVo(); | |
365 | + List<ClassModel> list = classModelService.selectBySchoolId(classList.get(0).getSchoolId()); | |
366 | + if(list != null && list.size() > 0){ | |
367 | + classModelService.deleteSchool(classList.get(0).getSchoolId()); | |
368 | + } | |
369 | + for(ClassModel classModel : classList){ | |
370 | + if(classModel.getClassId() == 0 || StringUtils.isBlank(classModel.getClassName()) || | |
371 | + StringUtils.isBlank(classModel.getGrade()) || classModel.getSchoolId() == 0){ | |
372 | + baseVo.setSuccess(false); | |
373 | + baseVo.setMessage("缺少参数"); | |
374 | + break; | |
375 | + } | |
376 | + } | |
377 | + if(baseVo.isSuccess()){ | |
378 | + classModelService.insertBatch(classList); | |
379 | + baseVo.setSuccess(true); | |
380 | + return baseVo; | |
381 | + }else { | |
382 | + return baseVo; | |
383 | + } | |
384 | + } | |
385 | + | |
386 | + public BaseVo initTeacher(List<Teacher> teacherList){ | |
387 | + List<Teacher> result = new ArrayList<>(); | |
388 | + for(Teacher teacher : teacherList){ | |
389 | + boolean isExist = false; | |
390 | + for(Teacher t : result){ | |
391 | + if(t.getTeacherName().equals(teacher.getTeacherName())){ | |
392 | + isExist = true; | |
393 | + } | |
394 | + } | |
395 | + if(!isExist){ | |
396 | + result.add(teacher); | |
397 | + } | |
398 | + } | |
399 | + BaseVo baseVo = new BaseVo(); | |
400 | + List<Teacher> list = teacherService.selectBySchoolId(result.get(0).getSchoolId()); | |
401 | + if(list != null && list.size()>0){ | |
402 | + teacherService.deleteSchool(result.get(0).getSchoolId()); | |
403 | + } | |
404 | + for(Teacher teacher : result){ | |
405 | + if(teacher.getSchoolId() == 0 || StringUtils.isBlank(teacher.getTeacherName()) || | |
406 | + teacher.getTeacherId() == 0){ | |
407 | + baseVo.setSuccess(false); | |
408 | + baseVo.setMessage("缺少参数"); | |
409 | + break; | |
410 | + } | |
411 | + } | |
412 | + if(baseVo.isSuccess()){ | |
413 | + teacherService.insertBatch(result); | |
414 | + baseVo.setSuccess(true); | |
415 | + return baseVo; | |
416 | + }else { | |
417 | + return baseVo; | |
418 | + } | |
419 | + } | |
420 | + | |
421 | +} | ... | ... |
src/main/java/com/jevon/controller/MessageController.java
0 → 100644
1 | +++ a/src/main/java/com/jevon/controller/MessageController.java | |
... | ... | @@ -0,0 +1,316 @@ |
1 | +package com.jevon.controller; | |
2 | + | |
3 | +import com.jevon.model.*; | |
4 | +import com.jevon.service.*; | |
5 | +import com.jevon.utils.ExcelUtils; | |
6 | +import com.jevon.vo.BaseVo; | |
7 | +import com.jevon.vo.rep.*; | |
8 | +import com.jevon.vo.req.CourseClassReqVo; | |
9 | +import com.jevon.vo.req.GetClassCourseReqVo; | |
10 | +import com.jevon.vo.req.ScheduleIdReqVo; | |
11 | +import com.jevon.vo.req.SchoolIdReqVo; | |
12 | +import io.swagger.annotations.Api; | |
13 | +import io.swagger.annotations.ApiOperation; | |
14 | +import org.springframework.beans.factory.annotation.Autowired; | |
15 | +import org.springframework.web.bind.annotation.RequestBody; | |
16 | +import org.springframework.web.bind.annotation.RequestMapping; | |
17 | +import org.springframework.web.bind.annotation.RequestMethod; | |
18 | +import org.springframework.web.bind.annotation.RestController; | |
19 | + | |
20 | +import javax.servlet.http.HttpServletRequest; | |
21 | +import javax.servlet.http.HttpServletResponse; | |
22 | +import java.util.ArrayList; | |
23 | +import java.util.HashMap; | |
24 | +import java.util.List; | |
25 | +import java.util.Map; | |
26 | + | |
27 | +/** | |
28 | + * @author chen | |
29 | + * @version 1.0 | |
30 | + * @date 2019/10/11 0011 14:00 | |
31 | + */ | |
32 | +@RestController | |
33 | +@Api(value = "获取信息") | |
34 | +public class MessageController { | |
35 | + | |
36 | + @Autowired | |
37 | + ScheduleService scheduleService; | |
38 | + | |
39 | + @Autowired | |
40 | + CourseService courseService; | |
41 | + | |
42 | + @Autowired | |
43 | + ClassCourseService classCourseService; | |
44 | + | |
45 | + @Autowired | |
46 | + ClassModelService classModelService; | |
47 | + | |
48 | + @Autowired | |
49 | + JoinClassService joinClassService; | |
50 | + | |
51 | + @Autowired | |
52 | + TeacherClassService teacherClassService; | |
53 | + | |
54 | + @ApiOperation("获取学校排课计划") | |
55 | + @RequestMapping(value = "getScheduleList", method = RequestMethod.POST) | |
56 | + public ScheduleListRepVo getScheduleList(@RequestBody SchoolIdReqVo schoolIdReqVo){ | |
57 | + ScheduleListRepVo scheduleListRepVo = new ScheduleListRepVo(); | |
58 | + scheduleListRepVo.setData(scheduleService.selectBySchool(schoolIdReqVo.getSchoolId())); | |
59 | + return scheduleListRepVo; | |
60 | + } | |
61 | + | |
62 | + @ApiOperation("获取学校下所有班级信息") | |
63 | + @RequestMapping(value = "getClassList", method = RequestMethod.POST) | |
64 | + public ClassRepVo getClassList(@RequestBody SchoolIdReqVo schoolIdReqVo){ | |
65 | + ClassRepVo classRepVo = new ClassRepVo(); | |
66 | + classRepVo.setData(classModelService.selectBySchoolId(schoolIdReqVo.getSchoolId())); | |
67 | + return classRepVo; | |
68 | + } | |
69 | + | |
70 | + @ApiOperation("获取学校课程") | |
71 | + @RequestMapping(value = "getCourseList", method = RequestMethod.POST) | |
72 | + public CourseRepVo getCourseList(@RequestBody ScheduleIdReqVo scheduleIdReqVo){ | |
73 | + CourseRepVo courseRepVo = new CourseRepVo(); | |
74 | + Schedule schedule = scheduleService.selectById(scheduleIdReqVo.getScheduleId()); | |
75 | + if(schedule == null){ | |
76 | + courseRepVo.setSuccess(false); | |
77 | + courseRepVo.setMessage("请先创建计划"); | |
78 | + return courseRepVo; | |
79 | + } | |
80 | + courseRepVo.setData(courseService.selectBySchoolId(schedule.getSchoolId())); | |
81 | + return courseRepVo; | |
82 | + } | |
83 | + | |
84 | + @ApiOperation("获取要学习某个学科的班级集合") | |
85 | + @RequestMapping(value = "getCourseClassList", method = RequestMethod.POST) | |
86 | + public List<GetCourseClassListRepVo> getCourseClassList(@RequestBody CourseClassReqVo courseClassReqVo){ | |
87 | + List<GetCourseClassListRepVo> repVos = new ArrayList<>(); | |
88 | + Schedule schedule = scheduleService.selectById(courseClassReqVo.getScheduleId()); | |
89 | + if(schedule == null){ | |
90 | + return null; | |
91 | + } | |
92 | + TeacherClass search = new TeacherClass(); | |
93 | + search.setSchoolId(schedule.getSchoolId()); | |
94 | + search.setTeam(schedule.getTeam()); | |
95 | + String courseName =courseService.selectBySchoolIdAndCourseId(schedule.getSchoolId(),courseClassReqVo.getCourseId()).getCourseName(); | |
96 | + search.setCourseName(courseName); | |
97 | + List<TeacherClass> list = teacherClassService.selectByCourseName(search); | |
98 | + for(TeacherClass teacherClass : list){ | |
99 | + GetCourseClassListRepVo repVo = new GetCourseClassListRepVo(); | |
100 | + repVo.setClassId(teacherClass.getClassId()); | |
101 | + repVo.setClassName(classModelService.selectByPrimaryKey(teacherClass.getClassId()).getClassName()); | |
102 | + repVo.setCourseId(courseClassReqVo.getCourseId()); | |
103 | + repVo.setCourseName(courseName); | |
104 | + repVo.setTeacherName(teacherClass.getTeacherName()); | |
105 | + repVos.add(repVo); | |
106 | + } | |
107 | + return repVos; | |
108 | + } | |
109 | + | |
110 | + @ApiOperation("获取班级排课课程") | |
111 | + @RequestMapping(value = "getClassCourseList", method = RequestMethod.POST) | |
112 | + public ClassCourseRepVo getClassCourseList(@RequestBody GetClassCourseReqVo getClassCourseReqVo){ | |
113 | + ClassCourseRepVo classCourseRepVo = new ClassCourseRepVo(); | |
114 | + Schedule schedule = scheduleService.selectById(getClassCourseReqVo.getScheduleId()); | |
115 | + if(schedule == null){ | |
116 | + classCourseRepVo.setSuccess(false); | |
117 | + classCourseRepVo.setMessage("请先创建计划"); | |
118 | + return classCourseRepVo; | |
119 | + } | |
120 | + ClassCourse search = new ClassCourse(); | |
121 | + search.setClassId(getClassCourseReqVo.getClassId()); | |
122 | + search.setSingleOrDouble(1); | |
123 | + search.setTeam(schedule.getTeam()); | |
124 | + classCourseRepVo.setData(classCourseService.selectByClassIdAndSingleOrDouble(search)); | |
125 | + return classCourseRepVo; | |
126 | + } | |
127 | + | |
128 | + @ApiOperation("获取合班信息") | |
129 | + @RequestMapping(value = "getJoinList", method = RequestMethod.POST) | |
130 | + public JoinRepVo getJoinList(@RequestBody ScheduleIdReqVo scheduleIdReqVo){ | |
131 | + JoinRepVo joinRepVo = new JoinRepVo(); | |
132 | + Schedule schedule = scheduleService.selectById(scheduleIdReqVo.getScheduleId()); | |
133 | + JoinClass joinClass = new JoinClass(); | |
134 | + joinClass.setSchoolId(schedule.getSchoolId()); | |
135 | + joinClass.setTeam(schedule.getTeam()); | |
136 | + List<JoinClass> list = joinClassService.selectByCourse(joinClass); | |
137 | + List<JoinDetail> joinDetails = new ArrayList<>(); | |
138 | + for(JoinClass temp : list){ | |
139 | + boolean flag = false ; | |
140 | + ClassModel classModel = classModelService.selectByPrimaryKey(temp.getClassId()); | |
141 | + for(JoinDetail joinDetail : joinDetails){ | |
142 | + if(temp.getCourseGroup() == joinDetail.getCourseGroup()){ | |
143 | + flag = true; | |
144 | + if(!joinDetail.getClassName().contains(classModel.getClassName())){ | |
145 | + joinDetail.setClassName(joinDetail.getClassName()+","+classModel.getClassName()); | |
146 | + } | |
147 | + } | |
148 | + } | |
149 | + if(!flag){ | |
150 | + JoinDetail joinDetail = new JoinDetail(); | |
151 | + joinDetail.setCourseGroup(temp.getCourseGroup()); | |
152 | + joinDetail.setClassName(classModel.getClassName()); | |
153 | + joinDetail.setCourseName(temp.getCourseName()); | |
154 | + TeacherClass search = new TeacherClass(); | |
155 | + search.setSchoolId(schedule.getSchoolId()); | |
156 | + search.setTeam(schedule.getTeam()); | |
157 | + search.setClassId(temp.getClassId()); | |
158 | + search.setCourseName(temp.getCourseName()); | |
159 | + joinDetail.setTeacherName(teacherClassService.selectByCourseAndClass(search).getTeacherName()); | |
160 | + joinDetails.add(joinDetail); | |
161 | + } | |
162 | + } | |
163 | + joinRepVo.setData(joinDetails); | |
164 | + return joinRepVo; | |
165 | + } | |
166 | + | |
167 | + @ApiOperation("获取导入任课信息") | |
168 | + @RequestMapping(value = "getTeacherClassList", method = RequestMethod.POST) | |
169 | + public TeacherCourseRepVo getTeacherClassList(@RequestBody ScheduleIdReqVo scheduleIdReqVo){ | |
170 | + TeacherCourseRepVo teacherCourseRepVo = new TeacherCourseRepVo(); | |
171 | + Schedule schedule = scheduleService.selectById(scheduleIdReqVo.getScheduleId()); | |
172 | + TeacherClass temp = new TeacherClass(); | |
173 | + temp.setSchoolId(schedule.getSchoolId()); | |
174 | + temp.setTeam(schedule.getTeam()); | |
175 | + List<ClassCourseVO> data = new ArrayList<>(); | |
176 | + List<String> courseNameList = new ArrayList<>(); | |
177 | + List<TeacherClass> teacherClasses = teacherClassService.selectBySchoolAndTeam(temp); | |
178 | + for(TeacherClass teacherClass :teacherClasses){ | |
179 | + boolean isExist = false; | |
180 | + if(!courseNameList.contains(teacherClass.getCourseName())){ | |
181 | + courseNameList.add(teacherClass.getCourseName()); | |
182 | + } | |
183 | + for(ClassCourseVO classCourseVO : data){ | |
184 | + if(classCourseVO.getClassId() == teacherClass.getClassId()){ | |
185 | + isExist = true ; | |
186 | + ClassCourseDetailVo classCourseDetailVo = new ClassCourseDetailVo(teacherClass); | |
187 | + List<ClassCourseDetailVo> classCourseDetailVos = classCourseVO.getList(); | |
188 | + classCourseDetailVos.add(classCourseDetailVo); | |
189 | + classCourseVO.setAllCount(classCourseVO.getAllCount()+teacherClass.getTimes()); | |
190 | + classCourseVO.setList(classCourseDetailVos); | |
191 | + } | |
192 | + } | |
193 | + if(!isExist){ | |
194 | + ClassCourseVO classCourseVO = new ClassCourseVO(); | |
195 | + classCourseVO.setClassId(teacherClass.getClassId()); | |
196 | + classCourseVO.setAllCount(teacherClass.getTimes()); | |
197 | + classCourseVO.setClassName(classModelService.selectByPrimaryKey(teacherClass.getClassId()).getClassName()); | |
198 | + List<ClassCourseDetailVo> classCourseDetailVos = new ArrayList<>(); | |
199 | + classCourseDetailVos.add(new ClassCourseDetailVo(teacherClass)); | |
200 | + classCourseVO.setList(classCourseDetailVos); | |
201 | + data.add(classCourseVO); | |
202 | + } | |
203 | + } | |
204 | + teacherCourseRepVo.setData(data); | |
205 | + teacherCourseRepVo.setCourseNameList(courseNameList); | |
206 | + return teacherCourseRepVo; | |
207 | + } | |
208 | + | |
209 | + @ApiOperation("获取主课,副科,公共课列表") | |
210 | + @RequestMapping(value = "getCourseTypeList", method = RequestMethod.POST) | |
211 | + public GetCourseTypeListRepVo getCourseTypeList(@RequestBody ScheduleIdReqVo scheduleIdReqVo){ | |
212 | + GetCourseTypeListRepVo getCourseTypeListRepVo = new GetCourseTypeListRepVo(); | |
213 | + List<CourseTypeListVO> data = new ArrayList<>(); | |
214 | + Schedule schedule = scheduleService.selectById(scheduleIdReqVo.getScheduleId()); | |
215 | + if(schedule == null){ | |
216 | + getCourseTypeListRepVo.setSuccess(false); | |
217 | + getCourseTypeListRepVo.setMessage("请先创建计划"); | |
218 | + return getCourseTypeListRepVo; | |
219 | + } | |
220 | + for(int i = 1 ; i <=3 ; i++){ | |
221 | + CourseTypeListVO vo = new CourseTypeListVO(); | |
222 | + vo.setCourseType(i); | |
223 | + switch (i){ | |
224 | + case 1 : | |
225 | + vo.setCourseTypeName("主课"); | |
226 | + break; | |
227 | + case 2: | |
228 | + vo.setCourseTypeName("副科"); | |
229 | + break; | |
230 | + case 3: | |
231 | + vo.setCourseTypeName("公共课"); | |
232 | + break; | |
233 | + } | |
234 | + Course course = new Course(); | |
235 | + course.setSchoolId(schedule.getSchoolId()); | |
236 | + course.setCourseType(i); | |
237 | + vo.setList(courseService.selectByCourse(course)); | |
238 | + data.add(vo); | |
239 | + } | |
240 | + getCourseTypeListRepVo.setData(data); | |
241 | + getCourseTypeListRepVo.setScheduleId(schedule.getSchoolId()); | |
242 | + return getCourseTypeListRepVo; | |
243 | + } | |
244 | + | |
245 | + @ApiOperation("获取未设置学科类型的科目") | |
246 | + @RequestMapping(value = "getUnCourseList", method = RequestMethod.POST) | |
247 | + public CourseRepVo getUnCourseList(@RequestBody ScheduleIdReqVo scheduleIdReqVo){ | |
248 | + CourseRepVo courseRepVo = new CourseRepVo(); | |
249 | + Schedule schedule = scheduleService.selectById(scheduleIdReqVo.getScheduleId()); | |
250 | + if(schedule == null){ | |
251 | + courseRepVo.setSuccess(false); | |
252 | + courseRepVo.setMessage("请先创建计划"); | |
253 | + return courseRepVo; | |
254 | + } | |
255 | + Course course = new Course(); | |
256 | + course.setSchoolId(schedule.getSchoolId()); | |
257 | + course.setCourseType(0); | |
258 | + courseRepVo.setData(courseService.selectByCourse(course)); | |
259 | + return courseRepVo; | |
260 | + } | |
261 | + | |
262 | + @ApiOperation("删除设置的 主课 副科 公共课") | |
263 | + @RequestMapping(value = "deleteCourseType", method = RequestMethod.POST) | |
264 | + public BaseVo deleteCourseType(@RequestBody CourseClassReqVo courseClassReqVo){ | |
265 | + BaseVo baseVo = new BaseVo(); | |
266 | + Schedule schedule = scheduleService.selectById(courseClassReqVo.getScheduleId()); | |
267 | + if(schedule == null){ | |
268 | + baseVo.setSuccess(false); | |
269 | + baseVo.setMessage("请先创建计划"); | |
270 | + return baseVo; | |
271 | + } | |
272 | + if(teacherClassService.selectHasSchedule(schedule.getSchoolId(),schedule.getTeam()) > 0){ | |
273 | + baseVo.setSuccess(false); | |
274 | + baseVo.setMessage("已经排课,不能再删除"); | |
275 | + return baseVo; | |
276 | + } | |
277 | + courseService.updateCourseType(courseClassReqVo.getCourseId(),0,schedule.getSchoolId()); | |
278 | + return baseVo; | |
279 | + } | |
280 | + | |
281 | + @ApiOperation("获取设置的作息 获取排课计划详情") | |
282 | + @RequestMapping(value = "getSchedule", method = RequestMethod.POST) | |
283 | + public Schedule getSchedule(@RequestBody ScheduleIdReqVo scheduleIdReqVo){ | |
284 | + Schedule schedule = scheduleService.selectById(scheduleIdReqVo.getScheduleId()); | |
285 | + return schedule; | |
286 | + } | |
287 | + | |
288 | + @ApiOperation("导出模板") | |
289 | + @RequestMapping(value = "export", method = RequestMethod.GET) | |
290 | + public void export(int scheduleId , HttpServletRequest request, HttpServletResponse response){ | |
291 | + ExcelUtils excelUtils = new ExcelUtils(); | |
292 | + List<String> headList = new ArrayList<>(); | |
293 | + headList.add("年级"); | |
294 | + headList.add("班级"); | |
295 | + List<String> heardKey = new ArrayList<>(); | |
296 | + heardKey.add("grade"); | |
297 | + heardKey.add("class"); | |
298 | + List<Map<String , String >> data = new ArrayList<>(); | |
299 | + Schedule schedule = scheduleService.selectById(scheduleId); | |
300 | + List<ClassModel> list = classModelService.selectBySchoolId(schedule.getSchoolId()); | |
301 | + for(ClassModel classModel : list){ | |
302 | + Map<String ,String> map = new HashMap<>(); | |
303 | + map.put("grade",classModel.getGrade()); | |
304 | + map.put("class",classModel.getClassName()); | |
305 | + data.add(map); | |
306 | + } | |
307 | + excelUtils.setHeardList(headList); | |
308 | + excelUtils.setHeardKey(heardKey); | |
309 | + excelUtils.setData(data); | |
310 | + try{ | |
311 | + excelUtils.exportExport(request,response); | |
312 | + }catch (Exception e){ | |
313 | + | |
314 | + } | |
315 | + } | |
316 | +} | ... | ... |
src/main/java/com/jevon/controller/ScheduleController.java
0 → 100644
1 | +++ a/src/main/java/com/jevon/controller/ScheduleController.java | |
... | ... | @@ -0,0 +1,846 @@ |
1 | +package com.jevon.controller; | |
2 | + | |
3 | +import com.jevon.model.*; | |
4 | +import com.jevon.service.*; | |
5 | +import com.jevon.vo.BaseVo; | |
6 | +import com.jevon.vo.req.*; | |
7 | +import io.swagger.annotations.Api; | |
8 | +import io.swagger.annotations.ApiOperation; | |
9 | +import org.apache.commons.lang3.StringUtils; | |
10 | +import org.springframework.beans.factory.annotation.Autowired; | |
11 | +import org.springframework.transaction.annotation.Transactional; | |
12 | +import org.springframework.web.bind.annotation.RequestBody; | |
13 | +import org.springframework.web.bind.annotation.RequestMapping; | |
14 | +import org.springframework.web.bind.annotation.RequestMethod; | |
15 | +import org.springframework.web.bind.annotation.RestController; | |
16 | + | |
17 | +import java.util.*; | |
18 | + | |
19 | +@RestController | |
20 | +@RequestMapping(value = "/schedule") | |
21 | +@Api(value = "排课表") | |
22 | +public class ScheduleController { | |
23 | + | |
24 | + @Autowired | |
25 | + ClassCourseService classCourseService; | |
26 | + | |
27 | + @Autowired | |
28 | + ClassModelService classModelService; | |
29 | + | |
30 | + @Autowired | |
31 | + TeacherCourseService teacherCourseService; | |
32 | + | |
33 | + @Autowired | |
34 | + TeacherClassService teacherClassService; | |
35 | + | |
36 | + @Autowired | |
37 | + CourseService courseService; | |
38 | + | |
39 | + @Autowired | |
40 | + JoinClassService joinClassService; | |
41 | + | |
42 | + @Autowired | |
43 | + ScheduleService scheduleService; | |
44 | + | |
45 | + @ApiOperation("作息安排") | |
46 | + @RequestMapping(value = "firstChoose", method = RequestMethod.POST) | |
47 | + public BaseVo firstChoose(@RequestBody FirstReqVo firstReqVo){ | |
48 | + BaseVo baseVo = new BaseVo(); | |
49 | + Schedule schedule = scheduleService.selectById(firstReqVo.getScheduleId()); | |
50 | + if(schedule != null && schedule.getSpeed() == 0){ | |
51 | + schedule.setMorning(firstReqVo.getMorning()); | |
52 | + schedule.setAfternoon(firstReqVo.getAfternoon()); | |
53 | + schedule.setNight(firstReqVo.getNight()); | |
54 | + scheduleService.updateZuoxi(schedule); | |
55 | + firstReqVo.setDayNumber(firstReqVo.getMorning()+firstReqVo.getAfternoon()+firstReqVo.getNight()); | |
56 | + List<ClassCourse> classCourses = new ArrayList<>(); | |
57 | + //暂时只有单周 | |
58 | + for (int i = 1; i <= 7; i++) { | |
59 | + classCourses.addAll(setClassCourse(false,i,firstReqVo)); | |
60 | + } | |
61 | + classCourseService.insertSchoolClass(classCourses); | |
62 | + schedule.setSpeed(2); | |
63 | + scheduleService.updateSpeed(schedule); | |
64 | + }else { | |
65 | + baseVo.setMessage("排课计划不存在或已生成作息"); | |
66 | + baseVo.setSuccess(false); | |
67 | + } | |
68 | + return baseVo; | |
69 | + } | |
70 | + | |
71 | + @ApiOperation("设置公共资源课,主课,副课") | |
72 | + @RequestMapping(value = "setCourseType", method = RequestMethod.POST) | |
73 | + public BaseVo setCourseType(@RequestBody SetTypeReqVo setTypeReqVo){ | |
74 | + BaseVo baseVo = new BaseVo(); | |
75 | + Schedule schedule = scheduleService.selectById(setTypeReqVo.getScheduleId()); | |
76 | + if(schedule == null){ | |
77 | + baseVo.setMessage("参数有误"); | |
78 | + baseVo.setSuccess(false); | |
79 | + return baseVo; | |
80 | + } | |
81 | + if(teacherClassService.selectHasSchedule(schedule.getSchoolId(),schedule.getTeam()) >0){ | |
82 | + baseVo.setMessage("已经部分排课,不能再设置"); | |
83 | + baseVo.setSuccess(false); | |
84 | + return baseVo; | |
85 | + } | |
86 | + for(Integer courseId : setTypeReqVo.getCourseIdList()){ | |
87 | + if(setTypeReqVo.getCourseType() !=1 && setTypeReqVo.getCourseType() != 2 &&setTypeReqVo.getCourseType() != 3){ | |
88 | + baseVo.setMessage("课程类型错误"); | |
89 | + baseVo.setSuccess(false); | |
90 | + return baseVo; | |
91 | + } | |
92 | + courseService.updateCourseType(courseId,setTypeReqVo.getCourseType(),schedule.getSchoolId()); | |
93 | + } | |
94 | + return baseVo; | |
95 | + } | |
96 | + | |
97 | + @ApiOperation("合班") | |
98 | + @RequestMapping(value = "joinClass", method = RequestMethod.POST) | |
99 | + public BaseVo joinClass(@RequestBody JoinClassReqVo joinClassReqVo){ | |
100 | + BaseVo baseVo = new BaseVo(); | |
101 | + Schedule schedule = scheduleService.selectById(joinClassReqVo.getScheduleId()); | |
102 | + if(teacherClassService.selectHasSchedule(schedule.getSchoolId(),schedule.getTeam()) >0){ | |
103 | + baseVo.setMessage("已经部分排课,不能再设置"); | |
104 | + baseVo.setSuccess(false); | |
105 | + return baseVo; | |
106 | + } | |
107 | + Course course = courseService.selectBySchoolIdAndCourseId(schedule.getSchoolId(),joinClassReqVo.getCourseId()); | |
108 | + List<JoinClass> list = new ArrayList<>(); | |
109 | + String grade = null ; | |
110 | + String teacherName = null ; | |
111 | + for(Integer classId : joinClassReqVo.getClassIdList()){ | |
112 | + ClassModel classModel = classModelService.selectByPrimaryKey(classId); | |
113 | + if(grade == null){ | |
114 | + grade = classModel.getGrade(); | |
115 | + } | |
116 | + if(!grade.equals(classModel.getGrade())){ | |
117 | + baseVo.setMessage("合班不能跨年段"); | |
118 | + baseVo.setSuccess(false); | |
119 | + return baseVo; | |
120 | + } | |
121 | + TeacherClass teacherClass = new TeacherClass(); | |
122 | + teacherClass.setTeam(schedule.getTeam()); | |
123 | + teacherClass.setSchoolId(schedule.getSchoolId()); | |
124 | + teacherClass.setCourseName(course.getCourseName()); | |
125 | + teacherClass.setClassId(classId); | |
126 | + TeacherClass resultTeacherClass = teacherClassService.selectByCourseAndClass(teacherClass); | |
127 | + if(teacherName == null){ | |
128 | + teacherName = resultTeacherClass.getTeacherName(); | |
129 | + } | |
130 | + if(!teacherName.equals(resultTeacherClass.getTeacherName())){ | |
131 | + baseVo.setMessage("合班必须同一个老师"); | |
132 | + baseVo.setSuccess(false); | |
133 | + return baseVo; | |
134 | + } | |
135 | + JoinClass joinClass = new JoinClass(); | |
136 | + joinClass.setSchoolId(schedule.getSchoolId()); | |
137 | + joinClass.setClassId(classId); | |
138 | + joinClass.setTeam(schedule.getTeam()); | |
139 | + joinClass.setCourseId(course.getCourseId()); | |
140 | + joinClass.setCourseName(course.getCourseName()); | |
141 | + List<JoinClass> joinClasses = joinClassService.selectByCourse(joinClass); | |
142 | + if(joinClasses != null && joinClasses.size() > 0){ | |
143 | + baseVo.setSuccess(false); | |
144 | + baseVo.setMessage("不能重复合班"); | |
145 | + return baseVo; | |
146 | + } | |
147 | + list.add(joinClass); | |
148 | + } | |
149 | + joinClassService.insertBatch(list); | |
150 | + return baseVo; | |
151 | + } | |
152 | + | |
153 | + @ApiOperation("删除某个合班信息") | |
154 | + @RequestMapping(value = "deleteJoinClass", method = RequestMethod.POST) | |
155 | + public BaseVo deleteJoinClass(@RequestBody CourseGroupReqVo courseGroupReqVo){ | |
156 | + BaseVo baseVo = new BaseVo(); | |
157 | + Schedule schedule = scheduleService.selectById(courseGroupReqVo.getScheduleId()); | |
158 | + if(teacherClassService.selectHasSchedule(schedule.getSchoolId(),schedule.getTeam()) >0){ | |
159 | + baseVo.setMessage("已经部分排课,不能再删除"); | |
160 | + baseVo.setSuccess(false); | |
161 | + return baseVo; | |
162 | + } | |
163 | + joinClassService.deleteCourseGroup(courseGroupReqVo.getCourseGroup()); | |
164 | + return baseVo; | |
165 | + } | |
166 | + | |
167 | + @ApiOperation("不排课") | |
168 | + @RequestMapping(value = "noSchedule", method = RequestMethod.POST) | |
169 | + public BaseVo noSchedule(@RequestBody NoScheduleReqVo noScheduleReqVo){ | |
170 | + BaseVo baseVo = new BaseVo(); | |
171 | + Schedule schedule =scheduleService.selectById(noScheduleReqVo.getScheduleId()); | |
172 | + if(teacherClassService.selectHasSchedule(schedule.getSchoolId(),schedule.getTeam()) >0){ | |
173 | + baseVo.setMessage("已经部分排课,不能再设置"); | |
174 | + baseVo.setSuccess(false); | |
175 | + return baseVo; | |
176 | + } | |
177 | + for(String msg : noScheduleReqVo.getList()){ | |
178 | + try { | |
179 | + String[] arrayMsg = msg.split("-"); | |
180 | + ClassCourse classCourse = new ClassCourse(); | |
181 | + classCourse.setTeam(schedule.getTeam()); | |
182 | + classCourse.setSchoolId(schedule.getSchoolId()); | |
183 | + classCourse.setWeek(Integer.valueOf(arrayMsg[0])); | |
184 | + classCourse.setCourseNumber(Integer.valueOf(arrayMsg[1])); | |
185 | + classCourse.setSingleOrDouble(1); | |
186 | + if(noScheduleReqVo.getLevel() == 1){ | |
187 | + classCourse.setClassId(noScheduleReqVo.getClassId()); | |
188 | + } | |
189 | + if(noScheduleReqVo.getLevel() == 2){ | |
190 | + classCourse.setGrade(noScheduleReqVo.getGrade()); | |
191 | + } | |
192 | + List<ClassCourse> list = classCourseService.selectClassCourseByClass(classCourse); | |
193 | + for(ClassCourse temp : list){ | |
194 | + temp.setCourseName("不排课"); | |
195 | + classCourseService.updateByPrimaryKey(temp); | |
196 | + } | |
197 | + }catch (Exception e){ | |
198 | + System.out.println("不排课"+e.toString()); | |
199 | + baseVo.setSuccess(false); | |
200 | + baseVo.setMessage("格式不对"); | |
201 | + } | |
202 | + } | |
203 | + return baseVo; | |
204 | + } | |
205 | + | |
206 | + @ApiOperation("选择拟排科目类型,设置优先区间 提示") | |
207 | + @RequestMapping(value = "secondChooseBefore", method = RequestMethod.POST) | |
208 | + public BaseVo secondChooseBefore(@RequestBody ParallelClassReqVo parallelClassReqVo){ | |
209 | + BaseVo baseVo = new BaseVo(); | |
210 | + Schedule schedule = scheduleService.selectById(parallelClassReqVo.getScheduleId()); | |
211 | + StringBuffer stringBuffer = new StringBuffer(); | |
212 | + if(parallelClassReqVo.getLevel() == 1){ | |
213 | + ClassModel classModel = classModelService.selectByPrimaryKey(parallelClassReqVo.getClassId()); | |
214 | + stringBuffer.append("本次不排课设置,只涉及"+classModel.getClassName()); | |
215 | + }else if(parallelClassReqVo.getLevel() == 2){ | |
216 | + List<ClassModel> list = classModelService.selectBySchoolIdAndGrade(schedule.getSchoolId(),parallelClassReqVo.getGrade()); | |
217 | + stringBuffer.append("本次不排课设置,共涉及"+list.size()+"个班"); | |
218 | + }else { | |
219 | + List<ClassModel> list = classModelService.selectBySchoolId(schedule.getSchoolId()); | |
220 | + stringBuffer.append("本次不排课设置,共涉及"+list.size()+"个班"); | |
221 | + } | |
222 | + baseVo.setMessage(stringBuffer.toString()); | |
223 | + return baseVo; | |
224 | + } | |
225 | + | |
226 | + @Transactional | |
227 | + @ApiOperation("选择拟排科目类型,设置优先区间") | |
228 | + @RequestMapping(value = "secondChoose", method = RequestMethod.POST) | |
229 | + public BaseVo secondChoose(@RequestBody ParallelClassReqVo parallelClassReqVo) { | |
230 | + BaseVo baseVo = new BaseVo(); | |
231 | + Schedule schedule = scheduleService.selectById(parallelClassReqVo.getScheduleId()); | |
232 | + //TODO 暂时只有单周 | |
233 | + boolean isDouble = false; | |
234 | + //优先范围 | |
235 | + List<ClassCourse> limitList = new ArrayList<>(); | |
236 | + for(String msg : parallelClassReqVo.getIntervalList()){ | |
237 | + String[] arrayMsg = msg.split("-"); | |
238 | + ClassCourse classCourse = new ClassCourse(); | |
239 | + if(Integer.valueOf(arrayMsg[0]) > 5){ | |
240 | + classCourse.setSingleOrDouble(2); | |
241 | + classCourse.setWeek(Integer.valueOf(arrayMsg[0])-5); | |
242 | + }else { | |
243 | + classCourse.setSingleOrDouble(1); | |
244 | + classCourse.setWeek(Integer.valueOf(arrayMsg[0])); | |
245 | + } | |
246 | + classCourse.setCourseNumber(Integer.valueOf(arrayMsg[1])); | |
247 | + limitList.add(classCourse); | |
248 | + } | |
249 | + | |
250 | + //查询该课程类型下 所有的老师授课信息 | |
251 | + Course course = new Course(); | |
252 | + course.setSchoolId(schedule.getSchoolId()); | |
253 | + course.setCourseType(parallelClassReqVo.getCourseType()); | |
254 | + List<Course> courseList = courseService.selectByCourse(course); | |
255 | + List<TeacherClass> teacherClasss = new ArrayList<>(); | |
256 | + int courseCount = 0 ; | |
257 | + for(Course course1 : courseList){ | |
258 | + TeacherClass search = new TeacherClass(); | |
259 | + search.setSchoolId(schedule.getSchoolId()); | |
260 | + search.setCourseName(course1.getCourseName()); | |
261 | + search.setTeam(schedule.getTeam()); | |
262 | + if(parallelClassReqVo.getLevel() == 1){ | |
263 | + search.setClassId(parallelClassReqVo.getClassId()); | |
264 | + } | |
265 | + if(parallelClassReqVo.getLevel() == 2){ | |
266 | + search.setGrade(parallelClassReqVo.getGrade()); | |
267 | + } | |
268 | + List<TeacherClass> teacherClassList = teacherClassService.selectByCourseName(search); | |
269 | + courseCount = courseCount + teacherClassList.get(0).getTimes(); | |
270 | + teacherClasss.addAll(teacherClassList); | |
271 | + } | |
272 | + if(courseCount > limitList.size()){ | |
273 | + baseVo.setSuccess(false); | |
274 | + baseVo.setMessage("所要设置的公共课程数大于选择课表时段,请重新设置"); | |
275 | + return baseVo; | |
276 | + } | |
277 | + //联排的优先级 | |
278 | + List<Integer> joinList = new ArrayList<>(); | |
279 | + for(int i = 1 ; i <= 5 ; i++) { | |
280 | + joinList.add(i); | |
281 | + } | |
282 | + Set<TeacherClass> teacherClassSet = new HashSet<>(teacherClasss); | |
283 | + for (TeacherClass temp : teacherClassSet) { | |
284 | + TeacherCourse teacherCourse = new TeacherCourse(); | |
285 | + teacherCourse.setSchoolId(schedule.getSchoolId()); | |
286 | + teacherCourse.setTeacherName(temp.getTeacherName()); | |
287 | + teacherCourse.setTeam(schedule.getTeam()); | |
288 | + //插入教师排课表 | |
289 | + if(teacherCourseService.isCreateCourse(teacherCourse) == 0){ | |
290 | + //插入教师排课表 | |
291 | + insertTeacherCourse(isDouble, teacherCourse); | |
292 | + } | |
293 | + TeacherClass searchTeacher = new TeacherClass(); | |
294 | + searchTeacher.setTeacherName(temp.getTeacherName()); | |
295 | + searchTeacher.setSchoolId(temp.getSchoolId()); | |
296 | + searchTeacher.setClassId(temp.getClassId()); | |
297 | + searchTeacher.setTeam(temp.getTeam()); | |
298 | + TeacherClass teacherClass = teacherClassService.selectByTeacher(searchTeacher); | |
299 | + if(teacherClass.getStatus() == 1){ | |
300 | + //已经排课不再排课 | |
301 | + }else { | |
302 | + ClassCourse classCourse = new ClassCourse(); | |
303 | + classCourse.setClassId(temp.getClassId()); | |
304 | + classCourse.setTeam(schedule.getTeam()); | |
305 | + if(isDouble){ | |
306 | +// //双周排课 先排第一周 | |
307 | +// int times = teacherClass.getTimes(); | |
308 | +// int joinTimes = teacherClass.getJoinTimes(); | |
309 | +// classCourse.setSingleOrDouble(1); | |
310 | +// teacherClass.setJoinTimes(times/2); | |
311 | +// teacherClass.setJoinTimes(joinTimes/2); | |
312 | +// List<ClassCourse> classCourses = classCourseService.selectByClassIdAndSingleOrDouble(classCourse); | |
313 | +// initWeekCourse(joinList,teacherClass,teacherCourse,classCourses,limitList,0); | |
314 | +// //第二周 | |
315 | +// classCourse.setSingleOrDouble(1); | |
316 | +// teacherClass.setJoinTimes(times/2+1); | |
317 | +// teacherClass.setJoinTimes(joinTimes/2+1); | |
318 | +// classCourses = classCourseService.selectByClassIdAndSingleOrDouble(classCourse); | |
319 | +// initWeekCourse(joinList,teacherClass,teacherCourse,classCourses,limitList,0); | |
320 | + }else { | |
321 | + classCourse.setSingleOrDouble(1); | |
322 | + List<ClassCourse> classCourses = classCourseService.selectByClassIdAndSingleOrDouble(classCourse); | |
323 | + initWeekCourse(joinList,teacherClass,teacherCourse,classCourses,limitList,0); | |
324 | + //排课结束,更新 | |
325 | + //如果是合班的话,需要更新多个teacherClass | |
326 | + teacherClassService.updateSchedule(teacherClass.gettClassId()); | |
327 | + JoinClass joinClass = new JoinClass(); | |
328 | + joinClass.setSchoolId(schedule.getSchoolId()); | |
329 | + joinClass.setTeam(schedule.getTeam()); | |
330 | + joinClass.setCourseId(courseService.selectBySchoolIdAndCourseName(schedule.getSchoolId(),teacherClass.getCourseName()).getCourseId()); | |
331 | + joinClass.setClassId(classCourse.getClassId()); | |
332 | + List<JoinClass> joinClasses = joinClassService.selectByCourse(joinClass); | |
333 | + if(joinClasses != null && joinClasses.size() > 0){ | |
334 | + List<JoinClass> resultList = joinClassService.selectByCourseGroup(joinClasses.get(0).getCourseGroup()); | |
335 | + for(JoinClass joinClass1 :resultList){ | |
336 | + TeacherClass searchTeacherClass = new TeacherClass(); | |
337 | + searchTeacherClass.setSchoolId(schedule.getSchoolId()); | |
338 | + searchTeacherClass.setTeam(schedule.getTeam()); | |
339 | + searchTeacherClass.setCourseName(teacherClass.getCourseName()); | |
340 | + searchTeacherClass.setClassId(joinClass1.getClassId()); | |
341 | + TeacherClass resultTeacherClass = teacherClassService.selectByCourseAndClass(searchTeacherClass); | |
342 | + teacherClassService.updateSchedule(resultTeacherClass.gettClassId()); | |
343 | + } | |
344 | + } | |
345 | + } | |
346 | + } | |
347 | + } | |
348 | + return baseVo; | |
349 | + } | |
350 | + | |
351 | + @ApiOperation("排课撤回") | |
352 | + @RequestMapping(value = "recall", method = RequestMethod.POST) | |
353 | + public BaseVo recall(@RequestBody RecallReqVo recallReqVo){ | |
354 | + BaseVo baseVo = new BaseVo(); | |
355 | + Schedule schedule = scheduleService.selectById(recallReqVo.getScheduleId()); | |
356 | + switch (recallReqVo.getNumber()){ | |
357 | + case 1: | |
358 | + //不排课撤回 | |
359 | + ClassCourse classCourse1 = new ClassCourse(); | |
360 | + classCourse1.setSchoolId(schedule.getSchoolId()); | |
361 | + classCourse1.setCourseName("不排课"); | |
362 | + classCourseService.recallClassCourse(classCourse1); | |
363 | + break; | |
364 | + case 2: | |
365 | + //公共课不排课 | |
366 | + recall(3,schedule); | |
367 | + break; | |
368 | + case 3: | |
369 | + //主课 | |
370 | + recall(1,schedule); | |
371 | + break; | |
372 | + case 4: | |
373 | + recall(2,schedule); | |
374 | + break; | |
375 | + } | |
376 | + return baseVo; | |
377 | + } | |
378 | + | |
379 | + private void recall(int courseType , Schedule schedule){ | |
380 | + Course course = new Course(); | |
381 | + course.setSchoolId(schedule.getSchoolId()); | |
382 | + course.setCourseType(courseType); | |
383 | + List<Course> list = courseService.selectByCourse(course); | |
384 | + for(Course temp : list){ | |
385 | + ClassCourse classCourse2 = new ClassCourse(); | |
386 | + classCourse2.setSchoolId(schedule.getSchoolId()); | |
387 | + classCourse2.setCourseName(temp.getCourseName()); | |
388 | + classCourseService.recallClassCourse(classCourse2); | |
389 | + TeacherClass teacherClass = new TeacherClass(); | |
390 | + teacherClass.setSchoolId(schedule.getSchoolId()); | |
391 | + teacherClass.setTeam(schedule.getTeam()); | |
392 | + teacherClass.setCourseName(temp.getCourseName()); | |
393 | + List<TeacherClass> teacherClasses = teacherClassService.selectByCourseName(teacherClass); | |
394 | + for(TeacherClass teacherClass1 : teacherClasses){ | |
395 | + TeacherCourse teacherCourse2 = new TeacherCourse(); | |
396 | + teacherCourse2.setSchoolId(schedule.getSchoolId()); | |
397 | + teacherCourse2.setTeam(schedule.getTeam()); | |
398 | + teacherCourse2.setTeacherName(teacherClass1.getTeacherName()); | |
399 | + teacherCourse2.setCourseName(temp.getCourseName()); | |
400 | + teacherCourseService.recallTeacherCourse(teacherCourse2); | |
401 | + teacherClassService.recallTeacherClass(teacherClass1.gettClassId()); | |
402 | + } | |
403 | + | |
404 | + } | |
405 | + } | |
406 | + | |
407 | + //设置当天课的信息 | |
408 | + private List<ClassCourse> setClassCourse(boolean isDouble , int i , FirstReqVo firstReqVo){ | |
409 | + List<ClassCourse> classCourses = new ArrayList<>(); | |
410 | + Schedule schedule = scheduleService.selectById(firstReqVo.getScheduleId()); | |
411 | + Date date = new Date(); | |
412 | + for(int j = 1 ; j <= firstReqVo.getDayNumber() ; j++){ | |
413 | + ClassCourse classCourse = new ClassCourse(); | |
414 | + classCourse.setSingleOrDouble(isDouble ? 2 : 1); | |
415 | + classCourse.setSchoolId(schedule.getSchoolId()); | |
416 | + classCourse.setWeek(i); | |
417 | + classCourse.setCourseNumber(j); | |
418 | + classCourse.setCreateTime(date); | |
419 | + classCourses.add(classCourse); | |
420 | + classCourse.setTeam(schedule.getTeam()); | |
421 | + } | |
422 | + return classCourses; | |
423 | + } | |
424 | + | |
425 | + private void initWeekCourse(List<Integer> joinList ,TeacherClass teacherClass , TeacherCourse teacherCourse , | |
426 | + List<ClassCourse> list , List<ClassCourse> limitList ,int functionTimes){ | |
427 | + List<Integer> sort = new ArrayList<>(); | |
428 | + String team = teacherClass.getTeam(); | |
429 | + int singleOrDouble = list.get(0).getSingleOrDouble(); | |
430 | + for(ClassCourse classCourse : limitList){ | |
431 | + if(!sort.contains(classCourse.getCourseNumber())){ | |
432 | + sort.add(classCourse.getCourseNumber()); | |
433 | + } | |
434 | + } | |
435 | + int times = 0 ; //已经排课数 | |
436 | + //先排联课 | |
437 | + int joinTimes = 0 ; //已经排联课数 | |
438 | + for(int w = 0 ; w <= 4 ; w++) { | |
439 | + int week = joinList.get(w); | |
440 | + if(joinTimes == teacherClass.getJoinTimes()){ | |
441 | + break; | |
442 | + } | |
443 | + for (int i = 0; i < sort.size(); i++) { | |
444 | + int courseNumber = sort.get(i); | |
445 | + ClassCourse classCourse = getClassCourse(list, week, courseNumber); | |
446 | + if(!sort.contains(courseNumber+1)){ | |
447 | + continue; | |
448 | + } | |
449 | + ClassCourse classCourseNext =getClassCourse(list, week, courseNumber+1); | |
450 | + if (StringUtils.isBlank(classCourse.getCourseName()) && StringUtils.isBlank(classCourseNext.getCourseName())) { | |
451 | + Course course = courseService.selectBySchoolIdAndCourseName(teacherClass.getSchoolId(),teacherCourse.getCourseName()); | |
452 | + classCourse.setCourseOpenId(course.getCourseId()); | |
453 | + classCourse.setCourseName(teacherClass.getCourseName()); | |
454 | + classCourseNext.setCourseOpenId(course.getCourseId()); | |
455 | + classCourseNext.setCourseName(teacherClass.getCourseName()); | |
456 | + TeacherCourse searchTeacherCourse = new TeacherCourse(); | |
457 | + searchTeacherCourse.setTeam(team); | |
458 | + searchTeacherCourse.setSchoolId(teacherCourse.getSchoolId()); | |
459 | + searchTeacherCourse.setGrade(teacherCourse.getGrade()); | |
460 | + searchTeacherCourse.setTeacherName(teacherCourse.getTeacherName()); | |
461 | + searchTeacherCourse.setSingleOrDouble(singleOrDouble); | |
462 | + searchTeacherCourse.setWeek(week); | |
463 | + searchTeacherCourse.setCourseName(teacherCourse.getCourseName()); | |
464 | + //查询当天老师的课是否已经大于等于2 防止老师一天课程太多 | |
465 | + int dayCourse = teacherCourseService.selectTeacherDayCourseNumber(searchTeacherCourse); | |
466 | + if(dayCourse >= 2){ | |
467 | + break; | |
468 | + } | |
469 | + searchTeacherCourse.setCourseNumber(courseNumber); | |
470 | + TeacherCourse teacherFirst = teacherCourseService.selectTeacherCourse(searchTeacherCourse); | |
471 | + searchTeacherCourse.setCourseNumber(courseNumber+1); | |
472 | + TeacherCourse teacherSecond = teacherCourseService.selectTeacherCourse(searchTeacherCourse); | |
473 | + if (StringUtils.isBlank(teacherFirst.getCourseName()) && StringUtils.isBlank(teacherSecond.getCourseName())) { | |
474 | + classCourseService.updateByPrimaryKey(classCourse); | |
475 | + classCourseService.updateByPrimaryKey(classCourseNext); | |
476 | + teacherFirst.setCourseName(teacherCourse.getCourseName()); | |
477 | + teacherFirst.setClassId(classCourse.getClassId()+""); | |
478 | + teacherSecond.setCourseName(teacherCourse.getCourseName()); | |
479 | + teacherSecond.setClassId(classCourse.getClassId()+""); | |
480 | + teacherCourseService.updateTeacherCourse(teacherFirst); | |
481 | + teacherCourseService.updateTeacherCourse(teacherSecond); | |
482 | + times = times + 2; | |
483 | + reSort(sort,courseNumber); | |
484 | + reSort(sort,courseNumber+1); | |
485 | + reSort(joinList,week); | |
486 | + joinTimes++ ; | |
487 | + break; | |
488 | + } else { | |
489 | + continue; | |
490 | + } | |
491 | + } | |
492 | + } | |
493 | + } | |
494 | + //单节课 | |
495 | + int before = 0 ; | |
496 | + for(int week = 1 ; week <= 5 ; week++){ | |
497 | + if(times == teacherClass.getTimes()){ | |
498 | + break; | |
499 | + } | |
500 | + if(before > 0){ | |
501 | + sort = reSort(sort,before); | |
502 | + } | |
503 | + for(int i = 0 ; i < sort.size() ; i++){ | |
504 | + int courseNumber = sort.get(i); | |
505 | + ClassCourse classCourse = getClassCourse(list,week,courseNumber); | |
506 | + boolean flag = false ; | |
507 | + //去判断 查出的classCourse 是否在limitList | |
508 | + for(ClassCourse temp : limitList){ | |
509 | + if(temp.getWeek() == classCourse.getWeek() && | |
510 | + temp.getCourseNumber() == classCourse.getCourseNumber()){ | |
511 | + flag = true ; | |
512 | + break; | |
513 | + } | |
514 | + } | |
515 | + if(flag){ | |
516 | + if(StringUtils.isBlank(classCourse.getCourseName())){ | |
517 | + Course course = courseService.selectBySchoolIdAndCourseName(teacherClass.getSchoolId(),teacherClass.getCourseName()); | |
518 | + classCourse.setCourseOpenId(course.getCourseId()); | |
519 | + classCourse.setCourseName(teacherClass.getCourseName()); | |
520 | + //判断当天是否已经排该课程 | |
521 | + if(classCourseService.selectCourseByClassIdAndWeek(classCourse) > 0){ | |
522 | + break; | |
523 | + } | |
524 | + TeacherCourse searchTeacherCourse = new TeacherCourse(); | |
525 | + searchTeacherCourse.setTeam(team); | |
526 | + searchTeacherCourse.setSchoolId(teacherCourse.getSchoolId()); | |
527 | + searchTeacherCourse.setGrade(teacherCourse.getGrade()); | |
528 | + searchTeacherCourse.setTeacherName(teacherCourse.getTeacherName()); | |
529 | + searchTeacherCourse.setSingleOrDouble(singleOrDouble); | |
530 | + searchTeacherCourse.setWeek(week); | |
531 | + searchTeacherCourse.setCourseNumber(courseNumber); | |
532 | + searchTeacherCourse.setCourseName(teacherClass.getCourseName()); | |
533 | + TeacherCourse result = teacherCourseService.selectTeacherCourse(searchTeacherCourse); | |
534 | + //老师当天课程不能多于2 | |
535 | + if(teacherCourseService.selectTeacherDayCourseNumber(searchTeacherCourse) >= 2){ | |
536 | + break; | |
537 | + } | |
538 | + //合课 多做一层判断 另一个班级这节课也为空 | |
539 | + JoinClass joinClass = new JoinClass(); | |
540 | + joinClass.setSchoolId(classCourse.getSchoolId()); | |
541 | + joinClass.setTeam(classCourse.getTeam()); | |
542 | + joinClass.setCourseId(classCourse.getCourseOpenId()); | |
543 | + joinClass.setClassId(classCourse.getClassId()); | |
544 | + List<JoinClass> joinClasses = joinClassService.selectByCourse(joinClass); | |
545 | + if(joinClasses != null && joinClasses.size() > 0){ | |
546 | + //说明是合班的课程 | |
547 | + boolean isClash = false ; | |
548 | + List<ClassCourse> joinClassList = new ArrayList<>(); | |
549 | + List<JoinClass> resultList = joinClassService.selectByCourseGroup(joinClasses.get(0).getCourseGroup()); | |
550 | + for(JoinClass temp : resultList){ | |
551 | + ClassCourse joinClassCourse = new ClassCourse(); | |
552 | + joinClassCourse.setTeam(classCourse.getTeam()); | |
553 | + joinClassCourse.setClassId(temp.getClassId()); | |
554 | + joinClassCourse.setWeek(classCourse.getWeek()); | |
555 | + joinClassCourse.setCourseNumber(classCourse.getCourseNumber()); | |
556 | + joinClassCourse.setSingleOrDouble(classCourse.getSingleOrDouble()); | |
557 | + ClassCourse joinResultClassCourse = classCourseService.selectClassCourse(joinClassCourse); | |
558 | + joinClassList.add(joinResultClassCourse); | |
559 | + if(StringUtils.isNotBlank(joinResultClassCourse.getCourseName())){ | |
560 | + isClash = true ; | |
561 | + break; | |
562 | + } | |
563 | + } | |
564 | + if(isClash){ | |
565 | + //合班的班级有 该节次的课 已经有老师上了 | |
566 | + continue; | |
567 | + }else { | |
568 | + String classIdString = ""; | |
569 | + for(ClassCourse temp : joinClassList){ | |
570 | + classIdString = course.getCourseId() + "," ; | |
571 | + temp.setCourseOpenId(course.getCourseId()); | |
572 | + temp.setCourseName(teacherClass.getCourseName()); | |
573 | + classCourseService.updateByPrimaryKey(temp); | |
574 | + } | |
575 | + result.setGrade(classCourse.getGrade()); | |
576 | + result.setClassId(classIdString); | |
577 | + result.setCourseName(classCourse.getCourseName()); | |
578 | + teacherCourseService.updateTeacherCourse(result); | |
579 | + times++; | |
580 | + before = courseNumber; | |
581 | + break; | |
582 | + } | |
583 | + }else { | |
584 | + //普通课程 | |
585 | + if(StringUtils.isBlank(result.getCourseName())){ | |
586 | + classCourseService.updateByPrimaryKey(classCourse); | |
587 | + result.setGrade(classCourse.getGrade()); | |
588 | + result.setClassId(classCourse.getClassId()+""); | |
589 | + result.setCourseName(classCourse.getCourseName()); | |
590 | + teacherCourseService.updateTeacherCourse(result); | |
591 | + times++; | |
592 | + before = courseNumber; | |
593 | + break; | |
594 | + }else { | |
595 | + continue; | |
596 | + } | |
597 | + } | |
598 | + } | |
599 | + } | |
600 | + } | |
601 | + } | |
602 | + if(functionTimes > 1){ | |
603 | + //递归次数限制,防止无限循环,内存溢出,手动优化课程 | |
604 | + optimizeCourse(teacherClass); | |
605 | + }else{ | |
606 | + if(times < teacherClass.getTimes()){ | |
607 | + //优先时段中课程数 不够 | |
608 | + teacherClass.setTimes(teacherClass.getTimes()-times); | |
609 | + teacherClass.setJoinTimes(teacherClass.getJoinTimes()-joinTimes); | |
610 | + //放大范围 | |
611 | + limitList = new ArrayList<>(); | |
612 | + int maxCourseNumber =classCourseService.selectMaxCourseNumber(teacherClass.getSchoolId(),team); | |
613 | + for(int i = 1 ; i<= 5 ; i++){ | |
614 | + for(int j = 1 ; j <=maxCourseNumber ; j++) { | |
615 | + ClassCourse temp = new ClassCourse(); | |
616 | + temp.setWeek(i); | |
617 | + temp.setCourseNumber(j); | |
618 | + limitList.add(temp); | |
619 | + } | |
620 | + } | |
621 | + functionTimes ++ ; | |
622 | + initWeekCourse(joinList,teacherClass,teacherCourse,list,limitList,functionTimes); | |
623 | + } | |
624 | + } | |
625 | + } | |
626 | + | |
627 | + //课程冲突 ,调优 | |
628 | + private void optimizeCourse(TeacherClass teacherClass){ | |
629 | + int times = teacherClass.getTimes(); | |
630 | + while (times > 0){ | |
631 | + boolean flag = false ; | |
632 | + List<ClassCourse> noClassList = classCourseService.selectNoCourse(teacherClass.getClassId(),teacherClass.getTeam()); | |
633 | + for(ClassCourse classCourse : noClassList){ | |
634 | + for(int i = -2 ; i <= 2 ; i++){ | |
635 | + int weekChange = classCourse.getWeek()+i ; | |
636 | + if(weekChange > 5){ | |
637 | + weekChange = weekChange - 5; | |
638 | + } | |
639 | + if(weekChange < 1){ | |
640 | + weekChange = weekChange + 5; | |
641 | + } | |
642 | + List<ClassCourse> list = classCourseService.selectWeekCourse(classCourse.getClassId(),weekChange,classCourse.getSingleOrDouble(),teacherClass.getCourseName(),teacherClass.getTeam()); | |
643 | + if(list.size() > 0){ | |
644 | + continue; | |
645 | + } | |
646 | + for(int j = -1 ; j<=1 ; j++){ | |
647 | + int courseNumberChange = classCourse.getCourseNumber() + j ; | |
648 | + if(courseNumberChange > classCourseService.selectMaxCourseNumber(teacherClass.getSchoolId(),teacherClass.getTeam())){ | |
649 | + continue; | |
650 | + } | |
651 | + if(courseNumberChange < 1){ | |
652 | + continue; | |
653 | + } | |
654 | + if(changeClass(classCourse,teacherClass,weekChange,courseNumberChange)){ | |
655 | + flag = true; | |
656 | + break; | |
657 | + } | |
658 | + } | |
659 | + if(flag){ | |
660 | + break; | |
661 | + } | |
662 | + } | |
663 | + if(flag){ | |
664 | + break; | |
665 | + } | |
666 | + } | |
667 | + if(flag){ | |
668 | + times-- ; | |
669 | + } | |
670 | + } | |
671 | + } | |
672 | + | |
673 | + private boolean changeClass(ClassCourse classCourse , TeacherClass teacherClass , int weekChange ,int courseNumberChange){ | |
674 | + String team = classCourse.getTeam(); | |
675 | + int week = classCourse.getWeek(); | |
676 | + int courseNumber = classCourse.getCourseNumber(); | |
677 | + ClassCourse searchClass = new ClassCourse(); | |
678 | + searchClass.setSingleOrDouble(classCourse.getSingleOrDouble()); | |
679 | + searchClass.setClassId(classCourse.getClassId()); | |
680 | + searchClass.setWeek(weekChange); | |
681 | + searchClass.setCourseNumber(courseNumberChange); | |
682 | + searchClass.setTeam(team); | |
683 | + ClassCourse nextClass = classCourseService.selectClassCourse(searchClass); | |
684 | + if(StringUtils.isBlank(nextClass.getCourseName())){ | |
685 | + //替换的课 本来就没课 | |
686 | + String className =teacherClass.getCourseName(); | |
687 | + String nextNameClass = nextClass.getCourseName(); | |
688 | + classCourse.setCourseOpenId(courseService.selectBySchoolIdAndCourseName(classCourse.getSchoolId(),nextNameClass).getCourseId()); | |
689 | + classCourse.setCourseName(nextNameClass); | |
690 | + nextClass.setCourseOpenId(courseService.selectBySchoolIdAndCourseName(classCourse.getSchoolId(),className).getCourseId()); | |
691 | + nextClass.setCourseName(className); | |
692 | + classCourseService.updateByPrimaryKey(classCourse); | |
693 | + classCourseService.updateByPrimaryKey(nextClass); | |
694 | + | |
695 | + TeacherCourse teacherCourse = new TeacherCourse(); | |
696 | + teacherCourse.setTeam(team); | |
697 | + teacherCourse.setSchoolId(classCourse.getSchoolId()); | |
698 | + teacherCourse.setSingleOrDouble(classCourse.getSingleOrDouble()); | |
699 | + teacherCourse.setGrade(classCourse.getGrade()); | |
700 | + teacherCourse.setWeek(weekChange); | |
701 | + teacherCourse.setCourseNumber(courseNumberChange); | |
702 | + teacherCourse.setCourseName(className); | |
703 | + teacherCourse.setTeacherName(teacherClass.getTeacherName()); | |
704 | + teacherCourse.setClassId(classCourse.getClassId()+""); | |
705 | + teacherCourseService.updateTeacherCourse(teacherCourse); | |
706 | + return true ; | |
707 | + }else { | |
708 | + //增加判断 不排课的课程不能替换 合班的课程不能替换 联课的可能不能替换 | |
709 | + JoinClass joinClass = new JoinClass(); | |
710 | + joinClass.setSchoolId(nextClass.getSchoolId()); | |
711 | + joinClass.setTeam(nextClass.getTeam()); | |
712 | + joinClass.setCourseId(nextClass.getCourseId()); | |
713 | + joinClass.setClassId(nextClass.getClassId()); | |
714 | + List<JoinClass> joinClasses = joinClassService.selectByCourse(joinClass); | |
715 | + boolean joinClassFlag = joinClasses != null && joinClasses.size() > 0 ; | |
716 | + TeacherClass searchTeacherClass = new TeacherClass(); | |
717 | + searchTeacherClass.setSchoolId(nextClass.getSchoolId()); | |
718 | + searchTeacherClass.setTeam(nextClass.getTeam()); | |
719 | + searchTeacherClass.setCourseName(nextClass.getCourseName()); | |
720 | + List<TeacherClass> teacherClasses = teacherClassService.selectByCourseName(searchTeacherClass); | |
721 | + boolean joinTimesFlag = teacherClasses.get(0).getJoinTimes()>0?true:false; | |
722 | + if(nextClass.getCourseName().equals("不排课") || joinClassFlag || joinTimesFlag){ | |
723 | + //这些课 不能替换 | |
724 | + }else { | |
725 | + TeacherClass replaceClassTeacher = new TeacherClass(); | |
726 | + replaceClassTeacher.setSchoolId(classCourse.getSchoolId()); | |
727 | + replaceClassTeacher.setGrade(classCourse.getGrade()); | |
728 | + replaceClassTeacher.setClassId(classCourse.getClassId()); | |
729 | + replaceClassTeacher.setCourseName(nextClass.getCourseName()); | |
730 | + replaceClassTeacher.setTeam(team); | |
731 | + String nextTeacher = teacherClassService.selectByCourseAndClass(replaceClassTeacher).getTeacherName(); | |
732 | + | |
733 | + //原课的老师 下一节课是否有课 ;下一节课的老师 上一节是否有课 | |
734 | + TeacherCourse searchTeacher = new TeacherCourse(); | |
735 | + searchTeacher.setSchoolId(classCourse.getSchoolId()); | |
736 | + searchTeacher.setSingleOrDouble(classCourse.getSingleOrDouble()); | |
737 | + searchTeacher.setTeacherName(teacherClass.getTeacherName()); | |
738 | + searchTeacher.setWeek(weekChange); | |
739 | + searchTeacher.setCourseNumber(courseNumberChange); | |
740 | + searchTeacher.setTeam(team); | |
741 | + TeacherCourse teacherCourse = teacherCourseService.selectTeacherCourse(searchTeacher); | |
742 | + | |
743 | + TeacherCourse nextTeacherCourseSearch = new TeacherCourse(); | |
744 | + nextTeacherCourseSearch.setSchoolId(classCourse.getSchoolId()); | |
745 | + nextTeacherCourseSearch.setSingleOrDouble(classCourse.getSingleOrDouble()); | |
746 | + nextTeacherCourseSearch.setTeacherName(nextTeacher); | |
747 | + nextTeacherCourseSearch.setWeek(week); | |
748 | + nextTeacherCourseSearch.setCourseNumber(courseNumber); | |
749 | + nextTeacherCourseSearch.setTeam(team); | |
750 | + TeacherCourse nextTeacherCourse = teacherCourseService.selectTeacherCourse(nextTeacherCourseSearch); | |
751 | + if(StringUtils.isBlank(nextTeacherCourse.getCourseName()) && StringUtils.isBlank(teacherCourse.getCourseName())){ | |
752 | + //则上下替换课程 班级课程上下替换,老师课程交换 | |
753 | + String className =teacherClass.getCourseName(); | |
754 | + String nextClassName = nextClass.getCourseName(); | |
755 | + classCourse.setCourseName(nextClassName); | |
756 | + nextClass.setCourseName(className); | |
757 | + classCourseService.updateByPrimaryKey(classCourse); | |
758 | + classCourseService.updateByPrimaryKey(nextClass); | |
759 | + | |
760 | + teacherCourse.setGrade(teacherClass.getGrade()); | |
761 | + teacherCourse.setCourseName(className); | |
762 | + teacherCourse.setClassId(teacherClass.getClassId()+""); | |
763 | + teacherCourseService.updateTeacherCourse(teacherCourse); | |
764 | + | |
765 | + nextTeacherCourse.setGrade(nextClass.getGrade()); | |
766 | + nextTeacherCourse.setCourseName(nextClassName); | |
767 | + nextTeacherCourse.setClassId(nextClass.getClassId()+""); | |
768 | + teacherCourseService.updateTeacherCourse(nextTeacherCourse); | |
769 | + | |
770 | + nextTeacherCourse.setWeek(weekChange); | |
771 | + nextTeacherCourse.setCourseNumber(courseNumberChange); | |
772 | + nextTeacherCourse.setCourseName(null); | |
773 | + nextTeacherCourse.setClassId(null); | |
774 | + teacherCourseService.updateTeacherCourse(nextTeacherCourse); | |
775 | + return true ; | |
776 | + } | |
777 | + } | |
778 | + } | |
779 | + return false ; | |
780 | + } | |
781 | + | |
782 | + //所谓权重 节次优先级 | |
783 | + private List<Integer> reSort(List<Integer> list , int number){ | |
784 | + int index = -1 ; | |
785 | + for(Integer i = 0 ; i < list.size() ;i++){ | |
786 | + if(list.get(i) == number){ | |
787 | + index = i ; | |
788 | + break ; | |
789 | + } | |
790 | + } | |
791 | + list.remove(index); | |
792 | + list.add(number); | |
793 | + return list ; | |
794 | + } | |
795 | + | |
796 | + //查所在课表中 返回某天某节课 | |
797 | + private ClassCourse getClassCourse(List<ClassCourse> list , int week , int courseNumber){ | |
798 | + ClassCourse result = null ; | |
799 | + for(ClassCourse classCourse : list){ | |
800 | + if(classCourse.getWeek() == week && classCourse.getCourseNumber() == courseNumber){ | |
801 | + result = classCourse ; | |
802 | + break; | |
803 | + } | |
804 | + } | |
805 | + return result; | |
806 | + } | |
807 | + | |
808 | + //生成教师排课表 | |
809 | + private void insertTeacherCourse(boolean isDouble , TeacherCourse teacherCourse){ | |
810 | + List<TeacherCourse> list = new ArrayList<>(); | |
811 | + //单周课表必生成 | |
812 | + list.addAll(createWeekTeacherCourse(teacherCourse,false)); | |
813 | + if(isDouble){ | |
814 | + list.addAll(createWeekTeacherCourse(teacherCourse,true)); | |
815 | + } | |
816 | + teacherCourseService.insertBatch(list); | |
817 | + } | |
818 | + | |
819 | + // 创建教师 周课表 单周isDouble false 双周isDouble true | |
820 | + private List<TeacherCourse> createWeekTeacherCourse(TeacherCourse teacherCourse , boolean isDouble){ | |
821 | + int singleOrDouble = 1 ; | |
822 | + if(isDouble){ | |
823 | + singleOrDouble = 2; | |
824 | + } | |
825 | + Date date =new Date(); | |
826 | + List<TeacherCourse> list = new ArrayList<>(); | |
827 | + int courseNumMax = classCourseService.selectMaxCourseNumber(teacherCourse.getSchoolId(),teacherCourse.getTeam()); | |
828 | + for (int i = 1; i <= 7; i++) { | |
829 | + for(int j = 1 ; j <= courseNumMax ; j++){ | |
830 | + TeacherCourse temp = new TeacherCourse() ; | |
831 | + temp.setTeam(teacherCourse.getTeam()); | |
832 | + temp.setSchoolId(teacherCourse.getSchoolId()); | |
833 | + temp.setClassId(teacherCourse.getClassId()); | |
834 | + temp.setGrade(teacherCourse.getGrade()); | |
835 | + temp.setTeacherName(teacherCourse.getTeacherName()); | |
836 | + temp.setWeek(i); | |
837 | + temp.setCourseNumber(j); | |
838 | + temp.setCreateTime(date); | |
839 | + temp.setSingleOrDouble(singleOrDouble); | |
840 | + list.add(temp); | |
841 | + } | |
842 | + } | |
843 | + return list ; | |
844 | + } | |
845 | + | |
846 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/filter/AllowOriginFilter.java | |
... | ... | @@ -0,0 +1,38 @@ |
1 | +package com.jevon.filter; | |
2 | + | |
3 | +import org.springframework.stereotype.Component; | |
4 | + | |
5 | +import javax.servlet.*; | |
6 | +import javax.servlet.annotation.WebFilter; | |
7 | +import javax.servlet.http.HttpServletResponse; | |
8 | +import java.io.IOException; | |
9 | + | |
10 | +/** | |
11 | + * 用于解决跨域问题 | |
12 | + * @author chen | |
13 | + * @version 1.0 | |
14 | + * @date 2019/10/11 0011 10:17 | |
15 | + */ | |
16 | +@Component | |
17 | +@WebFilter(urlPatterns = "/*", filterName = "authFilter") | |
18 | +public class AllowOriginFilter implements Filter { | |
19 | + | |
20 | + @Override | |
21 | + public void init(FilterConfig filterConfig) throws ServletException { | |
22 | + } | |
23 | + | |
24 | + public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { | |
25 | + HttpServletResponse response = (HttpServletResponse) res; | |
26 | + response.setHeader("Access-Control-Allow-Origin", "*"); | |
27 | + response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); | |
28 | + response.setHeader("Access-Control-Allow-Credentials", "true"); | |
29 | + response.setHeader("Access-Control-Allow-Headers","Origin, X-Requested-With, Content-Type, Accept"); | |
30 | + chain.doFilter(req, res); | |
31 | + } | |
32 | + | |
33 | + @Override | |
34 | + public void destroy() { | |
35 | + } | |
36 | +} | |
37 | + | |
38 | + | ... | ... |
1 | +++ a/src/main/java/com/jevon/mapper/ClassCourseMapper.java | |
... | ... | @@ -0,0 +1,36 @@ |
1 | +package com.jevon.mapper; | |
2 | + | |
3 | +import com.jevon.model.ClassCourse; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +public interface ClassCourseMapper { | |
8 | + | |
9 | + int updateByPrimaryKey(ClassCourse record); | |
10 | + | |
11 | + int insertBatch(List<ClassCourse> list); | |
12 | + | |
13 | + ClassCourse selectClassCourse(ClassCourse classCourse); | |
14 | + | |
15 | + int selectSingleOrDouble(ClassCourse classCourse); | |
16 | + | |
17 | + int selectMaxCourseNumber(ClassCourse classCourse); | |
18 | + | |
19 | + List<ClassCourse> selectByClassIdAndSingleOrDouble(ClassCourse classCourse); | |
20 | + | |
21 | + List<ClassCourse> selectCourseByClassIdAndWeek(ClassCourse classCourse); | |
22 | + | |
23 | + int updatePublicOreElective(ClassCourse classCourse); | |
24 | + | |
25 | + List<ClassCourse> selectNoCourse(ClassCourse classCourse); | |
26 | + | |
27 | + List<ClassCourse> selectWeekCourse(ClassCourse classCourse); | |
28 | + | |
29 | + List<ClassCourse> selectClassCourseByClass(ClassCourse classCourse); | |
30 | + | |
31 | + int deleteBySchoolIdAndTeam(ClassCourse classCourse); | |
32 | + | |
33 | + int recallClassCourse(ClassCourse classCourse); | |
34 | + | |
35 | + List<ClassCourse> copyClassCourse(ClassCourse classCourse); | |
36 | +} | |
0 | 37 | \ No newline at end of file | ... | ... |
1 | +++ a/src/main/java/com/jevon/mapper/ClassModelMapper.java | |
... | ... | @@ -0,0 +1,22 @@ |
1 | +package com.jevon.mapper; | |
2 | + | |
3 | +import com.jevon.model.ClassModel; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +public interface ClassModelMapper { | |
8 | + | |
9 | + ClassModel selectByPrimaryKey(Integer classId); | |
10 | + | |
11 | + int updateByPrimaryKey(ClassModel record); | |
12 | + | |
13 | + List<ClassModel> selectBySchoolId(int schoolId); | |
14 | + | |
15 | + int insertBatch(List<ClassModel> list); | |
16 | + | |
17 | + ClassModel selectBySchoolIdAndClassNameAndGrade(ClassModel classModel); | |
18 | + | |
19 | + List<ClassModel> selectBySchoolIdAndGrade(ClassModel classModel); | |
20 | + | |
21 | + int deleteSchool(int schoolId); | |
22 | +} | |
0 | 23 | \ No newline at end of file | ... | ... |
1 | +++ a/src/main/java/com/jevon/mapper/CourseMapper.java | |
... | ... | @@ -0,0 +1,25 @@ |
1 | +package com.jevon.mapper; | |
2 | + | |
3 | +import com.jevon.model.Course; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * @author chen | |
9 | + * @version 1.0 | |
10 | + * @date 2019/10/9 0009 9:40 | |
11 | + */ | |
12 | +public interface CourseMapper { | |
13 | + | |
14 | + int insertBatch(List<Course> list); | |
15 | + | |
16 | + List<Course> selectBySchoolId(int schoolId); | |
17 | + | |
18 | + List<Course> selectByCourse(Course course); | |
19 | + | |
20 | + int updateCourseType(Course course); | |
21 | + | |
22 | + int deleteSchoolId(int schoolId); | |
23 | + | |
24 | + int initSchoolId(int schoolId); | |
25 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/mapper/JoinClassMapper.java | |
... | ... | @@ -0,0 +1,25 @@ |
1 | +package com.jevon.mapper; | |
2 | + | |
3 | +import com.jevon.model.JoinClass; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * @author chen | |
9 | + * @version 1.0 | |
10 | + * @date 2019/10/10 0010 8:29 | |
11 | + */ | |
12 | +public interface JoinClassMapper { | |
13 | + | |
14 | + int insertBatch(List<JoinClass> list); | |
15 | + | |
16 | + Integer selectMaxGroup(); | |
17 | + | |
18 | + List<JoinClass> selectByCourse(JoinClass joinClass); | |
19 | + | |
20 | + List<JoinClass> selectByCourseGroup(int courseGroup); | |
21 | + | |
22 | + int deleteCourseGroup(int courseGroup); | |
23 | + | |
24 | + int deleteBySchoolIdAndTeam(JoinClass joinClass); | |
25 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/mapper/ScheduleMapper.java | |
... | ... | @@ -0,0 +1,29 @@ |
1 | +package com.jevon.mapper; | |
2 | + | |
3 | +import com.jevon.model.Schedule; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * @author chen | |
9 | + * @version 1.0 | |
10 | + * @date 2019/10/10 0010 11:19 | |
11 | + */ | |
12 | +public interface ScheduleMapper { | |
13 | + | |
14 | + int insert(Schedule schedule); | |
15 | + | |
16 | + List<Schedule> selectBySchool(int schoolId); | |
17 | + | |
18 | + int updateSpeed(Schedule schedule); | |
19 | + | |
20 | + Schedule selectById(int id); | |
21 | + | |
22 | + Schedule selectBySchoolAndTeam(Schedule schedule); | |
23 | + | |
24 | + int deleteBySchedule(int id); | |
25 | + | |
26 | + int updateZuoxi(Schedule schedule); | |
27 | + | |
28 | + int update(Schedule schedule); | |
29 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/mapper/TeacherClassMapper.java | |
... | ... | @@ -0,0 +1,33 @@ |
1 | +package com.jevon.mapper; | |
2 | + | |
3 | +import com.jevon.model.Teacher; | |
4 | +import com.jevon.model.TeacherClass; | |
5 | + | |
6 | +import java.util.List; | |
7 | + | |
8 | +public interface TeacherClassMapper { | |
9 | + | |
10 | + int insert(TeacherClass record); | |
11 | + | |
12 | + int updateByPrimaryKey(TeacherClass record); | |
13 | + | |
14 | + int insertBatch(List<TeacherClass> teacherClasses); | |
15 | + | |
16 | + List<TeacherClass> selectByCourseName(TeacherClass teacherClass); | |
17 | + | |
18 | + TeacherClass selectByTeacher(TeacherClass teacherClass); | |
19 | + | |
20 | + TeacherClass selectByCourseAndClass(TeacherClass teacherClass); | |
21 | + | |
22 | + List<TeacherClass> selectBySchoolAndTeam(TeacherClass teacherClass); | |
23 | + | |
24 | + int deleteBySchoolAndTeam(TeacherClass teacherClass); | |
25 | + | |
26 | + TeacherClass selectById(int tClassId); | |
27 | + | |
28 | + int updateSchedule(int tClassId); | |
29 | + | |
30 | + int selectHasSchedule(TeacherClass teacherClass); | |
31 | + | |
32 | + int recallTeacherClass(int tClassId); | |
33 | +} | |
0 | 34 | \ No newline at end of file | ... | ... |
1 | +++ a/src/main/java/com/jevon/mapper/TeacherCourseMapper.java | |
... | ... | @@ -0,0 +1,26 @@ |
1 | +package com.jevon.mapper; | |
2 | + | |
3 | +import com.jevon.model.TeacherCourse; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +public interface TeacherCourseMapper { | |
8 | + | |
9 | + int updateByPrimaryKey(TeacherCourse record); | |
10 | + | |
11 | + int insertBatch(List<TeacherCourse> list); | |
12 | + | |
13 | + int selectTeacherDayCourseNumber(TeacherCourse teacherCourse); | |
14 | + | |
15 | + TeacherCourse selectTeacherCourse(TeacherCourse teacherCourse); | |
16 | + | |
17 | + int updateTeacherCourse(TeacherCourse teacherCourse); | |
18 | + | |
19 | + int isCreateCourse(TeacherCourse teacherCourse); | |
20 | + | |
21 | + int deleteBySchoolIdAndTeam(TeacherCourse teacherCourse); | |
22 | + | |
23 | + int recallTeacherCourse(TeacherCourse teacherCourse); | |
24 | + | |
25 | + List<TeacherCourse> selectBySchoolIdAndTeam(TeacherCourse teacherCourse); | |
26 | +} | |
0 | 27 | \ No newline at end of file | ... | ... |
1 | +++ a/src/main/java/com/jevon/mapper/TeacherMapper.java | |
... | ... | @@ -0,0 +1,22 @@ |
1 | +package com.jevon.mapper; | |
2 | + | |
3 | +import com.jevon.model.Teacher; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * @author chen | |
9 | + * @version 1.0 | |
10 | + * @date 2019/10/9 0009 13:54 | |
11 | + */ | |
12 | +public interface TeacherMapper { | |
13 | + | |
14 | + | |
15 | + int insertBatch(List<Teacher> list); | |
16 | + | |
17 | + List<Teacher> selectBySchoolId(int schoolId); | |
18 | + | |
19 | + int deleteSchool(int schoolId); | |
20 | + | |
21 | + List<Teacher> selectByTeacher(Teacher teacher); | |
22 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/model/ClassCourse.java | |
... | ... | @@ -0,0 +1,125 @@ |
1 | +package com.jevon.model; | |
2 | + | |
3 | +import java.util.Date; | |
4 | + | |
5 | +public class ClassCourse { | |
6 | + private Integer courseId; | |
7 | + | |
8 | + private Integer schoolId; | |
9 | + | |
10 | + private String grade; | |
11 | + | |
12 | + private Integer classId; | |
13 | + | |
14 | + private Integer singleOrDouble; | |
15 | + | |
16 | + private Integer week; | |
17 | + | |
18 | + private Integer courseNumber; | |
19 | + | |
20 | + private String courseName; | |
21 | + | |
22 | + private Date createTime; | |
23 | + | |
24 | + private Date updateTime; | |
25 | + | |
26 | + private String team ; | |
27 | + | |
28 | + private int courseOpenId ; | |
29 | + | |
30 | + public Integer getCourseId() { | |
31 | + return courseId; | |
32 | + } | |
33 | + | |
34 | + public void setCourseId(Integer courseId) { | |
35 | + this.courseId = courseId; | |
36 | + } | |
37 | + | |
38 | + public Integer getSchoolId() { | |
39 | + return schoolId; | |
40 | + } | |
41 | + | |
42 | + public void setSchoolId(Integer schoolId) { | |
43 | + this.schoolId = schoolId; | |
44 | + } | |
45 | + | |
46 | + public String getGrade() { | |
47 | + return grade; | |
48 | + } | |
49 | + | |
50 | + public void setGrade(String grade) { | |
51 | + this.grade = grade; | |
52 | + } | |
53 | + | |
54 | + public Integer getClassId() { | |
55 | + return classId; | |
56 | + } | |
57 | + | |
58 | + public void setClassId(Integer classId) { | |
59 | + this.classId = classId; | |
60 | + } | |
61 | + | |
62 | + public Integer getSingleOrDouble() { | |
63 | + return singleOrDouble; | |
64 | + } | |
65 | + | |
66 | + public void setSingleOrDouble(Integer singleOrDouble) { | |
67 | + this.singleOrDouble = singleOrDouble; | |
68 | + } | |
69 | + | |
70 | + public Integer getWeek() { | |
71 | + return week; | |
72 | + } | |
73 | + | |
74 | + public void setWeek(Integer week) { | |
75 | + this.week = week; | |
76 | + } | |
77 | + | |
78 | + public Integer getCourseNumber() { | |
79 | + return courseNumber; | |
80 | + } | |
81 | + | |
82 | + public void setCourseNumber(Integer courseNumber) { | |
83 | + this.courseNumber = courseNumber; | |
84 | + } | |
85 | + | |
86 | + public String getCourseName() { | |
87 | + return courseName; | |
88 | + } | |
89 | + | |
90 | + public void setCourseName(String courseName) { | |
91 | + this.courseName = courseName == null ? null : courseName.trim(); | |
92 | + } | |
93 | + | |
94 | + public Date getCreateTime() { | |
95 | + return createTime; | |
96 | + } | |
97 | + | |
98 | + public void setCreateTime(Date createTime) { | |
99 | + this.createTime = createTime; | |
100 | + } | |
101 | + | |
102 | + public Date getUpdateTime() { | |
103 | + return updateTime; | |
104 | + } | |
105 | + | |
106 | + public void setUpdateTime(Date updateTime) { | |
107 | + this.updateTime = updateTime; | |
108 | + } | |
109 | + | |
110 | + public String getTeam() { | |
111 | + return team; | |
112 | + } | |
113 | + | |
114 | + public void setTeam(String team) { | |
115 | + this.team = team; | |
116 | + } | |
117 | + | |
118 | + public int getCourseOpenId() { | |
119 | + return courseOpenId; | |
120 | + } | |
121 | + | |
122 | + public void setCourseOpenId(int courseOpenId) { | |
123 | + this.courseOpenId = courseOpenId; | |
124 | + } | |
125 | +} | |
0 | 126 | \ No newline at end of file | ... | ... |
1 | +++ a/src/main/java/com/jevon/model/ClassModel.java | |
... | ... | @@ -0,0 +1,44 @@ |
1 | +package com.jevon.model; | |
2 | + | |
3 | +public class ClassModel { | |
4 | + private Integer classId; | |
5 | + | |
6 | + private Integer schoolId; | |
7 | + | |
8 | + private String grade; | |
9 | + | |
10 | + private String className; | |
11 | + | |
12 | + public Integer getClassId() { | |
13 | + return classId; | |
14 | + } | |
15 | + | |
16 | + public void setClassId(Integer classId) { | |
17 | + this.classId = classId; | |
18 | + } | |
19 | + | |
20 | + public Integer getSchoolId() { | |
21 | + return schoolId; | |
22 | + } | |
23 | + | |
24 | + public void setSchoolId(Integer schoolId) { | |
25 | + this.schoolId = schoolId; | |
26 | + } | |
27 | + | |
28 | + public String getGrade() { | |
29 | + return grade; | |
30 | + } | |
31 | + | |
32 | + public void setGrade(String grade) { | |
33 | + this.grade = grade; | |
34 | + } | |
35 | + | |
36 | + public String getClassName() { | |
37 | + return className; | |
38 | + } | |
39 | + | |
40 | + public void setClassName(String className) { | |
41 | + this.className = className == null ? null : className.trim(); | |
42 | + } | |
43 | + | |
44 | +} | |
0 | 45 | \ No newline at end of file | ... | ... |
1 | +++ a/src/main/java/com/jevon/model/Course.java | |
... | ... | @@ -0,0 +1,56 @@ |
1 | +package com.jevon.model; | |
2 | + | |
3 | +/** | |
4 | + * @author chen | |
5 | + * @version 1.0 | |
6 | + * @date 2019/10/9 0009 9:39 | |
7 | + */ | |
8 | +public class Course { | |
9 | + | |
10 | + private int id ; | |
11 | + private int schoolId ; | |
12 | + private int courseId ; | |
13 | + private String courseName ; | |
14 | + private int courseType; | |
15 | + | |
16 | + public int getCourseId() { | |
17 | + return courseId; | |
18 | + } | |
19 | + | |
20 | + public void setCourseId(int courseId) { | |
21 | + this.courseId = courseId; | |
22 | + } | |
23 | + | |
24 | + public String getCourseName() { | |
25 | + return courseName; | |
26 | + } | |
27 | + | |
28 | + public void setCourseName(String courseName) { | |
29 | + this.courseName = courseName; | |
30 | + } | |
31 | + | |
32 | + public int getId() { | |
33 | + return id; | |
34 | + } | |
35 | + | |
36 | + public void setId(int id) { | |
37 | + this.id = id; | |
38 | + } | |
39 | + | |
40 | + public int getSchoolId() { | |
41 | + return schoolId; | |
42 | + } | |
43 | + | |
44 | + public void setSchoolId(int schoolId) { | |
45 | + this.schoolId = schoolId; | |
46 | + } | |
47 | + | |
48 | + public int getCourseType() { | |
49 | + return courseType; | |
50 | + } | |
51 | + | |
52 | + public void setCourseType(int courseType) { | |
53 | + this.courseType = courseType; | |
54 | + } | |
55 | + | |
56 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/model/JoinClass.java | |
... | ... | @@ -0,0 +1,73 @@ |
1 | +package com.jevon.model; | |
2 | + | |
3 | +/** | |
4 | + * @author chen | |
5 | + * @version 1.0 | |
6 | + * @date 2019/10/10 0010 8:27 | |
7 | + */ | |
8 | +public class JoinClass { | |
9 | + | |
10 | + private int id ; | |
11 | + private int schoolId ; | |
12 | + private int classId ; | |
13 | + private String team ; | |
14 | + private int courseId ; | |
15 | + private String courseName ; | |
16 | + private int courseGroup ; | |
17 | + | |
18 | + public int getId() { | |
19 | + return id; | |
20 | + } | |
21 | + | |
22 | + public void setId(int id) { | |
23 | + this.id = id; | |
24 | + } | |
25 | + | |
26 | + public int getSchoolId() { | |
27 | + return schoolId; | |
28 | + } | |
29 | + | |
30 | + public void setSchoolId(int schoolId) { | |
31 | + this.schoolId = schoolId; | |
32 | + } | |
33 | + | |
34 | + public int getClassId() { | |
35 | + return classId; | |
36 | + } | |
37 | + | |
38 | + public void setClassId(int classId) { | |
39 | + this.classId = classId; | |
40 | + } | |
41 | + | |
42 | + public String getTeam() { | |
43 | + return team; | |
44 | + } | |
45 | + | |
46 | + public void setTeam(String team) { | |
47 | + this.team = team; | |
48 | + } | |
49 | + | |
50 | + public int getCourseId() { | |
51 | + return courseId; | |
52 | + } | |
53 | + | |
54 | + public void setCourseId(int courseId) { | |
55 | + this.courseId = courseId; | |
56 | + } | |
57 | + | |
58 | + public String getCourseName() { | |
59 | + return courseName; | |
60 | + } | |
61 | + | |
62 | + public void setCourseName(String courseName) { | |
63 | + this.courseName = courseName; | |
64 | + } | |
65 | + | |
66 | + public int getCourseGroup() { | |
67 | + return courseGroup; | |
68 | + } | |
69 | + | |
70 | + public void setCourseGroup(int courseGroup) { | |
71 | + this.courseGroup = courseGroup; | |
72 | + } | |
73 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/model/Schedule.java | |
... | ... | @@ -0,0 +1,101 @@ |
1 | +package com.jevon.model; | |
2 | + | |
3 | +import java.util.Date; | |
4 | + | |
5 | +/** | |
6 | + * @author chen | |
7 | + * @version 1.0 | |
8 | + * @date 2019/10/10 0010 11:17 | |
9 | + */ | |
10 | +public class Schedule { | |
11 | + private int id ; | |
12 | + private String scheduleName ; | |
13 | + private int schoolId ; | |
14 | + private String team ; | |
15 | + private Date createTime ; | |
16 | + private Date updateTime ; | |
17 | + private int speed ; | |
18 | + private int morning ; | |
19 | + private int afternoon; | |
20 | + private int night ; | |
21 | + | |
22 | + public int getId() { | |
23 | + return id; | |
24 | + } | |
25 | + | |
26 | + public void setId(int id) { | |
27 | + this.id = id; | |
28 | + } | |
29 | + | |
30 | + public String getScheduleName() { | |
31 | + return scheduleName; | |
32 | + } | |
33 | + | |
34 | + public void setScheduleName(String scheduleName) { | |
35 | + this.scheduleName = scheduleName; | |
36 | + } | |
37 | + | |
38 | + public int getSchoolId() { | |
39 | + return schoolId; | |
40 | + } | |
41 | + | |
42 | + public void setSchoolId(int schoolId) { | |
43 | + this.schoolId = schoolId; | |
44 | + } | |
45 | + | |
46 | + public String getTeam() { | |
47 | + return team; | |
48 | + } | |
49 | + | |
50 | + public void setTeam(String team) { | |
51 | + this.team = team; | |
52 | + } | |
53 | + | |
54 | + public Date getCreateTime() { | |
55 | + return createTime; | |
56 | + } | |
57 | + | |
58 | + public void setCreateTime(Date createTime) { | |
59 | + this.createTime = createTime; | |
60 | + } | |
61 | + | |
62 | + public Date getUpdateTime() { | |
63 | + return updateTime; | |
64 | + } | |
65 | + | |
66 | + public void setUpdateTime(Date updateTime) { | |
67 | + this.updateTime = updateTime; | |
68 | + } | |
69 | + | |
70 | + public int getSpeed() { | |
71 | + return speed; | |
72 | + } | |
73 | + | |
74 | + public void setSpeed(int speed) { | |
75 | + this.speed = speed; | |
76 | + } | |
77 | + | |
78 | + public int getMorning() { | |
79 | + return morning; | |
80 | + } | |
81 | + | |
82 | + public void setMorning(int morning) { | |
83 | + this.morning = morning; | |
84 | + } | |
85 | + | |
86 | + public int getAfternoon() { | |
87 | + return afternoon; | |
88 | + } | |
89 | + | |
90 | + public void setAfternoon(int afternoon) { | |
91 | + this.afternoon = afternoon; | |
92 | + } | |
93 | + | |
94 | + public int getNight() { | |
95 | + return night; | |
96 | + } | |
97 | + | |
98 | + public void setNight(int night) { | |
99 | + this.night = night; | |
100 | + } | |
101 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/model/Teacher.java | |
... | ... | @@ -0,0 +1,46 @@ |
1 | +package com.jevon.model; | |
2 | + | |
3 | +/** | |
4 | + * @author chen | |
5 | + * @version 1.0 | |
6 | + * @date 2019/10/9 0009 13:53 | |
7 | + */ | |
8 | +public class Teacher { | |
9 | + | |
10 | + private int id ; | |
11 | + private int schoolId ; | |
12 | + private int teacherId ; | |
13 | + private String teacherName ; | |
14 | + | |
15 | + public int getId() { | |
16 | + return id; | |
17 | + } | |
18 | + | |
19 | + public void setId(int id) { | |
20 | + this.id = id; | |
21 | + } | |
22 | + | |
23 | + public int getSchoolId() { | |
24 | + return schoolId; | |
25 | + } | |
26 | + | |
27 | + public void setSchoolId(int schoolId) { | |
28 | + this.schoolId = schoolId; | |
29 | + } | |
30 | + | |
31 | + public int getTeacherId() { | |
32 | + return teacherId; | |
33 | + } | |
34 | + | |
35 | + public void setTeacherId(int teacherId) { | |
36 | + this.teacherId = teacherId; | |
37 | + } | |
38 | + | |
39 | + public String getTeacherName() { | |
40 | + return teacherName; | |
41 | + } | |
42 | + | |
43 | + public void setTeacherName(String teacherName) { | |
44 | + this.teacherName = teacherName; | |
45 | + } | |
46 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/model/TeacherClass.java | |
... | ... | @@ -0,0 +1,125 @@ |
1 | +package com.jevon.model; | |
2 | + | |
3 | +import java.util.Date; | |
4 | + | |
5 | +public class TeacherClass { | |
6 | + private Integer tClassId; | |
7 | + | |
8 | + private Integer teacherId; | |
9 | + | |
10 | + private String teacherName; | |
11 | + | |
12 | + private Integer schoolId; | |
13 | + | |
14 | + private String grade; | |
15 | + | |
16 | + private Integer classId; | |
17 | + | |
18 | + private String courseName; | |
19 | + | |
20 | + private Integer times; | |
21 | + | |
22 | + private Integer joinTimes; | |
23 | + | |
24 | + private Date createTime; | |
25 | + | |
26 | + private String team ; | |
27 | + | |
28 | + private int status ; | |
29 | + | |
30 | + public Integer gettClassId() { | |
31 | + return tClassId; | |
32 | + } | |
33 | + | |
34 | + public void settClassId(Integer tClassId) { | |
35 | + this.tClassId = tClassId; | |
36 | + } | |
37 | + | |
38 | + public Integer getTeacherId() { | |
39 | + return teacherId; | |
40 | + } | |
41 | + | |
42 | + public void setTeacherId(Integer teacherId) { | |
43 | + this.teacherId = teacherId; | |
44 | + } | |
45 | + | |
46 | + public String getTeacherName() { | |
47 | + return teacherName; | |
48 | + } | |
49 | + | |
50 | + public void setTeacherName(String teacherName) { | |
51 | + this.teacherName = teacherName == null ? null : teacherName.trim(); | |
52 | + } | |
53 | + | |
54 | + public Integer getSchoolId() { | |
55 | + return schoolId; | |
56 | + } | |
57 | + | |
58 | + public void setSchoolId(Integer schoolId) { | |
59 | + this.schoolId = schoolId; | |
60 | + } | |
61 | + | |
62 | + public String getGrade() { | |
63 | + return grade; | |
64 | + } | |
65 | + | |
66 | + public void setGrade(String grade) { | |
67 | + this.grade = grade; | |
68 | + } | |
69 | + | |
70 | + public Integer getClassId() { | |
71 | + return classId; | |
72 | + } | |
73 | + | |
74 | + public void setClassId(Integer classId) { | |
75 | + this.classId = classId; | |
76 | + } | |
77 | + | |
78 | + public String getCourseName() { | |
79 | + return courseName; | |
80 | + } | |
81 | + | |
82 | + public void setCourseName(String courseName) { | |
83 | + this.courseName = courseName == null ? null : courseName.trim(); | |
84 | + } | |
85 | + | |
86 | + public Integer getTimes() { | |
87 | + return times; | |
88 | + } | |
89 | + | |
90 | + public void setTimes(Integer times) { | |
91 | + this.times = times; | |
92 | + } | |
93 | + | |
94 | + public Integer getJoinTimes() { | |
95 | + return joinTimes; | |
96 | + } | |
97 | + | |
98 | + public void setJoinTimes(Integer joinTimes) { | |
99 | + this.joinTimes = joinTimes; | |
100 | + } | |
101 | + | |
102 | + public Date getCreateTime() { | |
103 | + return createTime; | |
104 | + } | |
105 | + | |
106 | + public void setCreateTime(Date createTime) { | |
107 | + this.createTime = createTime; | |
108 | + } | |
109 | + | |
110 | + public String getTeam() { | |
111 | + return team; | |
112 | + } | |
113 | + | |
114 | + public void setTeam(String team) { | |
115 | + this.team = team; | |
116 | + } | |
117 | + | |
118 | + public int getStatus() { | |
119 | + return status; | |
120 | + } | |
121 | + | |
122 | + public void setStatus(int status) { | |
123 | + this.status = status; | |
124 | + } | |
125 | +} | |
0 | 126 | \ No newline at end of file | ... | ... |
1 | +++ a/src/main/java/com/jevon/model/TeacherCourse.java | |
... | ... | @@ -0,0 +1,117 @@ |
1 | +package com.jevon.model; | |
2 | + | |
3 | +import java.util.Date; | |
4 | + | |
5 | +public class TeacherCourse { | |
6 | + private Integer tClassId; | |
7 | + | |
8 | + private Integer schoolId; | |
9 | + | |
10 | + private String grade; | |
11 | + | |
12 | + private String teacherName; | |
13 | + | |
14 | + private Integer singleOrDouble; | |
15 | + | |
16 | + private Integer week; | |
17 | + | |
18 | + private Integer courseNumber; | |
19 | + | |
20 | + private String classId; | |
21 | + | |
22 | + private String courseName; | |
23 | + | |
24 | + private Date createTime; | |
25 | + | |
26 | + private String team ; | |
27 | + | |
28 | + public Integer gettClassId() { | |
29 | + return tClassId; | |
30 | + } | |
31 | + | |
32 | + public void settClassId(Integer tClassId) { | |
33 | + this.tClassId = tClassId; | |
34 | + } | |
35 | + | |
36 | + public Integer getSchoolId() { | |
37 | + return schoolId; | |
38 | + } | |
39 | + | |
40 | + public void setSchoolId(Integer schoolId) { | |
41 | + this.schoolId = schoolId; | |
42 | + } | |
43 | + | |
44 | + public String getGrade() { | |
45 | + return grade; | |
46 | + } | |
47 | + | |
48 | + public void setGrade(String grade) { | |
49 | + this.grade = grade; | |
50 | + } | |
51 | + | |
52 | + public String getTeacherName() { | |
53 | + return teacherName; | |
54 | + } | |
55 | + | |
56 | + public void setTeacherName(String teacherName) { | |
57 | + this.teacherName = teacherName == null ? null : teacherName.trim(); | |
58 | + } | |
59 | + | |
60 | + public Integer getSingleOrDouble() { | |
61 | + return singleOrDouble; | |
62 | + } | |
63 | + | |
64 | + public void setSingleOrDouble(Integer singleOrDouble) { | |
65 | + this.singleOrDouble = singleOrDouble; | |
66 | + } | |
67 | + | |
68 | + public Integer getWeek() { | |
69 | + return week; | |
70 | + } | |
71 | + | |
72 | + public void setWeek(Integer week) { | |
73 | + this.week = week; | |
74 | + } | |
75 | + | |
76 | + public Integer getCourseNumber() { | |
77 | + return courseNumber; | |
78 | + } | |
79 | + | |
80 | + public void setCourseNumber(Integer courseNumber) { | |
81 | + this.courseNumber = courseNumber; | |
82 | + } | |
83 | + | |
84 | + public String getClassId() { | |
85 | + return classId; | |
86 | + } | |
87 | + | |
88 | + public void setClassId(String classId) { | |
89 | + this.classId = classId; | |
90 | + } | |
91 | + | |
92 | + public String getCourseName() { | |
93 | + return courseName; | |
94 | + } | |
95 | + | |
96 | + public void setCourseName(String courseName) { | |
97 | + this.courseName = courseName == null ? null : courseName.trim(); | |
98 | + } | |
99 | + | |
100 | + public Date getCreateTime() { | |
101 | + return createTime; | |
102 | + } | |
103 | + | |
104 | + public void setCreateTime(Date createTime) { | |
105 | + this.createTime = createTime; | |
106 | + } | |
107 | + | |
108 | + public String getTeam() { | |
109 | + return team; | |
110 | + } | |
111 | + | |
112 | + public void setTeam(String team) { | |
113 | + this.team = team; | |
114 | + } | |
115 | + | |
116 | + | |
117 | +} | |
0 | 118 | \ No newline at end of file | ... | ... |
1 | +++ a/src/main/java/com/jevon/service/ClassCourseService.java | |
... | ... | @@ -0,0 +1,55 @@ |
1 | +package com.jevon.service; | |
2 | + | |
3 | +import com.jevon.model.ClassCourse; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * @author chen | |
9 | + * @version 1.0 | |
10 | + * @date 2019/9/24 0024 11:44 | |
11 | + */ | |
12 | +public interface ClassCourseService { | |
13 | + | |
14 | + int insertBatch(List<ClassCourse> classCourses); | |
15 | + | |
16 | + boolean insertSchoolClass(List<ClassCourse> classCourses); | |
17 | + | |
18 | + //通过 singleOrDouble , classId , week , courseNumber 获取某一天第几节课 | |
19 | + ClassCourse selectClassCourse(ClassCourse classCourse); | |
20 | + | |
21 | + int updateByPrimaryKey(ClassCourse record); | |
22 | + | |
23 | + //grade 获取该年段是单双周排课 boolean true 为双周 | |
24 | + boolean selectSingleOrDouble(ClassCourse classCourse); | |
25 | + | |
26 | + //获取每天课数 | |
27 | + int selectMaxCourseNumber(int schoolId , String team); | |
28 | + | |
29 | + //通过classID 单双周 获取该班课表 | |
30 | + List<ClassCourse> selectByClassIdAndSingleOrDouble(ClassCourse classCourse); | |
31 | + | |
32 | + //查询当前班某天是否已有某课 | |
33 | + int selectCourseByClassIdAndWeek(ClassCourse classCourse); | |
34 | + | |
35 | + //更新公共课以及选修课 | |
36 | + int updatePublicOreElective(ClassCourse classCourse); | |
37 | + | |
38 | + //查询未排课 | |
39 | + List<ClassCourse> selectNoCourse(int classId , String team); | |
40 | + | |
41 | + //查询改天 是否有某课 | |
42 | + List<ClassCourse> selectWeekCourse(int classId , int week , int singOrDouble , String courseName , String team); | |
43 | + | |
44 | + //查询不排课的课程 | |
45 | + List<ClassCourse> selectClassCourseByClass(ClassCourse classCourse); | |
46 | + | |
47 | + int deleteBySchoolIdAndTeam(int schoolId , String team); | |
48 | + | |
49 | + //撤回 | |
50 | + int recallClassCourse(ClassCourse classCourse); | |
51 | + | |
52 | + List<ClassCourse> copyClassCourse(int schoolId ,String team); | |
53 | + | |
54 | + | |
55 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/service/ClassModelService.java | |
... | ... | @@ -0,0 +1,25 @@ |
1 | +package com.jevon.service; | |
2 | + | |
3 | +import com.jevon.model.ClassModel; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * @author chen | |
9 | + * @version 1.0 | |
10 | + * @date 2019/9/25 0025 8:59 | |
11 | + */ | |
12 | +public interface ClassModelService { | |
13 | + | |
14 | + ClassModel selectByPrimaryKey(Integer classId); | |
15 | + | |
16 | + int insertBatch(List<ClassModel> list); | |
17 | + | |
18 | + ClassModel selectBySchoolIdAndClassNameAndGrade(ClassModel classModel); | |
19 | + | |
20 | + List<ClassModel> selectBySchoolId(int schoolId); | |
21 | + | |
22 | + List<ClassModel> selectBySchoolIdAndGrade(int schoolId , String grade); | |
23 | + | |
24 | + int deleteSchool(int schoolId); | |
25 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/service/CourseService.java | |
... | ... | @@ -0,0 +1,30 @@ |
1 | +package com.jevon.service; | |
2 | + | |
3 | +import com.jevon.model.Course; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * @author chen | |
9 | + * @version 1.0 | |
10 | + * @date 2019/10/9 0009 9:44 | |
11 | + */ | |
12 | +public interface CourseService { | |
13 | + | |
14 | + int insertBatch(List<Course> list); | |
15 | + | |
16 | + List<Course> selectBySchoolId(int schoolId); | |
17 | + | |
18 | + List<Course> selectByCourse(Course course); | |
19 | + | |
20 | + Course selectBySchoolIdAndCourseId(int schoolId , int courseId); | |
21 | + | |
22 | + Course selectBySchoolIdAndCourseName(int schoolId , String courseName); | |
23 | + | |
24 | + int updateCourseType(int courseId , int courseType , int schoolId); | |
25 | + | |
26 | + int deleteSchoolId(int schoolId); | |
27 | + | |
28 | + int initSchoolId(int schoolId); | |
29 | + | |
30 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/service/JoinClassService.java | |
... | ... | @@ -0,0 +1,23 @@ |
1 | +package com.jevon.service; | |
2 | + | |
3 | +import com.jevon.model.JoinClass; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * @author chen | |
9 | + * @version 1.0 | |
10 | + * @date 2019/10/10 0010 8:35 | |
11 | + */ | |
12 | +public interface JoinClassService { | |
13 | + | |
14 | + int insertBatch(List<JoinClass> list); | |
15 | + | |
16 | + List<JoinClass> selectByCourse(JoinClass joinClass); | |
17 | + | |
18 | + List<JoinClass> selectByCourseGroup(int courseGroup); | |
19 | + | |
20 | + int deleteBySchoolIdAndTeam(int schoolId , String team); | |
21 | + | |
22 | + int deleteCourseGroup(int courseGroup); | |
23 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/service/ScheduleService.java | |
... | ... | @@ -0,0 +1,29 @@ |
1 | +package com.jevon.service; | |
2 | + | |
3 | +import com.jevon.model.Schedule; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * @author chen | |
9 | + * @version 1.0 | |
10 | + * @date 2019/10/10 0010 11:26 | |
11 | + */ | |
12 | +public interface ScheduleService { | |
13 | + int insert(Schedule schedule); | |
14 | + | |
15 | + List<Schedule> selectBySchool(int schoolId); | |
16 | + | |
17 | + int updateSpeed(Schedule schedule); | |
18 | + | |
19 | + Schedule selectById(int id); | |
20 | + | |
21 | + Schedule selectBySchoolAndTeam(Schedule schedule); | |
22 | + | |
23 | + int deleteBySchedule(int id); | |
24 | + | |
25 | + int updateZuoxi(Schedule schedule); | |
26 | + | |
27 | + int update(Schedule schedule); | |
28 | + | |
29 | +} | ... | ... |
src/main/java/com/jevon/service/TeacherClassService.java
0 → 100644
1 | +++ a/src/main/java/com/jevon/service/TeacherClassService.java | |
... | ... | @@ -0,0 +1,38 @@ |
1 | +package com.jevon.service; | |
2 | + | |
3 | +import com.jevon.model.TeacherClass; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * @author chen | |
9 | + * @version 1.0 | |
10 | + * @date 2019/9/29 0029 11:04 | |
11 | + */ | |
12 | +public interface TeacherClassService { | |
13 | + | |
14 | + int insert(TeacherClass teacherClass); | |
15 | + | |
16 | + int insertBatch(List<TeacherClass> teacherClasses); | |
17 | + | |
18 | + List<TeacherClass> selectByCourseName(TeacherClass teacherClass); | |
19 | + | |
20 | + TeacherClass selectByTeacher(TeacherClass teacherClass); | |
21 | + | |
22 | + //通过学校 年段 班级 课程 获取对应授课老师 | |
23 | + TeacherClass selectByCourseAndClass(TeacherClass teacherClass); | |
24 | + | |
25 | + List<TeacherClass> selectBySchoolAndTeam(TeacherClass teacherClass); | |
26 | + | |
27 | + int deleteBySchoolAndTeam(TeacherClass teacherClass); | |
28 | + | |
29 | + TeacherClass selectById(int tClassId); | |
30 | + | |
31 | + int updateSchedule(int tClassId); | |
32 | + | |
33 | + //查询是否已排课 | |
34 | + int selectHasSchedule(int schoolId , String team); | |
35 | + | |
36 | + int recallTeacherClass(int tClassId); | |
37 | + | |
38 | +} | ... | ... |
src/main/java/com/jevon/service/TeacherCourseService.java
0 → 100644
1 | +++ a/src/main/java/com/jevon/service/TeacherCourseService.java | |
... | ... | @@ -0,0 +1,38 @@ |
1 | +package com.jevon.service; | |
2 | + | |
3 | +import com.jevon.model.TeacherCourse; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * @author chen | |
9 | + * @version 1.0 | |
10 | + * @date 2019/9/25 0025 14:45 | |
11 | + */ | |
12 | +public interface TeacherCourseService { | |
13 | + | |
14 | + int insertBatch(List<TeacherCourse> list); | |
15 | + | |
16 | + int updateByPrimaryKey(TeacherCourse record); | |
17 | + | |
18 | + //更新老师某一天某一节课 | |
19 | + int updateTeacherCourse(TeacherCourse teacherCourse); | |
20 | + | |
21 | + //查询老师某一天某一节课 | |
22 | + TeacherCourse selectTeacherCourse(TeacherCourse teacherCourse); | |
23 | + | |
24 | + //查询老师某一天课程数 | |
25 | + int selectTeacherDayCourseNumber(TeacherCourse teacherCourse); | |
26 | + | |
27 | + //查询老师是否已创建课表 | |
28 | + int isCreateCourse(TeacherCourse teacherCourse); | |
29 | + | |
30 | + //删除排课计划数据 | |
31 | + int deleteBySchoolIdAndTeam(int schoolId , String team); | |
32 | + | |
33 | + //撤回 | |
34 | + int recallTeacherCourse(TeacherCourse teacherCourse); | |
35 | + | |
36 | + List<TeacherCourse> selectBySchoolIdAndTeam(int schoolId , String team); | |
37 | + | |
38 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/service/TeacherService.java | |
... | ... | @@ -0,0 +1,22 @@ |
1 | +package com.jevon.service; | |
2 | + | |
3 | +import com.jevon.model.Teacher; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * @author chen | |
9 | + * @version 1.0 | |
10 | + * @date 2019/10/9 0009 13:56 | |
11 | + */ | |
12 | +public interface TeacherService { | |
13 | + | |
14 | + int insertBatch(List<Teacher> list); | |
15 | + | |
16 | + List<Teacher> selectBySchoolId(int schoolId); | |
17 | + | |
18 | + int deleteSchool(int schoolId); | |
19 | + | |
20 | + Teacher selectByTeacher(Teacher teacher); | |
21 | + | |
22 | +} | ... | ... |
src/main/java/com/jevon/service/impl/ClassCourseServiceImpl.java
0 → 100644
1 | +++ a/src/main/java/com/jevon/service/impl/ClassCourseServiceImpl.java | |
... | ... | @@ -0,0 +1,142 @@ |
1 | +package com.jevon.service.impl; | |
2 | + | |
3 | +import com.jevon.mapper.ClassCourseMapper; | |
4 | +import com.jevon.mapper.ClassModelMapper; | |
5 | +import com.jevon.model.ClassCourse; | |
6 | +import com.jevon.model.ClassModel; | |
7 | +import com.jevon.service.ClassCourseService; | |
8 | +import org.springframework.beans.factory.annotation.Autowired; | |
9 | +import org.springframework.stereotype.Service; | |
10 | + | |
11 | +import java.util.ArrayList; | |
12 | +import java.util.Date; | |
13 | +import java.util.List; | |
14 | + | |
15 | +/** | |
16 | + * @author chen | |
17 | + * @version 1.0 | |
18 | + * @date 2019/9/24 0024 11:45 | |
19 | + */ | |
20 | +@Service("classCourseService") | |
21 | +public class ClassCourseServiceImpl implements ClassCourseService { | |
22 | + | |
23 | + @Autowired | |
24 | + ClassCourseMapper classCourseMapper ; | |
25 | + | |
26 | + @Autowired | |
27 | + ClassModelMapper classModelMapper; | |
28 | + | |
29 | + @Override | |
30 | + public int insertBatch(List<ClassCourse> classCourses) { | |
31 | + int i = 0 ; | |
32 | + List<ClassCourse> result = new ArrayList<>(); | |
33 | + for(ClassCourse classCourse :classCourses){ | |
34 | + i++ ; | |
35 | + result.add(classCourse); | |
36 | + if(i % 100 == 0){ | |
37 | + classCourseMapper.insertBatch(result); | |
38 | + result = new ArrayList<>(); | |
39 | + } | |
40 | + } | |
41 | + classCourseMapper.insertBatch(result); | |
42 | + return 1; | |
43 | + } | |
44 | + | |
45 | + @Override | |
46 | + public boolean insertSchoolClass(List<ClassCourse> classCourses) { | |
47 | + List<ClassModel> classModels = classModelMapper.selectBySchoolId(classCourses.get(0).getSchoolId()); | |
48 | + Date date = new Date(); | |
49 | + for(ClassModel classModel : classModels){ | |
50 | + for(ClassCourse classCourse : classCourses){ | |
51 | + classCourse.setGrade(classModel.getGrade()); | |
52 | + classCourse.setClassId(classModel.getClassId()); | |
53 | + classCourse.setCreateTime(date); | |
54 | + } | |
55 | + classCourseMapper.insertBatch(classCourses); | |
56 | + } | |
57 | + return true; | |
58 | + } | |
59 | + | |
60 | + @Override | |
61 | + public ClassCourse selectClassCourse(ClassCourse classCourse) { | |
62 | + return classCourseMapper.selectClassCourse(classCourse); | |
63 | + } | |
64 | + | |
65 | + @Override | |
66 | + public int updateByPrimaryKey(ClassCourse record) { | |
67 | + return classCourseMapper.updateByPrimaryKey(record); | |
68 | + } | |
69 | + | |
70 | + @Override | |
71 | + public boolean selectSingleOrDouble(ClassCourse classCourse) { | |
72 | + return classCourseMapper.selectSingleOrDouble(classCourse) > 1 ; | |
73 | + } | |
74 | + | |
75 | + @Override | |
76 | + public int selectMaxCourseNumber(int schoolId , String team) { | |
77 | + ClassCourse classCourse = new ClassCourse(); | |
78 | + classCourse.setSchoolId(schoolId); | |
79 | + classCourse.setTeam(team); | |
80 | + return classCourseMapper.selectMaxCourseNumber(classCourse); | |
81 | + } | |
82 | + | |
83 | + @Override | |
84 | + public List<ClassCourse> selectByClassIdAndSingleOrDouble(ClassCourse classCourse) { | |
85 | + return classCourseMapper.selectByClassIdAndSingleOrDouble(classCourse); | |
86 | + } | |
87 | + | |
88 | + @Override | |
89 | + public int selectCourseByClassIdAndWeek(ClassCourse classCourse) { | |
90 | + return classCourseMapper.selectCourseByClassIdAndWeek(classCourse).size(); | |
91 | + } | |
92 | + | |
93 | + @Override | |
94 | + public int updatePublicOreElective(ClassCourse classCourse) { | |
95 | + return classCourseMapper.updatePublicOreElective(classCourse); | |
96 | + } | |
97 | + | |
98 | + @Override | |
99 | + public List<ClassCourse> selectNoCourse(int classId , String team) { | |
100 | + ClassCourse classCourse = new ClassCourse(); | |
101 | + classCourse.setClassId(classId); | |
102 | + classCourse.setTeam(team); | |
103 | + return classCourseMapper.selectNoCourse(classCourse); | |
104 | + } | |
105 | + | |
106 | + @Override | |
107 | + public List<ClassCourse> selectWeekCourse(int classId, int week, int singOrDouble, String courseName , String team) { | |
108 | + ClassCourse classCourse = new ClassCourse(); | |
109 | + classCourse.setClassId(classId); | |
110 | + classCourse.setWeek(week); | |
111 | + classCourse.setSingleOrDouble(singOrDouble); | |
112 | + classCourse.setCourseName(courseName); | |
113 | + classCourse.setTeam(team); | |
114 | + return classCourseMapper.selectWeekCourse(classCourse); | |
115 | + } | |
116 | + | |
117 | + @Override | |
118 | + public List<ClassCourse> selectClassCourseByClass(ClassCourse classCourse) { | |
119 | + return classCourseMapper.selectClassCourseByClass(classCourse); | |
120 | + } | |
121 | + | |
122 | + @Override | |
123 | + public int deleteBySchoolIdAndTeam(int schoolId, String team) { | |
124 | + ClassCourse classCourse = new ClassCourse(); | |
125 | + classCourse.setSchoolId(schoolId); | |
126 | + classCourse.setTeam(team); | |
127 | + return classCourseMapper.deleteBySchoolIdAndTeam(classCourse); | |
128 | + } | |
129 | + | |
130 | + @Override | |
131 | + public int recallClassCourse(ClassCourse classCourse) { | |
132 | + return classCourseMapper.recallClassCourse(classCourse); | |
133 | + } | |
134 | + | |
135 | + @Override | |
136 | + public List<ClassCourse> copyClassCourse(int schoolId ,String team) { | |
137 | + ClassCourse classCourse = new ClassCourse(); | |
138 | + classCourse.setSchoolId(schoolId); | |
139 | + classCourse.setTeam(team); | |
140 | + return classCourseMapper.copyClassCourse(classCourse); | |
141 | + } | |
142 | +} | ... | ... |
src/main/java/com/jevon/service/impl/ClassModelServiceImpl.java
0 → 100644
1 | +++ a/src/main/java/com/jevon/service/impl/ClassModelServiceImpl.java | |
... | ... | @@ -0,0 +1,54 @@ |
1 | +package com.jevon.service.impl; | |
2 | + | |
3 | +import com.jevon.mapper.ClassModelMapper; | |
4 | +import com.jevon.model.ClassModel; | |
5 | +import com.jevon.service.ClassModelService; | |
6 | +import org.springframework.beans.factory.annotation.Autowired; | |
7 | +import org.springframework.stereotype.Service; | |
8 | + | |
9 | +import java.util.List; | |
10 | + | |
11 | +/** | |
12 | + * @author chen | |
13 | + * @version 1.0 | |
14 | + * @date 2019/9/25 0025 9:00 | |
15 | + */ | |
16 | +@Service("classModelService") | |
17 | +public class ClassModelServiceImpl implements ClassModelService { | |
18 | + | |
19 | + @Autowired | |
20 | + ClassModelMapper classModelMapper; | |
21 | + | |
22 | + @Override | |
23 | + public ClassModel selectByPrimaryKey(Integer classId) { | |
24 | + return classModelMapper.selectByPrimaryKey(classId); | |
25 | + } | |
26 | + | |
27 | + @Override | |
28 | + public int insertBatch(List<ClassModel> list) { | |
29 | + return classModelMapper.insertBatch(list); | |
30 | + } | |
31 | + | |
32 | + @Override | |
33 | + public ClassModel selectBySchoolIdAndClassNameAndGrade(ClassModel classModel) { | |
34 | + return classModelMapper.selectBySchoolIdAndClassNameAndGrade(classModel); | |
35 | + } | |
36 | + | |
37 | + @Override | |
38 | + public List<ClassModel> selectBySchoolIdAndGrade(int schoolId , String grade ) { | |
39 | + ClassModel classModel = new ClassModel(); | |
40 | + classModel.setSchoolId(schoolId); | |
41 | + classModel.setGrade(grade); | |
42 | + return classModelMapper.selectBySchoolIdAndGrade(classModel); | |
43 | + } | |
44 | + | |
45 | + @Override | |
46 | + public List<ClassModel> selectBySchoolId(int schoolId) { | |
47 | + return classModelMapper.selectBySchoolId(schoolId); | |
48 | + } | |
49 | + | |
50 | + @Override | |
51 | + public int deleteSchool(int schoolId) { | |
52 | + return classModelMapper.deleteSchool(schoolId); | |
53 | + } | |
54 | +} | ... | ... |
src/main/java/com/jevon/service/impl/CourseServiceImpl.java
0 → 100644
1 | +++ a/src/main/java/com/jevon/service/impl/CourseServiceImpl.java | |
... | ... | @@ -0,0 +1,81 @@ |
1 | +package com.jevon.service.impl; | |
2 | + | |
3 | +import com.jevon.mapper.CourseMapper; | |
4 | +import com.jevon.model.Course; | |
5 | +import com.jevon.service.CourseService; | |
6 | +import org.springframework.beans.factory.annotation.Autowired; | |
7 | +import org.springframework.stereotype.Service; | |
8 | + | |
9 | +import java.util.List; | |
10 | + | |
11 | +/** | |
12 | + * @author chen | |
13 | + * @version 1.0 | |
14 | + * @date 2019/10/9 0009 9:45 | |
15 | + */ | |
16 | +@Service("courseService") | |
17 | +public class CourseServiceImpl implements CourseService { | |
18 | + | |
19 | + @Autowired | |
20 | + CourseMapper courseMapper; | |
21 | + | |
22 | + @Override | |
23 | + public int insertBatch(List<Course> list) { | |
24 | + return courseMapper.insertBatch(list); | |
25 | + } | |
26 | + | |
27 | + @Override | |
28 | + public List<Course> selectBySchoolId(int schoolId) { | |
29 | + return courseMapper.selectBySchoolId(schoolId); | |
30 | + } | |
31 | + | |
32 | + @Override | |
33 | + public List<Course> selectByCourse(Course course) { | |
34 | + return courseMapper.selectByCourse(course); | |
35 | + } | |
36 | + | |
37 | + @Override | |
38 | + public Course selectBySchoolIdAndCourseId(int schoolId, int courseId) { | |
39 | + Course course = new Course(); | |
40 | + course.setSchoolId(schoolId); | |
41 | + course.setCourseId(courseId); | |
42 | + List<Course> list = courseMapper.selectByCourse(course) ; | |
43 | + if(list != null && list.size() > 0){ | |
44 | + return list.get(0); | |
45 | + }else { | |
46 | + return null ; | |
47 | + } | |
48 | + } | |
49 | + | |
50 | + @Override | |
51 | + public Course selectBySchoolIdAndCourseName(int schoolId, String courseName) { | |
52 | + Course course = new Course(); | |
53 | + course.setSchoolId(schoolId); | |
54 | + course.setCourseName(courseName); | |
55 | + List<Course> list = courseMapper.selectByCourse(course) ; | |
56 | + if(list != null && list.size() > 0){ | |
57 | + return list.get(0); | |
58 | + }else { | |
59 | + return null ; | |
60 | + } | |
61 | + } | |
62 | + | |
63 | + @Override | |
64 | + public int updateCourseType(int courseId , int courseType , int schoolId) { | |
65 | + Course course = new Course(); | |
66 | + course.setCourseId(courseId); | |
67 | + course.setCourseType(courseType); | |
68 | + course.setSchoolId(schoolId); | |
69 | + return courseMapper.updateCourseType(course); | |
70 | + } | |
71 | + | |
72 | + @Override | |
73 | + public int deleteSchoolId(int schoolId) { | |
74 | + return courseMapper.deleteSchoolId(schoolId); | |
75 | + } | |
76 | + | |
77 | + @Override | |
78 | + public int initSchoolId(int schoolId) { | |
79 | + return courseMapper.initSchoolId(schoolId); | |
80 | + } | |
81 | +} | ... | ... |
src/main/java/com/jevon/service/impl/JoinCLassServiceImpl.java
0 → 100644
1 | +++ a/src/main/java/com/jevon/service/impl/JoinCLassServiceImpl.java | |
... | ... | @@ -0,0 +1,58 @@ |
1 | +package com.jevon.service.impl; | |
2 | + | |
3 | +import com.jevon.mapper.JoinClassMapper; | |
4 | +import com.jevon.model.JoinClass; | |
5 | +import com.jevon.service.JoinClassService; | |
6 | +import org.springframework.beans.factory.annotation.Autowired; | |
7 | +import org.springframework.stereotype.Service; | |
8 | + | |
9 | +import java.util.List; | |
10 | + | |
11 | +/** | |
12 | + * @author chen | |
13 | + * @version 1.0 | |
14 | + * @date 2019/10/10 0010 8:35 | |
15 | + */ | |
16 | +@Service("joinClassService") | |
17 | +public class JoinCLassServiceImpl implements JoinClassService { | |
18 | + | |
19 | + @Autowired | |
20 | + JoinClassMapper joinClassMapper; | |
21 | + | |
22 | + @Override | |
23 | + public int insertBatch(List<JoinClass> list) { | |
24 | + Integer maxGroup = joinClassMapper.selectMaxGroup(); | |
25 | + if(maxGroup == null){ | |
26 | + maxGroup = 1 ; | |
27 | + }else { | |
28 | + maxGroup = maxGroup + 1 ; | |
29 | + } | |
30 | + for(JoinClass joinClass : list){ | |
31 | + joinClass.setCourseGroup(maxGroup); | |
32 | + } | |
33 | + return joinClassMapper.insertBatch(list); | |
34 | + } | |
35 | + | |
36 | + @Override | |
37 | + public List<JoinClass> selectByCourse(JoinClass joinClass) { | |
38 | + return joinClassMapper.selectByCourse(joinClass); | |
39 | + } | |
40 | + | |
41 | + @Override | |
42 | + public List<JoinClass> selectByCourseGroup(int courseGroup) { | |
43 | + return joinClassMapper.selectByCourseGroup(courseGroup); | |
44 | + } | |
45 | + | |
46 | + @Override | |
47 | + public int deleteBySchoolIdAndTeam(int schoolId, String team) { | |
48 | + JoinClass joinClass = new JoinClass(); | |
49 | + joinClass.setTeam(team); | |
50 | + joinClass.setSchoolId(schoolId); | |
51 | + return joinClassMapper.deleteBySchoolIdAndTeam(joinClass); | |
52 | + } | |
53 | + | |
54 | + @Override | |
55 | + public int deleteCourseGroup(int courseGroup) { | |
56 | + return joinClassMapper.deleteCourseGroup(courseGroup); | |
57 | + } | |
58 | +} | ... | ... |
src/main/java/com/jevon/service/impl/ScheduleServiceImpl.java
0 → 100644
1 | +++ a/src/main/java/com/jevon/service/impl/ScheduleServiceImpl.java | |
... | ... | @@ -0,0 +1,64 @@ |
1 | +package com.jevon.service.impl; | |
2 | + | |
3 | +import com.jevon.mapper.ScheduleMapper; | |
4 | +import com.jevon.model.Schedule; | |
5 | +import com.jevon.service.ScheduleService; | |
6 | +import org.springframework.beans.factory.annotation.Autowired; | |
7 | +import org.springframework.stereotype.Service; | |
8 | + | |
9 | +import java.util.Date; | |
10 | +import java.util.List; | |
11 | + | |
12 | +/** | |
13 | + * @author chen | |
14 | + * @version 1.0 | |
15 | + * @date 2019/10/10 0010 11:26 | |
16 | + */ | |
17 | +@Service("scheduleService") | |
18 | +public class ScheduleServiceImpl implements ScheduleService { | |
19 | + | |
20 | + @Autowired | |
21 | + ScheduleMapper scheduleMapper; | |
22 | + | |
23 | + @Override | |
24 | + public int insert(Schedule schedule) { | |
25 | + schedule.setCreateTime(new Date()); | |
26 | + schedule.setSpeed(0); | |
27 | + return scheduleMapper.insert(schedule); | |
28 | + } | |
29 | + | |
30 | + @Override | |
31 | + public List<Schedule> selectBySchool(int schoolId) { | |
32 | + return scheduleMapper.selectBySchool(schoolId); | |
33 | + } | |
34 | + | |
35 | + @Override | |
36 | + public int updateSpeed(Schedule schedule) { | |
37 | + return scheduleMapper.updateSpeed(schedule); | |
38 | + } | |
39 | + | |
40 | + @Override | |
41 | + public Schedule selectById(int id) { | |
42 | + return scheduleMapper.selectById(id); | |
43 | + } | |
44 | + | |
45 | + @Override | |
46 | + public Schedule selectBySchoolAndTeam(Schedule schedule) { | |
47 | + return scheduleMapper.selectBySchoolAndTeam(schedule); | |
48 | + } | |
49 | + | |
50 | + @Override | |
51 | + public int deleteBySchedule(int id) { | |
52 | + return scheduleMapper.deleteBySchedule(id); | |
53 | + } | |
54 | + | |
55 | + @Override | |
56 | + public int updateZuoxi(Schedule schedule) { | |
57 | + return scheduleMapper.updateZuoxi(schedule); | |
58 | + } | |
59 | + | |
60 | + @Override | |
61 | + public int update(Schedule schedule) { | |
62 | + return scheduleMapper.update(schedule); | |
63 | + } | |
64 | +} | ... | ... |
src/main/java/com/jevon/service/impl/TeacherClassServiceImpl.java
0 → 100644
1 | +++ a/src/main/java/com/jevon/service/impl/TeacherClassServiceImpl.java | |
... | ... | @@ -0,0 +1,91 @@ |
1 | +package com.jevon.service.impl; | |
2 | + | |
3 | +import com.jevon.mapper.TeacherClassMapper; | |
4 | +import com.jevon.model.TeacherClass; | |
5 | +import com.jevon.service.TeacherClassService; | |
6 | +import org.springframework.beans.factory.annotation.Autowired; | |
7 | +import org.springframework.stereotype.Service; | |
8 | + | |
9 | +import java.util.ArrayList; | |
10 | +import java.util.List; | |
11 | + | |
12 | +/** | |
13 | + * @author chen | |
14 | + * @version 1.0 | |
15 | + * @date 2019/9/29 0029 11:31 | |
16 | + */ | |
17 | +@Service("teacherClassService") | |
18 | +public class TeacherClassServiceImpl implements TeacherClassService { | |
19 | + | |
20 | + @Autowired | |
21 | + TeacherClassMapper teacherClassMapper; | |
22 | + | |
23 | + @Override | |
24 | + public int insert(TeacherClass teacherClass) { | |
25 | + return teacherClassMapper.insert(teacherClass); | |
26 | + } | |
27 | + | |
28 | + @Override | |
29 | + public int insertBatch(List<TeacherClass> teacherClasses) { | |
30 | + int i = 0 ; | |
31 | + List<TeacherClass> result = new ArrayList<>(); | |
32 | + for(TeacherClass teacherClass :teacherClasses){ | |
33 | + i++ ; | |
34 | + result.add(teacherClass); | |
35 | + if(i % 100 == 0){ | |
36 | + teacherClassMapper.insertBatch(result); | |
37 | + result = new ArrayList<>(); | |
38 | + } | |
39 | + } | |
40 | + teacherClassMapper.insertBatch(result); | |
41 | + return 1; | |
42 | + } | |
43 | + | |
44 | + @Override | |
45 | + public List<TeacherClass> selectByCourseName(TeacherClass teacherClass) { | |
46 | + return teacherClassMapper.selectByCourseName(teacherClass); | |
47 | + } | |
48 | + | |
49 | + @Override | |
50 | + public TeacherClass selectByTeacher(TeacherClass teacherClass) { | |
51 | + return teacherClassMapper.selectByTeacher(teacherClass); | |
52 | + } | |
53 | + | |
54 | + @Override | |
55 | + public TeacherClass selectByCourseAndClass(TeacherClass teacherClass) { | |
56 | + return teacherClassMapper.selectByCourseAndClass(teacherClass); | |
57 | + } | |
58 | + | |
59 | + @Override | |
60 | + public List<TeacherClass> selectBySchoolAndTeam(TeacherClass teacherClass) { | |
61 | + return teacherClassMapper.selectBySchoolAndTeam(teacherClass); | |
62 | + } | |
63 | + | |
64 | + @Override | |
65 | + public int deleteBySchoolAndTeam(TeacherClass teacherClass) { | |
66 | + return teacherClassMapper.deleteBySchoolAndTeam(teacherClass); | |
67 | + } | |
68 | + | |
69 | + @Override | |
70 | + public TeacherClass selectById(int tClassId) { | |
71 | + return teacherClassMapper.selectById(tClassId); | |
72 | + } | |
73 | + | |
74 | + @Override | |
75 | + public int updateSchedule(int tClassId) { | |
76 | + return teacherClassMapper.updateSchedule(tClassId); | |
77 | + } | |
78 | + | |
79 | + @Override | |
80 | + public int selectHasSchedule(int schoolId, String team) { | |
81 | + TeacherClass teacherClass = new TeacherClass(); | |
82 | + teacherClass.setSchoolId(schoolId); | |
83 | + teacherClass.setTeam(team); | |
84 | + return teacherClassMapper.selectHasSchedule(teacherClass); | |
85 | + } | |
86 | + | |
87 | + @Override | |
88 | + public int recallTeacherClass(int tClassId) { | |
89 | + return teacherClassMapper.recallTeacherClass(tClassId); | |
90 | + } | |
91 | +} | ... | ... |
src/main/java/com/jevon/service/impl/TeacherCourseServiceImpl.java
0 → 100644
1 | +++ a/src/main/java/com/jevon/service/impl/TeacherCourseServiceImpl.java | |
... | ... | @@ -0,0 +1,83 @@ |
1 | +package com.jevon.service.impl; | |
2 | + | |
3 | +import com.jevon.mapper.TeacherCourseMapper; | |
4 | +import com.jevon.model.TeacherCourse; | |
5 | +import com.jevon.service.TeacherCourseService; | |
6 | +import org.springframework.beans.factory.annotation.Autowired; | |
7 | +import org.springframework.stereotype.Service; | |
8 | + | |
9 | +import java.util.ArrayList; | |
10 | +import java.util.List; | |
11 | + | |
12 | +/** | |
13 | + * @author chen | |
14 | + * @version 1.0 | |
15 | + * @date 2019/9/25 0025 14:46 | |
16 | + */ | |
17 | +@Service("teacherCourseService") | |
18 | +public class TeacherCourseServiceImpl implements TeacherCourseService { | |
19 | + | |
20 | + @Autowired | |
21 | + TeacherCourseMapper teacherCourseMapper; | |
22 | + @Override | |
23 | + public int insertBatch(List<TeacherCourse> list) { | |
24 | + int i = 0 ; | |
25 | + List<TeacherCourse> result = new ArrayList<>(); | |
26 | + for(TeacherCourse teacherClass :list){ | |
27 | + i++ ; | |
28 | + result.add(teacherClass); | |
29 | + if(i % 100 == 0){ | |
30 | + teacherCourseMapper.insertBatch(result); | |
31 | + result = new ArrayList<>(); | |
32 | + } | |
33 | + } | |
34 | + teacherCourseMapper.insertBatch(result); | |
35 | + return 1; | |
36 | + } | |
37 | + | |
38 | + @Override | |
39 | + public int updateByPrimaryKey(TeacherCourse record) { | |
40 | + return teacherCourseMapper.updateByPrimaryKey(record); | |
41 | + } | |
42 | + | |
43 | + @Override | |
44 | + public int updateTeacherCourse(TeacherCourse teacherCourse) { | |
45 | + return teacherCourseMapper.updateTeacherCourse(teacherCourse); | |
46 | + } | |
47 | + | |
48 | + @Override | |
49 | + public TeacherCourse selectTeacherCourse(TeacherCourse teacherCourse) { | |
50 | + return teacherCourseMapper.selectTeacherCourse(teacherCourse); | |
51 | + } | |
52 | + | |
53 | + @Override | |
54 | + public int selectTeacherDayCourseNumber(TeacherCourse teacherCourse) { | |
55 | + return teacherCourseMapper.selectTeacherDayCourseNumber(teacherCourse); | |
56 | + } | |
57 | + | |
58 | + @Override | |
59 | + public int isCreateCourse(TeacherCourse teacherCourse) { | |
60 | + return teacherCourseMapper.isCreateCourse(teacherCourse); | |
61 | + } | |
62 | + | |
63 | + @Override | |
64 | + public int deleteBySchoolIdAndTeam(int schoolId, String team) { | |
65 | + TeacherCourse teacherCourse = new TeacherCourse(); | |
66 | + teacherCourse.setSchoolId(schoolId); | |
67 | + teacherCourse.setTeacherName(team); | |
68 | + return teacherCourseMapper.deleteBySchoolIdAndTeam(teacherCourse); | |
69 | + } | |
70 | + | |
71 | + @Override | |
72 | + public int recallTeacherCourse(TeacherCourse teacherCourse) { | |
73 | + return teacherCourseMapper.recallTeacherCourse(teacherCourse); | |
74 | + } | |
75 | + | |
76 | + @Override | |
77 | + public List<TeacherCourse> selectBySchoolIdAndTeam(int schoolId, String team) { | |
78 | + TeacherCourse teacherCourse = new TeacherCourse(); | |
79 | + teacherCourse.setSchoolId(schoolId); | |
80 | + teacherCourse.setTeam(team); | |
81 | + return teacherCourseMapper.selectBySchoolIdAndTeam(teacherCourse); | |
82 | + } | |
83 | +} | ... | ... |
src/main/java/com/jevon/service/impl/TeacherServiceImpl.java
0 → 100644
1 | +++ a/src/main/java/com/jevon/service/impl/TeacherServiceImpl.java | |
... | ... | @@ -0,0 +1,42 @@ |
1 | +package com.jevon.service.impl; | |
2 | + | |
3 | +import com.jevon.mapper.TeacherMapper; | |
4 | +import com.jevon.model.Teacher; | |
5 | +import com.jevon.service.TeacherService; | |
6 | +import org.springframework.beans.factory.annotation.Autowired; | |
7 | +import org.springframework.stereotype.Service; | |
8 | + | |
9 | +import java.util.List; | |
10 | + | |
11 | +/** | |
12 | + * @author chen | |
13 | + * @version 1.0 | |
14 | + * @date 2019/10/9 0009 13:59 | |
15 | + */ | |
16 | +@Service("teacherService") | |
17 | +public class TeacherServiceImpl implements TeacherService { | |
18 | + | |
19 | + @Autowired | |
20 | + TeacherMapper teacherMapper; | |
21 | + | |
22 | + @Override | |
23 | + public int insertBatch(List<Teacher> list) { | |
24 | + return teacherMapper.insertBatch(list); | |
25 | + } | |
26 | + | |
27 | + @Override | |
28 | + public List<Teacher> selectBySchoolId(int schoolId) { | |
29 | + return teacherMapper.selectBySchoolId(schoolId); | |
30 | + } | |
31 | + | |
32 | + @Override | |
33 | + public int deleteSchool(int schoolId) { | |
34 | + return teacherMapper.deleteSchool(schoolId); | |
35 | + } | |
36 | + | |
37 | + @Override | |
38 | + public Teacher selectByTeacher(Teacher teacher) { | |
39 | + return teacherMapper.selectByTeacher(teacher).get(0); | |
40 | + } | |
41 | + | |
42 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/utils/ExcelUtils.java | |
... | ... | @@ -0,0 +1,146 @@ |
1 | +package com.jevon.utils; | |
2 | + | |
3 | +import com.google.common.base.Strings; | |
4 | +import org.apache.commons.lang3.StringUtils; | |
5 | +import org.apache.poi.hssf.usermodel.HSSFCell; | |
6 | +import org.apache.poi.hssf.usermodel.HSSFRow; | |
7 | +import org.apache.poi.hssf.usermodel.HSSFSheet; | |
8 | +import org.apache.poi.hssf.usermodel.HSSFWorkbook; | |
9 | + | |
10 | +import javax.servlet.http.HttpServletRequest; | |
11 | +import javax.servlet.http.HttpServletResponse; | |
12 | +import java.io.IOException; | |
13 | +import java.io.OutputStream; | |
14 | +import java.math.BigDecimal; | |
15 | +import java.util.List; | |
16 | +import java.util.Map; | |
17 | + | |
18 | +/** | |
19 | + * @author chen | |
20 | + * @version 1.0 | |
21 | + * @date 2019/10/16 0016 18:46 | |
22 | + */ | |
23 | +public class ExcelUtils { | |
24 | + | |
25 | + //各个列的表头 | |
26 | + private List<String> heardList; | |
27 | + //各个列的元素key值 | |
28 | + private List<String> heardKey; | |
29 | + //需要填充的数据信息 | |
30 | + private List<Map<String,String>> data; | |
31 | + //工作表 | |
32 | + private String sheetName = "模板"; | |
33 | + | |
34 | + | |
35 | + public List<String> getHeardList() { | |
36 | + return heardList; | |
37 | + } | |
38 | + | |
39 | + public void setHeardList(List<String> heardList) { | |
40 | + this.heardList = heardList; | |
41 | + } | |
42 | + | |
43 | + public List<String> getHeardKey() { | |
44 | + return heardKey; | |
45 | + } | |
46 | + | |
47 | + public void setHeardKey(List<String> heardKey) { | |
48 | + this.heardKey = heardKey; | |
49 | + } | |
50 | + | |
51 | + public List<Map<String, String>> getData() { | |
52 | + return data; | |
53 | + } | |
54 | + | |
55 | + public void setData(List<Map<String, String>> data) { | |
56 | + this.data = data; | |
57 | + } | |
58 | + | |
59 | + public String getSheetName() { | |
60 | + return sheetName; | |
61 | + } | |
62 | + | |
63 | + public void setSheetName(String sheetName) { | |
64 | + this.sheetName = sheetName; | |
65 | + } | |
66 | + | |
67 | + /** | |
68 | + * 开始导出数据信息 | |
69 | + * | |
70 | + */ | |
71 | + public byte[] exportExport(HttpServletRequest request, HttpServletResponse response) throws IOException { | |
72 | + //检查参数配置信息 | |
73 | + checkConfig(); | |
74 | + //创建工作簿 | |
75 | + HSSFWorkbook wb = new HSSFWorkbook(); | |
76 | + //创建工作表 | |
77 | + HSSFSheet wbSheet = wb.createSheet(this.sheetName); | |
78 | + | |
79 | + //在第0行创建rows | |
80 | + HSSFRow row = wbSheet.createRow((int)0); | |
81 | + //设置列头元素 | |
82 | + HSSFCell cellHead = null; | |
83 | + for (int i = 0; i < heardList.size(); i++) { | |
84 | + cellHead = row.createCell(i); | |
85 | + cellHead.setCellValue(heardList.get(i)); | |
86 | + } | |
87 | + //开始写入实体数据信息 | |
88 | + int a = 1; | |
89 | + for (int i = 0; i < data.size(); i++) { | |
90 | + HSSFRow roww = wbSheet.createRow((int) a); | |
91 | + Map map = data.get(i); | |
92 | + HSSFCell cell = null; | |
93 | + for (int j = 0; j < heardKey.size(); j++) { | |
94 | + cell = roww.createCell(j); | |
95 | + Object valueObject = map.get(heardKey.get(j)); | |
96 | + String value = null; | |
97 | + if (valueObject == null) { | |
98 | + valueObject = ""; | |
99 | + } | |
100 | + if (valueObject instanceof String) { | |
101 | + //取出的数据是字符串直接赋值 | |
102 | + value = (String) map.get(heardKey.get(j)); | |
103 | + } else if (valueObject instanceof Integer) { | |
104 | + //取出的数据是Integer | |
105 | + value = String.valueOf(((Integer) (valueObject)).floatValue()); | |
106 | + } else if (valueObject instanceof BigDecimal) { | |
107 | + //取出的数据是BigDecimal | |
108 | + value = String.valueOf(((BigDecimal) (valueObject)).floatValue()); | |
109 | + } else { | |
110 | + value = valueObject.toString(); | |
111 | + } | |
112 | + cell.setCellValue(Strings.isNullOrEmpty(value) ? "" : value); | |
113 | + } | |
114 | + a++; | |
115 | + } | |
116 | + | |
117 | + //导出数据 | |
118 | + try { | |
119 | + //设置Http响应头告诉浏览器下载这个附件 | |
120 | + response.setHeader("Content-Disposition", "attachment;Filename=" + System.currentTimeMillis() + ".xls"); | |
121 | + OutputStream outputStream = response.getOutputStream(); | |
122 | + wb.write(outputStream); | |
123 | + outputStream.flush(); | |
124 | + outputStream.close(); | |
125 | + return wb.getBytes(); | |
126 | + } catch (Exception ex) { | |
127 | + ex.printStackTrace(); | |
128 | + throw new IOException("导出Excel出现严重异常,异常信息:" + ex.getMessage()); | |
129 | + } | |
130 | + | |
131 | + } | |
132 | + | |
133 | + /** | |
134 | + * 检查数据配置问题 | |
135 | + * | |
136 | + * @throws IOException 抛出数据异常类 | |
137 | + */ | |
138 | + protected void checkConfig() throws IOException { | |
139 | + if (heardKey == null || heardList.size() == 0) { | |
140 | + throw new IOException("列名数组不能为空或者为NULL"); | |
141 | + } | |
142 | + if (StringUtils.isBlank(sheetName)) { | |
143 | + throw new IOException("工作表表名不能为NULL"); | |
144 | + } | |
145 | + } | |
146 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/utils/HttpClientUtils.java | |
... | ... | @@ -0,0 +1,145 @@ |
1 | +package com.jevon.utils; | |
2 | + | |
3 | +import com.alibaba.fastjson.JSONObject; | |
4 | +import org.apache.http.HttpEntity; | |
5 | +import org.apache.http.HttpStatus; | |
6 | +import org.apache.http.client.config.RequestConfig; | |
7 | +import org.apache.http.client.methods.CloseableHttpResponse; | |
8 | +import org.apache.http.client.methods.HttpGet; | |
9 | +import org.apache.http.client.methods.HttpPost; | |
10 | +import org.apache.http.entity.StringEntity; | |
11 | +import org.apache.http.impl.client.CloseableHttpClient; | |
12 | +import org.apache.http.impl.client.HttpClients; | |
13 | +import org.apache.http.util.EntityUtils; | |
14 | + | |
15 | +import java.io.IOException; | |
16 | + | |
17 | +/** | |
18 | + * HttpClient4.3工具类 | |
19 | + * @author chen | |
20 | + * @version 1.0 | |
21 | + * @date 2019/10/11 0011 10:17 | |
22 | + */ | |
23 | +public class HttpClientUtils { | |
24 | + | |
25 | + private static RequestConfig requestConfig = null; | |
26 | + | |
27 | + static | |
28 | + { | |
29 | + // 设置请求和传输超时时间 | |
30 | + requestConfig = RequestConfig.custom().setSocketTimeout(2000).setConnectTimeout(2000).build(); | |
31 | + } | |
32 | + | |
33 | + public static void main(String[] args){ | |
34 | + JSONObject teacherList = HttpClientUtils.httpGet("http://60.190.202.57:1000/api/EasyN/GetSchoolSubject?SchoolId=1"); | |
35 | + System.out.println("1"); | |
36 | + } | |
37 | + | |
38 | + /** | |
39 | + * post请求传输json参数 | |
40 | + * @param url url地址 | |
41 | + * @param jsonParam 参数 | |
42 | + * @return | |
43 | + */ | |
44 | + public static JSONObject httpPost(String url, JSONObject jsonParam) { | |
45 | + // post请求返回结果 | |
46 | + CloseableHttpClient httpClient = HttpClients.createDefault(); | |
47 | + JSONObject jsonResult = null; | |
48 | + HttpPost httpPost = new HttpPost(url); | |
49 | + // 设置请求和传输超时时间 | |
50 | + httpPost.setConfig(requestConfig); | |
51 | + try { | |
52 | + if (null != jsonParam) { | |
53 | + // 解决中文乱码问题 | |
54 | + StringEntity entity = new StringEntity(jsonParam.toString(), "utf-8"); | |
55 | + entity.setContentEncoding("UTF-8"); | |
56 | + entity.setContentType("application/json"); | |
57 | + httpPost.setEntity(entity); | |
58 | + } | |
59 | + CloseableHttpResponse result = httpClient.execute(httpPost); | |
60 | + // 请求发送成功,并得到响应 | |
61 | + if (result.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { | |
62 | + String str = ""; | |
63 | + // 读取服务器返回过来的json字符串数据 | |
64 | + str = EntityUtils.toString(result.getEntity(), "utf-8"); | |
65 | + // 把json字符串转换成json对象 | |
66 | + jsonResult = JSONObject.parseObject(str); | |
67 | + | |
68 | + } | |
69 | + } catch (IOException e) { | |
70 | + | |
71 | + } finally { | |
72 | + httpPost.releaseConnection(); | |
73 | + } | |
74 | + return jsonResult; | |
75 | + } | |
76 | + | |
77 | + /** | |
78 | + * post请求传输String参数 例如:name=Jack&sex=1&type=2 | |
79 | + * Content-type:application/x-www-form-urlencoded | |
80 | + * @param url url地址 | |
81 | + * @param strParam 参数 | |
82 | + * @return | |
83 | + */ | |
84 | + public static JSONObject httpPost(String url, String strParam) { | |
85 | + // post请求返回结果 | |
86 | + CloseableHttpClient httpClient = HttpClients.createDefault(); | |
87 | + JSONObject jsonResult = null; | |
88 | + HttpPost httpPost = new HttpPost(url); | |
89 | + httpPost.setConfig(requestConfig); | |
90 | + try { | |
91 | + if (null != strParam) { | |
92 | + // 解决中文乱码问题 | |
93 | + StringEntity entity = new StringEntity(strParam, "utf-8"); | |
94 | + entity.setContentEncoding("UTF-8"); | |
95 | + entity.setContentType("application/x-www-form-urlencoded"); | |
96 | + httpPost.setEntity(entity); | |
97 | + } | |
98 | + CloseableHttpResponse result = httpClient.execute(httpPost); | |
99 | + // 请求发送成功,并得到响应 | |
100 | + if (result.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { | |
101 | + String str = ""; | |
102 | + // 读取服务器返回过来的json字符串数据 | |
103 | + str = EntityUtils.toString(result.getEntity(), "utf-8"); | |
104 | + // 把json字符串转换成json对象 | |
105 | + jsonResult = JSONObject.parseObject(str); | |
106 | + } | |
107 | + } catch (IOException e) { | |
108 | + | |
109 | + } finally { | |
110 | + httpPost.releaseConnection(); | |
111 | + } | |
112 | + return jsonResult; | |
113 | + } | |
114 | + | |
115 | + /** | |
116 | + * 发送get请求 | |
117 | + * @param url 路径 | |
118 | + * @return | |
119 | + */ | |
120 | + public static JSONObject httpGet(String url) { | |
121 | + // get请求返回结果 | |
122 | + JSONObject jsonResult = null; | |
123 | + CloseableHttpClient client = HttpClients.createDefault(); | |
124 | + // 发送get请求 | |
125 | + HttpGet request = new HttpGet(url); | |
126 | + request.setConfig(requestConfig); | |
127 | + try { | |
128 | + CloseableHttpResponse response = client.execute(request); | |
129 | + // 请求发送成功,并得到响应 | |
130 | + if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { | |
131 | + // 读取服务器返回过来的json字符串数据 | |
132 | + HttpEntity entity = response.getEntity(); | |
133 | + String strResult = EntityUtils.toString(entity, "utf-8"); | |
134 | + // 把json字符串转换成json对象 | |
135 | + jsonResult = JSONObject.parseObject(strResult); | |
136 | + } | |
137 | + } catch (IOException e) { | |
138 | + | |
139 | + } finally { | |
140 | + request.releaseConnection(); | |
141 | + } | |
142 | + return jsonResult; | |
143 | + } | |
144 | + | |
145 | +} | |
0 | 146 | \ No newline at end of file | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/BaseVo.java | |
... | ... | @@ -0,0 +1,27 @@ |
1 | +package com.jevon.vo; | |
2 | + | |
3 | +public class BaseVo { | |
4 | + | |
5 | + private boolean success; | |
6 | + private String message ; | |
7 | + | |
8 | + public boolean isSuccess() { | |
9 | + return success; | |
10 | + } | |
11 | + | |
12 | + public void setSuccess(boolean success) { | |
13 | + this.success = success; | |
14 | + } | |
15 | + | |
16 | + public String getMessage() { | |
17 | + return message; | |
18 | + } | |
19 | + | |
20 | + public void setMessage(String message) { | |
21 | + this.message = message; | |
22 | + } | |
23 | + | |
24 | + public BaseVo() { | |
25 | + success = true; | |
26 | + } | |
27 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/rep/ClassCourseDetailVo.java | |
... | ... | @@ -0,0 +1,58 @@ |
1 | +package com.jevon.vo.rep; | |
2 | + | |
3 | +import com.jevon.model.TeacherClass; | |
4 | + | |
5 | +/** | |
6 | + * @author chen | |
7 | + * @version 1.0 | |
8 | + * @date 2019/10/12 0012 8:30 | |
9 | + */ | |
10 | +public class ClassCourseDetailVo { | |
11 | + | |
12 | + private String courseName ; | |
13 | + private String teacherName ; | |
14 | + private int times ; | |
15 | + private int joinTimes ; | |
16 | + | |
17 | + | |
18 | + public ClassCourseDetailVo(TeacherClass teacherClass) { | |
19 | + this.courseName = teacherClass.getCourseName(); | |
20 | + this.teacherName = teacherClass.getTeacherName(); | |
21 | + this.joinTimes = teacherClass.getJoinTimes(); | |
22 | + this.times = teacherClass.getTimes()-2*(teacherClass.getJoinTimes()); | |
23 | + } | |
24 | + | |
25 | + | |
26 | + public String getCourseName() { | |
27 | + return courseName; | |
28 | + } | |
29 | + | |
30 | + public void setCourseName(String courseName) { | |
31 | + this.courseName = courseName; | |
32 | + } | |
33 | + | |
34 | + public String getTeacherName() { | |
35 | + return teacherName; | |
36 | + } | |
37 | + | |
38 | + public void setTeacherName(String teacherName) { | |
39 | + this.teacherName = teacherName; | |
40 | + } | |
41 | + | |
42 | + public int getTimes() { | |
43 | + return times; | |
44 | + } | |
45 | + | |
46 | + public void setTimes(int times) { | |
47 | + this.times = times; | |
48 | + } | |
49 | + | |
50 | + public int getJoinTimes() { | |
51 | + return joinTimes; | |
52 | + } | |
53 | + | |
54 | + public void setJoinTimes(int joinTimes) { | |
55 | + this.joinTimes = joinTimes; | |
56 | + } | |
57 | + | |
58 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/rep/ClassCourseRepVo.java | |
... | ... | @@ -0,0 +1,24 @@ |
1 | +package com.jevon.vo.rep; | |
2 | + | |
3 | +import com.jevon.model.ClassCourse; | |
4 | +import com.jevon.vo.BaseVo; | |
5 | + | |
6 | +import java.util.List; | |
7 | + | |
8 | +/** | |
9 | + * @author chen | |
10 | + * @version 1.0 | |
11 | + * @date 2019/10/11 0011 10:17 | |
12 | + */ | |
13 | +public class ClassCourseRepVo extends BaseVo { | |
14 | + | |
15 | + private List<ClassCourse> data; | |
16 | + | |
17 | + public List<ClassCourse> getData() { | |
18 | + return data; | |
19 | + } | |
20 | + | |
21 | + public void setData(List<ClassCourse> data) { | |
22 | + this.data = data; | |
23 | + } | |
24 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/rep/ClassCourseVO.java | |
... | ... | @@ -0,0 +1,49 @@ |
1 | +package com.jevon.vo.rep; | |
2 | + | |
3 | +import java.util.List; | |
4 | + | |
5 | +/** | |
6 | + * @author chen | |
7 | + * @version 1.0 | |
8 | + * @date 2019/10/12 0012 8:30 | |
9 | + */ | |
10 | +public class ClassCourseVO { | |
11 | + | |
12 | + private int classId ; | |
13 | + private String className ; | |
14 | + private int allCount ; | |
15 | + | |
16 | + List<ClassCourseDetailVo> list ; | |
17 | + | |
18 | + public int getClassId() { | |
19 | + return classId; | |
20 | + } | |
21 | + | |
22 | + public void setClassId(int classId) { | |
23 | + this.classId = classId; | |
24 | + } | |
25 | + | |
26 | + public String getClassName() { | |
27 | + return className; | |
28 | + } | |
29 | + | |
30 | + public void setClassName(String className) { | |
31 | + this.className = className; | |
32 | + } | |
33 | + | |
34 | + public int getAllCount() { | |
35 | + return allCount; | |
36 | + } | |
37 | + | |
38 | + public void setAllCount(int allCount) { | |
39 | + this.allCount = allCount; | |
40 | + } | |
41 | + | |
42 | + public List<ClassCourseDetailVo> getList() { | |
43 | + return list; | |
44 | + } | |
45 | + | |
46 | + public void setList(List<ClassCourseDetailVo> list) { | |
47 | + this.list = list; | |
48 | + } | |
49 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/rep/ClassRepVo.java | |
... | ... | @@ -0,0 +1,24 @@ |
1 | +package com.jevon.vo.rep; | |
2 | + | |
3 | +import com.jevon.model.ClassModel; | |
4 | +import com.jevon.vo.BaseVo; | |
5 | + | |
6 | +import java.util.List; | |
7 | + | |
8 | +/** | |
9 | + * @author chen | |
10 | + * @version 1.0 | |
11 | + * @date 2019/10/11 0011 14:08 | |
12 | + */ | |
13 | +public class ClassRepVo extends BaseVo { | |
14 | + | |
15 | + private List<ClassModel> data ; | |
16 | + | |
17 | + public List<ClassModel> getData() { | |
18 | + return data; | |
19 | + } | |
20 | + | |
21 | + public void setData(List<ClassModel> data) { | |
22 | + this.data = data; | |
23 | + } | |
24 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/rep/CourseRepVo.java | |
... | ... | @@ -0,0 +1,28 @@ |
1 | +package com.jevon.vo.rep; | |
2 | + | |
3 | +import com.jevon.model.Course; | |
4 | +import com.jevon.vo.BaseVo; | |
5 | + | |
6 | +import java.util.List; | |
7 | + | |
8 | +/** | |
9 | + * @author chen | |
10 | + * @version 1.0 | |
11 | + * @date 2019/10/11 0011 10:12 | |
12 | + */ | |
13 | +public class CourseRepVo extends BaseVo { | |
14 | + | |
15 | + private List<Course> data ; | |
16 | + | |
17 | + public List<Course> getData() { | |
18 | + return data; | |
19 | + } | |
20 | + | |
21 | + public void setData(List<Course> data) { | |
22 | + this.data = data; | |
23 | + } | |
24 | + | |
25 | + public CourseRepVo(){ | |
26 | + super(); | |
27 | + } | |
28 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/rep/CourseTypeListVO.java | |
... | ... | @@ -0,0 +1,41 @@ |
1 | +package com.jevon.vo.rep; | |
2 | + | |
3 | +import com.jevon.model.Course; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * @author chen | |
9 | + * @version 1.0 | |
10 | + * @date 2019/10/14 0014 7:58 | |
11 | + */ | |
12 | +public class CourseTypeListVO { | |
13 | + | |
14 | + private int courseType ; | |
15 | + private String courseTypeName ; | |
16 | + private List<Course> list ; | |
17 | + | |
18 | + public int getCourseType() { | |
19 | + return courseType; | |
20 | + } | |
21 | + | |
22 | + public void setCourseType(int courseType) { | |
23 | + this.courseType = courseType; | |
24 | + } | |
25 | + | |
26 | + public String getCourseTypeName() { | |
27 | + return courseTypeName; | |
28 | + } | |
29 | + | |
30 | + public void setCourseTypeName(String courseTypeName) { | |
31 | + this.courseTypeName = courseTypeName; | |
32 | + } | |
33 | + | |
34 | + public List<Course> getList() { | |
35 | + return list; | |
36 | + } | |
37 | + | |
38 | + public void setList(List<Course> list) { | |
39 | + this.list = list; | |
40 | + } | |
41 | +} | ... | ... |
src/main/java/com/jevon/vo/rep/GetCourseClassListRepVo.java
0 → 100644
1 | +++ a/src/main/java/com/jevon/vo/rep/GetCourseClassListRepVo.java | |
... | ... | @@ -0,0 +1,55 @@ |
1 | +package com.jevon.vo.rep; | |
2 | + | |
3 | +/** | |
4 | + * @author chen | |
5 | + * @version 1.0 | |
6 | + * @date 2019/10/12 0012 9:20 | |
7 | + */ | |
8 | +public class GetCourseClassListRepVo { | |
9 | + | |
10 | + private int classId ; | |
11 | + private String className ; | |
12 | + private int courseId ; | |
13 | + private String courseName ; | |
14 | + private String teacherName ; | |
15 | + | |
16 | + public int getClassId() { | |
17 | + return classId; | |
18 | + } | |
19 | + | |
20 | + public void setClassId(int classId) { | |
21 | + this.classId = classId; | |
22 | + } | |
23 | + | |
24 | + public String getClassName() { | |
25 | + return className; | |
26 | + } | |
27 | + | |
28 | + public void setClassName(String className) { | |
29 | + this.className = className; | |
30 | + } | |
31 | + | |
32 | + public int getCourseId() { | |
33 | + return courseId; | |
34 | + } | |
35 | + | |
36 | + public void setCourseId(int courseId) { | |
37 | + this.courseId = courseId; | |
38 | + } | |
39 | + | |
40 | + public String getCourseName() { | |
41 | + return courseName; | |
42 | + } | |
43 | + | |
44 | + public void setCourseName(String courseName) { | |
45 | + this.courseName = courseName; | |
46 | + } | |
47 | + | |
48 | + public String getTeacherName() { | |
49 | + return teacherName; | |
50 | + } | |
51 | + | |
52 | + public void setTeacherName(String teacherName) { | |
53 | + this.teacherName = teacherName; | |
54 | + } | |
55 | +} | ... | ... |
src/main/java/com/jevon/vo/rep/GetCourseTypeListRepVo.java
0 → 100644
1 | +++ a/src/main/java/com/jevon/vo/rep/GetCourseTypeListRepVo.java | |
... | ... | @@ -0,0 +1,32 @@ |
1 | +package com.jevon.vo.rep; | |
2 | + | |
3 | +import com.jevon.vo.BaseVo; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * @author chen | |
9 | + * @version 1.0 | |
10 | + * @date 2019/10/14 0014 7:59 | |
11 | + */ | |
12 | +public class GetCourseTypeListRepVo extends BaseVo { | |
13 | + | |
14 | + private int scheduleId ; | |
15 | + private List<CourseTypeListVO> data ; | |
16 | + | |
17 | + public int getScheduleId() { | |
18 | + return scheduleId; | |
19 | + } | |
20 | + | |
21 | + public void setScheduleId(int scheduleId) { | |
22 | + this.scheduleId = scheduleId; | |
23 | + } | |
24 | + | |
25 | + public List<CourseTypeListVO> getData() { | |
26 | + return data; | |
27 | + } | |
28 | + | |
29 | + public void setData(List<CourseTypeListVO> data) { | |
30 | + this.data = data; | |
31 | + } | |
32 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/rep/InitRepVo.java | |
... | ... | @@ -0,0 +1,39 @@ |
1 | +package com.jevon.vo.rep; | |
2 | + | |
3 | +import com.jevon.vo.BaseVo; | |
4 | + | |
5 | +/** | |
6 | + * @author chen | |
7 | + * @version 1.0 | |
8 | + * @date 2019/10/11 0011 16:55 | |
9 | + */ | |
10 | +public class InitRepVo extends BaseVo { | |
11 | + | |
12 | + private int classNumber ; | |
13 | + private int teacherNumber ; | |
14 | + private int courseNumber ; | |
15 | + | |
16 | + public int getClassNumber() { | |
17 | + return classNumber; | |
18 | + } | |
19 | + | |
20 | + public void setClassNumber(int classNumber) { | |
21 | + this.classNumber = classNumber; | |
22 | + } | |
23 | + | |
24 | + public int getTeacherNumber() { | |
25 | + return teacherNumber; | |
26 | + } | |
27 | + | |
28 | + public void setTeacherNumber(int teacherNumber) { | |
29 | + this.teacherNumber = teacherNumber; | |
30 | + } | |
31 | + | |
32 | + public int getCourseNumber() { | |
33 | + return courseNumber; | |
34 | + } | |
35 | + | |
36 | + public void setCourseNumber(int courseNumber) { | |
37 | + this.courseNumber = courseNumber; | |
38 | + } | |
39 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/rep/JoinDetail.java | |
... | ... | @@ -0,0 +1,46 @@ |
1 | +package com.jevon.vo.rep; | |
2 | + | |
3 | +/** | |
4 | + * @author chen | |
5 | + * @version 1.0 | |
6 | + * @date 2019/10/11 0011 14:27 | |
7 | + */ | |
8 | +public class JoinDetail { | |
9 | + | |
10 | + private int courseGroup ; | |
11 | + private String courseName ; | |
12 | + private String className ; | |
13 | + private String teacherName ; | |
14 | + | |
15 | + public int getCourseGroup() { | |
16 | + return courseGroup; | |
17 | + } | |
18 | + | |
19 | + public void setCourseGroup(int courseGroup) { | |
20 | + this.courseGroup = courseGroup; | |
21 | + } | |
22 | + | |
23 | + public String getCourseName() { | |
24 | + return courseName; | |
25 | + } | |
26 | + | |
27 | + public void setCourseName(String courseName) { | |
28 | + this.courseName = courseName; | |
29 | + } | |
30 | + | |
31 | + public String getClassName() { | |
32 | + return className; | |
33 | + } | |
34 | + | |
35 | + public void setClassName(String className) { | |
36 | + this.className = className; | |
37 | + } | |
38 | + | |
39 | + public String getTeacherName() { | |
40 | + return teacherName; | |
41 | + } | |
42 | + | |
43 | + public void setTeacherName(String teacherName) { | |
44 | + this.teacherName = teacherName; | |
45 | + } | |
46 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/rep/JoinRepVo.java | |
... | ... | @@ -0,0 +1,23 @@ |
1 | +package com.jevon.vo.rep; | |
2 | + | |
3 | +import com.jevon.vo.BaseVo; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * @author chen | |
9 | + * @version 1.0 | |
10 | + * @date 2019/10/11 0011 14:28 | |
11 | + */ | |
12 | +public class JoinRepVo extends BaseVo { | |
13 | + | |
14 | + private List<JoinDetail> data ; | |
15 | + | |
16 | + public List<JoinDetail> getData() { | |
17 | + return data; | |
18 | + } | |
19 | + | |
20 | + public void setData(List<JoinDetail> data) { | |
21 | + this.data = data; | |
22 | + } | |
23 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/rep/ScheduleListRepVo.java | |
... | ... | @@ -0,0 +1,27 @@ |
1 | +package com.jevon.vo.rep; | |
2 | + | |
3 | +import com.jevon.model.Schedule; | |
4 | +import com.jevon.vo.BaseVo; | |
5 | + | |
6 | +import java.util.List; | |
7 | + | |
8 | +/** | |
9 | + * @author chen | |
10 | + * @version 1.0 | |
11 | + * @date 2019/10/11 0011 14:03 | |
12 | + */ | |
13 | +public class ScheduleListRepVo extends BaseVo { | |
14 | + | |
15 | + private List<Schedule> data ; | |
16 | + | |
17 | + public List<Schedule> getData() { | |
18 | + return data; | |
19 | + } | |
20 | + | |
21 | + public void setData(List<Schedule> data) { | |
22 | + this.data = data; | |
23 | + } | |
24 | + public ScheduleListRepVo(){ | |
25 | + super(); | |
26 | + } | |
27 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/rep/ScheduleRepVo.java | |
... | ... | @@ -0,0 +1,21 @@ |
1 | +package com.jevon.vo.rep; | |
2 | + | |
3 | +import com.jevon.vo.BaseVo; | |
4 | + | |
5 | +/** | |
6 | + * @author chen | |
7 | + * @version 1.0 | |
8 | + * @date 2019/10/10 0010 11:32 | |
9 | + */ | |
10 | +public class ScheduleRepVo extends BaseVo { | |
11 | + | |
12 | + private int scheduleId ; | |
13 | + | |
14 | + public int getScheduleId() { | |
15 | + return scheduleId; | |
16 | + } | |
17 | + | |
18 | + public void setScheduleId(int scheduleId) { | |
19 | + this.scheduleId = scheduleId; | |
20 | + } | |
21 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/rep/TeacherCourseRepVo.java | |
... | ... | @@ -0,0 +1,32 @@ |
1 | +package com.jevon.vo.rep; | |
2 | + | |
3 | +import com.jevon.vo.BaseVo; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * @author chen | |
9 | + * @version 1.0 | |
10 | + * @date 2019/10/12 0012 8:32 | |
11 | + */ | |
12 | +public class TeacherCourseRepVo extends BaseVo { | |
13 | + | |
14 | + private List<ClassCourseVO> data ; | |
15 | + private List<String> courseNameList ; | |
16 | + | |
17 | + public List<ClassCourseVO> getData() { | |
18 | + return data; | |
19 | + } | |
20 | + | |
21 | + public void setData(List<ClassCourseVO> data) { | |
22 | + this.data = data; | |
23 | + } | |
24 | + | |
25 | + public List<String> getCourseNameList() { | |
26 | + return courseNameList; | |
27 | + } | |
28 | + | |
29 | + public void setCourseNameList(List<String> courseNameList) { | |
30 | + this.courseNameList = courseNameList; | |
31 | + } | |
32 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/req/CourseClassReqVo.java | |
... | ... | @@ -0,0 +1,28 @@ |
1 | +package com.jevon.vo.req; | |
2 | + | |
3 | +/** | |
4 | + * @author chen | |
5 | + * @version 1.0 | |
6 | + * @date 2019/10/12 0012 9:18 | |
7 | + */ | |
8 | +public class CourseClassReqVo { | |
9 | + | |
10 | + private int scheduleId ; | |
11 | + private int courseId ; | |
12 | + | |
13 | + public int getScheduleId() { | |
14 | + return scheduleId; | |
15 | + } | |
16 | + | |
17 | + public void setScheduleId(int scheduleId) { | |
18 | + this.scheduleId = scheduleId; | |
19 | + } | |
20 | + | |
21 | + public int getCourseId() { | |
22 | + return courseId; | |
23 | + } | |
24 | + | |
25 | + public void setCourseId(int courseId) { | |
26 | + this.courseId = courseId; | |
27 | + } | |
28 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/req/CourseGroupReqVo.java | |
... | ... | @@ -0,0 +1,28 @@ |
1 | +package com.jevon.vo.req; | |
2 | + | |
3 | +/** | |
4 | + * @author chen | |
5 | + * @version 1.0 | |
6 | + * @date 2019/10/12 0012 8:58 | |
7 | + */ | |
8 | +public class CourseGroupReqVo { | |
9 | + | |
10 | + private int scheduleId ; | |
11 | + private int courseGroup ; | |
12 | + | |
13 | + public int getScheduleId() { | |
14 | + return scheduleId; | |
15 | + } | |
16 | + | |
17 | + public void setScheduleId(int scheduleId) { | |
18 | + this.scheduleId = scheduleId; | |
19 | + } | |
20 | + | |
21 | + public int getCourseGroup() { | |
22 | + return courseGroup; | |
23 | + } | |
24 | + | |
25 | + public void setCourseGroup(int courseGroup) { | |
26 | + this.courseGroup = courseGroup; | |
27 | + } | |
28 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/req/CreateScheduleReqVo.java | |
... | ... | @@ -0,0 +1,36 @@ |
1 | +package com.jevon.vo.req; | |
2 | + | |
3 | +/** | |
4 | + * @author chen | |
5 | + * @version 1.0 | |
6 | + * @date 2019/10/14 0014 8:24 | |
7 | + */ | |
8 | +public class CreateScheduleReqVo { | |
9 | + private int schoolId ; | |
10 | + private String team ; | |
11 | + private String scheduleName ; | |
12 | + | |
13 | + public int getSchoolId() { | |
14 | + return schoolId; | |
15 | + } | |
16 | + | |
17 | + public void setSchoolId(int schoolId) { | |
18 | + this.schoolId = schoolId; | |
19 | + } | |
20 | + | |
21 | + public String getTeam() { | |
22 | + return team; | |
23 | + } | |
24 | + | |
25 | + public void setTeam(String team) { | |
26 | + this.team = team; | |
27 | + } | |
28 | + | |
29 | + public String getScheduleName() { | |
30 | + return scheduleName; | |
31 | + } | |
32 | + | |
33 | + public void setScheduleName(String scheduleName) { | |
34 | + this.scheduleName = scheduleName; | |
35 | + } | |
36 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/req/FirstReqVo.java | |
... | ... | @@ -0,0 +1,50 @@ |
1 | +package com.jevon.vo.req; | |
2 | + | |
3 | +public class FirstReqVo { | |
4 | + | |
5 | + private int scheduleId; | |
6 | + private int morning ; | |
7 | + private int afternoon; | |
8 | + private int night ; | |
9 | + private int dayNumber; | |
10 | + | |
11 | + public int getScheduleId() { | |
12 | + return scheduleId; | |
13 | + } | |
14 | + | |
15 | + public void setScheduleId(int scheduleId) { | |
16 | + this.scheduleId = scheduleId; | |
17 | + } | |
18 | + | |
19 | + public int getMorning() { | |
20 | + return morning; | |
21 | + } | |
22 | + | |
23 | + public void setMorning(int morning) { | |
24 | + this.morning = morning; | |
25 | + } | |
26 | + | |
27 | + public int getAfternoon() { | |
28 | + return afternoon; | |
29 | + } | |
30 | + | |
31 | + public void setAfternoon(int afternoon) { | |
32 | + this.afternoon = afternoon; | |
33 | + } | |
34 | + | |
35 | + public int getNight() { | |
36 | + return night; | |
37 | + } | |
38 | + | |
39 | + public void setNight(int night) { | |
40 | + this.night = night; | |
41 | + } | |
42 | + | |
43 | + public int getDayNumber() { | |
44 | + return dayNumber; | |
45 | + } | |
46 | + | |
47 | + public void setDayNumber(int dayNumber) { | |
48 | + this.dayNumber = dayNumber; | |
49 | + } | |
50 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/req/GetClassCourseReqVo.java | |
... | ... | @@ -0,0 +1,28 @@ |
1 | +package com.jevon.vo.req; | |
2 | + | |
3 | +/** | |
4 | + * @author chen | |
5 | + * @version 1.0 | |
6 | + * @date 2019/10/11 0011 10:21 | |
7 | + */ | |
8 | +public class GetClassCourseReqVo { | |
9 | + | |
10 | + private int scheduleId ; | |
11 | + private int classId ; | |
12 | + | |
13 | + public int getScheduleId() { | |
14 | + return scheduleId; | |
15 | + } | |
16 | + | |
17 | + public void setScheduleId(int scheduleId) { | |
18 | + this.scheduleId = scheduleId; | |
19 | + } | |
20 | + | |
21 | + public int getClassId() { | |
22 | + return classId; | |
23 | + } | |
24 | + | |
25 | + public void setClassId(int classId) { | |
26 | + this.classId = classId; | |
27 | + } | |
28 | +} | ... | ... |
src/main/java/com/jevon/vo/req/InitTeacherCourseReqVo.java
0 → 100644
1 | +++ a/src/main/java/com/jevon/vo/req/InitTeacherCourseReqVo.java | |
... | ... | @@ -0,0 +1,27 @@ |
1 | +package com.jevon.vo.req; | |
2 | + | |
3 | +/** | |
4 | + * @author chen | |
5 | + * @version 1.0 | |
6 | + * @date 2019/10/10 0010 9:04 | |
7 | + */ | |
8 | +public class InitTeacherCourseReqVo { | |
9 | + private int scheduleId ; | |
10 | + private String url ; | |
11 | + | |
12 | + public int getScheduleId() { | |
13 | + return scheduleId; | |
14 | + } | |
15 | + | |
16 | + public void setScheduleId(int scheduleId) { | |
17 | + this.scheduleId = scheduleId; | |
18 | + } | |
19 | + | |
20 | + public String getUrl() { | |
21 | + return url; | |
22 | + } | |
23 | + | |
24 | + public void setUrl(String url) { | |
25 | + this.url = url; | |
26 | + } | |
27 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/req/JoinClassReqVo.java | |
... | ... | @@ -0,0 +1,39 @@ |
1 | +package com.jevon.vo.req; | |
2 | + | |
3 | +import java.util.List; | |
4 | + | |
5 | +/** | |
6 | + * @author chen | |
7 | + * @version 1.0 | |
8 | + * @date 2019/10/10 0010 8:40 | |
9 | + */ | |
10 | +public class JoinClassReqVo { | |
11 | + | |
12 | + private int scheduleId ; | |
13 | + private int courseId ; | |
14 | + private List<Integer> classIdList ; | |
15 | + | |
16 | + public int getScheduleId() { | |
17 | + return scheduleId; | |
18 | + } | |
19 | + | |
20 | + public void setScheduleId(int scheduleId) { | |
21 | + this.scheduleId = scheduleId; | |
22 | + } | |
23 | + | |
24 | + public int getCourseId() { | |
25 | + return courseId; | |
26 | + } | |
27 | + | |
28 | + public void setCourseId(int courseId) { | |
29 | + this.courseId = courseId; | |
30 | + } | |
31 | + | |
32 | + public List<Integer> getClassIdList() { | |
33 | + return classIdList; | |
34 | + } | |
35 | + | |
36 | + public void setClassIdList(List<Integer> classIdList) { | |
37 | + this.classIdList = classIdList; | |
38 | + } | |
39 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/req/NoScheduleReqVo.java | |
... | ... | @@ -0,0 +1,57 @@ |
1 | +package com.jevon.vo.req; | |
2 | + | |
3 | +import java.util.List; | |
4 | + | |
5 | +/** | |
6 | + * @author chen | |
7 | + * @version 1.0 | |
8 | + * @date 2019/10/9 0009 15:53 | |
9 | + */ | |
10 | +public class NoScheduleReqVo { | |
11 | + | |
12 | + private int scheduleId ; | |
13 | + private String grade ; | |
14 | + private int classId ; | |
15 | + private int level ; //1 班级不排 2 年级不排 3 学校不排 | |
16 | + private List<String> list ; | |
17 | + | |
18 | + public int getScheduleId() { | |
19 | + return scheduleId; | |
20 | + } | |
21 | + | |
22 | + public void setScheduleId(int scheduleId) { | |
23 | + this.scheduleId = scheduleId; | |
24 | + } | |
25 | + | |
26 | + public int getLevel() { | |
27 | + return level; | |
28 | + } | |
29 | + | |
30 | + public void setLevel(int level) { | |
31 | + this.level = level; | |
32 | + } | |
33 | + | |
34 | + public List<String> getList() { | |
35 | + return list; | |
36 | + } | |
37 | + | |
38 | + public void setList(List<String> list) { | |
39 | + this.list = list; | |
40 | + } | |
41 | + | |
42 | + public String getGrade() { | |
43 | + return grade; | |
44 | + } | |
45 | + | |
46 | + public void setGrade(String grade) { | |
47 | + this.grade = grade; | |
48 | + } | |
49 | + | |
50 | + public int getClassId() { | |
51 | + return classId; | |
52 | + } | |
53 | + | |
54 | + public void setClassId(int classId) { | |
55 | + this.classId = classId; | |
56 | + } | |
57 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/req/ParallelClassReqVo.java | |
... | ... | @@ -0,0 +1,67 @@ |
1 | +package com.jevon.vo.req; | |
2 | + | |
3 | +import java.util.List; | |
4 | + | |
5 | +/** | |
6 | + * @author chen | |
7 | + * @version 1.0 | |
8 | + * @date 2019/9/25 0025 8:41 | |
9 | + */ | |
10 | +public class ParallelClassReqVo { | |
11 | + | |
12 | + private int scheduleId ; | |
13 | + private List<String> intervalList ; | |
14 | + private int courseType; | |
15 | + | |
16 | + private int level ; | |
17 | + private String grade ; | |
18 | + private int classId ; | |
19 | + | |
20 | + public int getScheduleId() { | |
21 | + return scheduleId; | |
22 | + } | |
23 | + | |
24 | + public void setScheduleId(int scheduleId) { | |
25 | + this.scheduleId = scheduleId; | |
26 | + } | |
27 | + | |
28 | + public List<String> getIntervalList() { | |
29 | + return intervalList; | |
30 | + } | |
31 | + | |
32 | + public void setIntervalList(List<String> intervalList) { | |
33 | + this.intervalList = intervalList; | |
34 | + } | |
35 | + | |
36 | + public int getCourseType() { | |
37 | + return courseType; | |
38 | + } | |
39 | + | |
40 | + public void setCourseType(int courseType) { | |
41 | + this.courseType = courseType; | |
42 | + } | |
43 | + | |
44 | + public int getLevel() { | |
45 | + return level; | |
46 | + } | |
47 | + | |
48 | + public void setLevel(int level) { | |
49 | + this.level = level; | |
50 | + } | |
51 | + | |
52 | + public String getGrade() { | |
53 | + return grade; | |
54 | + } | |
55 | + | |
56 | + public void setGrade(String grade) { | |
57 | + this.grade = grade; | |
58 | + } | |
59 | + | |
60 | + public int getClassId() { | |
61 | + return classId; | |
62 | + } | |
63 | + | |
64 | + public void setClassId(int classId) { | |
65 | + this.classId = classId; | |
66 | + } | |
67 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/req/RecallReqVo.java | |
... | ... | @@ -0,0 +1,27 @@ |
1 | +package com.jevon.vo.req; | |
2 | + | |
3 | +/** | |
4 | + * @author chen | |
5 | + * @version 1.0 | |
6 | + * @date 2019/10/15 0015 8:08 | |
7 | + */ | |
8 | +public class RecallReqVo { | |
9 | + private int scheduleId ; | |
10 | + private int number ;// 对应页面 1不排课 2 公共课 3 主课 4 副课 | |
11 | + | |
12 | + public int getScheduleId() { | |
13 | + return scheduleId; | |
14 | + } | |
15 | + | |
16 | + public void setScheduleId(int scheduleId) { | |
17 | + this.scheduleId = scheduleId; | |
18 | + } | |
19 | + | |
20 | + public int getNumber() { | |
21 | + return number; | |
22 | + } | |
23 | + | |
24 | + public void setNumber(int number) { | |
25 | + this.number = number; | |
26 | + } | |
27 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/req/ScheduleIdReqVo.java | |
... | ... | @@ -0,0 +1,19 @@ |
1 | +package com.jevon.vo.req; | |
2 | + | |
3 | +/** | |
4 | + * @author chen | |
5 | + * @version 1.0 | |
6 | + * @date 2019/10/11 0011 14:41 | |
7 | + */ | |
8 | +public class ScheduleIdReqVo { | |
9 | + | |
10 | + private int scheduleId ; | |
11 | + | |
12 | + public int getScheduleId() { | |
13 | + return scheduleId; | |
14 | + } | |
15 | + | |
16 | + public void setScheduleId(int scheduleId) { | |
17 | + this.scheduleId = scheduleId; | |
18 | + } | |
19 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/req/SchoolIdReqVo.java | |
... | ... | @@ -0,0 +1,19 @@ |
1 | +package com.jevon.vo.req; | |
2 | + | |
3 | +/** | |
4 | + * @author chen | |
5 | + * @version 1.0 | |
6 | + * @date 2019/10/11 0011 14:41 | |
7 | + */ | |
8 | +public class SchoolIdReqVo { | |
9 | + | |
10 | + private int schoolId ; | |
11 | + | |
12 | + public int getSchoolId() { | |
13 | + return schoolId; | |
14 | + } | |
15 | + | |
16 | + public void setSchoolId(int schoolId) { | |
17 | + this.schoolId = schoolId; | |
18 | + } | |
19 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/req/SetTypeReqVo.java | |
... | ... | @@ -0,0 +1,40 @@ |
1 | +package com.jevon.vo.req; | |
2 | + | |
3 | +import java.util.List; | |
4 | + | |
5 | +/** | |
6 | + * @author chen | |
7 | + * @version 1.0 | |
8 | + * @date 2019/10/9 0009 16:32 | |
9 | + */ | |
10 | +public class SetTypeReqVo { | |
11 | + | |
12 | + private int scheduleId ; | |
13 | + private int courseType ; // 1 主课 2 副课 3 公共课 | |
14 | + private List<Integer> courseIdList ; | |
15 | + | |
16 | + | |
17 | + public int getCourseType() { | |
18 | + return courseType; | |
19 | + } | |
20 | + | |
21 | + public void setCourseType(int courseType) { | |
22 | + this.courseType = courseType; | |
23 | + } | |
24 | + | |
25 | + public int getScheduleId() { | |
26 | + return scheduleId; | |
27 | + } | |
28 | + | |
29 | + public void setScheduleId(int scheduleId) { | |
30 | + this.scheduleId = scheduleId; | |
31 | + } | |
32 | + | |
33 | + public List<Integer> getCourseIdList() { | |
34 | + return courseIdList; | |
35 | + } | |
36 | + | |
37 | + public void setCourseIdList(List<Integer> courseIdList) { | |
38 | + this.courseIdList = courseIdList; | |
39 | + } | |
40 | +} | ... | ... |
1 | +++ a/src/main/java/com/jevon/vo/req/UpdateScheduleReqVo.java | |
... | ... | @@ -0,0 +1,36 @@ |
1 | +package com.jevon.vo.req; | |
2 | + | |
3 | +/** | |
4 | + * @author chen | |
5 | + * @version 1.0 | |
6 | + * @date 2019/10/14 0014 16:52 | |
7 | + */ | |
8 | +public class UpdateScheduleReqVo { | |
9 | + private int scheduleId; | |
10 | + private String team ; | |
11 | + private String scheduleName ; | |
12 | + | |
13 | + public int getScheduleId() { | |
14 | + return scheduleId; | |
15 | + } | |
16 | + | |
17 | + public void setScheduleId(int scheduleId) { | |
18 | + this.scheduleId = scheduleId; | |
19 | + } | |
20 | + | |
21 | + public String getTeam() { | |
22 | + return team; | |
23 | + } | |
24 | + | |
25 | + public void setTeam(String team) { | |
26 | + this.team = team; | |
27 | + } | |
28 | + | |
29 | + public String getScheduleName() { | |
30 | + return scheduleName; | |
31 | + } | |
32 | + | |
33 | + public void setScheduleName(String scheduleName) { | |
34 | + this.scheduleName = scheduleName; | |
35 | + } | |
36 | +} | ... | ... |
1 | +++ a/src/main/resources/application.yml | |
... | ... | @@ -0,0 +1,54 @@ |
1 | +server: | |
2 | + port: 8008 | |
3 | + | |
4 | +spring: | |
5 | + freemarker: | |
6 | + template-loader-path: classpath:/templates/ | |
7 | + prefix: | |
8 | + suffix: .html | |
9 | + ##是否允许使用request | |
10 | + allow-request-override: true | |
11 | + request-context-attribute: request | |
12 | + | |
13 | + cache: false | |
14 | + check-template-location: true | |
15 | + charset: UTF-8 | |
16 | + content-type: text/html;charset=UTF-8 | |
17 | + expose-request-attributes: false | |
18 | + expose-session-attributes: false | |
19 | + expose-spring-macro-helpers: false | |
20 | + | |
21 | + datasource: | |
22 | + username: SZJXTUSER | |
23 | + password: xst200919 | |
24 | + url: jdbc:sqlserver://60.190.202.57:14333;database=SmartPaike | |
25 | + driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver | |
26 | + filters: stat | |
27 | + maxActive: 20 | |
28 | + initialSize: 1 | |
29 | + maxWait: 60000 | |
30 | + minIdle: 1 | |
31 | + timeBetweenEvictionRunsMillis: 60000 | |
32 | + minEvictableIdleTimeMillis: 300000 | |
33 | + validationQuery: select 'x' | |
34 | + testWhileIdle: true | |
35 | + testOnBorrow: false | |
36 | + testOnReturn: false | |
37 | + poolPreparedStatements: true | |
38 | + maxOpenPreparedStatements: 20 | |
39 | + | |
40 | +mybatis: | |
41 | + mapper-locations: classpath:mapping/*.xml | |
42 | + type-aliases-package: com.jevon.model | |
43 | + | |
44 | +#pagehelper | |
45 | +pagehelper: | |
46 | + helperDialect: mysql | |
47 | + reasonable: true | |
48 | + supportMethodsArguments: true | |
49 | + params: count=countSql | |
50 | + | |
51 | +#logger | |
52 | +Logger: | |
53 | + level: | |
54 | + com.jevon.mapper: info | ... | ... |
1 | +++ a/src/main/resources/logback.xml | |
... | ... | @@ -0,0 +1,61 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<configuration debug="true"> | |
3 | + <!-- 项目名称 --> | |
4 | + <property name="PROJECT_NAME" value="schedule" /> | |
5 | + | |
6 | + <!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径--> | |
7 | + <!-- <property name="LOG_HOME" value="/opt/web/log/" />--> | |
8 | + <property name="LOG_HOME" value="D://log"/> | |
9 | + | |
10 | + <!-- 控制台输出 --> | |
11 | + <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> | |
12 | + <!--<withJansi>true</withJansi>--> | |
13 | + <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> | |
14 | + <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符--> | |
15 | + <pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%thread] %highlight([%-5level] %logger{50} - %msg%n)</pattern> | |
16 | + <charset>UTF-8</charset> | |
17 | + </encoder> | |
18 | + </appender> | |
19 | + | |
20 | + <!-- 按照每天生成日志文件 --> | |
21 | + <appender name="SYSTEM_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |
22 | + <!-- 过滤器,只打印ERROR级别的日志 --> | |
23 | + <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> | |
24 | + <!--日志文件输出的文件名--> | |
25 | + <FileNamePattern>${LOG_HOME}/${PROJECT_NAME}.system-dev.%d{yyyy-MM-dd HH}.%i.log</FileNamePattern> | |
26 | + <!--日志文件保留天数--> | |
27 | + <MaxHistory>30</MaxHistory> | |
28 | + <!--日志文件最大的大小--> | |
29 | + <MaxFileSize>100MB</MaxFileSize> | |
30 | + </rollingPolicy> | |
31 | + | |
32 | + <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> | |
33 | + <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符--> | |
34 | + <pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%thread] [%-5level] %logger{50} - %msg%n</pattern> | |
35 | + <charset>UTF-8</charset> | |
36 | + </encoder> | |
37 | + </appender> | |
38 | + <logger name="system_error" additivity="true"> | |
39 | + <appender-ref ref="SYSTEM_FILE"/> | |
40 | + </logger> | |
41 | + | |
42 | + <!-- 设置Spring&Hibernate日志输出级别 --> | |
43 | + <logger name="org.springframework" level="WARN" /> | |
44 | + <logger name="org.mybatis" level="WARN" /> | |
45 | + <logger name="com.ibatis" level="DEBUG" /> | |
46 | + <logger name="com.ibatis.common.jdbc.SimpleDataSource" level="DEBUG" /> | |
47 | + <logger name="com.ibatis.common.jdbc.ScriptRunner" level="DEBUG" /> | |
48 | + <logger name="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate" level="DEBUG" /> | |
49 | + | |
50 | + | |
51 | + <logger name="java.sql.Connection" level="DEBUG" /> | |
52 | + <logger name="java.sql.Statement" level="DEBUG" /> | |
53 | + <logger name="java.sql.PreparedStatement" level="DEBUG" /> | |
54 | + <logger name="com.jevon.mapper" level="DEBUG" /> | |
55 | + <!-- 开发环境下的日志配置 --> | |
56 | + <root level="ERROR"> | |
57 | + <appender-ref ref="CONSOLE" /> | |
58 | + <appender-ref ref="SYSTEM_FILE" /> | |
59 | + </root> | |
60 | + | |
61 | +</configuration> | |
0 | 62 | \ No newline at end of file | ... | ... |
1 | +++ a/src/main/resources/mapping/ClassCourseMapper.xml | |
... | ... | @@ -0,0 +1,112 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | |
3 | +<mapper namespace="com.jevon.mapper.ClassCourseMapper" > | |
4 | + <resultMap id="BaseResultMap" type="com.jevon.model.ClassCourse" > | |
5 | + <id column="course_id" property="courseId" jdbcType="INTEGER" /> | |
6 | + <result column="school_id" property="schoolId" jdbcType="INTEGER" /> | |
7 | + <result column="grade" property="grade" jdbcType="INTEGER" /> | |
8 | + <result column="class_id" property="classId" jdbcType="INTEGER" /> | |
9 | + <result column="single_or_double" property="singleOrDouble" jdbcType="INTEGER" /> | |
10 | + <result column="week" property="week" jdbcType="INTEGER" /> | |
11 | + <result column="course_number" property="courseNumber" jdbcType="INTEGER" /> | |
12 | + <result column="course_name" property="courseName" jdbcType="VARCHAR" /> | |
13 | + <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> | |
14 | + <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> | |
15 | + <result column="team" property="team" jdbcType="VARCHAR" /> | |
16 | + <result column="course_open_id" property="courseOpenId" jdbcType="INTEGER" /> | |
17 | + </resultMap> | |
18 | + <sql id="Base_Column_List" > | |
19 | + course_id, school_id, grade, class_id, single_or_double, week, course_number, course_name, | |
20 | + create_time, update_time,team,course_open_id | |
21 | + </sql> | |
22 | + | |
23 | + <insert id="insertBatch" parameterType="java.util.List"> | |
24 | + insert into sz_sch_class_course ( school_id, grade, | |
25 | + class_id, single_or_double, week, | |
26 | + course_number, course_name, create_time, | |
27 | + update_time,team,course_open_id) | |
28 | + values | |
29 | + <foreach collection="list" item="emp" separator=","> | |
30 | + (#{emp.schoolId,jdbcType=INTEGER}, #{emp.grade,jdbcType=INTEGER}, | |
31 | + #{emp.classId,jdbcType=INTEGER}, #{emp.singleOrDouble,jdbcType=INTEGER}, #{emp.week,jdbcType=INTEGER}, | |
32 | + #{emp.courseNumber,jdbcType=INTEGER}, #{emp.courseName,jdbcType=VARCHAR}, #{emp.createTime,jdbcType=TIMESTAMP}, | |
33 | + #{emp.updateTime,jdbcType=TIMESTAMP},#{emp.team,jdbcType=VARCHAR}, #{emp.courseOpenId,jdbcType=INTEGER}) | |
34 | + </foreach> | |
35 | + </insert> | |
36 | + | |
37 | + <update id="recallClassCourse" parameterType="com.jevon.model.ClassCourse"> | |
38 | + update sz_sch_class_course set course_name = null where school_id = #{schoolId} | |
39 | + and course_name = #{courseName} | |
40 | + </update> | |
41 | + | |
42 | + <select id="selectClassCourseByClass" parameterType="com.jevon.model.ClassCourse" resultMap="BaseResultMap"> | |
43 | + select * from sz_sch_class_course where team = #{team} and school_id = #{schoolId} | |
44 | + <if test="grade != null"> | |
45 | + and grade = #{grade} | |
46 | + </if> | |
47 | + <if test="classId != null"> | |
48 | + and class_id = #{classId} | |
49 | + </if> | |
50 | + and week =#{week} and course_number =#{courseNumber} and single_or_double = #{singleOrDouble} | |
51 | + </select> | |
52 | + | |
53 | + <select id="selectClassCourse" parameterType="com.jevon.model.ClassCourse" resultMap="BaseResultMap"> | |
54 | + select * from sz_sch_class_course where team =#{team} and class_id = #{classId} | |
55 | + and week = #{week} and course_number = #{courseNumber} and single_or_double =#{singleOrDouble} | |
56 | + </select> | |
57 | + | |
58 | + <select id="selectWeekCourse" parameterType="com.jevon.model.ClassCourse" resultMap="BaseResultMap"> | |
59 | + select * from sz_sch_class_course where team =#{team} and class_id = #{classId} and week = #{week} and single_or_double = #{singleOrDouble} | |
60 | + and course_name = #{courseName} | |
61 | + </select> | |
62 | + | |
63 | + <select id="selectNoCourse" parameterType="com.jevon.model.ClassCourse" resultMap="BaseResultMap"> | |
64 | + select * from sz_sch_class_course where team =#{team} and class_id = #{classId} | |
65 | + and course_name is null and week != 6 and week != 7 | |
66 | + </select> | |
67 | + | |
68 | + <select id="selectSingleOrDouble" parameterType="com.jevon.model.ClassCourse" resultType="java.lang.Integer"> | |
69 | + select max(single_or_double) | |
70 | + from sz_sch_class_course where team =#{team} and grade = #{grade} and school_id = #{schoolId} | |
71 | + </select> | |
72 | + | |
73 | + <select id="selectMaxCourseNumber" parameterType="com.jevon.model.ClassCourse" resultType="java.lang.Integer"> | |
74 | + select max(course_number) from sz_sch_class_course where team =#{team} and school_id = #{schoolId} | |
75 | + </select> | |
76 | + | |
77 | + <select id="selectByClassIdAndSingleOrDouble" parameterType="com.jevon.model.ClassCourse" resultMap="BaseResultMap"> | |
78 | + select * from sz_sch_class_course where team =#{team} and class_id = #{classId} and single_or_double = #{singleOrDouble} order by week , course_number | |
79 | + </select> | |
80 | + | |
81 | + <select id="copyClassCourse" parameterType="com.jevon.model.ClassCourse" resultMap="BaseResultMap"> | |
82 | + select * from sz_sch_class_course where team =#{team} and school_id = #{schoolId} | |
83 | + </select> | |
84 | + <delete id="deleteBySchoolIdAndTeam" parameterType="com.jevon.model.ClassCourse"> | |
85 | + delete from sz_sch_class_course where team =#{team} and school_id = #{schoolId} | |
86 | + </delete> | |
87 | + | |
88 | + <select id="selectCourseByClassIdAndWeek" parameterType="com.jevon.model.ClassCourse" resultMap="BaseResultMap"> | |
89 | + select * from sz_sch_class_course where team =#{team} and class_id = #{classId} and week = ${week} and course_name = #{courseName} | |
90 | + and single_or_double =#{singleOrDouble} | |
91 | + </select> | |
92 | + | |
93 | + <update id="updatePublicOreElective" parameterType="com.jevon.model.ClassCourse" > | |
94 | + update sz_sch_class_course set course_name = #{courseName} where team =#{team} and school_id = #{schoolId} and grade = #{grade} | |
95 | + and week=#{week} and course_number = #{courseNumber} and single_or_double = #{singleOrDouble} | |
96 | + </update> | |
97 | + | |
98 | + <update id="updateByPrimaryKey" parameterType="com.jevon.model.ClassCourse" > | |
99 | + update sz_sch_class_course | |
100 | + set school_id = #{schoolId,jdbcType=INTEGER}, | |
101 | + grade = #{grade,jdbcType=INTEGER}, | |
102 | + class_id = #{classId,jdbcType=INTEGER}, | |
103 | + single_or_double = #{singleOrDouble,jdbcType=INTEGER}, | |
104 | + week = #{week,jdbcType=INTEGER}, | |
105 | + course_number = #{courseNumber,jdbcType=INTEGER}, | |
106 | + course_name = #{courseName,jdbcType=VARCHAR}, | |
107 | + course_open_id = #{courseOpenId,jdbcType=INTEGER}, | |
108 | + create_time = #{createTime,jdbcType=TIMESTAMP}, | |
109 | + update_time = #{updateTime,jdbcType=TIMESTAMP} | |
110 | + where course_id = #{courseId,jdbcType=INTEGER} | |
111 | + </update> | |
112 | +</mapper> | |
0 | 113 | \ No newline at end of file | ... | ... |
1 | +++ a/src/main/resources/mapping/ClassModelMapper.xml | |
... | ... | @@ -0,0 +1,52 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | |
3 | +<mapper namespace="com.jevon.mapper.ClassModelMapper" > | |
4 | + <resultMap id="BaseResultMap" type="com.jevon.model.ClassModel" > | |
5 | + <id column="class_id" property="classId" jdbcType="INTEGER" /> | |
6 | + <result column="school_id" property="schoolId" jdbcType="INTEGER" /> | |
7 | + <result column="grade" property="grade" jdbcType="VARCHAR" /> | |
8 | + <result column="class_name" property="className" jdbcType="VARCHAR" /> | |
9 | + </resultMap> | |
10 | + <sql id="Base_Column_List" > | |
11 | + class_id, school_id, grade, class_name | |
12 | + </sql> | |
13 | + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" > | |
14 | + select | |
15 | + <include refid="Base_Column_List" /> | |
16 | + from sz_sch_class | |
17 | + where class_id = #{classId,jdbcType=INTEGER} | |
18 | + </select> | |
19 | + | |
20 | + <insert id="insertBatch" parameterType="com.jevon.model.ClassModel" > | |
21 | + insert into sz_sch_class (class_id, school_id, grade, | |
22 | + class_name) | |
23 | + values | |
24 | + <foreach collection="list" item="emp" separator=","> | |
25 | + (#{emp.classId,jdbcType=INTEGER}, #{emp.schoolId,jdbcType=INTEGER}, #{emp.grade,jdbcType=VARCHAR}, | |
26 | + #{emp.className,jdbcType=VARCHAR}) | |
27 | + </foreach> | |
28 | + </insert> | |
29 | + <update id="updateByPrimaryKey" parameterType="com.jevon.model.ClassModel" > | |
30 | + update sz_sch_class | |
31 | + set school_id = #{schoolId,jdbcType=INTEGER}, | |
32 | + grade = #{grade,jdbcType=VARCHAR}, | |
33 | + class_name = #{className,jdbcType=VARCHAR}, | |
34 | + where class_id = #{classId,jdbcType=INTEGER} | |
35 | + </update> | |
36 | + | |
37 | + <select id="selectBySchoolId" parameterType="java.lang.Integer" resultMap="BaseResultMap"> | |
38 | + select * from sz_sch_class where school_id = #{schoolId} | |
39 | + </select> | |
40 | + | |
41 | + <select id="selectBySchoolIdAndGrade" parameterType="com.jevon.model.ClassModel" resultMap="BaseResultMap"> | |
42 | + select * from sz_sch_class where school_id = #{schoolId} and grade = #{grade} | |
43 | + </select> | |
44 | + | |
45 | + <delete id="deleteSchool" parameterType="java.lang.Integer"> | |
46 | + delete from sz_sch_class where school_id = #{schoolId} | |
47 | + </delete> | |
48 | + <select id="selectBySchoolIdAndClassNameAndGrade" parameterType="com.jevon.model.ClassModel" resultMap="BaseResultMap"> | |
49 | + select * from sz_sch_class where school_id = #{schoolId} and class_name = #{className} | |
50 | + and grade = #{grade} | |
51 | + </select> | |
52 | +</mapper> | |
0 | 53 | \ No newline at end of file | ... | ... |
1 | +++ a/src/main/resources/mapping/CourseMapper.xml | |
... | ... | @@ -0,0 +1,50 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | |
3 | +<mapper namespace="com.jevon.mapper.CourseMapper" > | |
4 | + <resultMap id="BaseResultMap" type="com.jevon.model.Course" > | |
5 | + <id column="id" property="id" jdbcType="INTEGER" /> | |
6 | + <result column="school_id" property="schoolId" jdbcType="INTEGER" /> | |
7 | + <result column="course_id" property="courseId" jdbcType="INTEGER" /> | |
8 | + <result column="course_name" property="courseName" jdbcType="VARCHAR" /> | |
9 | + <result column="course_type" property="courseType" jdbcType="INTEGER" /> | |
10 | + </resultMap> | |
11 | + | |
12 | + <insert id="insertBatch" parameterType="java.util.List"> | |
13 | + insert into sz_sch_course ( school_id , course_id, course_name,course_type) | |
14 | + values | |
15 | + <foreach collection="list" item="emp" separator=","> | |
16 | + (#{emp.schoolId,jdbcType=INTEGER}, #{emp.courseId,jdbcType=INTEGER}, #{emp.courseName,jdbcType=VARCHAR},0) | |
17 | + </foreach> | |
18 | + </insert> | |
19 | + | |
20 | + <select id="selectBySchoolId" parameterType="java.lang.Integer" resultMap="BaseResultMap"> | |
21 | + select sz_sch_course. * from sz_sch_course where sz_sch_course.school_Id = #{schoolId} | |
22 | + and sz_sch_course.course_name in ( select course_name from sz_sch_teacher_class where school_id = #{schoolId}) | |
23 | + </select> | |
24 | + | |
25 | + <delete id="deleteSchoolId" parameterType="java.lang.Integer"> | |
26 | + delete from sz_sch_course where school_Id =#{schoolId} | |
27 | + </delete> | |
28 | + | |
29 | + <update id="initSchoolId" parameterType="java.lang.Integer"> | |
30 | + update sz_sch_course set course_type = 0 where school_Id =#{schoolId} | |
31 | + </update> | |
32 | + | |
33 | + <select id="selectByCourse" parameterType="com.jevon.model.Course" resultMap="BaseResultMap"> | |
34 | + select * from sz_sch_course where school_id = #{schoolId} | |
35 | + <if test="courseId != 0"> | |
36 | + and course_id = #{courseId} | |
37 | + </if> | |
38 | + <if test="courseName != null"> | |
39 | + and course_name = #{courseName} | |
40 | + </if> | |
41 | + <if test="courseType != 0"> | |
42 | + and course_type =#{courseType} | |
43 | + </if> | |
44 | + </select> | |
45 | + | |
46 | + <update id="updateCourseType" parameterType="com.jevon.model.Course"> | |
47 | + update sz_sch_course set course_type =#{courseType} where course_id = #{courseId} and school_id = #{schoolId} | |
48 | + </update> | |
49 | + | |
50 | +</mapper> | |
0 | 51 | \ No newline at end of file | ... | ... |
1 | +++ a/src/main/resources/mapping/JoinClassMapper.xml | |
... | ... | @@ -0,0 +1,55 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | |
3 | +<mapper namespace="com.jevon.mapper.JoinClassMapper" > | |
4 | + <resultMap id="BaseResultMap" type="com.jevon.model.JoinClass" > | |
5 | + <id column="id" property="id" jdbcType="INTEGER" /> | |
6 | + <result column="school_id" property="schoolId" jdbcType="INTEGER" /> | |
7 | + <result column="class_id" property="classId" jdbcType="INTEGER" /> | |
8 | + <result column="team" property="team" jdbcType="VARCHAR" /> | |
9 | + <result column="course_id" property="courseId" jdbcType="INTEGER" /> | |
10 | + <result column="course_name" property="courseName" jdbcType="VARCHAR" /> | |
11 | + <result column="course_group" property="courseGroup" jdbcType="INTEGER" /> | |
12 | + </resultMap> | |
13 | + | |
14 | + <insert id="insertBatch" parameterType="java.util.List"> | |
15 | + insert into sz_sch_join_class ( school_id ,class_id,team, course_id, course_name,course_group) | |
16 | + values | |
17 | + <foreach collection="list" item="emp" separator=","> | |
18 | + (#{emp.schoolId,jdbcType=INTEGER}, #{emp.classId,jdbcType=INTEGER}, #{emp.team,jdbcType=VARCHAR} | |
19 | + , #{emp.courseId,jdbcType=INTEGER}, #{emp.courseName,jdbcType=VARCHAR}, #{emp.courseGroup,jdbcType=INTEGER}) | |
20 | + </foreach> | |
21 | + </insert> | |
22 | + | |
23 | + <select id="selectMaxGroup" resultType="java.lang.Integer"> | |
24 | + select max(course_group) from sz_sch_join_class | |
25 | + </select> | |
26 | + | |
27 | + <select id="selectByCourseGroup" parameterType="java.lang.Integer" resultMap="BaseResultMap"> | |
28 | + select * from sz_sch_join_class where course_group = #{courseGroup} | |
29 | + </select> | |
30 | + | |
31 | + <delete id="deleteCourseGroup" parameterType="java.lang.Integer"> | |
32 | + delete from sz_sch_join_class where course_group = #{courseGroup} | |
33 | + </delete> | |
34 | + | |
35 | + <delete id="deleteBySchoolIdAndTeam" parameterType="com.jevon.model.JoinClass"> | |
36 | + delete from sz_sch_join_class where school_id = #{schoolId} and team = #{team} | |
37 | + </delete> | |
38 | + | |
39 | + <select id="selectByCourse" parameterType="com.jevon.model.JoinClass" resultMap="BaseResultMap"> | |
40 | + select * from sz_sch_join_class where school_id = #{schoolId} and team = #{team} | |
41 | + <if test="classId != 0"> | |
42 | + and class_id = #{classId} | |
43 | + </if> | |
44 | + <if test="courseId != 0"> | |
45 | + and course_id = #{courseId} | |
46 | + </if> | |
47 | + <if test="courseName != null"> | |
48 | + and course_name = #{courseName} | |
49 | + </if> | |
50 | + <if test="courseGroup != 0"> | |
51 | + and course_group =#{courseGroup} | |
52 | + </if> | |
53 | + </select> | |
54 | + | |
55 | +</mapper> | |
0 | 56 | \ No newline at end of file | ... | ... |
1 | +++ a/src/main/resources/mapping/ScheduleMapper.xml | |
... | ... | @@ -0,0 +1,49 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | |
3 | +<mapper namespace="com.jevon.mapper.ScheduleMapper" > | |
4 | + <resultMap id="BaseResultMap" type="com.jevon.model.Schedule" > | |
5 | + <id column="id" property="id" jdbcType="INTEGER" /> | |
6 | + <result column="schedule_name" property="scheduleName" jdbcType="VARCHAR" /> | |
7 | + <result column="school_id" property="schoolId" jdbcType="INTEGER" /> | |
8 | + <result column="team" property="team" jdbcType="VARCHAR" /> | |
9 | + <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> | |
10 | + <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> | |
11 | + <result column="speed" property="speed" jdbcType="INTEGER" /> | |
12 | + <result column="morning" property="morning" jdbcType="INTEGER" /> | |
13 | + <result column="afternoon" property="afternoon" jdbcType="INTEGER" /> | |
14 | + <result column="night" property="night" jdbcType="INTEGER" /> | |
15 | + </resultMap> | |
16 | + | |
17 | + <insert id="insert" parameterType="com.jevon.model.Schedule"> | |
18 | + insert into sz_schedule ( schedule_name , school_id, team,create_time,speed) | |
19 | + values (#{scheduleName},#{schoolId},#{team},#{createTime},#{speed}) | |
20 | + </insert> | |
21 | + | |
22 | + <select id="selectById" parameterType="java.lang.Integer" resultMap="BaseResultMap"> | |
23 | + select * from sz_schedule where id =#{id} | |
24 | + </select> | |
25 | + | |
26 | + <select id="selectBySchoolAndTeam" parameterType="com.jevon.model.Schedule" resultMap="BaseResultMap"> | |
27 | + select * from sz_schedule where school_id =#{schoolId} and team =#{team} | |
28 | + </select> | |
29 | + | |
30 | + <select id="selectBySchool" parameterType="java.lang.Integer" resultMap="BaseResultMap"> | |
31 | + select * from sz_schedule where school_id = #{schoolId} | |
32 | + </select> | |
33 | + | |
34 | + <delete id="deleteBySchedule" parameterType="java.lang.Integer"> | |
35 | + delete sz_schedule where id =#{id} | |
36 | + </delete> | |
37 | + | |
38 | + <update id="updateSpeed" parameterType="com.jevon.model.Schedule"> | |
39 | + update sz_schedule set speed = #{speed} where id =#{id} | |
40 | + </update> | |
41 | + | |
42 | + <update id="update" parameterType="com.jevon.model.Schedule"> | |
43 | + update sz_schedule set schedule_name = #{scheduleName} , team =#{team} where id =#{id} | |
44 | + </update> | |
45 | + | |
46 | + <update id="updateZuoxi" parameterType="com.jevon.model.Schedule"> | |
47 | + update sz_schedule set morning = #{morning} , afternoon =#{afternoon} , night=#{night} where id =#{id} | |
48 | + </update> | |
49 | +</mapper> | |
0 | 50 | \ No newline at end of file | ... | ... |
1 | +++ a/src/main/resources/mapping/TeacherClassMapper.xml | |
... | ... | @@ -0,0 +1,208 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | |
3 | +<mapper namespace="com.jevon.mapper.TeacherClassMapper" > | |
4 | + <resultMap id="BaseResultMap" type="com.jevon.model.TeacherClass" > | |
5 | + <id column="t_class_id" property="tClassId" jdbcType="INTEGER" /> | |
6 | + <result column="teacher_id" property="teacherId" jdbcType="INTEGER" /> | |
7 | + <result column="teacher_name" property="teacherName" jdbcType="VARCHAR" /> | |
8 | + <result column="school_id" property="schoolId" jdbcType="INTEGER" /> | |
9 | + <result column="grade" property="grade" jdbcType="INTEGER" /> | |
10 | + <result column="class_id" property="classId" jdbcType="INTEGER" /> | |
11 | + <result column="course_name" property="courseName" jdbcType="VARCHAR" /> | |
12 | + <result column="times" property="times" jdbcType="INTEGER" /> | |
13 | + <result column="join_times" property="joinTimes" jdbcType="INTEGER" /> | |
14 | + <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> | |
15 | + <result column="team" property="team" jdbcType="VARCHAR" /> | |
16 | + <result column="status" property="status" jdbcType="INTEGER" /> | |
17 | + </resultMap> | |
18 | + | |
19 | + | |
20 | + <insert id="insert" parameterType="com.jevon.model.TeacherClass" > | |
21 | + insert into sz_sch_teacher_class (teacher_id, teacher_name, | |
22 | + school_id, grade, class_id, | |
23 | + course_name, times, join_times, | |
24 | + create_time team,status) | |
25 | + values ( #{teacherId,jdbcType=INTEGER}, #{teacherName,jdbcType=VARCHAR}, | |
26 | + #{schoolId,jdbcType=INTEGER}, #{grade,jdbcType=INTEGER}, #{classId,jdbcType=INTEGER}, | |
27 | + #{courseName,jdbcType=VARCHAR}, #{times,jdbcType=INTEGER}, #{joinTimes,jdbcType=INTEGER}, | |
28 | + #{createTime,jdbcType=TIMESTAMP},#{team,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}) | |
29 | + </insert> | |
30 | + <insert id="insertBatch" parameterType="java.util.List" > | |
31 | + insert into sz_sch_teacher_class ( teacher_id, teacher_name, | |
32 | + school_id, grade, class_id, | |
33 | + course_name, times, join_times, | |
34 | + create_time,team,status) | |
35 | + values | |
36 | + <foreach collection="list" item="emp" separator=","> | |
37 | + ( #{emp.teacherId,jdbcType=INTEGER}, #{emp.teacherName,jdbcType=VARCHAR}, | |
38 | + #{emp.schoolId,jdbcType=INTEGER}, #{emp.grade,jdbcType=INTEGER}, #{emp.classId,jdbcType=INTEGER}, | |
39 | + #{emp.courseName,jdbcType=VARCHAR}, #{emp.times,jdbcType=INTEGER}, #{emp.joinTimes,jdbcType=INTEGER}, | |
40 | + #{emp.createTime,jdbcType=TIMESTAMP},#{emp.team,jdbcType=VARCHAR}, #{emp.status,jdbcType=INTEGER}) | |
41 | + </foreach> | |
42 | + </insert> | |
43 | + | |
44 | + <select id="selectById" parameterType="java.lang.Integer" resultMap="BaseResultMap"> | |
45 | + select * from sz_sch_teacher_class where t_class_id =#{tClassId} | |
46 | + </select> | |
47 | + | |
48 | + <select id="selectHasSchedule" parameterType="com.jevon.model.TeacherClass" resultType="java.lang.Integer"> | |
49 | + select count(status) from sz_sch_teacher_class where school_id = #{schoolId} and team = #{team} and status=1 | |
50 | + </select> | |
51 | + | |
52 | + <update id="updateSchedule" parameterType="java.lang.Integer"> | |
53 | + update sz_sch_teacher_class set status = 1 where t_class_id =#{tClassId} | |
54 | + </update> | |
55 | + <update id="recallTeacherClass" parameterType="java.lang.Integer"> | |
56 | + update sz_sch_teacher_class set status = 0 where t_class_id =#{tClassId} | |
57 | + </update> | |
58 | + | |
59 | + <select id="selectBySchoolAndTeam" parameterType="com.jevon.model.TeacherClass" resultMap="BaseResultMap"> | |
60 | + select * from sz_sch_teacher_class where team =#{team} and school_id = #{schoolId} | |
61 | + </select> | |
62 | + <delete id="deleteBySchoolAndTeam" parameterType="com.jevon.model.TeacherClass"> | |
63 | + delete from sz_sch_teacher_class where team =#{team} and school_id = #{schoolId} | |
64 | + </delete> | |
65 | + | |
66 | + <select id="selectByCourseName" parameterType="com.jevon.model.TeacherClass" resultMap="BaseResultMap"> | |
67 | + select * from sz_sch_teacher_class where team =#{team} and school_id = #{schoolId} and course_name = #{courseName} | |
68 | + </select> | |
69 | + | |
70 | + <select id="selectByCourseAndClass" parameterType="com.jevon.model.TeacherClass" resultMap="BaseResultMap"> | |
71 | + select * from sz_sch_teacher_class where team =#{team} and school_id = #{schoolId} and course_name = #{courseName} | |
72 | + <if test="grade != null"> | |
73 | + and grade = #{grade} | |
74 | + </if> | |
75 | + <if test="classId != 0"> | |
76 | + and class_id =#{classId} | |
77 | + </if> | |
78 | + </select> | |
79 | + | |
80 | + <select id="selectByTeacher" parameterType="com.jevon.model.TeacherClass" resultMap="BaseResultMap"> | |
81 | + select * from sz_sch_teacher_class where team =#{team} and school_id= #{schoolId} and teacher_name = #{teacherName} and class_id = #{classId} | |
82 | + </select> | |
83 | + <update id="updateByPrimaryKey" parameterType="com.jevon.model.TeacherClass" > | |
84 | + update sz_sch_teacher_class | |
85 | + set teacher_id = #{teacherId,jdbcType=INTEGER}, | |
86 | + teacher_name = #{teacherName,jdbcType=VARCHAR}, | |
87 | + school_id = #{schoolId,jdbcType=INTEGER}, | |
88 | + grade = #{grade,jdbcType=INTEGER}, | |
89 | + class_id = #{classId,jdbcType=INTEGER}, | |
90 | + course_name = #{courseName,jdbcType=VARCHAR}, | |
91 | + times = #{times,jdbcType=INTEGER}, | |
92 | + join_times = #{joinTimes,jdbcType=INTEGER}, | |
93 | + create_time = #{createTime,jdbcType=TIMESTAMP} | |
94 | + where t_class_id = #{tClassId,jdbcType=INTEGER} | |
95 | + </update> | |
96 | + | |
97 | + <!-- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >--> | |
98 | + <!-- select --> | |
99 | + <!-- <include refid="Base_Column_List" />--> | |
100 | + <!-- from sz_sch_teacher_class--> | |
101 | + <!-- where t_class_id = #{tClassId,jdbcType=INTEGER}--> | |
102 | + <!-- </select>--> | |
103 | + <!-- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >--> | |
104 | + <!-- delete from sz_sch_teacher_class--> | |
105 | + <!-- where t_class_id = #{tClassId,jdbcType=INTEGER}--> | |
106 | + <!-- </delete>--> | |
107 | +<!-- <insert id="insertSelective" parameterType="com.jevon.model.TeacherClass" >--> | |
108 | +<!-- insert into sz_sch_teacher_class--> | |
109 | +<!-- <trim prefix="(" suffix=")" suffixOverrides="," >--> | |
110 | +<!-- <if test="tClassId != null" >--> | |
111 | +<!-- t_class_id,--> | |
112 | +<!-- </if>--> | |
113 | +<!-- <if test="teacherId != null" >--> | |
114 | +<!-- teacher_id,--> | |
115 | +<!-- </if>--> | |
116 | +<!-- <if test="teacherName != null" >--> | |
117 | +<!-- teacher_name,--> | |
118 | +<!-- </if>--> | |
119 | +<!-- <if test="schoolId != null" >--> | |
120 | +<!-- school_id,--> | |
121 | +<!-- </if>--> | |
122 | +<!-- <if test="grade != null" >--> | |
123 | +<!-- grade,--> | |
124 | +<!-- </if>--> | |
125 | +<!-- <if test="classId != null" >--> | |
126 | +<!-- class_id,--> | |
127 | +<!-- </if>--> | |
128 | +<!-- <if test="courseName != null" >--> | |
129 | +<!-- course_name,--> | |
130 | +<!-- </if>--> | |
131 | +<!-- <if test="times != null" >--> | |
132 | +<!-- times,--> | |
133 | +<!-- </if>--> | |
134 | +<!-- <if test="joinTimes != null" >--> | |
135 | +<!-- join_times,--> | |
136 | +<!-- </if>--> | |
137 | +<!-- <if test="createTime != null" >--> | |
138 | +<!-- create_time,--> | |
139 | +<!-- </if>--> | |
140 | +<!-- </trim>--> | |
141 | +<!-- <trim prefix="values (" suffix=")" suffixOverrides="," >--> | |
142 | +<!-- <if test="tClassId != null" >--> | |
143 | +<!-- #{tClassId,jdbcType=INTEGER},--> | |
144 | +<!-- </if>--> | |
145 | +<!-- <if test="teacherId != null" >--> | |
146 | +<!-- #{teacherId,jdbcType=INTEGER},--> | |
147 | +<!-- </if>--> | |
148 | +<!-- <if test="teacherName != null" >--> | |
149 | +<!-- #{teacherName,jdbcType=VARCHAR},--> | |
150 | +<!-- </if>--> | |
151 | +<!-- <if test="schoolId != null" >--> | |
152 | +<!-- #{schoolId,jdbcType=INTEGER},--> | |
153 | +<!-- </if>--> | |
154 | +<!-- <if test="grade != null" >--> | |
155 | +<!-- #{grade,jdbcType=INTEGER},--> | |
156 | +<!-- </if>--> | |
157 | +<!-- <if test="classId != null" >--> | |
158 | +<!-- #{classId,jdbcType=INTEGER},--> | |
159 | +<!-- </if>--> | |
160 | +<!-- <if test="courseName != null" >--> | |
161 | +<!-- #{courseName,jdbcType=VARCHAR},--> | |
162 | +<!-- </if>--> | |
163 | +<!-- <if test="times != null" >--> | |
164 | +<!-- #{times,jdbcType=INTEGER},--> | |
165 | +<!-- </if>--> | |
166 | +<!-- <if test="joinTimes != null" >--> | |
167 | +<!-- #{joinTimes,jdbcType=INTEGER},--> | |
168 | +<!-- </if>--> | |
169 | +<!-- <if test="createTime != null" >--> | |
170 | +<!-- #{createTime,jdbcType=TIMESTAMP},--> | |
171 | +<!-- </if>--> | |
172 | +<!-- </trim>--> | |
173 | +<!-- </insert>--> | |
174 | +<!-- <update id="updateByPrimaryKeySelective" parameterType="com.jevon.model.TeacherClass" >--> | |
175 | +<!-- update sz_sch_teacher_class--> | |
176 | +<!-- <set >--> | |
177 | +<!-- <if test="teacherId != null" >--> | |
178 | +<!-- teacher_id = #{teacherId,jdbcType=INTEGER},--> | |
179 | +<!-- </if>--> | |
180 | +<!-- <if test="teacherName != null" >--> | |
181 | +<!-- teacher_name = #{teacherName,jdbcType=VARCHAR},--> | |
182 | +<!-- </if>--> | |
183 | +<!-- <if test="schoolId != null" >--> | |
184 | +<!-- school_id = #{schoolId,jdbcType=INTEGER},--> | |
185 | +<!-- </if>--> | |
186 | +<!-- <if test="grade != null" >--> | |
187 | +<!-- grade = #{grade,jdbcType=INTEGER},--> | |
188 | +<!-- </if>--> | |
189 | +<!-- <if test="classId != null" >--> | |
190 | +<!-- class_id = #{classId,jdbcType=INTEGER},--> | |
191 | +<!-- </if>--> | |
192 | +<!-- <if test="courseName != null" >--> | |
193 | +<!-- course_name = #{courseName,jdbcType=VARCHAR},--> | |
194 | +<!-- </if>--> | |
195 | +<!-- <if test="times != null" >--> | |
196 | +<!-- times = #{times,jdbcType=INTEGER},--> | |
197 | +<!-- </if>--> | |
198 | +<!-- <if test="joinTimes != null" >--> | |
199 | +<!-- join_times = #{joinTimes,jdbcType=INTEGER},--> | |
200 | +<!-- </if>--> | |
201 | +<!-- <if test="createTime != null" >--> | |
202 | +<!-- create_time = #{createTime,jdbcType=TIMESTAMP},--> | |
203 | +<!-- </if>--> | |
204 | +<!-- </set>--> | |
205 | +<!-- where t_class_id = #{tClassId,jdbcType=INTEGER}--> | |
206 | +<!-- </update>--> | |
207 | + | |
208 | +</mapper> | |
0 | 209 | \ No newline at end of file | ... | ... |
1 | +++ a/src/main/resources/mapping/TeacherCourseMapper.xml | |
... | ... | @@ -0,0 +1,99 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | |
3 | +<mapper namespace="com.jevon.mapper.TeacherCourseMapper" > | |
4 | + <resultMap id="BaseResultMap" type="com.jevon.model.TeacherCourse" > | |
5 | + <id column="t_class_id" property="tClassId" jdbcType="INTEGER" /> | |
6 | + <result column="school_id" property="schoolId" jdbcType="INTEGER" /> | |
7 | + <result column="grade" property="grade" jdbcType="VARCHAR" /> | |
8 | + <result column="teacher_name" property="teacherName" jdbcType="VARCHAR" /> | |
9 | + <result column="single_or_double" property="singleOrDouble" jdbcType="INTEGER" /> | |
10 | + <result column="week" property="week" jdbcType="INTEGER" /> | |
11 | + <result column="course_number" property="courseNumber" jdbcType="INTEGER" /> | |
12 | + <result column="class_id" property="classId" jdbcType="VARCHAR" /> | |
13 | + <result column="course_name" property="courseName" jdbcType="VARCHAR" /> | |
14 | + <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> | |
15 | + <result column="team" property="team" jdbcType="VARCHAR" /> | |
16 | + </resultMap> | |
17 | + <sql id="Base_Column_List" > | |
18 | + t_class_id, school_id, grade, teacher_name, single_or_double, week, course_number, | |
19 | + class_id, course_name, create_time ,team | |
20 | + </sql> | |
21 | + | |
22 | + <insert id="insertBatch" parameterType="java.util.List" > | |
23 | + insert into sz_sch_teacher_course (school_id, grade, | |
24 | + teacher_name, single_or_double, week, | |
25 | + course_number, class_id, course_name, | |
26 | + create_time,team) | |
27 | + values | |
28 | + <foreach collection="list" item="emp" separator=","> | |
29 | + (#{emp.schoolId,jdbcType=INTEGER}, #{emp.grade,jdbcType=VARCHAR}, | |
30 | + #{emp.teacherName,jdbcType=VARCHAR}, #{emp.singleOrDouble,jdbcType=INTEGER}, #{emp.week,jdbcType=INTEGER}, | |
31 | + #{emp.courseNumber,jdbcType=INTEGER}, #{emp.classId,jdbcType=VARCHAR}, #{emp.courseName,jdbcType=VARCHAR}, | |
32 | + #{emp.createTime,jdbcType=TIMESTAMP},#{emp.team,jdbcType=VARCHAR}) | |
33 | + </foreach> | |
34 | + </insert> | |
35 | + | |
36 | + <select id="selectTeacherDayCourseNumber" parameterType="com.jevon.model.TeacherCourse" resultType="java.lang.Integer"> | |
37 | + select count(0) from sz_sch_teacher_course | |
38 | + where team = #{team} | |
39 | + and school_id = #{schoolId} | |
40 | + and teacher_name = #{teacherName} | |
41 | + and week = #{week,jdbcType=INTEGER} | |
42 | + and course_name = #{courseName} | |
43 | + and single_or_double = #{singleOrDouble,jdbcType=INTEGER} | |
44 | + </select> | |
45 | + <update id="updateTeacherCourse" parameterType="com.jevon.model.TeacherCourse" > | |
46 | + update sz_sch_teacher_course | |
47 | + set course_name = #{courseName,jdbcType=VARCHAR} , class_id = #{classId,jdbcType=VARCHAR} , grade=#{grade} | |
48 | + where team =#{team} and school_id = #{schoolId,jdbcType=INTEGER} | |
49 | + and teacher_name = #{teacherName,jdbcType=VARCHAR} | |
50 | + and week = #{week,jdbcType=INTEGER} | |
51 | + and course_number = #{courseNumber,jdbcType=INTEGER} | |
52 | + and single_or_double = #{singleOrDouble,jdbcType=INTEGER} | |
53 | + </update> | |
54 | + | |
55 | + <update id="recallTeacherCourse" parameterType="com.jevon.model.TeacherCourse"> | |
56 | + update sz_sch_teacher_course | |
57 | + set course_name = null , class_id = null , grade= null | |
58 | + where team =#{team} and school_id = #{schoolId,jdbcType=INTEGER} | |
59 | + and teacher_name = #{teacherName} and course_name = #{courseName} | |
60 | + </update> | |
61 | + | |
62 | + <select id="selectTeacherCourse" parameterType="com.jevon.model.TeacherCourse" resultMap="BaseResultMap"> | |
63 | + select * from sz_sch_teacher_course | |
64 | + where team =#{team} and | |
65 | + school_id = #{schoolId,jdbcType=INTEGER} | |
66 | + and teacher_name = #{teacherName} | |
67 | + and week = #{week,jdbcType=INTEGER} | |
68 | + and course_number = #{courseNumber,jdbcType=INTEGER} | |
69 | + and single_or_double = #{singleOrDouble,jdbcType=INTEGER} | |
70 | + </select> | |
71 | + | |
72 | + <select id="isCreateCourse" parameterType="com.jevon.model.TeacherCourse" resultType="java.lang.Integer"> | |
73 | + select count(0) from sz_sch_teacher_course | |
74 | + where team =#{team} and | |
75 | + school_id = #{schoolId,jdbcType=INTEGER} | |
76 | + and teacher_name = #{teacherName} | |
77 | + </select> | |
78 | + <update id="updateByPrimaryKey" parameterType="com.jevon.model.TeacherCourse" > | |
79 | + update sz_sch_teacher_course | |
80 | + set school_id = #{schoolId,jdbcType=INTEGER}, | |
81 | + grade = #{grade,jdbcType=VARCHAR}, | |
82 | + teacher_name = #{teacherName,jdbcType=VARCHAR}, | |
83 | + single_or_double = #{singleOrDouble,jdbcType=INTEGER}, | |
84 | + week = #{week,jdbcType=INTEGER}, | |
85 | + course_number = #{courseNumber,jdbcType=INTEGER}, | |
86 | + class_id = #{classId,jdbcType=VARCHAR}, | |
87 | + course_name = #{courseName,jdbcType=VARCHAR}, | |
88 | + create_time = #{createTime,jdbcType=TIMESTAMP} | |
89 | + where t_class_id = #{tClassId,jdbcType=INTEGER} | |
90 | + </update> | |
91 | + | |
92 | + <select id="selectBySchoolIdAndTeam" parameterType="com.jevon.model.TeacherCourse" resultMap="BaseResultMap"> | |
93 | + select * from sz_sch_teacher_course where school_id = #{schoolId} and team = #{team} | |
94 | + </select> | |
95 | + | |
96 | + <delete id="deleteBySchoolIdAndTeam" parameterType="com.jevon.model.TeacherCourse"> | |
97 | + delete from sz_sch_teacher_course where school_id = #{schoolId} and team = #{team} | |
98 | + </delete> | |
99 | +</mapper> | |
0 | 100 | \ No newline at end of file | ... | ... |
1 | +++ a/src/main/resources/mapping/TeacherMapper.xml | |
... | ... | @@ -0,0 +1,37 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | |
3 | +<mapper namespace="com.jevon.mapper.TeacherMapper" > | |
4 | + <resultMap id="BaseResultMap" type="com.jevon.model.Teacher" > | |
5 | + <id column="id" property="id" jdbcType="INTEGER" /> | |
6 | + <result column="school_id" property="schoolId" jdbcType="INTEGER" /> | |
7 | + <result column="teacher_id" property="teacherId" jdbcType="INTEGER" /> | |
8 | + <result column="teacher_name" property="teacherName" jdbcType="VARCHAR" /> | |
9 | + </resultMap> | |
10 | + | |
11 | + <insert id="insertBatch" parameterType="java.util.List"> | |
12 | + insert into sz_sch_teacher ( school_id , teacher_id, teacher_name) | |
13 | + values | |
14 | + <foreach collection="list" item="emp" separator=","> | |
15 | + (#{emp.schoolId,jdbcType=INTEGER}, #{emp.teacherId,jdbcType=INTEGER}, #{emp.teacherName,jdbcType=VARCHAR}) | |
16 | + </foreach> | |
17 | + </insert> | |
18 | + | |
19 | + <select id="selectBySchoolId" parameterType="java.lang.Integer" resultMap="BaseResultMap"> | |
20 | + select * from sz_sch_teacher where school_Id =#{schoolId} | |
21 | + </select> | |
22 | + | |
23 | + <delete id="deleteSchool" parameterType="java.lang.Integer"> | |
24 | + delete from sz_sch_teacher where school_Id =#{schoolId} | |
25 | + </delete> | |
26 | + | |
27 | + <select id="selectByTeacher" parameterType="com.jevon.model.Teacher" resultMap="BaseResultMap"> | |
28 | + select * from sz_sch_teacher where 1=1 | |
29 | + <if test="teacherId != 0"> | |
30 | + and teacher_id = #{teacherId} | |
31 | + </if> | |
32 | + <if test="teacherName != null"> | |
33 | + and teacher_name = #{teacherName} | |
34 | + </if> | |
35 | + </select> | |
36 | + | |
37 | +</mapper> | |
0 | 38 | \ No newline at end of file | ... | ... |
1 | +++ a/target/classes/application.yml | |
... | ... | @@ -0,0 +1,54 @@ |
1 | +server: | |
2 | + port: 8008 | |
3 | + | |
4 | +spring: | |
5 | + freemarker: | |
6 | + template-loader-path: classpath:/templates/ | |
7 | + prefix: | |
8 | + suffix: .html | |
9 | + ##是否允许使用request | |
10 | + allow-request-override: true | |
11 | + request-context-attribute: request | |
12 | + | |
13 | + cache: false | |
14 | + check-template-location: true | |
15 | + charset: UTF-8 | |
16 | + content-type: text/html;charset=UTF-8 | |
17 | + expose-request-attributes: false | |
18 | + expose-session-attributes: false | |
19 | + expose-spring-macro-helpers: false | |
20 | + | |
21 | + datasource: | |
22 | + username: SZJXTUSER | |
23 | + password: xst200919 | |
24 | + url: jdbc:sqlserver://60.190.202.57:14333;database=SmartPaike | |
25 | + driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver | |
26 | + filters: stat | |
27 | + maxActive: 20 | |
28 | + initialSize: 1 | |
29 | + maxWait: 60000 | |
30 | + minIdle: 1 | |
31 | + timeBetweenEvictionRunsMillis: 60000 | |
32 | + minEvictableIdleTimeMillis: 300000 | |
33 | + validationQuery: select 'x' | |
34 | + testWhileIdle: true | |
35 | + testOnBorrow: false | |
36 | + testOnReturn: false | |
37 | + poolPreparedStatements: true | |
38 | + maxOpenPreparedStatements: 20 | |
39 | + | |
40 | +mybatis: | |
41 | + mapper-locations: classpath:mapping/*.xml | |
42 | + type-aliases-package: com.jevon.model | |
43 | + | |
44 | +#pagehelper | |
45 | +pagehelper: | |
46 | + helperDialect: mysql | |
47 | + reasonable: true | |
48 | + supportMethodsArguments: true | |
49 | + params: count=countSql | |
50 | + | |
51 | +#logger | |
52 | +Logger: | |
53 | + level: | |
54 | + com.jevon.mapper: info | ... | ... |
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type