Browse Source

添加修改专家认证的方法。

zzy.zhiyuan.foxmail 8 years ago
parent
commit
928f01e894

+ 32 - 16
src/main/java/com/ekexiu/portal/dao/ConsultDao.java

@ -133,11 +133,15 @@ public abstract class ConsultDao {
133 133
		try {
134 134
			ps.setString(_m_2++, professorId);
135 135
			ResultSet rs = ps.executeQuery();
136
			rs.next();
137
			BigDecimal avg = rs.getBigDecimal(1);
138
			return avg;
136
			try{
137
				rs.next();
138
				BigDecimal avg = rs.getBigDecimal(1);
139
				return avg;
140
			}finally{
141
                try{rs.close();}catch(Exception _m_3){}
142
            }
139 143
		} finally{
140
            try{ps.close();}catch(Exception _m_3){}
144
            try{ps.close();}catch(Exception _m_4){}
141 145
        }
142 146
	}
143 147
	
@ -250,11 +254,15 @@ public abstract class ConsultDao {
250 254
		try {
251 255
			ps.setString(_m_2++, professorId);
252 256
			ResultSet rs = ps.executeQuery();
253
			rs.next();
254
			int count = rs.getInt(1);
255
			return count;
257
			try{
258
				rs.next();
259
				int count = rs.getInt(1);
260
				return count;
261
			}finally{
262
                try{rs.close();}catch(Exception _m_3){}
263
            }
256 264
		} finally{
257
            try{ps.close();}catch(Exception _m_3){}
265
            try{ps.close();}catch(Exception _m_4){}
258 266
        }
259 267
	}
260 268
	
@ -276,11 +284,15 @@ public abstract class ConsultDao {
276 284
			ps.setString(_m_2++, professorId);
277 285
			ps.setString(_m_2++, professorId);
278 286
			ResultSet rs = ps.executeQuery();
279
			rs.next();
280
			int count = rs.getInt(1);
281
			return count;
287
			try{
288
				rs.next();
289
				int count = rs.getInt(1);
290
				return count;
291
			}finally{
292
                try{rs.close();}catch(Exception _m_3){}
293
            }
282 294
		} finally{
283
            try{ps.close();}catch(Exception _m_3){}
295
            try{ps.close();}catch(Exception _m_4){}
284 296
        }
285 297
	}
286 298
	
@ -298,11 +310,15 @@ public abstract class ConsultDao {
298 310
		try {
299 311
			ps.setString(_m_2++, professorId);
300 312
			ResultSet rs = ps.executeQuery();
301
			rs.next();
302
			int count = rs.getInt(1);
303
			return count;
313
			try{
314
				rs.next();
315
				int count = rs.getInt(1);
316
				return count;
317
			}finally{
318
                try{rs.close();}catch(Exception _m_3){}
319
            }
304 320
		} finally{
305
            try{ps.close();}catch(Exception _m_3){}
321
            try{ps.close();}catch(Exception _m_4){}
306 322
        }
307 323
	}
308 324
	

+ 8 - 4
src/main/java/com/ekexiu/portal/dao/ProfessorDao.java

@ -39,6 +39,10 @@ public abstract class ProfessorDao {
39 39
	@Update
40 40
	public abstract int update(Connection con, Professor professor) throws SQLException;
41 41
	
42
	@UpdateWith
43
	@From(Professor.class)
44
	public abstract int updateAuthentication(Connection con, String id, @Set boolean authentication) throws SQLException;
45
	
42 46
	@UpdateWith
43 47
	@From(Professor.class)
44 48
	public abstract int updateStarLevel(Connection con, String id, @Set BigDecimal starLevel) throws SQLException;
@ -345,8 +349,8 @@ public abstract class ProfessorDao {
345 349
        PreparedStatement ps = con.prepareStatement(sql);
346 350
        try{
347 351
            ResultSet rs = ps.executeQuery();
348
            rs.next();
349 352
            try{
353
            	rs.next();
350 354
            	return rs.getBigDecimal(1);
351 355
            }finally{
352 356
                try{rs.close();}catch(Exception e1){}
@ -367,8 +371,8 @@ public abstract class ProfessorDao {
367 371
        PreparedStatement ps = con.prepareStatement(sql);
368 372
        try{
369 373
            ResultSet rs = ps.executeQuery();
370
            rs.next();
371 374
            try{
375
            	rs.next();
372 376
            	return rs.getBigDecimal(1);
373 377
            }finally{
374 378
                try{rs.close();}catch(Exception e1){}
@ -389,8 +393,8 @@ public abstract class ProfessorDao {
389 393
        PreparedStatement ps = con.prepareStatement(sql);
390 394
        try{
391 395
            ResultSet rs = ps.executeQuery();
392
            rs.next();
393 396
            try{
397
            	rs.next();
394 398
            	return new BigDecimal(rs.getInt(1));
395 399
            }finally{
396 400
                try{rs.close();}catch(Exception e1){}
@ -411,8 +415,8 @@ public abstract class ProfessorDao {
411 415
        PreparedStatement ps = con.prepareStatement(sql);
412 416
        try{
413 417
            ResultSet rs = ps.executeQuery();
414
            rs.next();
415 418
            try{
419
            	rs.next();
416 420
            	return new BigDecimal(rs.getInt(1));
417 421
            }finally{
418 422
                try{rs.close();}catch(Exception e1){}

+ 6 - 0
src/main/java/com/ekexiu/portal/service/ProfessorService.java

@ -317,6 +317,12 @@ public class ProfessorService {
317 317
		return queryResult;
318 318
	}
319 319
	
320
	@Post
321
	@Path("/authentication")
322
	public void updateAuthentication(@JdbcConn(true) Connection con, String id, boolean authentication) throws SQLException{
323
		this.professorDao.updateAuthentication(con, id, authentication);
324
	}
325
	
320 326
	@Post
321 327
	@Path("/starLevel")
322 328
	public void updateStarLevel(@JdbcConn(true) Connection con, String id, BigDecimal starLevel) throws SQLException{