add - 能源测控点信息

master
wenjy 3 years ago
parent 7b085f75c6
commit d38cd81bb6

@ -145,29 +145,27 @@ public class BaseLocationInfoController extends BaseController
BaseMaterialStore baseMaterialStore = new BaseMaterialStore();
baseMaterialStore.setStoreCode(baseLocationInfo.getStoreCode());
baseMaterialStore.setMaterialType(baseLocationInfo.getMaterialType());
baseMaterialStore.setMaterialCode(baseLocationInfo.getMaterialType());
baseMaterialStore.setLocationCode(baseLocationInfo.getLocationCode());
baseMaterialStore.setLocationArea(baseLocationInfo.getLocationArea());
int baseMaterialStoreCounts;
if (baseLocationInfo.getLocationStatus() == 1) {
baseMaterialStore.setObjid(UUIDTool.generate());
baseMaterialStoreCounts = baseMaterialStoreService.insertBaseMaterialStore(baseMaterialStore);
List<BaseMaterialStore> materialStores = baseMaterialStoreService.selectBaseMaterialStoreList(baseMaterialStore);
if(materialStores.size() == 0) {
baseMaterialStore.setObjid(UUIDTool.generate());
baseMaterialStore.setLocationStatus(1L);
baseMaterialStore.setRecordTime(new Date());
baseMaterialStoreService.insertBaseMaterialStore(baseMaterialStore);
}
} else {
List<BaseMaterialStore> materialStoresList = baseMaterialStoreService.selectBaseMaterialStoreList(baseMaterialStore);
//materialStoresList.get(0);
if(materialStoresList.size() > 0){
Optional<BaseMaterialStore> info = materialStoresList.stream().findFirst();
baseLocationInfoService.deleteBaseLocationInfoByObjid(info.get().getObjid());
baseMaterialStoreService.deleteBaseMaterialStoreByObjid(materialStoresList.get(0).getObjid());
}
}
int baseLocationInfoCounts = baseLocationInfoService.updateBaseLocationInfo(baseLocationInfo);
/*if(baseMaterialStoreCounts >0 && baseLocationInfoCounts>0){
return toAjax(baseLocationInfoService.updateBaseLocationInfo(baseLocationInfo));
}*/
return toAjax(baseLocationInfoService.updateBaseLocationInfo(baseLocationInfo));
}

@ -0,0 +1,154 @@
package com.ruoyi.web.controller.ems;
import java.util.List;
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.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.BaseMonitorInfo;
import com.ruoyi.system.service.IBaseMonitorInfoService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.core.domain.Ztree;
/**
* Controller
*
* @author WenJY
* @date 2021-11-25
*/
@Controller
@RequestMapping("/ems/monitorInfo")
public class BaseMonitorInfoController extends BaseController
{
private String prefix = "ems/monitorInfo";
@Autowired
private IBaseMonitorInfoService baseMonitorInfoService;
@RequiresPermissions("ems:monitorInfo:view")
@GetMapping()
public String monitorInfo()
{
return prefix + "/monitorInfo";
}
/**
*
*/
@RequiresPermissions("ems:monitorInfo:list")
@PostMapping("/list")
@ResponseBody
public List<BaseMonitorInfo> list(BaseMonitorInfo baseMonitorInfo)
{
List<BaseMonitorInfo> list = baseMonitorInfoService.selectBaseMonitorInfoList(baseMonitorInfo);
return list;
}
/**
*
*/
@RequiresPermissions("ems:monitorInfo:export")
@Log(title = "测控点信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(BaseMonitorInfo baseMonitorInfo)
{
List<BaseMonitorInfo> list = baseMonitorInfoService.selectBaseMonitorInfoList(baseMonitorInfo);
ExcelUtil<BaseMonitorInfo> util = new ExcelUtil<BaseMonitorInfo>(BaseMonitorInfo.class);
return util.exportExcel(list, "测控点信息数据");
}
/**
*
*/
@GetMapping(value = { "/add/{objid}", "/add/" })
public String add(@PathVariable(value = "objid", required = false) Long objid, ModelMap mmap)
{
if (StringUtils.isNotNull(objid))
{
mmap.put("baseMonitorInfo", baseMonitorInfoService.selectBaseMonitorInfoByObjid(objid));
}
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("ems:monitorInfo:add")
@Log(title = "测控点信息", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(BaseMonitorInfo baseMonitorInfo)
{
return toAjax(baseMonitorInfoService.insertBaseMonitorInfo(baseMonitorInfo));
}
/**
*
*/
@GetMapping("/edit/{objid}")
public String edit(@PathVariable("objid") Long objid, ModelMap mmap)
{
BaseMonitorInfo baseMonitorInfo = baseMonitorInfoService.selectBaseMonitorInfoByObjid(objid);
mmap.put("baseMonitorInfo", baseMonitorInfo);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("ems:monitorInfo:edit")
@Log(title = "测控点信息", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(BaseMonitorInfo baseMonitorInfo)
{
return toAjax(baseMonitorInfoService.updateBaseMonitorInfo(baseMonitorInfo));
}
/**
*
*/
@RequiresPermissions("ems:monitorInfo:remove")
@Log(title = "测控点信息", businessType = BusinessType.DELETE)
@GetMapping("/remove/{objid}")
@ResponseBody
public AjaxResult remove(@PathVariable("objid") Long objid)
{
return toAjax(baseMonitorInfoService.deleteBaseMonitorInfoByObjid(objid));
}
/**
*
*/
@GetMapping(value = { "/selectMonitorInfoTree/{objid}", "/selectMonitorInfoTree/" })
public String selectMonitorInfoTree(@PathVariable(value = "objid", required = false) Long objid, ModelMap mmap)
{
if (StringUtils.isNotNull(objid))
{
mmap.put("baseMonitorInfo", baseMonitorInfoService.selectBaseMonitorInfoByObjid(objid));
}
return prefix + "/tree";
}
/**
*
*/
@GetMapping("/treeData")
@ResponseBody
public List<Ztree> treeData()
{
List<Ztree> ztrees = baseMonitorInfoService.selectBaseMonitorInfoTree();
return ztrees;
}
}

@ -0,0 +1,30 @@
package com.ruoyi.web.controller.scada;
import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @author WenJY
* @date 20211125 15:13
*/
@Controller
@RequestMapping("/Scada/Foamer")
public class FoamerController {
@GetMapping("/ProductionPlan")
public String ProductionPlan(HttpServletRequest req, HttpServletResponse resp) {
String url = "http://10.100.71.101:8012/system/Foamer?id=1";
return "redirect:"+url;
}
@GetMapping("/DeviceInfo")
public String DeviceInfo(HttpServletRequest req, HttpServletResponse resp) {
String url = "http://10.100.71.101:8012/system/Foamer?id=2";
return "redirect:"+url;
}
}

@ -0,0 +1,24 @@
package com.ruoyi.web.controller.scada;
import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @author WenJY
* @date 20211125 15:25
*/
@Controller
@RequestMapping("/Scada/SouthWareHouse")
public class SouthWareHouseController {
@GetMapping("/Index")
public String Index(HttpServletRequest req, HttpServletResponse resp) {
String url = "http://10.100.71.101:8012/system/SouthWareHouse";
return "redirect:"+url;
}
}

@ -0,0 +1,30 @@
package com.ruoyi.web.controller.scada;
import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @author WenJY
* @date 20211125 15:22
*/
@Controller
@RequestMapping("/Scada/UShellMetalPlate")
public class UShellMetalPlateController {
@GetMapping("/ProductionPlan")
public String ProductionPlan(HttpServletRequest req, HttpServletResponse resp) {
String url = "http://10.100.71.101:8012/system/UShellMetalPlate?id=1";
return "redirect:"+url;
}
@GetMapping("/DeviceInfo")
public String DeviceInfo(HttpServletRequest req, HttpServletResponse resp) {
String url = "http://10.100.71.101:8012/system/UShellMetalPlate?id=2";
return "redirect:"+url;
}
}

@ -6,13 +6,13 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:oracle:thin:@124.70.0.226:1521:ORCL
# url: jdbc:oracle:thin:@10.100.71.101:1521:ORCL
#url: jdbc:oracle:thin:@124.70.0.226:1521:ORCL
#username: system
#assword: 123456
# username: aucma
username: system
# password: aucma
password: 123456
url: jdbc:oracle:thin:@10.100.71.101:1521:ORCL
username: aucma
password: aucma
# 从库数据源
slave:
# 从数据源开关/默认关闭

@ -0,0 +1,135 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增测控点信息')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-monitorInfo-add">
<div class="form-group">
<label class="col-sm-3 control-label">记录时间:</label>
<div class="col-sm-8">
<input name="objid" 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 name="monitorId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">父级编号:</label>
<div class="col-sm-8">
<div class="input-group">
<input id="treeId" name="pMonitorId" type="hidden" th:value="${baseMonitorInfo?.monitorId}"/>
<input class="form-control" type="text" onclick="selectMonitorInfoTree()" id="treeName" readonly="true" th:value="${baseMonitorInfo?.monitorName}">
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">测控点名称:</label>
<div class="col-sm-8">
<input name="monitorName" 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="monitorType" class="form-control m-b">
<option value="">所有</option>
</select>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">测控点位置:</label>
<div class="col-sm-8">
<input name="monitorAddr" 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="monitorStatus" class="form-control m-b" th:with="type=${@dict.getType('monitorType')}">
<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-3 control-label">测控点状态:</label>
<div class="col-sm-8">
<input name="correctValue" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">PT值</label>
<div class="col-sm-8">
<input name="pt" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">CT值</label>
<div class="col-sm-8">
<input name="ct" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">CT值</label>
<div class="col-sm-8">
<input name="grade" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">记录时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="recordTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "ems/monitorInfo"
$("#form-monitorInfo-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-monitorInfo-add').serialize());
}
}
$("input[name='recordTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
/*测控点信息-新增-选择父测控点信息树*/
function selectMonitorInfoTree() {
var options = {
title: '测控点信息选择',
width: "380",
url: prefix + "/selectMonitorInfoTree/" + $("#treeId").val(),
callBack: doSubmit
};
$.modal.openOptions(options);
}
function doSubmit(index, layero){
var body = $.modal.getChildFrame(index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
$.modal.close(index);
}
</script>
</body>
</html>

@ -0,0 +1,136 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改测控点信息')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-monitorInfo-edit" th:object="${baseMonitorInfo}">
<input name="objid" th:field="*{objid}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">记录时间:</label>
<div class="col-sm-8">
<input name="objid" th:field="*{objid}" 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 name="monitorId" th:field="*{monitorId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">父级编号:</label>
<div class="col-sm-8">
<div class="input-group">
<input id="treeId" name="pMonitorId" type="hidden" th:field="*{pMonitorId}" />
<input class="form-control" type="text" onclick="selectMonitorInfoTree()" id="treeName" readonly="true" th:field="*{parentName}">
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">测控点名称:</label>
<div class="col-sm-8">
<input name="monitorName" th:field="*{monitorName}" 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="monitorType" class="form-control m-b">
<option value="">所有</option>
</select>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">测控点位置:</label>
<div class="col-sm-8">
<input name="monitorAddr" th:field="*{monitorAddr}" 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="monitorStatus" class="form-control m-b" th:with="type=${@dict.getType('monitorType')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{monitorStatus}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">测控点状态:</label>
<div class="col-sm-8">
<input name="correctValue" th:field="*{correctValue}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">PT值</label>
<div class="col-sm-8">
<input name="pt" th:field="*{pt}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">CT值</label>
<div class="col-sm-8">
<input name="ct" th:field="*{ct}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">CT值</label>
<div class="col-sm-8">
<input name="grade" th:field="*{grade}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">记录时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="recordTime" th:value="${#dates.format(baseMonitorInfo.recordTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "ems/monitorInfo";
$("#form-monitorInfo-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-monitorInfo-edit').serialize());
}
}
$("input[name='recordTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
/*测控点信息-编辑-选择父测控点信息树*/
function selectMonitorInfoTree() {
var options = {
title: '测控点信息选择',
width: "380",
url: prefix + "/selectMonitorInfoTree/" + $("#treeId").val(),
callBack: doSubmit
};
$.modal.openOptions(options);
}
function doSubmit(index, layero){
var body = $.modal.getChildFrame(index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
$.modal.close(index);
}
</script>
</body>
</html>

@ -0,0 +1,159 @@
<!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>
<label>测控点编号:</label>
<input type="text" name="monitorId"/>
</li>
<li>
<label>父级编号:</label>
<input type="text" name="pMonitorId"/>
</li>
<li>
<label>测控点名称:</label>
<input type="text" name="monitorName"/>
</li>
<li>
<label>测控点类型:</label>
<select name="monitorType">
<option value="">所有</option>
<option value="-1">代码生成请选择字典属性</option>
</select>
</li>
<li>
<label>测控点位置:</label>
<input type="text" name="monitorAddr"/>
</li>
<li>
<label>测控点状态:</label>
<select name="monitorStatus" th:with="type=${@dict.getType('monitorType')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li class="select-time">
<label>记录时间:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginRecordTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endRecordTime]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.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="ems:monitorInfo:add">
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-primary" onclick="$.operate.edit()" shiro:hasPermission="ems:monitorInfo:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-info" id="expandAllBtn">
<i class="fa fa-exchange"></i> 展开/折叠
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-tree-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var addFlag = [[${@permission.hasPermi('ems:monitorInfo:add')}]];
var editFlag = [[${@permission.hasPermi('ems:monitorInfo:edit')}]];
var removeFlag = [[${@permission.hasPermi('ems:monitorInfo:remove')}]];
var monitorStatusDatas = [[${@dict.getType('monitorType')}]];
var prefix = ctx + "ems/monitorInfo";
$(function() {
var options = {
code: "monitorId",
parentCode: "pMonitorId",
expandColumn: "4",
uniqueId: "objid",
url: prefix + "/list",
createUrl: prefix + "/add/{id}",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove/{id}",
exportUrl: prefix + "/export",
modalName: "测控点信息",
columns: [{
field: 'selectItem',
radio: true
},
{
field: 'objid',
title: '编号',
align: 'left',
visible: false
},
{
field: 'monitorId',
title: '测控点编号',
align: 'left'
},
{
field: 'pMonitorId',
title: '父级编号',
align: 'left'
},
{
field: 'monitorName',
title: '测控点名称',
align: 'left'
},
{
field: 'monitorType',
title: '测控点类型',
align: 'left'
},
{
field: 'monitorAddr',
title: '测控点位置',
align: 'left'
},
{
field: 'monitorStatus',
title: '测控点状态',
align: 'left',
formatter: function(value, row, index) {
return $.table.selectDictLabel(monitorStatusDatas, value);
}
},
{
field: 'recordTime',
title: '记录时间',
align: 'left'
},
{
title: '操作',
align: 'center',
align: 'left',
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.objid + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.objid + '\')"><i class="fa fa-plus"></i>新增</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.objid + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.treeTable.init(options);
});
</script>
</body>
</html>

@ -0,0 +1,49 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('测控点信息树选择')" />
<th:block th:include="include :: ztree-css" />
</head>
<style>
body{height:auto;font-family: "Microsoft YaHei";}
button{font-family: "SimSun","Helvetica Neue",Helvetica,Arial;}
</style>
<body class="hold-transition box box-main">
<input id="treeId" name="treeId" type="hidden" th:value="${baseMonitorInfo?.monitorId}"/>
<input id="treeName" name="treeName" type="hidden" th:value="${baseMonitorInfo?.monitorName}"/>
<div class="wrapper"><div class="treeShowHideButton" onclick="$.tree.toggleSearch();">
<label id="btnShow" title="显示搜索" style="display:none;"></label>
<label id="btnHide" title="隐藏搜索"></label>
</div>
<div class="treeSearchInput" id="search">
<label for="keyword">关键字:</label><input type="text" class="empty" id="keyword" maxlength="50">
<button class="btn" id="btn" onclick="$.tree.searchNode()"> 搜索 </button>
</div>
<div class="treeExpandCollapse">
<a href="#" onclick="$.tree.expand()">展开</a> /
<a href="#" onclick="$.tree.collapse()">折叠</a>
</div>
<div id="tree" class="ztree treeselect"></div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: ztree-js" />
<script th:inline="javascript">
$(function() {
var url = ctx + "ems/monitorInfo/treeData";
var options = {
url: url,
expandLevel: 2,
onClick : zOnClick
};
$.tree.init(options);
});
function zOnClick(event, treeId, treeNode) {
var treeId = treeNode.id;
var treeName = treeNode.name;
$("#treeId").val(treeId);
$("#treeName").val(treeName);
}
</script>
</body>
</html>

@ -12,10 +12,10 @@ public class Ztree implements Serializable
private static final long serialVersionUID = 1L;
/** 节点ID */
private Long id;
private String id;
/** 节点父ID */
private Long pId;
private String pId;
/** 节点名称 */
private String name;
@ -32,22 +32,22 @@ public class Ztree implements Serializable
/** 是否能勾选 */
private boolean nocheck = false;
public Long getId()
public String getId()
{
return id;
}
public void setId(Long id)
public void setId(String id)
{
this.id = id;
}
public Long getpId()
public String getpId()
{
return pId;
}
public void setpId(Long pId)
public void setpId(String pId)
{
this.pId = pId;
}

@ -296,6 +296,10 @@ public class ShiroConfig
// 系统权限列表
// filterChainDefinitionMap.putAll(SpringUtils.getBean(IMenuService.class).selectPermsAll());
//开发Scada可视化界面
filterChainDefinitionMap.put("/Scada/**", "anon,captchaValidate");
Map<String, Filter> filters = new LinkedHashMap<String, Filter>();
filters.put("onlineSession", onlineSessionFilter());
filters.put("syncOnlineSession", syncOnlineSessionFilter());

@ -0,0 +1,191 @@
package com.ruoyi.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.TreeEntity;
/**
* base_monitor_info
*
* @author WenJY
* @date 2021-11-25
*/
public class BaseMonitorInfo extends TreeEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long objid;
/** 测控点编号 */
@Excel(name = "测控点编号")
private String monitorId;
/** 父级编号 */
@Excel(name = "父级编号")
private String pMonitorId;
/** 测控点名称 */
@Excel(name = "测控点名称")
private String monitorName;
/** 测控点类型 */
@Excel(name = "测控点类型")
private Long monitorType;
/** 测控点位置 */
@Excel(name = "测控点位置")
private String monitorAddr;
/** 测控点状态 */
@Excel(name = "测控点状态")
private Long monitorStatus;
/** $column.columnComment */
private Long correctValue;
/** PT值 */
private Long pt;
/** CT值 */
private Long ct;
/** $column.columnComment */
private Long grade;
/** 记录时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date recordTime;
public void setObjid(Long objid)
{
this.objid = objid;
}
public Long getObjid()
{
return objid;
}
public void setMonitorId(String monitorId)
{
this.monitorId = monitorId;
}
public String getMonitorId()
{
return monitorId;
}
public void setpMonitorId(String pMonitorId)
{
this.pMonitorId = pMonitorId;
}
public String getpMonitorId()
{
return pMonitorId;
}
public void setMonitorName(String monitorName)
{
this.monitorName = monitorName;
}
public String getMonitorName()
{
return monitorName;
}
public void setMonitorType(Long monitorType)
{
this.monitorType = monitorType;
}
public Long getMonitorType()
{
return monitorType;
}
public void setMonitorAddr(String monitorAddr)
{
this.monitorAddr = monitorAddr;
}
public String getMonitorAddr()
{
return monitorAddr;
}
public void setMonitorStatus(Long monitorStatus)
{
this.monitorStatus = monitorStatus;
}
public Long getMonitorStatus()
{
return monitorStatus;
}
public void setCorrectValue(Long correctValue)
{
this.correctValue = correctValue;
}
public Long getCorrectValue()
{
return correctValue;
}
public void setPt(Long pt)
{
this.pt = pt;
}
public Long getPt()
{
return pt;
}
public void setCt(Long ct)
{
this.ct = ct;
}
public Long getCt()
{
return ct;
}
public void setGrade(Long grade)
{
this.grade = grade;
}
public Long getGrade()
{
return grade;
}
public void setRecordTime(Date recordTime)
{
this.recordTime = recordTime;
}
public Date getRecordTime()
{
return recordTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("objid", getObjid())
.append("monitorId", getMonitorId())
.append("pMonitorId", getpMonitorId())
.append("monitorName", getMonitorName())
.append("monitorType", getMonitorType())
.append("monitorAddr", getMonitorAddr())
.append("monitorStatus", getMonitorStatus())
.append("correctValue", getCorrectValue())
.append("pt", getPt())
.append("ct", getCt())
.append("grade", getGrade())
.append("recordTime", getRecordTime())
.toString();
}
}

@ -0,0 +1,61 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.BaseMonitorInfo;
/**
* Mapper
*
* @author WenJY
* @date 2021-11-25
*/
public interface BaseMonitorInfoMapper
{
/**
*
*
* @param objid
* @return
*/
public BaseMonitorInfo selectBaseMonitorInfoByObjid(Long objid);
/**
*
*
* @param baseMonitorInfo
* @return
*/
public List<BaseMonitorInfo> selectBaseMonitorInfoList(BaseMonitorInfo baseMonitorInfo);
/**
*
*
* @param baseMonitorInfo
* @return
*/
public int insertBaseMonitorInfo(BaseMonitorInfo baseMonitorInfo);
/**
*
*
* @param baseMonitorInfo
* @return
*/
public int updateBaseMonitorInfo(BaseMonitorInfo baseMonitorInfo);
/**
*
*
* @param objid
* @return
*/
public int deleteBaseMonitorInfoByObjid(Long objid);
/**
*
*
* @param objids
* @return
*/
public int deleteBaseMonitorInfoByObjids(String[] objids);
}

@ -0,0 +1,69 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.BaseMonitorInfo;
import com.ruoyi.common.core.domain.Ztree;
/**
* Service
*
* @author WenJY
* @date 2021-11-25
*/
public interface IBaseMonitorInfoService
{
/**
*
*
* @param objid
* @return
*/
public BaseMonitorInfo selectBaseMonitorInfoByObjid(Long objid);
/**
*
*
* @param baseMonitorInfo
* @return
*/
public List<BaseMonitorInfo> selectBaseMonitorInfoList(BaseMonitorInfo baseMonitorInfo);
/**
*
*
* @param baseMonitorInfo
* @return
*/
public int insertBaseMonitorInfo(BaseMonitorInfo baseMonitorInfo);
/**
*
*
* @param baseMonitorInfo
* @return
*/
public int updateBaseMonitorInfo(BaseMonitorInfo baseMonitorInfo);
/**
*
*
* @param objids
* @return
*/
public int deleteBaseMonitorInfoByObjids(String objids);
/**
*
*
* @param objid
* @return
*/
public int deleteBaseMonitorInfoByObjid(Long objid);
/**
*
*
* @return
*/
public List<Ztree> selectBaseMonitorInfoTree();
}

@ -0,0 +1,118 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import java.util.ArrayList;
import com.ruoyi.common.core.domain.Ztree;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BaseMonitorInfoMapper;
import com.ruoyi.system.domain.BaseMonitorInfo;
import com.ruoyi.system.service.IBaseMonitorInfoService;
import com.ruoyi.common.core.text.Convert;
/**
* Service
*
* @author WenJY
* @date 2021-11-25
*/
@Service
public class BaseMonitorInfoServiceImpl implements IBaseMonitorInfoService
{
@Autowired
private BaseMonitorInfoMapper baseMonitorInfoMapper;
/**
*
*
* @param objid
* @return
*/
@Override
public BaseMonitorInfo selectBaseMonitorInfoByObjid(Long objid)
{
return baseMonitorInfoMapper.selectBaseMonitorInfoByObjid(objid);
}
/**
*
*
* @param baseMonitorInfo
* @return
*/
@Override
public List<BaseMonitorInfo> selectBaseMonitorInfoList(BaseMonitorInfo baseMonitorInfo)
{
return baseMonitorInfoMapper.selectBaseMonitorInfoList(baseMonitorInfo);
}
/**
*
*
* @param baseMonitorInfo
* @return
*/
@Override
public int insertBaseMonitorInfo(BaseMonitorInfo baseMonitorInfo)
{
return baseMonitorInfoMapper.insertBaseMonitorInfo(baseMonitorInfo);
}
/**
*
*
* @param baseMonitorInfo
* @return
*/
@Override
public int updateBaseMonitorInfo(BaseMonitorInfo baseMonitorInfo)
{
return baseMonitorInfoMapper.updateBaseMonitorInfo(baseMonitorInfo);
}
/**
*
*
* @param objids
* @return
*/
@Override
public int deleteBaseMonitorInfoByObjids(String objids)
{
return baseMonitorInfoMapper.deleteBaseMonitorInfoByObjids(Convert.toStrArray(objids));
}
/**
*
*
* @param objid
* @return
*/
@Override
public int deleteBaseMonitorInfoByObjid(Long objid)
{
return baseMonitorInfoMapper.deleteBaseMonitorInfoByObjid(objid);
}
/**
*
*
* @return
*/
@Override
public List<Ztree> selectBaseMonitorInfoTree()
{
List<BaseMonitorInfo> baseMonitorInfoList = baseMonitorInfoMapper.selectBaseMonitorInfoList(new BaseMonitorInfo());
List<Ztree> ztrees = new ArrayList<Ztree>();
for (BaseMonitorInfo baseMonitorInfo : baseMonitorInfoList)
{
Ztree ztree = new Ztree();
ztree.setId(baseMonitorInfo.getMonitorId());
ztree.setpId(baseMonitorInfo.getpMonitorId());
ztree.setName(baseMonitorInfo.getMonitorName());
ztree.setTitle(baseMonitorInfo.getMonitorName());
ztrees.add(ztree);
}
return ztrees;
}
}

@ -63,7 +63,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
*
*
* @param deptId ID
* @param dept
* @return
*/
@Override
@ -138,8 +138,8 @@ public class SysDeptServiceImpl implements ISysDeptService
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()))
{
Ztree ztree = new Ztree();
ztree.setId(dept.getDeptId());
ztree.setpId(dept.getParentId());
ztree.setId(dept.getDeptId().toString());
ztree.setpId(dept.getParentId().toString());
ztree.setName(dept.getDeptName());
ztree.setTitle(dept.getDeptName());
if (isCheck)

@ -238,7 +238,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
if (UserConstants.DICT_NORMAL.equals(dict.getStatus()))
{
Ztree ztree = new Ztree();
ztree.setId(dict.getDictId());
ztree.setId(dict.getDictId().toString());
ztree.setName(transDictName(dict));
ztree.setTitle(dict.getDictType());
ztrees.add(ztree);

@ -204,8 +204,8 @@ public class SysMenuServiceImpl implements ISysMenuService
for (SysMenu menu : menuList)
{
Ztree ztree = new Ztree();
ztree.setId(menu.getMenuId());
ztree.setpId(menu.getParentId());
ztree.setId(menu.getMenuId().toString());
ztree.setpId(menu.getParentId().toString());
ztree.setName(transMenuName(menu, permsFlag));
ztree.setTitle(menu.getMenuName());
if (isCheck)

@ -29,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<sql id="orderByRecordDate">
order by record_time desc
order by ORDERNUM
</sql>
<select id="selectBaseLocationInfoList" parameterType="BaseLocationInfo" resultMap="BaseLocationInfoResult">

@ -29,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="materialCode != null and materialCode != ''"> and material_code like concat(concat('%', #{materialCode}), '%')</if>
<if test="materialType != null and materialType != ''"> and material_type like concat(concat('%', #{materialType}), '%')</if>
<if test="locationCode != null and locationCode != ''"> and location_Code like concat(concat('%', #{locationCode}), '%')</if>
<if test="locationCode != null and locationCode != ''"> and location_Code = #{locationCode} </if>
<if test="locationStatus != null"> and location_status = #{locationStatus} </if>
<if test="locationArea != null and locationArea != ''"> and location_area = #{locationArea} </if>

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.BaseMonitorInfoMapper">
<resultMap type="BaseMonitorInfo" id="BaseMonitorInfoResult">
<result property="objid" column="objid" />
<result property="monitorId" column="monitor_id" />
<result property="pMonitorId" column="p_monitor_id" />
<result property="monitorName" column="monitor_name" />
<result property="monitorType" column="monitor_type" />
<result property="monitorAddr" column="monitor_addr" />
<result property="monitorStatus" column="monitor_status" />
<result property="correctValue" column="correct_value" />
<result property="pt" column="pt" />
<result property="ct" column="ct" />
<result property="grade" column="grade" />
<result property="recordTime" column="record_time" />
<result property="parentName" column="parent_name" />
</resultMap>
<sql id="selectBaseMonitorInfoVo">
select objid, monitor_id, p_monitor_id, monitor_name, monitor_type, monitor_addr, monitor_status, correct_value, pt, ct, grade, record_time from base_monitor_info
</sql>
<select id="selectBaseMonitorInfoList" parameterType="BaseMonitorInfo" resultMap="BaseMonitorInfoResult">
<include refid="selectBaseMonitorInfoVo"/>
<where>
<if test="monitorId != null and monitorId != ''"> and monitor_id = #{monitorId}</if>
<if test="pMonitorId != null and pMonitorId != ''"> and p_monitor_id = #{pMonitorId}</if>
<if test="monitorName != null and monitorName != ''"> and monitor_name like concat(concat('%', #{monitorName}), '%')</if>
<if test="monitorType != null "> and monitor_type = #{monitorType}</if>
<if test="monitorAddr != null and monitorAddr != ''"> and monitor_addr = #{monitorAddr}</if>
<if test="monitorStatus != null "> and monitor_status = #{monitorStatus}</if>
<if test="params.beginRecordTime != null and params.beginRecordTime != '' and params.endRecordTime != null and params.endRecordTime != ''"> and record_time between #{params.beginRecordTime} and #{params.endRecordTime}</if>
</where>
order by p_monitor_id
</select>
<select id="selectBaseMonitorInfoByObjid" parameterType="Long" resultMap="BaseMonitorInfoResult">
select t.objid, t.monitor_id, t.p_monitor_id, t.monitor_name, t.monitor_type, t.monitor_addr, t.monitor_status, t.correct_value, t.pt, t.ct, t.grade, t.record_time, p.monitor_name as parent_name
from base_monitor_info t
left join base_monitor_info p on p.objid = t.p_monitor_id
where t.objid = #{objid}
</select>
<insert id="insertBaseMonitorInfo" parameterType="BaseMonitorInfo">
insert into base_monitor_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="objid != null">objid,</if>
<if test="monitorId != null">monitor_id,</if>
<if test="pMonitorId != null">p_monitor_id,</if>
<if test="monitorName != null">monitor_name,</if>
<if test="monitorType != null">monitor_type,</if>
<if test="monitorAddr != null">monitor_addr,</if>
<if test="monitorStatus != null">monitor_status,</if>
<if test="correctValue != null">correct_value,</if>
<if test="pt != null">pt,</if>
<if test="ct != null">ct,</if>
<if test="grade != null">grade,</if>
<if test="recordTime != null">record_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objid != null">#{objid},</if>
<if test="monitorId != null">#{monitorId},</if>
<if test="pMonitorId != null">#{pMonitorId},</if>
<if test="monitorName != null">#{monitorName},</if>
<if test="monitorType != null">#{monitorType},</if>
<if test="monitorAddr != null">#{monitorAddr},</if>
<if test="monitorStatus != null">#{monitorStatus},</if>
<if test="correctValue != null">#{correctValue},</if>
<if test="pt != null">#{pt},</if>
<if test="ct != null">#{ct},</if>
<if test="grade != null">#{grade},</if>
<if test="recordTime != null">#{recordTime},</if>
</trim>
</insert>
<update id="updateBaseMonitorInfo" parameterType="BaseMonitorInfo">
update base_monitor_info
<trim prefix="SET" suffixOverrides=",">
<if test="monitorId != null">monitor_id = #{monitorId},</if>
<if test="pMonitorId != null">p_monitor_id = #{pMonitorId},</if>
<if test="monitorName != null">monitor_name = #{monitorName},</if>
<if test="monitorType != null">monitor_type = #{monitorType},</if>
<if test="monitorAddr != null">monitor_addr = #{monitorAddr},</if>
<if test="monitorStatus != null">monitor_status = #{monitorStatus},</if>
<if test="correctValue != null">correct_value = #{correctValue},</if>
<if test="pt != null">pt = #{pt},</if>
<if test="ct != null">ct = #{ct},</if>
<if test="grade != null">grade = #{grade},</if>
<if test="recordTime != null">record_time = #{recordTime},</if>
</trim>
where objid = #{objid}
</update>
<delete id="deleteBaseMonitorInfoByObjid" parameterType="Long">
delete from base_monitor_info where objid = #{objid}
</delete>
<delete id="deleteBaseMonitorInfoByObjids" parameterType="String">
delete from base_monitor_info where objid in
<foreach item="objid" collection="array" open="(" separator="," close=")">
#{objid}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save