Browse Source

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

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

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

133
		try {
133
		try {
134
			ps.setString(_m_2++, professorId);
134
			ps.setString(_m_2++, professorId);
135
			ResultSet rs = ps.executeQuery();
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
		} finally{
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
		try {
254
		try {
251
			ps.setString(_m_2++, professorId);
255
			ps.setString(_m_2++, professorId);
252
			ResultSet rs = ps.executeQuery();
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
		} finally{
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
			ps.setString(_m_2++, professorId);
284
			ps.setString(_m_2++, professorId);
277
			ps.setString(_m_2++, professorId);
285
			ps.setString(_m_2++, professorId);
278
			ResultSet rs = ps.executeQuery();
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
		} finally{
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
		try {
310
		try {
299
			ps.setString(_m_2++, professorId);
311
			ps.setString(_m_2++, professorId);
300
			ResultSet rs = ps.executeQuery();
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
		} finally{
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
	@Update
39
	@Update
40
	public abstract int update(Connection con, Professor professor) throws SQLException;
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
	@UpdateWith
46
	@UpdateWith
43
	@From(Professor.class)
47
	@From(Professor.class)
44
	public abstract int updateStarLevel(Connection con, String id, @Set BigDecimal starLevel) throws SQLException;
48
	public abstract int updateStarLevel(Connection con, String id, @Set BigDecimal starLevel) throws SQLException;
345
        PreparedStatement ps = con.prepareStatement(sql);
349
        PreparedStatement ps = con.prepareStatement(sql);
346
        try{
350
        try{
347
            ResultSet rs = ps.executeQuery();
351
            ResultSet rs = ps.executeQuery();
348
            rs.next();
349
            try{
352
            try{
353
            	rs.next();
350
            	return rs.getBigDecimal(1);
354
            	return rs.getBigDecimal(1);
351
            }finally{
355
            }finally{
352
                try{rs.close();}catch(Exception e1){}
356
                try{rs.close();}catch(Exception e1){}
367
        PreparedStatement ps = con.prepareStatement(sql);
371
        PreparedStatement ps = con.prepareStatement(sql);
368
        try{
372
        try{
369
            ResultSet rs = ps.executeQuery();
373
            ResultSet rs = ps.executeQuery();
370
            rs.next();
371
            try{
374
            try{
375
            	rs.next();
372
            	return rs.getBigDecimal(1);
376
            	return rs.getBigDecimal(1);
373
            }finally{
377
            }finally{
374
                try{rs.close();}catch(Exception e1){}
378
                try{rs.close();}catch(Exception e1){}
389
        PreparedStatement ps = con.prepareStatement(sql);
393
        PreparedStatement ps = con.prepareStatement(sql);
390
        try{
394
        try{
391
            ResultSet rs = ps.executeQuery();
395
            ResultSet rs = ps.executeQuery();
392
            rs.next();
393
            try{
396
            try{
397
            	rs.next();
394
            	return new BigDecimal(rs.getInt(1));
398
            	return new BigDecimal(rs.getInt(1));
395
            }finally{
399
            }finally{
396
                try{rs.close();}catch(Exception e1){}
400
                try{rs.close();}catch(Exception e1){}
411
        PreparedStatement ps = con.prepareStatement(sql);
415
        PreparedStatement ps = con.prepareStatement(sql);
412
        try{
416
        try{
413
            ResultSet rs = ps.executeQuery();
417
            ResultSet rs = ps.executeQuery();
414
            rs.next();
415
            try{
418
            try{
419
            	rs.next();
416
            	return new BigDecimal(rs.getInt(1));
420
            	return new BigDecimal(rs.getInt(1));
417
            }finally{
421
            }finally{
418
                try{rs.close();}catch(Exception e1){}
422
                try{rs.close();}catch(Exception e1){}

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

317
		return queryResult;
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
	@Post
326
	@Post
321
	@Path("/starLevel")
327
	@Path("/starLevel")
322
	public void updateStarLevel(@JdbcConn(true) Connection con, String id, BigDecimal starLevel) throws SQLException{
328
	public void updateStarLevel(@JdbcConn(true) Connection con, String id, BigDecimal starLevel) throws SQLException{