Merge branch 'master' of http://bore.pub:10439/r/HangZhouMes
| | |
| | | layoutnumber:'钢化版图号', |
| | | numberglasses:'玻璃数量', |
| | | specifytemperinga:'是否指定钢化该条信息?', |
| | | temperedswitch:'钢化开关', |
| | | dutyinformation:'值班信息', |
| | | line:'线路', |
| | | process:'工序', |
| | | team:'班组', |
| | | basic:'设备', |
| | | add:'确认保存', |
| | | cancel:'取消', |
| | | }, |
| | | workOrder:{ |
| | | glassID:'玻璃ID', |
| | |
| | | number :'序号', |
| | | layer :'层', |
| | | typebreakage :'破损类型', |
| | | ptypebreakage :' 请选择破损类型', |
| | | causebreakage :'破损原因', |
| | | pcausebreakage :'请选择破损原因', |
| | | responsibleprocess :'责任工序', |
| | | responsiblepersonnel :'责任人员', |
| | | presponsiblepersonnel :'请输入责任人员', |
| | | responsibleteam :'责任班组', |
| | | presponsibleteam :'请选择责任班组', |
| | | responsibleequipment :'责任设备', |
| | | presponsibleequipment :'请选择责任设备', |
| | | remark :'备注', |
| | | premark :'请输入备注', |
| | | }, |
| | | } |
| | |
| | | <img src="../assets/northGlass.ico" |
| | | alt="" |
| | | style="max-width: 100%;max-height: 100%"> |
| | | <h3 style="margin: 1rem ;font-weight: bold;width: 33vw;"> {{ $t('main.titleFirst') }}{{ user }}{{ $t('main.titleLast') }}</h3> |
| | | <h3 style="margin: 1rem ;font-weight: bold;width: 33vw;"> {{ $t('main.titleFirst') }}{{ userName }}{{ $t('main.titleLast') }}</h3> |
| | | <!-- <div class="header-left"> |
| | | <el-button :icon="isCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold'" @click="toggleCollapse" |
| | | style="height:30px;"></el-button> |
| | |
| | | // WebSocketService.js
|
| | |
|
| | | let socket = null;
|
| | | let messages='' ;
|
| | | export const initializeWebSocket = (socketUrl, messageHandler) => {
|
| | | let messages='' ;
|
| | | if (typeof WebSocket === "undefined") {
|
| | | console.log("Your browser does not support WebSocket");
|
| | | return null;
|
| | |
| | | // src/services/api.js
|
| | | import request from 'request';
|
| | | import request from '../utils/request';
|
| | | import { ElMessage } from 'element-plus';
|
| | |
|
| | | // Replace with your actual backend base URL
|
| | |
|
| | | export const findTasks = (id, newState) => {
|
| | | // Function to find list of raw usages
|
| | | const BASE_URL = 'glassStorage/api/rawUsage';
|
| | | const taskBASE_URL = 'glassStorage/api/storageTask';
|
| | |
|
| | | export const findTasks = () => {
|
| | | const url = `glassStorage/api/storageTask/findTasks`;
|
| | | const options = {
|
| | | method: 'POST',
|
| | | method: 'get',
|
| | | url,
|
| | | json: true,
|
| | | body: { id, enableState: newState }
|
| | | |
| | | };
|
| | | |
| | | return new Promise((resolve, reject) => {
|
| | | request(options, (error, response, body) => {
|
| | | if (error) {
|
| | | reject(new Error(error.message));
|
| | | } else {
|
| | | resolve(body);
|
| | | }
|
| | | });
|
| | | });
|
| | | };
|
| | |
|
| | |
|
| | |
|
| | | export const findList = (params) => {
|
| | | const url = `${BASE_URL}/findList`;
|
| | | const options = {
|
| | | method: 'post',
|
| | | url,
|
| | | json: true,
|
| | | body: params
|
| | | };
|
| | |
|
| | | return new Promise((resolve, reject) => {
|
| | |
| | | });
|
| | | });
|
| | | };
|
| | |
|
| | | // Function to find raw usage by ID
|
| | | export const findById = (id) => {
|
| | | const url = `${BASE_URL}/${id}`;
|
| | | const options = {
|
| | | method: 'get',
|
| | | url,
|
| | | json: true
|
| | | };
|
| | |
|
| | | return new Promise((resolve, reject) => {
|
| | | request(options, (error, response, body) => {
|
| | | if (error) {
|
| | | reject(new Error(error.message));
|
| | | } else {
|
| | | resolve(body);
|
| | | }
|
| | | });
|
| | | });
|
| | | };
|
| | |
|
| | | // Function to insert a new raw usage
|
| | | export const insertRawUsage = (rawUsage) => {
|
| | | const url = `${BASE_URL}`;
|
| | | const options = {
|
| | | method: 'post',
|
| | | url,
|
| | | json: true,
|
| | | body: rawUsage
|
| | | };
|
| | |
|
| | | return new Promise((resolve, reject) => {
|
| | | request(options, (error, response, body) => {
|
| | | if (error) {
|
| | | reject(new Error(error.message));
|
| | | } else {
|
| | | resolve(body);
|
| | | }
|
| | | });
|
| | | });
|
| | | };
|
| | |
|
| | |
|
| | | export const updateRawUsage = async (rawUsage) => {
|
| | | try {
|
| | | const response = await request.post(`${BASE_URL}/updaterawUsage`, rawUsage);
|
| | | ElMessage.success('修改成功');
|
| | | return response.data;
|
| | | } catch (error) {
|
| | | ElMessage.error('修改失败');
|
| | | throw error;
|
| | | }
|
| | | };
|
| | |
|
| | | export const deleteRawUsage = async (id) => {
|
| | | try {
|
| | | const response = await request.post(`${BASE_URL}/id`, id);
|
| | | ElMessage.success('删除原始使用数据成功');
|
| | | return response.data;
|
| | | } catch (error) {
|
| | | ElMessage.error('删除原始使用数据失败');
|
| | | throw error;
|
| | | }
|
| | | };
|
| | |
|
| | | export const inStorage = async (RawUsageAndShelfRack) => {
|
| | | try {
|
| | | const response = await request.post(`${BASE_URL}/inStorage`, RawUsageAndShelfRack);
|
| | | ElMessage.success('入库操作成功');
|
| | | return response.data;
|
| | | } catch (error) {
|
| | | ElMessage.error('入库操作失败');
|
| | | throw error;
|
| | | }
|
| | | };
|
| | |
|
| | | export const outStorage = async (RawUsageAndShelfRack) => {
|
| | | try {
|
| | | const response = await request.post(`${BASE_URL}/outStorage`, RawUsageAndShelfRack);
|
| | | ElMessage.success('出库操作成功');
|
| | | return response.data;
|
| | | } catch (error) {
|
| | | ElMessage.error('出库操作失败');
|
| | | throw error;
|
| | | }
|
| | | };
|
| | |
|
| | |
|
| | |
|
| | | export const taskUpdate = async (task) => {
|
| | | try {
|
| | | const response = await request.post(`${taskBASE_URL}/taskUpdate`, task);
|
| | |
|
| | | return response.data;
|
| | | } catch (error) {
|
| | | |
| | | throw error;
|
| | | }
|
| | | };
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | const API_URL = 'glassStorage/api/shelfRack'; // Adjust this based on your actual API URL
|
| | |
|
| | | export const shelfRackfindList = (params) => {
|
| | | return request.post(`${API_URL}/findList`, params)
|
| | | .then(response => response.data)
|
| | | .catch(error => {
|
| | | throw error; // Handle errors appropriately in your frontend
|
| | | });
|
| | | };
|
| | |
|
| | | export const shelfRackfindById = (id) => {
|
| | | return request.get(`${API_URL}/${id}`)
|
| | | .then(response => response.data)
|
| | | .catch(error => {
|
| | | throw error;
|
| | | });
|
| | | };
|
| | |
|
| | | export const insertShelfRack = (shelfRack) => {
|
| | | return request.post(`${API_URL}`, shelfRack)
|
| | | .then(response => response.data)
|
| | | .catch(error => {
|
| | | throw error;
|
| | | });
|
| | | };
|
| | |
|
| | | export const updateShelfRack = (shelfRack) => {
|
| | | return request.put(`${API_URL}`, shelfRack)
|
| | | .then(response => response.data)
|
| | | .catch(error => {
|
| | | throw error;
|
| | | });
|
| | | };
|
| | |
|
| | | export const shelfRackdeleteById = (id) => {
|
| | | return request.delete(`${API_URL}/${id}`)
|
| | | .then(response => response.data)
|
| | | .catch(error => {
|
| | | throw error;
|
| | | });
|
| | | };
|
| | |
|
| | | export const findShelfRack = () => {
|
| | | return request.get(`${API_URL}/findshelfrack`)
|
| | | .then(response => response.data)
|
| | | .catch(error => {
|
| | | throw error;
|
| | | });
|
| | | }; |
| | |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | |
| | | import request from "@/utils/request" |
| | | import { ref, onMounted , onBeforeUnmount} from "vue"; |
| | | import { ref, onMounted , onBeforeUnmount,onUnmounted} from "vue"; |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | // import { ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | |
| | | }; |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | |
| | | const adda = ref(false) |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import request from "@/utils/request" |
| | | import { ref, onMounted , onBeforeUnmount} from "vue"; |
| | | import { ref, onMounted , onBeforeUnmount,onUnmounted} from "vue"; |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | // import { ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | |
| | | |
| | | |
| | | |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/downcache`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | |
| | | })); |
| | | |
| | | }; |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | |
| | | <template>
|
| | | <div class="app-container" style="height: 600px;">
|
| | | <!-- <el-card style="flex: 1; margin-left: 10px; " :loading="loading"> -->
|
| | | <div slot="header" class="clearfix" style="display: flex; align-items: center;">
|
| | | <!-- 左侧按钮组 -->
|
| | | <div >
|
| | | <el-button type="success" size="mini" style="margin-left: 10px;" @click="storage()">原片仓储详情</el-button>
|
| | | <el-button type="success" size="mini" @click="handleInbound()">入库</el-button>
|
| | | <el-button type="success" size="mini" >吊装位入库</el-button>
|
| | | </div>
|
| | | <!-- 右侧选择框 -->
|
| | | <el-form-item style="margin-top: 15px; width: 150px;margin-left: 10px;">
|
| | | <el-select v-model="formData2.dzw" placeholder="请选择吊装位">
|
| | | <el-option label="吊装位1" value="吊装位1"></el-option>
|
| | | <el-option label="吊装位2" value="吊装位2"></el-option>
|
| | | <!-- 根据实际情况添加更多选项 -->
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | </div>
|
| | | <el-dialog v-model="Hidden" top="10vh" width="80%" >
|
| | | <div class="app-container">
|
| | | <el-card style="flex: 1; margin-left: 10px" :loading="loading">
|
| | | <div
|
| | | slot="header"
|
| | | class="clearfix"
|
| | | style="display: flex; align-items: center"
|
| | | >
|
| | | <!-- 左侧按钮组 -->
|
| | | <div>
|
| | | <el-button type="success" size="mini" @click="storage()"
|
| | | >原片仓储详情</el-button
|
| | | >
|
| | | <el-button type="success" size="mini" @click="handleInbound()"
|
| | | >入库</el-button
|
| | | >
|
| | | <el-button type="success" size="mini">吊装位入库</el-button>
|
| | | </div>
|
| | |
|
| | | <!-- 右侧选择框 -->
|
| | | <el-form-item style="margin-top: 15px; width: 150px">
|
| | | <el-select v-model="formData2.dzw" placeholder="请选择吊装位">
|
| | | <el-option label="吊装位1" value="吊装位1"></el-option>
|
| | | <el-option label="吊装位2" value="吊装位2"></el-option>
|
| | | <!-- 根据实际情况添加更多选项 -->
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | </div>
|
| | | <el-dialog v-model="Hidden" top="10vh" width="80%">
|
| | | <el-table
|
| | | :data="tableData"
|
| | | v-model="dialogVisible3"
|
| | | style="width: 98%; height: 200px"
|
| | | @selection-change="handleSelectionChange"
|
| | | :header-cell-style="{ background: '#F2F3F5', color: '#1D2129' }"
|
| | | ref="table"
|
| | | empty-text="No Data"
|
| | | >
|
| | | <el-table-column prop="number" label="库位号"></el-table-column>
|
| | | <el-table-column prop="rawType" label="类型"></el-table-column>
|
| | | <el-table-column prop="rawWidth" label="长度(mm)"></el-table-column>
|
| | | <el-table-column prop="rawHeight" label="高度(mm)"></el-table-column>
|
| | | <el-table-column
|
| | | prop="rawThickness"
|
| | | label="厚度(mm)"
|
| | | ></el-table-column>
|
| | | <el-table-column prop="pieces" label="数量"></el-table-column>
|
| | | <el-table-column prop="createTime" label="入库时间"></el-table-column>
|
| | | <el-table-column prop="batchId" label="批次号"></el-table-column>
|
| | |
|
| | | <el-table-column
|
| | | align="center"
|
| | | label="料架状态"
|
| | | min-width="80"
|
| | | prop="enableState"
|
| | | >
|
| | | <template #default="scope">
|
| | | <el-tag
|
| | | :type="getTagType(scope.row.enableState)"
|
| | | @click="toggleStatus(scope.row)"
|
| | | >
|
| | | {{ scope.row.enableState === 1 ? "启用" : "未启用" }}
|
| | | </el-tag>
|
| | | </template>
|
| | | </el-table-column>
|
| | |
|
| | | <!-- 操作列 -->
|
| | | <el-table-column label="操作" width="250">
|
| | | <template #default="{ row }">
|
| | | <el-button
|
| | | type="primary"
|
| | | size="mini"
|
| | | @click="edithandleRowClick(row)"
|
| | | >修改</el-button
|
| | | >
|
| | | <el-button type="danger" size="mini" @click="handleDelete(row)"
|
| | | >删除</el-button
|
| | | >
|
| | | <el-button type="warning" size="mini" @click="handleCheckout(row)"
|
| | | >出库</el-button
|
| | | >
|
| | | <!-- <el-button type="success" size="mini" @click="addglass()">添加原片</el-button> -->
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | | <el-pagination
|
| | | v-if="totalItems > 0"
|
| | | background
|
| | | layout="prev, pager, next"
|
| | | :total="totalItems"
|
| | | :page-size="pageSize"
|
| | | @current-change="handleCurrentChange"
|
| | | ></el-pagination>
|
| | | </el-dialog>
|
| | |
|
| | | <el-table
|
| | | :data="tableData" v-model="dialogVisible3"
|
| | | style="width: 98%; height: 200px"
|
| | | :data="tasktableData"
|
| | | style="width: 98%; height: 150px"
|
| | | @selection-change="handleSelectionChange"
|
| | | :header-cell-style="{ background: '#F2F3F5', color: '#1D2129' }"
|
| | | ref="table"
|
| | | empty-text="No Data"
|
| | | >
|
| | | <el-table-column prop="location" label="库位号"></el-table-column>
|
| | | <el-table-column prop="type" label="类型"></el-table-column>
|
| | | <el-table-column prop="length" label="长度(mm)"></el-table-column>
|
| | | <el-table-column prop="height" label="高度(mm)"></el-table-column>
|
| | | <el-table-column prop="thickness" label="厚度(mm)"></el-table-column>
|
| | | <el-table-column prop="quantity" label="数量"></el-table-column>
|
| | | <el-table-column prop="entry_time" label="入库时间"></el-table-column>
|
| | | <el-table-column prop="batchnumber" label="批次号"></el-table-column>
|
| | | <template #header>
|
| | | <div style="display: flex; align-items: center">
|
| | | <span style="font-size: 16px; font-weight: bold; margin-right: 20px"
|
| | | >任务列表</span
|
| | | >
|
| | | </div>
|
| | | </template>
|
| | | <el-table-column prop="id" label="Glassid"></el-table-column>
|
| | | <el-table-column
|
| | | prop="taskType"
|
| | | label="任务描述"
|
| | | width="250"
|
| | | :formatter="formatTaskType"
|
| | | ></el-table-column>
|
| | | <el-table-column
|
| | | prop="rawThickness"
|
| | | label="玻璃厚度"
|
| | | ></el-table-column>
|
| | | <el-table-column prop="color" label="玻璃膜系"></el-table-column>
|
| | | <el-table-column prop="startTime" label="创建时间"></el-table-column>
|
| | |
|
| | | <el-table-column
|
| | | align="center"
|
| | | label="料架状态"
|
| | | label="任务状态"
|
| | | min-width="80"
|
| | | prop="shelf_status"
|
| | | prop="taskState"
|
| | | >
|
| | | <template #default="scope">
|
| | | <el-tag :type="getTagType(scope.row.shelf_status)" @click="toggleStatus(scope.row)">
|
| | | {{ scope.row.shelf_status === 1 ? '启用' : '未启用' }}
|
| | | </el-tag>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <template #default="scope">
|
| | | <el-tag :type="getTagType2(scope.row.taskState)">
|
| | | {{ scope.row.taskState == "completed" ? "完成" : "进行中" }}
|
| | | </el-tag>
|
| | | </template>
|
| | | </el-table-column>
|
| | |
|
| | | <!-- 操作列 -->
|
| | | <el-table-column label="操作" width="250">
|
| | | <el-table-column label="操作" width="350">
|
| | | <template #default="{ row }">
|
| | | <el-button type="primary" size="mini" @click="edithandleRowClick(row)">修改</el-button>
|
| | | <el-button type="danger" size="mini" @click="handleDelete(row)">删除</el-button>
|
| | | <el-button type="warning" size="mini" @click="handleCheckout(row)">出库</el-button>
|
| | | <!-- <el-button type="success" size="mini" @click="addglass()">添加原片</el-button> -->
|
| | | <el-button type="primary" size="mini" @click="handleRestart(row)"
|
| | | >重新开始</el-button
|
| | | >
|
| | | <el-button type="danger" size="mini" @click="handleDeletetask(row)"
|
| | | >删除任务</el-button
|
| | | >
|
| | | <el-button type="success" size="mini" @click="handleComplete(row)"
|
| | | >任务完成</el-button
|
| | | >
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | | <el-pagination
|
| | | v-if="totalItems > 0"
|
| | | background
|
| | | layout="prev, pager, next"
|
| | | :total="totalItems"
|
| | | :page-size="pageSize"
|
| | | @current-change="handleCurrentChange"
|
| | | ></el-pagination>
|
| | | </el-dialog>
|
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;" v-loading="loading">
|
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;">
|
| | | <el-table
|
| | | :data="tasktableData"
|
| | | height="240"
|
| | | @selection-change="handleSelectionChange"
|
| | | :header-cell-style="{ background: '#F2F3F5', color: '#1D2129' }"
|
| | | ref="table"
|
| | | empty-text="No Data"
|
| | | >
|
| | | <template #header>
|
| | | <div style="display: flex; align-items: center;">
|
| | | <span style="font-size: 16px; font-weight: bold; margin-right: 20px;">任务列表</span>
|
| | | </div>
|
| | | </template>
|
| | | <el-table-column prop="Glassid" label="Glassid"></el-table-column>
|
| | | <el-table-column prop="taskDescription" label="任务描述" width="250"></el-table-column>
|
| | | <el-table-column prop="glassThickness" label="玻璃厚度"></el-table-column>
|
| | | <el-table-column prop="glassFilm" label="玻璃膜系"></el-table-column>
|
| | | <el-table-column prop="creationTime" label="创建时间"></el-table-column>
|
| | | <el-table-column
|
| | | align="center"
|
| | | label="任务状态"
|
| | | min-width="80"
|
| | | prop="taskStatus"
|
| | | >
|
| | | <template #default="scope">
|
| | | <el-tag :type="getTagType2(scope.row.taskStatus)">
|
| | | {{ scope.row.taskStatus == 'completed' ? '完成' : '进行中' }}
|
| | | </el-tag>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <!-- 操作列 -->
|
| | | <el-table-column label="操作" width="350">
|
| | | <template #default="{ row }">
|
| | | <el-button type="primary" size="mini" @click="handleRestart(row)">重新开始</el-button>
|
| | | <el-button type="danger" size="mini" @click="handleDeletetask(row)">删除任务</el-button>
|
| | | <el-button type="success" size="mini" @click="handleComplete(row)">任务完成</el-button>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | | </div>
|
| | | </el-card>
|
| | | <!-- </el-card> -->
|
| | | <div class="img-ypcc" >
|
| | | <div class="img-car1" :style="'z-index:999;left:397px;top:205px;position:absolute;'">
|
| | | <div v-show="cellshow1" style="margin-top:10px;width:200px;height:5px;background-color:#409EFF;"></div>
|
| | | </el-card>
|
| | |
|
| | | <div class="img-ypcc">
|
| | | <div
|
| | | class="img-car1"
|
| | | :style="'z-index:999;left:397px;top:205px;position:absolute;'"
|
| | | >
|
| | | <div
|
| | | v-show="cellshow1"
|
| | | style="
|
| | | margin-top: 10px;
|
| | | width: 200px;
|
| | | height: 5px;
|
| | | background-color: #409eff;
|
| | | "
|
| | | ></div>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | |
|
| | | <!-- 入库对话框 -->
|
| | | <el-dialog
|
| | | title="入库"
|
| | |
| | | >
|
| | | <el-form :model="formData" ref="form" label-width="80px">
|
| | | <el-form-item label="进库料架">
|
| | | <el-select v-model="formData.shelf" placeholder="请选择进库料架">
|
| | | <el-option label="A1" value="A1"></el-option>
|
| | | <el-option label="B2" value="B2"></el-option>
|
| | | <el-select v-model="formData.number" placeholder="请选择进库料架">
|
| | | <el-option label="1" value="1"></el-option>
|
| | | <el-option label="2" value="2"></el-option>
|
| | | <!-- 根据实际情况添加更多选项 -->
|
| | | </el-select>
|
| | | </el-form-item>
|
| | |
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="宽度">
|
| | | <el-input v-model.number="formData.width" placeholder="请输入宽度"></el-input>
|
| | | <el-input
|
| | | v-model.number="formData.rawWidth"
|
| | | placeholder="请输入宽度"
|
| | | ></el-input>
|
| | | </el-form-item>
|
| | | <el-form-item label="高度">
|
| | | <el-input v-model.number="formData.height" placeholder="请输入高度"></el-input>
|
| | | <el-input
|
| | | v-model.number="formData.rawHeight"
|
| | | placeholder="请输入高度"
|
| | | ></el-input>
|
| | | </el-form-item>
|
| | | <el-form-item label="厚度">
|
| | | <el-input v-model.number="formData.thickness" placeholder="请输入厚度"></el-input>
|
| | | <el-input
|
| | | v-model.number="formData.rawThickness"
|
| | | placeholder="请输入厚度"
|
| | | ></el-input>
|
| | | </el-form-item>
|
| | | <el-form-item label="数量">
|
| | | <el-input v-model.number="formData.quantity" placeholder="请输入数量"></el-input>
|
| | | <el-input
|
| | | v-model.number="formData.pieces"
|
| | | placeholder="请输入数量"
|
| | | ></el-input>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <div slot="footer" class="dialog-footer">
|
| | | <el-button @click="dialogVisible = false">取 消</el-button>
|
| | | <el-button type="primary" @click="handleConfirmInbound">确 定</el-button>
|
| | | <el-button type="primary" @click="handleConfirmInbound"
|
| | | >确 定</el-button
|
| | | >
|
| | | </div>
|
| | | </el-dialog>
|
| | | <el-dialog title="添加原片" v-model="dialogVisible3" width="50%">
|
| | | <el-form :model="formData3" ref="form" label-width="80px">
|
| | | <el-form-item label="颜色膜系">
|
| | | <el-input v-model="formData.selectedColor" readonly style="width: 250px; height: 35px; font-size: 20px"></el-input>
|
| | | <el-dropdown @command="handleCommand">
|
| | | <span class="el-dropdown-link">
|
| | | 选择<i class="el-icon-arrow-down el-icon--right"></i>
|
| | | </span>
|
| | | <el-dropdown-menu slot="dropdown">
|
| | | <el-dropdown-item v-for="color in colors" :key="color['0_glass_id']" :command="color['0_glass_id']">
|
| | | {{ color['0_glass_id'] }}
|
| | | </el-dropdown-item>
|
| | | </el-dropdown-menu>
|
| | | </el-dropdown>
|
| | | </el-form-item>
|
| | | <el-form-item label="长度">
|
| | | <el-input v-model="formData.width" required style="width: 250px; font-size: 20px" @focus="clearInput('wid')"></el-input>
|
| | | </el-form-item>
|
| | | <el-form-item label="高度">
|
| | | <el-input v-model="formData.height" required style="width: 250px; font-size: 20px" @focus="clearInput('heig')"></el-input>
|
| | | </el-form-item>
|
| | | <el-form-item label="厚度">
|
| | | <el-input v-model="formData.thickness" required style="width: 250px; font-size: 20px" @focus="clearInput('thinkness')"></el-input>
|
| | | </el-form-item>
|
| | | <el-form-item label="数量">
|
| | | <el-input-number v-model="formData.quantity" required :min="0" :max="9000" style="width: 250px; font-size: 20px" @focus="clearInput('num')"></el-input-number>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | | <span slot="footer" class="dialog-footer">
|
| | | <el-button @click="dialogVisible3 = false">关闭</el-button>
|
| | | <el-button type="primary" @click="submitForm">提交</el-button>
|
| | | </span>
|
| | | </el-dialog>
|
| | | <el-dialog title="编辑" v-model="editdialogVisible" width="30%" @close="edithandleDialogClose">
|
| | | <el-form :model="editForm" ref="editFormRef" label-width="80px">
|
| | | <el-form-item label="数量">
|
| | | <el-input v-model="editForm.quantity"></el-input>
|
| | |
|
| | | <el-dialog title="添加原片" v-model="dialogVisible3" width="50%">
|
| | | <el-form :model="formData3" ref="form" label-width="80px">
|
| | | <el-form-item label="颜色膜系">
|
| | | <el-input
|
| | | v-model="formData.selectedColor"
|
| | | readonly
|
| | | style="width: 250px; height: 35px; font-size: 20px"
|
| | | ></el-input>
|
| | | <el-dropdown @command="handleCommand">
|
| | | <span class="el-dropdown-link">
|
| | | 选择<i class="el-icon-arrow-down el-icon--right"></i>
|
| | | </span>
|
| | | <el-dropdown-menu slot="dropdown">
|
| | | <el-dropdown-item
|
| | | v-for="color in colors"
|
| | | :key="color['0_glass_id']"
|
| | | :command="color['0_glass_id']"
|
| | | >
|
| | | {{ color["0_glass_id"] }}
|
| | | </el-dropdown-item>
|
| | | </el-dropdown-menu>
|
| | | </el-dropdown>
|
| | | </el-form-item>
|
| | | <el-form-item label="批次号">
|
| | | <el-input v-model="editForm.batchnumber"></el-input>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item label="长度">
|
| | | <el-input v-model="editForm.length"></el-input>
|
| | | <el-input
|
| | | v-model="formData.width"
|
| | | required
|
| | | style="width: 250px; font-size: 20px"
|
| | | @focus="clearInput('wid')"
|
| | | ></el-input>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item label="高度">
|
| | | <el-input v-model="editForm.height"></el-input>
|
| | | <el-input
|
| | | v-model="formData.height"
|
| | | required
|
| | | style="width: 250px; font-size: 20px"
|
| | | @focus="clearInput('heig')"
|
| | | ></el-input>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item label="厚度">
|
| | | <el-input v-model="editForm.thickness"></el-input>
|
| | | <el-input
|
| | | v-model="formData.thickness"
|
| | | required
|
| | | style="width: 250px; font-size: 20px"
|
| | | @focus="clearInput('thinkness')"
|
| | | ></el-input>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item label="数量">
|
| | | <el-input-number
|
| | | v-model="formData.quantity"
|
| | | required
|
| | | :min="0"
|
| | | :max="9000"
|
| | | style="width: 250px; font-size: 20px"
|
| | | @focus="clearInput('num')"
|
| | | ></el-input-number>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | | <div class="dialog-footer">
|
| | |
|
| | | <span slot="footer" class="dialog-footer">
|
| | | <el-button @click="dialogVisible3 = false">关闭</el-button>
|
| | | <el-button type="primary" @click="submitForm">提交</el-button>
|
| | | </span>
|
| | | </el-dialog>
|
| | |
|
| | | <el-dialog
|
| | | title="编辑"
|
| | | v-model="editdialogVisible"
|
| | | width="30%"
|
| | | @close="edithandleDialogClose"
|
| | | >
|
| | | <el-form :model="editForm" ref="editFormRef" label-width="80px">
|
| | | <el-form-item label="数量">
|
| | | <el-input v-model="editForm.pieces"></el-input>
|
| | | </el-form-item>
|
| | | <el-form-item label="批次号">
|
| | | <el-input v-model="editForm.batchId"></el-input>
|
| | | </el-form-item>
|
| | | <el-form-item label="长度">
|
| | | <el-input v-model="editForm.rawWidth"></el-input>
|
| | | </el-form-item>
|
| | | <el-form-item label="高度">
|
| | | <el-input v-model="editForm.rawHeight"></el-input>
|
| | | </el-form-item>
|
| | | <el-form-item label="厚度">
|
| | | <el-input v-model="editForm.rawThickness"></el-input>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <div class="dialog-footer">
|
| | | <el-button @click="editdialogVisible = false">取消</el-button>
|
| | | <el-button type="primary" @click="editsaveEdit">保存</el-button>
|
| | | </div>
|
| | | </el-dialog>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | |
| | |
|
| | |
|
| | | <script setup>
|
| | | import { ref, onMounted, onBeforeUnmount } from 'vue'; // 导入 Vue 3 的模块
|
| | | import * as echarts from 'echarts';
|
| | | import { ElMessage, ElMessageBox } from 'element-plus'
|
| | | import {tableData} from '@/stores/tableData.js';
|
| | | const loading = ref(false);
|
| | | const Hidden = ref(false)
|
| | | const totalItems = ref(0);
|
| | | totalItems.value = 10;
|
| | | const pageSize = 10;
|
| | | let currentPage = ref(1);
|
| | | const handleCurrentChange = (val) => {
|
| | | currentPage.value = val;
|
| | | };
|
| | | const getTagType2 =(status) => {
|
| | | switch (status) {
|
| | | case 'completed':
|
| | | return 'success';
|
| | | case 'in-progress':
|
| | | return 'info';
|
| | | case 'warning':
|
| | | return 'warning';
|
| | | case 'danger':
|
| | | return 'danger';
|
| | | default:
|
| | | return '';
|
| | | }
|
| | | }
|
| | | const getTagType =(status) => {
|
| | | return status === 1 ? 'success' : 'danger';
|
| | | // 根据状态值决定标签类型,这里假设状态为1时为成功(绿色),否则为失败(红色)
|
| | | }
|
| | | const toggleStatus = (row) => {
|
| | | // 切换料架状态的逻辑
|
| | | row.shelf_status = 1 - row.shelf_status; // Toggle between 0 and 1
|
| | | // 此处可以添加保存状态的逻辑,比如调用 API 更新数据
|
| | | };
|
| | | const tasktableData=ref([
|
| | | {
|
| | | Glassid: 'G001',
|
| | | taskDescription: '从吊装位【99】到仓位【56】',
|
| | | taskStatus: 'in-progress',
|
| | | glassThickness: '5mm',
|
| | | glassFilm: '膜系A',
|
| | | creationTime: '2024-06-19 10:00:00'
|
| | | },
|
| | | {
|
| | | Glassid: 'G002',
|
| | | taskDescription: '从吊装位【99】到仓位【56】',
|
| | | taskStatus: 'completed',
|
| | | glassThickness: '10mm',
|
| | | glassFilm: '膜系B',
|
| | | creationTime: '2024-06-19 11:00:00'
|
| | | }
|
| | | ]);
|
| | | const dialogVisible = ref(false);
|
| | | const formData = ref({
|
| | | shelf: '',
|
| | | color: '',
|
| | | width: '',
|
| | | height: '',
|
| | | thickness: '',
|
| | | quantity: ''
|
| | | });
|
| | | const formData2 = ref({
|
| | | dzw: '',
|
| | | });
|
| | | const handleDelete = (row) => {
|
| | | // 使用 Element UI 的 MessageBox.confirm 方法进行二次确认
|
| | | ElMessageBox.confirm('确定要执行删除操作吗?', '确认删除', {
|
| | | confirmButtonText: '确认',
|
| | | cancelButtonText: '取消',
|
| | | type: 'warning',
|
| | | }).then(() => {
|
| | | // 点击确认按钮的回调,执行出库操作
|
| | | console.log('执行删除操作', row);
|
| | | }).catch(() => {
|
| | | // 点击取消按钮的回调,不执行任何操作
|
| | | console.log('取消删除操作');
|
| | | import { ref, onMounted, onBeforeUnmount,onUnmounted } from "vue"; // 导入 Vue 3 的模块
|
| | | //import * as echarts from 'echarts';
|
| | | import { ElMessage, ElMessageBox } from "element-plus";
|
| | | // import {tableData} from '@/stores/tableData.js';
|
| | | import { WebSocketHost, host } from "@/utils/constants";
|
| | | import { initializeWebSocket, closeWebSocket } from "@/utils/WebSocketService";
|
| | |
|
| | | import {
|
| | | updateRawUsage,
|
| | | deleteRawUsage,
|
| | | inStorage,
|
| | | outStorage,
|
| | | taskUpdate,
|
| | | } from "@/utils/api";
|
| | |
|
| | | const loading = ref(false);
|
| | | const Hidden = ref(false);
|
| | | const tableData = ref([]);
|
| | | const totalItems = ref(0);
|
| | | totalItems.value = 10;
|
| | | const pageSize = 10;
|
| | | let currentPage = ref(1);
|
| | | const handleCurrentChange = (val) => {
|
| | | currentPage.value = val;
|
| | | };
|
| | |
|
| | | const formatTaskType = (row, column) => {
|
| | | if (row.taskType === "从仓位到吊装位") {
|
| | | return `从仓位${row.shelfRack}到吊装位${row.loadRack}`;
|
| | | } else if (row.taskType === "从仓位到上片位") {
|
| | | return `从仓位${row.shelfRack}到上片位${row.loadRack}`;
|
| | | } else if (row.taskType === "从上片位到仓位") {
|
| | | return `从上片位${row.loadRack}到仓位${row.shelfRack}`;
|
| | | } else if (row.taskType === "从吊装位到仓位") {
|
| | | return `从吊装位${row.loadRack}到仓位${row.shelfRack}`;
|
| | | }
|
| | | };
|
| | |
|
| | | const getTagType2 = (status) => {
|
| | | switch (status) {
|
| | | case "completed":
|
| | | return "success";
|
| | | case "in-progress":
|
| | | return "info";
|
| | | case "warning":
|
| | | return "warning";
|
| | | case "danger":
|
| | | return "danger";
|
| | | default:
|
| | | return "";
|
| | | }
|
| | | };
|
| | |
|
| | | const getTagType = (status) => {
|
| | | return status === 1 ? "success" : "danger";
|
| | | // 根据状态值决定标签类型,这里假设状态为1时为成功(绿色),否则为失败(红色)
|
| | | };
|
| | |
|
| | | const toggleStatus = (row) => {
|
| | | // 切换料架状态的逻辑
|
| | | row.enableState = 1 - row.enableState; // Toggle between 0 and 1
|
| | | // 此处可以添加保存状态的逻辑,比如调用 API 更新数据
|
| | | };
|
| | | let socket = null;
|
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/glassStorage/api/talk/storageTask`;
|
| | | // 定义消息处理函数,更新 receivedData 变量
|
| | | const handleMessage = (data) => {
|
| | | // 更新 tableData 的数据
|
| | |
|
| | | tableData.value = data.rack[0]; // 假设 tableData 是响应式对象或变量
|
| | |
|
| | | tableData.value.forEach((item) => {
|
| | | // 获取 createTime 的时间戳
|
| | | const createTimeTimestamp = item.createTime;
|
| | |
|
| | | // 创建日期对象
|
| | | const date = new Date(createTimeTimestamp);
|
| | |
|
| | | // 格式化日期时间为本地格式
|
| | | const formattedDateTime = date.toLocaleString();
|
| | |
|
| | | // 替换原来的 createTime 字段为格式化后的日期时间字符串
|
| | | item.createTime = formattedDateTime;
|
| | | });
|
| | |
|
| | | tasktableData.value = data.tasks[0]; // 假设 tasktableData 是响应式对象或变量
|
| | |
|
| | | tasktableData.value.forEach((item) => {
|
| | | // 获取 createTime 的时间戳
|
| | | const createTimeTimestamp = item.startTime;
|
| | |
|
| | | // 创建日期对象
|
| | | const date = new Date(createTimeTimestamp);
|
| | |
|
| | | // 格式化日期时间为本地格式
|
| | | const formattedDateTime = date.toLocaleString();
|
| | |
|
| | | // 替换原来的 createTime 字段为格式化后的日期时间字符串
|
| | | item.startTime = formattedDateTime;
|
| | | });
|
| | | };
|
| | | const handleCheckout = (row) => {
|
| | | onMounted(() => {
|
| | | socket = initializeWebSocket(socketUrl, handleMessage);
|
| | | });
|
| | | onUnmounted(() => {
|
| | | if (socket) {
|
| | | closeWebSocket(socket);
|
| | | }
|
| | | });
|
| | | onBeforeUnmount(() => {
|
| | | console.log("关闭了");
|
| | | closeWebSocket();
|
| | | });
|
| | |
|
| | | const tasktableData = ref([]);
|
| | |
|
| | | const dialogVisible = ref(false);
|
| | | const formData = ref({
|
| | | number: "",
|
| | | color: "",
|
| | | rawWidth: "",
|
| | | rawHeight: "",
|
| | | rawThickness: "",
|
| | | pieces: "",
|
| | | loadRack: 1,
|
| | | });
|
| | |
|
| | | const formData2 = ref({
|
| | | dzw: "",
|
| | | });
|
| | |
|
| | | const handleDelete = (row) => {
|
| | | // 使用 Element UI 的 MessageBox.confirm 方法进行二次确认
|
| | | ElMessageBox.confirm('确定要执行出库操作吗?', '确认出库', {
|
| | | confirmButtonText: '确认',
|
| | | cancelButtonText: '取消',
|
| | | type: 'warning',
|
| | | }).then(() => {
|
| | | // 点击确认按钮的回调,执行出库操作
|
| | | console.log('执行出库操作', row);
|
| | | }).catch(() => {
|
| | | // 点击取消按钮的回调,不执行任何操作
|
| | | console.log('取消出库操作');
|
| | | });
|
| | | };
|
| | | const handleInbound = () => {
|
| | | // 打开入库对话框
|
| | | dialogVisible.value = true;
|
| | | };
|
| | | const storage = () => {
|
| | | // 打开入库对话框
|
| | | Hidden.value = true;
|
| | | };
|
| | | const handleCloseDialog = () => {
|
| | | // 关闭对话框时重置表单数据
|
| | | formData.value = {
|
| | | shelf: '',
|
| | | color: '',
|
| | | width: '',
|
| | | height: '',
|
| | | thickness: '',
|
| | | quantity: ''
|
| | | ElMessageBox.confirm("确定要执行删除操作吗?", "确认删除", {
|
| | | confirmButtonText: "确认",
|
| | | cancelButtonText: "取消",
|
| | | type: "warning",
|
| | | })
|
| | | .then(() => {
|
| | | // 点击确认按钮的回调,执行出库操作
|
| | |
|
| | | const intNumber = {
|
| | | id: parseInt(row.number),
|
| | | };
|
| | | dialogVisible.value = false;
|
| | | };
|
| | | const handleConfirmInbound = () => {
|
| | | // 处理确认入库逻辑,可以在这里提交表单或者执行其他操作
|
| | | console.log('Confirm Inbound:', formData.value);
|
| | | // 关闭对话框
|
| | | dialogVisible.value = false;
|
| | | };
|
| | | const dialogVisible3 = ref(false);
|
| | | const colors = ref([
|
| | | { '0_glass_id': 'Red' },
|
| | | { '0_glass_id': 'Green' },
|
| | | { '0_glass_id': 'Blue' }
|
| | | // Add more colors as needed
|
| | | ]);
|
| | | const formData3 = ref({
|
| | | selectedColor: '',
|
| | | wid: '',
|
| | | heig: '',
|
| | | thinkness: '',
|
| | | num: ''
|
| | | deleteRawUsage(intNumber);
|
| | |
|
| | | console.log("执行删除操作");
|
| | | })
|
| | | .catch(() => {
|
| | | // 点击取消按钮的回调,不执行任何操作
|
| | | console.log("取消删除操作");
|
| | | });
|
| | | const addglass = () => {
|
| | | // 打开入库对话框
|
| | | dialogVisible3.value = true;
|
| | | };
|
| | | const handleCommand = (command) => {
|
| | | formData.value.selectedColor = command;
|
| | | };
|
| | | const clearInput = (field) => {
|
| | | formData.value[field] = '';
|
| | | };
|
| | | const submitForm = () => {
|
| | | console.log('提交数据:', formData.value);
|
| | | dialogVisible3.value = false;
|
| | | // Add your submit logic here
|
| | | };
|
| | | const editdialogVisible = ref(false);
|
| | | const editForm = ref({
|
| | | quantity: '',
|
| | | batchnumber: '',
|
| | | length:'',
|
| | | height:'',
|
| | | thickness:''
|
| | | });
|
| | | const editFormRef = ref(null);
|
| | | let currentRow = ref(null);
|
| | | // 处理行点击事件
|
| | | const edithandleRowClick = (row) => {
|
| | | currentRow.value = row;
|
| | | console.log(row)
|
| | | editForm.value.quantity = row.quantity.toString();
|
| | | editForm.value.batchnumber = row.batchnumber;
|
| | | editForm.value.length = row.length;
|
| | | editForm.value.height = row.height;
|
| | | editForm.value.thickness = row.thickness;
|
| | | editdialogVisible.value = true;
|
| | | console.log(editForm.value)
|
| | | };
|
| | | // 添加保存编辑内容
|
| | | const editsaveEdit = () => {
|
| | | if (!currentRow.value) return;
|
| | | // 更新当前行数据
|
| | | currentRow.value.quantity = parseInt(editForm.value.quantity);
|
| | | currentRow.value.batchnumber = editForm.value.batchnumber;
|
| | | // 关闭对话框
|
| | | editdialogVisible.value = false;
|
| | | };
|
| | | // 对话框关闭时重置编辑表单和当前行数据
|
| | | const edithandleDialogClose = () => {
|
| | | editForm.value.quantity = '';
|
| | | editForm.value.batchnumber = '';
|
| | | editForm.value.width = '';
|
| | | editForm.value.height = '';
|
| | | editForm.value.thickness = '';
|
| | | currentRow.value = null;
|
| | | };
|
| | | const handleRestart = (row) => {
|
| | | // 使用 Element UI 的 MessageBox.confirm 方法进行二次确认
|
| | | ElMessageBox.confirm('确定要执行重新开始操作吗?', '确认重新开始', {
|
| | | confirmButtonText: '确认',
|
| | | cancelButtonText: '取消',
|
| | | type: 'warning',
|
| | | }).then(() => {
|
| | | // 点击确认按钮的回调
|
| | | console.log('执行重新开始操作', row);
|
| | | }).catch(() => {
|
| | | // 点击取消按钮的回调,不执行任何操作
|
| | | console.log('取消重新开始操作');
|
| | | });
|
| | | };
|
| | |
|
| | | const handleCheckout = (row) => {
|
| | | // 使用 Element UI 的 MessageBox.confirm 方法进行二次确认
|
| | | ElMessageBox.confirm("确定要执行出库操作吗?", "确认出库", {
|
| | | confirmButtonText: "确认",
|
| | | cancelButtonText: "取消",
|
| | | type: "warning",
|
| | | })
|
| | | .then(() => {
|
| | | // 点击确认按钮的回调,执行出库操作
|
| | | const raw={
|
| | | number:parseInt(row.number),
|
| | | loadRack:2
|
| | | }
|
| | | outStorage(raw)
|
| | | console.log("执行出库操作", row);
|
| | | })
|
| | | .catch(() => {
|
| | | // 点击取消按钮的回调,不执行任何操作
|
| | | console.log("取消出库操作");
|
| | | });
|
| | | };
|
| | |
|
| | | const handleInbound = () => {
|
| | | // 打开入库对话框
|
| | | dialogVisible.value = true;
|
| | | };
|
| | |
|
| | | const storage = () => {
|
| | | // 打开入库对话框
|
| | | Hidden.value = true;
|
| | | };
|
| | |
|
| | | const handleCloseDialog = () => {
|
| | | // 关闭对话框时重置表单数据
|
| | | formData.value = {
|
| | | number: "",
|
| | | color: "",
|
| | | rawWidth: "",
|
| | | rawHeight: "",
|
| | | rawThickness: "",
|
| | | pieces: "",
|
| | | };
|
| | | dialogVisible.value = false;
|
| | | };
|
| | |
|
| | | const handleConfirmInbound = () => {
|
| | | inStorage(formData.value);
|
| | | // 处理确认入库逻辑,可以在这里提交表单或者执行其他操作
|
| | | console.log("Confirm Inbound:", formData.value);
|
| | | // 关闭对话框
|
| | | dialogVisible.value = false;
|
| | | };
|
| | |
|
| | | const dialogVisible3 = ref(false);
|
| | | const colors = ref([
|
| | | { "0_glass_id": "Red" },
|
| | | { "0_glass_id": "Green" },
|
| | | { "0_glass_id": "Blue" },
|
| | | // Add more colors as needed
|
| | | ]);
|
| | |
|
| | | const formData3 = ref({
|
| | | selectedColor: "",
|
| | | wid: "",
|
| | | heig: "",
|
| | | thinkness: "",
|
| | | num: "",
|
| | | });
|
| | |
|
| | | const addglass = () => {
|
| | | // 打开入库对话框
|
| | | dialogVisible3.value = true;
|
| | | };
|
| | | const handleCommand = (command) => {
|
| | | formData.value.selectedColor = command;
|
| | | };
|
| | |
|
| | | const clearInput = (field) => {
|
| | | formData.value[field] = "";
|
| | | };
|
| | |
|
| | | const submitForm = () => {
|
| | | console.log("提交数据:", formData.value);
|
| | | dialogVisible3.value = false;
|
| | | // Add your submit logic here
|
| | | };
|
| | |
|
| | | const editdialogVisible = ref(false);
|
| | | const editForm = ref({
|
| | | id: "",
|
| | | pieces: "",
|
| | | batchId: "",
|
| | | rawWidth: "",
|
| | | rawHeight: "",
|
| | | rawThickness: "",
|
| | | });
|
| | | const editFormRef = ref(null);
|
| | | let currentRow = ref(null);
|
| | |
|
| | | // 处理行点击事件
|
| | | const edithandleRowClick = (row) => {
|
| | | currentRow.value = row;
|
| | | console.log(row);
|
| | | editForm.value.pieces = row.pieces.toString();
|
| | | editForm.value.batchId = row.batchId;
|
| | | editForm.value.rawWidth = row.rawWidth;
|
| | | editForm.value.rawHeight = row.rawHeight;
|
| | | editForm.value.rawThickness = row.rawThickness;
|
| | | editForm.value.id = row.number;
|
| | | editdialogVisible.value = true;
|
| | | console.log(editForm.value);
|
| | | };
|
| | |
|
| | | // 添加保存编辑内容
|
| | | const editsaveEdit = () => {
|
| | | if (!currentRow.value) return;
|
| | |
|
| | | // 更新当前行数据
|
| | | currentRow.value.pieces = editForm.value.pieces;
|
| | | currentRow.value.batchId = editForm.value.batchId;
|
| | | currentRow.value.rawWidth = editForm.value.rawWidth;
|
| | | currentRow.value.rawHeight = editForm.value.rawHeight;
|
| | | currentRow.value.rawThickness = editForm.value.rawThickness;
|
| | | // 调用更新函数,并处理其返回的 Promise
|
| | | updateRawUsage(editForm.value);
|
| | |
|
| | | // 关闭对话框
|
| | | editdialogVisible.value = false;
|
| | | };
|
| | |
|
| | | // 对话框关闭时重置编辑表单和当前行数据
|
| | | const edithandleDialogClose = () => {
|
| | | editForm.value.pieces = "";
|
| | | editForm.value.batchId = "";
|
| | | editForm.value.rawWidth = "";
|
| | | editForm.value.rawHeight = "";
|
| | | editForm.value.rawThickness = "";
|
| | |
|
| | | currentRow.value = null;
|
| | | };
|
| | |
|
| | | const handleRestart = (row) => {
|
| | | // 使用 Element UI 的 MessageBox.confirm 方法进行二次确认
|
| | | ElMessageBox.confirm("确定要执行重新开始操作吗?", "确认重新开始", {
|
| | | confirmButtonText: "确认",
|
| | | cancelButtonText: "取消",
|
| | | type: "warning",
|
| | | })
|
| | | .then(() => {
|
| | | const taskdata={
|
| | | id:row.id,
|
| | | Type:"重新开始"
|
| | | }
|
| | | taskUpdate(taskdata);
|
| | | |
| | |
|
| | | console.log("执行重新开始操作", row);
|
| | | })
|
| | | .catch(() => {
|
| | | // 点击取消按钮的回调,不执行任何操作
|
| | | console.log("取消重新开始操作");
|
| | | });
|
| | | };
|
| | |
|
| | | const handleDeletetask = (row) => {
|
| | | // 使用 Element UI 的 MessageBox.confirm 方法进行二次确认
|
| | | ElMessageBox.confirm('确定要执行删除任务操作吗?', '确认删除任务', {
|
| | | confirmButtonText: '确认',
|
| | | cancelButtonText: '取消',
|
| | | type: 'warning',
|
| | | }).then(() => {
|
| | | // 点击确认按钮的回调
|
| | | console.log('执行删除任务操作', row);
|
| | | }).catch(() => {
|
| | | // 点击取消按钮的回调,不执行任何操作
|
| | | console.log('取消删除任务操作');
|
| | | });
|
| | | ElMessageBox.confirm("确定要执行删除任务操作吗?", "确认删除任务", {
|
| | | confirmButtonText: "确认",
|
| | | cancelButtonText: "取消",
|
| | | type: "warning",
|
| | | })
|
| | | .then(() => {
|
| | | // 点击确认按钮的回调
|
| | | const taskdata={
|
| | | id:row.id,
|
| | | Type:"删除"
|
| | | }
|
| | | taskUpdate(taskdata);
|
| | | console.log("执行删除任务操作", row);
|
| | | })
|
| | | .catch(() => {
|
| | | // 点击取消按钮的回调,不执行任何操作
|
| | | console.log("取消删除任务操作");
|
| | | });
|
| | | };
|
| | |
|
| | | const handleComplete = (row) => {
|
| | | // 使用 Element UI 的 MessageBox.confirm 方法进行二次确认
|
| | | ElMessageBox.confirm('确定要执行任务完成操作吗?', '确认任务完成', {
|
| | | confirmButtonText: '确认',
|
| | | cancelButtonText: '取消',
|
| | | type: 'warning',
|
| | | }).then(() => {
|
| | | // 点击确认按钮的回调
|
| | | console.log('执行任务完成操作', row);
|
| | | }).catch(() => {
|
| | | // 点击取消按钮的回调,不执行任何操作
|
| | | console.log('取消任务完成操作');
|
| | | });
|
| | | ElMessageBox.confirm("确定要执行任务完成操作吗?", "确认任务完成", {
|
| | | confirmButtonText: "确认",
|
| | | cancelButtonText: "取消",
|
| | | type: "warning",
|
| | | })
|
| | | .then(() => {
|
| | |
|
| | | const taskdata={
|
| | | id:row.id,
|
| | | Type:"完成"
|
| | | }
|
| | | taskUpdate(taskdata);
|
| | | // 点击确认按钮的回调
|
| | | console.log("执行任务完成操作", row);
|
| | | })
|
| | | .catch(() => {
|
| | | // 点击取消按钮的回调,不执行任何操作
|
| | | console.log("取消任务完成操作");
|
| | | });
|
| | | };
|
| | | </script>
|
| | |
|
| | | <style scoped>
|
| | | #dt { display:block; float:left;line-height: 20px;margin-left: 100px;}
|
| | | #dta { display:block; float:left;line-height: 20px;margin-left: 80%;}
|
| | | #dialog-footer{
|
| | | #dt {
|
| | | display: block;
|
| | | float: left;
|
| | | line-height: 20px;
|
| | | margin-left: 100px;
|
| | | }
|
| | | #dta {
|
| | | display: block;
|
| | | float: left;
|
| | | line-height: 20px;
|
| | | margin-left: 80%;
|
| | | }
|
| | | #dialog-footer {
|
| | | text-align: center;
|
| | | margin-top: -15px;
|
| | | }
|
| | | .img-ypcc{
|
| | | margin-left: -40px;
|
| | | background-image:url('../../assets/ypcc.png');
|
| | |
|
| | | .img-ypcc {
|
| | | margin-left: 80px;
|
| | | background-image: url("../../assets/ypcc.png");
|
| | | background-repeat: no-repeat;
|
| | | background-attachment: local;
|
| | | min-height: 600px;
|
| | | width: 1400px;
|
| | | max-width: 100%;
|
| | | background-size: 1400px 600px;
|
| | | overflow: hidden;
|
| | | position:relative;
|
| | | margin-top: -30px
|
| | | background-attachment: local;
|
| | | min-height: 600px;
|
| | | width: 1400px;
|
| | | max-width: 100%;
|
| | | background-size: 1400px 600px;
|
| | | overflow: hidden;
|
| | | position: relative;
|
| | | margin-top: 0px;
|
| | | }
|
| | | .img-car1{
|
| | | background-image:url('../../assets/ypccche.png');
|
| | |
|
| | | .img-car1 {
|
| | | background-image: url("../../assets/ypccche.png");
|
| | | position: absolute;
|
| | | background-repeat: no-repeat;
|
| | | background-attachment: local;
|
| | | min-height: 400px;
|
| | | width: 200px;
|
| | | max-width: 100%;
|
| | | background-size: 200px 170px;
|
| | | overflow: hidden;
|
| | | position:relative
|
| | | background-attachment: local;
|
| | | min-height: 400px;
|
| | | width: 200px;
|
| | | max-width: 100%;
|
| | | background-size: 200px 170px;
|
| | | overflow: hidden;
|
| | | position: relative;
|
| | | }
|
| | |
|
| | | .custom-dialog {
|
| | | max-height: 90vh; /* 最大高度为视口高度的90% */
|
| | | overflow-y: auto; /* 对话框内部出现垂直滚动条 */
|
| | | }
|
| | | </style> |
| | | </style>
|
| | |
| | | <script setup lang="ts"> |
| | | import { Delete, Upload } from '@element-plus/icons-vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { ref, onMounted, onBeforeUnmount } from 'vue'; |
| | | import { ref, onMounted, onBeforeUnmount,onUnmounted } from 'vue'; |
| | | import request from "@/utils/request" |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | |
| | | } |
| | | }); |
| | | } |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | |
| | | // adjustedRects.value = data.currentCutTerritory[0] |
| | | adjustedRects.value = data.currentCutTerritory[0].map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | | x_axis: (rect.x_axis*100) * 0.003, // 将x值除以3 |
| | | ...rect, |
| | | x_axis: (rect.x_axis*100) * 0.003, |
| | | y_axis: (rect.y_axis*100) * 0.003, |
| | | width: (rect.width*100) * 0.002 , |
| | | widtha: rect.width , |
| | |
| | | height:( rect.height*100) * 0.002 , |
| | | glass_state: rect.glass_state |
| | | })); |
| | | // console.log("更新后数据", tableData); |
| | | |
| | | }; |
| | | |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | |
| | | import {reactive} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | import request from "@/utils/request" |
| | | import { ref, onMounted, onBeforeUnmount } from 'vue'; |
| | | import { ref, onMounted, onBeforeUnmount,onUnmounted } from 'vue'; |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | |
| | | const adjustedRectsb = ref([]); |
| | | const currentGlassId = ref(null); |
| | | const currenttemperingFeedSequence = ref(null); |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingGlass`; |
| | | const handleMessage = (data) => { |
| | | // 进炉中 |
| | | if(data.intoGlass!=null){ |
| | | adjustedRects1.value = data.intoGlass[0].map(rect => { |
| | | console.log( adjustedRects1.value); |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta; |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;; |
| | | let newX = rect.yCoordinate; |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = rect.height * 0.12; |
| | | adjustedHeight = rect.width * 0.1; |
| | | adjustedWidtha = rect.height; |
| | | adjustedHeighta = rect.width; |
| | | newX = 5087 - (rect.xCoordinate + rect.height); |
| | | } else { |
| | | adjustedWidth = rect.width * 0.12; |
| | | adjustedHeight = rect.height * 0.1; |
| | | adjustedWidtha = rect.width; |
| | | adjustedHeighta = rect.height; |
| | | newX = 5087 - (rect.xCoordinate + rect.width); |
| | | } |
| | | if (rect.width < rect.height) { |
| | | widtha = rect.height; |
| | | heighta = rect.width; |
| | | }else { |
| | | widtha = rect.width; |
| | | heighta = rect.height; |
| | | } |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = widtha * 0.12; |
| | | adjustedHeight = heighta * 0.1; |
| | | adjustedWidtha = widtha; |
| | | adjustedHeighta = heighta; |
| | | newX = 5087 - (rect.yCoordinate + widtha); |
| | | } else { |
| | | adjustedWidth = heighta * 0.12; |
| | | adjustedHeight = widtha * 0.1; |
| | | adjustedWidtha = heighta; |
| | | adjustedHeighta = widtha; |
| | | newX = 5087 - (rect.yCoordinate + heighta); |
| | | } |
| | | // if (rect.angle === 0) { |
| | | // adjustedWidth = heighta * 0.12; |
| | | // adjustedHeight = widtha * 0.1; |
| | | // adjustedWidtha = heighta; |
| | | // adjustedHeighta = widtha; |
| | | // newX = 5087 - (rect.xCoordinate + heighta); |
| | | // } else { |
| | | // adjustedWidth = widtha * 0.12; |
| | | // adjustedHeight = heighta * 0.1; |
| | | // adjustedWidtha = widtha; |
| | | // adjustedHeighta = heighta; |
| | | // newX = 5087 - (rect.xCoordinate + widtha); |
| | | // } |
| | | return { |
| | | ...rect, |
| | | xcoordinate: newX * 0.12, |
| | | ycoordinate: rect.yCoordinate * 0.1, |
| | | ycoordinate: rect.xCoordinate * 0.1, |
| | | width: adjustedWidth, |
| | | height: adjustedHeight, |
| | | widtha: adjustedWidtha, |
| | |
| | | if(data.intoGlass2!=null){ |
| | | adjustedRects2.value = data.intoGlass2[0].map(rect => { |
| | | console.log( adjustedRects2.value); |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta; |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;; |
| | | let newX = rect.yCoordinate; |
| | | if (rect.width < rect.height) { |
| | | widtha = rect.height; |
| | | heighta = rect.width; |
| | | }else { |
| | | widtha = rect.width; |
| | | heighta = rect.height; |
| | | } |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = rect.height * 0.12; |
| | | adjustedHeight = rect.width * 0.1; |
| | | adjustedWidtha = rect.height; |
| | | adjustedHeighta = rect.width; |
| | | newX = 5087 - (rect.xCoordinate + rect.height); |
| | | } else { |
| | | adjustedWidth = rect.width * 0.12; |
| | | adjustedHeight = rect.height * 0.1; |
| | | adjustedWidtha = rect.width; |
| | | adjustedHeighta = rect.height; |
| | | newX = 5087 - (rect.xCoordinate + rect.width); |
| | | adjustedWidth = widtha * 0.12; |
| | | adjustedHeight = heighta * 0.1; |
| | | adjustedWidtha = widtha; |
| | | adjustedHeighta = heighta; |
| | | newX = 5087 - (rect.yCoordinate + widtha); |
| | | } else { |
| | | adjustedWidth = heighta * 0.12; |
| | | adjustedHeight = widtha * 0.1; |
| | | adjustedWidtha = heighta; |
| | | adjustedHeighta = widtha; |
| | | newX = 5087 - (rect.yCoordinate + heighta); |
| | | } |
| | | // if (rect.angle === 0) { |
| | | // adjustedWidth = heighta * 0.12; |
| | | // adjustedHeight = widtha * 0.1; |
| | | // adjustedWidtha = heighta; |
| | | // adjustedHeighta = widtha; |
| | | // newX = 5087 - (rect.xCoordinate + heighta); |
| | | // } else { |
| | | // adjustedWidth = widtha * 0.12; |
| | | // adjustedHeight = heighta * 0.1; |
| | | // adjustedWidtha = widtha; |
| | | // adjustedHeighta = heighta; |
| | | // newX = 5087 - (rect.xCoordinate + widtha); |
| | | // } |
| | | return { |
| | | ...rect, |
| | | xcoordinate: newX * 0.12, |
| | | ycoordinate: rect.yCoordinate * 0.1, |
| | | ycoordinate: rect.xCoordinate * 0.1, |
| | | width: adjustedWidth, |
| | | height: adjustedHeight, |
| | | widtha: adjustedWidtha, |
| | |
| | | // 进炉前 |
| | | if(data.waitingGlass!=null){ |
| | | adjustedRectsa.value = data.waitingGlass[0].map(rect => { |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta; |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;; |
| | | let newX = rect.yCoordinate; |
| | | if (rect.width < rect.height) { |
| | | widtha = rect.height; |
| | | heighta = rect.width; |
| | | }else { |
| | | widtha = rect.width; |
| | | heighta = rect.height; |
| | | } |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = rect.width * 0.24; |
| | | adjustedHeight = rect.height * 0.16; |
| | | adjustedWidtha = rect.width; |
| | | adjustedHeighta = rect.height; |
| | | newX = 5190 - (rect.yCoordinate + rect.width); |
| | | adjustedWidth = widtha * 0.24; |
| | | adjustedHeight = heighta * 0.16; |
| | | adjustedWidtha = widtha; |
| | | adjustedHeighta = heighta; |
| | | newX = 5190 - (rect.yCoordinate + widtha); |
| | | } else { |
| | | adjustedWidth = rect.height * 0.24; |
| | | adjustedHeight = rect.width * 0.16; |
| | | adjustedWidtha = rect.height; |
| | | adjustedHeighta = rect.width; |
| | | newX = 5190 - (rect.yCoordinate + rect.height); |
| | | adjustedWidth = heighta * 0.24; |
| | | adjustedHeight = widtha * 0.16; |
| | | adjustedWidtha = heighta; |
| | | adjustedHeighta = widtha; |
| | | newX = 5190 - (rect.yCoordinate + heighta); |
| | | } |
| | | return { |
| | | ...rect, |
| | |
| | | // 已出炉 |
| | | if(data.outGlass!=null){ |
| | | adjustedRectsb.value = data.outGlass[0].map(rect => { |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta; |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;; |
| | | let newX = rect.yCoordinate; |
| | | if (rect.width < rect.height) { |
| | | widtha = rect.height; |
| | | heighta = rect.width; |
| | | }else { |
| | | widtha = rect.width; |
| | | heighta = rect.height; |
| | | } |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = rect.width * 0.24; |
| | | adjustedHeight = rect.height * 0.16; |
| | | adjustedWidtha = rect.width; |
| | | adjustedHeighta = rect.height; |
| | | // newX = 5190 - (rect.yCoordinate + rect.width); |
| | | adjustedWidth = widtha * 0.24; |
| | | adjustedHeight = heighta * 0.16; |
| | | adjustedWidtha = widtha; |
| | | adjustedHeighta = heighta; |
| | | // newX = 5190 - (rect.yCoordinate + widtha); |
| | | } else { |
| | | adjustedWidth = rect.height * 0.24; |
| | | adjustedHeight = rect.width * 0.16; |
| | | adjustedWidtha = rect.height; |
| | | adjustedHeighta = rect.width; |
| | | // newX = 5190 - (rect.yCoordinate + rect.height); |
| | | adjustedWidth = heighta * 0.24; |
| | | adjustedHeight = widtha * 0.16; |
| | | adjustedWidtha = heighta; |
| | | adjustedHeighta = widtha; |
| | | // newX = 5190 - (rect.yCoordinate + heighta); |
| | | } |
| | | return { |
| | | ...rect, // 复制原始对象的其他属性 |
| | |
| | | } |
| | | }; |
| | | onMounted(() => { |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | function updateRectColors() { |
| | | adjustedRectsa.value.forEach(rect => { |
| | | if (rect.glassId === glassId) { |
| | |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import request from "@/utils/request" |
| | | |
| | | import { ref, onMounted, onBeforeUnmount } from 'vue'; |
| | | import { ref, onMounted, onBeforeUnmount,onUnmounted } from 'vue'; |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | const adjustedRects = ref([]); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingGlass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | if(data.overGlass!=null){ |
| | | adjustedRects.value = data.overGlass[0].map(rect => { |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta; |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta; |
| | | let newX = rect.yCoordinate; |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = rect.width * 0.24; |
| | | adjustedHeight = rect.height * 0.16; |
| | | adjustedWidtha = rect.width; |
| | | adjustedHeighta = rect.height; |
| | | // newX = 5190 - (rect.yCoordinate + rect.width); |
| | | if (rect.width < rect.height) { |
| | | widtha = rect.height; |
| | | heighta = rect.width; |
| | | }else { |
| | | widtha = rect.width; |
| | | heighta = rect.height; |
| | | } |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = widtha * 0.24; |
| | | adjustedHeight = heighta * 0.16; |
| | | adjustedWidtha = widtha; |
| | | adjustedHeighta = heighta; |
| | | // newX = 5190 - (rect.yCoordinate + rect.width); |
| | | } else { |
| | | adjustedWidth = rect.height * 0.24; |
| | | adjustedHeight = rect.width * 0.16; |
| | | adjustedWidtha = rect.height; |
| | | adjustedHeighta = rect.width; |
| | | // newX = 5190 - (rect.yCoordinate + rect.height); |
| | | adjustedWidth = heighta * 0.24; |
| | | adjustedHeight = widtha * 0.16; |
| | | adjustedWidtha = heighta; |
| | | adjustedHeighta = widtha; |
| | | // newX = 5190 - (rect.yCoordinate + rect.height); |
| | | } |
| | | return { |
| | | ...rect, |
| | |
| | | } |
| | | } |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | |
| | | <el-option :label="$t('reportmanage.steel')" value="3"></el-option> |
| | | </el-select> |
| | | <el-button type="primary" style="margin-left: 10px;" @click="selectReportData()">{{ $t('reportmanage.inquire') }}</el-button> |
| | | <el-button type="success" style="margin-left: 10px;" >{{ $t('reportmanage.signingwork') }}</el-button> |
| | | <el-button type="success" style="margin-left: 10px;" @click="handleConfirm">{{ $t('reportmanage.signingwork') }}</el-button> |
| | | </div> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | |
| | | <el-table-column prop="deviceName" align="center" :label="$t('reportmanage.reportingequipment')" min-width="120" /> |
| | | <el-table-column prop="line" align="center" :label="$t('reportmanage.line')" min-width="120" /> |
| | | <el-table-column prop="workingProcedure" align="center" :label="$t('reportmanage.process')" min-width="120" /> |
| | | <el-table-column prop="glassId" align="center" :label="$t('reportmanage.glassID')" min-width="120" /> |
| | | <el-table-column prop="glassId" align="center" :label="$t('reportmanage.glassID')" min-width="130" /> |
| | | <el-table-column prop="engineerId" align="center" :label="$t('reportmanage.projectnumber')" min-width="120" /> |
| | | <el-table-column prop="temperingLayoutId" align="center" :label="$t('reportmanage.layoutID')" min-width="120" /> |
| | | <el-table-column prop="damageTime" align="center" :label="$t('reportmanage.productiontime')" min-width="120" /> |
| | | <el-table-column prop="damageTime" align="center" :label="$t('reportmanage.productiontime')" min-width="230" /> |
| | | <el-table-column prop="type" align="center" :label="$t('reportmanage.type')" min-width="120" /> |
| | | <el-table-column prop="status" align="center" :label="$t('reportmanage.state')" min-width="120" /> |
| | | <el-table-column prop="processId" align="center" :label="$t('reportmanage.processcards')" min-width="120" /> |
| | | <el-table-column prop="processId" align="center" :label="$t('reportmanage.processcards')" min-width="140" /> |
| | | <el-table-column prop="orderNumber" align="center" :label="$t('reportmanage.number')" min-width="120" /> |
| | | <el-table-column prop="technologyNumber" align="center" :label="$t('reportmanage.layer')" min-width="120" /> |
| | | <el-table-column prop="breakageType" align="center" :label="$t('reportmanage.typebreakage')" min-width="120" /> |
| | | <el-table-column prop="breakageReason" align="center" :label="$t('reportmanage.causebreakage')" min-width="120" /> |
| | | <el-table-column prop="responsibleProcess" align="center" :label="$t('reportmanage.responsibleprocess')" min-width="120" /> |
| | | <el-table-column prop="responsiblePersonnel" align="center" :label="$t('reportmanage.responsiblepersonnel')" min-width="120" /> |
| | | <el-table-column prop="responsibleTeam" align="center" :label="$t('reportmanage.responsibleteam')" min-width="120" /> |
| | | <el-table-column prop="responsibleEquipment" align="center" :label="$t('reportmanage.responsibleequipment')" min-width="120" /> |
| | | <el-table-column prop="remark" align="center" :label="$t('reportmanage.remark')" min-width="120" /> |
| | | <el-table-column prop="breakageType" align="center" :label="$t('reportmanage.typebreakage')" min-width="180"> |
| | | <template #default="{ row }"> |
| | | <el-select |
| | | v-model="selectValuesa[row.id]" |
| | | filterable |
| | | :placeholder="$t('reportmanage.pcausebreakage')" |
| | | clearable |
| | | @input="handleInputChangea($event, row.id)" |
| | | > |
| | | <el-option |
| | | v-for="item in selectOptionsa" |
| | | :key="item.basicName" |
| | | :label="item.basicName" |
| | | :value="item.basicName" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="breakageReason" align="center" :label="$t('reportmanage.causebreakage')" min-width="180"> |
| | | <template #default="{ row }"> |
| | | <el-select |
| | | v-model="selectValuesb[row.id]" |
| | | filterable |
| | | :placeholder="$t('reportmanage.ptypebreakage')" |
| | | clearable |
| | | @input="handleInputChangea($event, row.id)" |
| | | > |
| | | <el-option |
| | | v-for="item in selectOptionsb" |
| | | :key="item.basicName" |
| | | :label="item.basicName" |
| | | :value="item.basicName" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" :label="$t('reportmanage.responsibleprocess')" min-width="120"> |
| | | <template #default="{ row }"> |
| | | <span>{{ '切割磨边钢化' }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="responsiblePersonnel" align="center" :label="$t('reportmanage.responsiblepersonnel')" min-width="180"> |
| | | <template #default="{ row }"> |
| | | <el-input :placeholder="$t('reportmanage.presponsiblepersonnel')" v-model="inputValuesa[row.id]" autocomplete="off" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="responsibleTeam" align="center" :label="$t('reportmanage.responsibleteam')" min-width="180"> |
| | | <template #default="{ row }"> |
| | | <el-select |
| | | v-model="selectValuesc[row.id]" |
| | | filterable |
| | | :placeholder="$t('reportmanage.presponsibleteam')" |
| | | clearable |
| | | @input="handleInputChangea($event, row.id)" |
| | | > |
| | | <el-option |
| | | v-for="item in selectOptionsc" |
| | | :key="item.basicName" |
| | | :label="item.basicName" |
| | | :value="item.basicName" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="responsibleEquipment" align="center" :label="$t('reportmanage.responsibleequipment')" min-width="180"> |
| | | <template #default="{ row }"> |
| | | <el-select |
| | | v-model="selectValuesd[row.id]" |
| | | filterable |
| | | :placeholder="$t('reportmanage.presponsibleequipment')" |
| | | clearable |
| | | @input="handleInputChangea($event, row.id)" |
| | | > |
| | | <el-option |
| | | v-for="item in selectOptionsd" |
| | | :key="item.basicName" |
| | | :label="item.basicName" |
| | | :value="item.basicName" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="remark" align="center" :label="$t('reportmanage.remark')" min-width="180"> |
| | | <template #default="{ row }"> |
| | | <el-input :placeholder="$t('reportmanage.premark')" v-model="inputValuesb[row.id]" autocomplete="off" /> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | |
| | | }); |
| | | const reportData = ref([]) |
| | | const timeRange = ref(["2022-01-01", "2025-01-01"]) |
| | | const selectOptionsa = ref([]); |
| | | const selectOptionsb = ref([]); |
| | | const selectOptionsc = ref([]); |
| | | const selectOptionsd = ref([]); |
| | | const selectValuesa = reactive({}); |
| | | const selectValuesb = reactive({}); |
| | | const selectValuesc = reactive({}); |
| | | const selectValuesd = reactive({}); |
| | | const inputValuesa = reactive({}); |
| | | const inputValuesb = reactive({}); |
| | | |
| | | |
| | | // 查询数据 |
| | |
| | | status:"2" |
| | | }) |
| | | }; |
| | | |
| | | // 报工 |
| | | const handleConfirm = async () => { |
| | | const response = await request.post("/cacheVerticalGlass/damage/submitDamage", reportData.value) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | }; |
| | | const fetchTableData = async () => { |
| | | try { |
| | | const response = await request.post('/cacheVerticalGlass/basic_data_produce/selectBasicDataProduceGroup'); |
| | | if (response.code == 200) { |
| | | selectOptionsa.value = response.data.breakagetype.filter(item => item !== null) |
| | | .map(item => ({ basicName: item.basicName })); |
| | | selectOptionsb.value = response.data.breakagereason.filter(item => item !== null) |
| | | .map(item => ({ basicName: item.basicName })); |
| | | selectOptionsc.value = response.data.teamsgroups.filter(item => item !== null) |
| | | .map(item => ({ basicName: item.basicName })); |
| | | selectOptionsd.value = response.data.device.filter(item => item !== null) |
| | | .map(item => ({ basicName: item.basicName })); |
| | | } else { |
| | | ElMessage.warning(response.data); |
| | | } |
| | | } catch (error) { |
| | | console.error('Error fetching options:', error); |
| | | } |
| | | }; |
| | | const handleInputChangea = (value, rowId) => { |
| | | // 更新对应行的 select 值 |
| | | selectValuesa[rowId] = value; |
| | | selectValuesb[rowId] = value; |
| | | selectValuesc[rowId] = value; |
| | | selectValuesd[rowId] = value; |
| | | inputValuesa[rowId] = value; |
| | | inputValuesb[rowId] = value; |
| | | }; |
| | | fetchTableData(); |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/screen`; |
| | | const handleMessage = (data) => { |
| | | // adjustedRects.value = data.device[0].map(rect => ({ |
| | |
| | | // thisProcess: rect.thisProcess, |
| | | // })); |
| | | }; |
| | | let socket; |
| | | // let socket; |
| | | onMounted(() => { |
| | | socket = new WebSocket(socketUrl); |
| | | socket.onmessage = (event) => { |
| | |
| | | }; |
| | | // }; |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | onUnmounted(() => { |
| | | socket.close(); |
| | | }); |
| | | |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | fetchTableData(); |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | |
| | | const flakea = ref(false) |
| | | const flakeb = ref(false) |
| | | const flakec = ref(false) |
| | | const dialoglea = ref(false) |
| | | const tableDatax = ref([]) |
| | | const user = ref(''); |
| | | const projectNo = ref(''); |
| | | const workstationId = ref(''); |
| | |
| | | // ElMessage.error('获取表格数据失败,请重试'); |
| | | } |
| | | }; |
| | | onMounted(() => { |
| | | const handlezhiban = () => { |
| | | dialoglea.value = true; // 打开绑定架子对话框 |
| | | fetchFlowCardId(); |
| | | }; |
| | | // 值班信息 |
| | | const fetchFlowCardId = async () => { |
| | | try { |
| | | const response = await request.post('/loadGlass/work_assignment/selectWorkAssignment',{ |
| | | line: 2001, |
| | | workingProcedure : '冷加工' |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | tableDatax.value = response.data; |
| | | console.log(tableDatax.value); |
| | | console |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | const handleConfirmb = async () => { |
| | | const response = await request.post("/loadGlass/work_assignment/updateWorkAssignment", tableDatax.value) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | dialoglea.value = false; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | }; |
| | | onMounted(() => { |
| | | list(''); |
| | | fetchOptions(''); |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onMounted(() => { |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | const list = async () => { |
| | | try { |
| | | const response = await request.get('/loadGlass/LoadGlass/list'); |
| | |
| | | const titleSelectJsona = ref({ |
| | | processTypea: [], |
| | | }) |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | |
| | | <el-button style="margin-top: 5px;margin-left: 15px;" id="searchButton" type="primary" @click="dialogFormVisible = true">{{ $t('basicData.selectproject') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="primary" @click="handleBind">{{ $t('basicData.startloading') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="warning" @click="handleBinda">{{ $t('basicData.stop') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="info" @click="handlezhiban">{{ $t('searchOrder.dutyinformation') }}</el-button> |
| | | <!-- <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="danger" @click="handleBindb">停止任务</el-button> --> |
| | | |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 15px;" v-loading="loading"> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <el-dialog v-model="dialoglea" top="15vh" width="70%" :title="$t('searchOrder.dutyinformation')"> |
| | | <el-table ref="table" style="margin-top: 20px;height: 300px;" |
| | | :data="tableDatax" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="line" fixed align="center" :label="$t('searchOrder.line')"/> |
| | | <el-table-column prop="workProcesses" fixed align="center" :label="$t('searchOrder.process')" /> |
| | | <el-table-column prop="teamsGroupsName" align="center" :label="$t('searchOrder.team')"> |
| | | <template #default="{ row }"> |
| | | <el-input v-model="row.teamsGroupsName" autocomplete="off" min-width="150"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="deviceName" align="center" :label="$t('searchOrder.basic')"> |
| | | <template #default="{ row }"> |
| | | <el-input v-model="row.deviceName" autocomplete="off" min-width="150"/> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleConfirm"> |
| | | {{ $t('searchOrder.add') }} |
| | | </el-button> |
| | | <el-button @click="dialoglea = false">{{ $t('searchOrder.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="blinda" top="30vh" width="25%" :title="$t('basicData.whetherpause')"> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | |
| | | const router = useRouter() |
| | | import request from "@/utils/request" |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import { ref, onMounted , onBeforeUnmount, reactive, computed } from "vue"; |
| | | import { ref, onMounted , onBeforeUnmount, reactive, computed,onUnmounted } from "vue"; |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { tr } from "element-plus/es/locale"; |
| | | const dialogFormVisible = ref(false) |
| | | const dialoglea = ref(false) |
| | | const dialogFormVisiblea = ref(false) |
| | | const dialogFormVisibleb = ref(false) |
| | | const dialogFormVisiblec = ref(false) |
| | |
| | | const tableDatad = ref([]) |
| | | const tableDataf = ref([]) |
| | | const tableDatae = ref([]) |
| | | const tableDatax = ref([]) |
| | | const carPosition = ref([]) |
| | | const ganghua = ref('') |
| | | const adjustedRects = ref([]); |
| | |
| | | const adjustedRectsg = ref([]); |
| | | const adjustedRectsh = ref([]); |
| | | const currentRow = reactive({}); // 当前行的数据 |
| | | const inputValuesa = reactive({}); |
| | | |
| | | const add = ref(false) |
| | | const flowCardId = ref(''); |
| | | const gap = ref(''); |
| | |
| | | }); |
| | | setInterval(() => { |
| | | localStorage.clear(); // 清除所有localStorage数据 |
| | | console.log(11111); |
| | | }, 60000); |
| | | // function cleanUp() { |
| | | // console.log('执行清理操作'); |
| | | // } |
| | | // // 假设我们每2分钟执行一次清理 |
| | | // setInterval(cleanUp, 1 * 60 * 1000); |
| | |
| | | // 是否禁用 |
| | | const toggleEnableState = async (row) => { |
| | | const newState = row.enableState === 1 ? 0 : 1; |
| | | console.log(row.slot); |
| | | console.log(row.enableState); |
| | | var url="/cacheVerticalGlass/bigStorageCage/updateStorageCageDisabled?slot="+row.slot + "&enableState=" + newState; |
| | | console.log(url); |
| | | const response = await request.get(url) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | |
| | | |
| | | const handlezhiban = () => { |
| | | dialoglea.value = true; // 打开绑定架子对话框 |
| | | fetchFlowCardId(); |
| | | }; |
| | | const fetchFlowCardId = async () => { |
| | | try { |
| | | const response = await request.post('/cacheVerticalGlass/work_assignment/selectWorkAssignment',{ |
| | | line: 2001, |
| | | workingProcedure : '冷加工' |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | tableDatax.value = response.data; |
| | | console.log(tableDatax.value); |
| | | console |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | const handleConfirm = async () => { |
| | | const response = await request.post("/cacheVerticalGlass/work_assignment/updateWorkAssignment", tableDatax.value) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | dialoglea.value = false; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | }; |
| | | function handleRowClick(row) { |
| | | selectedRow.value = row; // 更新选中的行数据 |
| | | } |
| | |
| | | console.error(error); |
| | | } |
| | | } |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheVerticalGlass/api/talk/slicecage`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | console.log(data.temperingSwitch[0]); |
| | | if(data.bigStorageCageDetailsOutTask!=null){ |
| | | tableDatac.value = data.bigStorageCageDetailsOutTask[0] |
| | | adjusta.value = data.bigStorageCageDetailsOutTask[0].filter(rect => rect.slot !== null && rect.slot !== undefined); |
| | | } else { |
| | | tableDatac.value = '', |
| | | adjusta.value = '' |
| | | } |
| | | if(data.bigStorageCageDetailsFeedTask!=null){ |
| | | tableDatad.value = data.bigStorageCageDetailsFeedTask[0] |
| | | adjust.value = data.bigStorageCageDetailsFeedTask[0].filter(rect => rect.slot !== null && rect.slot !== undefined); |
| | | } |
| | | }else{ |
| | | tableDatad.value = '' |
| | | } |
| | | |
| | | // adjust.value = data.bigStorageCageDetailsFeedTask[0].map(rect => ({ |
| | | // ...rect, |
| | |
| | | // }); |
| | | if(data.bigStorageCageInfo!=null){ |
| | | tableData.value = data.bigStorageCageInfo[0] |
| | | } |
| | | }else{ |
| | | tableData.value = '' |
| | | } |
| | | if(data.temperingGlassInfoList!=null){ |
| | | tableDatab.value = data.temperingGlassInfoList[0] |
| | | } |
| | | }else{ |
| | | tableDatab.value = '' |
| | | } |
| | | if(data.bigStorageCageUsage!=null){ |
| | | tableDatae.value = data.bigStorageCageUsage[0] |
| | | } |
| | | }else{ |
| | | tableDatae.value = '' |
| | | } |
| | | if(data.carPostion!=null){ |
| | | carPosition.value = data.carPostion[0] |
| | | } |
| | | }else{ |
| | | carPosition.value = '' |
| | | } |
| | | if(data.temperingSwitch!=null){ |
| | | ganghua.value = data.temperingSwitch[0] |
| | | } |
| | | console.log(data.temperingSwitch[0]); |
| | | }else{ |
| | | ganghua.value = '' |
| | | } |
| | | if(data.bigStorageCageInfos!=null){ |
| | | window.localStorage.setItem('length', data.bigStorageCageInfos[0][1].length) |
| | | let length = window.localStorage.getItem('length') |
| | |
| | | height: 20/length, |
| | | top: 29/length |
| | | })); |
| | | }else{ |
| | | adjustedRects.value = '' |
| | | } |
| | | |
| | | |
| | |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | |
| | | // initializeWebSocket(socketUrl, handleMessage); |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | function getStatusType(enableState: number) { |
| | | switch (enableState) { |
| | | case 100: |
| | |
| | | } |
| | | } |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | // console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | |
| | | <div style="height: 600px;"> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="primary" @click="dialogFormVisiblea = true">{{ $t('searchOrder.cageinformation') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="success" @click="dialogFormVisibleb = true">{{ $t('searchOrder.productionqueue') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="info" @click="dialogFormVisiblec = true">{{ $t('searchOrder.temperingqueries') }}</el-button> |
| | | <el-switch style="margin-top: 5px;margin-left: 10px;" v-model="ganghua" class="mb-2" inactive-text="钢化开关" @change="handleChange" /> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="warning" @click="dialogFormVisiblec = true">{{ $t('searchOrder.temperingqueries') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="info" @click="handlezhiban">{{ $t('searchOrder.dutyinformation') }}</el-button> |
| | | <el-switch style="margin-top: 5px;margin-left: 10px;" v-model="ganghua" class="mb-2" :inactive-text="$t('searchOrder.temperedswitch')" @change="handleChange" /> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 5px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 100px;"> |
| | | <el-table height="100px" ref="table" |
| | |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | |
| | | <el-dialog v-model="dialoglea" top="15vh" width="70%" :title="$t('searchOrder.dutyinformation')"> |
| | | <el-table ref="table" style="margin-top: 20px;height: 300px;" |
| | | :data="tableDatax" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="line" fixed align="center" :label="$t('searchOrder.line')"/> |
| | | <el-table-column prop="workProcesses" fixed align="center" :label="$t('searchOrder.process')" /> |
| | | <el-table-column prop="teamsGroupsName" align="center" :label="$t('searchOrder.team')"> |
| | | <template #default="{ row }"> |
| | | <el-input v-model="row.teamsGroupsName" autocomplete="off" min-width="150"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="deviceName" align="center" :label="$t('searchOrder.basic')"> |
| | | <template #default="{ row }"> |
| | | <el-input v-model="row.deviceName" autocomplete="off" min-width="150"/> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleConfirm"> |
| | | {{ $t('searchOrder.add') }} |
| | | </el-button> |
| | | <el-button @click="dialoglea = false">{{ $t('searchOrder.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | <style scoped> |
| | | #dt { display:block; float:left;line-height: 20px;margin-left: 100px;} |
| | |
| | | const adda = ref(false) |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import request from "@/utils/request" |
| | | import { ref, onMounted , onBeforeUnmount} from "vue"; |
| | | import { ref, onMounted , onBeforeUnmount,onUnmounted} from "vue"; |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | // import { ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | tableData.value = data.EdgTasks1[0] |
| | | }; |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading"> |
| | |
| | | </template> |
| | | |
| | | <style scoped> |
| | | |
| | | #dt { display:block; float:left;line-height: 20px;margin-left: 100px;} |
| | | #dta { display:block; float:left;line-height: 20px;margin-left: 80%;} |
| | | #dialog-footer{ |
| | |
| | | const adda = ref(false) |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import request from "@/utils/request" |
| | | import { ref, onMounted , onBeforeUnmount} from "vue"; |
| | | import { ref, onMounted , onBeforeUnmount,onUnmounted} from "vue"; |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | // import { ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | |
| | | |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | tableData.value = data.EdgTasks2[0] |
| | | }; |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, watchEffect ,onMounted} from 'vue'; |
| | | import { ref, watchEffect ,onMounted,onUnmounted} from 'vue'; |
| | | |
| | | import { useI18n } from 'vue-i18n' |
| | | const { t } = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | import Swal from 'sweetalert2' |
| | | import request from "@/utils/request"; |
| | | import { initializeWebSocket } from '@/utils/WebSocketService'; |
| | | import { initializeWebSocket,closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { WebSocketHost } from '@/utils/constants'; |
| | | const racks = ref([ |
| | | { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456',downGlassInfoList:"" } }, |
| | |
| | | console.error(error); |
| | | } |
| | | }; |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:8085/api/talk/unloadglass2`; |
| | | //const socketUrl = `ws://${WebSocketHost}:88/api/unLoadGlass/api/talk/unloadglass2`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | |
| | | onMounted(() => { |
| | | fetchFlowCardId(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | const showCustomAlert = (downGlassInfoList) => { |
| | | let tableContent = '<table border="1" style="border-collapse: collapse; width: 100%;">'; |
| | | tableContent += '<tr><th style="background-color: #f2f2f2;">玻璃ID</th><th style="background-color: #f2f2f2;">膜系</th><th style="background-color: #f2f2f2;">厚度</th><th style="background-color: #f2f2f2;">宽度</th><th style="background-color: #f2f2f2;">高度</th></tr>'; |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, watchEffect ,onMounted} from 'vue'; |
| | | import { ref, watchEffect ,onMounted,onUnmounted} from 'vue'; |
| | | |
| | | import { useI18n } from 'vue-i18n' |
| | | const { t } = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | import Swal from 'sweetalert2' |
| | | import request from "@/utils/request"; |
| | | import { initializeWebSocket } from '@/utils/WebSocketService'; |
| | | import { initializeWebSocket,closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | const racks = ref([ |
| | | { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456' } }, |
| | |
| | | } |
| | | }; |
| | | |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unloadglass3`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | |
| | | onMounted(() => { |
| | | fetchFlowCardId(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | const showCustomAlert = (downGlassInfoList) => { |
| | | let tableContent = '<table border="1" style="border-collapse: collapse; width: 100%;">'; |
| | | tableContent += '<tr><th style="background-color: #f2f2f2;">玻璃ID</th><th style="background-color: #f2f2f2;">膜系</th><th style="background-color: #f2f2f2;">厚度</th><th style="background-color: #f2f2f2;">宽度</th><th style="background-color: #f2f2f2;">高度</th></tr>'; |
| | |
| | | <script setup> |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {reactive, onMounted, onBeforeUnmount} from "vue"; |
| | | import {reactive, onMounted, onBeforeUnmount,onUnmounted} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | const router = useRouter() |
| | | import { useI18n } from 'vue-i18n' |
| | |
| | | ElMessage.error('获取表格数据失败,请重试'); |
| | | } |
| | | }; |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unloadglass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | |
| | | onMounted(() => { |
| | | fetchFlowCardId(); |
| | | fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | |
| | | return t('large.allstatus'); |
| | | } |
| | | } |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/screen`; |
| | | const handleMessage = (data) => { |
| | | tableData.value = data.awaitingRepairs[0] |
| | |
| | | // thisProcess: rect.thisProcess, |
| | | // })); |
| | | }; |
| | | let socket; |
| | | // let socket; |
| | | // 设置图表 DOM 引用 |
| | | function setChartDom(index, el) { |
| | | if (!chartRefs.value[index]) { |
| | |
| | | onUnmounted(() => { |
| | | socket.close(); |
| | | }); |
| | | |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | |
| | | package com.mes.damage.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.mapper.DamageMapper; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.pp.entity.BasicDataProduce; |
| | | import com.mes.pp.entity.ReportingWork; |
| | | import com.mes.work_assignment.entity.WorkAssignment; |
| | | import com.mes.work_assignment.mapper.WorkAssignmentMapper; |
| | |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | server-addr: 10.153.19.150:8848 |
| | | gateway: |
| | | discovery: |
| | | locator: |
| | |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import com.mes.taskcache.service.TaskCacheService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.tools.WebSocketServer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | |
| | | @Value("${mes.max.secondLength}") |
| | | private String secondLength; |
| | | |
| | | @Value("${mes.min.firstLength}") |
| | | private String minFirstLength; |
| | | @Value("${mes.min.one.firstLength}") |
| | | private String minOneFirstLength; |
| | | |
| | | @Value("${mes.min.secondLength}") |
| | | private String minSecondLength; |
| | | @Value("${mes.min.one.secondLength}") |
| | | private String minOneSecondLength; |
| | | |
| | | @Value("${mes.min.two.firstLength}") |
| | | private String minTwoFirstLength; |
| | | |
| | | @Value("${mes.min.two.secondLength}") |
| | | private String minTwoSecondLength; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void plcHomeEdgTask() { |
| | |
| | | inTo(glassIdeValue, confirmationWrodAddress, currentSlot); |
| | | } else if ("2".equals(taskRequestTypeValue)) { |
| | | //09空闲 :1 10空闲 :2 都空闲:3 其他0 |
| | | log.info("2、出片请求,且确认字为0,执行进片任务"); |
| | | log.info("2、出片请求,且确认字为0,执行出片任务"); |
| | | outTo(Integer.parseInt(out08Glassstate), |
| | | Integer.parseInt(out10Glassstate), confirmationWrodAddress, "", 0); |
| | | } else if ("3".equals(taskRequestTypeValue)) { |
| | |
| | | Date endDate = new Date(); |
| | | log.info("本次任务结束时间:{},共耗时:{}ms", endDate, endDate.getTime() - startDate.getTime()); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void temperingIsRun(){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //正在进行的任务 |
| | | List<TaskCache>taskCaches=taskCacheService.selectTaskCacheIsRun(); |
| | | jsonObject.append("taskCaches", taskCaches); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("isRun"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | } else { |
| | | log.info("Home is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * 进片任务 |
| | | * |
| | |
| | | // 2、如果没有历史出片任务 |
| | | // 2.1、出当前版图id最小版序最小的玻璃(问题:两条线都没有历史任务,出片时两条线的玻璃尺寸相同,是否找尺寸不同的) |
| | | if ((out08Glassstate == 2 && out10Glassstate == 2) || (out08Glassstate == 0 && out10Glassstate == 0)) { |
| | | log.info("A09、A10为{},{}非自动状态,无法出片"); |
| | | log.info("A09、A10为{},{}非自动状态,无法出片", out08Glassstate, out10Glassstate); |
| | | return Boolean.FALSE; |
| | | } |
| | | log.info("0、出片任务出的状态:A09:【{}】;A10:【{}】)", out08Glassstate, out10Glassstate); |
| | |
| | | if (endcell == Const.A10_OUT_TARGET_POSITION) { |
| | | wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + |
| | | "case when width < height then width else height end as second_length from edg_storage_cage_details) t1 " + |
| | | "on t.glass_id = t1.glass_id and (t1.first_length <=" + firstLength + " and t1.second_length<=" + secondLength + ") "); |
| | | "on t.glass_id = t1.glass_id and (t1.first_length between " + minTwoFirstLength + " and " + firstLength |
| | | + " and t1.second_length between " + minTwoSecondLength + " and " + secondLength + ") "); |
| | | } else { |
| | | wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + |
| | | "case when width < height then width else height end as second_length from edg_storage_cage_details) t1 " + |
| | | "on t.glass_id = t1.glass_id and (t1.first_length >=" + minFirstLength + " and t1.second_length>=" + minSecondLength + ") "); |
| | | "on t.glass_id = t1.glass_id and (t1.first_length >=" + minOneFirstLength + " and t1.second_length>=" + minOneSecondLength + ") "); |
| | | } |
| | | wrapper.last("order by count(t.glass_id) desc limit 2"); |
| | | List<EdgStorageCageDetails> list = edgStorageCageDetailsService.list(wrapper); |
| | | if (CollectionUtil.isEmpty(list)) { |
| | | MPJQueryWrapper<GlassInfo> queryWrapper = new MPJQueryWrapper<GlassInfo>() |
| | | .selectAll(GlassInfo.class).eq("t.glass_id", glassId); |
| | | // .inSql("t.engineer_id", "select engineer_id from engineering where state = 1"); |
| | | if (endcell == Const.A10_OUT_TARGET_POSITION) { |
| | | wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + |
| | | queryWrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + |
| | | "case when width < height then width else height end as second_length from edg_storage_cage_details) t1 " + |
| | | "on t.glass_id = t1.glass_id and (t1.first_length <=" + firstLength + " and t1.second_length<=" + secondLength + ") "); |
| | | "on t.glass_id = t1.glass_id and (t1.first_length between " + minTwoFirstLength + " and " + firstLength |
| | | + " and t1.second_length between " + minTwoSecondLength + " and " + secondLength + ") "); |
| | | } else { |
| | | wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + |
| | | queryWrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + |
| | | "case when width < height then width else height end as second_length from edg_storage_cage_details) t1 " + |
| | | "on t.glass_id = t1.glass_id and (t1.first_length >=" + minFirstLength + " and t1.second_length>=" + minSecondLength + ") "); |
| | | "on t.glass_id = t1.glass_id and (t1.first_length >=" + minOneFirstLength + " and t1.second_length>=" + minOneSecondLength + ") "); |
| | | } |
| | | GlassInfo one = glassInfoService.getOne(queryWrapper); |
| | | if (one != null) { |
| | |
| | | if (endcell == Const.A10_OUT_TARGET_POSITION) { |
| | | wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + |
| | | "case when width < height then width else height end as second_length from edg_storage_cage_details) t1 " + |
| | | "on t.glass_id = t1.glass_id and (t1.first_length <=" + firstLength + " and t1.second_length<=" + secondLength + ") "); |
| | | "on t.glass_id = t1.glass_id and (t1.first_length between " + minTwoFirstLength + " and " + firstLength |
| | | + " and t1.second_length between " + minTwoSecondLength + " and " + secondLength + ") "); |
| | | } else { |
| | | wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + |
| | | "case when width < height then width else height end as second_length from edg_storage_cage_details) t1 " + |
| | | "on t.glass_id = t1.glass_id and (t1.first_length >=" + minFirstLength + " and t1.second_length>=" + minSecondLength + ") "); |
| | | "on t.glass_id = t1.glass_id and (t1.first_length >=" + minOneFirstLength + " and t1.second_length>=" + minOneSecondLength + ") "); |
| | | } |
| | | wrapper.last("order by count(t.glass_id) desc limit 2"); |
| | | List<EdgStorageCageDetails> list = edgStorageCageDetailsService.list(wrapper); |
| | |
| | | return queryMinGlass(firstSize.getWidth(), firstSize.getHeight(), glassId); |
| | | } |
| | | EdgStorageCageDetails outGlassInfo = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getGlassId, taskCache.getGlassId())); |
| | | .eq(EdgStorageCageDetails::getGlassId, taskCache.getGlassId()).last("limit 1")); |
| | | log.info("{}线有出片任务信息,任务信息为{},玻璃信息为{}", endcell, taskCache, outGlassInfo); |
| | | if (outGlassInfo.getWidth() == firstWidth && outGlassInfo.getHeight() == firstHeight) { |
| | | log.info("数量最多的宽{}高{}和{}线任务的宽{}高{}相同,出数量排第二的玻璃,宽{}高{}", |
| | |
| | | edgGlassTaskInfo.setStatus(Const.EDG_GLASS_BEFORE); |
| | | edgGlassTaskInfo.setLine(endcell); |
| | | edgGlassTaskInfo.setTime(new Date()); |
| | | //先将历史对列表中本玻璃的数据删除,重新新增一份最新的数据 |
| | | edgGlassTaskInfoService.remove(new LambdaQueryWrapper<EdgGlassTaskInfo>().eq(EdgGlassTaskInfo::getGlassId, glassInfo.getGlassId())); |
| | | return edgGlassTaskInfoService.save(edgGlassTaskInfo); |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | * @since 2024-04-07 |
| | | */ |
| | | @DS("salve_hangzhoumes") |
| | | public interface TaskCacheMapper extends BaseMapper<TaskCache> { |
| | | public interface TaskCacheMapper extends MPJBaseMapper<TaskCache> { |
| | | |
| | | TaskCache queryGlassByTaskCache(@Param(value = "line") int line, @Param(value = "taskTypes") List<Integer> taskTypes); |
| | | } |
| | |
| | | package com.mes.taskcache.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | |
| | | import java.util.List; |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | public interface TaskCacheService extends IService<TaskCache> { |
| | | public interface TaskCacheService extends MPJBaseService<TaskCache> { |
| | | |
| | | |
| | | boolean insertTaskCache(TaskCache taskCache); |
| | |
| | | * @return |
| | | */ |
| | | TaskCache selectLastOutCacheInfo(int line); |
| | | /** |
| | | * 查询判断磨边线是否有玻璃运行 |
| | | * @param |
| | | * @return |
| | | */ |
| | | List<TaskCache> selectTaskCacheIsRun(); |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.entity.Damage; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class TaskCacheServiceImpl extends ServiceImpl<TaskCacheMapper, TaskCache> implements TaskCacheService { |
| | | public class TaskCacheServiceImpl extends MPJBaseServiceImpl<TaskCacheMapper, TaskCache> implements TaskCacheService { |
| | | |
| | | @Autowired |
| | | EdgStorageCageDetailsMapper edgStorageCageDetailsMapper; |
| | | |
| | | @Autowired |
| | | GlassInfoMapper glassInfoMapper; |
| | | @Autowired |
| | | private TaskCacheMapper taskCacheMapper; |
| | | |
| | | |
| | | /** |
| | |
| | | .eq(EdgStorageCageDetails::getGlassId, GlassInfo::getGlassId) |
| | | .eq(EdgStorageCageDetails::getEngineerId, GlassInfo::getEngineerId)) |
| | | .eq(GlassInfo::getGlassId,taskCache1.getGlassId()) |
| | | .eq(EdgStorageCageDetails::getState,Const.GLASS_STATE_IN) |
| | | .eq(EdgStorageCageDetails::getState,Const.GLASS_STATE_OUT) |
| | | ); |
| | | if(glassInfos.size()==1){ |
| | | GlassInfo glassInfo=glassInfos.get(0); |
| | |
| | | public TaskCache selectLastOutCacheInfo(int line){ |
| | | return baseMapper.selectOne(new MPJLambdaWrapper<TaskCache>().selectAll(TaskCache.class).eq(TaskCache::getEndCell,line).eq(TaskCache::getTaskStatus,1).orderByDesc(TaskCache::getCreateTime)); |
| | | } |
| | | |
| | | /** |
| | | * 查询判断磨边线是否有玻璃运行 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TaskCache> selectTaskCacheIsRun() { |
| | | List<TaskCache> taskCaches=null; |
| | | taskCaches=taskCacheMapper.selectJoinList(TaskCache.class, new MPJLambdaWrapper<TaskCache>() |
| | | .select("top 4 t.end_cell,ISNULL(b.glass_id, 0)as glass_id") |
| | | .leftJoin("big_storage_cage_feed_task as b on t.glass_id=b.glass_id ") |
| | | .groupBy("t.end_cell,b.glass_id,t.create_time") |
| | | .orderByDesc("t.create_time") |
| | | ); |
| | | return taskCaches; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | log.info("大理片笼空车进片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 2000) |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcToHomeEdgOutTask() { |
| | | Date startDate = new Date(); |
| | | log.info("大理片笼空车进片任务开始执行时间:{}", startDate); |
| | |
| | | bigStorageCageDetailsService.remove(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_NEW).in(BigStorageCageDetails::getGlassId, inDamageTaskInfoList.stream().map(BigStorageCageFeedTask::getGlassId).collect(Collectors.toList()))); |
| | | //将破损信息新增入破损表 |
| | | List<Integer> slotList = new ArrayList<>(); |
| | | for (BigStorageCageFeedTask bigStorageCageFeedTask : inDamageTaskInfoList) { |
| | | Damage damage = new Damage(); |
| | | damage.setGlassId(bigStorageCageFeedTask.getGlassId()); |
| | |
| | | damage.setRemark("进笼前卧转立"); |
| | | damage.setStatus(2); |
| | | damageService.insertDamage(damage); |
| | | slotList.add(bigStorageCageFeedTask.getTargetSlot()); |
| | | } |
| | | //更新格子剩余宽度 |
| | | updateSlotRemainBySlots(slotList); |
| | | log.info("进片任务执行完成"); |
| | | } |
| | | //获取出片任务表中状态为破损的数据 |
| | |
| | | .eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_DAMAGE)); |
| | | if (CollectionUtils.isNotEmpty(outDamageTaskInfoList)) { |
| | | log.info("获取出片任务表中破损的玻璃信息{}", outDamageTaskInfoList); |
| | | bigStorageCageOutTaskService.remove(new LambdaQueryWrapper<BigStorageCageOutTask>().eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_IN_DAMAGE)); |
| | | bigStorageCageOutTaskService.remove(new LambdaQueryWrapper<BigStorageCageOutTask>().eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_DAMAGE)); |
| | | List<String> glassIdList = outDamageTaskInfoList.stream().map(BigStorageCageOutTask::getGlassId).collect(Collectors.toList()); |
| | | //移除钢化下片表数据 |
| | | temperingGlassInfoService.remove(new LambdaQueryWrapper<TemperingGlassInfo>().in(TemperingGlassInfo::getGlassId, glassIdList)); |
| | |
| | | bigStorageCageDetailsService.remove(new LambdaQueryWrapper<BigStorageCageDetails>().in(BigStorageCageDetails::getGlassId, glassIdList)); |
| | | |
| | | //将破损信息新增入破损表 |
| | | List<Integer> slotList = new ArrayList<>(); |
| | | for (BigStorageCageOutTask bigStorageCageOutTask : outDamageTaskInfoList) { |
| | | Damage damage = new Damage(); |
| | | damage.setGlassId(bigStorageCageOutTask.getGlassId()); |
| | |
| | | damage.setRemark("出片后卧转立"); |
| | | damage.setStatus(2); |
| | | damageService.insertDamage(damage); |
| | | slotList.add(bigStorageCageOutTask.getStartSlot()); |
| | | } |
| | | //更新格子剩余宽度 |
| | | updateSlotRemainBySlots(slotList); |
| | | log.info("出片任务执行完成"); |
| | | } |
| | | Date endDate = new Date(); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 出片一次仅生成一车玻璃 |
| | | * |
| | | * @param list |
| | | * @param isTempering |
| | | * @param mesToPLCAddress |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list, Boolean isTempering, String mesToPLCAddress) { |
| | | //任务数据 获取车子存放玻璃最大数量 玻璃间隔 |
| | | List<BigStorageCageOutTask> bigStorageCageOutTaskList = new ArrayList<>(); |
| | | //打车剩余尺寸 |
| | | Integer remainWidth = carWidth; |
| | | int maxX = 0; |
| | | for (T e : list) { |
| | | if (bigStorageCageOutTaskList.size() >= outCarMaxSize || e.getWidth() > remainWidth) { |
| | | break; |
| | | } |
| | | remainWidth = remainWidth - (int) e.getWidth() - glassGap; |
| | | if (isTempering) { |
| | | int minLength = Math.min((int) e.getWidth(), (int) e.getHeight()); |
| | | if (maxX + minLength <= xMaxSize) { |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION, |
| | | e.getWidth() * 10, e.getHeight() * 10, 0, 0, 1)); |
| | | maxX = Math.max(maxX, e.getXCoordinate()); |
| | | } else { |
| | | break; |
| | | } |
| | | |
| | | } else { |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.ARTIFICIAL_OUT_TARGET_POSITION, |
| | | e.getWidth() * 10, e.getHeight(), 0, 0, 1)); |
| | | } |
| | | } |
| | | Assert.isFalse(CollectionUtils.isEmpty(bigStorageCageOutTaskList), "未获取出片数据,结束出片任务"); |
| | | log.info("获取出片任务数据{}条,执行保存", bigStorageCageOutTaskList.size()); |
| | | bigStorageCageOutTaskService.saveBatch(bigStorageCageOutTaskList); |
| | | List<String> glassIds = bigStorageCageOutTaskList.stream().map(BigStorageCageOutTask::getGlassId).collect(Collectors.toList()); |
| | | log.info("将出片玻璃{}玻璃状态改为已出片", glassIds); |
| | | bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>() |
| | | .set(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT_ING) |
| | | .in(BigStorageCageDetails::getGlassId, glassIds)); |
| | | int returnData = 0; |
| | | int count = 1; |
| | | while (returnData == 0) { |
| | | S7object.getinstance().plccontrol.writeWord(mesToPLCAddress, 1); |
| | | returnData = S7object.getinstance().plccontrol.readWord(mesToPLCAddress, 1).get(0); |
| | | log.info("已向plc第{}次发送出片任务确认,地址为:{},写入的内容为{}", count++, mesToPLCAddress, returnData); |
| | | } |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | /** |
| | | * 出片一次生成一炉玻璃 |
| | | * |
| | | * @param list |
| | | * @param isTempering |
| | | * @param mesToPLCAddress |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | private <T extends BigStorageCageBaseInfo> Boolean computeOutMoreGlassInfo(List<T> list, Boolean isTempering, String mesToPLCAddress) { |
| | | //任务数据 获取车子存放玻璃最大数量 玻璃间隔 |
| | | List<BigStorageCageOutTask> bigStorageCageOutTaskList = new ArrayList<>(); |
| | | //打车剩余尺寸 |
| | |
| | | int maxX = 0; |
| | | for (T e : list) { |
| | | int maxLength = Math.max((int) e.getWidth(), (int) e.getHeight()); |
| | | if (bigStorageCageOutTaskList.size() >= outCarMaxSize || maxLength > remainWidth) { |
| | | if (serialNumber > outCarMaxSize || maxLength > remainWidth) { |
| | | remainWidth = carWidth; |
| | | trainNumber = trainNumber + 1; |
| | | serialNumber = 1; |
| | | maxX = 0; |
| | | continue; |
| | | } |
| | | remainWidth = remainWidth - maxLength - glassGap; |
| | | if (isTempering) { |
| | |
| | | e.getWidth() * 10, e.getHeight() * 10, trainNumber, serialNumber++, 1)); |
| | | maxX = Math.max(maxX, e.getXCoordinate()); |
| | | } else { |
| | | remainWidth = carWidth; |
| | | remainWidth = carWidth - maxLength - glassGap; |
| | | trainNumber = trainNumber + 1; |
| | | serialNumber = 1; |
| | | maxX = 0; |
| | | continue; |
| | | maxX = e.getXCoordinate(); |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.ARTIFICIAL_OUT_TARGET_POSITION, |
| | | e.getWidth() * 10, e.getHeight(), trainNumber, serialNumber++, 1)); |
| | | } |
| | | } else { |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.ARTIFICIAL_OUT_TARGET_POSITION, |
New file |
| | |
| | | package com.mes.job;
|
| | |
|
| | | import cn.hutool.json.JSONObject;
|
| | |
|
| | | import com.mes.shelfrack.entity.request.RawUsageAndShelfRack;
|
| | | import com.mes.shelfrack.service.ShelfRackService;
|
| | | import com.mes.storagetask.entity.request.StorageTaskRequest;
|
| | | import com.mes.storagetask.service.StorageTaskService;
|
| | | import com.mes.tools.WebSocketServer;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.scheduling.annotation.Scheduled;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | @Slf4j
|
| | | @Component
|
| | | public class push {
|
| | |
|
| | | @Autowired
|
| | | private StorageTaskService storageTaskService;
|
| | | @Autowired
|
| | | private ShelfRackService shelfRackService;
|
| | |
|
| | |
|
| | | @Scheduled(fixedDelay = 2000)
|
| | | public void sendDownWorkstations() {
|
| | | log.info("发送任务信息和架子信息");
|
| | | JSONObject jsonObject = new JSONObject();
|
| | |
|
| | | List<RawUsageAndShelfRack> rack = shelfRackService.selectshelf_rack();
|
| | | List<StorageTaskRequest> tasks = storageTaskService.Tasks();
|
| | |
|
| | | jsonObject.append("rack",rack);
|
| | | jsonObject.append("tasks",tasks);
|
| | | log.info(jsonObject.toString());
|
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("storageTask");
|
| | | if (sendwServer != null) {
|
| | | for (WebSocketServer webserver : sendwServer) {
|
| | | if (webserver != null&&webserver.session.isOpen()) {
|
| | | log.info("已发送");
|
| | | webserver.sendMessage(String.valueOf(jsonObject));
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
| | | package com.mes.loadposition.entity;
|
| | |
|
| | | import com.baomidou.mybatisplus.annotation.IdType;
|
| | | import com.baomidou.mybatisplus.annotation.TableId;
|
| | | import com.baomidou.mybatisplus.annotation.TableName;
|
| | | import io.swagger.annotations.ApiModel;
|
| | | import io.swagger.annotations.ApiModelProperty;
|
| | |
| | | /**
|
| | | *
|
| | | */
|
| | | @ApiModelProperty(" ")
|
| | | private Long id;
|
| | | @TableId(value = "id", type = IdType.AUTO)
|
| | | private Integer id;
|
| | |
|
| | | /**
|
| | | * 架子编号
|
| | |
| | | * 仓储任务编号
|
| | | */
|
| | | @ApiModelProperty("仓储任务编号")
|
| | | private Long storageTaskId;
|
| | | private Integer storageTaskId;
|
| | |
|
| | | /**
|
| | | * 上片位类型
|
| | |
| | | package com.mes.rawusage.controller;
|
| | |
|
| | | import com.mes.shelfrack.entity.request.RawUsageAndShelfRack;
|
| | | import com.mes.utils.Result;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.http.ResponseEntity;
|
| | |
| | | */
|
| | | @ApiOperation(value = "修改", notes = "修改数据")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "操作成功")})
|
| | | @PutMapping
|
| | | public Result update( @RequestBody RawUsage rawUsage) {
|
| | | @PostMapping("/updaterawUsage")
|
| | | public Result updaterawUsage(@RequestBody RawUsage rawUsage) {
|
| | | boolean result = rawUsageService.updateById(rawUsage);
|
| | | return Result.success(result);
|
| | | }
|
| | |
| | | /**
|
| | | * 删除
|
| | | *
|
| | | * @param id
|
| | | * @param
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "删除", notes = "删除数据")
|
| | | @DeleteMapping("/{id}")
|
| | | public Result delete(@PathVariable("id") Long id) {
|
| | | int result = rawUsageService.getBaseMapper().deleteById(id);
|
| | | return Result.success(result);
|
| | | @PostMapping("/id")
|
| | | public Result delete(@RequestBody RawUsage rawUsage) {
|
| | | rawUsageService.updateRawPackageAndStorageRack(rawUsage);
|
| | | return Result.success();
|
| | | }
|
| | |
|
| | | @ApiOperation(value = "入库", notes = "入库")
|
| | | @PostMapping("/inStorage")
|
| | | public Result inStorage(@RequestBody RawUsageAndShelfRack rawUsage) {
|
| | | rawUsageService.inStorage(rawUsage);
|
| | | return Result.success();
|
| | | }
|
| | |
|
| | | @ApiOperation(value = "出库", notes = "出库")
|
| | | @PostMapping("/outStorage")
|
| | | public Result outStorage(@RequestBody RawUsageAndShelfRack rawUsage) {
|
| | | rawUsageService.outStorage(rawUsage);
|
| | | return Result.success();
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | } |
| | |
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | |
|
| | | import com.baomidou.mybatisplus.annotation.IdType;
|
| | | import com.baomidou.mybatisplus.annotation.TableId;
|
| | | import com.baomidou.mybatisplus.annotation.TableName;
|
| | | import io.swagger.annotations.ApiModel;
|
| | | import io.swagger.annotations.ApiModelProperty;
|
| | |
| | | /**
|
| | | *
|
| | | */
|
| | | @ApiModelProperty(" ")
|
| | | private Long id;
|
| | | @TableId(value = "id", type = IdType.AUTO)
|
| | | private Integer id;
|
| | |
|
| | | /**
|
| | | * 玻璃类型
|
| | |
| | |
|
| | | import com.mes.rawusage.entity.RawUsage;
|
| | | import com.baomidou.mybatisplus.extension.service.IService;
|
| | | import com.mes.shelfrack.entity.ShelfRack;
|
| | | import com.mes.shelfrack.entity.request.RawUsageAndShelfRack;
|
| | |
|
| | | import java.util.List;
|
| | | /**
|
| | |
| | |
|
| | | List<RawUsage> findList(RawUsage params);
|
| | |
|
| | | /**
|
| | | * @param raw
|
| | | * 修改
|
| | | */
|
| | | void updateRawPackageAndStorageRack(RawUsage raw);
|
| | |
|
| | | /**
|
| | | * @param raw
|
| | | * 入库
|
| | | */
|
| | | void inStorage(RawUsageAndShelfRack raw);
|
| | |
|
| | |
|
| | | /**
|
| | | * @param raw
|
| | | * 出库
|
| | | */
|
| | | void outStorage(RawUsageAndShelfRack raw);
|
| | |
|
| | | } |
| | |
| | | import com.mes.rawusage.mapper.RawUsageMapper;
|
| | | import com.mes.rawusage.entity.RawUsage;
|
| | | import com.mes.rawusage.service.RawUsageService;
|
| | | import com.mes.shelfrack.entity.ShelfRack;
|
| | | import com.mes.shelfrack.entity.request.RawUsageAndShelfRack;
|
| | | import com.mes.shelfrack.mapper.ShelfRackMapper;
|
| | | import com.mes.storagetask.entity.StorageTask;
|
| | | import com.mes.storagetask.mapper.StorageTaskMapper;
|
| | | import org.springframework.beans.BeanUtils;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import java.lang.reflect.InvocationTargetException;
|
| | | import java.time.LocalDateTime;
|
| | | import java.util.List;
|
| | |
|
| | | import static cn.hutool.core.date.DateTime.now;
|
| | |
|
| | | /**
|
| | | * @author system
|
| | |
| | |
|
| | | @Autowired
|
| | | private RawUsageMapper rawUsageMapper;
|
| | | @Autowired
|
| | | private ShelfRackMapper shelfRackMapper;
|
| | | @Autowired
|
| | | private StorageTaskMapper storageTaskMapper;
|
| | |
|
| | | @Override
|
| | | public List<RawUsage> findList(RawUsage params){
|
| | |
| | | return rawUsageMapper.selectList(query);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void updateRawPackageAndStorageRack(RawUsage raw) {
|
| | | // Step 1: 查询raw_package_id
|
| | | LambdaQueryWrapper<ShelfRack> queryWrapper = Wrappers.lambdaQuery(ShelfRack.class)
|
| | | .eq(ShelfRack::getNumber, raw.getId());
|
| | | ShelfRack shelfRack = shelfRackMapper.selectOne(queryWrapper);
|
| | | if (shelfRack == null) {
|
| | | throw new RuntimeException("未找到与指定货架ID关联的原料包信息");
|
| | | }
|
| | |
|
| | |
|
| | | // Step 2: 更新raw_package表
|
| | | RawUsage rawUsage=new RawUsage();
|
| | |
|
| | | rawUsage.setState("空闲");
|
| | | rawUsage.setId(shelfRack.getRawPackageId());
|
| | | rawUsageMapper.updateById(rawUsage);
|
| | |
|
| | | // Step 3: 更新storage_rack表
|
| | |
|
| | | ShelfRack rack = new ShelfRack();
|
| | | rack.setState("空闲");
|
| | | rack.setRawPackageId(null); // 设置RawPackageId为特定的空值,例如0
|
| | | LambdaQueryWrapper<ShelfRack> queryWrapper2 = Wrappers.lambdaQuery(ShelfRack.class)
|
| | | .eq(ShelfRack::getNumber, raw.getId());
|
| | | shelfRackMapper.update(rack, queryWrapper2);
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | @Override
|
| | | public void inStorage(RawUsageAndShelfRack raw) {
|
| | | RawUsage rawPackage = new RawUsage();
|
| | | BeanUtils.copyProperties(raw,rawPackage);
|
| | | rawPackage.setRawType(raw.getRawThickness() + raw.getColor());
|
| | | rawPackage.setState("使用中");
|
| | | rawPackage.setLeftPieces(rawPackage.getPieces());
|
| | | rawUsageMapper.insert(rawPackage);
|
| | |
|
| | | // 更新架表
|
| | | ShelfRack rack = new ShelfRack();
|
| | | rack.setState("使用中");
|
| | | rack.setRawPackageId(rawPackage.getId()); // 设置RawPackageId为特定的空值,例如0
|
| | | LambdaQueryWrapper<ShelfRack> queryWrapper = Wrappers.lambdaQuery(ShelfRack.class)
|
| | | .eq(ShelfRack::getNumber, raw.getNumber());
|
| | | shelfRackMapper.update(rack, queryWrapper);
|
| | | StorageTask storageTask=new StorageTask();
|
| | | storageTask.setTaskState("等待中");
|
| | | storageTask.setTaskType("从仓位到吊装位");
|
| | | storageTask.setLoadRack(raw.getLoadRack());
|
| | | storageTask.setShelfRack(raw.getNumber());
|
| | | storageTask.setRouteGroup(1);
|
| | | storageTask.setStartTime(now());
|
| | | storageTask.setFinishTime(now());
|
| | | insertTask(storageTask);
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public void outStorage(RawUsageAndShelfRack raw) {
|
| | | ShelfRack rack = new ShelfRack();
|
| | | rack.setState("等待出库");
|
| | | rack.setRawPackageId(null); // 设置RawPackageId为特定的空值,例如0
|
| | | LambdaQueryWrapper<ShelfRack> queryWrapper = Wrappers.lambdaQuery(ShelfRack.class)
|
| | | .eq(ShelfRack::getNumber, raw.getNumber());
|
| | | shelfRackMapper.update(rack, queryWrapper);
|
| | |
|
| | |
|
| | | StorageTask storageTask=new StorageTask();
|
| | | storageTask.setTaskState("等待中");
|
| | | storageTask.setTaskType("从仓位到吊装位");
|
| | | storageTask.setLoadRack(raw.getLoadRack());
|
| | | storageTask.setShelfRack(raw.getNumber());
|
| | | storageTask.setRouteGroup(1);
|
| | | storageTask.setStartTime(now());
|
| | | storageTask.setFinishTime(now());
|
| | | insertTask(storageTask);
|
| | | }
|
| | |
|
| | |
|
| | | public void insertTask(StorageTask storageTask) {
|
| | | storageTaskMapper.insert(storageTask);
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | } |
| | |
| | | package com.mes.shelfrack.controller;
|
| | |
|
| | | import com.mes.shelfrack.entity.request.RawUsageAndShelfRack;
|
| | | import com.mes.utils.Result;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.http.ResponseEntity;
|
| | |
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")})
|
| | | @GetMapping("/findshelfrack")
|
| | | public Result findshelfrack() {
|
| | | List<Map<String, Object>> result = shelfRackService.selectshelf_rack();
|
| | | List<RawUsageAndShelfRack> result = shelfRackService.selectshelf_rack();
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | |
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | |
|
| | | import com.baomidou.mybatisplus.annotation.IdType;
|
| | | import com.baomidou.mybatisplus.annotation.TableId;
|
| | | import com.baomidou.mybatisplus.annotation.TableName;
|
| | | import io.swagger.annotations.ApiModel;
|
| | | import io.swagger.annotations.ApiModelProperty;
|
| | |
| | | /**
|
| | | *
|
| | | */
|
| | | @ApiModelProperty(" ")
|
| | | private Long id;
|
| | | @TableId(value = "id", type = IdType.AUTO)
|
| | | private Integer id;
|
| | |
|
| | | /**
|
| | | * 架子编号
|
| | |
| | | * 包号编号
|
| | | */
|
| | | @ApiModelProperty("包号编号")
|
| | | private Long rawPackageId;
|
| | | private Integer rawPackageId;
|
| | |
|
| | | /**
|
| | | * 修改时间
|
New file |
| | |
| | | package com.mes.shelfrack.entity.request;
|
| | |
|
| | | import com.baomidou.mybatisplus.annotation.IdType;
|
| | | import com.baomidou.mybatisplus.annotation.TableId;
|
| | | import io.swagger.annotations.ApiModelProperty;
|
| | | import lombok.Data;
|
| | | import lombok.EqualsAndHashCode;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | |
|
| | | @Data
|
| | |
|
| | | @EqualsAndHashCode(callSuper = false)
|
| | | public class RawUsageAndShelfRack {
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @ApiModelProperty("ID")
|
| | | private Integer id;
|
| | |
|
| | | @ApiModelProperty("玻璃类型")
|
| | | private String rawType;
|
| | |
|
| | | @ApiModelProperty("宽度")
|
| | | private Float rawWidth;
|
| | |
|
| | | @ApiModelProperty("高度")
|
| | | private Float rawHeight;
|
| | |
|
| | | @ApiModelProperty("厚度")
|
| | | private Float rawThickness;
|
| | |
|
| | | @ApiModelProperty("颜色")
|
| | | private String color;
|
| | |
|
| | | @ApiModelProperty("总数量")
|
| | | private Integer pieces;
|
| | |
|
| | | @ApiModelProperty("剩余数量")
|
| | | private Integer leftPieces;
|
| | |
|
| | | @ApiModelProperty("物料编码")
|
| | | private String qrcode;
|
| | |
|
| | | @ApiModelProperty("创建时间")
|
| | |
|
| | | private Date createTime;
|
| | |
|
| | |
|
| | |
|
| | | private Date productionTime;
|
| | |
|
| | | @ApiModelProperty("批次号")
|
| | | private String batchId;
|
| | |
|
| | | @ApiModelProperty("架子编号")
|
| | | private String number;
|
| | |
|
| | | @ApiModelProperty("工作状态")
|
| | | private String state;
|
| | |
|
| | | @ApiModelProperty("包号编号")
|
| | | private Integer rawPackageId;
|
| | |
|
| | |
|
| | | private Date modTime;
|
| | |
|
| | | @ApiModelProperty("启用状态")
|
| | | private String enableState;
|
| | |
|
| | | @ApiModelProperty("上片位编号")
|
| | | private String loadRack;
|
| | |
|
| | |
|
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import com.github.yulichang.base.MPJBaseMapper;
|
| | | import com.mes.shelfrack.entity.ShelfRack;
|
| | | import com.mes.shelfrack.entity.request.RawUsageAndShelfRack;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
| | | public interface ShelfRackMapper extends MPJBaseMapper<ShelfRack> {
|
| | |
|
| | |
|
| | | List<Map<String, Object>> selectshelf_rack();
|
| | | List<RawUsageAndShelfRack> selectshelf_rack();
|
| | | } |
| | |
| | |
|
| | | import com.mes.shelfrack.entity.ShelfRack;
|
| | | import com.baomidou.mybatisplus.extension.service.IService;
|
| | | import com.mes.shelfrack.entity.request.RawUsageAndShelfRack;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
| | |
|
| | | List<ShelfRack> findList(ShelfRack params);
|
| | |
|
| | | List<Map<String, Object>> selectshelf_rack();
|
| | | List<RawUsageAndShelfRack> selectshelf_rack();
|
| | |
|
| | | } |
| | |
| | | import com.github.yulichang.toolkit.JoinWrappers;
|
| | | import com.mes.common.config.Const;
|
| | | import com.mes.rawusage.entity.RawUsage;
|
| | | import com.mes.shelfrack.entity.request.RawUsageAndShelfRack;
|
| | | import com.mes.shelfrack.mapper.ShelfRackMapper;
|
| | | import com.mes.shelfrack.entity.ShelfRack;
|
| | | import com.mes.shelfrack.service.ShelfRackService;
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> selectshelf_rack() {
|
| | | public List<RawUsageAndShelfRack> selectshelf_rack() {
|
| | | return baseMapper.selectshelf_rack();
|
| | | }
|
| | |
|
| | |
| | | package com.mes.storagetask.controller;
|
| | |
|
| | | import com.mes.shelfrack.entity.request.RawUsageAndShelfRack;
|
| | | import com.mes.storagetask.entity.request.StorageTaskRequest;
|
| | | import com.mes.utils.Result;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.http.ResponseEntity;
|
| | |
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")})
|
| | | @GetMapping("/findTasks")
|
| | | public Result findLatestTasks() {
|
| | | List<Map<String, Object>> result = storageTaskService.Tasks();
|
| | | List<StorageTaskRequest> result = storageTaskService.Tasks();
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | @ApiOperation(value = "任务操作", notes = "任务操作")
|
| | | @PostMapping("/taskUpdate")
|
| | | public Result taskUpdate(@RequestBody Map<String, Object> storageTaskMap) {
|
| | |
|
| | | StorageTask task = new StorageTask();
|
| | | task.setType((String) storageTaskMap.get("Type")); // 假设Type是存储在Map中的一个键
|
| | | task.setId((int) storageTaskMap.get("id"));
|
| | | storageTaskService.taskUpdate(task);
|
| | | return Result.success();
|
| | | }
|
| | |
|
| | |
|
| | | } |
| | |
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | |
|
| | | import com.baomidou.mybatisplus.annotation.IdType;
|
| | | import com.baomidou.mybatisplus.annotation.TableId;
|
| | | import com.baomidou.mybatisplus.annotation.TableName;
|
| | | import io.swagger.annotations.ApiModel;
|
| | | import io.swagger.annotations.ApiModelProperty;
|
| | | import lombok.Data;
|
| | | import lombok.EqualsAndHashCode;
|
| | | import org.apache.xmlbeans.impl.xb.xsdschema.Public;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | /**
|
| | |
| | | /**
|
| | | *
|
| | | */
|
| | | @ApiModelProperty(" ")
|
| | | private Long id;
|
| | |
|
| | | @TableId(value = "id", type = IdType.AUTO)
|
| | | private Integer id;
|
| | | /**
|
| | | * 任务类型
|
| | | */
|
| | |
| | | @ApiModelProperty("完成时间")
|
| | | private Date finishTime;
|
| | |
|
| | | @ApiModelProperty("前端任务类型")
|
| | | private String Type;
|
| | |
|
| | |
|
| | | } |
New file |
| | |
| | | package com.mes.storagetask.entity.request;
|
| | |
|
| | | import com.baomidou.mybatisplus.annotation.IdType;
|
| | | import com.baomidou.mybatisplus.annotation.TableId;
|
| | | import io.swagger.annotations.ApiModelProperty;
|
| | | import lombok.Data;
|
| | | import lombok.EqualsAndHashCode;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | @Data
|
| | | @EqualsAndHashCode(callSuper = false)
|
| | | public class StorageTaskRequest {
|
| | |
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | /**
|
| | | *
|
| | | */
|
| | | @TableId(value = "id", type = IdType.AUTO)
|
| | | private Integer id;
|
| | | /**
|
| | | * 任务类型
|
| | | */
|
| | | @ApiModelProperty("任务类型")
|
| | | private String taskType;
|
| | |
|
| | |
|
| | |
|
| | | @ApiModelProperty("前端任务类型")
|
| | | private String Type;
|
| | |
|
| | | /**
|
| | | * 工作状态
|
| | | */
|
| | | @ApiModelProperty("工作状态")
|
| | | private String taskState;
|
| | |
|
| | | /**
|
| | | * 仓储架号
|
| | | */
|
| | | @ApiModelProperty("仓储架号")
|
| | | private String shelfRack;
|
| | |
|
| | | /**
|
| | | * 上片位编号
|
| | | */
|
| | | @ApiModelProperty("上片位编号")
|
| | | private String loadRack;
|
| | |
|
| | | /**
|
| | | * 线路
|
| | | */
|
| | | @ApiModelProperty("线路")
|
| | | private Integer routeGroup;
|
| | |
|
| | | /**
|
| | | * 创建时间
|
| | | */
|
| | | @ApiModelProperty("创建时间")
|
| | | private Date startTime;
|
| | |
|
| | | /**
|
| | | * 完成时间
|
| | | */
|
| | | @ApiModelProperty("完成时间")
|
| | | private Date finishTime;
|
| | |
|
| | | @ApiModelProperty("颜色")
|
| | | private String color;
|
| | |
|
| | | @ApiModelProperty("厚度")
|
| | | private Float rawThickness;
|
| | |
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import com.mes.storagetask.entity.StorageTask;
|
| | | import com.mes.storagetask.entity.request.StorageTaskRequest;
|
| | | import org.apache.ibatis.annotations.Param;
|
| | | import org.springframework.stereotype.Repository;
|
| | |
|
| | |
| | | public interface StorageTaskMapper extends BaseMapper<StorageTask> {
|
| | |
|
| | |
|
| | | List<Map<String, Object>> selectTasks();
|
| | | List<StorageTaskRequest> selectTasks();
|
| | |
|
| | | } |
| | |
| | |
|
| | | import com.mes.storagetask.entity.StorageTask;
|
| | | import com.baomidou.mybatisplus.extension.service.IService;
|
| | | import com.mes.storagetask.entity.request.StorageTaskRequest;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
| | |
|
| | | Map<String, Optional<StorageTask>> findLatestTasks();
|
| | |
|
| | | List<Map<String, Object>> Tasks();
|
| | | List<StorageTaskRequest> Tasks();
|
| | |
|
| | | void taskUpdate(StorageTask storageTask);
|
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
| | | import com.mes.loadposition.entity.LoadPosition;
|
| | | import com.mes.loadposition.mapper.LoadPositionMapper;
|
| | | import com.mes.rawusage.entity.RawUsage;
|
| | | import com.mes.rawusage.mapper.RawUsageMapper;
|
| | | import com.mes.shelfrack.entity.ShelfRack;
|
| | | import com.mes.shelfrack.entity.request.RawUsageAndShelfRack;
|
| | | import com.mes.shelfrack.mapper.ShelfRackMapper;
|
| | | import com.mes.storagetask.entity.request.StorageTaskRequest;
|
| | | import com.mes.storagetask.mapper.StorageTaskMapper;
|
| | | import com.mes.storagetask.entity.StorageTask;
|
| | | import com.mes.storagetask.service.StorageTaskService;
|
| | |
| | |
|
| | | @Autowired
|
| | | private StorageTaskMapper storageTaskMapper;
|
| | | @Autowired
|
| | | private LoadPositionMapper loadPositionMapper;
|
| | | @Autowired
|
| | | private ShelfRackMapper shelfRackMapper;
|
| | | @Autowired
|
| | | private RawUsageMapper rawUsageMapper;
|
| | |
|
| | |
|
| | | @Override
|
| | | public List<StorageTask> findList(StorageTask params){
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> Tasks() {
|
| | | public List<StorageTaskRequest> Tasks() {
|
| | | return baseMapper.selectTasks();
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | @Override
|
| | | public void taskUpdate(StorageTask request) {
|
| | | Integer taskId = request.getId();
|
| | | String taskType = request.getTaskType();
|
| | | String Type = request.getType();
|
| | | String taskState = request.getTaskState();
|
| | | String shelfRack = request.getShelfRack();
|
| | | String loadRack = request.getLoadRack();
|
| | |
|
| | | if ("重新开始".equals(Type)) {
|
| | | StorageTask storageTask = new StorageTask();
|
| | | storageTask.setTaskState("等待中");
|
| | | LambdaQueryWrapper<StorageTask> queryWrapper = Wrappers.lambdaQuery(StorageTask.class)
|
| | | .eq(StorageTask::getId, request.getId());
|
| | | storageTaskMapper.update(request,queryWrapper);
|
| | | } else if ("完成".equals(Type)) {
|
| | | StorageTask existingTask = storageTaskMapper.selectById(taskId);
|
| | | if (existingTask != null && "正在工作".equals(existingTask.getTaskState())) {
|
| | | if ("从仓位到上片位".equals(taskType) || "从仓位到吊装位".equals(taskType)) {
|
| | | LoadPosition loadPosition = new LoadPosition();
|
| | | loadPosition.setState("正在使用");
|
| | | loadPosition.setStorageTaskId(request.getId());
|
| | | LambdaQueryWrapper<LoadPosition> queryWrapper = Wrappers.lambdaQuery(LoadPosition.class)
|
| | | .eq(LoadPosition::getNumber, request.getLoadRack());
|
| | | loadPositionMapper.update(loadPosition, queryWrapper);
|
| | | StorageTask storageTask = new StorageTask();
|
| | | storageTask.setTaskState("正在使用");
|
| | | LambdaQueryWrapper<StorageTask> StorageTaskqueryWrapper = Wrappers.lambdaQuery(StorageTask.class)
|
| | | .eq(StorageTask::getId, request.getId());
|
| | | storageTaskMapper.update(request,StorageTaskqueryWrapper);
|
| | | } else if ("从上片位到仓位".equals(taskType)) {
|
| | | LoadPosition loadPosition = new LoadPosition();
|
| | | loadPosition.setState("使用中");
|
| | | loadPosition.setStorageTaskId(null);
|
| | | LambdaQueryWrapper<LoadPosition> queryWrapper = Wrappers.lambdaQuery(LoadPosition.class)
|
| | | .eq(LoadPosition::getNumber, request.getLoadRack());
|
| | | loadPositionMapper.update(loadPosition, queryWrapper);
|
| | | ShelfRack loshelfRack = new ShelfRack();
|
| | | LambdaQueryWrapper<RawUsage> RawUsagequeryWrapper = Wrappers.lambdaQuery(RawUsage.class)
|
| | | .eq(RawUsage::getId,loshelfRack.getRawPackageId());
|
| | | RawUsage RawUsage = rawUsageMapper.selectOne(RawUsagequeryWrapper);
|
| | | if(RawUsage.getLeftPieces()==0){
|
| | | loshelfRack.setState("空闲");
|
| | | }else {
|
| | | loshelfRack.setState("使用中");
|
| | | }
|
| | | LambdaQueryWrapper<ShelfRack> loshelfRackqueryWrapper = Wrappers.lambdaQuery(ShelfRack.class)
|
| | | .eq(ShelfRack::getNumber, request.getLoadRack());
|
| | | shelfRackMapper.update(loshelfRack, loshelfRackqueryWrapper);
|
| | | } else if ("从吊装位到仓位".equals(taskType)) {
|
| | | LoadPosition loadPosition = new LoadPosition();
|
| | | loadPosition.setState("空闲");
|
| | | loadPosition.setStorageTaskId(null);
|
| | | LambdaQueryWrapper<LoadPosition> queryWrapper = Wrappers.lambdaQuery(LoadPosition.class)
|
| | | .eq(LoadPosition::getNumber, request.getLoadRack());
|
| | | loadPositionMapper.update(loadPosition, queryWrapper);
|
| | | ShelfRack loshelfRack = new ShelfRack();
|
| | | LambdaQueryWrapper<RawUsage> RawUsagequeryWrapper = Wrappers.lambdaQuery(RawUsage.class)
|
| | | .eq(RawUsage::getId,loshelfRack.getRawPackageId());
|
| | | RawUsage RawUsage = rawUsageMapper.selectOne(RawUsagequeryWrapper);
|
| | | if(RawUsage.getLeftPieces()==1){
|
| | | loshelfRack.setEnableState("启用");
|
| | | }else {
|
| | | loshelfRack.setEnableState(loshelfRack.getEnableState());
|
| | | }
|
| | | loadPosition.setState("使用中");
|
| | | LambdaQueryWrapper<ShelfRack> loshelfRackqueryWrapper = Wrappers.lambdaQuery(ShelfRack.class)
|
| | | .eq(ShelfRack::getNumber, request.getLoadRack());
|
| | | shelfRackMapper.update(loshelfRack, loshelfRackqueryWrapper);
|
| | | }
|
| | | StorageTask storageTask = new StorageTask();
|
| | | storageTask.setTaskState("已完成");
|
| | | LambdaQueryWrapper<StorageTask> StorageTaskqueryWrapper = Wrappers.lambdaQuery(StorageTask.class)
|
| | | .eq(StorageTask::getId, request.getId());
|
| | | storageTaskMapper.update(storageTask, StorageTaskqueryWrapper);
|
| | | }
|
| | | } else if ("删除".equals(Type)) {
|
| | |
|
| | | LambdaQueryWrapper<StorageTask> StorageTaskqueryWrapper = Wrappers.lambdaQuery(StorageTask.class)
|
| | | .eq(StorageTask::getId, request.getId());
|
| | | storageTaskMapper.delete(StorageTaskqueryWrapper);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.mes.shelfrack.mapper.ShelfRackMapper">
|
| | |
|
| | |
|
| | | <select id="selectshelf_rack" resultType="java.util.Map">
|
| | | <![CDATA[
|
| | | SELECT a.number, b.raw_type, b.raw_width, b.raw_height, b.raw_thickness, b.left_pieces, a.mod_time, a.enable_state, b.pieces,
|
| | | datediff(now(), b.create_time) as rukutime,
|
| | | concat(if(ROUND(b.left_pieces / b.pieces * 100, 0) < 20, 20, ROUND(b.left_pieces / b.pieces * 100, 0)), '%') as bfb
|
| | | FROM shelf_rack AS a
|
| | | LEFT JOIN raw_usage AS b ON a.raw_package_id = b.id
|
| | | ]]>
|
| | | </select>
|
| | | <resultMap id="ShelfRackResultMap" type="com.mes.shelfrack.entity.request.RawUsageAndShelfRack">
|
| | | <result property="number" column="number"/>
|
| | | <result property="rawType" column="raw_type"/>
|
| | | <result property="rawWidth" column="raw_width"/>
|
| | | <result property="rawHeight" column="raw_height"/>
|
| | | <result property="rawThickness" column="raw_thickness"/>
|
| | | <result property="enableState" column="enable_state"/>
|
| | | <result property="pieces" column="pieces"/>
|
| | | <result property="createTime" column="createTime" />
|
| | | <result property="batchId" column="batch_id"/>
|
| | | </resultMap>
|
| | | <select id="selectshelf_rack" resultMap="ShelfRackResultMap">
|
| | | <![CDATA[
|
| | | SELECT a.number, b.raw_type, b.raw_width, b.raw_height, b.raw_thickness, a.enable_state, b.pieces,
|
| | | b.batch_id,DATE_FORMAT(b.create_time, '%Y-%m-%d %H:%i:%s') as createTime
|
| | | FROM shelf_rack AS a
|
| | | LEFT JOIN raw_usage AS b ON a.raw_package_id = b.id
|
| | | ]]>
|
| | | </select>
|
| | |
|
| | | </mapper>
|
| | |
| | | <mapper namespace="com.mes.storagetask.mapper.StorageTaskMapper">
|
| | |
|
| | |
|
| | | <resultMap id="StorageTaskRequest" type="com.mes.storagetask.entity.request.StorageTaskRequest">
|
| | | <result property="loadRack" column="load_rack"/>
|
| | | <result property="color" column="color"/>
|
| | | <result property="taskState" column="task_state"/>
|
| | | <result property="shelfRack" column="shelf_rack"/>
|
| | | <result property="startTime" column="start_time"/>
|
| | | <result property="rawThickness" column="raw_thickness"/>
|
| | | <result property="routeGroup" column="route_group"/>
|
| | | <result property="id" column="id" />
|
| | | <result property="taskType" column="task_type"/>
|
| | | </resultMap>
|
| | |
|
| | | <select id="selectTasks" resultType="java.util.Map">
|
| | |
|
| | |
|
| | | <select id="selectTasks" resultMap="StorageTaskRequest">
|
| | | <![CDATA[
|
| | | SELECT d.*, g.raw_thickness, g.color
|
| | | FROM (
|
| | |
| | | package mes; |
| | | |
| | | import com.mes.GlassStorageApplication; |
| | | import com.mes.rawusage.entity.RawUsage; |
| | | import com.mes.rawusage.service.RawUsageService; |
| | | import com.mes.shelfrack.entity.ShelfRack; |
| | | import com.mes.shelfrack.service.ShelfRackService; |
| | | import com.mes.storagetask.entity.StorageTask; |
| | | import com.mes.storagetask.service.StorageTaskService; |
| | |
| | | private StorageTaskService storageTaskService; |
| | | @Autowired |
| | | private ShelfRackService shelfRackService; |
| | | @Autowired |
| | | private RawUsageService rawUsageService; |
| | | |
| | | |
| | | @Test |
| | |
| | | |
| | | |
| | | |
| | | @Test |
| | | public void updateRawPackageAndStorageRack() { |
| | | RawUsage raw=new RawUsage(); |
| | | |
| | | raw.setId(null); |
| | | rawUsageService.updateRawPackageAndStorageRack(raw); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | //查询是否有开始上片的工程任务 |
| | | QueryWrapper<Engineering> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("state", state); |
| | | return this.getOne(wrapper); |
| | | return engineeringMapper.selectOne(wrapper); |
| | | } |
| | | |
| | | @Override |
| | |
| | | //工位信息 |
| | | List<UpWorkstation> upWorkstations = upWorkstationService.list(); |
| | | jsonObject.append("list", upWorkstations); |
| | | //是否开始工程 |
| | | Engineering engineering = engineeringService.selectInitiate(1); |
| | | if (engineering != null){ |
| | | jsonObject.append("engineering", engineering); |
| | | }else { |
| | | jsonObject.append("engineering", "0"); |
| | | } |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("loadGlass"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //正在进行的任务 |
| | | String inkageStatus =plcParameterObject.getPlcParameter("InkageStatus").getValue(); |
| | | // String inkageStatus ="1"; |
| | | //String inkageStatus ="1"; |
| | | jsonObject.append("InkageStatus", inkageStatus); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("loadGlass"); |
| | | if (sendwServer != null) { |
| | |
| | | } |
| | | } |
| | | } |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void loadGlassIsRun() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | Engineering engineering = engineeringService.selectInitiate(1); |
| | | if (engineering != null){ |
| | | jsonObject.append("engineering", engineering); |
| | | }else { |
| | | jsonObject.append("engineering", "0"); |
| | | } |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("IsRun"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | } else { |
| | | log.info("Home is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void overTask(String loadStatus, int state) { |
| | | |
| | |
| | | // 调用 DownWorkstationService 中的方法清除指定工位ID的信息 |
| | | int workstationId = (int) requestData.get("workstationId"); |
| | | |
| | | int totalWorkstations = downWorkstationService.getTotalQuantity(workstationId); |
| | | int downWorkstations = downWorkstationService.getRacksNumber(workstationId); |
| | | |
| | | |
| | | if (downWorkstations == totalWorkstations) { |
| | | downWorkstationService.clearFlowCardId(workstationId); |
| | | return Result.build(200, "清除工位信息成功", 1); |
| | | } else { |
| | | // 如果总数量和落架数量不一致,返回错误响应 |
| | | return Result.build(500, "清除工位信息失败", 1); |
| | | } |
| | | |
| | | |
| | | |
| | | // 构建响应数据 |
| | |
| | | log.info("2、查询卧式理片笼里面的空格:{}", nearestEmpty); |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | Assert.isFalse(null == glassInfo, "玻璃信息不存在"); |
| | | if ("1".equals(requestWord) && (glassInfo.getWidth() > throughWidth || glassInfo.getHeight() > throughHeight)) { |
| | | log.info("玻璃当前尺寸宽:{},高:{}只能直通,当前进片任务需等待", glassInfo.getWidth(), glassInfo.getHeight()); |
| | | double glassWidth = Math.max(glassInfo.getWidth(), glassInfo.getHeight()); |
| | | double glassHeight = Math.min(glassInfo.getWidth(), glassInfo.getHeight()); |
| | | if ("1".equals(requestWord) && (glassWidth > throughWidth || glassHeight > throughHeight)) { |
| | | log.info("玻璃当前尺寸宽:{},高:{}只能直通,当前进片任务需等待", glassWidth, glassHeight); |
| | | return; |
| | | } |
| | | Boolean checkFlag = Boolean.FALSE; |
| | | //玻璃尺寸是否走人工下片 |
| | | if (glassInfo.getWidth() > maxWidth || glassInfo.getHeight() > maxHeight || glassInfo.getWidth() < minWidth || glassInfo.getHeight() < minHeight) { |
| | | if (glassWidth > maxWidth || glassHeight > maxHeight || glassWidth < minWidth || glassHeight < minHeight) { |
| | | log.info("该玻璃尺寸不符合要求,需要走人工下片直接进片"); |
| | | } else { |
| | | log.info("该玻璃尺寸非人工下片"); |
| | |
| | | DownWorkstation one = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>() |
| | | .eq(DownWorkstation::getLayer, glassInfo.getLayer()) |
| | | .eq(DownWorkstation::getFlowCardId, glassInfo.getFlowCardId())); |
| | | //是否已经绑定 true:已绑定 false:未绑定 |
| | | Boolean isBind = Boolean.FALSE; |
| | | if (null != one) { |
| | | log.info("该流程卡已绑定架子"); |
| | |
| | | if (!checkFlag && !isBind) { |
| | | log.info("该玻璃的流程卡未绑定架子,获取是否有空架子"); |
| | | List<DownWorkstation> list = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() |
| | | .isNull(DownWorkstation::getFlowCardId).orderByDesc(DownWorkstation::getWorkstationId)); |
| | | .and(on -> on.isNull(DownWorkstation::getFlowCardId).or().eq(DownWorkstation::getFlowCardId, "")).orderByDesc(DownWorkstation::getWorkstationId)); |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | log.info("有空架子,将流程卡与架子好绑定,执行进片任务 结束"); |
| | | //绑定流程卡 |
| | |
| | | endLoop: |
| | | for (DownGlassInfoDTO e : downGlassInfoDTOList) { |
| | | List<GlassInfo> glassInfoList = e.getGlassInfoList(); |
| | | Optional<GlassInfo> glassInfoTempOptional = glassInfoList.stream().filter(item -> item.getWidth() == glassInfo.getWidth() && item.getHeight() == glassInfo.getHeight() |
| | | && item.getThickness() == glassInfo.getThickness() && item.getFilmsid().equals(glassInfo.getFilmsid())) |
| | | .findFirst(); |
| | | if (glassInfoTempOptional.isPresent()) { |
| | | GlassInfo item = glassInfoTempOptional.get(); |
| | | //玻璃是否为多层 |
| | | checkFlag = multilayerCheck(item, Boolean.FALSE); |
| | | if (checkFlag) { |
| | | //玻璃替换 仅替换流程卡id及层数 |
| | | String tempFlowCardId = item.getFlowCardId(); |
| | | Integer tempLayer = item.getLayer(); |
| | | String flowCardId = glassInfo.getFlowCardId(); |
| | | Integer layer = glassInfo.getLayer(); |
| | | log.info("替换流程卡信息,当前玻璃信息:{}的流程卡号{}及层数{},替换后玻璃信息:{}的流程卡号{}及层数{}", |
| | | item, glassInfo, flowCardId, layer, tempFlowCardId, tempLayer); |
| | | glassInfo.setFlowCardId(tempFlowCardId); |
| | | glassInfo.setLayer(tempLayer); |
| | | glassInfoService.updateById(glassInfo); |
| | | item.setFlowCardId(flowCardId); |
| | | item.setLayer(layer); |
| | | glassInfoService.updateById(item); |
| | | break endLoop; |
| | | List<GlassInfo> glassInfoTempList = glassInfoList.stream().filter(item -> item.getWidth() == glassInfo.getWidth() && item.getHeight() == glassInfo.getHeight() |
| | | && item.getThickness() == glassInfo.getThickness() && item.getFilmsid().equals(glassInfo.getFilmsid())).collect(Collectors.toList()); |
| | | if (CollectionUtils.isNotEmpty(glassInfoTempList)) { |
| | | for (GlassInfo item : glassInfoTempList) { |
| | | //玻璃是否为多层:1、先获取当前流程卡落架最多的层数,如果为空,表明未绑定流程卡,未落架,然后按照是否可绑定架子决定是否替换。(可忽略不计,本校验仅在前一次调用起作用) |
| | | // 2、判断落架最多的层数是否为当前替换玻璃的层数,是 则走替换逻辑返回true |
| | | // 3、不是最多的层数,获取落架最多层数的相同次序的玻璃尺寸与当前替换玻璃的尺寸比较,相同走替换,否则继续循环 |
| | | // 4、单层玻璃直接走替换 |
| | | checkFlag = multilayerCheck(item, Boolean.FALSE); |
| | | if (checkFlag) { |
| | | //玻璃替换 仅替换流程卡id及层数 |
| | | String tempFlowCardId = item.getFlowCardId(); |
| | | Integer tempLayer = item.getLayer(); |
| | | String flowCardId = glassInfo.getFlowCardId(); |
| | | Integer layer = glassInfo.getLayer(); |
| | | log.info("替换流程卡信息,当前玻璃信息:{}的流程卡号{}及层数{},替换后玻璃信息:{}的流程卡号{}及层数{}", |
| | | item, glassInfo, flowCardId, layer, tempFlowCardId, tempLayer); |
| | | glassInfo.setFlowCardId(tempFlowCardId); |
| | | glassInfo.setLayer(tempLayer); |
| | | glassInfoService.updateById(glassInfo); |
| | | item.setFlowCardId(flowCardId); |
| | | item.setLayer(layer); |
| | | glassInfoService.updateById(item); |
| | | break endLoop; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | downStorageCageDetails.setState(Const.GLASS_STATE_IN); |
| | | downStorageCageDetails.setSlot(nearestEmpty.getSlot()); |
| | | downStorageCageDetailsService.save(downStorageCageDetails); |
| | | |
| | | // 生成进片任务 |
| | | initDownGlassTask(glassInfo, 0, nearestEmpty.getSlot(), Const.GLASS_CACHE_TYPE_IN); |
| | | } |
| | |
| | | log.info("G06、G11、G13分别为{},{}、{}非自动状态,无法出片", glassStatus06, glassStatus11, glassStatus13); |
| | | return Boolean.FALSE; |
| | | } |
| | | |
| | | List<DownStorageCageDetails> tempList = downStorageCageDetailsService.list(new LambdaQueryWrapper<DownStorageCageDetails>() |
| | | .eq(DownStorageCageDetails::getState, Const.GLASS_STATE_IN)); |
| | | log.info("出片1、笼内的玻璃信息有:{}", tempList); |
| | | //获取待进片玻璃 |
| | | DownStorageCageDetails cageDetails = new DownStorageCageDetails(); |
| | | if (StringUtils.isNotBlank(glassId)) { |
| | |
| | | cageDetails.setSlot(empty.getSlot()); |
| | | tempList.add(cageDetails); |
| | | } |
| | | |
| | | log.info("笼内玻璃的数据有:{}", tempList); |
| | | log.info("出片2:笼内玻璃的数据(包括待进片)有:{}", tempList); |
| | | if (CollectionUtils.isEmpty(tempList)) { |
| | | log.info("笼内没有玻璃,无法执行出片"); |
| | | return Boolean.FALSE; |
| | | } |
| | | //优先走08片台的玻璃:走人工下片或者2号机械臂 |
| | | //1、08台忙碌,仅走1号机械臂 |
| | | //2、08台空闲,先走扔工下片或2号机械臂,无玻璃出片 在走1号机械臂 |
| | | //机械臂被禁用的情况下不能继续向禁用的机械臂放玻璃 |
| | | Boolean flag08 = "1".equals(out08Glassstate) ? Boolean.TRUE : Boolean.FALSE; |
| | | if (!flag08) { |
| | | generateTaskByShelf(glassStatus06, glassStatus11, flag08, glassStatus13, tempList, cageDetails, glassId); |
| | |
| | | return generateTaskByShelf(glassStatus06, glassStatus11, !flag08, glassStatus13, tempList, cageDetails, glassId); |
| | | } |
| | | } |
| | | |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | |
| | | log.info("架子已经占满,多层玻璃无法找到对应的格子,需执行替换玻璃的操作"); |
| | | return Boolean.FALSE; |
| | | } |
| | | |
| | | } |
| | | if (downGlassInfoDTO.getLayer().equals(glassInfo.getLayer())) { |
| | | log.info("当前玻璃的流程在架子上落架最多 直接进片"); |
| | |
| | | glassStatus13, List<DownStorageCageDetails> tempList, DownStorageCageDetails cageDetails, String glassId) { |
| | | //获取2个机械臂范围内的架子绑定的流程卡信息 |
| | | List<Integer> workList = new ArrayList(); |
| | | |
| | | if (flag08) { |
| | | if (!"2".equals(glassStatus11)) { |
| | | workList.addAll(Const.G11_WORK_STATION); |
| | |
| | | List<Integer> workStationAll = Arrays.asList(1, 2, 3, 4, 5, 6); |
| | | List<Integer> offWorkStationList = workStationAll.stream().filter(e -> !workList.contains(e)).collect(Collectors.toList()); |
| | | List<DownStorageCageDetails> list = new ArrayList(); |
| | | //是否有空架子 true:有 false:无 |
| | | Boolean isEmptyShelf = Boolean.FALSE; |
| | | //对笼内玻璃进行过滤,仅出符合逻辑的玻璃 |
| | | if (CollectionUtils.isNotEmpty(workList)) { |
| | | List<DownWorkstation> downWorkstationList = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() |
| | | .eq(DownWorkstation::getEnableState, Const.SLOT_ON).in(DownWorkstation::getWorkstationId, workList)); |
| | | // log.info("架子被禁用,无法出片落架"); |
| | | if (CollectionUtils.isEmpty(downWorkstationList)) { |
| | | log.info("笼子被禁用,无法走机械臂下片"); |
| | | //走人工下片 |
| | | if (!"2".equals(glassStatus13)) { |
| | | list = tempList.stream().filter(item -> item.getWidth() > maxWidth || item.getHeight() > maxHeight).collect(Collectors.toList()); |
| | | if (flag08 && !"2".equals(glassStatus13)) { |
| | | list = tempList.stream().filter(item -> { |
| | | double firstLength = Math.max(item.getWidth(), item.getHeight()); |
| | | double secondLength = Math.min(item.getWidth(), item.getHeight()); |
| | | return firstLength > maxWidth || secondLength > maxHeight; |
| | | }).collect(Collectors.toList()); |
| | | } |
| | | } else { |
| | | //获取可落架的的架子信息(包括空架子) |
| | | List<DownWorkstation> workstationsIsNotBind = downWorkstationList.stream().filter(item -> null == (item.getFlowCardId())).collect(Collectors.toList()); |
| | | //将架子的流程卡号及层数作为key |
| | | //仅获取空架子信息 |
| | | List<DownWorkstation> workstationsIsNotBind = downWorkstationList.stream().filter(item -> StringUtils.isBlank(item.getFlowCardId())).collect(Collectors.toList()); |
| | | //将架子的流程卡号及层数作为key 不存在空架子的情况 |
| | | if (CollectionUtils.isEmpty(workstationsIsNotBind)) { |
| | | log.info("不存在未绑定流程卡架子"); |
| | | //筛选出对应架子已绑定流程卡可下片的玻璃 |
| | | Map<String, List<DownWorkstation>> listMap = downWorkstationList.stream() |
| | | .filter(item -> null != (item.getFlowCardId())).collect(Collectors.groupingBy(item -> item.getFlowCardId() + ":" + item.getLayer())); |
| | | .filter(item -> StringUtils.isNotBlank(item.getFlowCardId())).collect(Collectors.groupingBy(item -> item.getFlowCardId() + ":" + item.getLayer())); |
| | | //过滤筛选获取架子上对应流程卡+层数的笼子内的玻璃信息 |
| | | list = tempList.stream().filter(item -> listMap.containsKey(item.getFlowCardId() + ":" + item.getLayer())).collect(Collectors.toList()); |
| | | } else { |
| | | log.info("存在未绑定流程卡架子,直接获取笼内所有玻璃,且未绑定架子的玻璃信息"); |
| | | //获取禁用架子的流程号,将笼内绑定架子且架子被禁用的流程卡信息 |
| | | |
| | | //获取禁用及非本机械臂的架子的流程号及层数对应的玻璃信息 |
| | | List<DownWorkstation> downWorkstationOffList = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() |
| | | .and(i -> i.in(DownWorkstation::getWorkstationId, offWorkStationList).or().eq(DownWorkstation::getEnableState, Const.SLOT_OFF))); |
| | | //获取被禁用的流程卡信息 |
| | | //获取被禁用的流程卡信息 为空:将返回笼内的所有玻璃信息 |
| | | if (CollectionUtils.isEmpty(downWorkstationOffList)) { |
| | | list = tempList; |
| | | } else { |
| | | Map<String, List<DownWorkstation>> listOffMap = downWorkstationOffList.stream().filter(item -> null != (item.getFlowCardId())).collect(Collectors.groupingBy(item -> item.getFlowCardId() + ":" + item.getLayer())); |
| | | //笼内存在无法出片的玻璃信息,过滤无法出片的玻璃信息,仅获取可出片的玻璃信息 无法出片的玻璃为:未绑定架子、绑定架子被禁用、非本机械臂对应的架子 |
| | | Map<String, List<DownWorkstation>> listOffMap = downWorkstationOffList.stream().filter(item -> StringUtils.isNotBlank(item.getFlowCardId())).collect(Collectors.groupingBy(item -> item.getFlowCardId() + ":" + item.getLayer())); |
| | | list = tempList.stream().filter(item -> !listOffMap.containsKey(item.getFlowCardId() + ":" + item.getLayer())).collect(Collectors.toList()); |
| | | } |
| | | //空架子表示置为true |
| | | isEmptyShelf = Boolean.TRUE; |
| | | //todo:如果禁用架子已绑定流程卡,因为时间不确定,笼子内的玻璃可重新绑定新架子 |
| | | // list = tempList.stream().filter(item -> !listMap.containsKey(item.getFlowCardId() + ":" + item.getLayer())).collect(Collectors.toList()); |
| | | |
| | | } |
| | | } |
| | | } else { |
| | | if (flag08 && !"2".equals(glassStatus13)) { |
| | | //直接走人工下片 |
| | | list = tempList.stream().filter(item -> item.getWidth() > maxWidth || item.getHeight() > maxHeight).collect(Collectors.toList()); |
| | | list = tempList.stream().filter(item -> { |
| | | double firstLength = Math.max(item.getWidth(), item.getHeight()); |
| | | double secondLength = Math.min(item.getWidth(), item.getHeight()); |
| | | return firstLength > maxWidth || secondLength > maxHeight; |
| | | }).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | if (CollectionUtils.isEmpty(list)) { |
| | |
| | | return Boolean.FALSE; |
| | | } |
| | | String tempGlassId = null; |
| | | Boolean isBind = Boolean.FALSE; |
| | | Boolean isNeedBind = Boolean.FALSE; |
| | | |
| | | for (DownStorageCageDetails item : list) { |
| | | if (item.getWidth() > maxWidth || item.getHeight() > maxHeight) { |
| | | double firstLength = Math.max(item.getWidth(), item.getHeight()); |
| | | double secondLength = Math.min(item.getWidth(), item.getHeight()); |
| | | if (firstLength > maxWidth || secondLength > maxHeight) { |
| | | if (flag08 && !"2".equals(glassStatus13)) { |
| | | log.info("玻璃宽度或高度超出阈值,执行人工下片"); |
| | | tempGlassId = item.getGlassId(); |
| | |
| | | //架子都未绑定流程卡,出笼内子数量最多尺寸最大的玻璃id,无 则返回扫描扫到的玻璃id进行出片 |
| | | tempGlassId = downStorageCageDetailsService.getGlassInfoMaxCount(glassId, offWorkStationList); |
| | | |
| | | isBind = Boolean.TRUE; |
| | | isNeedBind = Boolean.TRUE; |
| | | break loop; |
| | | } |
| | | //将笼子内的玻璃进行过滤,仅获取无法落架的流程卡玻璃 |
| | |
| | | if (isEmptyShelf) { |
| | | //架子都未绑定流程卡,出笼内子数量最多尺寸最大的玻璃id,无 则返回扫描扫到的玻璃id进行出片 |
| | | tempGlassId = downStorageCageDetailsService.getGlassInfoMaxCount(glassId, offWorkStationList); |
| | | isBind = Boolean.TRUE; |
| | | isNeedBind = Boolean.TRUE; |
| | | break loop; |
| | | } |
| | | } |
| | |
| | | DownGlassInfoDTO downGlassInfoDTO = downGlassInfoService.queryDownGlassMaxLayer(item.getFlowCardId()); |
| | | if (null == downGlassInfoDTO) { |
| | | // 历史落架玻璃按照相关流程卡取数据库未找到最多玻璃信息,表明当前流程卡下的有层的玻璃均未落架,直接可出当前玻璃 |
| | | log.info(""); |
| | | isBind = Boolean.FALSE; |
| | | tempGlassId = item.getGlassId(); |
| | | log.info("当前流程卡不存在落架的玻璃,可直接出片落架,玻璃id:{}", tempGlassId); |
| | | break loop; |
| | | } |
| | | if (downGlassInfoDTO.getLayer().equals(downGlassInfoDTO.getLayer())) { |
| | | log.info("当前玻璃的流程在架子上落架最多,直接出片"); |
| | | //更新玻璃状态,生成出片任务 |
| | | tempGlassId = item.getGlassId(); |
| | | isBind = Boolean.FALSE; |
| | | log.info("当前玻璃的流程在架子上落架最多,直接出片,玻璃id:{}", tempGlassId); |
| | | break loop; |
| | | } |
| | | Integer sequence = downGlassInfoService.queryMaxSequence(item.getFlowCardId(), item.getLayer()); |
| | |
| | | .eq(DownGlassInfo::getFlowCardId, downGlassInfoDTO.getFlowCardId()) |
| | | .eq(DownGlassInfo::getLayer, downGlassInfoDTO.getLayer()).eq(DownGlassInfo::getSequence, sequence)); |
| | | if (null != downGlassInfoDTO && downGlassInfo.getWidth() == item.getWidth() && downGlassInfo.getHeight() == item.getHeight()) { |
| | | log.info("相同次序玻璃对应上,可执行进片任务"); |
| | | //更新玻璃状态,生成出片任务 |
| | | tempGlassId = item.getGlassId(); |
| | | isBind = Boolean.FALSE; |
| | | log.info("相同次序玻璃对应上,可执行进片任务,玻璃id:{}", tempGlassId); |
| | | break loop; |
| | | } |
| | | } |
| | |
| | | List<DownStorageCageDetails> downStorageCageDetails = singleLayerMap.get(e.getFlowCardId() + e.getLayer()); |
| | | if (CollectionUtils.isNotEmpty(downStorageCageDetails)) { |
| | | tempGlassId = downStorageCageDetails.get(0).getGlassId(); |
| | | isBind = Boolean.FALSE; |
| | | break; |
| | | } |
| | | } |
| | |
| | | return Boolean.FALSE; |
| | | } else { |
| | | //按照出片的玻璃id更新笼内的玻璃状态为已出片 |
| | | return generateDownGlassOutTask(tempGlassId, Const.GLASS_CACHE_TYPE_OUT, isBind, cageDetails, workList); |
| | | return generateDownGlassOutTask(tempGlassId, Const.GLASS_CACHE_TYPE_OUT, isNeedBind, cageDetails, workList); |
| | | } |
| | | } |
| | | |
| | | public Boolean generateDownGlassOutTask(String glassId, Integer taskType, Boolean |
| | | isBind, DownStorageCageDetails cageDetails, List<Integer> workList) { |
| | | isNeedBind, DownStorageCageDetails cageDetails, List<Integer> workList) { |
| | | //按玻璃id获取玻璃信息 |
| | | DownStorageCageDetails downStorageCageDetails = null; |
| | | if (glassId.equals(cageDetails.getGlassId())) { |
| | |
| | | } |
| | | |
| | | Integer endCell = null; |
| | | if (isBind) { |
| | | if (isNeedBind) { |
| | | //获取空架子信息,将空架子信息绑定流程卡 |
| | | DownWorkstation emptyDownWorkstation = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>() |
| | | .isNull(DownWorkstation::getFlowCardId).in(DownWorkstation::getWorkstationId, workList).orderByDesc(DownWorkstation::getWorkstationId).last("limit 1")); |
| | | .and(on -> on.isNull(DownWorkstation::getFlowCardId).or().eq(DownWorkstation::getFlowCardId, "")).in(DownWorkstation::getWorkstationId, workList).orderByDesc(DownWorkstation::getWorkstationId).last("limit 1")); |
| | | if (null != emptyDownWorkstation) { |
| | | log.info("获取到空架子信息,绑定流程卡"); |
| | | downWorkstationService.updateFlowCardIdAndCount(downStorageCageDetails.getFlowCardId(), emptyDownWorkstation.getWorkstationId(), downStorageCageDetails.getLayer()); |
| | |
| | | //生成任务信息 |
| | | DownGlassInfo downGlassInfo = new DownGlassInfo(); |
| | | BeanUtils.copyProperties(downStorageCageDetails, downGlassInfo); |
| | | //todo:落架片序 |
| | | //落架片序 |
| | | downGlassInfo.setSequence(downGlassInfoService.queryMaxSequence(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer())); |
| | | downGlassInfoService.save(downGlassInfo); |
| | | //生成任务信息 |