Browse Source

修改更新资源申请状态的接口,添加用户注册的接口(还未添加注册时的手机和邮箱验证)。

zzy.zhiyuan.foxmail 8 years ago
parent
commit
e2407ab964

+ 5 - 4
src/main/java/com/ekexiu/portal/dao/OperationDao.java

@ -9,6 +9,7 @@ import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
9 9
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
10 10
import org.jfw.apt.orm.annotation.dao.method.operator.Update;
11 11
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
12
import org.jfw.apt.orm.annotation.dao.param.Set;
12 13

13 14
import com.ekexiu.portal.po.Operation;
14 15
import com.ekexiu.portal.po.Professor;
@ -24,19 +25,19 @@ public abstract class OperationDao {
24 25
	
25 26
	@UpdateWith
26 27
	@From(Operation.class)
27
	public abstract int updateDetailDemand(Connection con, String operationId, String detailDemand) throws SQLException;
28
	public abstract int updateDetailDemand(Connection con, String operationId, @Set String detailDemand) throws SQLException;
28 29
	
29 30
	@UpdateWith
30 31
	@From(Operation.class)
31
	public abstract int updateOperationStatus(Connection con, String operationId, int operationStatus) throws SQLException;
32
	public abstract int updateOperationStatus(Connection con, String operationId, @Set int operationStatus) throws SQLException;
32 33
	
33 34
	@UpdateWith
34 35
	@From(Operation.class)
35
	public abstract int updateDeliverTime(Connection con, String operationId, String deliverTime) throws SQLException;
36
	public abstract int updateDeliverTime(Connection con, String operationId, @Set String deliverTime) throws SQLException;
36 37
	
37 38
	@UpdateWith
38 39
	@From(Operation.class)
39
	public abstract int updatePayMethod(Connection con, String operationId, String payMethod) throws SQLException;
40
	public abstract int updatePayMethod(Connection con, String operationId, @Set String payMethod) throws SQLException;
40 41
	
41 42
	public com.ekexiu.portal.po.Operation query(java.sql.Connection con,java.lang.String operationId) throws java.sql.SQLException{
42 43
        int _m_1 = 1;

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

@ -15,6 +15,7 @@ import org.jfw.apt.web.annotation.operate.Post;
15 15
import org.jfw.apt.web.annotation.operate.Put;
16 16
import org.jfw.apt.web.annotation.param.JdbcConn;
17 17
import org.jfw.apt.web.annotation.param.PathVar;
18
import org.jfw.apt.web.annotation.param.RequestBody;
18 19
import org.jfw.util.PageQueryResult;
19 20
import org.jfw.util.StringUtil;
20 21

@ -48,7 +49,7 @@ public class OperationService {
48 49
	
49 50
	@Put
50 51
	@Path
51
	public void update(@JdbcConn(true) Connection con, Operation operation) throws SQLException{
52
	public void update(@JdbcConn(true) Connection con, @RequestBody Operation operation) throws SQLException{
52 53
		this.operationDao.update(con, operation);
53 54
	}
54 55
	

+ 5 - 4
src/main/java/com/ekexiu/portal/service/ProfessorService.java

@ -167,15 +167,16 @@ public class ProfessorService {
167 167
	@Path
168 168
	public String insert(@JdbcConn(true) Connection con, Professor professor, @Nullable String orgName)
169 169
			throws SQLException, IOException {
170
		String id = StringUtil.buildUUID();
171
		professor.setId(id);
170
		if(professor.getId() == null ) {
171
			professor.setId(StringUtil.buildUUID());
172
		}
172 173
		professor.setAuthentication(true);
173 174
		if (professor.getOrgId() == null) {
174 175
			professor.setOrgId(this.orgService.createOrganization(con, orgName));
175 176
		}
176 177
		this.professorDao.insert(con, professor);
177
		this.imageService.saveDefaultHeadImage(id);
178
		return id;
178
		this.imageService.saveDefaultHeadImage(professor.getId());
179
		return professor.getId();
179 180
	}
180 181

181 182
	@Put

+ 12 - 0
src/main/java/com/ekexiu/portal/service/SysService.java

@ -204,6 +204,18 @@ public class SysService {
204 204
		this.mailservice = mailservice;
205 205
	}
206 206
207
	@Post
208
	@Path("/reg")
209
	public String insert(@JdbcConn(true) Connection con, User user) throws SQLException {
210
		if(user.getId() == null){
211
			user.setId(StringUtil.buildUUID());
212
		}
213
		String password = StringUtil.md5(user.getPasswd());
214
		user.setPasswd(password);
215
		this.userDao.insert(con, user);
216
		return user.getId();
217
	}
218
	
207 219
	@SetCookie(checkResultNull = true, path = "/", value = { "userid=result.getId()", "userMobilePhone=result.getMobilePhone()", "userType=result.getType()",
208 220
			"userAuth=String.valueOf(result.isAuth())", "userEmail=result.getEmail()==null?\"\":result.getEmail()","userName=result.getName()" })
209 221
	@Post