机柜管理
This commit is contained in:
parent
5ebd161995
commit
bf1e675967
|
|
@ -1,7 +1,9 @@
|
|||
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;
|
||||
|
|
@ -24,17 +26,17 @@ import java.util.List;
|
|||
*/
|
||||
@Controller
|
||||
@RequestMapping("/assets/assetsCabinet")
|
||||
public class AssetsCabinetController extends BaseController
|
||||
{
|
||||
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()
|
||||
{
|
||||
public String assetsCabinet() {
|
||||
return prefix + "/assetsCabinet";
|
||||
}
|
||||
|
||||
|
|
@ -44,8 +46,7 @@ public class AssetsCabinetController extends BaseController
|
|||
@RequiresPermissions("assets:assetsCabinet:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(AssetsCabinet assetsCabinet)
|
||||
{
|
||||
public TableDataInfo list(AssetsCabinet assetsCabinet) {
|
||||
startPage();
|
||||
List<AssetsCabinet> list = assetsCabinetService.selectAssetsCabinetList(assetsCabinet);
|
||||
return getDataTable(list);
|
||||
|
|
@ -58,8 +59,7 @@ public class AssetsCabinetController extends BaseController
|
|||
@RequiresPermissions("assets:assetsCabinet:export")
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(AssetsCabinet assetsCabinet)
|
||||
{
|
||||
public AjaxResult export(AssetsCabinet assetsCabinet) {
|
||||
List<AssetsCabinet> list = assetsCabinetService.selectAssetsCabinetList(assetsCabinet);
|
||||
ExcelUtil<AssetsCabinet> util = new ExcelUtil<AssetsCabinet>(AssetsCabinet.class);
|
||||
return util.exportExcel(list, "assetsCabinet");
|
||||
|
|
@ -69,8 +69,9 @@ public class AssetsCabinetController extends BaseController
|
|||
* 新增机柜类型
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
public String add(ModelMap mmap) {
|
||||
List<AssetsMachineRoom> list = assetsMachineRoomService.selectAssetsMachineRoomList(new AssetsMachineRoom());
|
||||
mmap.put("machineRooms",list);
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
|
|
@ -81,8 +82,7 @@ public class AssetsCabinetController extends BaseController
|
|||
@Log(title = "机柜类型", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(AssetsCabinet assetsCabinet)
|
||||
{
|
||||
public AjaxResult addSave(AssetsCabinet assetsCabinet) {
|
||||
return toAjax(assetsCabinetService.insertAssetsCabinet(assetsCabinet));
|
||||
}
|
||||
|
||||
|
|
@ -90,9 +90,10 @@ public class AssetsCabinetController extends BaseController
|
|||
* 修改机柜类型
|
||||
*/
|
||||
@GetMapping("/edit/{cabinetId}")
|
||||
public String edit(@PathVariable("cabinetId") Integer cabinetId, ModelMap mmap)
|
||||
{
|
||||
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";
|
||||
}
|
||||
|
|
@ -104,8 +105,7 @@ public class AssetsCabinetController extends BaseController
|
|||
@Log(title = "机柜类型", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(AssetsCabinet assetsCabinet)
|
||||
{
|
||||
public AjaxResult editSave(AssetsCabinet assetsCabinet) {
|
||||
return toAjax(assetsCabinetService.updateAssetsCabinet(assetsCabinet));
|
||||
}
|
||||
|
||||
|
|
@ -116,8 +116,7 @@ public class AssetsCabinetController extends BaseController
|
|||
@Log(title = "机柜类型", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
public AjaxResult remove(String ids) {
|
||||
return toAjax(assetsCabinetService.deleteAssetsCabinetByIds(ids));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,19 +6,13 @@
|
|||
<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">-->
|
||||
<!-- <input id="machineRoomId" name="machineRoomId" 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 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}">
|
||||
<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>
|
||||
|
|
@ -38,13 +32,13 @@
|
|||
<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="text">
|
||||
<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="text">
|
||||
<input id="cabinetAvailElec" name="cabinetAvailElec" class="form-control" type="number" min="1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
|
@ -57,12 +51,34 @@
|
|||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "assets/assetsCabinet"
|
||||
var prefix = ctx + "assets/assetsCabinet";
|
||||
$("#form-assetsCabinet-add").validate({
|
||||
rules: {
|
||||
xxxx: {
|
||||
required: true,
|
||||
"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
|
||||
});
|
||||
|
|
|
|||
|
|
@ -10,9 +10,13 @@
|
|||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">所属机房:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="machineRoomId" name="machineRoomId" th:field="*{machineRoom.machineRoomId}"
|
||||
class="form-control"
|
||||
type="text">
|
||||
<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">
|
||||
|
|
@ -54,9 +58,31 @@
|
|||
var prefix = ctx + "assets/assetsCabinet";
|
||||
$("#form-assetsCabinet-edit").validate({
|
||||
rules: {
|
||||
xxxx: {
|
||||
required: true,
|
||||
"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
|
||||
});
|
||||
|
|
|
|||
|
|
@ -114,7 +114,6 @@
|
|||
sortable: true
|
||||
},
|
||||
{
|
||||
// field: 'memoryTotal',
|
||||
title: '总内存(G)',
|
||||
sortable: true,
|
||||
formatter: function (value, row, index) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.assets.service;
|
||||
|
||||
import com.ruoyi.assets.domain.AssetsCabinet;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -9,8 +10,7 @@ import java.util.List;
|
|||
* @author TP
|
||||
* @date 2019-06-17
|
||||
*/
|
||||
public interface IAssetsCabinetService
|
||||
{
|
||||
public interface IAssetsCabinetService {
|
||||
/**
|
||||
* 查询机柜类型信息
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.assets.service;
|
||||
|
||||
import com.ruoyi.assets.domain.AssetsMachineRoom;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -9,8 +10,7 @@ import java.util.List;
|
|||
* @author TP
|
||||
* @date 2019-06-17
|
||||
*/
|
||||
public interface IAssetsMachineRoomService
|
||||
{
|
||||
public interface IAssetsMachineRoomService {
|
||||
/**
|
||||
* 查询机房信息
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue