虫情设备图片数据获取修改

This commit is contained in:
mi9688
2024-11-20 17:34:35 +08:00
parent bfafd4bb80
commit 393c942da2
34 changed files with 489 additions and 235 deletions

View File

@ -153,6 +153,11 @@ public class Project extends BaseEntity
@ApiModelProperty("行政区域村代码")
private String villageCode;
/** 项目lei */
@Excel(name = "项目lei")
@ApiModelProperty("项目lei")
private Long type;
//业务字段---------------------------------------------------------------------------
/**
* 系统账号名称

View File

@ -17,6 +17,7 @@ import com.fastbee.common.utils.json.JsonStrUtil;
import com.fastbee.iot.model.RegisterUserInput;
import com.fastbee.iot.model.RegisterUserOutput;
import com.fastbee.iot.service.IToolService;
import com.fastbee.common.constant.ProjectTypeConstant;
import com.fastbee.project.domain.Project;
import com.fastbee.project.domain.vo.ProjectLoginBaseInfo;
import com.fastbee.project.mapper.ProjectMapper;
@ -168,9 +169,26 @@ public class ProjectServiceImpl implements IProjectService
// 添加管理员角色,给基本权限
SysDept sysDept = deptService.selectDeptById(100L);
List<SysMenu> sysMenuList = sysMenuService.selectMenuList(new SysMenu(), sysDept.getDeptUserId());
Long[] menuIdList = sysMenuList.stream().map(SysMenu::getMenuId)
.filter(menuId-> menuId!=3469L&&menuId!=3L&&menuId!=2L &&menuId!=3468L&&menuId!=102L)
Long[] menuIdList = sysMenuList.stream()
//过滤掉不该有的菜单
.filter(this::baseMenuFilter)
.map(SysMenu::getMenuId)
.toArray(Long[]::new);
//根据项目类型过滤菜单
if (!Objects.nonNull(project.getType())||ProjectTypeConstant.isValidProjectType(project.getType())) {
throw new ServiceException("项目类型不能为空或者非法!");
}
if (Objects.equals(project.getType(),ProjectTypeConstant.WATER)) {
List<Long> menuList=Arrays.asList(menuIdList);
menuIdList = menuList.stream().filter(this::waterMenuFilter).toArray(Long[]::new);
}
if (Objects.equals(project.getType(),ProjectTypeConstant.AGRICULTURE)) {
List<Long> menuList=Arrays.asList(menuIdList);
menuIdList = menuList.stream().filter(this::agriculturalMenuFilter).toArray(Long[]::new);
}
SysRole sysRole = new SysRole();
sysRole.setRoleName("管理员");
sysRole.setRoleKey("manager");
@ -209,8 +227,37 @@ public class ProjectServiceImpl implements IProjectService
if(!updatedSysDept){
throw new ServiceException("机构与项目关联失败!");
}
return 1;
}
/**
* 判断菜单是否为非法持有菜单
* @param sysMenu 菜单
* @return 是否为非法菜单
*/
private boolean baseMenuFilter(SysMenu sysMenu) {
Long menuId = sysMenu.getMenuId();
boolean base = menuId != 3469L//项目管理
&& menuId != 3L//系统工具
&& menuId!= 2L//系统监控
&& menuId != 3468L//图例管理
&& menuId != 102L;//菜单管理
return base;
}
//农业项目过滤菜单
private boolean agriculturalMenuFilter(Long menuId){
return menuId != 3353L;//项目管理
}
//水利项目过滤菜单
private boolean waterMenuFilter(Long menuId){
return menuId != 3474L;//项目管理
}
/**
* 解析项目行政区划信息