菜单路由,添加中文描述字段; 设备清单,添加所属 线路和是否为标杆机组字段;
This commit is contained in:
parent
b497f4cbdb
commit
7755b45b59
@ -339,4 +339,12 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isAllEnglishLetters(String str) {
|
||||||
|
if (str == null || str.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 正则表达式 [a-zA-Z] 匹配英文字母
|
||||||
|
return str.matches("[a-zA-Z]+");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import com.das.common.config.SessionUtil;
|
|||||||
import com.das.common.constant.SysAuthorityIds;
|
import com.das.common.constant.SysAuthorityIds;
|
||||||
import com.das.common.result.R;
|
import com.das.common.result.R;
|
||||||
import com.das.common.utils.PageDataInfo;
|
import com.das.common.utils.PageDataInfo;
|
||||||
|
import com.das.common.utils.StringUtils;
|
||||||
import com.das.modules.auth.domain.dto.DeleteDto;
|
import com.das.modules.auth.domain.dto.DeleteDto;
|
||||||
import com.das.modules.auth.domain.dto.SysMenuDto;
|
import com.das.modules.auth.domain.dto.SysMenuDto;
|
||||||
import com.das.modules.auth.domain.dto.SysMenuQueryDto;
|
import com.das.modules.auth.domain.dto.SysMenuQueryDto;
|
||||||
@ -35,12 +36,14 @@ public class SysMenusController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
public R<?> createMenu(@RequestBody SysMenuDto sysMenuDto) {
|
public R<?> createMenu(@RequestBody SysMenuDto sysMenuDto) {
|
||||||
|
|
||||||
//判断是否有权限
|
//判断是否有权限
|
||||||
boolean hasPermission = StpUtil.hasPermission(SysAuthorityIds.SYS_AUTHORITY_ID_ADMIN.toString());
|
boolean hasPermission = StpUtil.hasPermission(SysAuthorityIds.SYS_AUTHORITY_ID_ADMIN.toString());
|
||||||
if(!hasPermission){
|
if(!hasPermission){
|
||||||
return R.fail("没有系统管理权限");
|
return R.fail("没有系统管理权限");
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isAllEnglishLetters(sysMenuDto.getMenuName())){
|
||||||
|
return R.fail("菜单名称,必须为英文");
|
||||||
|
}
|
||||||
return R.success(sysMenuService.createMenu(sysMenuDto));
|
return R.success(sysMenuService.createMenu(sysMenuDto));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,7 +58,9 @@ public class SysMenusController {
|
|||||||
if(!hasPermission){
|
if(!hasPermission){
|
||||||
return R.fail("没有系统管理权限");
|
return R.fail("没有系统管理权限");
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isAllEnglishLetters(sysMenuDto.getMenuName())){
|
||||||
|
return R.fail("菜单名称,必须为英文");
|
||||||
|
}
|
||||||
sysMenuService.updateMenu(sysMenuDto);
|
sysMenuService.updateMenu(sysMenuDto);
|
||||||
return R.success();
|
return R.success();
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,8 @@ public class SysMenuDto implements Serializable {
|
|||||||
private Long id ;
|
private Long id ;
|
||||||
/** 菜单名称 */
|
/** 菜单名称 */
|
||||||
private String menuName ;
|
private String menuName ;
|
||||||
|
/** 菜单名称中文描述 */
|
||||||
|
private String menuDesc ;
|
||||||
/** 菜单排列顺序 */
|
/** 菜单排列顺序 */
|
||||||
private Integer menuOrder ;
|
private Integer menuOrder ;
|
||||||
/** 菜单图标名称 */
|
/** 菜单图标名称 */
|
||||||
|
@ -12,8 +12,11 @@ public class SysMenuQueryDto implements Serializable {
|
|||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long id ;
|
private Long id ;
|
||||||
|
|
||||||
/** 菜单名称 */
|
/** 菜单英文名称 */
|
||||||
private String menuName ;
|
private String menuName ;
|
||||||
|
/** 菜单中文名称 */
|
||||||
|
private String menuDesc ;
|
||||||
|
|
||||||
/** 上级菜单ID */
|
/** 上级菜单ID */
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long parentMenuId ;
|
private Long parentMenuId ;
|
||||||
|
@ -19,6 +19,8 @@ public class SysMenuVo implements Serializable {
|
|||||||
private Long id ;
|
private Long id ;
|
||||||
/** 菜单名称 */
|
/** 菜单名称 */
|
||||||
private String menuName ;
|
private String menuName ;
|
||||||
|
/** 菜单中文名称 */
|
||||||
|
private String menuDesc ;
|
||||||
/** 菜单排列顺序 */
|
/** 菜单排列顺序 */
|
||||||
private Integer menuOrder ;
|
private Integer menuOrder ;
|
||||||
/** 菜单图标名称 */
|
/** 菜单图标名称 */
|
||||||
|
@ -40,6 +40,10 @@ public class SysMenu extends BaseEntity {
|
|||||||
@TableField("menu_name")
|
@TableField("menu_name")
|
||||||
private String menuName ;
|
private String menuName ;
|
||||||
|
|
||||||
|
/** 菜单名称,中文描述 */
|
||||||
|
@TableField("menu_desc")
|
||||||
|
private String menuDesc ;
|
||||||
|
|
||||||
/** 菜单排列顺序 */
|
/** 菜单排列顺序 */
|
||||||
@TableField("menu_order")
|
@TableField("menu_order")
|
||||||
private Integer menuOrder ;
|
private Integer menuOrder ;
|
||||||
|
@ -95,4 +95,16 @@ public class SysEquipmentDto {
|
|||||||
* 当前页数
|
* 当前页数
|
||||||
*/
|
*/
|
||||||
private Integer pageNum;
|
private Integer pageNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属线路
|
||||||
|
*/
|
||||||
|
private String belongLine;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否为标杆机组
|
||||||
|
*/
|
||||||
|
private Integer standard;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -102,4 +102,15 @@ public class SysEquipmentVo{
|
|||||||
*/
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<SysEquipment> equipChildren;
|
private List<SysEquipment> equipChildren;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属线路
|
||||||
|
*/
|
||||||
|
private String belongLine;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否为标杆机组
|
||||||
|
*/
|
||||||
|
private Integer standard;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -119,4 +119,16 @@ public class SysEquipment extends BaseEntity {
|
|||||||
@TableField(value = "iot_model_id")
|
@TableField(value = "iot_model_id")
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long iotModelId;
|
private Long iotModelId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属线路
|
||||||
|
*/
|
||||||
|
@TableField(value = "belong_line")
|
||||||
|
private String belongLine;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否为标杆机组
|
||||||
|
*/
|
||||||
|
@TableField(value = "standard")
|
||||||
|
private Integer standard;
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
<result property="latitude" column="latitude" jdbcType="DOUBLE"/>
|
<result property="latitude" column="latitude" jdbcType="DOUBLE"/>
|
||||||
<result property="longitude" column="longitude" jdbcType="DOUBLE"/>
|
<result property="longitude" column="longitude" jdbcType="DOUBLE"/>
|
||||||
<result property="iotModelId" column="iot_model_id" jdbcType="BIGINT"/>
|
<result property="iotModelId" column="iot_model_id" jdbcType="BIGINT"/>
|
||||||
|
<result property="belongLine" column="belong_line" jdbcType="VARCHAR"/>
|
||||||
|
<result property="standard" column="standard" jdbcType="INTEGER"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap type="com.das.modules.equipment.domain.vo.SysEquipmentVo" id="SysEquipmentListMap">
|
<resultMap type="com.das.modules.equipment.domain.vo.SysEquipmentVo" id="SysEquipmentListMap">
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
<resultMap type="com.das.modules.auth.entity.SysMenu" id="SysMenuMap">
|
<resultMap type="com.das.modules.auth.entity.SysMenu" id="SysMenuMap">
|
||||||
<result property="id" column="id" jdbcType="BIGINT"/>
|
<result property="id" column="id" jdbcType="BIGINT"/>
|
||||||
<result property="menuName" column="menu_name" jdbcType="VARCHAR"/>
|
<result property="menuName" column="menu_name" jdbcType="VARCHAR"/>
|
||||||
|
<result property="menuDesc" column="menu_desc" jdbcType="VARCHAR"/>
|
||||||
<result property="menuOrder" column="menu_order" jdbcType="INTEGER"/>
|
<result property="menuOrder" column="menu_order" jdbcType="INTEGER"/>
|
||||||
<result property="menuIcon" column="menu_icon" jdbcType="VARCHAR"/>
|
<result property="menuIcon" column="menu_icon" jdbcType="VARCHAR"/>
|
||||||
<result property="funType" column="fun_type" jdbcType="INTEGER"/>
|
<result property="funType" column="fun_type" jdbcType="INTEGER"/>
|
||||||
@ -22,6 +23,7 @@
|
|||||||
<resultMap id="SysMenuChildMap" type="com.das.modules.auth.domain.vo.SysMenuVo">
|
<resultMap id="SysMenuChildMap" type="com.das.modules.auth.domain.vo.SysMenuVo">
|
||||||
<result property="id" column="id" jdbcType="BIGINT"/>
|
<result property="id" column="id" jdbcType="BIGINT"/>
|
||||||
<result property="menuName" column="menu_name" jdbcType="VARCHAR"/>
|
<result property="menuName" column="menu_name" jdbcType="VARCHAR"/>
|
||||||
|
<result property="menuDesc" column="menu_desc" jdbcType="VARCHAR"/>
|
||||||
<result property="menuOrder" column="menu_order" jdbcType="INTEGER"/>
|
<result property="menuOrder" column="menu_order" jdbcType="INTEGER"/>
|
||||||
<result property="menuIcon" column="menu_icon" jdbcType="VARCHAR"/>
|
<result property="menuIcon" column="menu_icon" jdbcType="VARCHAR"/>
|
||||||
<result property="funType" column="fun_type" jdbcType="INTEGER"/>
|
<result property="funType" column="fun_type" jdbcType="INTEGER"/>
|
||||||
@ -48,6 +50,9 @@
|
|||||||
<if test="sysMenu.menuName != null and sysMenu.menuName != ''">
|
<if test="sysMenu.menuName != null and sysMenu.menuName != ''">
|
||||||
and menu_name like concat('%',#{sysMenu.menuName},'%')
|
and menu_name like concat('%',#{sysMenu.menuName},'%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="sysMenu.menuDesc != null and sysMenu.menuDesc != ''">
|
||||||
|
and menu_desc like concat('%',#{sysMenu.menuDesc},'%')
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
order by menu_order
|
order by menu_order
|
||||||
</select>
|
</select>
|
||||||
|
Loading…
Reference in New Issue
Block a user