Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceInput.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Web/src/api/wcs/wcsDevice.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Web/src/views/device/alarmManage/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Web/src/views/device/deviceInfo/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Web/src/views/device/deviceStartStop/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceInput.cs
@@ -363,6 +363,18 @@ } public class WcsDeviceStartStop { /// <summary> /// 操作类型 /// </summary> public string Type { get; set; } /// <summary> /// 楼层 /// </summary> public string Layer { get; set; } } Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs
@@ -375,6 +375,81 @@ } /// <summary> /// 手动写入PLC启停信息 /// </summary> /// <param name="input"></param> /// <returns></returns> [HttpPost] [ApiDescriptionSettings(Name = "WriteStartStop")] [DisplayName("写入PLC启停信息")] public async Task WriteStartStop(WcsDeviceStartStop input) { WcsPlc modPlc; string DbNum = "";// DB块 var plcList = await _wcsPlcRep.Context.Queryable<WcsPlc>().Where(s => s.Type == PLCTypeEnum.ConveyorLine && s.IsDelete == false).ToListAsync(); if (input.Layer == "1") { modPlc = plcList.FirstOrDefault(m => m.Text == "1层托盘输送线"); if (modPlc == null) throw Oops.Bah($"未查询到1楼层PLC信息"); DbNum = ""; } else if (input.Layer == "2") { modPlc = plcList.FirstOrDefault(m => m.Text == "2层托盘输送线"); if (modPlc == null) throw Oops.Bah($"未查询到2楼层PLC信息"); DbNum = "91"; PLCUtil modUtil = new PLCUtil(modPlc); switch (input.Type) { case "TwoPalletStart": modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.0", "true"); break; case "OnePalletStop": modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.1", "true"); break; case "TwoMaStart": modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "58.0", "true"); break; case "TwoMaStop": modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "58.1", "true"); break; case "TwoMaTwoStart": modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "58.2", "true"); break; case "TwoMaTwoStop": modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "58.3", "true"); break; case "TwoBoxStart": modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.2", "true"); break; case "TwoBoxStop": modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.3", "true"); break; default: break; } modUtil.Close(); } else if (input.Layer == "3") { modPlc = plcList.FirstOrDefault(m => m.Text == "3层托盘输送线"); if (modPlc == null) throw Oops.Bah($"未查询到3楼层PLC信息"); DbNum = ""; } else { throw Oops.Bah("操作类型信息错误"); } } #endregion /// <summary> Web/src/api/wcs/wcsDevice.ts
@@ -17,6 +17,8 @@ WriteInfo = '/api/wcsDevice/WriteInfo', WriteTaskInfo = '/api/wcsDevice/WriteTaskInfo', WriteStartStop = '/api/wcsDevice/WriteStartStop', } // 增加设备信息 export const WriteInfo = (params?: any) => @@ -25,6 +27,20 @@ method: 'post', data: params, }); // 增加设备信息 export const WriteTaskInfo = (params?: any) => request({ url: Api.WriteTaskInfo, method: 'post', data: params, }); // 增加设备信息 export const WriteStartStop = (params?: any) => request({ url: Api.WriteStartStop, method: 'post', data: params, }); // 增加设备信息 export const addWcsDevice = (params?: any) => Web/src/views/device/alarmManage/index.vue
@@ -11,9 +11,10 @@ <el-table-column prop="alarmName" label="描述" align="center"></el-table-column> <el-table-column prop="stationNum" label="位置" align="center"></el-table-column> <el-table-column prop="alarmTime" label="时间" align="center"></el-table-column> <el-table-column label="操作" width="80" align="center" fixed="right" show-overflow-tooltip="" > <el-table-column label="操作" width="80" align="center" fixed="right" show-overflow-tooltip=""> <template #default="scope"> <el-button icon="ele-Check" size="small" text="" type="primary" @click="topUpAlarm(scope.row)" >恢复</el-button> <el-button icon="ele-Check" size="small" text="" type="primary" @click="topUpAlarm(scope.row)">恢复</el-button> </template> </el-table-column> </el-table> @@ -195,7 +196,7 @@ // row.Layer = 3; // } // row.TypeName = type; // console.log(row); // var res = await WriteInfo(row); // console.log(res.data.result); @@ -203,22 +204,28 @@ // } //报警恢复 const topUpAlarm = async (row: any) => { ElMessageBox.confirm(`确定要报警恢复任务吗?`, "提示", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning", }) .then(async () => { var param = Object.assign(row); console.log(row.stationNum); console.log(param); // await topUpWcsTask(param); // handleQuery(); // handleQuery2(); ElMessage.success("置顶任务成功"+param); }) .catch(() => { }); ElMessageBox.confirm(`确定要报警恢复任务吗?`, "提示", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning", }) .then(async () => { var param = Object.assign(row); console.log(row.stationNum); console.log(layer.value); var data = { LocatNo: row.stationNum,//工位 Layer: layer.value,//楼层 } var res = await WriteInfo(data); console.log(res.data.result); // await topUpWcsTask(param); // handleQuery(); // handleQuery2(); // ElMessage.success("报警恢复失败:" + res.data.result); }) .catch(() => { }); } Web/src/views/device/deviceInfo/index.vue
@@ -198,7 +198,7 @@ <script lang="ts" setup> import { ref, reactive, onMounted } from 'vue'; import { listStatus, listPosition } from '/@/api/wcs/wcsPlc'; import { WriteInfo } from '/@/api/wcs/wcsDevice'; import { WriteInfo,WriteTaskInfo } from '/@/api/wcs/wcsDevice'; import { signalR } from './signalR'; import { cellsDataLine, cellsDataOne, cellsDataTwo, cellsDataThree } from './data'; import { ElMessage } from "element-plus"; @@ -436,7 +436,7 @@ row.Layer = 3; } row.TypeName = type; var res = await WriteInfo(row); var res = await WriteTaskInfo(row); console.log(type+"抬起事件"); // ElMessage.success('asdf'+ res.data.result); Web/src/views/device/deviceStartStop/index.vue
@@ -2,23 +2,27 @@ <el-row :gutter="10"> <el-col :span="8"> <el-collapse v-model="activeNames"> <el-collapse-item title="仓库二层" name="1"> <el-collapse-item title="仓库一层" name="1"> <el-card class="box-card" shadow="hover"> <el-switch v-model="state.boRunningState" active-text="" inactive-text="托盘输送" @change=""></el-switch> <el-text style="margin-right: 15px;">托盘输送</el-text> <el-button @click="write('OnePalletStart','1')">启动</el-button> <el-button @click="write('OnePalletStop','1')">停止</el-button> </el-card> <el-card class="box-card" shadow="hover" style="margin-top: 3px;"> <el-switch active-text="" inactive-text="拆跺机器人1" @change=""></el-switch> <el-text style="margin-right: 15px;">拆跺机器人1</el-text> <el-button @click="write('OneChaiStart','1')">启动</el-button> <el-button @click="write('OneChaiStop','1')">停止</el-button> </el-card> <el-card class="box-card" shadow="hover" style="margin-top: 3px;"> <el-switch active-text="" inactive-text="拆跺机器人2" @change=""></el-switch> <el-text style="margin-right: 15px;">拆跺机器人2</el-text> <el-button @click="write('OneChaiTwoStart','1')">启动</el-button> <el-button @click="write('OneChaiTwoStop','1')">停止</el-button> </el-card> <el-card class="box-card" shadow="hover" style="margin-top: 3px;"> <el-switch active-text="" inactive-text="件箱输送" @change=""></el-switch> <el-text style="margin-right: 15px;">件箱输送</el-text> <el-button @click="write('OneBoxStart','1')">启动</el-button> <el-button @click="write('OneBoxStop','1')">停止</el-button> </el-card> </el-collapse-item> </el-collapse> @@ -28,21 +32,25 @@ <el-collapse v-model="activeNames2"> <el-collapse-item title="仓库二层" name="2"> <el-card class="box-card" shadow="hover"> <el-switch active-text="" inactive-text="托盘输送" @change=""></el-switch> <el-text style="margin-right: 15px;">托盘输送</el-text> <el-button @click="write('TwoPalletStart','2')">启动</el-button> <el-button @click="write('TwoPalletStop','2')">停止</el-button> </el-card> <el-card class="box-card" shadow="hover" style="margin-top: 3px;"> <el-switch active-text="" inactive-text="码垛机器人1" @change=""></el-switch> <el-text style="margin-right: 15px;">码跺机器人1</el-text> <el-button @click="write('TwoMaStart','2')">启动</el-button> <el-button @click="write('TwoMaStop','2')">停止</el-button> </el-card> <el-card class="box-card" shadow="hover" style="margin-top: 3px;"> <el-switch active-text="" inactive-text="码垛机器人2" @change=""></el-switch> <el-text style="margin-right: 15px;">码跺机器人2</el-text> <el-button @click="write('TwoMaTwoStart','2')">启动</el-button> <el-button @click="write('TwoMaTwoStop','2')">停止</el-button> </el-card> <el-card class="box-card" shadow="hover" style="margin-top: 3px;"> <el-switch active-text="" inactive-text="件箱输送" @change=""></el-switch> <el-text style="margin-right: 15px;">件箱输送</el-text> <el-button @click="write('TwoBoxStart','2')">启动</el-button> <el-button @click="write('TwoBoxStop','2')">停止</el-button> </el-card> </el-collapse-item> </el-collapse> @@ -52,8 +60,9 @@ <el-collapse v-model="activeNames3"> <el-collapse-item title="仓库三层" name="3"> <el-card class="box-card" shadow="hover" style="margin-top: 3px;"> <el-switch active-text="" inactive-text="托盘输送" @change=""></el-switch> <el-text style="margin-right: 15px;">托盘输送</el-text> <el-button @click="write('ThreePalletStart','3')">启动</el-button> <el-button @click="write('ThreePalletStop','3')">停止</el-button> </el-card> </el-collapse-item> </el-collapse> @@ -65,7 +74,11 @@ <script lang="ts" setup> import { ref } from 'vue'; import { ref, reactive, onMounted } from 'vue'; import { listStatus, listPosition } from '/@/api/wcs/wcsPlc'; import { WriteStartStop } from '/@/api/wcs/wcsDevice'; import { ElMessage } from "element-plus"; const activeNames = ref(['1']) const activeNames2 = ref(['2']) @@ -73,7 +86,17 @@ const state = ref<any>({}); const write = async (type: string,layer: string) => { var data = { Type:type, Layer: layer }; var res = await WriteStartStop(data); console.log(res.data.result); // ElMessage.success(res.data.result); } </script>