Commit dcf87abb by 阳浪

我的信息查询

parent 1a703d3d
...@@ -28,6 +28,9 @@ public class SystemMailboxConditionVo { ...@@ -28,6 +28,9 @@ public class SystemMailboxConditionVo {
@ApiModelProperty(value = "信箱类型 1: 纪检 2: 书记") @ApiModelProperty(value = "信箱类型 1: 纪检 2: 书记")
private Integer type; private Integer type;
@ApiModelProperty(value = "创建人")
private Long createById;
@ApiModelProperty(value = "联系人名称") @ApiModelProperty(value = "联系人名称")
private String contactName; private String contactName;
......
...@@ -19,4 +19,6 @@ public interface MyItemConfigMapper extends BaseMapper<MyItemConfig> { ...@@ -19,4 +19,6 @@ public interface MyItemConfigMapper extends BaseMapper<MyItemConfig> {
List<MyItemConfig> queryMyitemConfigByCondition(@Param("name") String name, @Param("showable") Integer showable, @Param("terminalType")Integer terminalType,@Param("siteId")Long siteId); List<MyItemConfig> queryMyitemConfigByCondition(@Param("name") String name, @Param("showable") Integer showable, @Param("terminalType")Integer terminalType,@Param("siteId")Long siteId);
List<MyItemConfig> queryByAuthoity(@Param("siteId") Long siteId, @Param("terminalType") List<Integer> terminalType, @Param("showAble") Integer showAble,@Param("accountId") Long accountId); List<MyItemConfig> queryByAuthoity(@Param("siteId") Long siteId, @Param("terminalType") List<Integer> terminalType, @Param("showAble") Integer showAble,@Param("accountId") Long accountId);
List<Long> getJjXxRoleCount(@Param("accountId") Long accountId);
} }
...@@ -100,6 +100,11 @@ public class MyItemConfigServiceImpl extends ServiceImpl<MyItemConfigMapper, MyI ...@@ -100,6 +100,11 @@ public class MyItemConfigServiceImpl extends ServiceImpl<MyItemConfigMapper, MyI
Long accountId = ContextHolder.get().getAccountId(); Long accountId = ContextHolder.get().getAccountId();
if(accountId==0L){ if(accountId==0L){
accountId = null; accountId = null;
}else{
List<Long> roleIds = myItemConfigmapper.getJjXxRoleCount(accountId);
if(CollectionUtils.isEmpty(roleIds)){
accountId = null;
}
} }
return myItemConfigmapper.queryByAuthoity(siteId, terminalType, showAble,accountId); return myItemConfigmapper.queryByAuthoity(siteId, terminalType, showAble,accountId);
} }
......
package com.yizhi.site.application.service.impl; package com.yizhi.site.application.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page; import com.baomidou.mybatisplus.plugins.Page;
...@@ -10,6 +11,7 @@ import com.yizhi.core.application.context.RequestContext; ...@@ -10,6 +11,7 @@ import com.yizhi.core.application.context.RequestContext;
import com.yizhi.course.application.eum.DeletedEnum; import com.yizhi.course.application.eum.DeletedEnum;
import com.yizhi.site.application.constant.SiteConstant; import com.yizhi.site.application.constant.SiteConstant;
import com.yizhi.site.application.domain.SystemMailbox; import com.yizhi.site.application.domain.SystemMailbox;
import com.yizhi.site.application.mapper.MyItemConfigMapper;
import com.yizhi.site.application.mapper.SystemMailboxMapper; import com.yizhi.site.application.mapper.SystemMailboxMapper;
import com.yizhi.site.application.service.SystemMailboxService; import com.yizhi.site.application.service.SystemMailboxService;
import com.yizhi.site.application.vo.domain.SystemMailboxVo; import com.yizhi.site.application.vo.domain.SystemMailboxVo;
...@@ -34,6 +36,9 @@ public class SystemMailboxServiceImpl extends ServiceImpl<SystemMailboxMapper,Sy ...@@ -34,6 +36,9 @@ public class SystemMailboxServiceImpl extends ServiceImpl<SystemMailboxMapper,Sy
@Autowired @Autowired
private IdGenerator idGenerator; private IdGenerator idGenerator;
@Autowired
private MyItemConfigMapper myItemConfigmapper;
@Override @Override
public Page<SystemMailbox> selectPage(SystemMailboxConditionVo conditionVo){ public Page<SystemMailbox> selectPage(SystemMailboxConditionVo conditionVo){
Page<SystemMailbox> page = new Page<>(conditionVo.getPageNo(), conditionVo.getPageSize()); Page<SystemMailbox> page = new Page<>(conditionVo.getPageNo(), conditionVo.getPageSize());
...@@ -53,9 +58,28 @@ public class SystemMailboxServiceImpl extends ServiceImpl<SystemMailboxMapper,Sy ...@@ -53,9 +58,28 @@ public class SystemMailboxServiceImpl extends ServiceImpl<SystemMailboxMapper,Sy
if(ObjectUtil.isNotEmpty(conditionVo.getFileName())){ if(ObjectUtil.isNotEmpty(conditionVo.getFileName())){
entityWrapper.like("file_name",conditionVo.getFileName()); entityWrapper.like("file_name",conditionVo.getFileName());
} }
Long accountId = ContextHolder.get().getAccountId();
List<Long> roleIds = myItemConfigmapper.getJjXxRoleCount(accountId);
if(CollectionUtil.isNotEmpty(roleIds)){
if(roleIds.contains(1877604582759526400L)&&!roleIds.contains(1877605828904022016L)){
conditionVo.setType(2);
}
if(!roleIds.contains(1877604582759526400L)&&roleIds.contains(1877605828904022016L)){
conditionVo.setType(1);
}
if(!roleIds.contains(1877604582759526400L)&&!roleIds.contains(1877605828904022016L)){
conditionVo.setCreateById(accountId);
}
}
if(ObjectUtil.isNotEmpty(conditionVo.getType())){ if(ObjectUtil.isNotEmpty(conditionVo.getType())){
entityWrapper.eq("type",conditionVo.getType()); entityWrapper.eq("type",conditionVo.getType());
} }
if(ObjectUtil.isNotEmpty(conditionVo.getCreateById())){
entityWrapper.eq("create_by_id",conditionVo.getCreateById());
}
List<String> list = new ArrayList<String>(); List<String> list = new ArrayList<String>();
list.add("submitTime"); list.add("submitTime");
entityWrapper.orderDesc(list); entityWrapper.orderDesc(list);
......
...@@ -66,6 +66,11 @@ ...@@ -66,6 +66,11 @@
<if test="siteId !=null"> <if test="siteId !=null">
and my.site_id = #{siteId} and my.site_id = #{siteId}
</if> </if>
<if test="accountId !=null">
and my.id in(
select item_id from my_item_config_role where role_id in(
select role_id from cloud_system.authz_account_role aar where account_id =#{accountId}))
</if>
<if test="terminalType !=null"> <if test="terminalType !=null">
and my.terminal_type in and my.terminal_type in
<foreach collection="terminalType" item="t" open="(" close=")" separator=","> <foreach collection="terminalType" item="t" open="(" close=")" separator=",">
...@@ -75,6 +80,10 @@ ...@@ -75,6 +80,10 @@
</where> </where>
order by my.sort order by my.sort
</select> </select>
<select id="getJjXxRoleCount" resultType="java.lang.Long">
select distinct role_id from my_item_config_role where role_id in(
select role_id from cloud_system.authz_account_role aar where account_id =#{accountId})
</select>
</mapper> </mapper>
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