Commit b6e381d9 by wangqi

项目成员

parent 7ee2fcc3
......@@ -47,20 +47,30 @@ public class YsqqXmxxController extends BaseController
// 系统管理员:看所有。
// 创建人能看到
// 项目成员能看到
ysqqXmxx.setCreatedBy(SecurityUtils.getUserId()+"");
// 拿到角色如果是管理员 不限制。不是管理员只能看到自己的帮扶组
boolean is_admin = false;
// 拿到角色如果是管理员 不限制。不是管理员只能看到自己创建的,或者自己是成员的
List<SysRole> rolelist = SecurityUtils.getLoginUser().getUser().getRoles();
if(StringUtils.isNotEmpty(rolelist)){
for (SysRole role :rolelist){
Long roleid = role.getRoleId();
if(roleid==1||roleid==3){
ysqqXmxx.setCreatedBy(null);
is_admin = true;
}
}
}
if(is_admin){
ysqqXmxx.setCreatedBy(null);
}else{
ysqqXmxx.setCreatedBy(SecurityUtils.getUserId()+"");
}
startPage();
List<YsqqXmxx> list = ysqqXmxxService.selectYsqqXmxxList(ysqqXmxx);
if(is_admin){
}else{
}
return getDataTable(list);
}
......
......@@ -345,4 +345,36 @@ public class YsqqXmxx extends BaseEntity
public void setZlsl(Integer zlsl) {
this.zlsl = zlsl;
}
// group by 的成员id
private String cyids;
// group by 的项目角色
private String xmjss;
// 当前登录人的角色
private String xmjs;
public String getCyids() {
return cyids;
}
public void setCyids(String cyids) {
this.cyids = cyids;
}
public String getXmjss() {
return xmjss;
}
public void setXmjss(String xmjss) {
this.xmjss = xmjss;
}
public String getXmjs() {
return xmjs;
}
public void setXmjs(String xmjs) {
this.xmjs = xmjs;
}
}
......@@ -29,8 +29,8 @@ public class YsqqXmxxXmcy extends BaseEntity
private Long userId;
/** 用户账号 */
@Excel(name = "用户账号")
private String userName;
@Excel(name = "用户姓名")
private String nickName;
/** 项目角色 */
@Excel(name = "项目角色")
......@@ -87,15 +87,7 @@ public class YsqqXmxxXmcy extends BaseEntity
return userId;
}
public void setUserName(String userName)
{
this.userName = userName;
}
public String getUserName()
{
return userName;
}
public void setXmjs(String xmjs)
{
......@@ -163,7 +155,7 @@ public class YsqqXmxxXmcy extends BaseEntity
.append("cyid", getCyid())
.append("zbid", getZbid())
.append("userId", getUserId())
.append("userName", getUserName())
.append("nickName", getNickName())
.append("xmjs", getXmjs())
.append("createdBy", getCreatedBy())
.append("createdTime", getCreatedTime())
......@@ -174,4 +166,12 @@ public class YsqqXmxxXmcy extends BaseEntity
.append("ext3", getExt3())
.toString();
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
}
......@@ -24,6 +24,8 @@
<result property="ext3" column="ext3" />
<result property="xmzt" column="xmzt" />
<result property="xmrq" column="xmrq" />
<result property="cyids" column="cyids" />
<result property="xmjss" column="xmjss" />
</resultMap>
<sql id="selectYsqqXmxxVo">
......@@ -32,9 +34,9 @@
<select id="selectYsqqXmxxList" parameterType="YsqqXmxx" resultMap="YsqqXmxxResult">
select a.id, a.xmmc, a.qk, a.xmjj, a.jhdw, a.jfdw, a.xmin, a.xmax, a.ymin, a.ymax,
a.created_by, a.created_time, a.update_by, a.update_time, a.ext1, a.ext2, a.ext3, a.xmzt, a.xmrq,b.cyid
a.created_by, a.created_time, a.update_by, a.update_time, a.ext1, a.ext2, a.ext3, a.xmzt, a.xmrq,b.cyids,b.xmjss
from ysqq_xmxx a
left join (select zbid,GROUP_CONCAT(user_id) cyid from ysqq_xmxx_xmcy group by zbid) b on a.id = b.zbid
left join (select zbid,GROUP_CONCAT(user_id) cyids ,GROUP_CONCAT(xmjs) xmjss from ysqq_xmxx_xmcy group by zbid) b on a.id = b.zbid
<where>
<if test="id != null "> and id = #{id}</if>
<if test="xmmc != null and xmmc != ''"> and xmmc like concat('%', #{xmmc}, '%')</if>
......@@ -46,7 +48,7 @@
<if test="xmax != null "> and xmax = #{xmax}</if>
<if test="ymin != null "> and ymin = #{ymin}</if>
<if test="ymax != null "> and ymax = #{ymax}</if>
<if test="createdBy != null and createdBy != ''"> and (created_by = #{createdBy} or FIND_IN_SET(#{createdBy},b.cyid))</if>
<if test="createdBy != null and createdBy != ''"> and (created_by = #{createdBy} or FIND_IN_SET(#{createdBy},b.cyids))</if>
<if test="createdTime != null "> and created_time = #{createdTime}</if>
<if test="ext1 != null and ext1 != ''"> and xmzt in ('待验收','已验收(待归档)','已归档')</if>
<if test="ext2 != null and ext2 != ''"> and xmzt in ('已验收(待归档)','已归档')</if>
......
......@@ -8,7 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="cyid" column="cyid" />
<result property="zbid" column="zbid" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="nickName" column="nick_name" />
<result property="xmjs" column="xmjs" />
<result property="createdBy" column="created_by" />
<result property="createdTime" column="created_time" />
......@@ -20,7 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectYsqqXmxxXmcyVo">
select cyid, zbid, user_id, user_name, xmjs, created_by, created_time, update_by, update_time, ext1, ext2, ext3 from ysqq_xmxx_xmcy
select cyid, zbid, user_id, nick_name, xmjs, created_by, created_time, update_by, update_time, ext1, ext2, ext3 from ysqq_xmxx_xmcy
</sql>
<select id="selectYsqqXmxxXmcyList" parameterType="YsqqXmxxXmcy" resultMap="YsqqXmxxXmcyResult">
......@@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="zbid != null "> and zbid = #{zbid}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
<if test="xmjs != null and xmjs != ''"> and xmjs = #{xmjs}</if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
<if test="createdTime != null "> and created_time = #{createdTime}</if>
......@@ -48,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="zbid != null">zbid,</if>
<if test="userId != null">user_id,</if>
<if test="userName != null">user_name,</if>
<if test="nickName != null">nick_name,</if>
<if test="xmjs != null">xmjs,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
......@@ -61,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="zbid != null">#{zbid},</if>
<if test="userId != null">#{userId},</if>
<if test="userName != null">#{userName},</if>
<if test="nickName != null">#{nickName},</if>
<if test="xmjs != null">#{xmjs},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
......@@ -78,7 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=",">
<if test="zbid != null">zbid = #{zbid},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="userName != null">user_name = #{userName},</if>
<if test="nickName != null">nick_name = #{nickName},</if>
<if test="xmjs != null">xmjs = #{xmjs},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment