GLJ-代码提交

This commit is contained in:
glj 2023-05-08 13:50:33 +08:00
parent 846b160403
commit 9c12722c82
7 changed files with 35 additions and 4 deletions

View File

@ -92,4 +92,15 @@ public class CallForHelpVo extends DisasterInfo {
*/
private String roleName;
/**
* 角色Id
*/
private Long roleId;
/**
* 角色父级Id
*/
private Long parentId;
}

View File

@ -78,6 +78,11 @@ public class DisasterInfoController {
})
@GetMapping("/list")
public R<IPage<CallForHelpVo>> list(CallForHelpVo CallForHelpVo, Query query) {
CallForHelpVo userRole = disasterInfoService.getByNameRole("admin");
Long chiefIdEquals = CallForHelpVo.getChiefIdEquals();
if (chiefIdEquals.equals(userRole.getRoleId())){
CallForHelpVo.setChiefIdEquals(null);
}
IPage<CallForHelpVo> pages = disasterInfoService.page(Condition.getPage(query), CallForHelpVo);
return R.data(pages);
}

View File

@ -80,4 +80,7 @@ public interface DisasterInfoMapper extends BaseMapper<DisasterInfo> {
List<Map<String, Long>> adminData(String year);
List<Map<String, Long>> disasterNum(String year);
CallForHelpVo getByNameRole(@Param("admin") String admin);
}

View File

@ -371,4 +371,8 @@
</select>
<select id="getByNameRole" resultType="com.kening.vordm.vo.CallForHelpVo">
SELECT id AS roleId, parent_id AS parentId, role_name AS roleName FROM blade_role WHERE role_name = #{admin}
</select>
</mapper>

View File

@ -74,6 +74,9 @@
<if test="remoteSensingSourceData.disasterId != null and remoteSensingSourceData.disasterId != ''">
r.disaster_id = #{remoteSensingSourceData.disasterId}
</if>
<if test="remoteSensingSourceData.status != null">
and r.status = #{remoteSensingSourceData.status}
</if>
<if test="remoteSensingSourceData.productResolutionMax != null and remoteSensingSourceData.productResolutionMin != null">
and r.product_resolution &gt;= #{remoteSensingSourceData.productResolutionMin} and r.product_resolution &lt; #{remoteSensingSourceData.productResolutionMax}
</if>

View File

@ -72,4 +72,6 @@ public interface DisasterInfoService extends IService<DisasterInfo> {
Integer getByUserDisasterInfo(Long userId, Long disasterId);
UserVo getByUserDisasterInfoStatistics(Long userId);
CallForHelpVo getByNameRole(String anmin);
}

View File

@ -20,7 +20,6 @@ import org.springblade.common.cache.CacheNames;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.DigestUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.scheduling.annotation.Async;
@ -154,9 +153,8 @@ public class DisasterInfoServiceImpl extends ServiceImpl<DisasterInfoMapper, Dis
@Override
public IPage<CallForHelpVo> page(IPage<CallForHelpVo> page, CallForHelpVo callForHelpVo) {
if (callForHelpVo.getRoleName() == null || callForHelpVo.getRoleName().equals("admin")){
callForHelpVo.setChiefIdEquals(null);
}
return page.setRecords(this.baseMapper.page(page, callForHelpVo));
}
@ -239,6 +237,11 @@ public class DisasterInfoServiceImpl extends ServiceImpl<DisasterInfoMapper, Dis
return userVo;
}
@Override
public CallForHelpVo getByNameRole(String anmin) {
return this.baseMapper.getByNameRole(anmin);
}
/**
* 后台管理系统-控制台灾害各项统计
* @description 暂时没有条件查询 所有统计都暂时写在一个查询里面