添加堆垛机站台状态的查询
This commit is contained in:
parent
37476b94ba
commit
81407e0fe4
|
|
@ -14,6 +14,7 @@ import org.wcs.model.vo.serve.AppServeResponse;
|
|||
import org.wcs.model.vo.serve.stacker.QueryStackerInfoVo;
|
||||
import org.wcs.model.vo.serve.stacker.QueryStackerStandVo;
|
||||
import org.wcs.model.vo.serve.stacker.StackerStatusVo;
|
||||
import org.wcs.model.vo.serve.trayConveyLocation.TrayConveyStatusVo;
|
||||
import org.wcs.serve.service.intf.IStackerService;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -105,6 +106,17 @@ public class StackerController {
|
|||
return stackerService.getStackerRunningInfo();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取输送机站台运行信息
|
||||
* @param standId 站台号
|
||||
* @return 结果
|
||||
*/
|
||||
@SaCheckPermission("stackerManage:queryStand")
|
||||
@GetMapping("/queryStackerStandStatus")
|
||||
public AppServeDataResponse<List<TrayConveyStatusVo>> queryStandStatus(@RequestParam("standId") @NotBlank(message = "站台号不能为空") String standId) {
|
||||
return stackerService.queryStandStatus(standId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import org.wcs.factory.AppServeResponseFactory;
|
|||
import org.wcs.mapper.intf.AppStackerInfoService;
|
||||
import org.wcs.mapper.intf.AppStackerStandService;
|
||||
import org.wcs.model.bo.stacker.StackerStatusData;
|
||||
import org.wcs.model.bo.tuple.Tuple2;
|
||||
import org.wcs.model.dto.serve.stacker.AddOrUpdateStackerStandReq;
|
||||
import org.wcs.model.dto.serve.stacker.AddStackerReq;
|
||||
import org.wcs.model.dto.serve.stacker.UpdateStackerInfoReq;
|
||||
|
|
@ -20,9 +21,14 @@ import org.wcs.model.vo.serve.AppServeResponse;
|
|||
import org.wcs.model.vo.serve.stacker.QueryStackerInfoVo;
|
||||
import org.wcs.model.vo.serve.stacker.QueryStackerStandVo;
|
||||
import org.wcs.model.vo.serve.stacker.StackerStatusVo;
|
||||
import org.wcs.model.vo.serve.trayConveyLocation.TrayConveyStatusVo;
|
||||
import org.wcs.plugin.plc.PlcCommunicationFactory;
|
||||
import org.wcs.plugin.plc.communication.IPlcCommunication;
|
||||
import org.wcs.plugin.plc.model.StackerStatus;
|
||||
import org.wcs.plugin.plc.model.TaskConveyStatus;
|
||||
import org.wcs.serve.service.intf.IStackerService;
|
||||
import org.wcs.utils.AppBeanUtils;
|
||||
import org.wcs.utils.AppStringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
@ -196,4 +202,32 @@ public class StackerService implements IStackerService {
|
|||
}
|
||||
return AppServeResponseFactory.success("查询成功", stackerStatusVos);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据堆垛机站台查询状态
|
||||
* @param standId 站台号
|
||||
* @return 堆垛机运行信息
|
||||
*/
|
||||
@Override
|
||||
public AppServeDataResponse<List<TrayConveyStatusVo>> queryStandStatus(String standId) {
|
||||
List<AppStackerStand> stackerStands = appStackerStandService.queryStandInfo(standId);
|
||||
if(stackerStands == null || stackerStands.isEmpty()) {
|
||||
return AppServeResponseFactory.fail("数据服务异常或者点位不存在", null);
|
||||
}
|
||||
AppStackerStand stand = stackerStands.getFirst();
|
||||
IPlcCommunication plcCommunicationByPlcId = PlcCommunicationFactory.getPlcCommunicationByPlcId(stand.getPlcId());
|
||||
if(plcCommunicationByPlcId == null) {
|
||||
return AppServeResponseFactory.fail("该PLCID对应的连接不存在", null);
|
||||
}
|
||||
Tuple2<String, List<TaskConveyStatus>> standStatusTuple2 = plcCommunicationByPlcId.readTaskMultiConveyStatus(standId);
|
||||
if(AppStringUtils.isNotEmpty(standStatusTuple2.item1)) {
|
||||
return AppServeResponseFactory.fail(standStatusTuple2.item1, null);
|
||||
}
|
||||
if(standStatusTuple2.item2 == null) {
|
||||
return AppServeResponseFactory.fail("查询失败", null);
|
||||
}
|
||||
List<TrayConveyStatusVo> standStatusList = AppBeanUtils.copyListProperties(standStatusTuple2.item2, TrayConveyStatusVo::new);
|
||||
return AppServeResponseFactory.success("查询成功", standStatusList);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import org.wcs.model.vo.serve.AppServeResponse;
|
|||
import org.wcs.model.vo.serve.stacker.QueryStackerInfoVo;
|
||||
import org.wcs.model.vo.serve.stacker.QueryStackerStandVo;
|
||||
import org.wcs.model.vo.serve.stacker.StackerStatusVo;
|
||||
import org.wcs.model.vo.serve.trayConveyLocation.TrayConveyStatusVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -21,4 +22,5 @@ public interface IStackerService {
|
|||
AppServeResponse deleteWithStandId(String standId); // 删除一个站台
|
||||
|
||||
AppServeDataResponse<List<StackerStatusVo>> getStackerRunningInfo();
|
||||
AppServeDataResponse<List<TrayConveyStatusVo>> queryStandStatus(String standId); // 查询站台状态
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,14 @@ export default class StackerApi {
|
|||
// 获取堆垛机运行信息
|
||||
static getStackerRunningInfo() {
|
||||
return axiosInstance.get("app/stacker/getStackerRunningInfo");
|
||||
}
|
||||
};
|
||||
// 获取站台状态
|
||||
static queryStandStatus(standId: string) {
|
||||
return axiosInstance.get("app/stacker/queryStackerStandStatus", {
|
||||
params: {
|
||||
standId: standId
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
}
|
||||
|
|
@ -11,6 +11,7 @@ import StackerInTypeFormatter from "@/plugin/formatter/StackerInTypeFormatter.ts
|
|||
import type {AppServeResponse} from "@/interface/api/AppServeResponse.ts";
|
||||
import StringUtils from "@/utils/StringUtils.ts";
|
||||
import AppPermission from "@/components/manage/AppPermission.vue";
|
||||
import StackerStandStatus from "@/components/page/stacker/StackerStandStatus.vue";
|
||||
|
||||
const trueFalseTagStyleFormatter = new TrueFalseTagStyleFormatter(); // 是否枚举格式化
|
||||
const stackerInTypeFormatter = new StackerInTypeFormatter(); // 入库方式
|
||||
|
|
@ -19,6 +20,8 @@ const props = defineProps(['stackerData']); //
|
|||
const emit = defineEmits(['reLoadingTableData']);
|
||||
const standIdDisable = ref<boolean>(false); // 站台号不允许编辑
|
||||
const tableData = ref<IStackerStandTableData[]>([]); // 站台表格数据
|
||||
const selectStandId = ref<string | undefined>(''); // 选择的站台
|
||||
const showStandStatus = ref<boolean>(false); // 是否展示站台状态弹窗
|
||||
const formData = ref<IStackerStandTableData>({
|
||||
standId: '',
|
||||
plcId: 0,
|
||||
|
|
@ -133,9 +136,16 @@ const deleteRow = (index: number, row: any) => {
|
|||
});
|
||||
}).catch(() => {});
|
||||
};
|
||||
const selectedChange = (item: IStackerStandTableData | undefined) => {
|
||||
selectStandId.value = item?.standId;
|
||||
}
|
||||
// 查看站台状态
|
||||
const queryStandStatus = () => {
|
||||
|
||||
if(selectStandId.value == undefined || selectStandId.value.trim() == '') {
|
||||
MessageUtils.warningMessageBox('请选择站台');
|
||||
return;
|
||||
}
|
||||
showStandStatus.value = true;
|
||||
};
|
||||
|
||||
</script>
|
||||
|
|
@ -197,7 +207,7 @@ const queryStandStatus = () => {
|
|||
<el-input v-model="formData.outType" placeholder="请输入出库方式" disabled clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="获取状态地址:" style="width: 250px;">
|
||||
<el-input v-model="formData.readStatusAddress" placeholder="请输入获取状态地址" clearable></el-input>
|
||||
<el-input v-model="formData.readStatusAddress" placeholder="多个地址用 ; 隔开" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="写入任务地址:" style="width: 250px;">
|
||||
<el-input v-model="formData.writeTaskAddress" placeholder="请输入写入任务地址" clearable></el-input>
|
||||
|
|
@ -218,8 +228,12 @@ const queryStandStatus = () => {
|
|||
</el-button-group>
|
||||
</el-row>
|
||||
<el-row class="dataTable">
|
||||
<el-table :data="tableData" stripe border style="width: 100%" max-height="calc(100vh - 270px)">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table :data="tableData" stripe border style="width: 100%" max-height="calc(100vh - 270px)" @current-change="selectedChange">
|
||||
<el-table-column width="60" fixed="left" align="center">
|
||||
<template #default="scope">
|
||||
<el-radio v-model="selectStandId" :label="scope.row.standId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="standId" label="站台编号" width="100" align="center" show-overflow-tooltip fixed="left"/>
|
||||
<el-table-column prop="standName" label="站台名称" align="center" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="plcId" label="管辖的PLC" align="center" min-width="120" show-overflow-tooltip/>
|
||||
|
|
@ -266,6 +280,9 @@ const queryStandStatus = () => {
|
|||
</el-table>
|
||||
</el-row>
|
||||
</el-drawer>
|
||||
|
||||
<!-- 站台状态弹窗-->
|
||||
<StackerStandStatus :stand-id="selectStandId ?? ''" :model-value="showStandStatus"/>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
|
|
|||
109
wcs_web/src/components/page/stacker/StackerStandStatus.vue
Normal file
109
wcs_web/src/components/page/stacker/StackerStandStatus.vue
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
<script setup lang="ts">
|
||||
|
||||
import {onMounted, ref} from "vue";
|
||||
import type {IConveyPlcStatus} from "@/interface/page/trayConvey/IConveyPlcStatus.ts";
|
||||
import StackerApi from "@/api/stacker.ts";
|
||||
import type {AppServeDataResponse} from "@/interface/api/AppServeDataResponse.ts";
|
||||
import {AppServeResponseCodeEnum} from "@/constant/enums/AppServeResponseCodeEnum.ts";
|
||||
import MessageUtils from "@/utils/MessageUtils.ts";
|
||||
|
||||
const modelValue = defineModel('modelValue', {required: true, default: false});
|
||||
const props = defineProps<{
|
||||
standId: string
|
||||
}>()
|
||||
const trayConveyPlcStatusList = ref<IConveyPlcStatus[]>([]); // 从服务器获取的数据
|
||||
const selectIndex = ref<number | null>(null);
|
||||
const trayConveyPlcStatus = ref<IConveyPlcStatus>({}); // 当前状态
|
||||
|
||||
const close = () => {
|
||||
modelValue.value = false;
|
||||
};
|
||||
|
||||
const indexChange = () => {
|
||||
if(selectIndex.value == null) {
|
||||
return;
|
||||
}
|
||||
trayConveyPlcStatus.value = trayConveyPlcStatusList.value[selectIndex.value];
|
||||
};
|
||||
|
||||
const query = () => {
|
||||
// 获取数据
|
||||
trayConveyPlcStatusList.value = [];
|
||||
trayConveyPlcStatus.value = {};
|
||||
const loadingInstance = MessageUtils.loading('正在查询,请稍后...');
|
||||
StackerApi.queryStandStatus(props.standId).then((res) => {
|
||||
const responseString = JSON.stringify(res.data);
|
||||
const response = JSON.parse(responseString) as AppServeDataResponse<IConveyPlcStatus[]>;
|
||||
if (response && response.code == AppServeResponseCodeEnum.SUCCESS && response.data != undefined) {
|
||||
trayConveyPlcStatusList.value = response.data;
|
||||
MessageUtils.successMessage('查询成功');
|
||||
return;
|
||||
}
|
||||
MessageUtils.warningMessageBox(response.msg, '警告');
|
||||
}).catch(() => {}).finally( () => {
|
||||
loadingInstance.close();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-dialog v-model="modelValue" :title="props.standId + '当前状态' " @close="close" :close-on-click-modal="false" @opened="query">
|
||||
<el-scrollbar style="height:60vh;">
|
||||
<el-row style="margin-bottom: 5px">
|
||||
<el-col :span="20">
|
||||
<el-select v-model="selectIndex" placeholder="请选择工位序号" @change="indexChange">
|
||||
<el-option v-for="(item, index) in trayConveyPlcStatusList" :key="index" :label="index + 1" :value="index"/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-button type="primary" @click="query" style="margin-left: 3px">查询</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-card shadow="never" style="width: 100%">
|
||||
<el-form :model="trayConveyPlcStatus" label-position="right" label-width="120px" require-asterisk-position="right">
|
||||
<el-form-item label="设备号:" required>
|
||||
<el-input v-model="trayConveyPlcStatus.conveyNo" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="PLC任务号:" required>
|
||||
<el-input v-model="trayConveyPlcStatus.plcTaskId" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务允许:" required>
|
||||
<el-input v-model="trayConveyPlcStatus.taskAllow" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="控制方式:" required>
|
||||
<el-input v-model="trayConveyPlcStatus.controllerModel" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备状态:" required>
|
||||
<el-input v-model="trayConveyPlcStatus.conveyStatus" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否有AGV:" required>
|
||||
<el-input v-model="trayConveyPlcStatus.haveAgv" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具尺寸:" required>
|
||||
<el-input v-model="trayConveyPlcStatus.vehicleSize" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具重量:" required>
|
||||
<el-input v-model="trayConveyPlcStatus.vehicleWeight" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="错误码:" required>
|
||||
<el-input v-model="trayConveyPlcStatus.errorCode" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="条码:" required>
|
||||
<el-input v-model="trayConveyPlcStatus.vehicleCode" disabled/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</el-row>
|
||||
</el-scrollbar>
|
||||
<template #footer>
|
||||
<el-button type="danger" @click="close">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Loading…
Reference in New Issue
Block a user