Browse Source

--update queryPro();

zzy.zhiyuan.foxmail 8 years ago
parent
commit
2dee7f59b3

+ 7 - 0
src/main/java/com/ekexiu/portal/po/Watch.java

@ -21,6 +21,7 @@ public class Watch implements CreateTimeSupported {
21 21
	private Integer watchType;
22 22
	private EditProfessor professor;
23 23
	private Resource resource;
24
	private Article article;
24 25
	
25 26
	public EditProfessor getProfessor() {
26 27
		return professor;
@ -34,6 +35,12 @@ public class Watch implements CreateTimeSupported {
34 35
	public void setResource(Resource resource) {
35 36
		this.resource = resource;
36 37
	}
38
	public Article getArticle() {
39
		return article;
40
	}
41
	public void setArticle(Article article) {
42
		this.article = article;
43
	}
37 44
	
38 45
	@Column(DE.id_32)
39 46
	public String getProfessorId() {

+ 18 - 0
src/main/java/com/ekexiu/portal/service/WatchService.java

@ -12,10 +12,12 @@ import org.jfw.apt.web.annotation.operate.Post;
12 12
import org.jfw.apt.web.annotation.param.JdbcConn;
13 13
import org.jfw.util.PageQueryResult;
14 14

15
import com.ekexiu.portal.dao.ArticleDao;
15 16
import com.ekexiu.portal.dao.ProfessorDao;
16 17
import com.ekexiu.portal.dao.ResearchAreaDao;
17 18
import com.ekexiu.portal.dao.ResourceDao;
18 19
import com.ekexiu.portal.dao.WatchDao;
20
import com.ekexiu.portal.po.Article;
19 21
import com.ekexiu.portal.po.Resource;
20 22
import com.ekexiu.portal.po.Watch;
21 23
import com.ekexiu.portal.pojo.EditProfessor;
@ -32,6 +34,8 @@ public class WatchService {
32 34
	private ImageService imageService;
33 35
	@Autowrie
34 36
	private ResearchAreaDao researchAreaDao;
37
	@Autowrie
38
	private ArticleDao articleDao;
35 39
	
36 40
	public WatchDao getWatchDao() {
37 41
		return watchDao;
@ -63,6 +67,12 @@ public class WatchService {
63 67
	public void setResearchAreaDao(ResearchAreaDao researchAreaDao) {
64 68
		this.researchAreaDao = researchAreaDao;
65 69
	}
70
	public ArticleDao getArticleDao() {
71
		return articleDao;
72
	}
73
	public void setArticleDao(ArticleDao articleDao) {
74
		this.articleDao = articleDao;
75
	}
66 76
	
67 77
	@Post
68 78
	@Path
@ -107,6 +117,14 @@ public class WatchService {
107 117
				}
108 118
				watch.setResource(resource);
109 119
			}
120
		}else if(3 == watchType){
121
			for (Watch watch : watchs) {
122
				Article article = this.articleDao.queryOne(con, watch.getWatchObject());
123
				if(article != null){
124
					article.setProfessor(this.professorDao.queryBaseInfo(con, article.getProfessorId()));
125
				}
126
				watch.setArticle(article);
127
			}
110 128
		}
111 129
		return queryResult;
112 130
	}