Browse Source

数据字典项添加资源的学术领域、学科和专家的地址

zzy.zhiyuan.foxmail 8 years ago
parent
commit
6b9c40f5d7

+ 1 - 1
src/main/java/com/ekexiu/portal/dao/DataDictDao.java

@ -38,7 +38,7 @@ public interface DataDictDao {
38 38
	@From(DataDict.class)
39 39
	@Nullable
40 40
	@SelectOne
41
	DataDict query(Connection con, String dictCode, String code) throws SQLException;
41
	public DataDict query(Connection con, String dictCode, String code) throws SQLException;
42 42
43 43
	@SelectList
44 44
	List<DataDict> query(Connection con, String dictCode) throws SQLException;

+ 84 - 0
src/main/java/com/ekexiu/portal/job/SchJob.java

@ -112,6 +112,90 @@ public class SchJob implements AfterBeanFactory {
112 112
				}
113 113
			}
114 114
		}, 1, 5, TimeUnit.MINUTES);
115
		this.service.scheduleWithFixedDelay(new Runnable() {
116
			@Override
117
			public void run() {
118
				try {
119
					Connection con = SchJob.this.dataSource.getConnection();
120
					try {
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'");
123
						for (String s : exists)
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);
182
						con.commit();
183
					} catch (SQLException e) {
184
						try {
185
							con.rollback();
186
						} catch (SQLException ee) {
187
						}
188
						throw e;
189
					} finally {
190
						try {
191
							con.close();
192
						} catch (Exception e) {
193
						}
194
					}
195
				} catch (Throwable th) {
196
				}
197
			}
198
		}, 1, 5, TimeUnit.MINUTES);
115 199
116 200
	}
117 201

+ 1 - 1
src/main/java/com/ekexiu/portal/service/DataDictService.java

@ -71,7 +71,7 @@ public class DataDictService {
71 71
	}
72 72
	@Get
73 73
	@Path("/{dictCode}/{code}")
74
	DataDict query(@JdbcConn(false) Connection con,@PathVar String dictCode,@PathVar String code)throws SQLException{
74
	public DataDict query(@JdbcConn(false) Connection con,@PathVar String dictCode,@PathVar String code)throws SQLException{
75 75
		return this.dataDictDao.query(con, dictCode, code);	
76 76
	}
77 77