Pre Merge pull request !106 from s886259/master

This commit is contained in:
Gitee 2019-06-18 21:13:59 +08:00
commit 67adfeb5d1
109 changed files with 12053 additions and 1314 deletions

43
.gitignore vendored
View File

@ -1,43 +0,0 @@
######################################################################
# Build Tools
.gradle
/build/
!gradle/wrapper/gradle-wrapper.jar
target/
!.mvn/wrapper/maven-wrapper.jar
######################################################################
# IDE
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
nbproject/private/
build/*
nbbuild/
dist/
nbdist/
.nb-gradle/
######################################################################
# Others
*.log
*.xml.versionsBackup
!*/build/*.java
!*/build/*.html
!*/build/*.xml

20
pom.xml
View File

@ -4,13 +4,12 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId>
<groupId>com.ezsvs</groupId>
<artifactId>rms</artifactId>
<version>3.4</version>
<name>ruoyi</name>
<url>http://www.ruoyi.vip</url>
<description>若依管理系统</description>
<name>rms</name>
<description>资源管理系统</description>
<properties>
<ruoyi.version>3.4</ruoyi.version>
@ -31,6 +30,7 @@
<jsoup.version>1.11.3</jsoup.version>
<poi.version>3.17</poi.version>
<velocity.version>1.7</velocity.version>
<fastjson.version>1.2.16</fastjson.version>
</properties>
<!-- 依赖声明 -->
@ -170,35 +170,35 @@
<!-- 定时任务-->
<dependency>
<groupId>com.ruoyi</groupId>
<groupId>com.ezsvs</groupId>
<artifactId>ruoyi-quartz</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.ruoyi</groupId>
<groupId>com.ezsvs</groupId>
<artifactId>ruoyi-generator</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<groupId>com.ezsvs</groupId>
<artifactId>ruoyi-framework</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 系统模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<groupId>com.ezsvs</groupId>
<artifactId>ruoyi-system</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<groupId>com.ezsvs</groupId>
<artifactId>ruoyi-common</artifactId>
<version>${ruoyi.version}</version>
</dependency>

View File

@ -0,0 +1 @@
browser-sync start --proxy localhost:80 --files "**"

View File

@ -3,8 +3,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<artifactId>rms</artifactId>
<groupId>com.ezsvs</groupId>
<version>3.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -57,19 +57,19 @@
<!-- 核心模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<groupId>com.ezsvs</groupId>
<artifactId>ruoyi-framework</artifactId>
</dependency>
<!-- 定时任务-->
<dependency>
<groupId>com.ruoyi</groupId>
<groupId>com.ezsvs</groupId>
<artifactId>ruoyi-quartz</artifactId>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.ruoyi</groupId>
<groupId>com.ezsvs</groupId>
<artifactId>ruoyi-generator</artifactId>
</dependency>

View File

@ -0,0 +1,123 @@
package com.ruoyi.web.controller.assets;
import com.ruoyi.assets.domain.AssetsCabinet;
import com.ruoyi.assets.domain.AssetsMachineRoom;
import com.ruoyi.assets.service.IAssetsCabinetService;
import com.ruoyi.assets.service.IAssetsMachineRoomService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 机柜类型 信息操作处理
*
* @author TP
* @date 2019-06-17
*/
@Controller
@RequestMapping("/assets/assetsCabinet")
public class AssetsCabinetController extends BaseController {
private String prefix = "assets/assetsCabinet";
@Autowired
private IAssetsCabinetService assetsCabinetService;
@Autowired
private IAssetsMachineRoomService assetsMachineRoomService;
@RequiresPermissions("assets:assetsCabinet:view")
@GetMapping()
public String assetsCabinet() {
return prefix + "/assetsCabinet";
}
/**
* 查询机柜类型列表
*/
@RequiresPermissions("assets:assetsCabinet:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(AssetsCabinet assetsCabinet) {
startPage();
List<AssetsCabinet> list = assetsCabinetService.selectAssetsCabinetList(assetsCabinet);
return getDataTable(list);
}
/**
* 导出机柜类型列表
*/
@RequiresPermissions("assets:assetsCabinet:export")
@PostMapping("/export")
@ResponseBody
public AjaxResult export(AssetsCabinet assetsCabinet) {
List<AssetsCabinet> list = assetsCabinetService.selectAssetsCabinetList(assetsCabinet);
ExcelUtil<AssetsCabinet> util = new ExcelUtil<AssetsCabinet>(AssetsCabinet.class);
return util.exportExcel(list, "assetsCabinet");
}
/**
* 新增机柜类型
*/
@GetMapping("/add")
public String add(ModelMap mmap) {
List<AssetsMachineRoom> list = assetsMachineRoomService.selectAssetsMachineRoomList(new AssetsMachineRoom());
mmap.put("machineRooms", list);
return prefix + "/add";
}
/**
* 新增保存机柜类型
*/
@RequiresPermissions("assets:assetsCabinet:add")
@Log(title = "机柜管理", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(AssetsCabinet assetsCabinet) {
return toAjax(assetsCabinetService.insertAssetsCabinet(assetsCabinet));
}
/**
* 修改机柜类型
*/
@GetMapping("/edit/{cabinetId}")
public String edit(@PathVariable("cabinetId") Integer cabinetId, ModelMap mmap) {
AssetsCabinet assetsCabinet = assetsCabinetService.selectAssetsCabinetById(cabinetId);
List<AssetsMachineRoom> list = assetsMachineRoomService.selectAssetsMachineRoomList(new AssetsMachineRoom());
mmap.put("machineRooms", list);
mmap.put("assetsCabinet", assetsCabinet);
return prefix + "/edit";
}
/**
* 修改保存机柜类型
*/
@RequiresPermissions("assets:assetsCabinet:edit")
@Log(title = "机柜管理", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(AssetsCabinet assetsCabinet) {
return toAjax(assetsCabinetService.updateAssetsCabinet(assetsCabinet));
}
/**
* 删除机柜类型
*/
@RequiresPermissions("assets:assetsCabinet:remove")
@Log(title = "机柜管理", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids) {
return toAjax(assetsCabinetService.deleteAssetsCabinetByIds(ids));
}
}

View File

@ -0,0 +1,115 @@
package com.ruoyi.web.controller.assets;
import com.ruoyi.assets.domain.AssetsMachineRoom;
import com.ruoyi.assets.service.IAssetsMachineRoomService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 机房 信息操作处理
*
* @author TP
* @date 2019-06-17
*/
@Controller
@RequestMapping("/assets/assetsMachineRoom")
public class AssetsMachineRoomController extends BaseController {
private String prefix = "assets/assetsMachineRoom";
@Autowired
private IAssetsMachineRoomService assetsMachineRoomService;
@RequiresPermissions("assets:assetsMachineRoom:view")
@GetMapping()
public String assetsMachineRoom() {
return prefix + "/assetsMachineRoom";
}
/**
* 查询机房列表
*/
@RequiresPermissions("assets:assetsMachineRoom:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(AssetsMachineRoom assetsMachineRoom) {
startPage();
List<AssetsMachineRoom> list = assetsMachineRoomService.selectAssetsMachineRoomList(assetsMachineRoom);
return getDataTable(list);
}
/**
* 导出机房列表
*/
@RequiresPermissions("assets:assetsMachineRoom:export")
@PostMapping("/export")
@ResponseBody
public AjaxResult export(AssetsMachineRoom assetsMachineRoom) {
List<AssetsMachineRoom> list = assetsMachineRoomService.selectAssetsMachineRoomList(assetsMachineRoom);
ExcelUtil<AssetsMachineRoom> util = new ExcelUtil<AssetsMachineRoom>(AssetsMachineRoom.class);
return util.exportExcel(list, "assetsMachineRoom");
}
/**
* 新增机房
*/
@GetMapping("/add")
public String add() {
return prefix + "/add";
}
/**
* 新增保存机房
*/
@RequiresPermissions("assets:assetsMachineRoom:add")
@Log(title = "机房管理", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(AssetsMachineRoom assetsMachineRoom) {
return toAjax(assetsMachineRoomService.insertAssetsMachineRoom(assetsMachineRoom));
}
/**
* 修改机房
*/
@GetMapping("/edit/{machineRoomId}")
public String edit(@PathVariable("machineRoomId") Integer machineRoomId, ModelMap mmap) {
AssetsMachineRoom assetsMachineRoom = assetsMachineRoomService.selectAssetsMachineRoomById(machineRoomId);
mmap.put("assetsMachineRoom", assetsMachineRoom);
return prefix + "/edit";
}
/**
* 修改保存机房
*/
@RequiresPermissions("assets:assetsMachineRoom:edit")
@Log(title = "机房管理", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(AssetsMachineRoom assetsMachineRoom) {
return toAjax(assetsMachineRoomService.updateAssetsMachineRoom(assetsMachineRoom));
}
/**
* 删除机房
*/
@RequiresPermissions("assets:assetsMachineRoom:remove")
@Log(title = "机房管理", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids) {
return toAjax(assetsMachineRoomService.deleteAssetsMachineRoomByIds(ids));
}
}

View File

@ -0,0 +1,115 @@
package com.ruoyi.web.controller.network;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.network.domain.NetIpAddress;
import com.ruoyi.network.service.INetIpAddressService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 网络IP 信息操作处理
*
* @author TP
* @date 2019-06-15
*/
@Controller
@RequestMapping("/network/netIpAddress")
public class NetIpAddressController extends BaseController {
private String prefix = "network/netIpAddress";
@Autowired
private INetIpAddressService netIpAddressService;
@RequiresPermissions("network:netIpAddress:view")
@GetMapping()
public String netIpAddress() {
return prefix + "/netIpAddress";
}
/**
* 查询网络IP列表
*/
@RequiresPermissions("network:netIpAddress:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(NetIpAddress netIpAddress) {
startPage();
List<NetIpAddress> list = netIpAddressService.selectNetIpAddressList(netIpAddress);
return getDataTable(list);
}
/**
* 导出网络IP列表
*/
@RequiresPermissions("network:netIpAddress:export")
@PostMapping("/export")
@ResponseBody
public AjaxResult export(NetIpAddress netIpAddress) {
List<NetIpAddress> list = netIpAddressService.selectNetIpAddressList(netIpAddress);
ExcelUtil<NetIpAddress> util = new ExcelUtil<NetIpAddress>(NetIpAddress.class);
return util.exportExcel(list, "netIpAddress");
}
/**
* 新增网络IP
*/
@GetMapping("/add")
public String add() {
return prefix + "/add";
}
/**
* 新增保存网络IP
*/
@RequiresPermissions("network:netIpAddress:add")
@Log(title = "网络IP", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(NetIpAddress netIpAddress) {
return toAjax(netIpAddressService.insertNetIpAddress(netIpAddress));
}
/**
* 修改网络IP
*/
@GetMapping("/edit/{ipAddressId}")
public String edit(@PathVariable("ipAddressId") Integer ipAddressId, ModelMap mmap) {
NetIpAddress netIpAddress = netIpAddressService.selectNetIpAddressById(ipAddressId);
mmap.put("netIpAddress", netIpAddress);
return prefix + "/edit";
}
/**
* 修改保存网络IP
*/
@RequiresPermissions("network:netIpAddress:edit")
@Log(title = "网络IP", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(NetIpAddress netIpAddress) {
return toAjax(netIpAddressService.updateNetIpAddress(netIpAddress));
}
/**
* 删除网络IP
*/
@RequiresPermissions("network:netIpAddress:remove")
@Log(title = "网络IP", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids) {
return toAjax(netIpAddressService.deleteNetIpAddressByIds(ids));
}
}

View File

@ -1,6 +1,9 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import com.ruoyi.system.domain.SysNotice;
import com.ruoyi.system.service.ISysNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
@ -22,6 +25,9 @@ public class SysIndexController extends BaseController
{
@Autowired
private ISysMenuService menuService;
@Autowired
private ISysNoticeService noticeService;
// 系统首页
@GetMapping("/index")
@ -35,6 +41,7 @@ public class SysIndexController extends BaseController
mmap.put("user", user);
mmap.put("copyrightYear", Global.getCopyrightYear());
mmap.put("demoEnabled", Global.isDemoEnabled());
mmap.put("version", Global.getVersion());
return "index";
}
@ -43,6 +50,7 @@ public class SysIndexController extends BaseController
public String main(ModelMap mmap)
{
mmap.put("version", Global.getVersion());
mmap.put("notices",noticeService.selectNoticeList(new SysNotice()));
return "main";
}
}

View File

@ -0,0 +1,114 @@
package com.ruoyi.web.controller.template;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.template.domain.TmplServer;
import com.ruoyi.template.service.ITmplServerService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 服务器模板 信息操作处理
*
* @author TP
* @date 2019-06-12
*/
@Controller
@RequestMapping("/template/tmplServer")
public class TmplServerController extends BaseController {
private String prefix = "template/tmplServer";
@Autowired
private ITmplServerService tmplServerService;
@RequiresPermissions("template:tmplServer:view")
@GetMapping()
public String tmplServer() {
return prefix + "/tmplServer";
}
/**
* 查询服务器模板列表
*/
@RequiresPermissions("template:tmplServer:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(TmplServer tmplServer) {
startPage();
List<TmplServer> list = tmplServerService.selectTmplServerList(tmplServer);
return getDataTable(list);
}
/**
* 导出服务器模板列表
*/
@RequiresPermissions("template:tmplServer:export")
@PostMapping("/export")
@ResponseBody
public AjaxResult export(TmplServer tmplServer) {
List<TmplServer> list = tmplServerService.selectTmplServerList(tmplServer);
ExcelUtil<TmplServer> util = new ExcelUtil<TmplServer>(TmplServer.class);
return util.exportExcel(list, "tmplServer");
}
/**
* 新增服务器模板
*/
@GetMapping("/add")
public String add() {
return prefix + "/add";
}
/**
* 新增保存服务器模板
*/
@RequiresPermissions("template:tmplServer:add")
@Log(title = "服务器模板", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(TmplServer tmplServer) {
return toAjax(tmplServerService.insertTmplServer(tmplServer));
}
/**
* 修改服务器模板
*/
@GetMapping("/edit/{serverId}")
public String edit(@PathVariable("serverId") Integer serverId, ModelMap mmap) {
TmplServer tmplServer = tmplServerService.selectTmplServerById(serverId);
mmap.put("tmplServer", tmplServer);
return prefix + "/edit";
}
/**
* 修改保存服务器模板
*/
@RequiresPermissions("template:tmplServer:edit")
@Log(title = "服务器模板", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(TmplServer tmplServer) {
return toAjax(tmplServerService.updateTmplServer(tmplServer));
}
/**
* 删除服务器模板
*/
@RequiresPermissions("template:tmplServer:remove")
@Log(title = "服务器模板", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids) {
return toAjax(tmplServerService.deleteTmplServerByIds(ids));
}
}

View File

@ -0,0 +1,115 @@
package com.ruoyi.web.controller.template;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.template.domain.TmplSwitch;
import com.ruoyi.template.service.ITmplSwitchService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 交换机模板 信息操作处理
*
* @author TP
* @date 2019-06-12
*/
@Controller
@RequestMapping("/template/tmplSwitch")
public class TmplSwitchController extends BaseController {
private String prefix = "template/tmplSwitch";
@Autowired
private ITmplSwitchService tmplSwitchService;
@RequiresPermissions("template:tmplSwitch:view")
@GetMapping()
public String tmplSwitch() {
return prefix + "/tmplSwitch";
}
/**
* 查询交换机模板列表
*/
@RequiresPermissions("template:tmplSwitch:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(TmplSwitch tmplSwitch) {
startPage();
List<TmplSwitch> list = tmplSwitchService.selectTmplSwitchList(tmplSwitch);
return getDataTable(list);
}
/**
* 导出交换机模板列表
*/
@RequiresPermissions("template:tmplSwitch:export")
@PostMapping("/export")
@ResponseBody
public AjaxResult export(TmplSwitch tmplSwitch) {
List<TmplSwitch> list = tmplSwitchService.selectTmplSwitchList(tmplSwitch);
ExcelUtil<TmplSwitch> util = new ExcelUtil<TmplSwitch>(TmplSwitch.class);
return util.exportExcel(list, "tmplSwitch");
}
/**
* 新增交换机模板
*/
@GetMapping("/add")
public String add() {
return prefix + "/add";
}
/**
* 新增保存交换机模板
*/
@RequiresPermissions("template:tmplSwitch:add")
@Log(title = "交换机模板", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(TmplSwitch tmplSwitch) {
return toAjax(tmplSwitchService.insertTmplSwitch(tmplSwitch));
}
/**
* 修改交换机模板
*/
@GetMapping("/edit/{switchId}")
public String edit(@PathVariable("switchId") Integer switchId, ModelMap mmap) {
TmplSwitch tmplSwitch = tmplSwitchService.selectTmplSwitchById(switchId);
mmap.put("tmplSwitch", tmplSwitch);
return prefix + "/edit";
}
/**
* 修改保存交换机模板
*/
@RequiresPermissions("template:tmplSwitch:edit")
@Log(title = "交换机模板", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(TmplSwitch tmplSwitch) {
return toAjax(tmplSwitchService.updateTmplSwitch(tmplSwitch));
}
/**
* 删除交换机模板
*/
@RequiresPermissions("template:tmplSwitch:remove")
@Log(title = "交换机模板", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids) {
return toAjax(tmplSwitchService.deleteTmplSwitchByIds(ids));
}
}

View File

@ -6,9 +6,9 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://localhost:3306/rms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: password
password: 123456
# 从库数据源
slave:
# 从数据源开关/默认关闭

View File

@ -1,9 +1,9 @@
# 项目相关配置
ruoyi:
# 名称
name: RuoYi
# 版本
version: 3.4.0
name: RMS
# RMS版本(对应ruoyi版本:3.4.0)
version: 1.0.0
# 版权年份
copyrightYear: 2019
# 实例演示开关

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 日志存放路径 -->
<property name="log.path" value="/home/ruoyi/logs" />
<property name="log.path" value="./logs" />
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{100} - [%method,%line] - %msg%n" />
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">

View File

@ -2495,7 +2495,7 @@
// Trigger select 'change'
if (triggerChange) {
if (that.multiple || prevIndex !== element.selectedIndex) {
// $option.prop('selected') is current option state (selected/unselected). prevValue is the value of the select prior to being changed.
// $option.assets('selected') is current option state (selected/unselected). prevValue is the value of the select prior to being changed.
changedArguments = [option.index, $option.prop('selected'), prevValue];
that.$element
.triggerNative('change');

View File

@ -2019,7 +2019,7 @@
return result;
}
// get computed style property
// get computed style assets
function getStyle (target, prop) {
try {
if ( window.getComputedStyle ) { // gecko and webkit

View File

@ -232,7 +232,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
if (elements.index(this.$element) !== -1) {
$(this.$element).data('offcanvas-style', $(this.$element).attr('style') || '')
this.$element.css(placement, -1 * offset)
this.$element.css(placement); // Workaround: Need to get the CSS property for it to be applied before the next line of code
this.$element.css(placement); // Workaround: Need to get the CSS assets for it to be applied before the next line of code
}
elements.addClass('canvas-sliding').each(function() {

View File

@ -104,7 +104,7 @@
for (prop in object) {
value = object[prop];
hasContents = true;
output += "<li><span class=\"prop\"><span class=\"q\">\"</span>" + (this.jsString(prop)) + "<span class=\"q\">\"</span></span>: " + (this.valueToHTML(value, level + 1));
output += "<li><span class=\"assets\"><span class=\"q\">\"</span>" + (this.jsString(prop)) + "<span class=\"q\">\"</span></span>: " + (this.valueToHTML(value, level + 1));
if (numProps > 1) {
output += ',';
}

View File

@ -281,7 +281,7 @@ var requirejs, require, define;
}
}
//Using ridiculous property names for space reasons
//Using ridiculous assets names for space reasons
return {
f: prefix ? prefix + '!' + name : name, //fullName
n: name,
@ -2024,10 +2024,10 @@ S2.define('select2/selection/search',[
}
});
// Try to detect the IE version should the `documentMode` property that
// Try to detect the IE version should the `documentMode` assets that
// is stored on the document. This is only implemented in IE and is
// slightly cleaner than doing a user agent check.
// This property is not available in Edge, but Edge also doesn't have
// This assets is not available in Edge, but Edge also doesn't have
// this bug.
var msie = document.documentMode;
var disableInputEvents = msie && msie <= 11;
@ -3588,7 +3588,7 @@ S2.define('select2/data/ajax',[
callback(results);
}, function () {
// Attempt to detect if a request was aborted
// Only works if the transport exposes a status property
// Only works if the transport exposes a status assets
if ('status' in $request &&
($request.status === 0 || $request.status === '0')) {
return;
@ -5679,7 +5679,7 @@ S2.define('select2/core',[
if (this.options.get('debug') && window.console && console.warn) {
console.warn(
'Select2: The `select2("enable")` method has been deprecated and will' +
' be removed in later Select2 versions. Use $element.prop("disabled")' +
' be removed in later Select2 versions. Use $element.assets("disabled")' +
' instead.'
);
}

File diff suppressed because one or more lines are too long

View File

@ -63,7 +63,7 @@ if (!String.prototype.format)
*
* @static
* @private
* @property _uniqueId
* @assets _uniqueId
* @type Integer
**/
var _uniqueId = 0;
@ -73,7 +73,7 @@ var _uniqueId = 0;
*
* @final
* @private
* @property _cookiePrefix
* @assets _cookiePrefix
* @type String
**/
var _cookiePrefix = "jQu3ry_5teps_St@te_";
@ -83,7 +83,7 @@ var _cookiePrefix = "jQu3ry_5teps_St@te_";
*
* @final
* @private
* @property _tabSuffix
* @assets _tabSuffix
* @type String
* @since 0.9.7
**/
@ -94,7 +94,7 @@ var _tabSuffix = "-t-";
*
* @final
* @private
* @property _tabpanelSuffix
* @assets _tabpanelSuffix
* @type String
* @since 0.9.7
**/
@ -105,7 +105,7 @@ var _tabpanelSuffix = "-p-";
*
* @final
* @private
* @property _titleSuffix
* @assets _titleSuffix
* @type String
* @since 0.9.7
**/
@ -116,7 +116,7 @@ var _titleSuffix = "-h-";
*
* @final
* @private
* @property _indexOutOfRangeErrorMessage
* @assets _indexOutOfRangeErrorMessage
* @type String
**/
var _indexOutOfRangeErrorMessage = "Index out of range.";
@ -126,7 +126,7 @@ var _indexOutOfRangeErrorMessage = "Index out of range.";
*
* @final
* @private
* @property _missingCorrespondingElementErrorMessage
* @assets _missingCorrespondingElementErrorMessage
* @type String
**/
var _missingCorrespondingElementErrorMessage = "One or more corresponding step {0} are missing.";
@ -1485,7 +1485,7 @@ var contentMode = $.fn.steps.contentMode = {
* HTML embedded content
*
* @readOnly
* @property html
* @assets html
* @type Integer
* @for contentMode
**/
@ -1495,7 +1495,7 @@ var contentMode = $.fn.steps.contentMode = {
* IFrame embedded content
*
* @readOnly
* @property iframe
* @assets iframe
* @type Integer
* @for contentMode
**/
@ -1505,7 +1505,7 @@ var contentMode = $.fn.steps.contentMode = {
* Async embedded content
*
* @readOnly
* @property async
* @assets async
* @type Integer
* @for contentMode
**/
@ -1523,7 +1523,7 @@ var stepsOrientation = $.fn.steps.stepsOrientation = {
* Horizontal orientation
*
* @readOnly
* @property horizontal
* @assets horizontal
* @type Integer
* @for stepsOrientation
**/
@ -1533,7 +1533,7 @@ var stepsOrientation = $.fn.steps.stepsOrientation = {
* Vertical orientation
*
* @readOnly
* @property vertical
* @assets vertical
* @type Integer
* @for stepsOrientation
**/
@ -1551,7 +1551,7 @@ var transitionEffect = $.fn.steps.transitionEffect = {
* No transition animation
*
* @readOnly
* @property none
* @assets none
* @type Integer
* @for transitionEffect
**/
@ -1561,7 +1561,7 @@ var transitionEffect = $.fn.steps.transitionEffect = {
* Fade in transition
*
* @readOnly
* @property fade
* @assets fade
* @type Integer
* @for transitionEffect
**/
@ -1571,7 +1571,7 @@ var transitionEffect = $.fn.steps.transitionEffect = {
* Slide up transition
*
* @readOnly
* @property slide
* @assets slide
* @type Integer
* @for transitionEffect
**/
@ -1581,7 +1581,7 @@ var transitionEffect = $.fn.steps.transitionEffect = {
* Slide left transition
*
* @readOnly
* @property slideLeft
* @assets slideLeft
* @type Integer
* @for transitionEffect
**/
@ -1615,7 +1615,7 @@ var defaults = $.fn.steps.defaults = {
/**
* The header tag is used to find the step button text within the declared wizard area.
*
* @property headerTag
* @assets headerTag
* @type String
* @default "h1"
* @for defaults
@ -1625,7 +1625,7 @@ var defaults = $.fn.steps.defaults = {
/**
* The body tag is used to find the step content within the declared wizard area.
*
* @property bodyTag
* @assets bodyTag
* @type String
* @default "div"
* @for defaults
@ -1635,7 +1635,7 @@ var defaults = $.fn.steps.defaults = {
/**
* The content container tag which will be used to wrap all step contents.
*
* @property contentContainerTag
* @assets contentContainerTag
* @type String
* @default "div"
* @for defaults
@ -1645,7 +1645,7 @@ var defaults = $.fn.steps.defaults = {
/**
* The action container tag which will be used to wrap the pagination navigation.
*
* @property actionContainerTag
* @assets actionContainerTag
* @type String
* @default "div"
* @for defaults
@ -1655,7 +1655,7 @@ var defaults = $.fn.steps.defaults = {
/**
* The steps container tag which will be used to wrap the steps navigation.
*
* @property stepsContainerTag
* @assets stepsContainerTag
* @type String
* @default "div"
* @for defaults
@ -1665,7 +1665,7 @@ var defaults = $.fn.steps.defaults = {
/**
* The css class which will be added to the outer component wrapper.
*
* @property cssClass
* @assets cssClass
* @type String
* @default "wizard"
* @for defaults
@ -1679,7 +1679,7 @@ var defaults = $.fn.steps.defaults = {
/**
* The css class which will be used for floating scenarios.
*
* @property clearFixCssClass
* @assets clearFixCssClass
* @type String
* @default "clearfix"
* @for defaults
@ -1689,7 +1689,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Determines whether the steps are vertically or horizontally oriented.
*
* @property stepsOrientation
* @assets stepsOrientation
* @type stepsOrientation
* @default horizontal
* @for defaults
@ -1704,7 +1704,7 @@ var defaults = $.fn.steps.defaults = {
/**
* The title template which will be used to create a step button.
*
* @property titleTemplate
* @assets titleTemplate
* @type String
* @default "<span class=\"number\">#index#.</span> #title#"
* @for defaults
@ -1714,7 +1714,7 @@ var defaults = $.fn.steps.defaults = {
/**
* The loading template which will be used to create the loading animation.
*
* @property loadingTemplate
* @assets loadingTemplate
* @type String
* @default "<span class=\"spinner\"></span> #text#"
* @for defaults
@ -1728,7 +1728,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Sets the focus to the first wizard instance in order to enable the key navigation from the begining if `true`.
*
* @property autoFocus
* @assets autoFocus
* @type Boolean
* @default false
* @for defaults
@ -1739,7 +1739,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Enables all steps from the begining if `true` (all steps are clickable).
*
* @property enableAllSteps
* @assets enableAllSteps
* @type Boolean
* @default false
* @for defaults
@ -1749,7 +1749,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Enables keyboard navigation if `true` (arrow left and arrow right).
*
* @property enableKeyNavigation
* @assets enableKeyNavigation
* @type Boolean
* @default true
* @for defaults
@ -1759,7 +1759,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Enables pagination if `true`.
*
* @property enablePagination
* @assets enablePagination
* @type Boolean
* @default true
* @for defaults
@ -1769,7 +1769,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Suppresses pagination if a form field is focused.
*
* @property suppressPaginationOnFocus
* @assets suppressPaginationOnFocus
* @type Boolean
* @default true
* @for defaults
@ -1779,7 +1779,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Enables cache for async loaded or iframe embedded content.
*
* @property enableContentCache
* @assets enableContentCache
* @type Boolean
* @default true
* @for defaults
@ -1789,7 +1789,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Shows the cancel button if enabled.
*
* @property enableCancelButton
* @assets enableCancelButton
* @type Boolean
* @default false
* @for defaults
@ -1799,7 +1799,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Shows the finish button if enabled.
*
* @property enableFinishButton
* @assets enableFinishButton
* @type Boolean
* @default true
* @for defaults
@ -1809,7 +1809,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Not yet implemented.
*
* @property preloadContent
* @assets preloadContent
* @type Boolean
* @default false
* @for defaults
@ -1820,7 +1820,7 @@ var defaults = $.fn.steps.defaults = {
* Shows the finish button always (on each step; right beside the next button) if `true`.
* Otherwise the next button will be replaced by the finish button if the last step becomes active.
*
* @property showFinishButtonAlways
* @assets showFinishButtonAlways
* @type Boolean
* @default false
* @for defaults
@ -1830,7 +1830,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Prevents jumping to a previous step.
*
* @property forceMoveForward
* @assets forceMoveForward
* @type Boolean
* @default false
* @for defaults
@ -1841,7 +1841,7 @@ var defaults = $.fn.steps.defaults = {
* Saves the current state (step position) to a cookie.
* By coming next time the last active step becomes activated.
*
* @property saveState
* @assets saveState
* @type Boolean
* @default false
* @for defaults
@ -1851,7 +1851,7 @@ var defaults = $.fn.steps.defaults = {
/**
* The position to start on (zero-based).
*
* @property startIndex
* @assets startIndex
* @type Integer
* @default 0
* @for defaults
@ -1865,7 +1865,7 @@ var defaults = $.fn.steps.defaults = {
/**
* The animation effect which will be used for step transitions.
*
* @property transitionEffect
* @assets transitionEffect
* @type transitionEffect
* @default none
* @for defaults
@ -1875,7 +1875,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Animation speed for step transitions (in milliseconds).
*
* @property transitionEffectSpeed
* @assets transitionEffectSpeed
* @type Integer
* @default 200
* @for defaults
@ -1890,7 +1890,7 @@ var defaults = $.fn.steps.defaults = {
* Fires before the step changes and can be used to prevent step changing by returning `false`.
* Very useful for form validation.
*
* @property onStepChanging
* @assets onStepChanging
* @type Event
* @default function (event, currentIndex, newIndex) { return true; }
* @for defaults
@ -1900,7 +1900,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Fires after the step has change.
*
* @property onStepChanged
* @assets onStepChanged
* @type Event
* @default function (event, currentIndex, priorIndex) { }
* @for defaults
@ -1910,7 +1910,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Fires after cancelation.
*
* @property onCanceled
* @assets onCanceled
* @type Event
* @default function (event) { }
* @for defaults
@ -1921,7 +1921,7 @@ var defaults = $.fn.steps.defaults = {
* Fires before finishing and can be used to prevent completion by returning `false`.
* Very useful for form validation.
*
* @property onFinishing
* @assets onFinishing
* @type Event
* @default function (event, currentIndex) { return true; }
* @for defaults
@ -1931,7 +1931,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Fires after completion.
*
* @property onFinished
* @assets onFinished
* @type Event
* @default function (event, currentIndex) { }
* @for defaults
@ -1941,7 +1941,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Fires after async content is loaded.
*
* @property onContentLoaded
* @assets onContentLoaded
* @type Event
* @default function (event, index) { }
* @for defaults
@ -1951,7 +1951,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Fires when the wizard is initialized.
*
* @property onInit
* @assets onInit
* @type Event
* @default function (event) { }
* @for defaults
@ -1961,7 +1961,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Contains all labels.
*
* @property labels
* @assets labels
* @type Object
* @for defaults
**/
@ -1969,7 +1969,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Label for the cancel button.
*
* @property cancel
* @assets cancel
* @type String
* @default "Cancel"
* @for defaults
@ -1980,7 +1980,7 @@ var defaults = $.fn.steps.defaults = {
* This label is important for accessability reasons.
* Indicates which step is activated.
*
* @property current
* @assets current
* @type String
* @default "current step:"
* @for defaults
@ -1990,7 +1990,7 @@ var defaults = $.fn.steps.defaults = {
/**
* This label is important for accessability reasons and describes the kind of navigation.
*
* @property pagination
* @assets pagination
* @type String
* @default "Pagination"
* @for defaults
@ -2001,7 +2001,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Label for the finish button.
*
* @property finish
* @assets finish
* @type String
* @default "Finish"
* @for defaults
@ -2011,7 +2011,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Label for the next button.
*
* @property next
* @assets next
* @type String
* @default "Next"
* @for defaults
@ -2021,7 +2021,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Label for the previous button.
*
* @property previous
* @assets previous
* @type String
* @default "Previous"
* @for defaults
@ -2031,7 +2031,7 @@ var defaults = $.fn.steps.defaults = {
/**
* Label for the loading animation.
*
* @property loading
* @assets loading
* @type String
* @default "Loading ..."
* @for defaults

View File

@ -1797,13 +1797,13 @@
return node && !isText(node) && lists.contains(node.classList, 'note-styletag');
}
var dom = {
/** @property {String} NBSP_CHAR */
/** @assets {String} NBSP_CHAR */
NBSP_CHAR: NBSP_CHAR,
/** @property {String} ZERO_WIDTH_NBSP_CHAR */
/** @assets {String} ZERO_WIDTH_NBSP_CHAR */
ZERO_WIDTH_NBSP_CHAR: ZERO_WIDTH_NBSP_CHAR,
/** @property {String} blank */
/** @assets {String} blank */
blank: blankHTML,
/** @property {String} emptyPara */
/** @assets {String} emptyPara */
emptyPara: "<p>" + blankHTML + "</p>",
makePredByNodeName: makePredByNodeName,
isEditable: isEditable,
@ -2885,8 +2885,8 @@
], keyCode);
},
/**
* @property {Object} nameFromCode
* @property {String} nameFromCode.8 "BACKSPACE"
* @assets {Object} nameFromCode
* @assets {String} nameFromCode.8 "BACKSPACE"
*/
nameFromCode: func.invertObject(KEY_MAP),
code: KEY_MAP
@ -3045,7 +3045,7 @@
*
* [workaround] for old jQuery
* passing an array of style properties to .css()
* will result in an object of property-value pairs.
* will result in an object of assets-value pairs.
* (compability with version < 1.9)
*
* @private

View File

@ -11,7 +11,7 @@ body.signin {
color:rgba(255,255,255,.95)
}
.signinpanel {
width:750px;
width:350px;
margin:10% auto 0
}
.signinpanel .logopanel {

View File

@ -1 +1 @@
html{height:100%}body.signin{height:auto;background:url(../img/login-background.jpg) no-repeat center fixed;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;color:rgba(255,255,255,.95)}.signinpanel{width:750px;margin:10% auto 0}.signinpanel .logopanel{float:none;width:auto;padding:0;background:0}.signinpanel .signin-info ul{list-style:none;padding:0;margin:20px 0}.signinpanel .form-control{display:block;margin-top:15px}.signinpanel .uname{background:#fff url(../img/user.png) no-repeat 95% center;color:#333}.signinpanel .pword{background:#fff url(../img/locked.png) no-repeat 95% center;color:#333}.signinpanel .code{background:#fff no-repeat 95% center;color:#333;margin:0 0 15px 0}.signinpanel .btn{margin-top:15px}.signinpanel form{background:rgba(255,255,255,.2);border:1px solid rgba(255,255,255,.3);-moz-box-shadow:0 3px 0 rgba(12,12,12,.03);-webkit-box-shadow:0 3px 0 rgba(12,12,12,.03);box-shadow:0 3px 0 rgba(12,12,12,.03);-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;padding:30px}.signup-footer{border-top:solid 1px rgba(255,255,255,.3);margin:20px 0;padding-top:15px}@media screen and (max-width:768px){.signinpanel,.signuppanel{margin:0 auto;width:420px!important;padding:20px}.signinpanel form{margin-top:20px}.signup-footer,.signuppanel .form-control{margin-bottom:10px}.signup-footer .pull-left,.signup-footer .pull-right{float:none!important;text-align:center}.signinpanel .signin-info ul{display:none}}@media screen and (max-width:320px){.signinpanel,.signuppanel{margin:0 20px;width:auto}}.checkbox-custom{position:relative;padding:0 15px 0 25px;margin-bottom:7px;display:inline-block}.checkbox-custom input[type="checkbox"]{opacity:0;position:absolute;cursor:pointer;z-index:2;margin:-6px 0 0 0;top:50%;left:3px}.checkbox-custom label:before{content:'';position:absolute;top:50%;left:0;margin-top:-9px;width:18px;height:17px;display:inline-block;border-radius:2px;border:1px solid #bbb;background:#fff}.checkbox-custom input[type="checkbox"]:checked+label:after{position:absolute;display:inline-block;font-family:'Glyphicons Halflings';content:"\e013";top:42%;left:3px;margin-top:-5px;font-size:11px;line-height:1;width:16px;height:16px;color:#333}.checkbox-custom label{cursor:pointer;line-height:1.2;font-weight:normal;margin-bottom:0;text-align:left}
html{height:100%}body.signin{height:auto;background:url(../img/login-background.jpg) no-repeat center fixed;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;color:rgba(255,255,255,.95)}.signinpanel{width:350px;margin:10% auto 0}.signinpanel .logopanel{float:none;width:auto;padding:0;background:0}.signinpanel .signin-info ul{list-style:none;padding:0;margin:20px 0}.signinpanel .form-control{display:block;margin-top:15px}.signinpanel .uname{background:#fff url(../img/user.png) no-repeat 95% center;color:#333}.signinpanel .pword{background:#fff url(../img/locked.png) no-repeat 95% center;color:#333}.signinpanel .code{background:#fff no-repeat 95% center;color:#333;margin:0 0 15px 0}.signinpanel .btn{margin-top:15px}.signinpanel form{background:rgba(255,255,255,.2);border:1px solid rgba(255,255,255,.3);-moz-box-shadow:0 3px 0 rgba(12,12,12,.03);-webkit-box-shadow:0 3px 0 rgba(12,12,12,.03);box-shadow:0 3px 0 rgba(12,12,12,.03);-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;padding:30px}.signup-footer{border-top:solid 1px rgba(255,255,255,.3);margin:20px 0;padding-top:15px}@media screen and (max-width:768px){.signinpanel,.signuppanel{margin:0 auto;width:420px!important;padding:20px}.signinpanel form{margin-top:20px}.signup-footer,.signuppanel .form-control{margin-bottom:10px}.signup-footer .pull-left,.signup-footer .pull-right{float:none!important;text-align:center}.signinpanel .signin-info ul{display:none}}@media screen and (max-width:320px){.signinpanel,.signuppanel{margin:0 20px;width:auto}}.checkbox-custom{position:relative;padding:0 15px 0 25px;margin-bottom:7px;display:inline-block}.checkbox-custom input[type="checkbox"]{opacity:0;position:absolute;cursor:pointer;z-index:2;margin:-6px 0 0 0;top:50%;left:3px}.checkbox-custom label:before{content:'';position:absolute;top:50%;left:0;margin-top:-9px;width:18px;height:17px;display:inline-block;border-radius:2px;border:1px solid #bbb;background:#fff}.checkbox-custom input[type="checkbox"]:checked+label:after{position:absolute;display:inline-block;font-family:'Glyphicons Halflings';content:"\e013";top:42%;left:3px;margin-top:-5px;font-size:11px;line-height:1;width:16px;height:16px;color:#333}.checkbox-custom label{cursor:pointer;line-height:1.2;font-weight:normal;margin-bottom:0;text-align:left}

View File

@ -0,0 +1,101 @@
# Changelog
## 2.0.5 (Dec 1, 2018)
- Fixed the issue of trigger change event twice (#68).
## 2.0.4 (Jun 1, 2018)
- Update districts.
## 2.0.3 (Mar 1, 2018)
- Update districts.
## 2.0.2 (Dec 1, 2017)
- Trigger change event once district changed.
- Support to load in node environment.
- Update districts.
## 2.0.1 (Sep 1, 2017)
- Update districts.
## 2.0.0 (Jun 1, 2017)
- Update districts.
- Use `window.jQuery` instead of `window.$` for browser side usage.
- Change the `main` field value from `dist/distpicker.js` (UMD) to `dist/distpicker.common.js` (CommonJS).
- Added `module` and `browser` fields to `package.json`.
## 2.0.0-rc (Mar 4, 2017)
- Update districts.
## 2.0.0-beta.2 (Dec 8, 2016)
- Build the source code with [Rollup](https://github.com/rollup/rollup).
## 2.0.0-beta.1 (Oct 15, 2016)
- Fixed the issue of restoring saved districts by code (#19).
## 2.0.0-alpha.2 (Sep 6, 2016)
- Rename `autoSelect` option to `autoselect`.
- Subdivide optional values for `autoselect` option (#13).
- Fixed the wrong value of the `<select>` elements (#18).
## 2.0.0-alpha.1 (Aug 11, 2016)
- Merge the `distpicker.data.js` file to the `distpicker.js` file.
- Added a new option: `valueType`.
- Added a new method: `getDistricts`.
## 1.0.4 (Jun 1, 2016)
- Update districts data.
## 1.0.3 (Mar 3, 2016)
- Update districts data.
## 1.0.2 (Dec 26, 2015)
- Update lots of districts.
## 1.0.1 (Sep 6, 2015)
- Added new cities of Xizang (Tibet).
## 1.0.0 (Aug 27, 2015)
- Added new districts of Sanya city.
- Optimized code style.
## 0.2.1 (Dec 26, 2014)
- Enable to change the global default options.
- Fix placeholder bug.
- Improve code.
## 0.2.0 (Dec 20, 2014)
- Add new options: "autoSelect", "placeholder".
- Add new methods: "reset", "destroy".
- Use "data-distpicker" attribute for initializing automatically instead of "distpicker" attribute.
## 0.1.3 (Aug 9, 2014)
- Improve
## 0.1.2 (Apr 8, 2014)
- Fix a type error bug when initialize a city without districts.
## 0.1.1 (Feb 21, 2014)
- Fix bug: The default options will be changed when use multiple times in one page.
## 0.1.0 (Jan 25, 2014)

View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright 2014-present Chen Fengyuan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -0,0 +1,259 @@
# Distpicker
[![Downloads](https://img.shields.io/npm/dm/distpicker.svg)](https://www.npmjs.com/package/distpicker) [![Version](https://img.shields.io/npm/v/distpicker.svg)](https://www.npmjs.com/package/distpicker)
> A simple jQuery plugin for picking provinces, cities and districts of China.
- [Website](https://fengyuanchen.github.io/distpicker)
> 请注意以下市/县并未设置下一级的区/乡/镇:济源市、潜江市、神农架林区、天门市、仙桃市、东莞市、中山市、东沙群岛、白沙黎族自治县、保亭黎族苗族自治县、昌江黎族自治县、澄迈县、儋州市、定安县、东方市、乐东黎族自治县、临高县、陵水黎族自治县、琼海市、琼中黎族苗族自治县、屯昌县、万宁市、文昌市、五指山市、嘉峪关市、阿拉尔市、北屯市、可克达拉市、昆玉市、石河子市、双河市、铁门关市、图木舒克市、五家渠市。
## Table of contents
- [Main](#main)
- [Getting started](#getting-started)
- [Options](#options)
- [Methods](#methods)
- [No conflict](#no-conflict)
- [Browser support](#browser-support)
- [License](#license)
## Main
```text
dist/
├── distpicker.js (UMD)
├── distpicker.min.js (UMD, compressed)
├── distpicker.common.js (CommonJS, default)
└── distpicker.esm.js (ES Module)
```
## Getting started
### Install
```shell
npm install distpicker
```
Include files:
```html
<script src="/path/to/jquery.js"></script><!-- jQuery is required -->
<script src="/path/to/distpicker.js"></script>
```
Create HTML elements:
```html
<div><!-- container -->
<select></select><!-- province -->
<select></select><!-- city -->
<select></select><!-- district -->
</div>
```
### Usage
#### Initialize with `data-toggle="distpicker"` attribute
Basic
```html
<div data-toggle="distpicker">
<select></select>
<select></select>
<select></select>
</div>
```
Custom placeholders
```html
<div data-toggle="distpicker">
<select data-province="---- 选择省 ----"></select>
<select data-city="---- 选择市 ----"></select>
<select data-district="---- 选择区 ----"></select>
</div>
```
Custom districts
```html
<div data-toggle="distpicker">
<select data-province="浙江省"></select>
<select data-city="杭州市"></select>
<select data-district="西湖区"></select>
</div>
```
#### Initialize with `$.fn.distpicker` method
Basic
```js
$('#target').distpicker();
```
Custom placeholders
```js
$('#target').distpicker({
province: '---- 所在省 ----',
city: '---- 所在市 ----',
district: '---- 所在区 ----'
});
```
Custom districts
```js
$('#target').distpicker({
province: '浙江省',
city: '杭州市',
district: '西湖区'
});
```
[⬆ back to top](#table-of-contents)
## Options
- Change the default options with `$().distpicker(options)`.
- Change the global default options with `$.fn.distpicker.setDefaults(options)`.
Also supports to set the options by `data-*` attributes:
```html
<div data-toggle="distpicker" data-autoselect="3" data-province="浙江省">...</div>
```
### autoselect
- Type: `Number`
- Options:
- `0`: Disable autoselect.
- `1`: Autoselect province only.
- `2`: Autoselect province and city only.
- `3`: Autoselect all (province, city and district).
- Default: `0`
Selects the districts automatically.
### placeholder
- Type: `Boolean`
- Default: `true`
Show placeholder (with an `<option>` element).
### valueType
- Type: `String`
- Options:
- `'name'`: administrative division name.
- `'code'`: administrative division code.
- Default: `'name'`
Defines the value type of the `<select>` element.
Note that this option in `data-*` attribute should be `data-value-type`:
```html
<div data-toggle="distpicker" data-value-type="code">...</div>
```
### province
- Type: `String`
- Default: `—— 省 ——`
Defines the initial value of province `<select>`. If it is a valid province, it will be selected. If not, it will be used as a placeholder.
### city
- Type: `String`
- Default: `—— 市 ——`
Defines the initial value of city `<select>`. If it is a valid city under the selected province, it will be selected. If not, it will be used as a placeholder.
### district
- Type: `String`
- Default: `—— 区 ——`
Defines the initial value of district `<select>`. If it is a valid district under the selected city, it will be selected. If not, it will be used as a placeholder.
[⬆ back to top](#table-of-contents)
## Methods
### getDistricts([districtCode])
- **districtCode** (optional):
- Type: `Number`
- The district code of target country, province or city.
- If not present, will return all the districts.
- (return value):
- Type: `Object`
Get districts data.
```js
$().distpicker('getDistricts'); // 中国
$().distpicker('getDistricts', 330000); // 浙江省
$().distpicker('getDistricts', 330100); // 杭州市
```
### reset([deep])
- **deep** (optional):
- Type: `Boolean`
- Default: `false`
- Reset the selects to default states (Undo selected).
Reset the selects to the initial states (Undo changed).
```js
$().distpicker('reset');
$().distpicker('reset', true);
```
### destroy()
Destroy the distpicker instance, but keep the selected districts.
If you want to remove the selected districts, you can call `reset` method first and then call this method.
[⬆ back to top](#table-of-contents)
## No conflict
If you have to use other plugin with the same namespace, just call the `$.fn.distpicker.noConflict` method to revert to it.
```html
<script src="other-plugin.js"></script>
<script src="distpicker.js"></script>
<script>
$.fn.distpicker.noConflict();
// Code that uses other plugin's "$().distpicker" can follow here.
</script>
```
## Browser support
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Opera (latest)
- Edge (latest)
- Internet Explorer 9+
As a jQuery plugin, you also need to see the [jQuery Browser Support](http://jquery.com/browser-support/).
## License
[MIT](https://opensource.org/licenses/MIT) © [Chen Fengyuan](https://chenfengyuan.com)
[⬆ back to top](#table-of-contents)

View File

@ -0,0 +1,112 @@
{
"_from": "distpicker",
"_id": "distpicker@2.0.5",
"_inBundle": false,
"_integrity": "sha1-hMJXkksIm5EpvflpHUb6FHEJEcU=",
"_location": "/distpicker",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"registry": true,
"raw": "distpicker",
"name": "distpicker",
"escapedName": "distpicker",
"rawSpec": "",
"saveSpec": null,
"fetchSpec": "latest"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npm.taobao.org/distpicker/download/distpicker-2.0.5.tgz",
"_shasum": "84c257924b089b9129bdf9691d46fa14710911c5",
"_spec": "distpicker",
"_where": "/Users/tangpeng/git/RMS/ruoyi-admin/src/main/resources/static",
"author": {
"name": "Chen Fengyuan",
"url": "https://chenfengyuan.com"
},
"bugs": {
"url": "https://github.com/fengyuanchen/distpicker/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "A simple jQuery plugin for picking provinces, cities and districts of China.",
"devDependencies": {
"@babel/core": "^7.1.6",
"@babel/preset-env": "^7.1.6",
"@commitlint/cli": "^7.2.1",
"@commitlint/config-conventional": "^7.1.2",
"change-case": "^3.0.2",
"create-banner": "^1.0.0",
"del-cli": "^1.1.0",
"eslint": "^5.9.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.14.0",
"husky": "^1.2.0",
"jquery": "^3.3.1",
"lint-staged": "^8.1.0",
"rollup": "^0.67.3",
"rollup-plugin-babel": "^4.0.3",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-node-resolve": "^3.4.0",
"rollup-watch": "^4.3.1",
"uglify-js": "^3.4.9"
},
"files": [
"src",
"dist"
],
"homepage": "https://fengyuanchen.github.io/distpicker",
"keywords": [
"中国",
"省份",
"城市",
"行政区",
"省市区",
"三级联动",
"地址选择器",
"China",
"Chinese",
"province",
"provinces",
"city",
"cities",
"district",
"districts",
"pick",
"picker",
"picking",
"jquery",
"plugin",
"jquery-plugin",
"html",
"css",
"javascript",
"front-end",
"web",
"development"
],
"license": "MIT",
"main": "dist/distpicker.common.js",
"module": "dist/distpicker.esm.js",
"name": "distpicker",
"peerDependencies": {
"jquery": ">= 1.9.1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/fengyuanchen/distpicker.git"
},
"scripts": {
"build": "rollup -c",
"clear": "del-cli dist",
"compress": "uglifyjs dist/distpicker.js -o dist/distpicker.min.js -c -m --comments /^!/",
"lint": "eslint src *.js --fix",
"release": "npm run clear && npm run lint && npm run build && npm run compress",
"start": "rollup -c -m -w"
},
"unpkg": "dist/distpicker.js",
"version": "2.0.5"
}

View File

@ -0,0 +1,3 @@
export const WINDOW = typeof window !== 'undefined' ? window : {};
export const NAMESPACE = 'distpicker';
export const EVENT_CHANGE = 'change';

View File

@ -0,0 +1,23 @@
export default {
// Selects the districts automatically.
// 0 -> Disable autoselect
// 1 -> Autoselect province only
// 2 -> Autoselect province and city only
// 3 -> Autoselect all (province, city and district)
autoselect: 0,
// Show placeholder.
placeholder: true,
// Select value. Options: 'name' and 'code'
valueType: 'name',
// Defines the initial value of province.
province: '—— 省 ——',
// Defines the initial value of city.
city: '—— 市 ——',
// Defines the initial value of district.
district: '—— 区 ——',
};

View File

@ -0,0 +1,195 @@
import $ from 'jquery';
import DEFAULTS from './defaults';
import DISTRICTS from './districts';
import { EVENT_CHANGE } from './constants';
const DEFAULT_CODE = 100000;
const PROVINCE = 'province';
const CITY = 'city';
const DISTRICT = 'district';
export default class Distpicker {
constructor(element, options) {
this.$element = $(element);
this.options = $.extend({}, DEFAULTS, $.isPlainObject(options) && options);
this.placeholders = $.extend({}, DEFAULTS);
this.ready = false;
this.init();
}
init() {
const { options } = this;
const $selects = this.$element.find('select');
const { length } = $selects;
const data = {};
$selects.each((i, select) => $.extend(data, $(select).data()));
$.each([PROVINCE, CITY, DISTRICT], (i, type) => {
if (data[type]) {
options[type] = data[type];
this[`$${type}`] = $selects.filter(`[data-${type}]`);
} else {
this[`$${type}`] = length > i ? $selects.eq(i) : null;
}
});
this.bind();
// Reset all the selects (after event binding)
this.reset();
this.ready = true;
}
bind() {
if (this.$province) {
this.$province.on(EVENT_CHANGE, (this.onChangeProvince = $.proxy(() => {
this.output(CITY);
this.output(DISTRICT, true);
}, this)));
}
if (this.$city) {
this.$city.on(
EVENT_CHANGE,
(this.onChangeCity = $.proxy(() => this.output(DISTRICT, true), this)),
);
}
}
unbind() {
if (this.$province) {
this.$province.off(EVENT_CHANGE, this.onChangeProvince);
}
if (this.$city) {
this.$city.off(EVENT_CHANGE, this.onChangeCity);
}
}
output(type, triggerEvent = false) {
const { options, placeholders } = this;
const $select = this[`$${type}`];
if (!$select || !$select.length) {
return;
}
let code;
switch (type) {
case PROVINCE:
code = DEFAULT_CODE;
break;
case CITY:
code = this.$province && (this.$province.find(':selected').data('code') || '');
break;
case DISTRICT:
code = this.$city && (this.$city.find(':selected').data('code') || '');
break;
}
const districts = this.getDistricts(code);
const value = options[type];
const data = [];
let matched = false;
if ($.isPlainObject(districts)) {
$.each(districts, (i, name) => {
const selected = name === value || i === String(value);
if (selected) {
matched = true;
}
data.push({
name,
selected,
code: i,
value: options.valueType === 'name' ? name : i,
});
});
}
if (!matched) {
const autoselect = options.autoselect || options.autoSelect;
if (data.length && ((type === PROVINCE && autoselect > 0)
|| (type === CITY && autoselect > 1)
|| (type === DISTRICT && autoselect > 2))) {
data[0].selected = true;
}
// Save the unmatched value as a placeholder at the first output
if (!this.ready && value) {
placeholders[type] = value;
}
}
// Add placeholder option
if (options.placeholder) {
data.unshift({
code: '',
name: placeholders[type],
value: '',
selected: false,
});
}
if (data.length) {
$select.html(this.getList(data));
} else {
$select.empty();
}
if (triggerEvent) {
$select.trigger(EVENT_CHANGE);
}
}
// eslint-disable-next-line class-methods-use-this
getList(data) {
const list = [];
$.each(data, (i, n) => {
const attrs = [
`data-code="${n.code}"`,
`data-text="${n.name}"`,
`value="${n.value}"`,
];
if (n.selected) {
attrs.push('selected');
}
list.push(`<option ${attrs.join(' ')}>${n.name}</option>`);
});
return list.join('');
}
// eslint-disable-next-line class-methods-use-this
getDistricts(code = DEFAULT_CODE) {
return DISTRICTS[code] || null;
}
reset(deep) {
if (!deep) {
this.output(PROVINCE);
this.output(CITY);
this.output(DISTRICT);
} else if (this.$province) {
this.$province.find(':first').prop('selected', true).end().trigger(EVENT_CHANGE);
}
}
destroy() {
this.unbind();
}
static setDefaults(options) {
$.extend(DEFAULTS, $.isPlainObject(options) && options);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,59 @@
import $ from 'jquery';
import Distpicker from './distpicker';
import {
NAMESPACE,
WINDOW,
} from './constants';
if ($.fn) {
const AnotherDistpicker = $.fn.distpicker;
$.fn.distpicker = function jQueryDistpicker(option, ...args) {
let result;
this.each((i, element) => {
const $element = $(element);
const isDestroy = option === 'destroy';
let distpicker = $element.data(NAMESPACE);
if (!distpicker) {
if (isDestroy) {
return;
}
const options = $.extend({}, $element.data(), $.isPlainObject(option) && option);
distpicker = new Distpicker(element, options);
$element.data(NAMESPACE, distpicker);
}
if (typeof option === 'string') {
const fn = distpicker[option];
if ($.isFunction(fn)) {
result = fn.apply(distpicker, args);
if (isDestroy) {
$element.removeData(NAMESPACE);
}
}
}
});
return typeof result === 'undefined' ? this : result;
};
$.fn.distpicker.Constructor = Distpicker;
$.fn.distpicker.setDefaults = Distpicker.setDefaults;
$.fn.distpicker.noConflict = function noConflict() {
$.fn.distpicker = AnotherDistpicker;
return this;
};
}
if (WINDOW.document) {
$(() => {
$(`[data-toggle="${NAMESPACE}"]`).distpicker();
});
}

View File

@ -0,0 +1,11 @@
{
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"distpicker": {
"version": "2.0.5",
"resolved": "https://registry.npm.taobao.org/distpicker/download/distpicker-2.0.5.tgz",
"integrity": "sha1-hMJXkksIm5EpvflpHUb6FHEJEcU="
}
}
}

View File

@ -0,0 +1,93 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('新增机柜类型')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-assetsCabinet-add">
<div class="form-group">
<label class="col-sm-3 control-label">所属机房:</label>
<div class="col-sm-8">
<select id="machineRoom" name="machineRoom.machineRoomId">
<option value="">请选择所属机房</option>
<option th:each="machineRoom : ${machineRooms}" th:text="${machineRoom.machineRoomName}"
th:value="${machineRoom.machineRoomId}">
</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">机柜名称:</label>
<div class="col-sm-8">
<input id="cabinetName" name="cabinetName" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">机柜所在区域:</label>
<div class="col-sm-8">
<input id="cabinetArea" name="cabinetArea" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">机柜可用U数</label>
<div class="col-sm-8">
<input id="cabinetAvailU" name="cabinetAvailU" class="form-control" type="number" min="1">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">机柜可用电力:</label>
<div class="col-sm-8">
<input id="cabinetAvailElec" name="cabinetAvailElec" class="form-control" type="number" min="1">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">机柜备注:</label>
<div class="col-sm-8">
<input id="remark" name="remark" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "assets/assetsCabinet";
$("#form-assetsCabinet-add").validate({
rules: {
"machineRoom.machineRoomId": {
required: true
},
cabinetName: {
required: true,
minlength: 1,
maxlength: 10
},
cabinetArea: {
required: true,
minlength: 1,
maxlength: 10
},
cabinetAvailU: {
required: true,
minlength: 1,
maxlength: 3,
min: 1
},
cabinetAvailElec: {
required: true,
minlength: 1,
maxlength: 5,
min: 1
}
},
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-assetsCabinet-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,143 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('机柜类型列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
机柜名称:<input type="text" name="cabinetName"/>
</li>
<li>
机房:<input type="text" name="dictCode"/>
</li>
<li>
机柜所在区域:<input type="text" name="cabinetArea"/>
</li>
<li>
机柜可用U数<input type="text" name="cabinetAvailU"/>
</li>
<li>
机柜可用电力:<input type="text" name="cabinetAvailElec"/>
</li>
<li>
机柜备注:<input type="text" name="remark"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="assets:assetsCabinet:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()"
shiro:hasPermission="assets:assetsCabinet:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()"
shiro:hasPermission="assets:assetsCabinet:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()"
shiro:hasPermission="assets:assetsCabinet:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('assets:assetsCabinet:edit')}]];
var removeFlag = [[${@permission.hasPermi('assets:assetsCabinet:remove')}]];
var prefix = ctx + "assets/assetsCabinet";
$(function () {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "机柜类型",
showExport: true,
columns: [{
checkbox: true
},
{
field: 'cabinetId',
title: '机柜编号',
visible: false
},
{
field: 'cabinetName',
title: '机柜名称',
sortable: true
},
{
field: 'machineRoom',
title: '所属机房',
sortable: true,
formatter: function (value, row, index) {
if (row.machineRoom != null) {
var machineRoomName = row.machineRoom.machineRoomName;
value = machineRoomName;
}
return value;
}
},
{
field: 'cabinetArea',
title: '机柜所在区域',
sortable: true
},
{
field: 'cabinetAvailU',
title: '机柜可用U数',
sortable: true
},
{
field: 'cabinetAvailElec',
title: '机柜可用电力',
sortable: true
},
{
field: 'remark',
title: '机柜备注',
sortable: true
},
{
title: '操作',
align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.cabinetId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.cabinetId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,97 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('修改机柜类型')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-assetsCabinet-edit" th:object="${assetsCabinet}">
<input id="cabinetId" name="cabinetId" th:field="*{cabinetId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">所属机房:</label>
<div class="col-sm-8">
<select id="machineRoom" name="machineRoom.machineRoomId">
<option value="">请选择所属机房</option>
<option th:each="machineRoom : ${machineRooms}" th:text="${machineRoom.machineRoomName}"
th:value="${machineRoom.machineRoomId}"
th:selected="*{machineRoom.machineRoomId} == ${machineRoom.machineRoomId} ? true :false">
</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">机柜名称:</label>
<div class="col-sm-8">
<input id="cabinetName" name="cabinetName" th:field="*{cabinetName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">机柜所在区域:</label>
<div class="col-sm-8">
<input id="cabinetArea" name="cabinetArea" th:field="*{cabinetArea}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">机柜可用U数</label>
<div class="col-sm-8">
<input id="cabinetAvailU" name="cabinetAvailU" th:field="*{cabinetAvailU}" class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">机柜可用电力:</label>
<div class="col-sm-8">
<input id="cabinetAvailElec" name="cabinetAvailElec" th:field="*{cabinetAvailElec}" class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">机柜备注:</label>
<div class="col-sm-8">
<input id="remark" name="remark" th:field="*{remark}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" th:inline="javascript">
var prefix = ctx + "assets/assetsCabinet";
$("#form-assetsCabinet-edit").validate({
rules: {
"machineRoom.machineRoomId": {
required: true
},
cabinetName: {
required: true,
minlength: 1,
maxlength: 10
},
cabinetArea: {
required: true,
minlength: 1,
maxlength: 10
},
cabinetAvailU: {
required: true,
minlength: 1,
maxlength: 3,
min: 1,
},
cabinetAvailElec: {
required: true,
minlength: 1,
maxlength: 5,
min: 1
}
},
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-assetsCabinet-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,130 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('新增机房')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-assetsMachineRoom-add">
<div class="form-group">
<label class="col-sm-3 control-label">机房名称:</label>
<div class="col-sm-8">
<input id="machineRoomName" name="machineRoomName" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">带宽类型:</label>
<div class="col-sm-8">
<select id="bandwidthType" name="bandwidthType.dictCode"
th:with="type=${@dict.getType('dict_bandwidth_type')}">
<option value="">请选择带宽类型</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictCode}">
</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">带宽大小:</label>
<div class="col-sm-8">
<input id="bandwidthSize" name="bandwidthSize" class="form-control" type="number" min="1">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">所在国家:</label>
<div class="col-sm-8">
<input id="country" name="country" class="form-control" type="text">
</div>
</div>
<div class="form-group" data-toggle="distpicker"><!-- container -->
<label class="col-sm-3 control-label">省市区:</label>
<div class="col-sm-8">
<select id="province" name="province" data-province="---- 选择省 ----"></select>
<select id="city" name="city" data-city="---- 选择市 ----"></select>
<select id="area" name="area" data-district="---- 选择区 ----"></select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">详细地址:</label>
<div class="col-sm-8">
<input id="location" name="location" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">联系人:</label>
<div class="col-sm-8">
<input id="contactPerson" name="contactPerson" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">联系电话:</label>
<div class="col-sm-8">
<input id="contactPhone" name="contactPhone" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">邮箱:</label>
<div class="col-sm-8">
<input id="email" name="email" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "assets/assetsMachineRoom";
$("#form-assetsMachineRoom-add").validate({
rules: {
"bandwidthType.dictCode": {
required: true
},
machineRoomName: {
required: true,
minlength: 1,
maxlength: 10
},
bandwidthSize: {
required: true,
minlength: 1,
maxlength: 10
},
country: {
required: true,
minlength: 1,
maxlength: 10
},
province: {
required: true,
minlength: 1,
maxlength: 10
},
city: {
required: true,
minlength: 1,
maxlength: 10
},
area: {
required: true,
minlength: 1,
maxlength: 10
},
email: {
required: false,
email: true
},
contactPhone: {
required: false,
isPhone: true
}
},
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-assetsMachineRoom-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,200 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('机房列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
机房名称:<input type="text" name="machineRoomName"/>
</li>
<li>
带宽类型:<input type="text" name="dictCode"/>
</li>
<li>
带宽大小:<input type="text" name="bandwidthSize"/>
</li>
<li>
所在国家:<input type="text" name="country"/>
</li>
<li>
所在省:<input type="text" name="province"/>
</li>
<li>
所在市:<input type="text" name="city"/>
</li>
<li>
所在区:<input type="text" name="area"/>
</li>
<li>
地址:<input type="text" name="location"/>
</li>
<li>
联系人:<input type="text" name="contactPerson"/>
</li>
<li>
联系电话:<input type="text" name="contactPhone"/>
</li>
<li>
邮箱:<input type="text" name="email"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="assets:assetsMachineRoom:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()"
shiro:hasPermission="assets:assetsMachineRoom:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()"
shiro:hasPermission="assets:assetsMachineRoom:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()"
shiro:hasPermission="assets:assetsMachineRoom:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('assets:assetsMachineRoom:edit')}]];
var removeFlag = [[${@permission.hasPermi('assets:assetsMachineRoom:remove')}]];
var prefix = ctx + "assets/assetsMachineRoom";
$(function () {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "机房",
showExport: true,
columns: [{
checkbox: true
},
{
field: 'machineRoomId',
title: '机房编号',
visible: false
},
{
field: 'machineRoomName',
title: '机房名称',
sortable: true
},
{
field: 'bandwidthType.dictLabel',
title: '带宽类型',
sortable: true
},
{
field: 'bandwidthSize',
title: '带宽(M)',
sortable: true
},
{
field: 'country',
title: '国家',
sortable: true
},
{
title: '省市区',
formatter: function (value, row, index) {
if (row) {
value = row.province + row.city + row.area;
}
return value;
}
},
{
field: 'location',
title: '地址',
sortable: true
},
{
field: 'contactPerson',
title: '联系人',
sortable: true
},
{
field: 'contactPhone',
title: '联系电话',
sortable: true
},
{
field: 'email',
title: '邮箱',
sortable: true
}]
};
$.each([[${@dict.getType('dict_net_ip_type')}]], function (index, dict) {
options.columns.push({
field: dict.dictCode,
title: dict.dictLabel,
align: 'center',
formatter: function (value, row, index) {
if (row.switchPorts) {
$.each(row.switchPorts, function (index, switchPort) {
if (switchPort.switchPortType == dict.dictCode) {
value = switchPort.switchPortNum;
} else {
}
});
}
var title = "'新增" + dict.dictLabel + "IP'";
var url = "/network/netIpAddress/add?";
value = "<a class=\"btn btn-primary btn-xs \" href=\"javascript:void(0)\" " +
"onclick=\"$.modal.open(" + title + ",'" + url + "');\"><i class=\"fa fa-create\"></i>新增</a>";
return value;
}
});
});
options.columns.push({
title: '操作',
align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.machineRoomId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.machineRoomId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
});
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,148 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('修改机房')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-assetsMachineRoom-edit" th:object="${assetsMachineRoom}">
<input id="machineRoomId" name="machineRoomId" th:field="*{machineRoomId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">机房名称:</label>
<div class="col-sm-8">
<input id="machineRoomName" name="machineRoomName" th:field="*{machineRoomName}" class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">带宽类型:</label>
<div class="col-sm-8">
<select id="bandwidthType" name="bandwidthType.dictCode"
th:with="type=${@dict.getType('dict_bandwidth_type')}">
<option value="">请选择带宽类型</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictCode}"
th:selected="*{bandwidthType.dictCode} == ${dict.dictCode} ? true :false">
</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">带宽大小(M)</label>
<div class="col-sm-8">
<input id="bandwidthSize" name="bandwidthSize" th:field="*{bandwidthSize}" class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">所在国家:</label>
<div class="col-sm-8">
<input id="country" name="country" th:field="*{country}" class="form-control" type="text">
</div>
</div>
<div class="form-group" data-toggle="distpicker"><!-- container -->
<label class="col-sm-3 control-label">省市区:</label>
<div class="col-sm-8">
<select id="province" name="province" th:field="*{province}" data-province="---- 选择省 ----"></select>
<select id="city" name="city" th:field="*{city}" data-city="---- 选择市 ----"></select>
<select id="area" name="area" th:field="*{area}" data-district="---- 选择区 ----"></select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">地址:</label>
<div class="col-sm-8">
<input id="location" name="location" th:field="*{location}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">联系人:</label>
<div class="col-sm-8">
<input id="contactPerson" name="contactPerson" th:field="*{contactPerson}" class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">联系电话:</label>
<div class="col-sm-8">
<input id="contactPhone" name="contactPhone" th:field="*{contactPhone}" class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">邮箱:</label>
<div class="col-sm-8">
<input id="email" name="email" th:field="*{email}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" th:inline="javascript">
var prefix = ctx + "assets/assetsMachineRoom";
$("#form-assetsMachineRoom-edit").validate({
rules: {
"bandwidthType.dictCode": {
required: true
},
machineRoomName: {
required: true,
minlength: 1,
maxlength: 10
},
bandwidthSize: {
required: true,
minlength: 1,
maxlength: 10
},
country: {
required: true,
minlength: 1,
maxlength: 10
},
province: {
required: true,
minlength: 1,
maxlength: 10
},
city: {
required: true,
minlength: 1,
maxlength: 10
},
area: {
required: true,
minlength: 1,
maxlength: 10
},
email: {
required: false,
email: true
},
contactPhone: {
required: false,
isPhone: true
}
},
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-assetsMachineRoom-edit').serialize());
}
}
/*
* 修改时手动回显省市区
*/
$(function () {
var machineRoom = [[${assetsMachineRoom}]];
$("#province").val(machineRoom.province);
$("#province").trigger("change");
$("#city").val(machineRoom.city);
$("#city").trigger("change");
$("#area").val(machineRoom.area);
});
</script>
</body>
</html>

View File

@ -41,6 +41,7 @@
<script th:src="@{/ajax/libs/layui/layui.js}"></script>
<script th:src="@{/ruoyi/js/common.js?v=3.4.0}"></script>
<script th:src="@{/ruoyi/js/ry-ui.js?v=3.4.0}"></script>
<script th:src="@{/node_modules/distpicker/dist/distpicker.js}"></script>
<script th:inline="javascript"> var ctx = [[@{/}]]; </script>
</div>

View File

@ -4,9 +4,9 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="renderer" content="webkit">
<title>若依管理系统首页</title>
<meta name="keywords" content="若依管理系统首页">
<meta name="description" content="若依管理系统首页">
<title>资源管理系统首页</title>
<meta name="keywords" content="资源管理系统首页">
<meta name="description" content="资源管理系统首页">
<!--[if lt IE 9]>
<meta http-equiv="refresh" content="0;ie.html"/>
<![endif]-->
@ -30,7 +30,7 @@
<div class="sidebar-collapse">
<ul class="nav" id="side-menu">
<li class="logo">
<span class="logo-lg">RuoYi</span>
<span class="logo-lg">资源管理系统</span>
</li>
<li>
<div class="user-panel">
@ -50,7 +50,7 @@
<li class="active">
<a href="index.html"><i class="fa fa-home"></i> <span class="nav-label">主页</span> <span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li class="active"><a class="menuItem" th:href="@{/system/main}">了解若依</a></li>
<li class="active"><a class="menuItem" th:href="@{/system/main}">控制台</a></li>
</ul>
</li>
<li th:each="menu : ${menus}">
@ -168,8 +168,8 @@
</a>
</div>
<ul class="nav navbar-top-links navbar-right welcome-message">
<li><a title="视频教程" href="http://doc.ruoyi.vip/#/standard/spjc" target="_blank"><i class="fa fa-video-camera"></i> 视频教程</a></li>
<li><a title="开发文档" href="http://doc.ruoyi.vip" target="_blank"><i class="fa fa-question-circle"></i> 开发文档</a></li>
<!-- <li><a title="视频教程" href="http://doc.ruoyi.vip/#/standard/spjc" target="_blank"><i class="fa fa-video-camera"></i> 视频教程</a></li>-->
<!-- <li><a title="开发文档" href="http://doc.ruoyi.vip" target="_blank"><i class="fa fa-question-circle"></i> 开发文档</a></li>-->
<li><a title="全屏显示" href="javascript:void(0)" id="fullScreen"><i class="fa fa-arrows-alt"></i> 全屏显示</a></li>
<li class="dropdown user-menu">
<a href="javascript:void(0)" class="dropdown-toggle" data-hover="dropdown">
@ -217,7 +217,7 @@
th:src="@{/system/main}" frameborder="0" seamless></iframe>
</div>
<div class="footer">
<div class="pull-right">© [[${copyrightYear}]] RuoYi Copyright </div>
<div class="pull-right">Version [[${version}]] © [[${copyrightYear}]] EZSVS Copyright </div>
</div>
</div>
<!--右侧部分结束-->

View File

@ -1,10 +1,10 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title>若依管理系统</title>
<title>资源管理系统</title>
<meta name="keywords" content="若依,若依开源,若依框架,若依系统,ruoyi">
<meta name="description" content="若依基于SpringBoot2.0的权限管理系统 易读易懂、界面简洁美观。 核心技术采用Spring、MyBatis、Shiro没有任何其它重度依赖">
<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
@ -13,73 +13,68 @@
<link href="../static/css/login.min.css" th:href="@{/css/login.min.css}" rel="stylesheet"/>
<link href="../static/ruoyi/css/ry-ui.css" th:href="@{/ruoyi/css/ry-ui.css?v=3.4.0}" rel="stylesheet"/>
<!--[if lt IE 9]>
<meta http-equiv="refresh" content="0;ie.html" />
<meta http-equiv="refresh" content="0;ie.html"/>
<![endif]-->
<link rel="shortcut icon" href="../static/favicon.ico" th:href="@{favicon.ico}"/>
<style type="text/css">label.error { position:inherit; }</style>
<style type="text/css">label.error {
position: inherit;
}</style>
<script>
if(window.top!==window.self){window.top.location=window.location};
if (window.top !== window.self) {
window.top.location = window.location
}
;
</script>
</head>
<body class="signin">
<div class="signinpanel">
<div class="row">
<div class="col-sm-7">
<div class="signin-info">
<div class="logopanel m-b">
<h1><img alt="[ 若依 ]" src="../static/ruoyi.png" th:src="@{/ruoyi.png}"></h1>
<div class="signinpanel">
<div class="text-center">
<h2>资源管理系统</h2>
</div>
<div class="row">
<div class="layadmin-user-login-box layadmin-user-login-body layui-form">
<form id="signupForm">
<h4 class="no-margins">登录:</h4>
<!-- <p class="m-t-md">你若不离不弃,我必生死相依</p>-->
<input type="text" name="username" class="form-control uname" placeholder="用户名" value="admin"/>
<input type="password" name="password" class="form-control pword" placeholder="密码" value="admin123"/>
<div class="row m-t" th:if="${captchaEnabled==true}">
<div class="col-xs-6">
<input type="text" name="validateCode" class="form-control code" placeholder="验证码" maxlength="5"
autocomplete="off">
</div>
<div class="col-xs-6">
<a href="javascript:void(0);" title="点击更换验证码">
<img th:src="@{captcha/captchaImage(type=${captchaType})}" class="imgcode" width="85%"/>
</a>
</div>
<div class="m-b"></div>
<h4>欢迎使用 <strong>若依 后台管理系统</strong></h4>
<ul class="m-b">
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> SpringBoot</li>
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Mybatis</li>
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Shiro</li>
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Thymeleaf</li>
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Bootstrap</li>
</ul>
<strong>还没有账号? <a href="#">立即注册&raquo;</a></strong>
</div>
</div>
<div class="col-sm-5">
<form id="signupForm">
<h4 class="no-margins">登录:</h4>
<p class="m-t-md">你若不离不弃,我必生死相依</p>
<input type="text" name="username" class="form-control uname" placeholder="用户名" value="admin" />
<input type="password" name="password" class="form-control pword" placeholder="密码" value="admin123" />
<div class="row m-t" th:if="${captchaEnabled==true}">
<div class="col-xs-6">
<input type="text" name="validateCode" class="form-control code" placeholder="验证码" maxlength="5" autocomplete="off">
</div>
<div class="col-xs-6">
<a href="javascript:void(0);" title="点击更换验证码">
<img th:src="@{captcha/captchaImage(type=${captchaType})}" class="imgcode" width="85%"/>
</a>
</div>
</div>
<div class="checkbox-custom" th:classappend="${captchaEnabled==false} ? 'm-t'">
<input type="checkbox" id="rememberme" name="rememberme"> <label for="rememberme">记住我</label>
</div>
<button class="btn btn-success btn-block" id="btnSubmit" data-loading="正在验证登录,请稍后...">登录</button>
</form>
</div>
</div>
<div class="signup-footer">
<div class="pull-left">
&copy; 2019 All Rights Reserved. RuoYi <br>
<a href="http://www.miitbeian.gov.cn/" target="_blank" rel="nofollow">粤ICP备18046899号</a><br>
</div>
<div class="checkbox-custom" th:classappend="${captchaEnabled==false} ? 'm-t'">
<input type="checkbox" id="rememberme" name="rememberme"> <label for="rememberme">记住我</label>
</div>
<button class="btn btn-success btn-block" id="btnSubmit" data-loading="正在验证登录,请稍后...">登录</button>
</form>
</div>
</div>
<script th:inline="javascript"> var ctx = [[@{/}]]; var captchaType = [[${captchaType}]]; </script>
<div class="signup-footer">
<div class="pull-left">
&copy; 2019 All Rights Reserved. EZSVS <br>
<!-- <a href="http://www.miitbeian.gov.cn/" target="_blank" rel="nofollow">粤ICP备18046899号</a><br>-->
</div>
</div>
</div>
<script th:inline="javascript"> var ctx = [[@{
/}]]; var captchaType = [[${captchaType}]]; </script>
<!-- 全局js -->
<script src="../static/js/jquery.min.js" th:src="@{/js/jquery.min.js}"></script>
<script src="../static/js/bootstrap.min.js" th:src="@{/js/bootstrap.min.js}"></script>
<!-- 验证插件 -->
<script src="../static/ajax/libs/validate/jquery.validate.min.js" th:src="@{/ajax/libs/validate/jquery.validate.min.js}"></script>
<script src="../static/ajax/libs/validate/messages_zh.min.js" th:src="@{/ajax/libs/validate/messages_zh.min.js}"></script>
<script src="../static/ajax/libs/validate/jquery.validate.min.js"
th:src="@{/ajax/libs/validate/jquery.validate.min.js}"></script>
<script src="../static/ajax/libs/validate/messages_zh.min.js"
th:src="@{/ajax/libs/validate/messages_zh.min.js}"></script>
<script src="../static/ajax/libs/layer/layer.min.js" th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script src="../static/ajax/libs/blockUI/jquery.blockUI.js" th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
<script src="../static/ruoyi/js/ry-ui.js" th:src="@{/ruoyi/js/ry-ui.js?v=3.4.0}"></script>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,79 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('新增网络IP')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-netIpAddress-add">
<div class="form-group">
<label class="col-sm-3 control-label">IP地址类型</label>
<div class="col-sm-8">
<select id="ipAddressType" name="ipAddressType.dictCode"
th:with="type=${@dict.getType('dict_net_ip_type')}">
<option value="">请选择带宽类型</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictCode}">
</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">IP地址段</label>
<div class="col-sm-8">
<input id="ipAddressSection" name="ipAddressSection" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">所属机房:</label>
<div class="col-sm-8">
<input id="machineRoomId" name="machineRoomId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">IP使用规则</label>
<div class="col-sm-8">
<input id="ipUseRule" name="ipUseRule" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">IP地址分配规则</label>
<div class="col-sm-8">
<input id="ipAllocRule" name="ipAllocRule" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "network/netIpAddress"
$("#form-netIpAddress-add").validate({
onkeyup: false,
rules: {
machineRoomId: {
required: true,
minlength: 1,
maxlength: 2
},
"ipAddressType.dictCode": {
required: true,
minlength: 1,
maxlength: 20
},
ipAddressSection: {
required: true,
minlength: 1,
maxlength: 20
}
},
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-netIpAddress-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,82 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('修改网络IP')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-netIpAddress-edit" th:object="${netIpAddress}">
<input id="ipAddressId" name="ipAddressId" th:field="*{ipAddressId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">IP地址类型</label>
<div class="col-sm-8">
<select id="ipAddressType" name="ipAddressType.dictCode"
th:with="type=${@dict.getType('dict_net_ip_type')}">
<option value="">请选择IP地址类型</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictCode}"
th:selected="*{ipAddressType.dictCode} == ${dict.dictCode} ? true :false">
</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">IP地址段</label>
<div class="col-sm-8">
<input id="ipAddressSection" name="ipAddressSection" th:field="*{ipAddressSection}" class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">所属机房编号:</label>
<div class="col-sm-8">
<input id="machineRoomId" name="machineRoomId" th:field="*{machineRoomId}" class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">IP使用规则</label>
<div class="col-sm-8">
<input id="ipUseRule" name="ipUseRule" th:field="*{ipUseRule}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">IP地址分配规则</label>
<div class="col-sm-8">
<input id="ipAllocRule" name="ipAllocRule" th:field="*{ipAllocRule}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" th:inline="javascript">
var prefix = ctx + "network/netIpAddress";
$("#form-netIpAddress-edit").validate({
rules: {
machineRoomId: {
required: true,
minlength: 1,
maxlength: 2
},
ipAddressType: {
required: true,
minlength: 1,
maxlength: 20
},
ipAddressSection: {
required: true,
minlength: 1,
maxlength: 20
}
},
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-netIpAddress-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,129 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('网络IP列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
IP地址类型<input type="text" name="dictCode"/>
</li>
<li>
IP地址段<input type="text" name="ipAddressSection"/>
</li>
<li>
所属机房编号:<input type="text" name="machineRoomId"/>
</li>
<li>
IP使用规则<input type="text" name="ipUseRule"/>
</li>
<li>
IP地址分配规则<input type="text" name="ipAllocRule"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="network:netIpAddress:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()"
shiro:hasPermission="network:netIpAddress:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()"
shiro:hasPermission="network:netIpAddress:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()"
shiro:hasPermission="network:netIpAddress:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('network:netIpAddress:edit')}]];
var removeFlag = [[${@permission.hasPermi('network:netIpAddress:remove')}]];
var prefix = ctx + "network/netIpAddress";
$(function () {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "网络IP",
showExport: true,
columns: [{
checkbox: true
},
{
field: 'ipAddressId',
title: 'IP地址编号',
visible: false
},
{
field: 'ipAddressType.dictLabel',
title: 'IP地址类型',
sortable: true
},
{
field: 'ipAddressSection',
title: 'IP地址段',
sortable: true
},
{
field: 'machineRoomId',
title: '所属机房',
sortable: true
},
{
field: 'ipUseRule',
title: 'IP使用规则',
sortable: true
},
{
field: 'ipAllocRule',
title: 'IP地址分配规则',
sortable: true
},
{
title: '操作',
align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.ipAddressId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.ipAddressId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -78,7 +78,8 @@
},
{
field: 'configId',
title: '参数主键'
title: '参数主键',
visible: false
},
{
field: 'configName',

View File

@ -76,7 +76,8 @@
},
{
field: 'dictCode',
title: '字典编码'
title: '字典编码',
visible: false
},
{
field: 'dictLabel',
@ -88,7 +89,8 @@
},
{
field: 'dictSort',
title: '字典排序'
title: '字典排序',
sortable: true
},
{
field: 'status',

View File

@ -80,7 +80,8 @@
},
{
field: 'dictId',
title: '字典主键'
title: '字典主键',
visible: false
},
{
field: 'dictName',

View File

@ -1,97 +1,98 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('新增通知公告')" />
<th:block th:include="include :: summernote-css" />
<th:block th:include="include :: header('新增通知公告')"/>
<th:block th:include="include :: summernote-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-notice-add">
<div class="form-group">
<label class="col-sm-2 control-label">公告标题:</label>
<div class="col-sm-10">
<input id="noticeTitle" name="noticeTitle" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">公告类型:</label>
<div class="col-sm-10">
<select name="noticeType" class="form-control m-b" th:with="type=${@dict.getType('sys_notice_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">公告内容:</label>
<div class="col-sm-10">
<input id="noticeContent" name="noticeContent" type="hidden">
<div class="summernote"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">公告状态:</label>
<div class="col-sm-10">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_notice_status')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: summernote-js" />
<script type="text/javascript">
var prefix = ctx + "system/notice";
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-notice-add">
<div class="form-group">
<label class="col-sm-2 control-label">公告标题:</label>
<div class="col-sm-10">
<input id="noticeTitle" name="noticeTitle" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">公告类型:</label>
<div class="col-sm-10">
<select name="noticeType" class="form-control m-b" th:with="type=${@dict.getType('sys_notice_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">公告内容:</label>
<div class="col-sm-10">
<input id="noticeContent" name="noticeContent" type="hidden">
<div class="summernote"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">公告状态:</label>
<div class="col-sm-10">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_notice_status')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}"
th:checked="${dict.isDefault == 'Y' ? true : false}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: summernote-js"/>
<script type="text/javascript">
var prefix = ctx + "system/notice";
$('.summernote').summernote({
placeholder: '请输入公告内容',
height : 192,
lang : 'zh-CN',
followingToolbar: false,
callbacks: {
onImageUpload: function (files) {
sendFile(files[0], this);
}
$('.summernote').summernote({
placeholder: '请输入公告内容',
height: 192,
lang: 'zh-CN',
followingToolbar: false,
callbacks: {
onImageUpload: function (files) {
sendFile(files[0], this);
}
});
// 上传文件
function sendFile(file, obj) {
var data = new FormData();
data.append("file", file);
$.ajax({
type: "POST",
url: ctx + "common/upload",
data: data,
cache: false,
contentType: false,
processData: false,
dataType: 'json',
success: function(result) {
if (result.code == web_status.SUCCESS) {
$(obj).summernote('editor.insertImage', result.url, result.fileName);
} else {
$.modal.alertError(result.msg);
}
},
error: function(error) {
$.modal.alertWarning("图片上传失败。");
}
});
}
$("#form-notice-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
var sHTML = $('.summernote').summernote('code');
$("#noticeContent").val(sHTML);
$.operate.save(prefix + "/add", $('#form-notice-add').serialize());
}
}
</script>
}
});
// 上传文件
function sendFile(file, obj) {
var data = new FormData();
data.append("file", file);
$.ajax({
type: "POST",
url: ctx + "common/upload",
data: data,
cache: false,
contentType: false,
processData: false,
dataType: 'json',
success: function (result) {
if (result.code == web_status.SUCCESS) {
$(obj).summernote('editor.insertImage', result.url, result.fileName);
} else {
$.modal.alertError(result.msg);
}
},
error: function (error) {
$.modal.alertWarning("图片上传失败。");
}
});
}
$("#form-notice-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
var sHTML = $('.summernote').summernote('code');
$("#noticeContent").val(sHTML);
$.operate.save(prefix + "/add", $('#form-notice-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -68,7 +68,8 @@
},
{
field : 'noticeId',
title : '序号'
title : '序号',
visible: false
},
{
field : 'noticeTitle',

View File

@ -72,7 +72,8 @@
},
{
field: 'postId',
title: '岗位编号'
title: '岗位编号',
visible: false
},
{
field: 'postCode',

View File

@ -36,7 +36,7 @@
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:role:add">
<i class="fa fa-plus"></i> 新增
@ -51,7 +51,7 @@
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
@ -62,7 +62,7 @@
var editFlag = [[${@permission.hasPermi('system:role:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:role:remove')}]];
var prefix = ctx + "system/role";
$(function() {
var options = {
@ -78,7 +78,8 @@
},
{
field: 'roleId',
title: '角色编号'
title: '角色编号',
visible: false
},
{
field: 'roleName',
@ -123,19 +124,19 @@
};
$.table.init(options);
});
/* 角色管理-分配数据权限 */
function authDataScope(roleId) {
var url = prefix + '/authDataScope/' + roleId;
$.modal.open("分配数据权限", url);
}
/* 角色管理-分配用户 */
function authUser(roleId) {
var url = prefix + '/authUser/' + roleId;
$.modal.openTab("分配用户", url);
}
/* 角色状态显示 */
function statusTools(row) {
if (row.status == 1) {
@ -144,7 +145,7 @@
return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.roleId + '\')"></i> ';
}
}
/* 角色管理-停用 */
function disable(roleId) {
$.modal.confirm("确认要停用角色吗?", function() {

View File

@ -122,7 +122,8 @@
},
{
field: 'userId',
title: '用户ID'
title: '用户ID',
visible: false
},
{
field: 'loginName',

View File

@ -0,0 +1,188 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('新增服务器模板')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-tmplServer-add">
<div class="form-group">
<label class="col-sm-3 control-label">服务器品牌:</label>
<div class="col-sm-8">
<input id="serverBrand" name="serverBrand" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">服务器型号:</label>
<div class="col-sm-8">
<input id="serverType" name="serverType" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">CPU主频</label>
<div class="col-sm-8">
<input id="cpuFreq" name="cpuFreq" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">CPU数量</label>
<div class="col-sm-8">
<input id="cpuNum" name="cpuNum" class="form-control" min=1 type="number">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">内存类型:</label>
<div class="col-sm-8">
<select name="memoryType" th:with="type=${@dict.getType('dict_memory_type')}">
<option value="">请选择单根内存大小</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictCode}">
</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">内存个数:</label>
<div class="col-sm-8">
<input name="memoryNum" type="number"
class="form-control"
placeholder="单位(个)">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">IPMI端口</label>
<div class="col-sm-8">
<input id="ipmiPort" name="ipmiPort" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">服务器电源数量:</label>
<div class="col-sm-8">
<input id="powerNum" name="powerNum" class="form-control" min=1 type="number">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">服务器raid卡</label>
<div class="col-sm-8">
<input id="raidCard" name="raidCard" class="form-control" type="text">
</div>
</div>
<!--服务器网卡类型字典-->
<div class="form-group" th:with="type=${@dict.getType('dict_netcard_type')}">
<div class="col-sm-6" th:each="dict : ${type}">
<div class="col-md-12">
<div class="form-group">
<label class="col-sm-6 control-label" th:text="${dict.dictLabel}"></label>
<div class="col-sm-5">
<input type="number" min="0" max="100" th:id="${dict.dictCode}"
class="form-control serverNetcard"
placeholder="单位(个)">
</div>
</div>
</div>
</div>
</div>
<!--服务器硬盘类型字典-->
<div class="form-group" th:with="type=${@dict.getType('dict_disk_type')}">
<div class="col-sm-6" th:each="dict : ${type}">
<div class="col-md-12">
<div class="form-group">
<label class="col-sm-6 control-label" th:text="${dict.dictLabel}"></label>
<div class="col-sm-5">
<input type="number" min="0" max="100" th:id="${dict.dictCode}"
class="form-control serverDisk"
placeholder="单位(个)">
</div>
</div>
</div>
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "template/tmplServer";
$("#form-tmplServer-add").validate({
onkeyup: false,
rules: {
serverBrand: {
required: true,
minlength: 1,
maxlength: 20
},
serverType: {
required: true,
minlength: 1,
maxlength: 20
},
cpuFreq: {
required: true,
minlength: 1,
maxlength: 10
},
cpuNum: {
required: true,
minlength: 1,
maxlength: 2
},
memoryType: {
required: true
},
memoryNum: {
required: true,
minlength: 1,
maxlength: 2,
min: 1
},
ipmiPort: {
required: true,
minlength: 1,
maxlength: 2
},
powerNum: {
required: true,
minlength: 1,
maxlength: 2
},
raidCard: {
required: true,
minlength: 1,
maxlength: 2
},
},
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
var data = $('#form-tmplServer-add').serializeArray();
var serverNetcards = [];
$(".serverNetcard").each(function () {
serverNetcards.push({"id": $(this).attr("id"), "value": $(this).val()});
});
var serverDisks = [];
$(".serverDisk").each(function () {
serverDisks.push({"id": $(this).attr("id"), "value": $(this).val()});
});
var serverMemorys = [];
serverMemorys.push({
"id": $("select[name='memoryType']").val(),
"value": $("input[name='memoryNum']").val()
});
var obj = {
"name": "foreignKeyInfo",
"value": JSON.stringify({
"serverNetcards": serverNetcards,
"serverDisks": serverDisks,
"serverMemorys": serverMemorys
})
};
data.push(obj);
$.operate.save(prefix + "/add", data);
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,198 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('修改服务器模板')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-tmplServer-edit" th:object="${tmplServer}">
<input id="serverId" name="serverId" th:field="*{serverId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">服务器品牌:</label>
<div class="col-sm-8">
<input id="serverBrand" name="serverBrand" th:field="*{serverBrand}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">服务器型号:</label>
<div class="col-sm-8">
<input id="serverType" name="serverType" th:field="*{serverType}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">CPU主频</label>
<div class="col-sm-8">
<input id="cpuFreq" name="cpuFreq" th:field="*{cpuFreq}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">CPU数量</label>
<div class="col-sm-8">
<input id="cpuNum" name="cpuNum" th:field="*{cpuNum}" class="form-control" min=1 type="number">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">内存类型:</label>
<div class="col-sm-8">
<select name="memoryType" th:with="type=${@dict.getType('dict_memory_type')}">
<option value="">请选择单根内存大小</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictCode}">
</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">内存个数:</label>
<div class="col-sm-8">
<input name="memoryNum" type="number"
class="form-control"
placeholder="单位(个)">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">IPMI端口</label>
<div class="col-sm-8">
<input id="ipmiPort" name="ipmiPort" th:field="*{ipmiPort}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">服务器电源数量:</label>
<div class="col-sm-8">
<input id="powerNum" name="powerNum" th:field="*{powerNum}" class="form-control" min=1 type="number">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">服务器raid卡</label>
<div class="col-sm-8">
<input id="raidCard" name="raidCard" th:field="*{raidCard}" class="form-control" type="text">
</div>
</div>
<!--网卡类型字典-->
<div class="form-group" th:with="type=${@dict.getType('dict_netcard_type')}">
<div class="col-sm-6" th:each="dict : ${type}">
<div class="col-md-12">
<div class="form-group">
<label class="col-sm-6 control-label" th:text="${dict.dictLabel}"></label>
<div class="col-sm-5">
<input type="number" min="0" max="100" th:id="${dict.dictCode}"
class="form-control serverNetcard"
placeholder="单位(个)">
</div>
</div>
</div>
</div>
</div>
<!--硬盘类型字典-->
<div class="form-group" th:with="type=${@dict.getType('dict_disk_type')}">
<div class="col-sm-6" th:each="dict : ${type}">
<div class="col-md-12">
<div class="form-group">
<label class="col-sm-6 control-label" th:text="${dict.dictLabel}"></label>
<div class="col-sm-5">
<input type="number" min="0" max="100" th:id="${dict.dictCode}"
class="form-control serverDisk"
placeholder="单位(个)">
</div>
</div>
</div>
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" th:inline="javascript">
var prefix = ctx + "template/tmplServer";
$("#form-tmplServer-edit").validate({
onkeyup: false,
rules: {
serverBrand: {
required: true,
minlength: 1,
maxlength: 20
},
serverType: {
required: true,
minlength: 1,
maxlength: 20
},
cpuFreq: {
required: true,
minlength: 1,
maxlength: 10
},
cpuNum: {
required: true,
minlength: 1,
maxlength: 2
},
ipmiPort: {
required: true,
minlength: 1,
maxlength: 2
},
powerNum: {
required: true,
minlength: 1,
maxlength: 2
},
raidCard: {
required: true,
minlength: 1,
maxlength: 2
}
},
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
var data = $('#form-tmplServer-edit').serializeArray();
var serverNetcards = [];
$(".serverNetcard").each(function () {
serverNetcards.push({"id": $(this).attr("id"), "value": $(this).val()});
});
var serverDisks = [];
$(".serverDisk").each(function () {
serverDisks.push({"id": $(this).attr("id"), "value": $(this).val()});
});
var serverMemorys = [];
serverMemorys.push({
"id": $("select[name='memoryType']").val(),
"value": $("input[name='memoryNum']").val()
});
var obj = {
"name": "foreignKeyInfo",
"value": JSON.stringify({
"serverNetcards": serverNetcards,
"serverDisks": serverDisks,
"serverMemorys": serverMemorys
})
};
data.push(obj);
$.operate.save(prefix + "/edit", data);
}
}
/*
* 修改时手动回显ServerNetcardNum、ServerDiskNum
*/
$(function () {
var serverNetcards = [[${tmplServer}]].serverNetcards;
$.each(serverNetcards, function (index, netcard) {
$("#" + netcard.serverNetcardType).val(netcard.serverNetcardNum);
});
var serverDisks = [[${tmplServer}]].serverDisks;
$.each(serverDisks, function (index, disk) {
$("#" + disk.serverDiskType).val(disk.serverDiskNum);
});
var serverMemorys = [[${tmplServer}]].serverMemorys;
$.each(serverMemorys, function (index, memory) {
$("select[name='memoryType']").val(memory.serverMemoryType.dictCode);
$("input[name='memoryNum']").val(memory.serverMemoryNum);
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,192 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('服务器模板列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
服务器品牌:<input type="text" name="serverBrand"/>
</li>
<li>
服务器型号:<input type="text" name="serverType"/>
</li>
<li>
CPU主频<input type="text" name="cpuFreq"/>
</li>
<li>
CPU数量<input type="text" name="cpuNum"/>
</li>
<li>
IPMI端口<input type="text" name="ipmiPort"/>
</li>
<li>
服务器电源数量:<input type="text" name="powerNum"/>
</li>
<li>
服务器raid卡<input type="text" name="raidCard"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="template:tmplServer:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()"
shiro:hasPermission="template:tmplServer:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()"
shiro:hasPermission="template:tmplServer:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="template:tmplServer:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('template:tmplServer:edit')}]];
var removeFlag = [[${@permission.hasPermi('template:tmplServer:remove')}]];
var prefix = ctx + "template/tmplServer";
$(function () {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "服务器模板",
showExport: true,
columns: [{
checkbox: true
},
{
field: 'serverId',
title: '服务器模板编号',
visible: false
},
{
field: 'serverBrand',
title: '品牌',
sortable: true
},
{
field: 'serverType',
title: '型号',
sortable: true
},
{
field: 'cpuFreq',
title: 'CPU主频',
sortable: true
},
{
field: 'cpuNum',
title: 'CPU(核)',
sortable: true
},
{
title: '总内存(G)',
sortable: true,
formatter: function (value, row, index) {
if (row.serverMemorys[index] && row.serverMemorys[index].serverMemoryType) {
var num = row.serverMemorys[index].serverMemoryNum;
var singleVaule = row.serverMemorys[index].serverMemoryType.dictValue;
value = num * singleVaule + "(" + singleVaule + "Gx" + num + ")";
}
return value;
}
},
{
field: 'ipmiPort',
title: 'IPMI端口',
sortable: true
},
{
field: 'powerNum',
title: '电源(个)',
sortable: true
},
{
field: 'raidCard',
title: 'raid卡',
sortable: true
}]
};
$.each([[${@dict.getType('dict_netcard_type')}]], function (index, dict) {
options.columns.push({
field: dict.dictCode,
title: dict.dictLabel + "(个)",
align: 'center',
formatter: function (value, row, index) {
if (row.serverNetcards) {
$.each(row.serverNetcards, function (index, serverNetcard) {
if (serverNetcard.serverNetcardType == dict.dictCode) {
value = serverNetcard.serverNetcardNum;
}
});
}
return value;
}
});
});
$.each([[${@dict.getType('dict_disk_type')}]], function (index, dict) {
options.columns.push({
field: dict.dictCode,
title: dict.dictLabel + "(个)",
align: 'center',
formatter: function (value, row, index) {
if (row.serverDisks) {
$.each(row.serverDisks, function (index, serverDisk) {
if (serverDisk.serverDiskType == dict.dictCode) {
value = serverDisk.serverDiskNum;
}
});
}
return value;
}
});
});
options.columns.push({
title: '操作',
align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.serverId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.serverId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
})
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,90 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('新增交换机模板')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-tmplSwitch-add">
<div class="form-group">
<label class="col-sm-3 control-label">交换机品牌:</label>
<div class="col-sm-8">
<input id="switchBrand" name="switchBrand" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交换机型号:</label>
<div class="col-sm-8">
<input id="switchType" name="switchType" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交换机电源数量:</label>
<div class="col-sm-8">
<input id="powerNum" name="powerNum" class="form-control" min=1 type="number">
</div>
</div>
<!--端口类型字典-->
<div class="form-group" th:with="type=${@dict.getType('dict_port_type')}">
<div class="col-sm-6" th:each="dict : ${type}">
<div class="col-md-12">
<div class="form-group">
<label class="col-sm-6 control-label" th:text="${dict.dictLabel}"></label>
<div class="col-sm-5">
<input type="number" min="0" max="100" th:id="${dict.dictCode}"
class="form-control switchPort"
placeholder="单位(个)">
</div>
</div>
</div>
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "template/tmplSwitch"
$("#form-tmplSwitch-add").validate({
onkeyup: false,
rules: {
switchBrand: {
required: true,
minlength: 1,
maxlength: 20
},
switchType: {
required: true,
minlength: 1,
maxlength: 20
},
powerNum: {
required: true,
minlength: 1,
maxlength: 2
},
},
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
var data = $('#form-tmplSwitch-add').serializeArray();
var switchPorts = [];
$(".switchPort").each(function () {
switchPorts.push({"id": $(this).attr("id"), "value": $(this).val()});
});
var obj = {
"name": "foreignKeyInfo",
"value": JSON.stringify({
"switchPorts": switchPorts
})
};
data.push(obj);
$.operate.save(prefix + "/add", data);
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,100 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('修改交换机模板')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-tmplSwitch-edit" th:object="${tmplSwitch}">
<input id="switchId" name="switchId" th:field="*{switchId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">交换机品牌:</label>
<div class="col-sm-8">
<input id="switchBrand" name="switchBrand" th:field="*{switchBrand}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交换机型号:</label>
<div class="col-sm-8">
<input id="switchType" name="switchType" th:field="*{switchType}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交换机电源数量:</label>
<div class="col-sm-8">
<input id="powerNum" name="powerNum" th:field="*{powerNum}" class="form-control" min="1" type="number">
</div>
</div>
<!--端口类型字典-->
<div class="form-group" th:with="type=${@dict.getType('dict_port_type')}">
<div class="col-sm-6" th:each="dict : ${type}">
<div class="col-md-12">
<div class="form-group">
<label class="col-sm-6 control-label" th:text="${dict.dictLabel}"></label>
<div class="col-sm-5">
<input type="number" min="0" max="100" th:id="${dict.dictCode}"
class="form-control switchPort"
placeholder="单位(个)">
</div>
</div>
</div>
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" th:inline="javascript">
var prefix = ctx + "template/tmplSwitch";
$("#form-tmplSwitch-edit").validate({
onkeyup: false,
rules: {
switchBrand: {
required: true,
minlength: 1,
maxlength: 20
},
switchType: {
required: true,
minlength: 1,
maxlength: 20
},
powerNum: {
required: true,
minlength: 1,
maxlength: 2
}
},
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
var data = $('#form-tmplSwitch-edit').serializeArray();
var switchPorts = [];
$(".switchPort").each(function () {
switchPorts.push({"id": $(this).attr("id"), "value": $(this).val()});
});
var obj = {
"name": "foreignKeyInfo",
"value": JSON.stringify({
"switchPorts": switchPorts
})
};
data.push(obj);
$.operate.save(prefix + "/edit", data);
}
}
/*
* 修改时手动回显SwitchPortNum
*/
$(function () {
var switchPorts = [[${tmplSwitch}]].switchPorts;
$.each(switchPorts, function (index, port) {
$("#" + port.switchPortType).val(port.switchPortNum);
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,131 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('交换机模板列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
交换机品牌:<input type="text" name="switchBrand"/>
</li>
<li>
交换机型号:<input type="text" name="switchType"/>
</li>
<li>
交换机电源数量:<input type="text" name="powerNum"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="template:tmplSwitch:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()"
shiro:hasPermission="template:tmplSwitch:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()"
shiro:hasPermission="template:tmplSwitch:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="template:tmplSwitch:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('template:tmplSwitch:edit')}]];
var removeFlag = [[${@permission.hasPermi('template:tmplSwitch:remove')}]];
var prefix = ctx + "template/tmplSwitch";
$(function () {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "交换机模板",
showExport: true,
columns: [{
checkbox: true
},
{
field: 'switchId',
title: '交换机模板编号',
visible: false,
align: 'center'
},
{
field: 'switchBrand',
title: '交换机品牌',
sortable: true,
align: 'center'
},
{
field: 'switchType',
title: '交换机型号',
sortable: true,
align: 'center'
},
{
field: 'powerNum',
title: '交换机电源数量',
sortable: true,
align: 'center'
}
]
};
$.each([[${@dict.getType('dict_port_type')}]], function (index, dict) {
options.columns.push({
field: dict.dictCode,
title: dict.dictLabel + "(个)",
align: 'center',
formatter: function (value, row, index) {
if (row.switchPorts) {
$.each(row.switchPorts, function (index, switchPort) {
if (switchPort.switchPortType == dict.dictCode) {
value = switchPort.switchPortNum;
}
});
}
return value;
}
});
});
options.columns.push({
title: '操作',
align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.switchId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.switchId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
});
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -3,8 +3,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<artifactId>rms</artifactId>
<groupId>com.ezsvs</groupId>
<version>3.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -52,6 +52,12 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<!-- fastjson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- io常用工具类 -->
<dependency>

View File

@ -1,114 +1,113 @@
package com.ruoyi.common.core.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* Entity基类
*
*
* @author ruoyi
*/
public class BaseEntity implements Serializable
{
private static final long serialVersionUID = 1L;
public class BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
/** 搜索值 */
private String searchValue;
/** 搜索值 */
private String searchValue;
/** 创建者 */
private String createBy;
/** 创建者 */
private String createBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/** 更新者 */
private String updateBy;
/** 更新者 */
private String updateBy;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/** 备注 */
private String remark;
/** 备注 */
private String remark;
/** 请求参数 */
private Map<String, Object> params;
/** 请求参数 */
private Map<String, Object> params;
public String getSearchValue()
{
return searchValue;
}
/** 外键关联额外信息 */
@JsonIgnore
private String foreignKeyInfo;
public void setSearchValue(String searchValue)
{
this.searchValue = searchValue;
}
public String getSearchValue() {
return searchValue;
}
public String getCreateBy()
{
return createBy;
}
public void setSearchValue(String searchValue) {
this.searchValue = searchValue;
}
public void setCreateBy(String createBy)
{
this.createBy = createBy;
}
public String getCreateBy() {
return createBy;
}
public Date getCreateTime()
{
return createTime;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public void setCreateTime(Date createTime)
{
this.createTime = createTime;
}
public Date getCreateTime() {
return createTime;
}
public String getUpdateBy()
{
return updateBy;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public void setUpdateBy(String updateBy)
{
this.updateBy = updateBy;
}
public String getUpdateBy() {
return updateBy;
}
public Date getUpdateTime()
{
return updateTime;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public void setUpdateTime(Date updateTime)
{
this.updateTime = updateTime;
}
public Date getUpdateTime() {
return updateTime;
}
public String getRemark()
{
return remark;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public void setRemark(String remark)
{
this.remark = remark;
}
public String getRemark() {
return remark;
}
public Map<String, Object> getParams()
{
if (params == null)
{
params = new HashMap<>();
}
return params;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Map<String, Object> getParams() {
if (params == null) {
params = new HashMap<>();
}
return params;
}
public void setParams(Map<String, Object> params) {
this.params = params;
}
public String getForeignKeyInfo() {
return foreignKeyInfo;
}
public void setForeignKeyInfo(String foreignKeyInfo) {
this.foreignKeyInfo = foreignKeyInfo;
}
public void setParams(Map<String, Object> params)
{
this.params = params;
}
}

View File

@ -109,7 +109,7 @@ public class PermissionUtils
}
catch (Exception e)
{
log.error("Error reading property [{}] from principal of type [{}]", property,
log.error("Error reading assets [{}] from principal of type [{}]", property,
principal.getClass().getName());
}
}

View File

@ -3,8 +3,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<artifactId>rms</artifactId>
<groupId>com.ezsvs</groupId>
<version>3.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -73,7 +73,7 @@
<!-- 系统模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<groupId>com.ezsvs</groupId>
<artifactId>ruoyi-system</artifactId>
</dependency>

View File

@ -3,8 +3,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<artifactId>rms</artifactId>
<groupId>com.ezsvs</groupId>
<version>3.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -25,7 +25,7 @@
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<groupId>com.ezsvs</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>

View File

@ -2,10 +2,10 @@
# 代码生成
gen:
# 作者
author: ruoyi
author: TP
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
packageName: com.ruoyi.system
packageName: com.ruoyi.assets
# 自动去除表前缀默认是true
autoRemovePre: true
autoRemovePre: fasle
# 表前缀(类名不会包含表前缀)
tablePrefix: sys_

View File

@ -41,7 +41,7 @@
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
<script type="text/javascript" th:inline="javascript">
var prefix = ctx + "${moduleName}/${classname}";
$("#form-${classname}-edit").validate({
rules:{

View File

@ -3,8 +3,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<artifactId>rms</artifactId>
<groupId>com.ezsvs</groupId>
<version>3.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -31,7 +31,7 @@
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<groupId>com.ezsvs</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>

View File

@ -37,7 +37,7 @@ public class ScheduleConfig
prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true");
// sqlserver 启用
// prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?");
// assets.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?");
prop.put("org.quartz.jobStore.misfireThreshold", "12000");
prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_");
factory.setQuartzProperties(prop);

View File

@ -3,8 +3,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<artifactId>rms</artifactId>
<groupId>com.ezsvs</groupId>
<version>3.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -25,7 +25,7 @@
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<groupId>com.ezsvs</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>

View File

@ -0,0 +1,114 @@
package com.ruoyi.assets.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 机柜类型表 assets_cabinet
*
* @author TP
* @date 2019-06-17
*/
public class AssetsCabinet extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 机柜编号
*/
private Integer cabinetId;
/**
* 机房编号
*/
private Integer dictCode;
/**
* 机房对象
*/
private AssetsMachineRoom machineRoom;
/**
* 机柜名称
*/
private String cabinetName;
/**
* 机柜所在区域
*/
private Long cabinetArea;
/**
* 机柜可用U数
*/
private Integer cabinetAvailU;
/**
* 机柜可用电力
*/
private Integer cabinetAvailElec;
public Integer getCabinetId() {
return cabinetId;
}
public void setCabinetId(Integer cabinetId) {
this.cabinetId = cabinetId;
}
public Integer getDictCode() {
return dictCode;
}
public void setDictCode(Integer dictCode) {
this.dictCode = dictCode;
}
public AssetsMachineRoom getMachineRoom() {
return machineRoom;
}
public void setMachineRoom(AssetsMachineRoom machineRoom) {
this.machineRoom = machineRoom;
}
public String getCabinetName() {
return cabinetName;
}
public void setCabinetName(String cabinetName) {
this.cabinetName = cabinetName;
}
public Long getCabinetArea() {
return cabinetArea;
}
public void setCabinetArea(Long cabinetArea) {
this.cabinetArea = cabinetArea;
}
public Integer getCabinetAvailU() {
return cabinetAvailU;
}
public void setCabinetAvailU(Integer cabinetAvailU) {
this.cabinetAvailU = cabinetAvailU;
}
public Integer getCabinetAvailElec() {
return cabinetAvailElec;
}
public void setCabinetAvailElec(Integer cabinetAvailElec) {
this.cabinetAvailElec = cabinetAvailElec;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("cabinetId", getCabinetId())
.append("machineRoomId", getMachineRoom())
.append("cabinetName", getCabinetName())
.append("cabinetArea", getCabinetArea())
.append("cabinetAvailU", getCabinetAvailU())
.append("cabinetAvailElec", getCabinetAvailElec())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,194 @@
package com.ruoyi.assets.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.system.domain.SysDictData;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.beans.Transient;
/**
* 机房表 assets_machine_room
*
* @author TP
* @date 2019-06-17
*/
public class AssetsMachineRoom extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 机房编号
*/
private Integer machineRoomId;
/**
* 机房名称
*/
private String machineRoomName;
/**
* 带宽类型
*/
private Integer dictCode;
/**
* 带宽类型 实体关联
*/
private SysDictData bandwidthType;
/**
* 带宽大小
*/
private Integer bandwidthSize;
/**
* 所在国家
*/
private String country;
/**
* 所在省
*/
private String province;
/**
* 所在市
*/
private String city;
/**
* 所在区
*/
private String area;
/**
* 地址
*/
private String location;
/**
* 联系人
*/
private String contactPerson;
/**
* 联系电话
*/
private String contactPhone;
/**
* 邮箱
*/
private String email;
public Integer getMachineRoomId() {
return machineRoomId;
}
public void setMachineRoomId(Integer machineRoomId) {
this.machineRoomId = machineRoomId;
}
public String getMachineRoomName() {
return machineRoomName;
}
public void setMachineRoomName(String machineRoomName) {
this.machineRoomName = machineRoomName;
}
@Transient
public Integer getDictCode() {
return dictCode;
}
public void setDictCode(Integer dictCode) {
this.dictCode = dictCode;
}
public SysDictData getBandwidthType() {
return bandwidthType;
}
public void setBandwidthType(SysDictData bandwidthType) {
this.bandwidthType = bandwidthType;
}
public Integer getBandwidthSize() {
return bandwidthSize;
}
public void setBandwidthSize(Integer bandwidthSize) {
this.bandwidthSize = bandwidthSize;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getArea() {
return area;
}
public void setArea(String area) {
this.area = area;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getContactPerson() {
return contactPerson;
}
public void setContactPerson(String contactPerson) {
this.contactPerson = contactPerson;
}
public String getContactPhone() {
return contactPhone;
}
public void setContactPhone(String contactPhone) {
this.contactPhone = contactPhone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("machineRoomId", getMachineRoomId())
.append("machineRoomName", getMachineRoomName())
.append("bandwidthType", getBandwidthType())
.append("bandwidthSize", getBandwidthSize())
.append("country", getCountry())
.append("province", getProvince())
.append("city", getCity())
.append("area", getArea())
.append("location", getLocation())
.append("contactPerson", getContactPerson())
.append("contactPhone", getContactPhone())
.append("email", getEmail())
.toString();
}
}

View File

@ -0,0 +1,62 @@
package com.ruoyi.assets.mapper;
import com.ruoyi.assets.domain.AssetsCabinet;
import java.util.List;
/**
* 机柜类型 数据层
*
* @author TP
* @date 2019-06-17
*/
public interface AssetsCabinetMapper {
/**
* 查询机柜类型信息
*
* @param cabinetId 机柜类型ID
* @return 机柜类型信息
*/
public AssetsCabinet selectAssetsCabinetById(Integer cabinetId);
/**
* 查询机柜类型列表
*
* @param assetsCabinet 机柜类型信息
* @return 机柜类型集合
*/
public List<AssetsCabinet> selectAssetsCabinetList(AssetsCabinet assetsCabinet);
/**
* 新增机柜类型
*
* @param assetsCabinet 机柜类型信息
* @return 结果
*/
public int insertAssetsCabinet(AssetsCabinet assetsCabinet);
/**
* 修改机柜类型
*
* @param assetsCabinet 机柜类型信息
* @return 结果
*/
public int updateAssetsCabinet(AssetsCabinet assetsCabinet);
/**
* 删除机柜类型
*
* @param cabinetId 机柜类型ID
* @return 结果
*/
public int deleteAssetsCabinetById(Integer cabinetId);
/**
* 批量删除机柜类型
*
* @param cabinetIds 需要删除的数据ID
* @return 结果
*/
public int deleteAssetsCabinetByIds(String[] cabinetIds);
}

View File

@ -0,0 +1,62 @@
package com.ruoyi.assets.mapper;
import com.ruoyi.assets.domain.AssetsMachineRoom;
import java.util.List;
/**
* 机房 数据层
*
* @author TP
* @date 2019-06-17
*/
public interface AssetsMachineRoomMapper {
/**
* 查询机房信息
*
* @param machineRoomId 机房ID
* @return 机房信息
*/
public AssetsMachineRoom selectAssetsMachineRoomById(Integer machineRoomId);
/**
* 查询机房列表
*
* @param assetsMachineRoom 机房信息
* @return 机房集合
*/
public List<AssetsMachineRoom> selectAssetsMachineRoomList(AssetsMachineRoom assetsMachineRoom);
/**
* 新增机房
*
* @param assetsMachineRoom 机房信息
* @return 结果
*/
public int insertAssetsMachineRoom(AssetsMachineRoom assetsMachineRoom);
/**
* 修改机房
*
* @param assetsMachineRoom 机房信息
* @return 结果
*/
public int updateAssetsMachineRoom(AssetsMachineRoom assetsMachineRoom);
/**
* 删除机房
*
* @param machineRoomId 机房ID
* @return 结果
*/
public int deleteAssetsMachineRoomById(Integer machineRoomId);
/**
* 批量删除机房
*
* @param machineRoomIds 需要删除的数据ID
* @return 结果
*/
public int deleteAssetsMachineRoomByIds(String[] machineRoomIds);
}

View File

@ -0,0 +1,54 @@
package com.ruoyi.assets.service;
import com.ruoyi.assets.domain.AssetsCabinet;
import java.util.List;
/**
* 机柜类型 服务层
*
* @author TP
* @date 2019-06-17
*/
public interface IAssetsCabinetService {
/**
* 查询机柜类型信息
*
* @param cabinetId 机柜类型ID
* @return 机柜类型信息
*/
public AssetsCabinet selectAssetsCabinetById(Integer cabinetId);
/**
* 查询机柜类型列表
*
* @param assetsCabinet 机柜类型信息
* @return 机柜类型集合
*/
public List<AssetsCabinet> selectAssetsCabinetList(AssetsCabinet assetsCabinet);
/**
* 新增机柜类型
*
* @param assetsCabinet 机柜类型信息
* @return 结果
*/
public int insertAssetsCabinet(AssetsCabinet assetsCabinet);
/**
* 修改机柜类型
*
* @param assetsCabinet 机柜类型信息
* @return 结果
*/
public int updateAssetsCabinet(AssetsCabinet assetsCabinet);
/**
* 删除机柜类型信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteAssetsCabinetByIds(String ids);
}

View File

@ -0,0 +1,54 @@
package com.ruoyi.assets.service;
import com.ruoyi.assets.domain.AssetsMachineRoom;
import java.util.List;
/**
* 机房 服务层
*
* @author TP
* @date 2019-06-17
*/
public interface IAssetsMachineRoomService {
/**
* 查询机房信息
*
* @param machineRoomId 机房ID
* @return 机房信息
*/
public AssetsMachineRoom selectAssetsMachineRoomById(Integer machineRoomId);
/**
* 查询机房列表
*
* @param assetsMachineRoom 机房信息
* @return 机房集合
*/
public List<AssetsMachineRoom> selectAssetsMachineRoomList(AssetsMachineRoom assetsMachineRoom);
/**
* 新增机房
*
* @param assetsMachineRoom 机房信息
* @return 结果
*/
public int insertAssetsMachineRoom(AssetsMachineRoom assetsMachineRoom);
/**
* 修改机房
*
* @param assetsMachineRoom 机房信息
* @return 结果
*/
public int updateAssetsMachineRoom(AssetsMachineRoom assetsMachineRoom);
/**
* 删除机房信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteAssetsMachineRoomByIds(String ids);
}

View File

@ -0,0 +1,78 @@
package com.ruoyi.assets.service.impl;
import com.ruoyi.assets.domain.AssetsCabinet;
import com.ruoyi.assets.mapper.AssetsCabinetMapper;
import com.ruoyi.assets.service.IAssetsCabinetService;
import com.ruoyi.common.core.text.Convert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 机柜类型 服务层实现
*
* @author TP
* @date 2019-06-17
*/
@Service
public class AssetsCabinetServiceImpl implements IAssetsCabinetService {
@Autowired
private AssetsCabinetMapper assetsCabinetMapper;
/**
* 查询机柜类型信息
*
* @param cabinetId 机柜类型ID
* @return 机柜类型信息
*/
@Override
public AssetsCabinet selectAssetsCabinetById(Integer cabinetId) {
return assetsCabinetMapper.selectAssetsCabinetById(cabinetId);
}
/**
* 查询机柜类型列表
*
* @param assetsCabinet 机柜类型信息
* @return 机柜类型集合
*/
@Override
public List<AssetsCabinet> selectAssetsCabinetList(AssetsCabinet assetsCabinet) {
return assetsCabinetMapper.selectAssetsCabinetList(assetsCabinet);
}
/**
* 新增机柜类型
*
* @param assetsCabinet 机柜类型信息
* @return 结果
*/
@Override
public int insertAssetsCabinet(AssetsCabinet assetsCabinet) {
return assetsCabinetMapper.insertAssetsCabinet(assetsCabinet);
}
/**
* 修改机柜类型
*
* @param assetsCabinet 机柜类型信息
* @return 结果
*/
@Override
public int updateAssetsCabinet(AssetsCabinet assetsCabinet) {
return assetsCabinetMapper.updateAssetsCabinet(assetsCabinet);
}
/**
* 删除机柜类型对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteAssetsCabinetByIds(String ids) {
return assetsCabinetMapper.deleteAssetsCabinetByIds(Convert.toStrArray(ids));
}
}

View File

@ -0,0 +1,78 @@
package com.ruoyi.assets.service.impl;
import com.ruoyi.assets.domain.AssetsMachineRoom;
import com.ruoyi.assets.mapper.AssetsMachineRoomMapper;
import com.ruoyi.assets.service.IAssetsMachineRoomService;
import com.ruoyi.common.core.text.Convert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 机房 服务层实现
*
* @author TP
* @date 2019-06-17
*/
@Service
public class AssetsMachineRoomServiceImpl implements IAssetsMachineRoomService {
@Autowired
private AssetsMachineRoomMapper assetsMachineRoomMapper;
/**
* 查询机房信息
*
* @param machineRoomId 机房ID
* @return 机房信息
*/
@Override
public AssetsMachineRoom selectAssetsMachineRoomById(Integer machineRoomId) {
return assetsMachineRoomMapper.selectAssetsMachineRoomById(machineRoomId);
}
/**
* 查询机房列表
*
* @param assetsMachineRoom 机房信息
* @return 机房集合
*/
@Override
public List<AssetsMachineRoom> selectAssetsMachineRoomList(AssetsMachineRoom assetsMachineRoom) {
return assetsMachineRoomMapper.selectAssetsMachineRoomList(assetsMachineRoom);
}
/**
* 新增机房
*
* @param assetsMachineRoom 机房信息
* @return 结果
*/
@Override
public int insertAssetsMachineRoom(AssetsMachineRoom assetsMachineRoom) {
return assetsMachineRoomMapper.insertAssetsMachineRoom(assetsMachineRoom);
}
/**
* 修改机房
*
* @param assetsMachineRoom 机房信息
* @return 结果
*/
@Override
public int updateAssetsMachineRoom(AssetsMachineRoom assetsMachineRoom) {
return assetsMachineRoomMapper.updateAssetsMachineRoom(assetsMachineRoom);
}
/**
* 删除机房对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteAssetsMachineRoomByIds(String ids) {
return assetsMachineRoomMapper.deleteAssetsMachineRoomByIds(Convert.toStrArray(ids));
}
}

View File

@ -0,0 +1,109 @@
package com.ruoyi.network.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.system.domain.SysDictData;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 网络IP表 net_ip_address
*
* @author TP
* @date 2019-06-15
*/
public class NetIpAddress extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* IP地址编号
*/
private Integer ipAddressId;
/**
* IP地址类型
*/
private Integer dictCode;
/**
* IP地址类型 实体关联
*/
private SysDictData ipAddressType;
/**
* IP地址段
*/
private String ipAddressSection;
/**
* 所属机房编号
*/
private Integer machineRoomId;
/**
* IP使用规则
*/
private String ipUseRule;
/**
* IP地址分配规则
*/
private String ipAllocRule;
public Integer getIpAddressId() {
return ipAddressId;
}
public void setIpAddressId(Integer ipAddressId) {
this.ipAddressId = ipAddressId;
}
public Integer getDictCode() {
return dictCode;
}
public void setDictCode(Integer dictCode) {
this.dictCode = dictCode;
}
public SysDictData getIpAddressType() {
return ipAddressType;
}
public void setIpAddressType(SysDictData ipAddressType) {
this.ipAddressType = ipAddressType;
}
public String getIpAddressSection() {
return ipAddressSection;
}
public void setIpAddressSection(String ipAddressSection) {
this.ipAddressSection = ipAddressSection;
}
public Integer getMachineRoomId() {
return machineRoomId;
}
public void setMachineRoomId(Integer machineRoomId) {
this.machineRoomId = machineRoomId;
}
public String getIpUseRule() {
return ipUseRule;
}
public void setIpUseRule(String ipUseRule) {
this.ipUseRule = ipUseRule;
}
public String getIpAllocRule() {
return ipAllocRule;
}
public void setIpAllocRule(String ipAllocRule) {
this.ipAllocRule = ipAllocRule;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("ipAddressId", getIpAddressId())
.append("ipAddressType", getIpAddressType()).append("ipAddressSection", getIpAddressSection())
.append("machineRoomId", getMachineRoomId()).append("ipUseRule", getIpUseRule())
.append("ipAllocRule", getIpAllocRule()).toString();
}
}

View File

@ -0,0 +1,62 @@
package com.ruoyi.network.mapper;
import com.ruoyi.network.domain.NetIpAddress;
import java.util.List;
/**
* 网络IP 数据层
*
* @author TP
* @date 2019-06-15
*/
public interface NetIpAddressMapper
{
/**
* 查询网络IP信息
*
* @param ipAddressId 网络IPID
* @return 网络IP信息
*/
public NetIpAddress selectNetIpAddressById(Integer ipAddressId);
/**
* 查询网络IP列表
*
* @param netIpAddress 网络IP信息
* @return 网络IP集合
*/
public List<NetIpAddress> selectNetIpAddressList(NetIpAddress netIpAddress);
/**
* 新增网络IP
*
* @param netIpAddress 网络IP信息
* @return 结果
*/
public int insertNetIpAddress(NetIpAddress netIpAddress);
/**
* 修改网络IP
*
* @param netIpAddress 网络IP信息
* @return 结果
*/
public int updateNetIpAddress(NetIpAddress netIpAddress);
/**
* 删除网络IP
*
* @param ipAddressId 网络IPID
* @return 结果
*/
public int deleteNetIpAddressById(Integer ipAddressId);
/**
* 批量删除网络IP
*
* @param ipAddressIds 需要删除的数据ID
* @return 结果
*/
public int deleteNetIpAddressByIds(String[] ipAddressIds);
}

View File

@ -0,0 +1,54 @@
package com.ruoyi.network.service;
import com.ruoyi.network.domain.NetIpAddress;
import java.util.List;
/**
* 网络IP 服务层
*
* @author TP
* @date 2019-06-15
*/
public interface INetIpAddressService
{
/**
* 查询网络IP信息
*
* @param ipAddressId 网络IPID
* @return 网络IP信息
*/
public NetIpAddress selectNetIpAddressById(Integer ipAddressId);
/**
* 查询网络IP列表
*
* @param netIpAddress 网络IP信息
* @return 网络IP集合
*/
public List<NetIpAddress> selectNetIpAddressList(NetIpAddress netIpAddress);
/**
* 新增网络IP
*
* @param netIpAddress 网络IP信息
* @return 结果
*/
public int insertNetIpAddress(NetIpAddress netIpAddress);
/**
* 修改网络IP
*
* @param netIpAddress 网络IP信息
* @return 结果
*/
public int updateNetIpAddress(NetIpAddress netIpAddress);
/**
* 删除网络IP信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteNetIpAddressByIds(String ids);
}

View File

@ -0,0 +1,84 @@
package com.ruoyi.network.service.impl;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.network.domain.NetIpAddress;
import com.ruoyi.network.mapper.NetIpAddressMapper;
import com.ruoyi.network.service.INetIpAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 网络IP 服务层实现
*
* @author TP
* @date 2019-06-15
*/
@Service
public class NetIpAddressServiceImpl implements INetIpAddressService
{
@Autowired
private NetIpAddressMapper netIpAddressMapper;
/**
* 查询网络IP信息
*
* @param ipAddressId 网络IPID
* @return 网络IP信息
*/
@Override
public NetIpAddress selectNetIpAddressById(Integer ipAddressId)
{
return netIpAddressMapper.selectNetIpAddressById(ipAddressId);
}
/**
* 查询网络IP列表
*
* @param netIpAddress 网络IP信息
* @return 网络IP集合
*/
@Override
public List<NetIpAddress> selectNetIpAddressList(NetIpAddress netIpAddress)
{
return netIpAddressMapper.selectNetIpAddressList(netIpAddress);
}
/**
* 新增网络IP
*
* @param netIpAddress 网络IP信息
* @return 结果
*/
@Override
public int insertNetIpAddress(NetIpAddress netIpAddress)
{
return netIpAddressMapper.insertNetIpAddress(netIpAddress);
}
/**
* 修改网络IP
*
* @param netIpAddress 网络IP信息
* @return 结果
*/
@Override
public int updateNetIpAddress(NetIpAddress netIpAddress)
{
return netIpAddressMapper.updateNetIpAddress(netIpAddress);
}
/**
* 删除网络IP对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteNetIpAddressByIds(String ids)
{
return netIpAddressMapper.deleteNetIpAddressByIds(Convert.toStrArray(ids));
}
}

View File

@ -1,19 +1,19 @@
package com.ruoyi.system.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.system.domain.SysDictData;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 字典表 数据层
*
*
* @author ruoyi
*/
public interface SysDictDataMapper
{
public interface SysDictDataMapper {
/**
* 根据条件分页查询字典数据
*
*
* @param dictData 字典数据信息
* @return 字典数据集合信息
*/
@ -21,7 +21,7 @@ public interface SysDictDataMapper
/**
* 根据字典类型查询字典数据
*
*
* @param dictType 字典类型
* @return 字典数据集合信息
*/
@ -29,8 +29,8 @@ public interface SysDictDataMapper
/**
* 根据字典类型和字典键值查询字典数据信息
*
* @param dictType 字典类型
*
* @param dictType 字典类型
* @param dictValue 字典键值
* @return 字典标签
*/
@ -38,7 +38,7 @@ public interface SysDictDataMapper
/**
* 根据字典数据ID查询信息
*
*
* @param dictCode 字典数据ID
* @return 字典数据
*/
@ -46,7 +46,7 @@ public interface SysDictDataMapper
/**
* 查询字典数据
*
*
* @param dictType 字典类型
* @return 字典数据
*/
@ -54,7 +54,7 @@ public interface SysDictDataMapper
/**
* 通过字典ID删除字典数据信息
*
*
* @param dictCode 字典数据ID
* @return 结果
*/
@ -62,7 +62,7 @@ public interface SysDictDataMapper
/**
* 批量删除字典数据
*
*
* @param ids 需要删除的数据
* @return 结果
*/
@ -70,7 +70,7 @@ public interface SysDictDataMapper
/**
* 新增字典数据信息
*
*
* @param dictData 字典数据信息
* @return 结果
*/
@ -78,7 +78,7 @@ public interface SysDictDataMapper
/**
* 修改字典数据信息
*
*
* @param dictData 字典数据信息
* @return 结果
*/
@ -86,7 +86,7 @@ public interface SysDictDataMapper
/**
* 同步修改字典类型
*
*
* @param oldDictType 旧字典类型
* @param newDictType 新旧字典类型
* @return 结果

View File

@ -1,39 +1,31 @@
package com.ruoyi.system.service.impl;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.security.Md5Utils;
import com.ruoyi.system.domain.SysPost;
import com.ruoyi.system.domain.SysRole;
import com.ruoyi.system.domain.SysUser;
import com.ruoyi.system.domain.SysUserPost;
import com.ruoyi.system.domain.SysUserRole;
import com.ruoyi.system.mapper.SysPostMapper;
import com.ruoyi.system.mapper.SysRoleMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.mapper.SysUserPostMapper;
import com.ruoyi.system.mapper.SysUserRoleMapper;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.mapper.*;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ISysUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
* 用户 业务层处理
*
*
* @author ruoyi
*/
@Service
public class SysUserServiceImpl implements ISysUserService
{
public class SysUserServiceImpl implements ISysUserService {
private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
@Autowired
@ -56,98 +48,90 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 根据条件分页查询用户列表
*
*
* @param user 用户信息
* @return 用户信息集合信息
*/
@Override
@DataScope(tableAlias = "u")
public List<SysUser> selectUserList(SysUser user)
{
public List<SysUser> selectUserList(SysUser user) {
return userMapper.selectUserList(user);
}
/**
* 根据条件分页查询已分配用户角色列表
*
*
* @param user 用户信息
* @return 用户信息集合信息
*/
@DataScope(tableAlias = "u")
public List<SysUser> selectAllocatedList(SysUser user)
{
public List<SysUser> selectAllocatedList(SysUser user) {
return userMapper.selectAllocatedList(user);
}
/**
* 根据条件分页查询未分配用户角色列表
*
*
* @param user 用户信息
* @return 用户信息集合信息
*/
@DataScope(tableAlias = "u")
public List<SysUser> selectUnallocatedList(SysUser user)
{
public List<SysUser> selectUnallocatedList(SysUser user) {
return userMapper.selectUnallocatedList(user);
}
/**
* 通过用户名查询用户
*
*
* @param userName 用户名
* @return 用户对象信息
*/
@Override
public SysUser selectUserByLoginName(String userName)
{
public SysUser selectUserByLoginName(String userName) {
return userMapper.selectUserByLoginName(userName);
}
/**
* 通过手机号码查询用户
*
*
* @param phoneNumber 手机号码
* @return 用户对象信息
*/
@Override
public SysUser selectUserByPhoneNumber(String phoneNumber)
{
public SysUser selectUserByPhoneNumber(String phoneNumber) {
return userMapper.selectUserByPhoneNumber(phoneNumber);
}
/**
* 通过邮箱查询用户
*
*
* @param email 邮箱
* @return 用户对象信息
*/
@Override
public SysUser selectUserByEmail(String email)
{
public SysUser selectUserByEmail(String email) {
return userMapper.selectUserByEmail(email);
}
/**
* 通过用户ID查询用户
*
*
* @param userId 用户ID
* @return 用户对象信息
*/
@Override
public SysUser selectUserById(Long userId)
{
public SysUser selectUserById(Long userId) {
return userMapper.selectUserById(userId);
}
/**
* 通过用户ID删除用户
*
*
* @param userId 用户ID
* @return 结果
*/
@Override
public int deleteUserById(Long userId)
{
public int deleteUserById(Long userId) {
// 删除用户与角色关联
userRoleMapper.deleteUserRoleByUserId(userId);
// 删除用户与岗位表
@ -157,18 +141,15 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 批量删除用户信息
*
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteUserByIds(String ids) throws BusinessException
{
public int deleteUserByIds(String ids) throws BusinessException {
Long[] userIds = Convert.toLongArray(ids);
for (Long userId : userIds)
{
if (SysUser.isAdmin(userId))
{
for (Long userId : userIds) {
if (SysUser.isAdmin(userId)) {
throw new BusinessException("不允许删除超级管理员用户");
}
}
@ -177,14 +158,13 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 新增保存用户信息
*
*
* @param user 用户信息
* @return 结果
*/
@Override
@Transactional
public int insertUser(SysUser user)
{
public int insertUser(SysUser user) {
// 新增用户信息
int rows = userMapper.insertUser(user);
// 新增用户岗位关联
@ -196,14 +176,13 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 修改保存用户信息
*
*
* @param user 用户信息
* @return 结果
*/
@Override
@Transactional
public int updateUser(SysUser user)
{
public int updateUser(SysUser user) {
Long userId = user.getUserId();
// 删除用户与角色关联
userRoleMapper.deleteUserRoleByUserId(userId);
@ -218,49 +197,43 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 修改用户个人详细信息
*
*
* @param user 用户信息
* @return 结果
*/
@Override
public int updateUserInfo(SysUser user)
{
public int updateUserInfo(SysUser user) {
return userMapper.updateUser(user);
}
/**
* 修改用户密码
*
*
* @param user 用户信息
* @return 结果
*/
@Override
public int resetUserPwd(SysUser user)
{
public int resetUserPwd(SysUser user) {
return updateUserInfo(user);
}
/**
* 新增用户角色信息
*
*
* @param user 用户对象
*/
public void insertUserRole(SysUser user)
{
public void insertUserRole(SysUser user) {
Long[] roles = user.getRoleIds();
if (StringUtils.isNotNull(roles))
{
if (StringUtils.isNotNull(roles)) {
// 新增用户与角色管理
List<SysUserRole> list = new ArrayList<SysUserRole>();
for (Long roleId : roles)
{
for (Long roleId : roles) {
SysUserRole ur = new SysUserRole();
ur.setUserId(user.getUserId());
ur.setRoleId(roleId);
list.add(ur);
}
if (list.size() > 0)
{
if (list.size() > 0) {
userRoleMapper.batchUserRole(list);
}
}
@ -268,25 +241,21 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 新增用户岗位信息
*
*
* @param user 用户对象
*/
public void insertUserPost(SysUser user)
{
public void insertUserPost(SysUser user) {
Long[] posts = user.getPostIds();
if (StringUtils.isNotNull(posts))
{
if (StringUtils.isNotNull(posts)) {
// 新增用户与岗位管理
List<SysUserPost> list = new ArrayList<SysUserPost>();
for (Long postId : posts)
{
for (Long postId : posts) {
SysUserPost up = new SysUserPost();
up.setUserId(user.getUserId());
up.setPostId(postId);
list.add(up);
}
if (list.size() > 0)
{
if (list.size() > 0) {
userPostMapper.batchUserPost(list);
}
}
@ -294,16 +263,14 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 校验登录名称是否唯一
*
*
* @param loginName 用户名
* @return
*/
@Override
public String checkLoginNameUnique(String loginName)
{
public String checkLoginNameUnique(String loginName) {
int count = userMapper.checkLoginNameUnique(loginName);
if (count > 0)
{
if (count > 0) {
return UserConstants.USER_NAME_NOT_UNIQUE;
}
return UserConstants.USER_NAME_UNIQUE;
@ -316,12 +283,10 @@ public class SysUserServiceImpl implements ISysUserService
* @return
*/
@Override
public String checkPhoneUnique(SysUser user)
{
public String checkPhoneUnique(SysUser user) {
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber());
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
{
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
return UserConstants.USER_PHONE_NOT_UNIQUE;
}
return UserConstants.USER_PHONE_UNIQUE;
@ -334,12 +299,10 @@ public class SysUserServiceImpl implements ISysUserService
* @return
*/
@Override
public String checkEmailUnique(SysUser user)
{
public String checkEmailUnique(SysUser user) {
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
SysUser info = userMapper.checkEmailUnique(user.getEmail());
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
{
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
return UserConstants.USER_EMAIL_NOT_UNIQUE;
}
return UserConstants.USER_EMAIL_UNIQUE;
@ -347,21 +310,18 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 查询用户所属角色组
*
*
* @param userId 用户ID
* @return 结果
*/
@Override
public String selectUserRoleGroup(Long userId)
{
public String selectUserRoleGroup(Long userId) {
List<SysRole> list = roleMapper.selectRolesByUserId(userId);
StringBuffer idsStr = new StringBuffer();
for (SysRole role : list)
{
for (SysRole role : list) {
idsStr.append(role.getRoleName()).append(",");
}
if (StringUtils.isNotEmpty(idsStr.toString()))
{
if (StringUtils.isNotEmpty(idsStr.toString())) {
return idsStr.substring(0, idsStr.length() - 1);
}
return idsStr.toString();
@ -369,21 +329,18 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 查询用户所属岗位组
*
*
* @param userId 用户ID
* @return 结果
*/
@Override
public String selectUserPostGroup(Long userId)
{
public String selectUserPostGroup(Long userId) {
List<SysPost> list = postMapper.selectPostsByUserId(userId);
StringBuffer idsStr = new StringBuffer();
for (SysPost post : list)
{
for (SysPost post : list) {
idsStr.append(post.getPostName()).append(",");
}
if (StringUtils.isNotEmpty(idsStr.toString()))
{
if (StringUtils.isNotEmpty(idsStr.toString())) {
return idsStr.substring(0, idsStr.length() - 1);
}
return idsStr.toString();
@ -391,17 +348,15 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 导入用户数据
*
* @param userList 用户数据列表
*
* @param userList 用户数据列表
* @param isUpdateSupport 是否更新支持如果已存在则进行更新数据
* @param operName 操作用户
* @param operName 操作用户
* @return 结果
*/
@Override
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName)
{
if (StringUtils.isNull(userList) || userList.size() == 0)
{
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName) {
if (StringUtils.isNull(userList) || userList.size() == 0) {
throw new BusinessException("导入用户数据不能为空!");
}
int successNum = 0;
@ -409,48 +364,36 @@ public class SysUserServiceImpl implements ISysUserService
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
String password = configService.selectConfigByKey("sys.user.initPassword");
for (SysUser user : userList)
{
try
{
for (SysUser user : userList) {
try {
// 验证是否存在这个用户
SysUser u = userMapper.selectUserByLoginName(user.getLoginName());
if (StringUtils.isNull(u))
{
if (StringUtils.isNull(u)) {
user.setPassword(Md5Utils.hash(user.getLoginName() + password));
user.setCreateBy(operName);
this.insertUser(user);
successNum++;
successMsg.append("<br/>" + successNum + "、账号 " + user.getLoginName() + " 导入成功");
}
else if (isUpdateSupport)
{
} else if (isUpdateSupport) {
user.setUpdateBy(operName);
this.updateUser(user);
successNum++;
successMsg.append("<br/>" + successNum + "、账号 " + user.getLoginName() + " 更新成功");
}
else
{
} else {
failureNum++;
failureMsg.append("<br/>" + failureNum + "、账号 " + user.getLoginName() + " 已存在");
}
}
catch (Exception e)
{
} catch (Exception e) {
failureNum++;
String msg = "<br/>" + failureNum + "、账号 " + user.getLoginName() + " 导入失败:";
failureMsg.append(msg + e.getMessage());
log.error(msg, e);
}
}
if (failureNum > 0)
{
if (failureNum > 0) {
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
throw new BusinessException(failureMsg.toString());
}
else
{
} else {
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
}
return successMsg.toString();
@ -458,15 +401,13 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 用户状态修改
*
*
* @param user 用户信息
* @return 结果
*/
@Override
public int changeStatus(SysUser user)
{
if (SysUser.isAdmin(user.getUserId()))
{
public int changeStatus(SysUser user) {
if (SysUser.isAdmin(user.getUserId())) {
throw new BusinessException("不允许修改超级管理员用户");
}
return userMapper.updateUser(user);

View File

@ -0,0 +1,164 @@
package com.ruoyi.template.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.List;
/**
* 服务器模板表 tmpl_server
*
* @author TP
* @date 2019-06-12
*/
public class TmplServer extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 服务器模板编号
*/
private Integer serverId;
/**
* 服务器品牌
*/
private String serverBrand;
/**
* 服务器型号
*/
private String serverType;
/**
* CPU主频
*/
private String cpuFreq;
/**
* CPU数量
*/
private Integer cpuNum;
/**
* IPMI端口
*/
private Integer ipmiPort;
/**
* 服务器电源数量
*/
private Integer powerNum;
/**
* 服务器raid卡
*/
private String raidCard;
/**
* 服务器网卡类型
*/
private List<TmplServerNetcard> serverNetcards;
/**
* 服务器硬盘类型
*/
private List<TmplServerDisk> serverDisks;
/**
* 服务器内存类型
*/
private List<TmplServerMemory> serverMemorys;
public Integer getServerId() {
return serverId;
}
public void setServerId(Integer serverId) {
this.serverId = serverId;
}
public String getServerBrand() {
return serverBrand;
}
public void setServerBrand(String serverBrand) {
this.serverBrand = serverBrand;
}
public String getServerType() {
return serverType;
}
public void setServerType(String serverType) {
this.serverType = serverType;
}
public String getCpuFreq() {
return cpuFreq;
}
public void setCpuFreq(String cpuFreq) {
this.cpuFreq = cpuFreq;
}
public Integer getCpuNum() {
return cpuNum;
}
public void setCpuNum(Integer cpuNum) {
this.cpuNum = cpuNum;
}
public Integer getIpmiPort() {
return ipmiPort;
}
public void setIpmiPort(Integer ipmiPort) {
this.ipmiPort = ipmiPort;
}
public Integer getPowerNum() {
return powerNum;
}
public void setPowerNum(Integer powerNum) {
this.powerNum = powerNum;
}
public String getRaidCard() {
return raidCard;
}
public void setRaidCard(String raidCard) {
this.raidCard = raidCard;
}
public List<TmplServerNetcard> getServerNetcards() {
return serverNetcards;
}
public void setServerNetcards(List<TmplServerNetcard> serverNetcards) {
this.serverNetcards = serverNetcards;
}
public List<TmplServerDisk> getServerDisks() {
return serverDisks;
}
public void setServerDisks(List<TmplServerDisk> serverDisks) {
this.serverDisks = serverDisks;
}
public List<TmplServerMemory> getServerMemorys() {
return serverMemorys;
}
public void setServerMemorys(List<TmplServerMemory> serverMemorys) {
this.serverMemorys = serverMemorys;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("serverId", getServerId())
.append("serverBrand", getServerBrand())
.append("serverType", getServerType())
.append("cpuFreq", getCpuFreq())
.append("cpuNum", getCpuNum())
.append("ipmiPort", getIpmiPort())
.append("powerNum", getPowerNum())
.append("raidCard", getRaidCard())
.toString();
}
}

View File

@ -0,0 +1,74 @@
package com.ruoyi.template.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 服务器硬盘类型表 tmpl_server_disk
*
* @author TP
* @date 2019-06-14
*/
public class TmplServerDisk extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 服务器硬盘编号
*/
private Integer serverDiskId;
/**
* 服务器编号
*/
private Integer serverId;
/**
* 服务器硬盘类型
*/
private Long serverDiskType;
/**
* 服务器网卡数量
*/
private Integer serverDiskNum;
public Integer getServerDiskId() {
return serverDiskId;
}
public void setServerDiskId(Integer serverDiskId) {
this.serverDiskId = serverDiskId;
}
public Integer getServerId() {
return serverId;
}
public void setServerId(Integer serverId) {
this.serverId = serverId;
}
public Long getServerDiskType() {
return serverDiskType;
}
public void setServerDiskType(Long serverDiskType) {
this.serverDiskType = serverDiskType;
}
public Integer getServerDiskNum() {
return serverDiskNum;
}
public void setServerDiskNum(Integer serverDiskNum) {
this.serverDiskNum = serverDiskNum;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("serverDiskId", getServerDiskId())
.append("serverId", getServerId())
.append("serverDiskType", getServerDiskType())
.append("serverDiskNum", getServerDiskNum())
.toString();
}
}

View File

@ -0,0 +1,75 @@
package com.ruoyi.template.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.system.domain.SysDictData;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 服务器内存类型表 tmpl_server_memory
*
* @author TP
* @date 2019-06-16
*/
public class TmplServerMemory extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 服务器内存编号
*/
private Integer serverMemoryId;
/**
* 服务器编号
*/
private Integer serverId;
/**
* 服务器内存类型
*/
private SysDictData serverMemoryType;
/**
* 服务器内存数量
*/
private Integer serverMemoryNum;
public Integer getServerMemoryId() {
return serverMemoryId;
}
public void setServerMemoryId(Integer serverMemoryId) {
this.serverMemoryId = serverMemoryId;
}
public Integer getServerId() {
return serverId;
}
public void setServerId(Integer serverId) {
this.serverId = serverId;
}
public SysDictData getServerMemoryType() {
return serverMemoryType;
}
public void setServerMemoryType(SysDictData serverMemoryType) {
this.serverMemoryType = serverMemoryType;
}
public Integer getServerMemoryNum() {
return serverMemoryNum;
}
public void setServerMemoryNum(Integer serverMemoryNum) {
this.serverMemoryNum = serverMemoryNum;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("serverMemoryId", getServerMemoryId())
.append("serverId", getServerId())
.append("serverMemoryType", getServerMemoryType())
.append("serverMemoryNum", getServerMemoryNum())
.toString();
}
}

View File

@ -0,0 +1,71 @@
package com.ruoyi.template.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 服务器网卡类型表 tmpl_server_netcard
*
* @author TP
* @date 2019-06-14
*/
public class TmplServerNetcard extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 服务器网卡编号 */
private Integer serverNetcardId;
/** 服务器编号 */
private Integer serverId;
/** 服务器网卡类型 */
private Long serverNetcardType;
/** 服务器网卡数量 */
private Integer serverNetcardNum;
public void setServerNetcardId(Integer serverNetcardId)
{
this.serverNetcardId = serverNetcardId;
}
public Integer getServerNetcardId()
{
return serverNetcardId;
}
public void setServerId(Integer serverId)
{
this.serverId = serverId;
}
public Integer getServerId()
{
return serverId;
}
public void setServerNetcardType(Long serverNetcardType)
{
this.serverNetcardType = serverNetcardType;
}
public Long getServerNetcardType()
{
return serverNetcardType;
}
public void setServerNetcardNum(Integer serverNetcardNum)
{
this.serverNetcardNum = serverNetcardNum;
}
public Integer getServerNetcardNum()
{
return serverNetcardNum;
}
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("serverNetcardId", getServerNetcardId())
.append("serverId", getServerId())
.append("serverNetcardType", getServerNetcardType())
.append("serverNetcardNum", getServerNetcardNum())
.toString();
}
}

View File

@ -0,0 +1,91 @@
package com.ruoyi.template.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.List;
/**
* 交换机模板表 tmpl_switch
*
* @author TP
* @date 2019-06-12
*/
public class TmplSwitch extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 交换机模板编号
*/
private Integer switchId;
/**
* 交换机品牌
*/
private String switchBrand;
/**
* 交换机型号
*/
private String switchType;
/**
* 交换机电源数量
*/
private Integer powerNum;
/**
* 交换机端口类型
*/
private List<TmplSwitchPort> switchPorts;
public Integer getSwitchId() {
return switchId;
}
public void setSwitchId(Integer switchId) {
this.switchId = switchId;
}
public String getSwitchBrand() {
return switchBrand;
}
public void setSwitchBrand(String switchBrand) {
this.switchBrand = switchBrand;
}
public String getSwitchType() {
return switchType;
}
public void setSwitchType(String switchType) {
this.switchType = switchType;
}
public Integer getPowerNum() {
return powerNum;
}
public void setPowerNum(Integer powerNum) {
this.powerNum = powerNum;
}
public List<TmplSwitchPort> getSwitchPorts() {
return switchPorts;
}
public void setSwitchPorts(List<TmplSwitchPort> switchPorts) {
this.switchPorts = switchPorts;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("switchId", getSwitchId())
.append("switchBrand", getSwitchBrand())
.append("switchType", getSwitchType())
.append("powerNum", getPowerNum())
.append("switchPorts", getSwitchPorts())
.toString();
}
}

View File

@ -0,0 +1,74 @@
package com.ruoyi.template.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 交换机端口类型表 tmpl_switch_port
*
* @author TP
* @date 2019-06-12
*/
public class TmplSwitchPort extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 交换机端口编号
*/
private Integer switchPortId;
/**
* 交换机模板编号
*/
private Integer switchId;
/**
* 交换机端口类型
*/
private Integer switchPortType;
/**
* 交换机端口数量
*/
private Integer switchPortNum;
public Integer getSwitchPortId() {
return switchPortId;
}
public void setSwitchPortId(Integer switchPortId) {
this.switchPortId = switchPortId;
}
public Integer getSwitchId() {
return switchId;
}
public void setSwitchId(Integer switchId) {
this.switchId = switchId;
}
public Integer getSwitchPortType() {
return switchPortType;
}
public void setSwitchPortType(Integer switchPortType) {
this.switchPortType = switchPortType;
}
public Integer getSwitchPortNum() {
return switchPortNum;
}
public void setSwitchPortNum(Integer switchPortNum) {
this.switchPortNum = switchPortNum;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("switchPortId", getSwitchPortId())
.append("switchId", getSwitchId())
.append("switchPortType", getSwitchPortType())
.append("switchPortNum", getSwitchPortNum())
.toString();
}
}

View File

@ -0,0 +1,88 @@
package com.ruoyi.template.mapper;
import com.ruoyi.template.domain.TmplServerDisk;
import com.ruoyi.template.domain.TmplServerNetcard;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 服务器硬盘类型 数据层
*
* @author TP
* @date 2019-06-14
*/
public interface TmplServerDiskMapper {
/**
* 查询服务器硬盘类型信息
*
* @param serverDiskId 服务器硬盘类型ID
* @return 服务器硬盘类型信息
*/
public TmplServerDisk selectTmplServerDiskById(Integer serverDiskId);
/**
* 查询服务器硬盘类型信息
*
* @param serverId 服务器ID
* @return 服务器硬盘类型信息
*/
public TmplServerNetcard selectByServerId(@Param("serverId") Integer serverId);
/**
* 查询服务器硬盘类型列表
*
* @param tmplServerDisk 服务器硬盘类型信息
* @return 服务器硬盘类型集合
*/
public List<TmplServerDisk> selectTmplServerDiskList(TmplServerDisk tmplServerDisk);
/**
* 新增服务器硬盘类型
*
* @param tmplServerDisk 服务器硬盘类型信息
* @return 结果
*/
public int insertTmplServerDisk(TmplServerDisk tmplServerDisk);
/**
* 修改服务器硬盘类型
*
* @param tmplServerDisk 服务器硬盘类型信息
* @return 结果
*/
public int updateTmplServerDisk(TmplServerDisk tmplServerDisk);
/**
* 删除服务器硬盘类型
*
* @param serverDiskId 服务器硬盘类型ID
* @return 结果
*/
public int deleteTmplServerDiskById(Integer serverDiskId);
/**
* 批量删除服务器硬盘类型
*
* @param serverDiskIds 需要删除的数据ID
* @return 结果
*/
public int deleteTmplServerDiskByIds(String[] serverDiskIds);
/**
* 通过服务器ID批量删除服务器硬盘类型
*
* @param serverId 服务器ID
* @return 结果
*/
public int deleteTmplServerDiskByServerId(Integer serverId);
/**
* 批量新增服务器硬盘类型信息
*
* @param tmplServerDiskList 服务器硬盘类型列表
* @return 结果
*/
public int batchTmplServerDisk(List<TmplServerDisk> tmplServerDiskList);
}

View File

@ -0,0 +1,62 @@
package com.ruoyi.template.mapper;
import com.ruoyi.template.domain.TmplServer;
import java.util.List;
/**
* 服务器模板 数据层
*
* @author TP
* @date 2019-06-12
*/
public interface TmplServerMapper
{
/**
* 查询服务器模板信息
*
* @param serverId 服务器模板ID
* @return 服务器模板信息
*/
public TmplServer selectTmplServerById(Integer serverId);
/**
* 查询服务器模板列表
*
* @param tmplServer 服务器模板信息
* @return 服务器模板集合
*/
public List<TmplServer> selectTmplServerList(TmplServer tmplServer);
/**
* 新增服务器模板
*
* @param tmplServer 服务器模板信息
* @return 结果
*/
public int insertTmplServer(TmplServer tmplServer);
/**
* 修改服务器模板
*
* @param tmplServer 服务器模板信息
* @return 结果
*/
public int updateTmplServer(TmplServer tmplServer);
/**
* 删除服务器模板
*
* @param serverId 服务器模板ID
* @return 结果
*/
public int deleteTmplServerById(Integer serverId);
/**
* 批量删除服务器模板
*
* @param serverIds 需要删除的数据ID
* @return 结果
*/
public int deleteTmplServerByIds(String[] serverIds);
}

View File

@ -0,0 +1,87 @@
package com.ruoyi.template.mapper;
import com.ruoyi.template.domain.TmplServerMemory;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 服务器内存类型 数据层
*
* @author TP
* @date 2019-06-16
*/
public interface TmplServerMemoryMapper {
/**
* 查询服务器内存类型信息
*
* @param serverMemoryId 服务器内存类型ID
* @return 服务器内存类型信息
*/
public TmplServerMemory selectTmplServerMemoryById(Integer serverMemoryId);
/**
* 查询服务器内存类型信息
*
* @param serverId 服务器ID
* @return 服务器内存类型信息
*/
public TmplServerMemory selectByServerId(@Param("serverId") Integer serverId);
/**
* 查询服务器内存类型列表
*
* @param tmplServerMemory 服务器内存类型信息
* @return 服务器内存类型集合
*/
public List<TmplServerMemory> selectTmplServerMemoryList(TmplServerMemory tmplServerMemory);
/**
* 新增服务器内存类型
*
* @param tmplServerMemory 服务器内存类型信息
* @return 结果
*/
public int insertTmplServerMemory(TmplServerMemory tmplServerMemory);
/**
* 修改服务器内存类型
*
* @param tmplServerMemory 服务器内存类型信息
* @return 结果
*/
public int updateTmplServerMemory(TmplServerMemory tmplServerMemory);
/**
* 删除服务器内存类型
*
* @param serverMemoryId 服务器内存类型ID
* @return 结果
*/
public int deleteTmplServerMemoryById(Integer serverMemoryId);
/**
* 通过服务器ID批量删除服务器内存类型
*
* @param serverId 服务器ID
* @return 结果
*/
public int deleteTmplServerMemoryByServerId(Integer serverId);
/**
* 批量删除服务器内存类型
*
* @param serverMemoryIds 需要删除的数据ID
* @return 结果
*/
public int deleteTmplServerMemoryByIds(String[] serverMemoryIds);
/**
* 批量新增服务器内存类型信息
*
* @param tmplServerMemoryList 服务器内存类型列表
* @return 结果
*/
public int batchTmplServerMemory(List<TmplServerMemory> tmplServerMemoryList);
}

View File

@ -0,0 +1,87 @@
package com.ruoyi.template.mapper;
import com.ruoyi.template.domain.TmplServerNetcard;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 服务器网卡类型 数据层
*
* @author TP
* @date 2019-06-14
*/
public interface TmplServerNetcardMapper {
/**
* 查询服务器网卡类型信息
*
* @param serverNetcardId 服务器网卡类型ID
* @return 服务器网卡类型信息
*/
public TmplServerNetcard selectTmplServerNetcardById(Integer serverNetcardId);
/**
* 查询服务器网卡类型信息
*
* @param serverId 服务器ID
* @return 服务器网卡类型信息
*/
public TmplServerNetcard selectByServerId(@Param("serverId") Integer serverId);
/**
* 查询服务器网卡类型列表
*
* @param tmplServerNetcard 服务器网卡类型信息
* @return 服务器网卡类型集合
*/
public List<TmplServerNetcard> selectTmplServerNetcardList(TmplServerNetcard tmplServerNetcard);
/**
* 新增服务器网卡类型
*
* @param tmplServerNetcard 服务器网卡类型信息
* @return 结果
*/
public int insertTmplServerNetcard(TmplServerNetcard tmplServerNetcard);
/**
* 修改服务器网卡类型
*
* @param tmplServerNetcard 服务器网卡类型信息
* @return 结果
*/
public int updateTmplServerNetcard(TmplServerNetcard tmplServerNetcard);
/**
* 删除服务器网卡类型
*
* @param serverNetcardId 服务器网卡类型ID
* @return 结果
*/
public int deleteTmplServerNetcardById(Integer serverNetcardId);
/**
* 通过服务器ID批量删除服务器网卡类型
*
* @param serverId 服务器ID
* @return 结果
*/
public int deleteTmplServerNetcardByServerId(Integer serverId);
/**
* 批量删除服务器网卡类型
*
* @param serverNetcardIds 需要删除的数据ID
* @return 结果
*/
public int deleteTmplServerNetcardByIds(String[] serverNetcardIds);
/**
* 批量新增服务器网卡类型信息
*
* @param tmplServerNetcardList 服务器网卡类型列表
* @return 结果
*/
public int batchTmplServerNetcard(List<TmplServerNetcard> tmplServerNetcardList);
}

View File

@ -0,0 +1,62 @@
package com.ruoyi.template.mapper;
import com.ruoyi.template.domain.TmplSwitch;
import java.util.List;
/**
* 交换机模板 数据层
*
* @author TP
* @date 2019-06-12
*/
public interface TmplSwitchMapper
{
/**
* 查询交换机模板信息
*
* @param switchId 交换机模板ID
* @return 交换机模板信息
*/
public TmplSwitch selectTmplSwitchById(Integer switchId);
/**
* 查询交换机模板列表
*
* @param tmplSwitch 交换机模板信息
* @return 交换机模板集合
*/
public List<TmplSwitch> selectTmplSwitchList(TmplSwitch tmplSwitch);
/**
* 新增交换机模板
*
* @param tmplSwitch 交换机模板信息
* @return 结果
*/
public int insertTmplSwitch(TmplSwitch tmplSwitch);
/**
* 修改交换机模板
*
* @param tmplSwitch 交换机模板信息
* @return 结果
*/
public int updateTmplSwitch(TmplSwitch tmplSwitch);
/**
* 删除交换机模板
*
* @param switchId 交换机模板ID
* @return 结果
*/
public int deleteTmplSwitchById(Integer switchId);
/**
* 批量删除交换机模板
*
* @param switchIds 需要删除的数据ID
* @return 结果
*/
public int deleteTmplSwitchByIds(String[] switchIds);
}

View File

@ -0,0 +1,97 @@
package com.ruoyi.template.mapper;
import com.ruoyi.template.domain.TmplSwitchPort;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 交换机端口类型 数据层
*
* @author TP
* @date 2019-06-12
*/
public interface TmplSwitchPortMapper {
/**
* 查询交换机端口类型信息
*
* @param switchPortId 交换机端口类型ID
* @return 交换机端口类型信息
*/
public TmplSwitchPort selectTmplSwitchPortById(Integer switchPortId);
/**
* * 查询交换机端口类型信息
*
* @param switchId 交换机ID
* @param switchPortType 交换机端口类型
* @return 交换机端口类型信息
*/
public TmplSwitchPort selectBySwitchIdAndPortType(Integer switchId, Integer switchPortType);
/**
* 查询交换机端口类型信息
*
* @param switchId 交换机ID
* @return 交换机端口类型信息
*/
public TmplSwitchPort selectBySwitchId(@Param("switchId") Integer switchId);
/**
* 查询交换机端口类型列表
*
* @param tmplSwitchPort 交换机端口类型信息
* @return 交换机端口类型集合
*/
public List<TmplSwitchPort> selectTmplSwitchPortList(TmplSwitchPort tmplSwitchPort);
/**
* 新增交换机端口类型
*
* @param tmplSwitchPort 交换机端口类型信息
* @return 结果
*/
public int insertTmplSwitchPort(TmplSwitchPort tmplSwitchPort);
/**
* 修改交换机端口类型
*
* @param tmplSwitchPort 交换机端口类型信息
* @return 结果
*/
public int updateTmplSwitchPort(TmplSwitchPort tmplSwitchPort);
/**
* 删除交换机端口类型
*
* @param switchPortId 交换机端口类型ID
* @return 结果
*/
public int deleteTmplSwitchPortById(Integer switchPortId);
/**
* 通过交换机ID批量删除交换机端口类型
*
* @param switchId 交换机ID
* @return 结果
*/
public int deleteTmplSwitchPortBySwitchId(Integer switchId);
/**
* 批量删除交换机端口类型
*
* @param switchPortIds 需要删除的数据ID
* @return 结果
*/
public int deleteTmplSwitchPortByIds(String[] switchPortIds);
/**
* 批量新增交换机端口信息
*
* @param tmplSwitchPortList 交换机端口列表
* @return 结果
*/
public int batchTmplSwitchPort(List<TmplSwitchPort> tmplSwitchPortList);
}

View File

@ -0,0 +1,54 @@
package com.ruoyi.template.service;
import com.ruoyi.template.domain.TmplServer;
import java.util.List;
/**
* 服务器模板 服务层
*
* @author TP
* @date 2019-06-12
*/
public interface ITmplServerService
{
/**
* 查询服务器模板信息
*
* @param serverId 服务器模板ID
* @return 服务器模板信息
*/
public TmplServer selectTmplServerById(Integer serverId);
/**
* 查询服务器模板列表
*
* @param tmplServer 服务器模板信息
* @return 服务器模板集合
*/
public List<TmplServer> selectTmplServerList(TmplServer tmplServer);
/**
* 新增服务器模板
*
* @param tmplServer 服务器模板信息
* @return 结果
*/
public int insertTmplServer(TmplServer tmplServer);
/**
* 修改服务器模板
*
* @param tmplServer 服务器模板信息
* @return 结果
*/
public int updateTmplServer(TmplServer tmplServer);
/**
* 删除服务器模板信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteTmplServerByIds(String ids);
}

View File

@ -0,0 +1,54 @@
package com.ruoyi.template.service;
import com.ruoyi.template.domain.TmplSwitch;
import java.util.List;
/**
* 交换机模板 服务层
*
* @author TP
* @date 2019-06-12
*/
public interface ITmplSwitchService
{
/**
* 查询交换机模板信息
*
* @param switchId 交换机模板ID
* @return 交换机模板信息
*/
public TmplSwitch selectTmplSwitchById(Integer switchId);
/**
* 查询交换机模板列表
*
* @param tmplSwitch 交换机模板信息
* @return 交换机模板集合
*/
public List<TmplSwitch> selectTmplSwitchList(TmplSwitch tmplSwitch);
/**
* 新增交换机模板
*
* @param tmplSwitch 交换机模板信息
* @return 结果
*/
public int insertTmplSwitch(TmplSwitch tmplSwitch);
/**
* 修改交换机模板
*
* @param tmplSwitch 交换机模板信息
* @return 结果
*/
public int updateTmplSwitch(TmplSwitch tmplSwitch);
/**
* 删除交换机模板信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteTmplSwitchByIds(String ids);
}

View File

@ -0,0 +1,211 @@
package com.ruoyi.template.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.system.domain.SysDictData;
import com.ruoyi.system.mapper.SysDictDataMapper;
import com.ruoyi.template.domain.TmplServer;
import com.ruoyi.template.domain.TmplServerDisk;
import com.ruoyi.template.domain.TmplServerMemory;
import com.ruoyi.template.domain.TmplServerNetcard;
import com.ruoyi.template.mapper.TmplServerDiskMapper;
import com.ruoyi.template.mapper.TmplServerMapper;
import com.ruoyi.template.mapper.TmplServerMemoryMapper;
import com.ruoyi.template.mapper.TmplServerNetcardMapper;
import com.ruoyi.template.service.ITmplServerService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
* 服务器模板 服务层实现
*
* @author TP
* @date 2019-06-12
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class TmplServerServiceImpl implements ITmplServerService {
@Autowired
private TmplServerMapper tmplServerMapper;
@Autowired
private TmplServerNetcardMapper tmplServerNetcardMapper;
@Autowired
private TmplServerDiskMapper tmplServerDiskMapper;
@Autowired
private TmplServerMemoryMapper tmplServerMemoryMapper;
@Autowired
private SysDictDataMapper sysDictDataMapper;
/**
* 查询服务器模板信息
*
* @param serverId 服务器模板ID
* @return 服务器模板信息
*/
@Override
public TmplServer selectTmplServerById(Integer serverId) {
return tmplServerMapper.selectTmplServerById(serverId);
}
/**
* 查询服务器模板列表
*
* @param tmplServer 服务器模板信息
* @return 服务器模板集合
*/
@Override
public List<TmplServer> selectTmplServerList(TmplServer tmplServer) {
return tmplServerMapper.selectTmplServerList(tmplServer);
}
/**
* 新增服务器模板
*
* @param tmplServer 服务器模板信息
* @return 结果
*/
@Override
public int insertTmplServer(TmplServer tmplServer) {
return saveOrUpdate(tmplServer);
}
private int saveOrUpdate(TmplServer tmplServer) {
int affectRow = tmplServerMapper.selectTmplServerById(tmplServer.getServerId()) != null
? tmplServerMapper.updateTmplServer(tmplServer)
: tmplServerMapper.insertTmplServer(tmplServer);
if (affectRow > 0) {
JSONObject jsonObject = JSONObject.parseObject(tmplServer.getForeignKeyInfo());
if (jsonObject != null) {
//保存网卡信息
if (jsonObject.containsKey("serverNetcards")) {
saveServerNetcard(tmplServer.getServerId(), jsonObject.getJSONArray("serverNetcards"));
}
//保存硬盘信息
if (jsonObject.containsKey("serverDisks")) {
saveServerDisk(tmplServer.getServerId(), jsonObject.getJSONArray("serverDisks"));
}
//保存内存信息
if (jsonObject.containsKey("serverMemorys")) {
saveServerMemory(tmplServer.getServerId(), jsonObject.getJSONArray("serverMemorys"));
}
}
}
return affectRow;
}
/**
* 新增网卡
*
* @param id
* @param jsonArray
*/
private void saveServerNetcard(Integer id, JSONArray jsonArray) {
List<TmplServerNetcard> list = new ArrayList<>();
jsonArray.forEach((i) -> {
JSONObject jsonObject = (JSONObject) i;
String valueStr = jsonObject.getString("value");
int num = 0;
if (StringUtils.isNotBlank(valueStr) && (num = Convert.toInt(valueStr)) > 0) {
SysDictData dictData = sysDictDataMapper.selectDictDataById(Convert.toLong(jsonObject.getString("id")));
TmplServerNetcard tmplServerNetcard = new TmplServerNetcard();
tmplServerNetcard.setServerId(id);
tmplServerNetcard.setServerNetcardType(Convert.toLong(dictData.getDictCode()));
tmplServerNetcard.setServerNetcardNum(num);
list.add(tmplServerNetcard);
}
});
int serverNetcardNums = list.size() > 0 ? tmplServerNetcardMapper.batchTmplServerNetcard(list) : 0;
if (serverNetcardNums == 0) {
throw new BusinessException("至少输入一个网卡数量");
}
}
/**
* 新增硬盘
*
* @param id
* @param jsonArray
*/
private void saveServerDisk(Integer id, JSONArray jsonArray) {
List<TmplServerDisk> list = new ArrayList<>();
jsonArray.forEach((i) -> {
JSONObject jsonObject = (JSONObject) i;
String valueStr = jsonObject.getString("value");
int num = 0;
if (StringUtils.isNotBlank(valueStr) && (num = Convert.toInt(valueStr)) > 0) {
SysDictData dictData = sysDictDataMapper.selectDictDataById(Convert.toLong(jsonObject.getString("id")));
TmplServerDisk tmplServerDisk = new TmplServerDisk();
tmplServerDisk.setServerId(id);
tmplServerDisk.setServerDiskType(Convert.toLong(dictData.getDictCode()));
tmplServerDisk.setServerDiskNum(num);
list.add(tmplServerDisk);
}
});
int serverDiskNums = list.size() > 0 ? tmplServerDiskMapper.batchTmplServerDisk(list) : 0;
if (serverDiskNums == 0) {
throw new BusinessException("至少输入一个硬盘数量");
}
}
/**
* 新增内存
*
* @param id
* @param jsonArray
*/
private void saveServerMemory(Integer id, JSONArray jsonArray) {
List<TmplServerMemory> list = new ArrayList<>();
jsonArray.forEach((i) -> {
JSONObject jsonObject = (JSONObject) i;
String valueStr = jsonObject.getString("value");
int num = 0;
if (StringUtils.isNotBlank(valueStr) && (num = Convert.toInt(valueStr)) > 0) {
SysDictData dictData = sysDictDataMapper.selectDictDataById(Convert.toLong(jsonObject.getString("id")));
TmplServerMemory tmplServerMemory = new TmplServerMemory();
tmplServerMemory.setServerId(id);
tmplServerMemory.setServerMemoryType(dictData);
tmplServerMemory.setServerMemoryNum(num);
list.add(tmplServerMemory);
}
});
int serverDiskNums = list.size() > 0 ? tmplServerMemoryMapper.batchTmplServerMemory(list) : 0;
if (serverDiskNums == 0) {
throw new BusinessException("至少输入一个内存数量");
}
}
/**
* 修改交换机模板
*
* @param tmplServer 服务器模板信息
* @return 更新后数据库中存在的值个数
*/
@Override
public int updateTmplServer(TmplServer tmplServer) {
// 1.采取简单的做法直接删除关联的所有外键值(一定不能删除原对象tmplServer!!!)
tmplServerNetcardMapper.deleteTmplServerNetcardByServerId(tmplServer.getServerId());
tmplServerDiskMapper.deleteTmplServerDiskByServerId(tmplServer.getServerId());
tmplServerMemoryMapper.deleteTmplServerMemoryByServerId(tmplServer.getServerId());
// 2.更新主表
return insertTmplServer(tmplServer);
}
/**
* 删除服务器模板对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteTmplServerByIds(String ids) {
return tmplServerMapper.deleteTmplServerByIds(Convert.toStrArray(ids));
}
}

View File

@ -0,0 +1,138 @@
package com.ruoyi.template.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.system.domain.SysDictData;
import com.ruoyi.system.mapper.SysDictDataMapper;
import com.ruoyi.template.domain.TmplSwitch;
import com.ruoyi.template.domain.TmplSwitchPort;
import com.ruoyi.template.mapper.TmplSwitchMapper;
import com.ruoyi.template.mapper.TmplSwitchPortMapper;
import com.ruoyi.template.service.ITmplSwitchService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
* 交换机模板 服务层实现
*
* @author TP
* @date 2019-06-12
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class TmplSwitchServiceImpl implements ITmplSwitchService {
@Autowired
private TmplSwitchMapper tmplSwitchMapper;
@Autowired
private TmplSwitchPortMapper tmplSwitchPortMapper;
@Autowired
private SysDictDataMapper sysDictDataMapper;
/**
* 查询交换机模板信息
*
* @param switchId 交换机模板ID
* @return 交换机模板信息
*/
@Override
public TmplSwitch selectTmplSwitchById(Integer switchId) {
return tmplSwitchMapper.selectTmplSwitchById(switchId);
}
/**
* 查询交换机模板列表
*
* @param tmplSwitch 交换机模板信息
* @return 交换机模板集合
*/
@Override
public List<TmplSwitch> selectTmplSwitchList(TmplSwitch tmplSwitch) {
return tmplSwitchMapper.selectTmplSwitchList(tmplSwitch);
}
/**
* 新增交换机模板
*
* @param tmplSwitch 交换机模板信息
* @return 结果
*/
@Override
public int insertTmplSwitch(TmplSwitch tmplSwitch) {
return saveOrUpdate(tmplSwitch);
}
private int saveOrUpdate(TmplSwitch tmplSwitch) {
int affectRow = tmplSwitchMapper.selectTmplSwitchById(tmplSwitch.getSwitchId()) != null
? tmplSwitchMapper.updateTmplSwitch(tmplSwitch)
: tmplSwitchMapper.insertTmplSwitch(tmplSwitch);
if (affectRow > 0) {
JSONObject jsonObject = JSONObject.parseObject(tmplSwitch.getForeignKeyInfo());
if (jsonObject != null) {
if (jsonObject.containsKey("switchPorts")) {
saveSwitchPort(tmplSwitch.getSwitchId(), jsonObject.getJSONArray("switchPorts"));
}
}
}
return affectRow;
}
/**
* 新增端口
*
* @param id
* @param jsonArray
*/
private void saveSwitchPort(Integer id, JSONArray jsonArray) {
List<TmplSwitchPort> list = new ArrayList<>();
jsonArray.forEach((i) -> {
JSONObject jsonObject = (JSONObject) i;
String valueStr = jsonObject.getString("value");
int num = 0;
if (StringUtils.isNotBlank(valueStr) && (num = Convert.toInt(valueStr)) > 0) {
SysDictData dictData = sysDictDataMapper.selectDictDataById(Convert.toLong(jsonObject.getString("id")));
TmplSwitchPort tmplSwitchPort = new TmplSwitchPort();
tmplSwitchPort.setSwitchId(id);
tmplSwitchPort.setSwitchPortType(Convert.toInt(dictData.getDictCode()));
tmplSwitchPort.setSwitchPortNum(num);
list.add(tmplSwitchPort);
}
});
int switchPortNums = list.size() > 0 ? tmplSwitchPortMapper.batchTmplSwitchPort(list) : 0;
if (switchPortNums == 0) {
throw new BusinessException("至少输入一个端口数量");
}
}
/**
* 修改交换机模板
*
* @param tmplSwitch 交换机模板信息
* @return 更新后数据库中存在的值个数
*/
@Override
public int updateTmplSwitch(TmplSwitch tmplSwitch) {
//1.清空数据库中已存的值
tmplSwitchPortMapper.deleteTmplSwitchPortBySwitchId(tmplSwitch.getSwitchId());
//2.更新主表
return insertTmplSwitch(tmplSwitch);
}
/**
* 删除交换机模板对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteTmplSwitchByIds(String ids) {
return tmplSwitchMapper.deleteTmplSwitchByIds(Convert.toStrArray(ids));
}
}

Some files were not shown because too many files have changed in this diff Show More