Commit 57aa918e by 杨林龙

优化POI编辑详情描述展示 非管理员外只查看自己对应创建的POI

1 parent 20385c6c
......@@ -31,4 +31,8 @@ public class PoiFenceSearch extends BasicSearch {
*/
private String createEndDate;
/**
* 当前用户ID
*/
private Long userId;
}
......@@ -43,11 +43,13 @@ public class PoiFenceService extends AbstractCommonService {
private OrganizationApiService organizationApiService;
public PageInfo<PoiFenceSearchVO> search(PoiFenceSearch search) {
injectOrgChecked(search);
// log.info("search===" + JSONUtil.toJsonStr(search));
// 非管理员设置当前用户ID
if (!ShieldContextHolder.isSuperAdmin()) {
search.setUserId(ShieldContextHolder.getUserId());
}
Page page = PageHelper.startPage(search.getPageNumber(), search.getPageSize());
List<PoiFenceSearchVO> list = poiFenceMapper.search(search);
// log.info("search list===" + JSONUtil.toJsonStr(list));
// 填充组织层级
organizationApiService.drawAllLevel(list);
list.forEach(poiFenceSearchVO -> {
......@@ -64,7 +66,11 @@ public class PoiFenceService extends AbstractCommonService {
* @return
*/
public List<PoiFenceExport> export(PoiFenceSearch search) {
injectOrgChecked(search);
// 非管理员设置当前用户ID
if (!ShieldContextHolder.isSuperAdmin()) {
search.setUserId(ShieldContextHolder.getUserId());
}
List<PoiFenceExport> list = poiFenceMapper.export(search);
list.forEach(poiFenceSearchVO -> {
poiFenceSearchVO.setPoiTypeStr(PoiTypeEnum.getDescByCode(poiFenceSearchVO.getPoiType()));
......@@ -72,7 +78,6 @@ public class PoiFenceService extends AbstractCommonService {
});
// 填充组织层级
organizationApiService.drawAllLevel(list);
// log.info("export list===" + JSONUtil.toJsonStr(list));
return list;
}
......
......@@ -73,8 +73,8 @@
<if test="createEndDate != null and createEndDate != ''">
and LEFT(tpf.created_date,10) &lt;= #{createEndDate}
</if>
<if test="checkedUserIdsStr != null and checkedUserIdsStr !=''">
and tpf.created_by in (#{checkedUserIdsStr})
<if test="userId != null ">
and tpf.created_by in (#{userId})
</if>
order by tpf.id desc
</select>
......@@ -104,8 +104,8 @@
<if test="createEndDate != null and createEndDate != ''">
and LEFT(tpf.created_date,10) &lt;= #{createEndDate}
</if>
<if test="checkedUserIdsStr != null and checkedUserIdsStr !=''">
and tpf.created_by in (#{checkedUserIdsStr})
<if test="userId != null ">
and tpf.created_by in (#{userId})
</if>
order by tpf.id desc
</select>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!