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

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;//项目管理
}
/**
* 解析项目行政区划信息

View File

@ -36,10 +36,11 @@
<result property="countyCode" column="county_code" />
<result property="townCode" column="town_code" />
<result property="villageCode" column="village_code" />
<result property="type" column="type" />
</resultMap>
<sql id="selectProjectVo">
select id, project_name, sys_show_name, central_coordinates, scope, administrative_area, owner, logo, image, video_introduction, remark, p_params, introduce, del_flag, create_time, create_by, update_time, remarks, tenant_id, tenant_name, owner_id, parent_id, dept_id, administrative_area_code, dept_name, level, province_code, city_code, county_code, town_code, village_code from project
select id, project_name, sys_show_name, central_coordinates, scope, administrative_area, owner, logo, image, video_introduction, remark, p_params, introduce, del_flag, create_time, create_by, update_time, remarks, tenant_id, tenant_name, owner_id, parent_id, dept_id, administrative_area_code, dept_name, level, province_code, city_code, county_code, town_code, village_code, type from project
</sql>
<select id="selectProjectList" parameterType="Project" resultMap="ProjectResult">
@ -70,6 +71,7 @@
<if test="countyCode != null and countyCode != ''"> and county_code = #{countyCode}</if>
<if test="townCode != null and townCode != ''"> and town_code = #{townCode}</if>
<if test="villageCode != null and villageCode != ''"> and village_code = #{villageCode}</if>
<if test="type != null "> and type = #{type}</if>
</where>
</select>
@ -111,6 +113,7 @@
<if test="countyCode != null">county_code,</if>
<if test="townCode != null">town_code,</if>
<if test="villageCode != null">village_code,</if>
<if test="type != null">type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="projectName != null and projectName != ''">#{projectName},</if>
@ -143,6 +146,7 @@
<if test="countyCode != null">#{countyCode},</if>
<if test="townCode != null">#{townCode},</if>
<if test="villageCode != null">#{villageCode},</if>
<if test="type != null">#{type},</if>
</trim>
</insert>
@ -179,6 +183,7 @@
<if test="countyCode != null">county_code = #{countyCode},</if>
<if test="townCode != null">town_code = #{townCode},</if>
<if test="villageCode != null">village_code = #{villageCode},</if>
<if test="type != null">type = #{type},</if>
</trim>
where id = #{id}
</update>