|
@ -35,10 +35,10 @@ public class SchJob implements AfterBeanFactory {
|
35
|
35
|
Connection con = SchJob.this.dataSource.getConnection();
|
36
|
36
|
try {
|
37
|
37
|
Set<String> all = fillSetValue(con, "SELECT SUBJECT FROM PROFESSOR");
|
38
|
|
Set<String> exists = fillSetValue(con, "SELECT CAPTION FROM DATA_DICT WHERE DICT_CODE='PRO_SUBJECT'");
|
|
38
|
Set<String> exists = fillSetValue(con, "SELECT CAPTION FROM DATA_DICT WHERE DICT_CODE='SUBJECT'");
|
39
|
39
|
for (String s : exists)
|
40
|
40
|
all.remove(s);
|
41
|
|
batchAddCode(con, "PRO_SUBJECT", all);
|
|
41
|
batchAddCode(con, "SUBJECT", all);
|
42
|
42
|
con.commit();
|
43
|
43
|
} catch (SQLException e) {
|
44
|
44
|
try {
|
|
@ -63,10 +63,10 @@ public class SchJob implements AfterBeanFactory {
|
63
|
63
|
Connection con = SchJob.this.dataSource.getConnection();
|
64
|
64
|
try {
|
65
|
65
|
Set<String> all = fillSetValue(con, "SELECT INDUSTRY FROM PROFESSOR");
|
66
|
|
Set<String> exists = fillSetValue(con, "SELECT CAPTION FROM DATA_DICT WHERE DICT_CODE='PRO_INDUSTRY'");
|
|
66
|
Set<String> exists = fillSetValue(con, "SELECT CAPTION FROM DATA_DICT WHERE DICT_CODE='INDUSTRY'");
|
67
|
67
|
for (String s : exists)
|
68
|
68
|
all.remove(s);
|
69
|
|
batchAddCode(con, "PRO_INDUSTRY", all);
|
|
69
|
batchAddCode(con, "INDUSTRY", all);
|
70
|
70
|
con.commit();
|
71
|
71
|
} catch (SQLException e) {
|
72
|
72
|
try {
|
|
@ -91,10 +91,10 @@ public class SchJob implements AfterBeanFactory {
|
91
|
91
|
Connection con = SchJob.this.dataSource.getConnection();
|
92
|
92
|
try {
|
93
|
93
|
Set<String> all = fillSetValue(con, "SELECT CAPTION FROM RESEARCH_AREA");
|
94
|
|
Set<String> exists = fillSetValue(con, "SELECT CAPTION FROM DATA_DICT WHERE DICT_CODE='PRO_RESEARCH_AREA'");
|
|
94
|
Set<String> exists = fillSetValue(con, "SELECT CAPTION FROM DATA_DICT WHERE DICT_CODE='RESEARCH_AREA'");
|
95
|
95
|
for (String s : exists)
|
96
|
96
|
all.remove(s);
|
97
|
|
batchAddCode(con, "PRO_RESEARCH_AREA", all);
|
|
97
|
batchAddCode(con, "RESEARCH_AREA", all);
|
98
|
98
|
con.commit();
|
99
|
99
|
} catch (SQLException e) {
|
100
|
100
|
try {
|
|
@ -119,66 +119,10 @@ public class SchJob implements AfterBeanFactory {
|
119
|
119
|
Connection con = SchJob.this.dataSource.getConnection();
|
120
|
120
|
try {
|
121
|
121
|
Set<String> all = fillSetValue(con, "SELECT ADDRESS FROM PROFESSOR");
|
122
|
|
Set<String> exists = fillSetValue(con, "SELECT CAPTION FROM DATA_DICT WHERE DICT_CODE='PRO_ADDRESS'");
|
|
122
|
Set<String> exists = fillSetValue(con, "SELECT CAPTION FROM DATA_DICT WHERE DICT_CODE='ADDRESS'");
|
123
|
123
|
for (String s : exists)
|
124
|
124
|
all.remove(s);
|
125
|
|
batchAddCode(con, "PRO_ADDRESS", all);
|
126
|
|
con.commit();
|
127
|
|
} catch (SQLException e) {
|
128
|
|
try {
|
129
|
|
con.rollback();
|
130
|
|
} catch (SQLException ee) {
|
131
|
|
}
|
132
|
|
throw e;
|
133
|
|
} finally {
|
134
|
|
try {
|
135
|
|
con.close();
|
136
|
|
} catch (Exception e) {
|
137
|
|
}
|
138
|
|
}
|
139
|
|
} catch (Throwable th) {
|
140
|
|
}
|
141
|
|
}
|
142
|
|
}, 1, 5, TimeUnit.MINUTES);
|
143
|
|
this.service.scheduleWithFixedDelay(new Runnable() {
|
144
|
|
@Override
|
145
|
|
public void run() {
|
146
|
|
try {
|
147
|
|
Connection con = SchJob.this.dataSource.getConnection();
|
148
|
|
try {
|
149
|
|
Set<String> all = fillSetValue(con, "SELECT SUBJECT FROM RESOURCE");
|
150
|
|
Set<String> exists = fillSetValue(con, "SELECT CAPTION FROM DATA_DICT WHERE DICT_CODE='RES_SUBJECT'");
|
151
|
|
for (String s : exists)
|
152
|
|
all.remove(s);
|
153
|
|
batchAddCode(con, "RES_SUBJECT", all);
|
154
|
|
con.commit();
|
155
|
|
} catch (SQLException e) {
|
156
|
|
try {
|
157
|
|
con.rollback();
|
158
|
|
} catch (SQLException ee) {
|
159
|
|
}
|
160
|
|
throw e;
|
161
|
|
} finally {
|
162
|
|
try {
|
163
|
|
con.close();
|
164
|
|
} catch (Exception e) {
|
165
|
|
}
|
166
|
|
}
|
167
|
|
} catch (Throwable th) {
|
168
|
|
}
|
169
|
|
}
|
170
|
|
}, 1, 5, TimeUnit.MINUTES);
|
171
|
|
this.service.scheduleWithFixedDelay(new Runnable() {
|
172
|
|
@Override
|
173
|
|
public void run() {
|
174
|
|
try {
|
175
|
|
Connection con = SchJob.this.dataSource.getConnection();
|
176
|
|
try {
|
177
|
|
Set<String> all = fillSetValue(con, "SELECT INDUSTRY FROM RESOURCE");
|
178
|
|
Set<String> exists = fillSetValue(con, "SELECT CAPTION FROM DATA_DICT WHERE DICT_CODE='RES_INDUSTRY'");
|
179
|
|
for (String s : exists)
|
180
|
|
all.remove(s);
|
181
|
|
batchAddCode(con, "RES_INDUSTRY", all);
|
|
125
|
batchAddCode(con, "ADDRESS", all);
|
182
|
126
|
con.commit();
|
183
|
127
|
} catch (SQLException e) {
|
184
|
128
|
try {
|