opt: 路由同步,设备监控优化
This commit is contained in:
@@ -224,6 +224,7 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
|
||||
IPage<Device> queryPage = PageUtil.toMybatisPage(page);
|
||||
LambdaQueryWrapper<Device> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(StringUtils.isNotBlank((String) whereJson.get("device_type")), Device::getDevice_type, whereJson.get("device_type"));
|
||||
wrapper.eq(StringUtils.isNotBlank((String) whereJson.get("region")), Device::getRegion, whereJson.get("region"));
|
||||
wrapper.nested(StringUtils.isNotBlank((String) whereJson.get("blurry")), i -> i.like(Device::getDevice_code, whereJson.get("blurry")).or().like(Device::getDevice_name, whereJson.get("blurry")));
|
||||
wrapper.orderByAsc(Device::getIs_config).orderByDesc(Device::getSeq_num).orderByDesc(Device::getUpdate_time);
|
||||
wrapper.orderByDesc(Device::getCreate_time);
|
||||
@@ -1905,11 +1906,15 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
|
||||
String in_device_name = null;
|
||||
String en_device_name = null;
|
||||
String zh_device_name = null;
|
||||
/*if(list.size() > 7){
|
||||
if(list.size() > 6 && ObjectUtil.isNotEmpty(list.get(6))){
|
||||
in_device_name = list.get(6).toString();
|
||||
}
|
||||
if(list.size() > 7 && ObjectUtil.isNotEmpty(list.get(7))){
|
||||
en_device_name = list.get(7).toString();
|
||||
}
|
||||
if(list.size() > 8 && ObjectUtil.isNotEmpty(list.get(8))){
|
||||
zh_device_name = list.get(8).toString();
|
||||
}*/
|
||||
}
|
||||
|
||||
if (StrUtil.isEmpty(device_code)) {
|
||||
throw new BadRequestException(LangProcess.msg("error_checkNull", "device_code"));
|
||||
@@ -1931,7 +1936,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
|
||||
continue;
|
||||
}
|
||||
if(StrUtil.isEmpty(zh_device_name)){
|
||||
//throw new BadRequestException(LangProcess.msg("zh_device_name_isNotNull"));
|
||||
zh_device_name = StrUtil.isNotEmpty(device_name) ? device_name : device_code;
|
||||
}
|
||||
if(StrUtil.isEmpty(en_device_name)){
|
||||
@@ -2013,7 +2017,7 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
|
||||
|
||||
@Override
|
||||
public JSONArray selectDriverCodeList(String device_code) {
|
||||
JSONArray ja = new JSONArray();
|
||||
JSONArray ja;
|
||||
DeviceDto device = this.findByCode(device_code);
|
||||
String device_type = device.getDevice_type();
|
||||
List<Dict> dictList = iSysDictService.getDictByName("device_type");
|
||||
|
||||
@@ -69,8 +69,8 @@ public class RouteLineServiceImpl extends CommonServiceImpl<RouteLineMapper, Rou
|
||||
@Autowired
|
||||
ISysParamService paramService;
|
||||
|
||||
Map<String, RoutePlanDto> routePlans = new HashMap();
|
||||
Map<Integer, String> routeIndex = new HashMap();
|
||||
Map<String, RoutePlanDto> routePlans = new HashMap<>();
|
||||
Map<Integer, String> routeIndex = new HashMap<>();
|
||||
Map<String, List> routeLines = new HashMap();
|
||||
/**
|
||||
* 用来确定设备在 路由二维数组中的坐标
|
||||
@@ -335,6 +335,12 @@ public class RouteLineServiceImpl extends CommonServiceImpl<RouteLineMapper, Rou
|
||||
if (list.size() == 0) {
|
||||
// wo.insert(json);
|
||||
routeLineMapper.insert(entity);
|
||||
RoutePlanDto routePlanDto = routePlanService.findById(entity.getRoute_plan_id());
|
||||
if(ObjectUtil.isNotEmpty(routePlanDto)){
|
||||
List list1 = routeLines.get(routePlanDto.getPlan_code());
|
||||
RouteLineDto convert = ConvertUtil.convert(entity, RouteLineDto.class);
|
||||
list1.add(convert);
|
||||
}
|
||||
} else {
|
||||
throw new BadRequestException(LangProcess.msg("error_creat_route"));
|
||||
}
|
||||
@@ -405,6 +411,7 @@ public class RouteLineServiceImpl extends CommonServiceImpl<RouteLineMapper, Rou
|
||||
RouteLineDto dto = this.findById(routeLineId);
|
||||
dto.setIs_active(ia_active);
|
||||
this.update(dto);
|
||||
reload();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -531,10 +538,10 @@ public class RouteLineServiceImpl extends CommonServiceImpl<RouteLineMapper, Rou
|
||||
Object[] param = new Object[0];
|
||||
Map map = new HashMap();
|
||||
List<RoutePlanDto> routePlans = this.routePlanService.queryAll(map);
|
||||
Iterator var2 = routePlans.iterator();
|
||||
Iterator<RoutePlanDto> var2 = routePlans.iterator();
|
||||
while (var2.hasNext()) {
|
||||
RoutePlanDto routePlan = (RoutePlanDto) var2.next();
|
||||
Map map1 = new HashMap();
|
||||
RoutePlanDto routePlan = var2.next();
|
||||
Map<String, String> map1 = new HashMap<String, String>();
|
||||
map1.put("route_plan_id", routePlan.getPlan_uuid());
|
||||
//List<Entity> allRouteLines = Db.use().query(initsql,param);
|
||||
|
||||
@@ -568,11 +575,11 @@ public class RouteLineServiceImpl extends CommonServiceImpl<RouteLineMapper, Rou
|
||||
routeLineDto.setWeights(entity.get("weights").toString());
|
||||
return routeLineDto;
|
||||
}).collect(Collectors.toList());
|
||||
Iterator var = routeDaoList.iterator();
|
||||
Iterator<RouteLineDto> var = routeDaoList.iterator();
|
||||
List list = new ArrayList<>();
|
||||
|
||||
while (var.hasNext()) {
|
||||
RouteLineDto routeLine = (RouteLineDto) var.next();
|
||||
RouteLineDto routeLine = var.next();
|
||||
|
||||
if (StrUtil.equals(routePlan.getPlan_uuid(), routeLine.getRoute_plan_id())) {
|
||||
list.add(routeLine);
|
||||
@@ -614,7 +621,7 @@ public class RouteLineServiceImpl extends CommonServiceImpl<RouteLineMapper, Rou
|
||||
public List<RouteLineDto> getShortPathLines(String device_code, String next_device_code, String plan_code) {
|
||||
|
||||
List list = this.routeLines.get(plan_code);
|
||||
List result = new ArrayList();
|
||||
List<RouteLineDto> result = new ArrayList<>();
|
||||
Iterator iterator = list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
RouteLineDto routeLineDto = (RouteLineDto) iterator.next();
|
||||
@@ -630,7 +637,7 @@ public class RouteLineServiceImpl extends CommonServiceImpl<RouteLineMapper, Rou
|
||||
@Override
|
||||
public List<RouteLineDto> getShortPathLinesByCode(String device_code, String plan_code) {
|
||||
List list = this.routeLines.get(plan_code);
|
||||
List result = new ArrayList();
|
||||
List<RouteLineDto> result = new ArrayList<>();
|
||||
Iterator iterator = list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
RouteLineDto routeLineDto = (RouteLineDto) iterator.next();
|
||||
@@ -646,7 +653,7 @@ public class RouteLineServiceImpl extends CommonServiceImpl<RouteLineMapper, Rou
|
||||
@Override
|
||||
public List<RouteLineDto> getPathLinesByCode(String device_code, String plan_code) {
|
||||
List list = this.routeLines.get(plan_code);
|
||||
List result = new ArrayList();
|
||||
List<RouteLineDto> result = new ArrayList<RouteLineDto>();
|
||||
Iterator iterator = list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
RouteLineDto routeLineDto = (RouteLineDto) iterator.next();
|
||||
@@ -662,7 +669,7 @@ public class RouteLineServiceImpl extends CommonServiceImpl<RouteLineMapper, Rou
|
||||
@Override
|
||||
public List<RouteLineDto> getSuperiorShortPathLinesByCode(String device_code, String plan_code) {
|
||||
List list = this.routeLines.get(plan_code);
|
||||
List result = new ArrayList();
|
||||
List<RouteLineDto> result = new ArrayList<RouteLineDto>();
|
||||
Iterator iterator = list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
RouteLineDto routeLineDto = (RouteLineDto) iterator.next();
|
||||
@@ -686,7 +693,7 @@ public class RouteLineServiceImpl extends CommonServiceImpl<RouteLineMapper, Rou
|
||||
}
|
||||
|
||||
public Integer getIndex(String device_code) {
|
||||
Iterator var2 = this.routeIndex.keySet().iterator();
|
||||
Iterator<Integer> var2 = this.routeIndex.keySet().iterator();
|
||||
|
||||
Integer i;
|
||||
do {
|
||||
@@ -694,7 +701,7 @@ public class RouteLineServiceImpl extends CommonServiceImpl<RouteLineMapper, Rou
|
||||
throw new BadRequestException(device_code + "当前设备没有路由请检查设备配置");
|
||||
}
|
||||
|
||||
i = (Integer) var2.next();
|
||||
i = var2.next();
|
||||
} while (!((String) this.routeIndex.get(i)).equals(device_code));
|
||||
|
||||
return i;
|
||||
|
||||
@@ -36,6 +36,20 @@
|
||||
<el-option v-for="item in device_types" :key="item.id" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('device.device_table_title.region')">
|
||||
<el-select
|
||||
v-model="query.region"
|
||||
clearable
|
||||
filterable
|
||||
size="small"
|
||||
:placeholder="$t('device.device_table_title.region')"
|
||||
class="filter-item"
|
||||
style="width: 200px"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option v-for="item in regions" :key="item.id" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
@@ -168,7 +168,7 @@
|
||||
<el-table-column prop="start_point_code" :label="$t('Inst.table.start_point_code')" :min-width="flexWidth('start_point_code',crud.data,$t('Inst.table.start_point_code'))" />
|
||||
<el-table-column prop="next_point_code" :label="$t('Inst.table.next_point_code')" :min-width="flexWidth('next_point_code',crud.data,$t('Inst.table.next_point_code'))" />
|
||||
<el-table-column prop="start_point_code2" :label="$t('Inst.table.start_point_code2')" :min-width="flexWidth('start_point_code2',crud.data,$t('Inst.table.start_point_code2'))" />
|
||||
<el-table-column prop="next_point_code2" :label="$t('Inst.table.next_point_code2')" :min-width="flexWidth('next_point_code2',crud.data,$t('Inst.table.snext_point_code2'))" />
|
||||
<el-table-column prop="next_point_code2" :label="$t('Inst.table.next_point_code2')" :min-width="flexWidth('next_point_code2',crud.data,$t('Inst.table.next_point_code2'))" />
|
||||
<el-table-column prop="put_point_code" :label="$t('Inst.table.put_point_code')" :min-width="flexWidth('put_point_code',crud.data,$t('Inst.table.put_point_code'))" />
|
||||
<el-table-column prop="execute_device_code" :label="$t('Inst.table.execute_device_code')" :min-width="flexWidth('execute_device_code',crud.data,$t('Inst.table.execute_device_code'))" />
|
||||
<el-table-column prop="carno" :label="$t('Inst.table.carno')" :min-width="flexWidth('carno',crud.data,$t('Inst.table.carno'))" />
|
||||
@@ -180,21 +180,11 @@
|
||||
<el-table-column
|
||||
v-permission="['admin','instruction:edit','instruction:del']"
|
||||
:label="$t('auto.common.Operate')"
|
||||
width="250px"
|
||||
width="150px"
|
||||
align="center"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-dropdown trigger="click" @command="handleCommand">-->
|
||||
<!-- <span class="el-dropdown-link">-->
|
||||
<!-- <i class="el-icon-menu" />-->
|
||||
<!-- </span>-->
|
||||
<!-- <el-dropdown-menu slot="dropdown">-->
|
||||
<!-- <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'a')">{{ $t('Inst.table.Finish') }}</el-dropdown-item>-->
|
||||
<!-- <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'b')">{{ $t('auto.common.Cancel') }}</el-dropdown-item>-->
|
||||
<!-- <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'c')">{{ $t('auto.common.Forced_cancellation') }}</el-dropdown-item>-->
|
||||
<!-- <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'d')">{{ $t('auto.common.Initialize') }}</el-dropdown-item>-->
|
||||
<!-- </el-dropdown-menu>-->
|
||||
<!-- </el-dropdown>-->
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-finished"
|
||||
@@ -202,27 +192,20 @@
|
||||
>
|
||||
{{ $t('Inst.table.Finish') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-circle-close"
|
||||
@click="handleCommand(scope.$index, scope.row,'b')"
|
||||
>
|
||||
{{ $t('auto.common.Cancel') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-error"
|
||||
@click="handleCommand(scope.$index, scope.row,'c')"
|
||||
>
|
||||
{{ $t('auto.common.Forced_cancellation') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-refresh"
|
||||
@click="handleCommand(scope.$index, scope.row,'d')"
|
||||
>
|
||||
{{ $t('auto.common.Initialize') }}
|
||||
</el-button>
|
||||
<el-dropdown size="mini">
|
||||
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">{{ $t('user.other.More') }}</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item icon="el-icon-circle-close"><span @click="handleCommand(scope.$index, scope.row,'b')">
|
||||
{{ $t('auto.common.Cancel') }}</span>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-error"><span @click="handleCommand(scope.$index, scope.row,'c')">
|
||||
{{ $t('auto.common.Forced_cancellation') }}</span></el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
icon="el-icon-refresh"
|
||||
><span @click="handleCommand(scope.$index, scope.row,'d')">{{ $t('auto.common.Initialize') }}</span>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@@ -51,8 +51,9 @@
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<!-- <el-button
|
||||
<el-button
|
||||
slot="right"
|
||||
v-permission="['admin','task:synchronous']"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
@@ -60,7 +61,7 @@
|
||||
@click="reload"
|
||||
>
|
||||
{{ $t('auto.common.synchronous') }}
|
||||
</el-button> -->
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:visible.sync="crud.status.cu"
|
||||
:title="crud.status.title"
|
||||
width="500px"
|
||||
>
|
||||
@@ -67,7 +67,6 @@
|
||||
<script>
|
||||
import crudStage from '@/api/acs/stage/stage'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
@@ -86,7 +85,7 @@ const defaultForm = {
|
||||
}
|
||||
export default {
|
||||
name: 'Stage',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
components: { pagination, crudOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div style="overflow: hidden">
|
||||
<el-select v-model="value" :placeholder="$t('auto.common.please')" @change="initStageData">
|
||||
<el-select v-model="value" :placeholder="$t('auto.common.please')" @change="initStageData(value)">
|
||||
<el-option
|
||||
v-for="item in stageParam"
|
||||
:key="item.value"
|
||||
@@ -259,12 +259,12 @@ export default {
|
||||
dialogFormVisible10: false,
|
||||
stageParam: [{// 舞台参数
|
||||
value: 'age',
|
||||
label: 'age'
|
||||
label: '一楼监控'
|
||||
}, {
|
||||
value: 'stage_code',
|
||||
label: 'stage_code'
|
||||
label: '二楼监控'
|
||||
}],
|
||||
value: '',
|
||||
value: 'age',
|
||||
stage_code: '',
|
||||
form: {
|
||||
device_code: '',
|
||||
@@ -364,6 +364,10 @@ export default {
|
||||
initStageData(var1) {
|
||||
// 获取舞台数据
|
||||
this.stage_code = var1
|
||||
if (!this.stage_code) {
|
||||
// 可以在这里设置一个默认的stage_code,或者直接返回
|
||||
this.stage_code = 'age'
|
||||
}
|
||||
crudStage.getNewStageDataByCode(this.stage_code).then(res => { // 通过舞台编码获取舞台数据并且赋值到lf对象
|
||||
data = JSON.parse(res.stage_data)
|
||||
lf.render(data)
|
||||
|
||||
Reference in New Issue
Block a user