Ver Código Fonte

Merge branch 'dev' of http://www.ekexiu.com:3000/jiapeng/portal-web.git
into dev

Conflicts:
src/main/java/com/ekexiu/portal/service/AuthImageService.java

jiapeng 8 anos atrás
pai
commit
5904e3c94f

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

17
import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
17
import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
18
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
18
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
19
import org.jfw.apt.orm.annotation.dao.param.Set;
19
import org.jfw.apt.orm.annotation.dao.param.Set;
20
import org.jfw.apt.orm.annotation.dao.param.SqlColumn;
21
import org.jfw.apt.orm.core.defaultImpl.IntHandler;
22

20

23
import com.ekexiu.portal.po.AuthApply;
21
import com.ekexiu.portal.po.AuthApply;
24
import com.ekexiu.portal.pojo.AuthApplyInfo;
22
import com.ekexiu.portal.pojo.AuthApplyInfo;
49
                    AuthApply _result = new AuthApply();
47
                    AuthApply _result = new AuthApply();
50
                    _result.setAuthApplyId(rs.getString(1));
48
                    _result.setAuthApplyId(rs.getString(1));
51
                    _result.setProfessorId(rs.getString(2));
49
                    _result.setProfessorId(rs.getString(2));
52
                    _result.setApplyType(rs.getString(3));
50
                    _result.setApplyType(rs.getInt(3));
53
                    _result.setSolveStatus(rs.getInt(4));
51
                    _result.setSolveStatus(rs.getInt(4));
54
                    return _result;
52
                    return _result;
55
                }else{
53
                }else{

+ 4 - 4
src/main/java/com/ekexiu/portal/po/AuthApply.java

13
public class AuthApply implements CreateTimeSupported {
13
public class AuthApply implements CreateTimeSupported {
14
	private String authApplyId;
14
	private String authApplyId;
15
	private String professorId;
15
	private String professorId;
16
	private String applyType;
16
	private Integer applyType;
17
	private Integer solveStatus;
17
	private Integer solveStatus;
18
	private String createTime;
18
	private String createTime;
19
	
19
	
33
		this.professorId = professorId;
33
		this.professorId = professorId;
34
	}
34
	}
35
	
35
	
36
	@Column(DE.string_de)
37
	public String getApplyType() {
36
	@Column(handlerClass=WIntHandler.class,dbType="INT",insertable=true,nullable=false,renewable=false,queryable=true)
37
	public Integer getApplyType() {
38
		return applyType;
38
		return applyType;
39
	}
39
	}
40
	public void setApplyType(String applyType) {
40
	public void setApplyType(Integer applyType) {
41
		this.applyType = applyType;
41
		this.applyType = applyType;
42
	}
42
	}
43
	
43
	

+ 23 - 0
src/main/java/com/ekexiu/portal/service/ArticleService.java

25

25

26
import com.ekexiu.portal.dao.ArticleDao;
26
import com.ekexiu.portal.dao.ArticleDao;
27
import com.ekexiu.portal.dao.ProfessorDao;
27
import com.ekexiu.portal.dao.ProfessorDao;
28
import com.ekexiu.portal.dao.ResearchAreaDao;
28
import com.ekexiu.portal.dao.ResourceDao;
29
import com.ekexiu.portal.dao.ResourceDao;
29
import com.ekexiu.portal.po.Article;
30
import com.ekexiu.portal.po.Article;
30
import com.ekexiu.portal.pojo.EditProfessor;
31
import com.ekexiu.portal.pojo.EditProfessor;
42
	private ProfessorDao professorDao;
43
	private ProfessorDao professorDao;
43
	@Autowrie
44
	@Autowrie
44
	private ResourceDao resourceDao;
45
	private ResourceDao resourceDao;
46
	@Autowrie
47
	private ImageService imageService;
48
	@Autowrie
49
	private ResearchAreaDao researchAreaDao;
45

50

46
	public String getDateFormat() {
51
	public String getDateFormat() {
47
		return dateFormat;
52
		return dateFormat;
99
		this.resourceDao = resourceDao;
104
		this.resourceDao = resourceDao;
100
	}
105
	}
101

106

107
	public ImageService getImageService() {
108
		return imageService;
109
	}
110

111
	public void setImageService(ImageService imageService) {
112
		this.imageService = imageService;
113
	}
114

115
	public ResearchAreaDao getResearchAreaDao() {
116
		return researchAreaDao;
117
	}
118

119
	public void setResearchAreaDao(ResearchAreaDao researchAreaDao) {
120
		this.researchAreaDao = researchAreaDao;
121
	}
122

102
	private byte[] resImage(byte[] src, int maxLen) throws IOException {
123
	private byte[] resImage(byte[] src, int maxLen) throws IOException {
103
		ByteArrayInputStream in = new ByteArrayInputStream(src);
124
		ByteArrayInputStream in = new ByteArrayInputStream(src);
104
		ByteArrayOutputStream out = new ByteArrayOutputStream();
125
		ByteArrayOutputStream out = new ByteArrayOutputStream();
179
		if(article != null){
200
		if(article != null){
180
			EditProfessor professor = this.professorDao.queryBaseInfo(con, article.getProfessorId());
201
			EditProfessor professor = this.professorDao.queryBaseInfo(con, article.getProfessorId());
181
			if(professor != null){
202
			if(professor != null){
203
				professor.setHasHeadImage(this.imageService.hasProfessorImage(professor.getId()));
204
				professor.setResearchAreas(this.researchAreaDao.query(con, professor.getId()));
182
				professor.setResources(this.resourceDao.queryPro(con, professor.getId()));
205
				professor.setResources(this.resourceDao.queryPro(con, professor.getId()));
183
			}
206
			}
184
			article.setProfessor(professor);
207
			article.setProfessor(professor);

+ 24 - 2
src/main/java/com/ekexiu/portal/service/AuthImageService.java

6
import java.io.IOException;
6
import java.io.IOException;
7
import java.io.InputStream;
7
import java.io.InputStream;
8
import java.sql.Connection;
8
import java.sql.Connection;
9
import java.sql.SQLException;
10
import java.util.List;
9
import java.sql.SQLException;
10
import java.util.List;
11
import java.text.SimpleDateFormat;
11
import java.text.SimpleDateFormat;
12
import java.util.Date;
12
import java.util.Date;
13

13

73
	public void setAuthApplyDao(AuthApplyDao authApplyDao) {
73
	public void setAuthApplyDao(AuthApplyDao authApplyDao) {
74
		this.authApplyDao = authApplyDao;
74
		this.authApplyDao = authApplyDao;
75
	}
75
	}
76
	
77
	public String insertImg(@JdbcConn(true) Connection con, String authApplyId, String fn) throws SQLException, IOException{
78
		String authImageId = StringUtil.buildUUID();
79
		SimpleDateFormat df = new SimpleDateFormat(this.dateFormat);
80
		String date = df.format(new Date());
81
		File dateFile = new File(this.authImgPath + "/" + date);
82
		if (!dateFile.exists()) {
83
			dateFile.mkdir();
84
		}
85
		InputStream in = new FileInputStream(new File(this.tmpPath, fn));
86
		try {
87
			IoUtil.copy(in, new FileOutputStream(new File(dateFile, authImageId + ".jpg")), false, true);
88
		} finally {
89
			in.close();
90
		}
91
		AuthImage authImage = new AuthImage();
92
		authImage.setAuthImageId(authImageId);
93
		authImage.setAuthApplyId(authApplyId);
94
		authImage.setAuthSrc(date + "/" + authImageId + ".jpg");
95
		this.authImageDao.insert(con, authImage);
96
		return authImageId;
97
	}
76

98

77
	@Post
99
	@Post
78
	@Path
100
	@Path