Browse Source

--add column forShort;add queryAuthStatus();

zzy.zhiyuan.foxmail 8 years ago
parent
commit
43a858d861

+ 9 - 2
src/main/java/com/ekexiu/portal/dao/OrgDao.java

@ -19,6 +19,7 @@ import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
19 19
import org.jfw.apt.orm.annotation.dao.method.operator.Update;
20 20
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
21 21
import org.jfw.apt.orm.annotation.dao.param.Like;
22
import org.jfw.apt.orm.annotation.dao.param.Set;
22 23
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
23 24
import org.jfw.util.PageQueryResult;
24 25
@ -33,11 +34,11 @@ public interface OrgDao {
33 34
	
34 35
	@UpdateWith
35 36
	@From(Organization.class)
36
	int updateIsJoin(Connection con,String id,String isJoin)throws SQLException;
37
	int updateIsJoin(Connection con,String id,@Set String isJoin)throws SQLException;
37 38
	
38 39
	@UpdateWith
39 40
	@From(Organization.class)
40
	int updateAuthStatus(Connection con,String id,String authStatus)throws SQLException;
41
	int updateAuthStatus(Connection con,String id,@Set String authStatus)throws SQLException;
41 42
	
42 43
	@Dynamic
43 44
	@Update
@ -59,6 +60,12 @@ public interface OrgDao {
59 60
	@From(Organization.class)
60 61
	String queryByName(Connection con,String name)throws SQLException;
61 62
	
63
	@Nullable
64
	@QueryVal
65
	@Column(handlerClass=StringHandler.class,value="auth_status")
66
	@From(Organization.class)
67
	String queryAuthStatus(Connection con,String id)throws SQLException;
68
	
62 69
	@PageSelect
63 70
	PageQueryResult<Organization> query(Connection con,@Nullable  @Like String name,@Nullable String orgType,int pageSize,int pageNo) throws SQLException;
64 71

+ 11 - 0
src/main/java/com/ekexiu/portal/po/Organization.java

@ -18,6 +18,10 @@ import com.ekexiu.portal.basepo.ModifyTimeSupported;
18 18
@Table
19 19
public class Organization extends BaseOrganization implements CreateTimeSupported,ModifyTimeSupported,DescpSupported{
20 20
21
	/**
22
	 * 企业简称
23
	 */
24
	private String forShort;
21 25
	/**
22 26
	 * 企业官网
23 27
	 */
@ -50,6 +54,13 @@ public class Organization extends BaseOrganization implements CreateTimeSupporte
50 54
	private String createTime;
51 55
	private String modifyTime;
52 56
57
	@Column(value=DE.String_de,dbType="VARCHAR(20)")
58
	public String getForShort() {
59
		return forShort;
60
	}
61
	public void setForShort(String forShort) {
62
		this.forShort = forShort;
63
	}
53 64
	@Column(DE.String_de)
54 65
	public String getOrgUrl() {
55 66
		return orgUrl;

+ 12 - 5
src/main/java/com/ekexiu/portal/service/OrgService.java

@ -11,10 +11,8 @@ import org.jfw.apt.annotation.Nullable;
11 11
import org.jfw.apt.web.annotation.Path;
12 12
import org.jfw.apt.web.annotation.operate.Get;
13 13
import org.jfw.apt.web.annotation.operate.Post;
14
import org.jfw.apt.web.annotation.operate.Put;
15 14
import org.jfw.apt.web.annotation.param.JdbcConn;
16 15
import org.jfw.apt.web.annotation.param.PathVar;
17
import org.jfw.apt.web.annotation.param.RequestBody;
18 16
import org.jfw.util.StringUtil;
19 17
20 18
import com.ekexiu.portal.dao.OrgDao;
@ -76,9 +74,12 @@ public class OrgService {
76 74
	}
77 75
	
78 76
	
79
	@Put
80
	@Path
81
	public void update(@JdbcConn(true) Connection con,@RequestBody Organization organization) throws SQLException{
77
	@Post
78
	@Path("/update")
79
	public void update(@JdbcConn(true) Connection con,Organization organization,@Nullable String fn) throws SQLException, IOException{
80
		if(fn != null){
81
			this.imageService.saveOrgLogo(organization.getId(), fn);
82
		}
82 83
		this.orgDao.update(con, organization);
83 84
	}
84 85
	
@ -88,6 +89,12 @@ public class OrgService {
88 89
		return this.orgDao.query(con, id);
89 90
	}
90 91
	
92
	@Get
93
	@Path("/authStatus")
94
	public String queryAuthStatus(@JdbcConn Connection con,String id)throws SQLException{
95
		return this.orgDao.queryAuthStatus(con, id);
96
	}
97
	
91 98
	@Get
92 99
	@Path("/qa")
93 100
	public List<Organization> query(@JdbcConn(false) Connection con )throws SQLException{