mirror of https://github.com/Rekoe/rk_svnadmin
pull/1/head
parent
4baadb1e6c
commit
9b8ccd23e4
|
@ -1,7 +1,11 @@
|
|||
package com.rekoe.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.nutz.dao.entity.annotation.Column;
|
||||
import org.nutz.dao.entity.annotation.Comment;
|
||||
import org.nutz.dao.entity.annotation.Index;
|
||||
import org.nutz.dao.entity.annotation.Name;
|
||||
import org.nutz.dao.entity.annotation.PK;
|
||||
import org.nutz.dao.entity.annotation.Table;
|
||||
import org.nutz.dao.entity.annotation.TableIndexes;
|
||||
|
@ -12,7 +16,7 @@ import org.nutz.dao.entity.annotation.TableIndexes;
|
|||
@Table("pj_usr")
|
||||
@PK({ "usr", "pj" })
|
||||
@TableIndexes({ @Index(name = "FK_Reference_5", fields = { "pj" }, unique = false) })
|
||||
public class PjUsr extends Usr {
|
||||
public class PjUsr implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -23,6 +27,98 @@ public class PjUsr extends Usr {
|
|||
@Column
|
||||
private String pj;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Name
|
||||
private String usr;
|
||||
/**
|
||||
* 用户姓名
|
||||
*/
|
||||
@Comment
|
||||
private String name;
|
||||
/**
|
||||
* 密码(加密)
|
||||
*/
|
||||
@Comment
|
||||
private String psw;
|
||||
/**
|
||||
* 角色
|
||||
*/
|
||||
@Comment
|
||||
private String role;
|
||||
|
||||
@Comment
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* @return 用户ID
|
||||
*/
|
||||
public String getUsr() {
|
||||
return usr;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param usr
|
||||
* 用户ID
|
||||
*/
|
||||
public void setUsr(String usr) {
|
||||
this.usr = usr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 用户姓名
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name
|
||||
* 用户姓名
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 密码(加密)
|
||||
*/
|
||||
public String getPsw() {
|
||||
return psw;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param psw
|
||||
* 密码(加密)
|
||||
*/
|
||||
public void setPsw(String psw) {
|
||||
this.psw = psw;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 角色
|
||||
*/
|
||||
public String getRole() {
|
||||
return role;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param role
|
||||
* 角色
|
||||
*/
|
||||
public void setRole(String role) {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 项目ID
|
||||
*/
|
||||
|
|
|
@ -30,6 +30,7 @@ public class ChangePackage {
|
|||
public void visit(File file) {
|
||||
if (file.isDirectory())
|
||||
return;
|
||||
System.out.println(file);
|
||||
String origin = Files.read(file);
|
||||
String output = origin.replaceAll("WenQuanYi Micro Hei.ttf", "FZY4JW_0.ttf");
|
||||
if (origin.equals(output))
|
||||
|
|
|
@ -18,6 +18,7 @@ import org.nutz.ioc.loader.annotation.IocBean;
|
|||
|
||||
import com.rekoe.domain.Pj;
|
||||
import com.rekoe.domain.PjAuth;
|
||||
import com.rekoe.domain.PjGrAuth;
|
||||
import com.rekoe.utils.Constants;
|
||||
|
||||
/**
|
||||
|
@ -283,9 +284,11 @@ public class ProjectAuthService extends BaseService<PjAuth> {
|
|||
*/
|
||||
public void saveByGr(PjAuth pjAuth) {
|
||||
if (this.getByGr(pjAuth.getPj(), pjAuth.getGr(), pjAuth.getRes()) == null) {
|
||||
dao().insert(pjAuth);
|
||||
Sql sql = Sqls.create("insert into pj_gr_auth (pj,gr,res,rw) values (@pj,@gr,@res,@rw)");
|
||||
sql.setParam("pj", pjAuth.getPj()).setParam("gr", pjAuth.getGr()).setParam("res", pjAuth.getRes()).setParam("rw", pjAuth.getRw());
|
||||
dao().execute(sql);
|
||||
} else {
|
||||
dao().update(getEntityClass(), Chain.make("rw", pjAuth.getRw()), Cnd.where("pj", "=", pjAuth.getPj()).and("gr", "=", pjAuth.getGr()).and("res", "=", pjAuth.getRes()));
|
||||
dao().update(PjGrAuth.class, Chain.make("rw", pjAuth.getRw()), Cnd.where("pj", "=", pjAuth.getPj()).and("gr", "=", pjAuth.getGr()).and("res", "=", pjAuth.getRes()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ public class UsrService extends BaseService<Usr> {
|
|||
* @return 所有项目用户列表(不包括*)
|
||||
*/
|
||||
public List<Usr> getList(String pj) {
|
||||
Sql sql = Sqls.create("select p.usr,p.name,p.role,CASE WHEN pu.psw IS NOT NULL THEN pu.psw ELSE p.psw END psw from (" + " select a.usr,a.role,a.psw,a.name from usr a " + " where " + " exists (select d.usr from pj_gr_usr d where d.usr=a.usr and d.pj=$pj) " + " or exists(select c.usr from pj_usr_auth c where a.usr=c.usr and c.pj=$pj) " + " ) p " + " left join pj_usr pu on (p.usr=pu.usr and pu.pj=$pj) where p.usr <> '*'" + " order by p.usr ");
|
||||
sql.setVar("pj", pj);
|
||||
Sql sql = Sqls.create("select p.usr,p.name,p.role,CASE WHEN pu.psw IS NOT NULL THEN pu.psw ELSE p.psw END psw from (" + " select a.usr,a.role,a.psw,a.name from usr a " + " where " + " exists (select d.usr from pj_gr_usr d where d.usr=a.usr and d.pj=@pj) " + " or exists(select c.usr from pj_usr_auth c where a.usr=c.usr and c.pj=@pj) " + " ) p " + " left join pj_usr pu on (p.usr=pu.usr and pu.pj=@pj) where p.usr <> '*'" + " order by p.usr ");
|
||||
sql.setParam("pj", pj);
|
||||
final List<Usr> list = new ArrayList<Usr>();
|
||||
sql.setCallback(new SqlCallback() {
|
||||
|
||||
|
@ -60,8 +60,8 @@ public class UsrService extends BaseService<Usr> {
|
|||
}
|
||||
|
||||
public List<Usr> getListByRootPath(String rootPath) {
|
||||
Sql sql = Sqls.create("select p.usr,p.name,p.role,CASE WHEN pu.psw IS NOT NULL THEN pu.psw ELSE p.psw END psw from (" + " select a.usr,a.role,a.psw,a.name from usr a " + " where " + " exists (select d.usr from pj_gr_usr d where d.usr=a.usr and d.pj in (select distinct pj from pj where type=$type and path like $like)) " + " or exists(select c.usr from pj_usr_auth c where a.usr=c.usr and c.pj in (select distinct pj from pj where type=$type and path like $like)) " + " ) p " + " left join pj_usr pu on (p.usr=pu.usr) where p.usr <> '*'" + " order by p.usr ");
|
||||
sql.setVar("like", rootPath + "%").setVar("type", com.rekoe.utils.Constants.HTTP_MUTIL);
|
||||
Sql sql = Sqls.create("select p.usr,p.name,p.role,CASE WHEN pu.psw IS NOT NULL THEN pu.psw ELSE p.psw END psw from (" + " select a.usr,a.role,a.psw,a.name from usr a " + " where " + " exists (select d.usr from pj_gr_usr d where d.usr=a.usr and d.pj in (select distinct pj from pj where type=@type and path like @like)) " + " or exists(select c.usr from pj_usr_auth c where a.usr=c.usr and c.pj in (select distinct pj from pj where type=@type and path like @like)) " + " ) p " + " left join pj_usr pu on (p.usr=pu.usr) where p.usr <> '*'" + " order by p.usr ");
|
||||
sql.setParam("like", rootPath + "%").setParam("type", com.rekoe.utils.Constants.HTTP_MUTIL);
|
||||
final List<Usr> list = new ArrayList<Usr>();
|
||||
sql.setCallback(new SqlCallback() {
|
||||
|
||||
|
|
Loading…
Reference in New Issue