Merge remote-tracking branch 'origin/master'
| | |
| | | { |
| | | "plcAddressBegin": "DB100.0", |
| | | "plcAddressLenght": "142", |
| | | "dataType": "word", |
| | | "parameteInfor": [ |
| | | { |
| | | "codeId": "RequestWord", |
| | | "addressIndex": "0", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G04ID", |
| | | "addressIndex": "2", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06RobotTaskRequestWord", |
| | | "addressIndex": "4", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06ID", |
| | | "addressIndex": "6", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11RobotTaskRequestWord", |
| | | "addressIndex": "8", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G011ID", |
| | | "addressIndex": "10", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "12", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "14", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "16", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "18", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "MESSendingWord", |
| | | "addressIndex": "20", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InputGrid", |
| | | "addressIndex": "22", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "OutputGrid", |
| | | "addressIndex": "24", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "OutputID", |
| | | "addressIndex": "26", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "FrontOrRearLowerSlice", |
| | | "addressIndex": "28", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "30", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06RobotTaskReply", |
| | | "addressIndex": "32", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06Rack", |
| | | "addressIndex": "34", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11RobotTaskReply", |
| | | "addressIndex": "36", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11Rack", |
| | | "addressIndex": "38", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "40", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "42", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "44", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "46", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "48", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "50", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "52", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "54", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "MESTaskState", |
| | | "addressIndex": "56", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "58", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "AlarmState", |
| | | "addressIndex": "60", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Alarm1", |
| | | "addressIndex": "62", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Alarm2", |
| | | "addressIndex": "64", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Alarm3", |
| | | "addressIndex": "66", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Alarm4", |
| | | "addressIndex": "68", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "neirong", |
| | | "addressIndex": "70", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "device", |
| | | "addressIndex": "72", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "74", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "76", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut1", |
| | | "addressIndex": "78", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut2", |
| | | "addressIndex": "80", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut3", |
| | | "addressIndex": "82", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut4", |
| | | "addressIndex": "84", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut5", |
| | | "addressIndex": "86", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut6", |
| | | "addressIndex": "88", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut7", |
| | | "addressIndex": "90", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "92", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "94", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "96", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "98", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "100", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G04ActionState", |
| | | "addressIndex": "102", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G05ActionState", |
| | | "addressIndex": "104", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06ActionState", |
| | | "addressIndex": "106", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G07ActionState", |
| | | "addressIndex": "108", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G08ActionState", |
| | | "addressIndex": "110", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G09ActionState", |
| | | "addressIndex": "112", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G10ActionState", |
| | | "addressIndex": "114", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11ActionState", |
| | | "addressIndex": "116", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G12ActionState", |
| | | "addressIndex": "118", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G13ActionState", |
| | | "addressIndex": "120", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G04IDS", |
| | | "addressIndex": "122", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G05IDS", |
| | | "addressIndex": "124", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06IDS", |
| | | "addressIndex": "126", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G07IDS", |
| | | "addressIndex": "128", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G08IDS", |
| | | "addressIndex": "130", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G09IDS", |
| | | "addressIndex": "132", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G10IDS", |
| | | "addressIndex": "134", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11IDS", |
| | | "addressIndex": "136", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G12IDS", |
| | | "addressIndex": "138", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G13ID", |
| | | "addressIndex": "140", |
| | | "addressLenght": "2" |
| | | } |
| | | ] |
| | | "plcAddressBegin": "DB11.0", |
| | | "plcAddressLenght": "92", |
| | | "dataType": "word", |
| | | "parameteInfor": [ |
| | | |
| | | { |
| | | "codeId": "requestWord", |
| | | "addressIndex": "0", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "requestID", |
| | | "addressIndex": "2", |
| | | "addressLenght": "30" |
| | | }, |
| | | { |
| | | "codeId": "currentCell", |
| | | "addressIndex": "32", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "glassStatus08", |
| | | "addressIndex": "36", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "glassStatus06", |
| | | "addressIndex": "40", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "glassStatus11", |
| | | "addressIndex": "42", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "glassStatus13", |
| | | "addressIndex": "44", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G04_error_status", |
| | | "addressIndex": "48", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G05_error_status", |
| | | "addressIndex": "50", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06_error_status", |
| | | "addressIndex": "52", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "robot_error_status", |
| | | "addressIndex": "54", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G08_error_status", |
| | | "addressIndex": "56", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G09_error_status", |
| | | "addressIndex": "58", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G10_error_status", |
| | | "addressIndex": "60", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11_error_status", |
| | | "addressIndex": "62", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "robot_error_status", |
| | | "addressIndex": "64", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G13_error_status", |
| | | "addressIndex": "66", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "confirmationWord", |
| | | "addressIndex": "72", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06_prohibit_film_production", |
| | | "addressIndex": "74", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11_prohibit_film_production", |
| | | "addressIndex": "76", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G13_prohibit_film_production", |
| | | "addressIndex": "78", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Glass_width", |
| | | "addressIndex": "80", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Glass_height", |
| | | "addressIndex": "82", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Glass_thickness", |
| | | "addressIndex": "84", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Start_cell", |
| | | "addressIndex": "86", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "End_cell", |
| | | "addressIndex": "88", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "task_type", |
| | | "addressIndex": "90", |
| | | "addressLenght": "2" |
| | | } |
| | | |
| | | ] |
| | | } |
| | |
| | | disable:'禁用', |
| | | start:'启用', |
| | | deficiencieste:'报缺', |
| | | updown:'人工下片', |
| | | operate:'操作', |
| | | prompt:'提示', |
| | | information:'是否报缺该条信息?', |
| | | infor:'是否人工下片该条信息?', |
| | | yes:'是', |
| | | cancel:'取消', |
| | | }, |
| | |
| | | search:'搜索', |
| | | tabid:'大理片笼详情表id', |
| | | tid:'设备id', |
| | | tida:'设备id:', |
| | | fin:'是否完成任务?', |
| | | sureadd:'确认添加', |
| | | sureadda:'是否确认添加?', |
| | | zailong:'在笼中', |
| | | rengongxp:'人工下片', |
| | | up:'上一页', |
| | | down:'下一页', |
| | | now:'当前页显示', |
| | | tit:'条数据', |
| | | }, |
| | | workOrder:{ |
| | | glassID:'玻璃ID', |
| | |
| | | <el-table-column fixed="right" :label="$t('sorter.operate')" align="center" width="200"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="open(scope.row)">{{ $t('sorter.deficiencieste') }}</el-button> |
| | | <el-button size="mini" type="text" plain @click="opena(scope.row)">{{ $t('sorter.updown') }}</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | // 用户点击了“是”,现在调用删除接口 |
| | | var url="/cacheGlass/edgStorageCage/edgStorageCageGlass?edgStorageCageId="+row.id; |
| | | var url="/unLoadGlass/downStorage/deleteDownStorageCage?edgStorageCageId="+row.id; |
| | | console.log(url); |
| | | const response = await request.post(url, { |
| | | esdId: row.esdId |
| | |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | // 删除失败,您可以处理错误或显示错误信息给用户 |
| | | ElMessage.error(response.msg); |
| | | ElMessage.error(response.message); |
| | | // alert('删除失败:' + deleteResponse.message); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | catch (error) { |
| | | // 处理可能出现的错误,比如 ElMessageBox 抛出的异常等 |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | // 人工下片 |
| | | const opena = async(row) => { |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | t('sorter.infor'), |
| | | t('sorter.prompt'), |
| | | { |
| | | confirmButtonText: t('sorter.yes'), |
| | | cancelButtonText: t('sorter.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | const response = await request.post("/unLoadGlass/downGlassTask/generateOutGlassTask", { |
| | | glassId: row.glass_id |
| | | }) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | // 删除失败,您可以处理错误或显示错误信息给用户 |
| | | ElMessage.error(response.message); |
| | | // alert('删除失败:' + deleteResponse.message); |
| | | } |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理可能出现的错误,比如 ElMessageBox 抛出的异常等 |
| | | console.error('发生错误:', error); |
| | |
| | | <template>
|
| | | <div >
|
| | | <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="handleInbound()">入库</el-button>
|
| | | <el-button type="success" size="mini" @click="handleInbound()">吊装位入库</el-button>
|
| | | <el-button type="success" size="mini" @click="handleInbound()">添加原片</el-button>
|
| | | <el-button type="success" size="mini" >吊装位入库</el-button>
|
| | | |
| | | </div>
|
| | |
|
| | | <!-- 右侧选择框 -->
|
| | |
| | | min-width="80"
|
| | | prop="shelf_status"
|
| | | >
|
| | | <template #default="scope">
|
| | | <el-tag :type="getTagType(scope.row.shelf_status)">
|
| | | {{ scope.row.shelf_status === 1 ? '启用' : '未启用' }}
|
| | | </el-tag>
|
| | | </template>
|
| | | <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>
|
| | |
|
| | | <!-- 操作列 -->
|
| | | <el-table-column label="操作" width="300">
|
| | | <el-table-column label="操作" width="350">
|
| | | <template #default="{ row }">
|
| | | <el-button type="primary" size="mini" @click="handleEdit(row)">修改</el-button>
|
| | | <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-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="handleDelete(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-button type="primary" @click="handleConfirmInbound">确 定</el-button>
|
| | | </div>
|
| | | </el-dialog>
|
| | | <div ref="chart" id="chart" style="width: 100%; height: 400px;"></div>
|
| | |
|
| | |
|
| | | <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.wid" required style="width: 250px; font-size: 20px" @focus="clearInput('wid')"></el-input>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item label="高度">
|
| | | <el-input v-model="formData.heig" required style="width: 250px; font-size: 20px" @focus="clearInput('heig')"></el-input>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item label="厚度">
|
| | | <el-input v-model="formData.thinkness" 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.num" 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-form-item>
|
| | | <el-form-item label="批次号">
|
| | | <el-input v-model="editForm.batchnumber"></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 ref="chart" id="chart" style="width: 100%; height: 400px;"></div> -->
|
| | | </div>
|
| | | </template>
|
| | |
|
| | |
| | | <script setup>
|
| | | import { ref, onMounted, onBeforeUnmount } from 'vue'; // 导入 Vue 3 的模块
|
| | | import * as echarts from 'echarts';
|
| | | import { ElMessage, ElMessageBox } from 'element-plus'
|
| | |
|
| | |
|
| | | const loading = ref(false);
|
| | |
| | | height: '50',
|
| | | thickness: '10',
|
| | | quantity: '5',
|
| | | entry_time: '2024-06-19',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber:"444",
|
| | | shelf_status: 1
|
| | | },
|
| | |
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-18',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber:"444",
|
| | | shelf_status: 0
|
| | | },
|
| | |
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-18',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber:"444",
|
| | | shelf_status: 1
|
| | | },
|
| | |
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-18',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber:"444",
|
| | | shelf_status: 1
|
| | | },
|
| | |
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-18',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber:"444",
|
| | | shelf_status: 1
|
| | | }
|
| | |
| | | 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([
|
| | |
|
| | |
| | |
|
| | | });
|
| | |
|
| | | const handleEdit = (row) => {
|
| | | // 处理修改数量逻辑
|
| | | console.log('Edit Quantity:', row);
|
| | | };
|
| | |
|
| | | |
| | | const handleDelete = (row) => {
|
| | | // 处理删除逻辑
|
| | | console.log('Delete:', row);
|
| | | };
|
| | | // 使用 Element UI 的 MessageBox.confirm 方法进行二次确认
|
| | | ElMessageBox.confirm('确定要执行删除操作吗?', '确认删除', {
|
| | | confirmButtonText: '确认',
|
| | | cancelButtonText: '取消',
|
| | | type: 'warning',
|
| | | }).then(() => {
|
| | | // 点击确认按钮的回调,执行出库操作
|
| | | console.log('执行删除操作', row);
|
| | | }).catch(() => {
|
| | | // 点击取消按钮的回调,不执行任何操作
|
| | | console.log('取消删除操作');
|
| | | });
|
| | | };
|
| | |
|
| | | |
| | | const handleCheckout = (row) => {
|
| | | // 处理出库逻辑
|
| | | console.log('Checkout:', row);
|
| | | };
|
| | | // 使用 Element UI 的 MessageBox.confirm 方法进行二次确认
|
| | | ElMessageBox.confirm('确定要执行出库操作吗?', '确认出库', {
|
| | | confirmButtonText: '确认',
|
| | | cancelButtonText: '取消',
|
| | | type: 'warning',
|
| | | }).then(() => {
|
| | | // 点击确认按钮的回调,执行出库操作
|
| | | console.log('执行出库操作', row);
|
| | | }).catch(() => {
|
| | | // 点击取消按钮的回调,不执行任何操作
|
| | | console.log('取消出库操作');
|
| | | });
|
| | | };
|
| | |
|
| | |
|
| | | const handleInbound = () => {
|
| | | // 打开入库对话框
|
| | |
| | | // 关闭对话框
|
| | | 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({
|
| | | quantity: '',
|
| | | batchnumber: ''
|
| | | });
|
| | | const editFormRef = ref(null);
|
| | | let currentRow = ref(null);
|
| | |
|
| | | // 处理行点击事件
|
| | | const edithandleRowClick = (row) => {
|
| | | currentRow.value = row;
|
| | | editForm.value.quantity = row.quantity.toString();
|
| | | editForm.value.batchnumber = row.batchnumber;
|
| | | 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 = '';
|
| | | currentRow.value = null;
|
| | | };
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | |
| | |
|
| | |
|
| | | const handleRestart = (row) => {
|
| | | // 使用 Element UI 的 MessageBox.confirm 方法进行二次确认
|
| | | ElMessageBox.confirm('确定要执行重新开始操作吗?', '确认重新开始', {
|
| | | confirmButtonText: '确认',
|
| | | cancelButtonText: '取消',
|
| | | type: 'warning',
|
| | | }).then(() => {
|
| | | // 点击确认按钮的回调
|
| | | 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('取消删除任务操作');
|
| | | });
|
| | | };
|
| | |
|
| | |
|
| | |
|
| | | const handleComplete = (row) => {
|
| | | // 使用 Element UI 的 MessageBox.confirm 方法进行二次确认
|
| | | ElMessageBox.confirm('确定要执行任务完成操作吗?', '确认任务完成', {
|
| | | confirmButtonText: '确认',
|
| | | cancelButtonText: '取消',
|
| | | type: 'warning',
|
| | | }).then(() => {
|
| | | // 点击确认按钮的回调
|
| | | console.log('执行任务完成操作', row);
|
| | | }).catch(() => {
|
| | | // 点击取消按钮的回调,不执行任何操作
|
| | | console.log('取消任务完成操作');
|
| | | });
|
| | | };
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | let chartInstance = null;
|
| | |
| | |
|
| | | </script>
|
| | |
|
| | | <style>
|
| | | <style scoped>
|
| | | html, body {
|
| | | height: 100%;
|
| | | margin: 0;
|
| | | padding: 0;
|
| | | overflow: hidden; /* 禁止出现滚动条 */
|
| | | }
|
| | |
|
| | | .app-container {
|
| | |
|
| | | flex-direction: column;
|
| | | height: 100vh; /* 使用视口高度 */
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | .custom-dialog {
|
| | | max-height: 90vh; /* 最大高度为视口高度的90% */
|
| | | overflow-y: auto; /* 对话框内部出现垂直滚动条 */
|
| | | }
|
| | | </style>
|
| | |
| | | const uniqueThicknesses = new Set(response.data.map(item => item.thickness)); |
| | | |
| | | selectOptions.value = Array.from(uniqueWidths).map(width => ({ |
| | | value: width, // 假设这是你想要作为value的属性 |
| | | label: width, // 假设这是你想要显示的label |
| | | value: width, |
| | | label: width, |
| | | })); |
| | | selectOptionsa.value = Array.from(uniqueHeights).map(height => ({ |
| | | value: height, |
| | |
| | | ElMessage.error(t('basicData.updatanull')); |
| | | return; // 如果 id 为空,则不执行后续操作 |
| | | } |
| | | |
| | | const newState = row.state === 100 ? 0 : 100; |
| | | |
| | | try { |
| | | // 发送请求到后端更新状态 |
| | | const response = await request.post('/loadGlass/up-patten-usage/updateGlassState', { id: row.id, state: newState }); |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | row.state = newState; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | |
| | | ElMessage.error(t('basicData.glassnull')); |
| | | } |
| | | }; |
| | | |
| | | const wsUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlass`; |
| | | const ws = new WebSocket(wsUrl); |
| | | ws.onopen = () => { |
| | |
| | | <script lang="ts" setup> |
| | | // import zhCn from 'element-plus/lib/locale/lang/zh-cn' |
| | | // import en from 'element-plus/dist/locale/en.mjs' |
| | | // const { locale } = useI18n() |
| | | |
| | | import { useI18n } from 'vue-i18n' |
| | | const { t } = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {reactive} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | const router = useRouter() |
| | | import request from "@/utils/request" |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import { ref, onMounted , onBeforeUnmount} from "vue"; |
| | | import { ref, onMounted , onBeforeUnmount, reactive, computed } from "vue"; |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { tr } from "element-plus/es/locale"; |
| | |
| | | const tableDatab = ref([]) |
| | | const tableDatac = ref([]) |
| | | const tableDatad = ref([]) |
| | | const tableDataf = ref([]) |
| | | const tableDatae = ref([]) |
| | | const adjustedRects = ref([]); |
| | | const project = ref([]); |
| | | const adjustedRectsa = ref([]); |
| | | // const height = ref([]); |
| | | const adjustedRectsb = ref([]); |
| | | const adjustedRectsc = ref([]); |
| | | const adjustedRectsd = ref([]); |
| | | const adjustedRectse = ref([]); |
| | | const adjustedRectsf = ref([]); |
| | | const adjustedRectsg = ref([]); |
| | | const currentRow = reactive({}); // 当前行的数据 |
| | | const add = ref(false) |
| | | const flowCardId = ref(''); |
| | | const gap = ref(''); |
| | |
| | | const cell7=ref(true); |
| | | const cell8=ref(true); |
| | | const selectedRow = ref(null); // 存储选中的行数据 |
| | | |
| | | const currentPage4 = ref(4) |
| | | const pageSize4 = ref(100) |
| | | |
| | | // var timer=setInterval(() => { |
| | | // // console.log(million.value,million1.value); |
| | | // million.value+=1; |
| | | // if(million.value-million1.value!==12){ |
| | | |
| | | // if(million.value-million1.value>=2){ |
| | | // if(carposition1.value==220){ |
| | | // timers1.value=false; |
| | | // }else if(carposition1.value==60){ |
| | | // timers1.value=true; |
| | | // } |
| | | // if(timers1.value==true){ |
| | | // carposition1.value=carposition1.value+16; |
| | | // }else{ |
| | | // carposition1.value=carposition1.value-16; |
| | | // } |
| | | |
| | | |
| | | // if(carposition2.value==220){ |
| | | // timers2.value=false; |
| | | // }else if(carposition2.value==60){ |
| | | // timers2.value=true; |
| | | // } |
| | | // if(timers2.value==true){ |
| | | // carposition2.value+=16; |
| | | // }else{ |
| | | // carposition2.value-=16; |
| | | // } |
| | | // }else{ |
| | | |
| | | // } |
| | | // }else{ |
| | | // million1.value=million.value; |
| | | |
| | | |
| | | // 当前页码和每页显示的条数 |
| | | const currentPage = ref(1); |
| | | const itemsPerPage = computed(() => { |
| | | if (currentPage.value === 1) { |
| | | return 21; |
| | | } else if (currentPage.value === 2) { |
| | | return 21; |
| | | } else if (currentPage.value === 3) { |
| | | return 21; |
| | | } else if (currentPage.value === 4) { |
| | | return 21; |
| | | } else if (currentPage.value === 5) { |
| | | return 21; |
| | | } else if (currentPage.value === 6) { |
| | | return 21; |
| | | } else if (currentPage.value === 7) { |
| | | return 21; |
| | | } else { |
| | | return 21; // 默认值,可以根据实际需求修改 |
| | | } |
| | | }); |
| | | |
| | | // 计算分页后的数据 |
| | | const paginatedUsers = computed(() => { |
| | | const startIndex = calculateStartIndex(); |
| | | const endIndex = startIndex + itemsPerPage.value; |
| | | return tableData.value.slice(startIndex, endIndex); |
| | | }); |
| | | |
| | | // 计算当前页的起始索引 |
| | | function calculateStartIndex() { |
| | | let index = 0; |
| | | for (let i = 1; i < currentPage.value; i++) { |
| | | if (i === 1) { |
| | | index += 21; |
| | | } else if (i === 2) { |
| | | index += 21; |
| | | } else if (i === 3) { |
| | | index += 21; |
| | | }else if (i === 4) { |
| | | index += 21; |
| | | }else if (i === 5) { |
| | | index += 21; |
| | | }else if (i === 6) { |
| | | index += 21; |
| | | }else if (i === 7) { |
| | | index += 21; |
| | | } else { |
| | | index += 31; |
| | | } |
| | | } |
| | | return index; |
| | | } |
| | | |
| | | // 上一页和下一页方法 |
| | | const prevPage = () => { |
| | | if (currentPage.value > 1) { |
| | | currentPage.value--; |
| | | } |
| | | }; |
| | | |
| | | // if(cellshow1.value==true){ |
| | | // cellshow1.value=false; |
| | | // }else{ |
| | | // cellshow1.value=true; |
| | | // } |
| | | // if(cellshow2.value==true){ |
| | | // cellshow2.value=false; |
| | | // }else{ |
| | | // cellshow2.value=true; |
| | | // } |
| | | // } |
| | | |
| | | // }, 1000); |
| | | |
| | | // var timer=setInterval(() => { |
| | | // // console.log(million3.value,million4.value); |
| | | // million3.value+=1; |
| | | // if(million3.value-million4.value!==12){ |
| | | |
| | | // if(million3.value-million4.value>=2){ |
| | | // if(carposition3.value==260){ |
| | | // timers3.value=false; |
| | | // }else if(carposition3.value==60){ |
| | | // timers3.value=true; |
| | | // } |
| | | // if(timers3.value==true){ |
| | | // carposition3.value=carposition3.value+20; |
| | | // }else{ |
| | | // carposition3.value=carposition3.value-20; |
| | | // } |
| | | |
| | | |
| | | // if(carposition4.value==260){ |
| | | // timers4.value=false; |
| | | // }else if(carposition4.value==60){ |
| | | // timers4.value=true; |
| | | // } |
| | | // if(timers4.value==true){ |
| | | // carposition4.value+=20; |
| | | // }else{ |
| | | // carposition4.value-=20; |
| | | // } |
| | | // }else{ |
| | | |
| | | // } |
| | | // }else{ |
| | | // million4.value=million3.value; |
| | | // if(cellshow5.value==true){ |
| | | // cellshow5.value=false; |
| | | |
| | | // }else{ |
| | | // cellshow5.value=true; |
| | | |
| | | // } |
| | | // if(cellshow3.value==true){ |
| | | // cellshow3.value=false; |
| | | // }else{ |
| | | // cellshow3.value=true; |
| | | // } |
| | | // if(cellshow4.value==true){ |
| | | // cellshow4.value=false; |
| | | // }else{ |
| | | // cellshow4.value=true; |
| | | // } |
| | | // } |
| | | |
| | | // }, 1000); |
| | | const nextPage = () => { |
| | | if (currentPage.value < totalPages.value) { |
| | | currentPage.value++; |
| | | } |
| | | }; |
| | | |
| | | // 总页数计算 |
| | | const totalPages = computed(() => { |
| | | // let total = 0; |
| | | // for (let i = 1; i <= users.value.length; i++) { |
| | | // if (i === 1) { |
| | | // total += 1; |
| | | // } else if (i === 2) { |
| | | // total += 2; |
| | | // } else if (i === 3) { |
| | | // total += 5; |
| | | // } else { |
| | | // total += 10; |
| | | // } |
| | | // } |
| | | return 8; |
| | | }); |
| | | |
| | | |
| | | |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | |
| | | } |
| | | const handleBindRack = (row) => { |
| | | selectedRow.value = row; // 更新选中的行数据 |
| | | currentRow.deviceId = row.deviceId; // 直接设置响应式属性 |
| | | currentRow.slot = row.slot; |
| | | window.localStorage.setItem('deviceId', row.deviceId) |
| | | window.localStorage.setItem('slot', row.slot) |
| | | add.value = true; // 打开绑定架子对话框 |
| | | }; |
| | | async function handleConfirm() { |
| | | if (!selectedRow.value) { |
| | | // 处理没有选中行的情况... |
| | | return; |
| | | } |
| | | |
| | | // 构造你的POST请求数据,包含选中的行数据和表单数据 |
| | | const postData = { |
| | | ...selectedRow.value, // 选中行的数据 |
| | | }; |
| | | |
| | | // 搜索 |
| | | const searchout = async () => { |
| | | try { |
| | | const response = await request.post('/cacheVerticalGlass/bigStorageCageDetails/insertBigStorageCageDetails', { |
| | | 'flowCardId': flowCardId.value, |
| | | 'gap': gap.value, |
| | | 'glassId': glassId.value, |
| | | 'glassType': glassType.value, |
| | | 'height': height.value, |
| | | 'sequence': sequence.value, |
| | | 'state': state.value, |
| | | 'temperingFeedSequence': temperingFeedSequence.value, |
| | | 'temperingLayoutId': temperingLayoutId.value, |
| | | 'thickness': thickness.value, |
| | | 'width': width.value, |
| | | body: JSON.stringify(postData), |
| | | const response = await request.post('/cacheVerticalGlass/bigStorageCageDetails/selectBigStorageCageDetails',{ |
| | | glassId:glassId.value |
| | | }); |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | tableDataf.value = response.data; |
| | | ElMessage.success(response.message); |
| | | add.value = false; |
| | | tableData.value = response.data; |
| | | |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | // 处理错误... |
| | | console.error(error); |
| | | } |
| | | } |
| | | // 添加 |
| | | // const handleConfirm = async () => { |
| | | // try { |
| | | // const response = await request.post('/cacheVerticalGlass/bigStorageCageDetails/insertBigStorageCageDetails', { |
| | | // 'bigStorageCageOutTask.flowCardId': flowCardId.value, |
| | | // 'bigStorageCageOutTask.gap': gap.value, |
| | | // 'bigStorageCageOutTask.glassId': glassId.value, |
| | | // 'bigStorageCageOutTask.glassType': glassType.value, |
| | | // 'bigStorageCageOutTask.height': height.value, |
| | | // 'bigStorageCageOutTask.sequence': sequence.value, |
| | | // 'bigStorageCageOutTask.state': state.value, |
| | | // 'bigStorageCageOutTask.temperingFeedSequence': temperingFeedSequence.value, |
| | | // 'bigStorageCageOutTask.temperingLayoutId': temperingLayoutId.value, |
| | | // 'bigStorageCageOutTask.thickness': thickness.value, |
| | | // 'bigStorageCageOutTask.width': width.value, |
| | | // }); |
| | | // if (response.code == 200) { |
| | | // // 绑定成功,处理逻辑 |
| | | // ElMessage.success(response.message); |
| | | // add.value = false; |
| | | // tableData.value = response.data; |
| | | // } else { |
| | | // // 请求失败,显示错误消息 |
| | | // ElMessage.error(response.msg); |
| | | // } |
| | | // } catch (error) { |
| | | // // 处理错误 |
| | | // console.error(error); |
| | | // } |
| | | // }; |
| | | } catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | }; |
| | | // 是否禁用 |
| | | const toggleEnableState = async (row) => { |
| | | const newState = row.enableState === 1 ? 0 : 1; |
| | |
| | | ElMessage.error(response.message); |
| | | } |
| | | row.enableState = newState; |
| | | }; |
| | | // const tableData = ref([ |
| | | // // ...您的表格数据 |
| | | // id: |
| | | // deviceId slot enableState remainWidth |
| | | |
| | | // ]); |
| | | }; |
| | | // 删除 |
| | | const opena = async(row) => { |
| | | try { |
| | |
| | | // 用户点击了“是”,现在调用删除接口 |
| | | const response = await request.post("/cacheVerticalGlass/bigStorageCageDetails/deleteBigStorageCageDetails",row) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | tableData.value = response.data; |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | // 删除失败,您可以处理错误或显示错误信息给用户 |
| | | ElMessage.error(response.message); |
| | |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | // const dataToSend = { |
| | | // ...row, |
| | | // status: 0 |
| | | // }; |
| | | // 用户点击了“是”,现在调用删除接口 |
| | | const response = await request.post("/cacheVerticalGlass/bigStorageCageDetails/damageBigStorageCageDetails?status="+0, row) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | tableData.value = response.data; |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | // 删除失败,您可以处理错误或显示错误信息给用户 |
| | | ElMessage.error(response.message); |
| | | // alert('删除失败:' + deleteResponse.message); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | // 处理可能出现的错误,比如 ElMessageBox 抛出的异常等 |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | // const dataToSend = { |
| | | // ...row, |
| | | // status: 1 |
| | | // }; |
| | | // 用户点击了“是”,现在调用删除接口 |
| | | const response = await request.post("/cacheVerticalGlass/bigStorageCageDetails/damageBigStorageCageDetails?status="+1, row) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | tableData.value = response.data; |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | // 删除失败,您可以处理错误或显示错误信息给用户 |
| | | ElMessage.error(response.message); |
| | | // alert('删除失败:' + deleteResponse.message); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | // 处理可能出现的错误,比如 ElMessageBox 抛出的异常等 |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | // 删除失败,您可以处理错误或显示错误信息给用户 |
| | | ElMessage.error(response.message); |
| | | // alert('删除失败:' + deleteResponse.message); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | // 处理可能出现的错误,比如 ElMessageBox 抛出的异常等 |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | // 用户点击了“是”,现在调用删除接口 |
| | | // const dataToSend = { |
| | | // ...row, |
| | | // status: 0 |
| | | // }; |
| | | const response = await request.post("/cacheVerticalGlass/temperingGlassInfo/damageTemperingGlassInfo?status="+0, row) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | // 删除失败,您可以处理错误或显示错误信息给用户 |
| | | ElMessage.error(response.message); |
| | | // alert('删除失败:' + deleteResponse.message); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | // 处理可能出现的错误,比如 ElMessageBox 抛出的异常等 |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | // 用户点击了“是”,现在调用删除接口 |
| | | // const dataToSend = { |
| | | // ...row, |
| | | // status: 1 |
| | | // }; |
| | | const response = await request.post("/cacheVerticalGlass/temperingGlassInfo/damageTemperingGlassInfo?status="+1, row) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | // 删除失败,您可以处理错误或显示错误信息给用户 |
| | | ElMessage.error(response.message); |
| | | // alert('删除失败:' + deleteResponse.message); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | // 处理可能出现的错误,比如 ElMessageBox 抛出的异常等 |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | // 用户点击了“是”,现在调用删除接口 |
| | | const dataToSend = { |
| | | ...row, |
| | | status: 1 |
| | |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | // 删除失败,您可以处理错误或显示错误信息给用户 |
| | | ElMessage.error(response.message); |
| | | // alert('删除失败:' + deleteResponse.message); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | // 处理可能出现的错误,比如 ElMessageBox 抛出的异常等 |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | // 用户点击了“是”,现在调用删除接口 |
| | | // const dataToSend = { |
| | | // ...row, |
| | | // status: 1 |
| | | // }; |
| | | const response = await request.post("/cacheVerticalGlass/bigStorageCageDetails/finishBigStorageCageDetails", row) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | // 删除失败,您可以处理错误或显示错误信息给用户 |
| | | ElMessage.error(response.message); |
| | | // alert('删除失败:' + deleteResponse.message); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | } catch (error) { |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | // 确认添加 |
| | | const finisha = async(row) => { |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | t('searchOrder.sureadda'), |
| | | t('searchOrder.prompt'), |
| | | { |
| | | confirmButtonText: t('searchOrder.yes'), |
| | | cancelButtonText: t('searchOrder.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | let deviceId = window.localStorage.getItem('deviceId') |
| | | let slot = window.localStorage.getItem('slot') |
| | | const dataToSend = { |
| | | ...row, |
| | | deviceId: deviceId, |
| | | slot: slot |
| | | }; |
| | | const response = await request.post("/cacheVerticalGlass/bigStorageCageDetails/insertBigStorageCageDetails", dataToSend) |
| | | if (response.code === 200) { |
| | | tableData.value = response.data; |
| | | add.value = false; |
| | | ElMessage.success(response.message); |
| | | glassId.value = ''; |
| | | tableDataf.value = ''; |
| | | |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | // 处理可能出现的错误,比如 ElMessageBox 抛出的异常等 |
| | | console.error('发生错误:', error); |
| | | } |
| | |
| | | function handleRowClick(row) { |
| | | selectedRow.value = row; // 更新选中的行数据 |
| | | } |
| | | |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheVerticalGlass/api/talk/slicecage`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | |
| | | tableDatab.value = data.temperingGlassInfoList[0] |
| | | tableDatae.value = data.bigStorageCageUsage[0] |
| | | // adjustedRects.value = data.bigStorageCageInfo1[0] |
| | | window.localStorage.setItem('length', data.bigStorageCageInfo1[0].length) |
| | | let length = window.localStorage.getItem('length') |
| | | adjustedRects.value = data.bigStorageCageInfo1[0].map(rect => ({ |
| | | ...rect, |
| | | // width: rect.remainWidth *0.04, |
| | | top: rect.id *2, |
| | | height: 20/length, |
| | | top: 29/length |
| | | })); |
| | | console.log(data.bigStorageCageInfo1[0]); |
| | | let small = data.bigStorageCageInfo1[0] |
| | | console.log(small[0].bigStorageCageDetails); |
| | | adjustedRectsa.value = data.bigStorageCageInfo2[0].map(rect => ({ |
| | | ...rect, |
| | | // width: rect.remainWidth *0.04, |
| | | top: rect.id *2, |
| | | height: 20/length, |
| | | top: 29/length |
| | | })); |
| | | // window.localStorage.setItem('length', data.bigStorageCageInfo1[0].length) |
| | | // let length = window.localStorage.getItem('length') |
| | | |
| | | adjustedRectsb.value = data.bigStorageCageInfo3[0].map(rect => ({ |
| | | ...rect, |
| | | height: 20/length, |
| | | top: 29/length |
| | | })); |
| | | adjustedRectsc.value = data.bigStorageCageInfo4[0].map(rect => ({ |
| | | ...rect, |
| | | height: 20/length, |
| | | top: 29/length |
| | | })); |
| | | adjustedRectsd.value = data.bigStorageCageInfo5[0].map(rect => ({ |
| | | ...rect, |
| | | height: 20/length, |
| | | top: 29/length |
| | | })); |
| | | adjustedRectse.value = data.bigStorageCageInfo6[0].map(rect => ({ |
| | | ...rect, |
| | | height: 20/length, |
| | | top: 29/length |
| | | })); |
| | | adjustedRectsf.value = data.bigStorageCageInfo7[0].map(rect => ({ |
| | | ...rect, |
| | | height: 20/length, |
| | | top: 29/length |
| | | })); |
| | | adjustedRectsg.value = data.bigStorageCageInfo8[0].map(rect => ({ |
| | | ...rect, |
| | | height: 20/length, |
| | | top: 29/length |
| | | })); |
| | | }; |
| | | // function getRectHeight(length: number) { |
| | | // return length > 0 ? 29 / length : 29; |
| | | // } |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | |
| | | }); |
| | | function getStatusType(enableState: number) { |
| | | switch (enableState) { |
| | | case 0: |
| | | return 'warning'; |
| | | case 1: |
| | | case 100: |
| | | return 'success'; |
| | | case 102: |
| | | return 'warning'; |
| | | } |
| | | } |
| | | function getStatusText(enableState: number) { |
| | | switch (enableState) { |
| | | case 0: |
| | | return t('searchOrder.disable'); |
| | | case 1: |
| | | return t('searchOrder.enable'); |
| | | case 100: |
| | | return t('searchOrder.zailong'); |
| | | case 102: |
| | | return t('searchOrder.rengongxp'); |
| | | } |
| | | } |
| | | function getStatusTypea(ishorizontal: number) { |
| | |
| | | </el-col> |
| | | </div> |
| | | </div> |
| | | <!-- <div id="awatch"> |
| | | <img src="../../assets/cp.png" alt="" style="width: 70%;height: 70%;margin-left: 160px;"> |
| | | </div> --> |
| | | <!-- // 父级框 --> |
| | | <div class="img-dlpl" > |
| | | <div class="img-car1" :style="'z-index:999;left:247px;top:' + carposition1 + 'px;position:absolute;'"> |
| | |
| | | <div class="img-car4" :style="'z-index:999;left:704px;top:' + carposition4 + 'px;position:absolute;'"> |
| | | <div v-show="cellshow4" style="margin-top:10px;width:200px;height:5px;background-color:#409EFF;"></div> |
| | | </div> |
| | | <div v-show="cell1" style="width: 227px;position: relative;height: 29px;top:55px;left: 465px;background-color: #911005;"> |
| | | <div style="position: relative;"> |
| | | <div v-show="cell1" style="width: 227px;height: 29px;position: relative;top:55px;left: 465px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRects" |
| | | :key="rect" |
| | | :key="rect.id" |
| | | :style="{ |
| | | |
| | | // display:'flex', |
| | | position: 'absolute', |
| | | width: '227px', |
| | | height: '0.8px', |
| | | backgroundColor: '#409EFF', |
| | | // backgroundColor: 'red', |
| | | left: '0px', |
| | | top: `${rect.top}px`, |
| | | top: index*rect.top+`px`, |
| | | height: `${rect.height}px`, |
| | | }" |
| | | > |
| | | |
| | | <div |
| | | v-for="(rects, index) in rect.bigStorageCageDetails" |
| | | :key="rects" |
| | | :style="{ |
| | | float:'left', |
| | | width: '18px', |
| | | height: `${rect.height}px`, |
| | | backgroundColor: '#911005', |
| | | // border:'1px solid black', |
| | | top: '0px', |
| | | marginRight: rects.gap/5000*227+'px' |
| | | }" |
| | | > |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-show="cell2" style="width: 227px;height: 29px;position: relative;top:86px;left: 465px;background-color: #911005;"> |
| | | <div v-show="cell2" style="width: 227px;height: 29px;position: relative;top:56px;left: 465px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsa" |
| | | :key="rect" |
| | | :key="rect.id" |
| | | :style="{ |
| | | |
| | | // display:'flex', |
| | | position: 'absolute', |
| | | width: '227px', |
| | | height: '0.8px', |
| | | backgroundColor: '#409EFF', |
| | | // backgroundColor: 'red', |
| | | left: '0px', |
| | | top: `${rect.top}px`, |
| | | top: index*rect.top+`px`, |
| | | height: `${rect.height}px`, |
| | | }" |
| | | > |
| | | |
| | | <div |
| | | v-for="(rects, index) in rect.bigStorageCageDetails" |
| | | :key="rects" |
| | | :style="{ |
| | | float:'left', |
| | | width: '18px', |
| | | height: `${rect.height}px`, |
| | | backgroundColor: '#911005', |
| | | // border:'1px solid black', |
| | | top: '0px', |
| | | marginRight: rects.gap/5000*227+'px' |
| | | }" |
| | | > |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- <div v-show="cell3" style="width: 227px;height: 29px;position: absolute;top:117px;left: 465px;background-color: #409EFF;"> |
| | | <div v-show="cell3" style="width: 227px;height: 29px;position: absolute;top:117px;left: 465px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsb" |
| | | :key="rect.id" |
| | | :style="{ |
| | | // display:'flex', |
| | | position: 'absolute', |
| | | width: '227px', |
| | | // backgroundColor: 'red', |
| | | left: '0px', |
| | | top: index*rect.top+`px`, |
| | | height: `${rect.height}px`, |
| | | }" |
| | | > |
| | | <div |
| | | v-for="(rects, index) in rect.bigStorageCageDetails" |
| | | :key="rects" |
| | | :style="{ |
| | | float:'left', |
| | | width: '18px', |
| | | height: `${rect.height}px`, |
| | | backgroundColor: '#911005', |
| | | // border:'1px solid black', |
| | | top: '0px', |
| | | marginRight: rects.gap/5000*227+'px' |
| | | }" |
| | | > |
| | | </div> |
| | | </div> |
| | | <div v-show="cell4" style="width: 227px;height: 29px;position: absolute;top:148px;left: 465px;background-color: #409EFF;"> |
| | | </div> |
| | | <div v-show="cell5" style="width: 227px;height: 29px;position: absolute;top:208px;left: 465px;background-color: #409EFF;"> |
| | | <div v-show="cell4" style="width: 227px;height: 29px;position: absolute;top:148px;left: 465px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsc" |
| | | :key="rect.id" |
| | | :style="{ |
| | | |
| | | // display:'flex', |
| | | position: 'absolute', |
| | | width: '227px', |
| | | // backgroundColor: 'red', |
| | | left: '0px', |
| | | top: index*rect.top+`px`, |
| | | height: `${rect.height}px`, |
| | | }" |
| | | > |
| | | <div |
| | | v-for="(rects, index) in rect.bigStorageCageDetails" |
| | | :key="rects" |
| | | :style="{ |
| | | float:'left', |
| | | width: '18px', |
| | | height: `${rect.height}px`, |
| | | backgroundColor: '#911005', |
| | | // border:'1px solid black', |
| | | top: '0px', |
| | | marginRight: rects.gap/5000*227+'px' |
| | | }" |
| | | > |
| | | </div> |
| | | </div> |
| | | <div v-show="cell6" style="width: 227px;height: 29px;position: absolute;top:238px;left: 465px;background-color: #409EFF;"> |
| | | </div> |
| | | <div v-show="cell7" style="width: 227px;height: 29px;position: absolute;top:269px;left: 465px;background-color: #409EFF;"> |
| | | <div v-show="cell5" style="width: 227px;height: 29px;position: absolute;top:208px;left: 465px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsd" |
| | | :key="rect.id" |
| | | :style="{ |
| | | |
| | | // display:'flex', |
| | | position: 'absolute', |
| | | width: '227px', |
| | | // backgroundColor: 'red', |
| | | left: '0px', |
| | | top: index*rect.top+`px`, |
| | | height: `${rect.height}px`, |
| | | }" |
| | | > |
| | | <div |
| | | v-for="(rects, index) in rect.bigStorageCageDetails" |
| | | :key="rects" |
| | | :style="{ |
| | | float:'left', |
| | | width: '18px', |
| | | height: `${rect.height}px`, |
| | | backgroundColor: '#911005', |
| | | // border:'1px solid black', |
| | | top: '0px', |
| | | marginRight: rects.gap/5000*227+'px' |
| | | }" |
| | | > |
| | | </div> |
| | | </div> |
| | | <div v-show="cell8" style="width: 227px;height: 29px;position: absolute;top:300px;left: 465px;background-color: #409EFF;"> |
| | | </div> --> |
| | | </div> |
| | | <div v-show="cell6" style="width: 227px;height: 29px;position: absolute;top:238px;left: 465px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectse" |
| | | :key="rect.id" |
| | | :style="{ |
| | | |
| | | // display:'flex', |
| | | position: 'absolute', |
| | | width: '227px', |
| | | // backgroundColor: 'red', |
| | | left: '0px', |
| | | top: index*rect.top+`px`, |
| | | height: `${rect.height}px`, |
| | | }" |
| | | > |
| | | <div |
| | | v-for="(rects, index) in rect.bigStorageCageDetails" |
| | | :key="rects" |
| | | :style="{ |
| | | float:'left', |
| | | width: '18px', |
| | | height: `${rect.height}px`, |
| | | backgroundColor: '#911005', |
| | | // border:'1px solid black', |
| | | top: '0px', |
| | | marginRight: rects.gap/5000*227+'px' |
| | | }" |
| | | > |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-show="cell7" style="width: 227px;height: 29px;position: absolute;top:269px;left: 465px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsf" |
| | | :key="rect.id" |
| | | :style="{ |
| | | |
| | | // display:'flex', |
| | | position: 'absolute', |
| | | width: '227px', |
| | | // backgroundColor: 'red', |
| | | left: '0px', |
| | | top: index*rect.top+`px`, |
| | | height: `${rect.height}px`, |
| | | }" |
| | | > |
| | | <div |
| | | v-for="(rects, index) in rect.bigStorageCageDetails" |
| | | :key="rects" |
| | | :style="{ |
| | | float:'left', |
| | | width: '18px', |
| | | height: `${rect.height}px`, |
| | | backgroundColor: '#911005', |
| | | // border:'1px solid black', |
| | | top: '0px', |
| | | marginRight: rects.gap/5000*227+'px' |
| | | }" |
| | | > |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-show="cell8" style="width: 227px;height: 29px;position: absolute;top:300px;left: 465px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsg" |
| | | :key="rect.id" |
| | | :style="{ |
| | | |
| | | // display:'flex', |
| | | position: 'absolute', |
| | | width: '227px', |
| | | // backgroundColor: 'red', |
| | | left: '0px', |
| | | top: index*rect.top+`px`, |
| | | height: `${rect.height}px`, |
| | | }" |
| | | > |
| | | <div |
| | | v-for="(rects, index) in rect.bigStorageCageDetails" |
| | | :key="rects" |
| | | :style="{ |
| | | float:'left', |
| | | width: '18px', |
| | | height: `${rect.height}px`, |
| | | backgroundColor: '#911005', |
| | | // border:'1px solid black', |
| | | top: '0px', |
| | | marginRight: rects.gap/5000*227+'px' |
| | | }" |
| | | > |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <el-dialog v-model="add" top="10vh" width="65%" :title="$t('searchOrder.addcage')" > |
| | | <div style="margin-top: -20px;margin-bottom: 40px;margin-left: 30px"> |
| | | <el-input :placeholder="$t('searchOrder.inputid')" clearable style="width: 200px;"> |
| | | </el-input> |
| | | <el-button type="primary" plain style="margin-left: 10px;">{{ $t('searchOrder.search') }}</el-button> |
| | | |
| | | <!-- <span style="margin-right: 10px">禁用词</span> |
| | | <el-input clearable placeholder="请输入禁用词" size="mini" |
| | | style="margin-right: 50px; width: 200px;" /> --> |
| | | </div> |
| | | <div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form size="mini" label-width="180px"> |
| | | <el-form label-width="180px" label-position="right"> |
| | | <el-dialog v-model="add" top="10vh" width="70%" :title="$t('searchOrder.addcage')" > |
| | | <div style="margin-bottom: 20px"> |
| | | <el-form> |
| | | <el-row style="margin-top: -15px;margin-bottom: -2px;"> |
| | | <el-col :span="6"> |
| | | <el-col :span="4"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('searchOrder.glassIDa')" :required="true" style="width: 24vw;"> |
| | | <el-input :placeholder="$t('searchOrder.inglassID')" v-model="glassId" autocomplete="off" /> |
| | | <el-form-item :label="$t('searchOrder.tida')" style="width: 14vw"> |
| | | {{ currentRow.deviceId }} |
| | | <!-- <el-input v-model="currentRow.id" autocomplete="off"></el-input> --> |
| | | </el-form-item> |
| | | </div></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="9"> |
| | | <el-col :span="5"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('searchOrder.pieceingrida')" :required="true" style="width: 24vw;"> |
| | | <el-input :placeholder="$t('searchOrder.inpieceingrid')" v-model="sequence" autocomplete="off" /> |
| | | </el-form-item></div> |
| | | <el-form-item :label="$t('searchOrder.gridnumbera')" style="width: 14vw"> |
| | | {{ currentRow.slot }} |
| | | <!-- <el-input v-model="currentRow.slot" autocomplete="off"></el-input> --> |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('searchOrder.cardnumbera')" :required="true" style="width: 24vw;"> |
| | | <el-input :placeholder="$t('searchOrder.incardnumber')" v-model="flowCardId" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | <el-col :span="9"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('searchOrder.typeglassa')" :required="true" style="width: 24vw;"> |
| | | <el-input :placeholder="$t('searchOrder.intypeglass')" v-model="glassType" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('searchOrder.widtha')" :required="true" style="width: 24vw;"> |
| | | <el-input :placeholder="$t('searchOrder.inwidth')" v-model="width" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | <el-col :span="9"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('searchOrder.heighta')" :required="true" style="width: 24vw;"> |
| | | <el-input :placeholder="$t('searchOrder.inheight')" v-model="height" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('searchOrder.thicknessa')" :required="true" style="width: 24vw;"> |
| | | <el-input :placeholder="$t('searchOrder.inthickness')" v-model="thickness" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | <el-col :span="9"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('searchOrder.layoutIDa')" :required="true" style="width: 24vw;"> |
| | | <el-input :placeholder="$t('searchOrder.inlayoutID')" v-model="temperingLayoutId" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('searchOrder.picturesequencea')" :required="true" style="width: 24vw;"> |
| | | <el-input :placeholder="$t('searchOrder.inpicturesequence')" v-model="temperingFeedSequence" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | <el-col :span="9"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('searchOrder.startstatusa')" :required="true" style="width: 24vw;"> |
| | | <el-input :placeholder="$t('searchOrder.instartstatus')" v-model="state" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('searchOrder.glassgapsa')" :required="true" style="width: 24vw;"> |
| | | <el-input :placeholder="$t('searchOrder.inglassgaps')" v-model="gap" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | <el-col :span="9"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('searchOrder.gridnumbera')" :required="true" style="width: 24vw;"> |
| | | <el-input :placeholder="$t('searchOrder.grid')" v-model="state" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </el-form> |
| | | </div> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleConfirm"> |
| | | {{ $t('searchOrder.sure') }} |
| | | </el-button> |
| | | <el-button @click="add = false">{{ $t('searchOrder.cancel') }}</el-button> |
| | | </el-form> |
| | | </div> |
| | | <div style="margin-top: -20px;margin-bottom: 40px;margin-left: 30px"> |
| | | <el-input v-model="glassId" :placeholder="$t('searchOrder.inputid')" clearable style="width: 200px;"> |
| | | </el-input> |
| | | <el-button type="primary" plain style="margin-left: 10px;" @click="searchout">{{ $t('searchOrder.search') }}</el-button> |
| | | </div> |
| | | |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 500px;"> |
| | | <el-table height="100%" ref="table" |
| | | :data="tableDataf" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="glassId" align="center" :label="$t('searchOrder.glassID')" min-width="120" /> |
| | | <el-table-column prop="sequence" align="center" :label="$t('searchOrder.pieceingrid')" min-width="180" /> |
| | | <el-table-column prop="flowCardId" align="center" :label="$t('searchOrder.cardnumber')" min-width="150" /> |
| | | <el-table-column prop="glassType" align="center" :label="$t('searchOrder.typeglass')" min-width="150"/> |
| | | <el-table-column prop="width" align="center" :label="$t('searchOrder.width')" min-width="150"/> |
| | | <el-table-column prop="height" align="center" :label="$t('searchOrder.height')" min-width="150"/> |
| | | <el-table-column prop="thickness" align="center" :label="$t('searchOrder.thickness')" min-width="150"/> |
| | | <el-table-column prop="temperingLayoutId" align="center" :label="$t('searchOrder.layoutID')" min-width="150"/> |
| | | <el-table-column prop="temperingFeedSequence" align="center" :label="$t('searchOrder.picturesequence')" min-width="150"/> |
| | | <el-table-column |
| | | align="center" |
| | | :label="$t('searchOrder.startstatus')" |
| | | min-width="80" |
| | | prop="state" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag |
| | | :type="scope.row.state === 1 ? 'success' : 'danger'" |
| | | > |
| | | {{ scope.row.state === 1 ? $t('searchOrder.enable') : $t('searchOrder.disable') }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="gap" align="center" :label="$t('searchOrder.glassgaps')" min-width="150"/> |
| | | <!-- <el-table-column prop="slot" align="center" :label="$t('searchOrder.gridnumber')" min-width="150"/> --> |
| | | <el-table-column fixed="right" :label="$t('searchOrder.operate')" align="center" width="150"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="finisha(scope.row)">{{ $t('searchOrder.sureadd') }}</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisiblea" top="5vh" width="97%" :title="$t('searchOrder.cageinformation')"> |
| | | <el-table |
| | | :data="tableData" |
| | | :data="paginatedUsers" |
| | | @row-click="handleRowClick" |
| | | height="500" |
| | | @expand-change="handleExpandChange" |
| | |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" |
| | | > |
| | | <!-- <el-table-column prop="menuName" label="二级菜单栏" align="center" min-width="140" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"/> --> |
| | | <el-table-column prop="glassId" :label="$t('searchOrder.glassID')" align="center" min-width="80"/> |
| | | <el-table-column prop="sequence" align="center" :label="$t('searchOrder.pieceingrid')" min-width="100" /> |
| | | <el-table-column prop="glassId" :label="$t('searchOrder.glassID')" align="center" min-width="90"/> |
| | | <el-table-column prop="sequence" align="center" :label="$t('searchOrder.pieceingrid')" min-width="110" /> |
| | | <el-table-column prop="flowCardId" align="center" :label="$t('searchOrder.cardnumber')" min-width="120" /> |
| | | <el-table-column prop="glassType" align="center" :label="$t('searchOrder.typeglass')" min-width="80" /> |
| | | <el-table-column prop="width" align="center" :label="$t('searchOrder.width')" min-width="80" /> |
| | |
| | | :label="$t('searchOrder.startstatus')" |
| | | min-width="80" |
| | | prop="state" |
| | | |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusType(scope.row.state)"> |
| | |
| | | <el-button size="mini" type="text" plain @click="broke(scope.row)">{{ $t('searchOrder.breakage') }}</el-button> |
| | | <el-button size="mini" type="text" plain @click="brokec(scope.row)">{{ $t('searchOrder.takeout') }}</el-button> |
| | | <el-button size="mini" type="text" plain @click="opena(scope.row)">{{ $t('searchOrder.delete') }}</el-button> |
| | | <el-button size="mini" type="text" plain @click="outfil(scope.row)">{{ $t('searchOrder.outfilm') }}</el-button> |
| | | <el-button size="mini" type="text" |
| | | :disabled="!((props.row.bigStorageCageDetails[0].state !== 102 && scope.$index == 0 ) || (props.row.bigStorageCageDetails[(scope.$index - 1)<0?0:scope.$index-1].state==102)&&(scope.row.state!=102))" |
| | | plain @click="outfil(scope.row)"> |
| | | {{ $t('searchOrder.outfilm') }} |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-table> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div id="demo-pagination-block"> |
| | | <el-pagination |
| | | style="margin-left: 850px;" |
| | | v-model:current-page="currentPage4" |
| | | v-model:page-size="pageSize4" |
| | | :page-sizes="[100, 200, 300, 400]" |
| | | :small="small" |
| | | :disabled="disabled" |
| | | :background="background" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="400" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | <div> |
| | | <div style="margin-top: 20px; text-align: center;"> |
| | | <!-- 上一页按钮 --> |
| | | <el-button @click="prevPage" :disabled="currentPage === 1">{{ $t('searchOrder.up') }}</el-button> |
| | | |
| | | <!-- 下一页按钮 --> |
| | | <el-button @click="nextPage" :disabled="currentPage >= totalPages">{{ $t('searchOrder.down') }}</el-button> |
| | | |
| | | <!-- 当前页显示的条数 --> |
| | | <span style="margin-left: 10px;">{{ $t('searchOrder.now') }} {{ itemsPerPage }} {{ $t('searchOrder.tit') }}</span> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | </el-dialog> |
| | | <!-- </el-dialog> --> |
| | | <el-dialog v-model="dialogFormVisibleb" top="5vh" width="85%" :title="$t('searchOrder.productionqueue')"> |
| | | <!-- <div style="display: flex;"> |
| | | <p style="margin-top: 3px;">队列状态:</p> |
| | |
| | | |
| | | </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{ |
| | |
| | | |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG12345678',downGlassInfoList:"" } }, |
| | | |
| | | { x: 140, y: 420, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: 'NG1234561454' ,downGlassInfoList:""} } |
| | | { x: 140, y: 320, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: 'NG1234561454' ,downGlassInfoList:""} } |
| | | |
| | | ]); |
| | | |
| | |
| | | |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG12345678' } }, |
| | | |
| | | { x: 140, y: 420, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: 'NG1234561454' } } |
| | | { x: 140, y: 320, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: 'NG1234561454' } } |
| | | |
| | | ]); |
| | | |
| | |
| | | { |
| | | "plcAddressBegin": "DB100.0", |
| | | "plcAddressLenght": "142", |
| | | "dataType": "word", |
| | | "parameteInfor": [ |
| | | { |
| | | "codeId": "RequestWord", |
| | | "addressIndex": "0", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G04ID", |
| | | "addressIndex": "2", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06RobotTaskRequestWord", |
| | | "addressIndex": "4", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06ID", |
| | | "addressIndex": "6", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11RobotTaskRequestWord", |
| | | "addressIndex": "8", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G011ID", |
| | | "addressIndex": "10", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "12", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "14", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "16", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "18", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "MESSendingWord", |
| | | "addressIndex": "20", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InputGrid", |
| | | "addressIndex": "22", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "OutputGrid", |
| | | "addressIndex": "24", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "OutputID", |
| | | "addressIndex": "26", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "FrontOrRearLowerSlice", |
| | | "addressIndex": "28", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "30", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06RobotTaskReply", |
| | | "addressIndex": "32", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06Rack", |
| | | "addressIndex": "34", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11RobotTaskReply", |
| | | "addressIndex": "36", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11Rack", |
| | | "addressIndex": "38", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "40", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "42", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "44", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "46", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "48", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "50", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "52", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "54", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "MESTaskState", |
| | | "addressIndex": "56", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "58", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "AlarmState", |
| | | "addressIndex": "60", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Alarm1", |
| | | "addressIndex": "62", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Alarm2", |
| | | "addressIndex": "64", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Alarm3", |
| | | "addressIndex": "66", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Alarm4", |
| | | "addressIndex": "68", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "neirong", |
| | | "addressIndex": "70", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "device", |
| | | "addressIndex": "72", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "74", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "76", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut1", |
| | | "addressIndex": "78", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut2", |
| | | "addressIndex": "80", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut3", |
| | | "addressIndex": "82", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut4", |
| | | "addressIndex": "84", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut5", |
| | | "addressIndex": "86", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut6", |
| | | "addressIndex": "88", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "InOut7", |
| | | "addressIndex": "90", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "92", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "94", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "96", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "98", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "spare", |
| | | "addressIndex": "100", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G04ActionState", |
| | | "addressIndex": "102", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G05ActionState", |
| | | "addressIndex": "104", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06ActionState", |
| | | "addressIndex": "106", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G07ActionState", |
| | | "addressIndex": "108", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G08ActionState", |
| | | "addressIndex": "110", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G09ActionState", |
| | | "addressIndex": "112", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G10ActionState", |
| | | "addressIndex": "114", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11ActionState", |
| | | "addressIndex": "116", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G12ActionState", |
| | | "addressIndex": "118", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G13ActionState", |
| | | "addressIndex": "120", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G04IDS", |
| | | "addressIndex": "122", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G05IDS", |
| | | "addressIndex": "124", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06IDS", |
| | | "addressIndex": "126", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G07IDS", |
| | | "addressIndex": "128", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G08IDS", |
| | | "addressIndex": "130", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G09IDS", |
| | | "addressIndex": "132", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G10IDS", |
| | | "addressIndex": "134", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11IDS", |
| | | "addressIndex": "136", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G12IDS", |
| | | "addressIndex": "138", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G13ID", |
| | | "addressIndex": "140", |
| | | "addressLenght": "2" |
| | | } |
| | | ] |
| | | "plcAddressBegin": "DB11.0", |
| | | "plcAddressLenght": "100", |
| | | "dataType": "word", |
| | | "parameteInfor": [ |
| | | |
| | | { |
| | | "codeId": "requestWord", |
| | | "addressIndex": "0", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "requestID", |
| | | "addressIndex": "2", |
| | | "addressLenght": "30" |
| | | }, |
| | | { |
| | | "codeId": "currentCell", |
| | | "addressIndex": "32", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "glassStatus08", |
| | | "addressIndex": "36", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06_glass_status", |
| | | "addressIndex": "40", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11_glass_status", |
| | | "addressIndex": "42", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G13_glass_status", |
| | | "addressIndex": "44", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G04_error_status", |
| | | "addressIndex": "48", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G05_error_status", |
| | | "addressIndex": "50", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06_error_status", |
| | | "addressIndex": "52", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "robot_error_status", |
| | | "addressIndex": "54", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G08_error_status", |
| | | "addressIndex": "56", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G09_error_status", |
| | | "addressIndex": "58", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G10_error_status", |
| | | "addressIndex": "60", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11_error_status", |
| | | "addressIndex": "62", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "robot_error_status", |
| | | "addressIndex": "64", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G13_error_status", |
| | | "addressIndex": "66", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "confirmationWord", |
| | | "addressIndex": "72", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G06_prohibit_film_production", |
| | | "addressIndex": "74", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G11_prohibit_film_production", |
| | | "addressIndex": "76", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "G13_prohibit_film_production", |
| | | "addressIndex": "78", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "Glass_width", |
| | | "addressIndex": "82", |
| | | "addressLenght": "4" |
| | | }, |
| | | { |
| | | "codeId": "Glass_height", |
| | | "addressIndex": "86", |
| | | "addressLenght": "4" |
| | | }, |
| | | { |
| | | "codeId": "Glass_thickness", |
| | | "addressIndex": "90", |
| | | "addressLenght": "4" |
| | | }, |
| | | { |
| | | "codeId": "Start_cell", |
| | | "addressIndex": "94", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "End_cell", |
| | | "addressIndex": "96", |
| | | "addressLenght": "2" |
| | | }, |
| | | { |
| | | "codeId": "task_type", |
| | | "addressIndex": "98", |
| | | "addressLenght": "2" |
| | | } |
| | | |
| | | ] |
| | | } |
| | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>com.microsoft.sqlserver</groupId> |
| | | <artifactId>sqljdbc4</artifactId> |
| | | <version>4.0</version> |
| | | <artifactId>mssql-jdbc</artifactId> |
| | | <version>6.4.0.jre8</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | |
| | | * 宽 |
| | | */ |
| | | @ApiModelProperty(value = "宽") |
| | | private Double width; |
| | | private double width; |
| | | |
| | | /** |
| | | * 格子号 |
| | |
| | | * 磨边清洗前 |
| | | */ |
| | | /** |
| | | * A09出片目标位置 d02卧转立 钢化出片 2001 |
| | | * A10出片目标位置 d05卧转立 人工出片 2002 |
| | | * A09出片目标位置 d02卧转立 2001 |
| | | * A10出片目标位置 d05卧转立 2002 |
| | | */ |
| | | public static final Integer A09_OUT_TARGET_POSITION = 2001; |
| | | public static final Integer A10_OUT_TARGET_POSITION = 2002; |
| | | |
| | | |
| | | /** |
| | | * A09出片目标位置 d02卧转立 钢化出片 3001 |
| | | * A10出片目标位置 d05卧转立 人工出片 3002 |
| | | */ |
| | | public static final Integer TEMPERING_OUT_TARGET_POSITION = 3001; |
| | | public static final Integer ARTIFICIAL_OUT_TARGET_POSITION = 3002; |
| | | |
| | | /** |
| | | * 卧式理片笼详情表玻璃状态 |
| | | * 识别后成功状态100 |
| | | * 出片任务101 |
| | | * 人工下片101 |
| | | * 人工下片102 |
| | | * 拿走200 |
| | | * 破损201 |
| | | */ |
| | |
| | | /** |
| | | * 卧式理片笼详情表玻璃状态 |
| | | * 进片任务1 |
| | | * 出片任务2 |
| | | * 出片任务2 |
| | | */ |
| | | public static final Integer GLASS_CACHE_TYPE_IN = 1; |
| | |
| | | * 6 拿走 |
| | | */ |
| | | |
| | | public static final Integer TEMPERING_NEW =-1; |
| | | public static final Integer TEMPERING_OUT =0; |
| | | public static final Integer TEMPERING_DROP =1; |
| | | public static final Integer TEMPERING_START =2; |
| | | public static final Integer TEMPERING_SUCCESS =3; |
| | | public static final Integer TEMPERING_END =4; |
| | | public static final Integer TEMPERING_DAMAGE =5; |
| | | public static final Integer TEMPERING_TAKE =6; |
| | | public static final Integer TEMPERING_NEW = -1; |
| | | public static final Integer TEMPERING_OUT = 0; |
| | | public static final Integer TEMPERING_DROP = 1; |
| | | public static final Integer TEMPERING_START = 2; |
| | | public static final Integer TEMPERING_SUCCESS = 3; |
| | | public static final Integer TEMPERING_END = 4; |
| | | public static final Integer TEMPERING_DAMAGE = 5; |
| | | public static final Integer TEMPERING_TAKE = 6; |
| | | |
| | | /** |
| | | * 下片 |
| | | */ |
| | | /** |
| | | * 执行线路格子信息 |
| | | */ |
| | | public static final List<Integer> G06_WORK_STATION = Arrays.asList(1, 2, 3); |
| | | public static final List<Integer> G11_WORK_STATION = Arrays.asList(4, 5, 6); |
| | | public static final List<Integer> G13_WORK_STATION = Arrays.asList(7); |
| | | |
| | | /** |
| | | * 启用 1 |
| | | * 禁用 0 |
| | | */ |
| | | public static final Integer SLOT_ON = 1; |
| | | public static final Integer SLOT_OFF = 0; |
| | | |
| | | } |
| | |
| | | package com.mes.damage.controller; |
| | | |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-06-13 |
| | | * @since 2024-06-25 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/glassinfo/damage") |
| | | @RequestMapping("/damage") |
| | | public class DamageController { |
| | | |
| | | @Autowired |
| | | private DamageService damageService; |
| | | @ApiOperation("报工数据查询") |
| | | @GetMapping("/selectDamage") |
| | | public Result selectDamage(DateTime startTime , DateTime endTime,int type,int status,int workingProcedureId) { |
| | | return Result.build(200,"查询成功",damageService.selectDamage(startTime,endTime,type,status,workingProcedureId)); |
| | | } |
| | | |
| | | @ApiOperation("报工") |
| | | @GetMapping("/submitDamage") |
| | | public Result submitDamage(DateTime startTime , DateTime endTime,int type,int status,int workingProcedureId) { |
| | | damageService.submitDamage(startTime,endTime,type,status,workingProcedureId); |
| | | return Result.build(200,"报工成功",1); |
| | | } |
| | | |
| | | @ApiOperation("报工数据修改") |
| | | @GetMapping("/updateDamage") |
| | | public Result updateDamage(List<Damage> damageList) { |
| | | damageService.updateBatchById(damageList); |
| | | return Result.build(200,"修改成功",1); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-06-13 |
| | | * @since 2024-06-25 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 工序 |
| | | */ |
| | | private Integer workingProcedureId; |
| | | |
| | | /** |
| | | * 玻璃id |
| | | */ |
| | | private String glassId; |
| | | |
| | | private Integer deviceId; |
| | | |
| | | /** |
| | | * 工程号 |
| | | */ |
| | | private String engineerId; |
| | | |
| | | /** |
| | | * 钢化版图id |
| | | */ |
| | | private Integer temperingLayoutId; |
| | | |
| | | /** |
| | | * 生产时间 |
| | | */ |
| | | private LocalDateTime damageTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * 类型:0:报工 1:破损 2:拿走 |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 状态:0:未报工 1:已报工 |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 流程卡 |
| | | */ |
| | | private Integer processId; |
| | | |
| | | /** |
| | | * 序号 |
| | | */ |
| | | private Integer orderNumber; |
| | | |
| | | /** |
| | | * 工艺确认序号 |
| | | */ |
| | | private Integer technologyNumber; |
| | | |
| | | /** |
| | | * 破损类型 |
| | | */ |
| | | private String breakageType; |
| | | |
| | | /** |
| | | * 破损原因 |
| | | */ |
| | | private String breakageReason; |
| | | |
| | | /** |
| | | * 责任工序 |
| | | */ |
| | | private String responsibleProcess; |
| | | |
| | | /** |
| | | * 责任人员 |
| | | */ |
| | | private String responsiblePersonnel; |
| | | |
| | | /** |
| | | * 责任班组 |
| | | */ |
| | | private String responsibleTeam; |
| | | |
| | | /** |
| | | * 责任设备 |
| | | */ |
| | | private String responsibleEquipment; |
| | | |
| | | /** |
| | | * 报工班组名称 |
| | | */ |
| | | private String teamsGroupsName; |
| | | |
| | | /** |
| | | * 报工设备名称 |
| | | */ |
| | | private String deviceName; |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.damage.service; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface DamageService extends IService<Damage> { |
| | | |
| | | List<Damage> selectDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId); |
| | | |
| | | void submitDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId); |
| | | |
| | | void insertDamage(String glassId); |
| | | } |
| | |
| | | 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.core.conditions.update.UpdateWrapper; |
| | | 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 org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class DamageServiceImpl extends ServiceImpl<DamageMapper, Damage> implements DamageService { |
| | | |
| | | @Override |
| | | public List<Damage> selectDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId){ |
| | | LambdaQueryWrapper<Damage> damageSelectWrapper =new LambdaQueryWrapper<>(); |
| | | damageSelectWrapper.between(Damage::getDamageTime,startTime,endTime); |
| | | if (type!=0){ |
| | | damageSelectWrapper.eq(Damage::getType,type); |
| | | } |
| | | if (status!=0){ |
| | | damageSelectWrapper.eq(Damage::getStatus,status); |
| | | } |
| | | if(workingProcedureId!=0){ |
| | | damageSelectWrapper.eq(Damage::getWorkingProcedureId,workingProcedureId); |
| | | } |
| | | return baseMapper.selectList(damageSelectWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void submitDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId){ |
| | | LambdaUpdateWrapper<Damage> damageUpdateWrapper=new LambdaUpdateWrapper<>(); |
| | | damageUpdateWrapper.between(Damage::getDamageTime,startTime,endTime); |
| | | if (type!=0){ |
| | | damageUpdateWrapper.eq(Damage::getType,type); |
| | | } |
| | | if (status!=0){ |
| | | damageUpdateWrapper.eq(Damage::getStatus,status); |
| | | } |
| | | if(workingProcedureId!=0){ |
| | | damageUpdateWrapper.eq(Damage::getWorkingProcedureId,workingProcedureId); |
| | | } |
| | | Damage damage=new Damage(); |
| | | damage.setStatus(2); |
| | | baseMapper.update(damage,damageUpdateWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void insertDamage(String glassId){ |
| | | LambdaQueryWrapper<GlassInfo> glassInfoSelectWrapper=new LambdaQueryWrapper<>(); |
| | | GlassInfo glassInfo=new GlassInfo(); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Double width; |
| | | private double width; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | private Double thickness; |
| | | private double thickness; |
| | | |
| | | /** |
| | | * 膜系 |
| | |
| | | /** |
| | | * 磨前宽 |
| | | */ |
| | | private Double edgWidth; |
| | | private double edgWidth; |
| | | |
| | | /** |
| | | * 磨前高 |
| | | */ |
| | | private Double edgHeight; |
| | | private double edgHeight; |
| | | |
| | | /** |
| | | * 是否配片 |
| | |
| | | /** |
| | | * 配片最大宽 |
| | | */ |
| | | private Double maxWidth; |
| | | private double maxWidth; |
| | | |
| | | /** |
| | | * 配片最大高 |
| | | */ |
| | | private Double maxHeight; |
| | | private double maxHeight; |
| | | |
| | | /** |
| | | * 钢化是否接受横放 |
| | |
| | | /** |
| | | * 旋转角度(逆时针) |
| | | */ |
| | | private Double angle; |
| | | private double angle; |
| | | |
| | | /** |
| | | * 工程号 |
| | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Double width; |
| | | private double width; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Double oHeight; |
| | | private double oHeight; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Double oWidth; |
| | | private double oWidth; |
| | | |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | private Double glassThickness; |
| | | private double glassThickness; |
| | | |
| | | /** |
| | | * 玻璃膜系 |
| | |
| | | /** |
| | | * 小片宽(加磨量) |
| | | */ |
| | | private Double pWidth; |
| | | private double pWidth; |
| | | /** |
| | | * 小片高(加磨量) |
| | | */ |
| | | private Double pHeight; |
| | | private double pHeight; |
| | | /** |
| | | * 版图id |
| | | */ |
| | |
| | | /** |
| | | * 订单序号 |
| | | */ |
| | | private String orderSort; |
| | | private String orderSort; |
| | | /** |
| | | * 旋转角度 |
| | | */ |
| | | private Double rotateAngle; |
| | | private double rotateAngle; |
| | | |
| | | } |
| | |
| | | /** |
| | | * 面积 |
| | | */ |
| | | private Double area; |
| | | private double area; |
| | | |
| | | |
| | | /** |
| | |
| | | package com.mes.order.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | /** |
| | | * 面积 |
| | | */ |
| | | private Double area; |
| | | private double area; |
| | | |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 小片宽(加磨量) |
| | | */ |
| | | private Double pWidth; |
| | | private double pWidth; |
| | | |
| | | /** |
| | | * 小片高(加磨量) |
| | | */ |
| | | private Double pHeight; |
| | | private double pHeight; |
| | | |
| | | /** |
| | | * 小片宽 |
| | | */ |
| | | private Double width; |
| | | private double width; |
| | | |
| | | /** |
| | | * 小片高 |
| | | */ |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * x坐标 |
| | | */ |
| | | private Double xAxis; |
| | | private double xAxis; |
| | | |
| | | /** |
| | | * y坐标 |
| | | */ |
| | | private Double yAxis; |
| | | private double yAxis; |
| | | |
| | | /** |
| | | * 钢化版图编号(架号) |
| | |
| | | */ |
| | | private Integer stockId; |
| | | |
| | | private Double width; |
| | | private double width; |
| | | |
| | | private Double height; |
| | | private double height; |
| | | |
| | | private Double realwidth; |
| | | private double realwidth; |
| | | |
| | | private Double realheight; |
| | | private double realheight; |
| | | |
| | | /** |
| | | * 切裁率 |
| | |
| | | /** |
| | | * 总面积 |
| | | */ |
| | | private Double glassTotalArea; |
| | | private double glassTotalArea; |
| | | |
| | | /** |
| | | * 流程卡数量 |
| | |
| | | /** |
| | | * 第一次平均切裁率 |
| | | */ |
| | | private Double fristCutPct; |
| | | private double fristCutPct; |
| | | |
| | | /** |
| | | * 使用的原料数 |
| | |
| | | /** |
| | | * 使用的原料面积 |
| | | */ |
| | | private Double rawStockArea; |
| | | private double rawStockArea; |
| | | |
| | | /** |
| | | * 平均切裁率 |
| | | */ |
| | | private Double avgCutPct; |
| | | private double avgCutPct; |
| | | |
| | | /** |
| | | * 有效切裁率 |
| | | */ |
| | | private Double validCutPct; |
| | | private double validCutPct; |
| | | |
| | | /** |
| | | * 尾片切裁率 |
| | | */ |
| | | private Double lastCutPct; |
| | | private double lastCutPct; |
| | | |
| | | /** |
| | | * g混排程度 |
| | |
| | | /** |
| | | * g上片宽 |
| | | */ |
| | | private Double loadWidth; |
| | | private double loadWidth; |
| | | |
| | | /** |
| | | * g上片长 |
| | | */ |
| | | private Double loadLength; |
| | | private double loadLength; |
| | | |
| | | /** |
| | | * x间隔 |
| | | */ |
| | | private Double xSpace; |
| | | private double xSpace; |
| | | |
| | | /** |
| | | * y间隔 |
| | | */ |
| | | private Double ySpace; |
| | | private double ySpace; |
| | | |
| | | /** |
| | | * g平均装载率 |
| | | */ |
| | | private Double loadRate; |
| | | private double loadRate; |
| | | |
| | | /** |
| | | * 流程卡集合 |
| | |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Double width; |
| | | private double width; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 形状 |
| | |
| | | /** |
| | | * 次破面积 |
| | | */ |
| | | private Double patchArea; |
| | | private double patchArea; |
| | | |
| | | /** |
| | | * 质检员 |
| | |
| | | * 高 |
| | | */ |
| | | @ApiModelProperty(value = "高", position = 7) |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | @ApiModelProperty(value = "厚度", position = 8) |
| | | private Double thickness; |
| | | private double thickness; |
| | | |
| | | /** |
| | | * 膜系 |
| | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Double width; |
| | | private double width; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | private Double thickness; |
| | | private double thickness; |
| | | |
| | | /** |
| | | * 原片版图片序 |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.List; |
| | |
| | | * @return |
| | | */ |
| | | private String saveRoleMenu(Long roleId, List<SysMenu> menuList) { |
| | | log.info("配置角色菜单关心"); |
| | | log.info("配置角色菜单关系"); |
| | | if (CollectionUtils.isEmpty(menuList)) { |
| | | // 先删除原来的记录,再保存新的 |
| | | sysRoleMenuService.remove(new LambdaQueryWrapper<SysRoleMenu>().eq(SysRoleMenu::getRoleId, roleId)); |
| | | // 删除缓存 |
| | | sysUserService.clearUserAuthorityInfoByRoleId(roleId); |
| | | return "success"; |
| | | } |
| | | List<SysRoleMenu> roleMenuList = menuList.stream().map(menu -> { |
| | | SysRoleMenu roleMenu = new SysRoleMenu(); |
| | | roleMenu.setRoleId(roleId); |
| | |
| | | return roleMenu; |
| | | }).collect(Collectors.toList()); |
| | | log.info("清空角色权限表中该角色信息"); |
| | | |
| | | |
| | | // 先删除原来的记录,再保存新的 |
| | | sysRoleMenuService.remove(new LambdaQueryWrapper<SysRoleMenu>().eq(SysRoleMenu::getRoleId, roleId)); |
| | | sysRoleMenuService.saveBatch(roleMenuList); |
| | | |
| | | // 删除缓存 |
| | | sysUserService.clearUserAuthorityInfoByRoleId(roleId); |
| | | return "success"; |
| | |
| | | <artifactId>junit</artifactId> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.microsoft.sqlserver</groupId> |
| | | <artifactId>sqljdbc4</artifactId> |
| | | <version>4.0</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.samba.jcifs</groupId> |
| | | <artifactId>jcifs</artifactId> |
| | |
| | | /** |
| | | * 启用状态 |
| | | */ |
| | | private String enableState; |
| | | private Integer enableState; |
| | | |
| | | /** |
| | | * 剩余 |
| | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Double width; |
| | | private double width; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | private Double thickness; |
| | | private double thickness; |
| | | |
| | | /** |
| | | * 磨前宽 |
| | | */ |
| | | private Double edgWidth; |
| | | private double edgWidth; |
| | | |
| | | /** |
| | | * 磨前高 |
| | | */ |
| | | private Double edgHeight; |
| | | private double edgHeight; |
| | | |
| | | /** |
| | | * 钢化版图id |
| | |
| | | |
| | | /** |
| | | * 查询笼内离指定格子最近空格 |
| | | * flag :是否为直通 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | * @return |
| | | */ |
| | | public GlassInfo queryAndChangeGlass(String glassId) { |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId) |
| | | .inSql(GlassInfo::getEngineerId, "select engineer_id from engineering where state = 1")); |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | // .inSql(GlassInfo::getEngineerId, "select engineer_id from engineering where state = 1")); |
| | | Assert.isFalse(null == glassInfo, "玻璃信息不存在"); |
| | | //按照玻璃尺寸 |
| | | LambdaQueryWrapper<GlassInfo> queryWrapper = new LambdaQueryWrapper<GlassInfo>() |
| | |
| | | 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"); |
| | | .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) { |
| | | 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 glass_info) t1 " + |
| | |
| | | //todo: 获取正在执行的工程信息 |
| | | if (StringUtils.isNotBlank(glassId)) { |
| | | GlassInfo one = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getGlassId, glassId) |
| | | .inSql(GlassInfo::getEngineerId, "select engineer_id from engineering where state = 1")); |
| | | .eq(GlassInfo::getGlassId, glassId)); |
| | | // .inSql(GlassInfo::getEngineerId, "select engineer_id from engineering where state = 1")); |
| | | EdgStorageCageDetails resultDetails = new EdgStorageCageDetails(); |
| | | BeanUtils.copyProperties(one, resultDetails); |
| | | glassList.add(resultDetails); |
| | |
| | | * @param width |
| | | * @param height |
| | | */ |
| | | private EdgStorageCageDetails queryMinGlass(Double width, Double height, String glassId) { |
| | | private EdgStorageCageDetails queryMinGlass(double width, double height, String glassId) { |
| | | //获取表内版图id最小的玻璃信息 |
| | | EdgStorageCageDetails glassDetails = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getState, 100) |
| | |
| | | return glassDetails; |
| | | } |
| | | GlassInfo one = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getGlassId, glassId) |
| | | .inSql(GlassInfo::getEngineerId, "select engineer_id from engineering where state = 1") |
| | | .eq(GlassInfo::getGlassId, glassId) |
| | | // .inSql(GlassInfo::getEngineerId, "select engineer_id from engineering where state = 1") |
| | | ); |
| | | EdgStorageCageDetails resultDetails = new EdgStorageCageDetails(); |
| | | BeanUtils.copyProperties(one, resultDetails); |
| | |
| | | return null; |
| | | } |
| | | return edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>().eq(EdgStorageCageDetails::getGlassId, taskCache.getGlassId()) |
| | | .inSql(EdgStorageCageDetails::getEngineerId, "select engineer_id from engineering where state = 1").last(" limit 1 ")); |
| | | // .inSql(EdgStorageCageDetails::getEngineerId, "select engineer_id from engineering where state = 1") |
| | | .last(" limit 1 ")); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | private Integer queryLineByGlassInfo(EdgStorageCageDetails a08EdgStorageCageDetails, EdgStorageCageDetails a10EdgStorageCageDetails, |
| | | EdgStorageCageDetails glassInfo, int out08Glassstate, int out10Glassstate) { |
| | | boolean b08 = a08EdgStorageCageDetails != null && a08EdgStorageCageDetails.getHeight().equals(glassInfo.getHeight()) |
| | | && a08EdgStorageCageDetails.getWidth().equals(glassInfo.getWidth()); |
| | | boolean b10 = a10EdgStorageCageDetails != null && a10EdgStorageCageDetails.getHeight().equals(glassInfo.getHeight()) |
| | | && a10EdgStorageCageDetails.getWidth().equals(glassInfo.getWidth()); |
| | | boolean b08 = a08EdgStorageCageDetails != null && a08EdgStorageCageDetails.getHeight() == glassInfo.getHeight() |
| | | && a08EdgStorageCageDetails.getWidth() == glassInfo.getWidth(); |
| | | boolean b10 = a10EdgStorageCageDetails != null && a10EdgStorageCageDetails.getHeight() == glassInfo.getHeight() |
| | | && a10EdgStorageCageDetails.getWidth() == glassInfo.getWidth(); |
| | | //存在出片任务 07为空 |
| | | if (b10) { |
| | | return out10Glassstate == 2 ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | |
| | | //获取宽高拍第一的玻璃信息 |
| | | EdgStorageCageDetails firstSize = list.get(0); |
| | | Integer firstCount = firstSize.getCount(); |
| | | Double firstWidth = firstSize.getWidth(); |
| | | Double firstHeight = firstSize.getHeight(); |
| | | double firstWidth = firstSize.getWidth(); |
| | | double firstHeight = firstSize.getHeight(); |
| | | if (list.size() == 1) { |
| | | return queryMinGlass(firstWidth, firstHeight, glassId); |
| | | } |
| | | //获取宽高拍第二的玻璃信息 |
| | | EdgStorageCageDetails secondSize = list.get(1); |
| | | Integer secondCount = secondSize.getCount(); |
| | | Double secondWidth = secondSize.getWidth(); |
| | | Double secondHeight = secondSize.getHeight(); |
| | | double secondWidth = secondSize.getWidth(); |
| | | double secondHeight = secondSize.getHeight(); |
| | | //获取数量前2的玻璃数量比例 |
| | | Integer mix = firstCount / secondCount; |
| | | log.info("获取玻璃数量前2的玻璃占比为:{}", mix); |
| | |
| | | EdgStorageCageDetails outGlassInfo = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getGlassId, taskCache.getGlassId())); |
| | | log.info("{}线有出片任务信息,任务信息为{},玻璃信息为{}", endcell, taskCache, outGlassInfo); |
| | | if (outGlassInfo.getWidth().equals(firstWidth) && outGlassInfo.getHeight().equals(firstHeight)) { |
| | | if (outGlassInfo.getWidth() == firstWidth && outGlassInfo.getHeight() == firstHeight) { |
| | | log.info("数量最多的宽{}高{}和{}线任务的宽{}高{}相同,出数量排第二的玻璃,宽{}高{}", |
| | | firstWidth, firstHeight, endcell, outGlassInfo.getWidth(), outGlassInfo.getHeight(), secondWidth, secondHeight); |
| | | return queryMinGlass(secondWidth, secondHeight, glassId); |
| | |
| | | * @return |
| | | */ |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void currentCutTerritory(){ |
| | | public void currentCutTerritory() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | List<Map<String, Object>> currentCutTerritorys = edgStorageCageDetailsService.selectCutTerritory(); |
| | | jsonObject.append("currentCutTerritory", currentCutTerritorys); |
| | |
| | | * @return |
| | | */ |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void selectEdgTask(){ |
| | | public void selectEdgTask() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | List<Map<String,Object>> EdgTasks1 = taskCacheService.selectEdgInfo("2001"); |
| | | List<Map<String,Object>> EdgTasks2 = taskCacheService.selectEdgInfo("2002"); |
| | | List<Map<String, Object>> EdgTasks1 = taskCacheService.selectEdgInfo("2001"); |
| | | List<Map<String, Object>> EdgTasks2 = taskCacheService.selectEdgInfo("2002"); |
| | | jsonObject.append("EdgTasks1", EdgTasks1); |
| | | jsonObject.append("EdgTasks2", EdgTasks2); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cacheGlass"); |
| | |
| | | * @return |
| | | */ |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void selectEdgStorageCage(){ |
| | | public void selectEdgStorageCage() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | List<Map<String, Object>> EdgStorageCageinfos=edgStorageCageService.selectEdgStorageCages(); |
| | | List<Map<String, Object>> EdgStorageCageinfos = edgStorageCageService.selectEdgStorageCages(); |
| | | jsonObject.append("EdgStorageCageinfos", EdgStorageCageinfos); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cacheGlass"); |
| | | if (sendwServer != null) { |
| | |
| | | <artifactId>junit</artifactId> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.microsoft.sqlserver</groupId> |
| | | <artifactId>sqljdbc4</artifactId> |
| | | <version>4.0</version> |
| | | </dependency> |
| | | </dependencies> |
| | | <properties> |
| | | <maven.compiler.source>8</maven.compiler.source> |
| | |
| | | package com.mes.bigstorage.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @ApiOperation("玻璃详情查询") |
| | | @PostMapping("/selectBigStorageCageDetails") |
| | | public Result selectBigStorageCageDetails(String glassId) { |
| | | BigStorageCageDetails bigStorageCageDetails=bigStorageCageDetailsService.selectBigStorageCageDetails(glassId); |
| | | public Result selectBigStorageCageDetails(@RequestBody Map map) { |
| | | List<BigStorageCageDetails> bigStorageCageDetails=bigStorageCageDetailsService.selectBigStorageCageDetails(map.get("glassId").toString()); |
| | | return Result.build(200,"查询成功",bigStorageCageDetails); |
| | | } |
| | | |
| | | @ApiOperation("理片笼详情添加") |
| | | @PostMapping("/insertBigStorageCageDetails") |
| | | public Result insertBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | public Result insertBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | bigStorageCageDetailsService.insertBigStorageCageDetails(bigStorageCageDetails); |
| | | return Result.build(200,"添加成功",1); |
| | | } |
| | | |
| | | @ApiOperation("理片笼详情删除") |
| | | @PostMapping("/deleteBigStorageCageDetails") |
| | | public Result deleteBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | public Result deleteBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | bigStorageCageDetailsService.deleteBigStorageCageDetails(bigStorageCageDetails); |
| | | return Result.build(200,"删除成功",1); |
| | | } |
| | | |
| | | @ApiOperation("理片笼任务破损0/拿走1") |
| | | @PostMapping("/damageBigStorageCageDetails") |
| | | public Result damageBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails,int status) { |
| | | public Result damageBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails,int status) { |
| | | bigStorageCageDetailsService.damageBigStorageCageDetails(bigStorageCageDetails.getGlassId(),status); |
| | | return Result.build(200,"破损成功",1); |
| | | return Result.build(200,"破损/拿走成功",1); |
| | | } |
| | | |
| | | @ApiOperation("理片笼任务完成") |
| | | @PostMapping("/finishBigStorageCageDetails") |
| | | public Result finishBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | public Result finishBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | bigStorageCageDetailsService.finishBigStorageCageDetails(bigStorageCageDetails); |
| | | return Result.build(200,"破损成功",1); |
| | | return Result.build(200,"任务完成成功",1); |
| | | } |
| | | |
| | | @ApiOperation("理片笼任务出片") |
| | | @PostMapping("/outBigStorageCageDetails") |
| | | public Result outBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | public Result outBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | |
| | | bigStorageCageDetailsService.outBigStorageCageDetails(bigStorageCageDetails); |
| | | return Result.build(200,"破损成功",1); |
| | | return Result.build(200,"出片添加成功",1); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | * 高 |
| | | */ |
| | | @ApiModelProperty(value = "高", position = 10) |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | @ApiModelProperty(value = "厚度", position = 11) |
| | | private Double thickness; |
| | | private double thickness; |
| | | |
| | | /** |
| | | * 钢化版图id |
| | |
| | | |
| | | void damageBigStorageCageDetails(String glassId,int status); |
| | | |
| | | BigStorageCageDetails selectBigStorageCageDetails(String glassId); |
| | | List<BigStorageCageDetails> selectBigStorageCageDetails(String glassId); |
| | | |
| | | void insertBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails); |
| | | |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | @Value("${mes.minCount}") |
| | | private int minCount; |
| | | |
| | | @Value("${mes.carWidth}") |
| | | private Integer carWidth; |
| | | |
| | | @Value("${mes.slotWidth}") |
| | | private Integer slotWidth; |
| | | |
| | | @Value("${mes.carMaxSize}") |
| | | private Integer carMaxSize; |
| | | |
| | | @Value("${mes.galssGap}") |
| | | private Integer galssGap; |
| | |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = baseMapper.selectList(feedWrapper); |
| | | |
| | | LambdaQueryWrapper<BigStorageCageFeedTask> feedTaskWrapper = new LambdaQueryWrapper<>(); |
| | | feedTaskWrapper.lt(BigStorageCageFeedTask::getTaskState,Const.BIG_STORAGE_IN_SLOT); |
| | | feedTaskWrapper.lt(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_SLOT); |
| | | List<BigStorageCageFeedTask> bigStorageCageFeedTaskList = bigStorageCageFeedTaskMapper.selectList(feedTaskWrapper); |
| | | |
| | | Map<String, BigStorageCageFeedTask> listMap = bigStorageCageFeedTaskList.stream() |
| | |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = baseMapper.selectList(outWrapper); |
| | | |
| | | LambdaQueryWrapper<BigStorageCageOutTask> outTaskWrapper = new LambdaQueryWrapper<>(); |
| | | outTaskWrapper.lt(BigStorageCageOutTask::getTaskState,Const.BIG_STORAGE_OUT_SUCCESS); |
| | | outTaskWrapper.lt(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_SUCCESS); |
| | | List<BigStorageCageOutTask> bigStorageCageOutTaskList = bigStorageCageOutTaskMapper.selectList(outTaskWrapper); |
| | | |
| | | Map<String, BigStorageCageOutTask> listMap = bigStorageCageOutTaskList.stream() |
| | |
| | | for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList |
| | | ) { |
| | | if (bigStorageCageDetails.getBigStorageCageFeedTask().getTaskState() == 0) { |
| | | carWidth -= Integer.parseInt(bigStorageCageDetails.getWidth().toString()) + galssGap; |
| | | carWidth = carWidth - bigStorageCageDetails.getWidth() - galssGap; |
| | | } |
| | | } |
| | | return carWidth; |
| | |
| | | |
| | | //理片笼详情破损 |
| | | @Override |
| | | public void damageBigStorageCageDetails(String glassId,int status) { |
| | | public void damageBigStorageCageDetails(String glassId, int status) { |
| | | |
| | | LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoWrapper = new LambdaQueryWrapper<>(); |
| | | temperingGlassInfoWrapper.eq(TemperingGlassInfo::getGlassId, glassId); |
| | |
| | | bigStorageCageDetailsWrapper.eq(BigStorageCageDetails::getGlassId, glassId); |
| | | BigStorageCageDetails bigStorageCageDetails = baseMapper.selectOne(bigStorageCageDetailsWrapper); |
| | | |
| | | if(temperingGlassInfo!=null){ |
| | | if(status==0){ |
| | | if (temperingGlassInfo != null) { |
| | | if (status == 0) { |
| | | temperingGlassInfo.setState(Const.TEMPERING_DAMAGE); |
| | | }else{ |
| | | } else { |
| | | temperingGlassInfo.setState(Const.TEMPERING_TAKE); |
| | | } |
| | | temperingGlassInfoMapper.updateById(temperingGlassInfo); |
| | | } |
| | | baseMapper.deleteById(bigStorageCageDetails.getId()); |
| | | bigStorageCageDetails.setState(Const.BIG_STORAGE_OUTSIDE); |
| | | baseMapper.updateById(bigStorageCageDetails); |
| | | bigStorageCageService.updateRemainWidth(bigStorageCageDetails.getSlot()); |
| | | //todo:插入破损数据 |
| | | |
| | |
| | | |
| | | //查询玻璃信息 |
| | | @Override |
| | | public BigStorageCageDetails selectBigStorageCageDetails(String glassId) { |
| | | public List<BigStorageCageDetails> selectBigStorageCageDetails(String glassId) { |
| | | LambdaQueryWrapper<GlassInfo> glassInfoWrapper = new LambdaQueryWrapper<>(); |
| | | glassInfoWrapper.eq(GlassInfo::getGlassId, glassId); |
| | | GlassInfo glassInfo = glassInfoMapper.selectOne(glassInfoWrapper); |
| | | BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails(); |
| | | BeanUtils.copyProperties(glassInfo, bigStorageCageDetails); |
| | | bigStorageCageDetails.setState(0); |
| | | bigStorageCageDetails.setGap(galssGap); |
| | | return bigStorageCageDetails; |
| | | if (glassInfo != null) { |
| | | BeanUtils.copyProperties(glassInfo, bigStorageCageDetails); |
| | | bigStorageCageDetails.setState(0); |
| | | bigStorageCageDetails.setGap(galssGap); |
| | | } |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = new ArrayList<>(); |
| | | bigStorageCageDetailsList.add(bigStorageCageDetails); |
| | | return bigStorageCageDetailsList; |
| | | } |
| | | |
| | | //理片笼详情添加 |
| | |
| | | //理片笼详情完成 |
| | | @Override |
| | | public void finishBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | if (bigStorageCageDetails.getBigStorageCageFeedTask()!=null) { |
| | | if (bigStorageCageDetails.getBigStorageCageFeedTask() != null) { |
| | | bigStorageCageDetails.setState(Const.BIG_STORAGE_INSIDE); |
| | | baseMapper.updateById(bigStorageCageDetails); |
| | | } else { |
| | |
| | | MPJLambdaWrapper<BigStorageCage> wrapper = new MPJLambdaWrapper<>(BigStorageCage.class) |
| | | .selectAll(BigStorageCage.class) |
| | | .leftJoin(BigStorageCageDetails.class, BigStorageCageDetails::getSlot, BigStorageCage::getSlot) |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .eq(BigStorageCageDetails::getTemperingLayoutId, glassInfo.getTemperingLayoutId()) |
| | | .gt(BigStorageCage::getRemainWidth, glassInfo.getWidth()) |
| | | .last("limit 1"); |
| | |
| | | return bigStorageDTO; |
| | | } |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .inSql(BigStorageCage::getDeviceId, |
| | | "select distinct device_id from big_storage_cage_details where tempering_layout_id = " + glassInfo.getTemperingLayoutId()) |
| | |
| | | } |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .last("limit 1")); |
| | | Assert.isTrue(null != bigStorageCage, "没有空余的笼子存放玻璃"); |
| | | bigStorageDTO = new BigStorageDTO(); |
| | |
| | | public List<BigStorageCage> querybigStorageCageDetail(int deviceId) { |
| | | LambdaQueryWrapper<BigStorageCage> bigStorageCageWrapper =new LambdaQueryWrapper<>(); |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper =new LambdaQueryWrapper<>(); |
| | | bigStorageCageDetailsWrapper.lt(BigStorageCageDetails::getState, Const.BIG_STORAGE_OUTSIDE); |
| | | if(deviceId!=0){ |
| | | bigStorageCageWrapper.eq(BigStorageCage::getDeviceId,deviceId); |
| | | bigStorageCageDetailsWrapper.eq(BigStorageCageDetails::getDeviceId,deviceId); |
| | |
| | | * 目标位置 |
| | | */ |
| | | @ApiModelProperty(value = "目标位置", position = 4) |
| | | private Integer targetSlot; |
| | | private int targetSlot; |
| | | |
| | | /** |
| | | * 玻璃类型 |
| | |
| | | * 线路 |
| | | */ |
| | | @ApiModelProperty(value = "线路", position = 7) |
| | | private Integer line; |
| | | private int line; |
| | | /** |
| | | * 宽度 |
| | | */ |
| | |
| | | package com.mes.bigstoragetask.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.bigstorage.entity.BigStorageDTO; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.bigstorage.entity.BigStorageDTO; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-16 |
| | | */ |
| | | @DS("salve_hangzhoumes") |
| | | @DS("salve_hangzhoumes_1") |
| | | public interface BigStorageCageFeedTaskMapper extends MPJBaseMapper<BigStorageCageFeedTask> { |
| | | |
| | | List<Integer> querySitToUpGlass(); |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-16 |
| | | */ |
| | | @DS("salve_hangzhoumes") |
| | | @DS("salve_hangzhoumes_1") |
| | | public interface BigStorageCageOutTaskMapper extends BaseMapper<BigStorageCageOutTask> { |
| | | |
| | | boolean saveBatch(@Param(value = "list") List<BigStorageCageOutTask> list); |
| | |
| | | public class S7object extends Thread { |
| | | public S7control plccontrol; // PLC通讯类实例 |
| | | private EPlcType plcType = EPlcType.S1200; // 西门子PLC类型 |
| | | private String ip = "192.168.10.1"; // plc ip地址 |
| | | private String ip = "192.168.20.2"; // plc ip地址 |
| | | private int port = 102; // plc 端口号 |
| | | |
| | | |
| | |
| | | if (plccontrol == null) { |
| | | plccontrol = new S7control(plcType, ip, port, 0, 0); |
| | | |
| | | String PlcLoadGlass=S7object.class.getResource("/JsonFile/PlcCacheVerticalGlass.json").getPath(); |
| | | String PlcLoadGlass = S7object.class.getResource("/JsonFile/PlcCacheVerticalGlass.json").getPath(); |
| | | //log.info(PLCAutoMes.class.getResource("").getPath()); |
| | | PlcMesObject = InitUtil.initword(PlcLoadGlass); |
| | | } |
| | |
| | | } |
| | | |
| | | byte[] getplcvlues = plccontrol.readByte(PlcMesObject.getPlcAddressBegin(), PlcMesObject.getPlcAddressLength()); |
| | | PlcMesObject.setPlcParameterList(getplcvlues); |
| | | |
| | | if (getplcvlues != null) { |
| | | PlcMesObject.setPlcParameterList(getplcvlues); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | @Scheduled(fixedDelay = 5000) |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void plcStorageCageTask() throws InterruptedException { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | try { |
| | |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import com.mes.tools.S7control; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Value("${mes.slotWidth}") |
| | | private Integer slotWidth; |
| | | |
| | | @Value("${mes.carMaxSize}") |
| | | private Integer carMaxSize; |
| | | @Value("${mes.inCarMaxSize}") |
| | | private Integer inCarMaxSize; |
| | | |
| | | @Value("${mes.outCarMaxSize}") |
| | | private Integer outCarMaxSize; |
| | | |
| | | @Value("${mes.galssGap}") |
| | | private Integer galssGap; |
| | |
| | | @Scheduled(fixedDelay = 5000) |
| | | public void plcToHomeEdgScan() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String d01Request = plcParameterObject.getPlcParameter("D01Request").getValue(); |
| | | String d01Id = plcParameterObject.getPlcParameter("D01ID1").getValue(); |
| | | String d02SitState = plcParameterObject.getPlcParameter("D02SitState").getValue(); |
| | | String d04Request = plcParameterObject.getPlcParameter("D04Request").getValue(); |
| | | String d04Id = plcParameterObject.getPlcParameter("D04ID1").getValue(); |
| | | String d05SitState = plcParameterObject.getPlcParameter("D05SitState").getValue(); |
| | | String d01Id = plcParameterObject.getPlcParameter("D01ID").getValue(); |
| | | String d04Id = plcParameterObject.getPlcParameter("D04ID").getValue(); |
| | | String d03State = plcParameterObject.getPlcParameter("D03State").getValue(); |
| | | String d05State = plcParameterObject.getPlcParameter("D05State").getValue(); |
| | | String mesD03Address = plcParameterObject.getPlcParameter("MESToD03").getAddress(); |
| | | String mesD05Address = plcParameterObject.getPlcParameter("MESToD05").getAddress(); |
| | | |
| | | log.info("1、获取到的请求字d01为:{},获取到的扫描ID为:{};获取到的请求字d04为:{},获取到的扫描ID为:{};", |
| | | d01Request, d01Id, d04Request, d04Id); |
| | | if (!REQUEST_WORD.equals(d01Request) && !REQUEST_WORD.equals(d04Request)) { |
| | | |
| | | log.info("1、获取d01Id扫描ID为:{};获取d04Id扫描ID为:{};", d01Id, d04Id); |
| | | if (StringUtils.isBlank(d01Id) && StringUtils.isBlank(d04Id)) { |
| | | log.info("两条线未收到进片任务,结束本次扫描进卧转立任务"); |
| | | return; |
| | | } |
| | | if (REQUEST_WORD.equals(d02SitState) && REQUEST_WORD.equals(d05SitState)) { |
| | | if (REQUEST_WORD.equals(d03State) && REQUEST_WORD.equals(d05State)) { |
| | | log.info("两条线卧转立均在执行任务,结束本次扫描进卧转立任务"); |
| | | return; |
| | | } |
| | | Boolean flag01 = Boolean.FALSE; |
| | | Boolean flag04 = Boolean.FALSE; |
| | | // Boolean flag01 = Boolean.FALSE; |
| | | // Boolean flag04 = Boolean.FALSE; |
| | | //按照线路及玻璃id获取相邻两块玻璃 卧转立上的玻璃 |
| | | if (REQUEST_WORD.equals(d01Request) && !REQUEST_WORD.equals(d02SitState)) { |
| | | flag01 = judgeGlassTypeStatus(d01Id, Const.A09_OUT_TARGET_POSITION); |
| | | if (StringUtils.isNotBlank(d01Id) && !REQUEST_WORD.equals(d03State)) { |
| | | judgeGlassTypeStatus(d01Id, Const.A09_OUT_TARGET_POSITION, mesD03Address); |
| | | } |
| | | if (REQUEST_WORD.equals(d04Request) && !REQUEST_WORD.equals(d05SitState)) { |
| | | flag04 = judgeGlassTypeStatus(d04Id, Const.A10_OUT_TARGET_POSITION); |
| | | if (StringUtils.isNotBlank(d04Id) && !REQUEST_WORD.equals(d05State)) { |
| | | judgeGlassTypeStatus(d04Id, Const.A10_OUT_TARGET_POSITION, mesD05Address); |
| | | } |
| | | if (flag01 && flag04) { |
| | | //比较最早一片任务的版图id及版序 求出卧转立的线路 |
| | | Integer startLine = getStartLine(); |
| | | //计算目标格子,发送启动任务 |
| | | computeTargetByLine(startLine); |
| | | } else if (flag01 || flag04) { |
| | | Integer startLine = flag01.equals(Boolean.TRUE) ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | //计算目标格子,发送启动任务 |
| | | computeTargetByLine(startLine); |
| | | } else { |
| | | log.info("两条线未收到进片任务,结束本次扫描进卧转立任务"); |
| | | } |
| | | log.info("结束扫码任务"); |
| | | // if (flag01 && flag04) { |
| | | // //比较最早一片任务的版图id及版序 求出卧转立的线路 |
| | | // Integer startLine = getStartLine(); |
| | | // //计算目标格子,发送启动任务 |
| | | // computeTargetByLine(startLine); |
| | | // } else if (flag01 || flag04) { |
| | | // Integer startLine = flag01.equals(Boolean.TRUE) ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | // //计算目标格子,发送启动任务 |
| | | // computeTargetByLine(startLine); |
| | | // } else { |
| | | // log.info("两条线未收到进片任务,结束本次扫描进卧转立任务"); |
| | | // } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 5000) |
| | | public void plcToHomeEdgFreeCarTask() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String e01Status = plcParameterObject.getPlcParameter("E01Status").getValue(); |
| | | String e01Status = plcParameterObject.getPlcParameter("E01State").getValue(); |
| | | if (REQUEST_WORD.equals(e01Status)) { |
| | | log.info("进片大车非空闲"); |
| | | return; |
| | | } |
| | | String d01Request = plcParameterObject.getPlcParameter("D01Request").getValue(); |
| | | String d01Id = plcParameterObject.getPlcParameter("D01ID1").getValue(); |
| | | String d04Request = plcParameterObject.getPlcParameter("D04Request").getValue(); |
| | | String d04Id = plcParameterObject.getPlcParameter("D04ID1").getValue(); |
| | | log.info("1、获取到的请求字d01为:{},获取到的扫描ID为:{};获取到的请求字d04为:{},获取到的扫描ID为:{};", |
| | | d01Request, d01Id, d04Request, d04Id); |
| | | //两条线都有进卧转立任务,直接结束 |
| | | if (Const.BIG_STORAGE_REQUEST_IN.equals(d01Request) |
| | | && Const.BIG_STORAGE_REQUEST_IN.equals(d04Request)) { |
| | | log.info("两条线都存在进片任务,结束任务"); |
| | | return; |
| | | List<BigStorageCageFeedTask> feedTaskList = bigStorageCageFeedTaskService.list(new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | .eq(BigStorageCageFeedTask::getTaskType, Const.BIG_STORAGE_IN_RUN) |
| | | .eq(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_UP)); |
| | | if (CollectionUtils.isNotEmpty(feedTaskList)) { |
| | | if (feedTaskList.size() == 1) { |
| | | computeTargetByLine(feedTaskList.get(0).getLine()); |
| | | return; |
| | | } else { |
| | | //比较最早一片任务的版图id及版序 求出卧转立的线路 |
| | | Integer startLine = getStartLine(); |
| | | // //计算目标格子,发送启动任务 |
| | | computeTargetByLine(startLine); |
| | | return; |
| | | } |
| | | } |
| | | String d01Id = plcParameterObject.getPlcParameter("D01ID").getValue(); |
| | | String d04Id = plcParameterObject.getPlcParameter("D04ID").getValue(); |
| | | log.info("1、获取d01Id扫描ID为:{};获取d04Id扫描ID为:{};", d01Id, d04Id); |
| | | //两条线都有进卧转立任务,直接结束 |
| | | // if (StringUtils.isNotBlank(d01Id) && StringUtils.isNotBlank(d04Id)) { |
| | | // log.info("两条线都存在进片任务,结束任务"); |
| | | // return; |
| | | // } |
| | | //获取两条线卧转立是否有玻璃,且任务状态都为2 |
| | | List<Integer> lineList = bigStorageCageFeedTaskService.querySitToUpGlass(); |
| | | if (CollectionUtils.isEmpty(lineList)) { |
| | |
| | | } |
| | | Integer lineFirst = lineList.get(0); |
| | | String lineGlassId = lineFirst.equals(Const.A09_OUT_TARGET_POSITION) ? d01Id : d04Id; |
| | | //仅有一条先符合启动启动条件 |
| | | if (lineList.size() == 1) { |
| | | //计算任务表进片格子 发送进片任务 |
| | | //如果进片请求但玻璃为空,计算任务表进片格子 发送进片任务 |
| | | if (StringUtils.isEmpty(lineGlassId)) { |
| | | computeTargetByLine(lineFirst); |
| | | } else { |
| | | //todo:计算扫描到的玻璃是否可以存进卧转立 |
| | | //获取卧转立剩余宽度 |
| | | if (computeIsRun(lineFirst, lineGlassId)) { |
| | | computeTargetByLine(lineFirst); |
| | | } |
| | | } |
| | | return; |
| | | } |
| | | //两条先均可执行进片任务,判断两条线是否进片请求是否都为空 |
| | | if (StringUtils.isBlank(d01Id) && StringUtils.isBlank(d04Id)) { |
| | | //比较最早一片任务的版图id及版序 求出卧转立的线路 |
| | | Integer line = getStartLine(); |
| | | //计算任务表进片格子 发送进片任务 |
| | | computeTargetByLine(line); |
| | | return; |
| | | } else if (StringUtils.isNotBlank(d01Id) && StringUtils.isNotBlank(d04Id)) { |
| | | // todo:两个都有进片玻璃 |
| | | if (computeIsRun(Const.A09_OUT_TARGET_POSITION, d01Id) && computeIsRun(Const.A10_OUT_TARGET_POSITION, d04Id)) { |
| | | //比较最早一片任务的版图id及版序 求出卧转立的线路 |
| | | Integer line = getStartLine(); |
| | | //计算任务表进片格子 发送进片任务 |
| | | computeTargetByLine(line); |
| | | } else if (computeIsRun(Const.A09_OUT_TARGET_POSITION, d01Id)) { |
| | | computeTargetByLine(Const.A09_OUT_TARGET_POSITION); |
| | | } else if (computeIsRun(Const.A10_OUT_TARGET_POSITION, d04Id)) { |
| | | computeTargetByLine(Const.A10_OUT_TARGET_POSITION); |
| | | } else { |
| | | return; |
| | | } |
| | | } else { |
| | | //,或者仅有一条有玻璃 |
| | | //一条线为空,一条线有进片请求有玻璃 |
| | | int outLine = StringUtils.isBlank(d01Id) ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | //获取进片请求玻璃为空的,计算任务表进片格子 发送进片任务 |
| | | computeTargetByLine(outLine); |
| | | } |
| | | int outLine = StringUtils.isBlank(d01Id) ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | //计算任务表进片格子 发送进片任务 |
| | | computeTargetByLine(outLine); |
| | | |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 5000) |
| | | // @Scheduled(fixedDelay = 5000) |
| | | public void plcToHomeEdgOutTask() { |
| | | |
| | | List<BigStorageCageOutTask> outingList = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>().eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_NEW)); |
| | |
| | | .orderBy(Boolean.TRUE, sequenceOrder, TemperingGlassInfo::getTemperingFeedSequence)); |
| | | if (CollectionUtils.isNotEmpty(temperingGlassInfoList)) { |
| | | log.info("有正在出片的钢化任务"); |
| | | computeOutGlassInfo(temperingGlassInfoList); |
| | | computeOutGlassInfo(temperingGlassInfoList, Boolean.TRUE); |
| | | return; |
| | | } |
| | | //是否有人工下片任务 有直接出 |
| | | List<BigStorageCageDetails> artificialList = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_ARTIFICIAL).orderByDesc(BigStorageCageDetails::getWidth)); |
| | | if (CollectionUtils.isNotEmpty(artificialList)) { |
| | | computeOutGlassInfo(temperingGlassInfoList); |
| | | computeOutGlassInfo(temperingGlassInfoList, Boolean.FALSE); |
| | | return; |
| | | } |
| | | //钢化优先:获取理片笼 玻璃小片 破损表 数量 判断笼内版图是否到齐 |
| | |
| | | .eq(GlassInfo::getTemperingLayoutId, temperingLayoutDTO.getTemperingLayoutId()) |
| | | .eq(GlassInfo::getEngineerId, temperingLayoutDTO.getEngineerId())); |
| | | temperingGlassInfoService.saveBatch(temperingGlassInfos); |
| | | computeOutGlassInfo(temperingGlassInfoList); |
| | | computeOutGlassInfo(temperingGlassInfoList, Boolean.TRUE); |
| | | return; |
| | | } |
| | | //未到齐 执行内部调度任务 |
| | |
| | | /** |
| | | * 按照玻璃id判断玻璃状态及卧转立是否可直接启动 |
| | | */ |
| | | public Boolean judgeGlassTypeStatus(String glassId, Integer line) { |
| | | public Boolean judgeGlassTypeStatus(String glassId, Integer line, String mesAddress) { |
| | | //1、获取任务表中相邻玻璃 |
| | | List<EdgGlassTaskInfo> edgGlassTaskInfoList = edgGlassTaskInfoService.list(new LambdaQueryWrapper<EdgGlassTaskInfo>() |
| | | .eq(EdgGlassTaskInfo::getLine, line) |
| | |
| | | remainWidth = sitToUpRemainWidth.getWidth(); |
| | | glassCount = sitToUpRemainWidth.getGlassCount(); |
| | | } |
| | | |
| | | Boolean flag = Boolean.TRUE; |
| | | //2、获取卧转立 |
| | | Integer widthFirst = edgGlassTaskInfoList.get(0).getWidth(); |
| | | if (edgGlassTaskInfoList.size() == 1) { |
| | | if (remainWidth >= widthFirst) { |
| | | if (glassCount <= 5) { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthFirst); |
| | | return Boolean.FALSE; |
| | | } else { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst); |
| | | return Boolean.TRUE; |
| | | } |
| | | } else { |
| | | flag = Boolean.FALSE; |
| | | } |
| | | } else { |
| | | Integer widthSecond = edgGlassTaskInfoList.get(1).getWidth(); |
| | | if (remainWidth >= widthFirst) { |
| | | if (remainWidth - widthFirst - galssGap >= widthSecond) { |
| | | if (glassCount <= carMaxSize - 1) { |
| | | if (glassCount <= inCarMaxSize - 1) { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthFirst); |
| | | return Boolean.FALSE; |
| | | } else { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst); |
| | | return Boolean.TRUE; |
| | | } |
| | | } else { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst); |
| | | } |
| | | } else { |
| | | flag = Boolean.FALSE; |
| | | } |
| | | } |
| | | //向plc发送进片确认 |
| | | if (flag) { |
| | | S7object.getinstance().plccontrol.writeWord(mesAddress, (short) 1); |
| | | } |
| | | //记录无法放下玻璃,后续判断启动 |
| | | return Boolean.TRUE; |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | |
| | | //2、去笼子内查找是否可以继续存放的笼子 |
| | | List<String> glassIds = taskList.stream().map(BigStorageCageFeedTask::getGlassId).collect(Collectors.toList()); |
| | | List<GlassInfo> glassInfos = glassInfoService.list(new LambdaQueryWrapper<GlassInfo>().in(GlassInfo::getGlassId, glassIds)); |
| | | return computeIsTemperingTargetByLine(glassInfos, taskList, Boolean.TRUE) && computeIsTemperingTargetByLine(glassInfos, taskList, Boolean.FALSE); |
| | | return computeIsTemperingTargetByLine(glassInfos, taskList, line); |
| | | } |
| | | |
| | | /** |
| | | * 是否钢化玻璃进笼目标位置 |
| | | * |
| | | * @param glassInfos 当条线卧转立所有玻璃 |
| | | * @param taskList 当条线卧转立所有任务 |
| | | * @param isTempering true 钢化 false 不钢化 |
| | | * @param glassInfos 当条线卧转立所有玻璃 |
| | | * @param taskList 当条线卧转立所有任务 |
| | | * @param line 任务是哪条线 |
| | | */ |
| | | private boolean computeIsTemperingTargetByLine(List<GlassInfo> glassInfos, List<BigStorageCageFeedTask> taskList, Boolean isTempering) { |
| | | private boolean computeIsTemperingTargetByLine(List<GlassInfo> glassInfos, List<BigStorageCageFeedTask> taskList, Integer line) { |
| | | //1、将玻璃信息集合转为glassid为key的map |
| | | Map<String, GlassInfo> glassInfoMap = glassInfos.stream() |
| | | .collect(Collectors.toMap(GlassInfo::getGlassId, p -> p)); |
| | |
| | | //2、获取目标格子信息 |
| | | BigStorageDTO bigStorageDTO = bigStorageCageDetailsService.queryTargetSlotByTempering(info); |
| | | //3、更新大理片笼表剩余宽度 |
| | | bigStorageCageService.update(new LambdaUpdateWrapper<BigStorageCage>().set(BigStorageCage::getRemainWidth, bigStorageDTO.getWidth()) |
| | | bigStorageCageService.update(new LambdaUpdateWrapper<BigStorageCage>().set(BigStorageCage::getRemainWidth, bigStorageDTO.getWidth() - info.getWidth()) |
| | | .eq(BigStorageCage::getSlot, bigStorageDTO.getSlot())); |
| | | //4、更新进片任务表,目标格子及状态(状态改为2 电气扫到自行处理) 遇到问题:无法批量更新,批量更新无法走指定从库 |
| | | e.setTargetSlot(bigStorageDTO.getSlot()); |
| | | e.setTaskType(Const.BIG_STORAGE_IN_RUN); |
| | | // e.setTaskType(Const.BIG_STORAGE_IN_RUN); |
| | | bigStorageCageFeedTaskService.updateById(e); |
| | | |
| | | //5、将进片信息存入大理片笼详情表 |
| | |
| | | cageDetails.setState(Const.GLASS_STATE_IN); |
| | | bigStorageCageDetailsService.save(cageDetails); |
| | | } |
| | | sendTaskListToPLC(taskList, line); |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list) { |
| | | private void sendTaskListToPLC(List<BigStorageCageFeedTask> taskList, Integer line) { |
| | | S7control s7control = S7object.getinstance().plccontrol; |
| | | PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject; |
| | | String mesD03Address = plcMesObject.getPlcParameter("MESToD03").getAddress(); |
| | | String mesD05Address = plcMesObject.getPlcParameter("MESToD05").getAddress(); |
| | | String outLine = line.equals(Const.A09_OUT_TARGET_POSITION) ? mesD03Address : mesD05Address; |
| | | for (int i = 1; i <= taskList.size(); i++) { |
| | | s7control.writeWord(plcMesObject.getPlcParameter("StartAddToImport" + i).getAddress(), (short) taskList.get(i - 1).getLine()); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("TargetAddToImport" + i).getAddress(), (short) taskList.get(i - 1).getTargetSlot()); |
| | | } |
| | | s7control.writeWord(outLine, (short) 1); |
| | | } |
| | | |
| | | private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list, Boolean isTempering) { |
| | | //任务数据 获取车子存放玻璃最大数量 玻璃间隔 |
| | | List<BigStorageCageOutTask> bigStorageCageOutTaskList = new ArrayList<>(); |
| | | //打车剩余尺寸 |
| | | Integer remainWidth = carWidth; |
| | | for (T e : list) { |
| | | if (bigStorageCageOutTaskList.size() > carMaxSize || e.getWidth() > remainWidth) { |
| | | if (bigStorageCageOutTaskList.size() > outCarMaxSize || e.getWidth() > remainWidth) { |
| | | break; |
| | | } |
| | | remainWidth = remainWidth - e.getWidth().intValue() - galssGap; |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.A09_OUT_TARGET_POSITION, |
| | | e.getWidth().intValue(), 0, 0, 1)); |
| | | remainWidth = remainWidth - (int) e.getWidth() - galssGap; |
| | | if (isTempering) { |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION, |
| | | (int) e.getWidth() * 10, 0, 0, 1)); |
| | | } else { |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.ARTIFICIAL_OUT_TARGET_POSITION, |
| | | (int) e.getWidth() * 10, 0, 0, 1)); |
| | | } |
| | | |
| | | } |
| | | Assert.isFalse(CollectionUtils.isEmpty(bigStorageCageOutTaskList), "未获取出片数据,结束出片任务"); |
| | | log.info("获取出片任务数据{}条,执行保存", bigStorageCageOutTaskList.size()); |
| | |
| | | bigStorageCageService.update(new LambdaUpdateWrapper<BigStorageCage>().set(BigStorageCage::getRemainWidth, slotWidth) |
| | | .in(BigStorageCage::getSlot, slotList)); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | public Boolean computeIsRun(int line, String glassId) { |
| | | //获取卧转立剩余宽度 |
| | | BigStorageDTO sitToUpRemainWidth = bigStorageCageFeedTaskService.querySitToUpRemainWidth(line); |
| | | //获取玻璃信息 |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | return sitToUpRemainWidth.getWidth() < glassInfo.getWidth(); |
| | | } |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @ApiOperation("出片任务删除") |
| | | @PostMapping("/deleteTemperingGlassInfo") |
| | | public Result deleteTemperingGlassInfo(TemperingGlassInfo temperingGlassInfo) { |
| | | public Result deleteTemperingGlassInfo(@RequestBody TemperingGlassInfo temperingGlassInfo) { |
| | | temperingGlassInfoService.removeById(temperingGlassInfo.getId()); |
| | | return Result.build(200,"删除成功",1); |
| | | } |
| | | |
| | | @ApiOperation("出片任务破损0/拿走1") |
| | | @PostMapping("/damageTemperingGlassInfo") |
| | | public Result damageTemperingGlassInfo(TemperingGlassInfo temperingGlassInfo,int status) { |
| | | public Result damageTemperingGlassInfo(@RequestBody TemperingGlassInfo temperingGlassInfo,int status) { |
| | | bigStorageCageDetailsService.damageBigStorageCageDetails(temperingGlassInfo.getGlassId(),status); |
| | | return Result.build(200,"破损成功",1); |
| | | } |
| | |
| | | { |
| | | "plcAddressBegin":"DB14.0", |
| | | "plcAddressLenght":"84", |
| | | "dataType":"word", |
| | | "parameteInfor":[ |
| | | { |
| | | "codeId": "D01Request", |
| | | "addressIndex":"0", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "D01ID1", |
| | | "addressIndex":"2", |
| | | "addressLenght":"6", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D04Request", |
| | | "addressIndex":"34", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D04ID1", |
| | | "addressIndex":"10", |
| | | "addressLenght":"36", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "E01Status", |
| | | "addressIndex":"2", |
| | | "addressLenght":"68", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "E02Status", |
| | | "addressIndex":"2", |
| | | "addressLenght":"70", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "MaxTaskNo", |
| | | "addressIndex":"2", |
| | | "addressLenght":"72", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D02MaxWidth", |
| | | "addressIndex":"2", |
| | | "addressLenght":"74", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D05MaxWidth", |
| | | "addressIndex":"2", |
| | | "addressLenght":"76", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "GlassGap", |
| | | "addressIndex":"2", |
| | | "addressLenght":"78", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D02SitState", |
| | | "addressIndex":"80", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D05SitState", |
| | | "addressIndex":"82", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | } |
| | | ] |
| | | "plcAddressBegin": "DB14.0", |
| | | "plcAddressLenght": "938", |
| | | "dataType": "word", |
| | | "parameteInfor": [{ |
| | | "codeId": "D01ID", |
| | | "addressIndex": "0", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D02ID", |
| | | "addressIndex": "32", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID1", |
| | | "addressIndex": "64", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID2", |
| | | "addressIndex": "96", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID3", |
| | | "addressIndex": "128", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID4", |
| | | "addressIndex": "160", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID5", |
| | | "addressIndex": "192", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID6", |
| | | "addressIndex": "224", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D04ID", |
| | | "addressIndex": "256", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID1", |
| | | "addressIndex": "288", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID2", |
| | | "addressIndex": "328", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID3", |
| | | "addressIndex": "352", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID4", |
| | | "addressIndex": "384", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID5", |
| | | "addressIndex": "416", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID6", |
| | | "addressIndex": "448", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID1", |
| | | "addressIndex": "480", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID2", |
| | | "addressIndex": "512", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID3", |
| | | "addressIndex": "544", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID4", |
| | | "addressIndex": "576", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID5", |
| | | "addressIndex": "608", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID6", |
| | | "addressIndex": "640", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID1", |
| | | "addressIndex": "672", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID2", |
| | | "addressIndex": "704", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID3", |
| | | "addressIndex": "736", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID4", |
| | | "addressIndex": "768", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID5", |
| | | "addressIndex": "800", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID6", |
| | | "addressIndex": "832", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "MESToD03", |
| | | "addressIndex": "888", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "MESToD05", |
| | | "addressIndex": "890", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "MESToPLC", |
| | | "addressIndex": "892", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport1", |
| | | "addressIndex": "914", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport2", |
| | | "addressIndex": "916", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport3", |
| | | "addressIndex": "918", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport4", |
| | | "addressIndex": "920", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport5", |
| | | "addressIndex": "922", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport6", |
| | | "addressIndex": "924", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport1", |
| | | "addressIndex": "926", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport2", |
| | | "addressIndex": "928", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport3", |
| | | "addressIndex": "930", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport4", |
| | | "addressIndex": "932", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport5", |
| | | "addressIndex": "934", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport6", |
| | | "addressIndex": "936", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "deviceState", |
| | | "addressIndex": "864", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01State", |
| | | "addressIndex": "866", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02State", |
| | | "addressIndex": "868", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03State", |
| | | "addressIndex": "870", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05State", |
| | | "addressIndex": "872", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | } |
| | | ] |
| | | } |
| | |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | salve_hangzhoumes_1: |
| | | url: jdbc:sqlserver://192.168.20.24:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | salve_hangzhoumes_1: |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | |
| | | minCount: 5 |
| | | carWidth: 5000 #大车宽度 |
| | | slotWidth: 5000 #大车宽度 |
| | | carMaxSize: 6 #大车最大存放玻璃数量 |
| | | galssGap: 20 #玻璃间距 |
| | | inCarMaxSize: 6 #进片大车最大存放玻璃数量 |
| | | outCarMaxSize: 1 #出片大车最大存放玻璃数量 |
| | | galssGap: 300 #玻璃间距 |
| | |
| | | ) T2 |
| | | INNER JOIN (SELECT ENGINEER_ID, TEMPERING_LAYOUT_ID, COUNT(TEMPERING_FEED_SEQUENCE) AS COUNT |
| | | FROM BIG_STORAGE_CAGE_DETAILS |
| | | WHERE STATE = 100 |
| | | WHERE STATE in (100, 101, 102) |
| | | GROUP BY ENGINEER_ID, TEMPERING_LAYOUT_ID) T3 ON T2.ENGINEER_ID = T3.ENGINEER_ID |
| | | AND T2.TEMPERING_LAYOUT_ID = T3.TEMPERING_LAYOUT_ID |
| | | AND T2.COUNT = T3.COUNT LIMIT 1 |
| | |
| | | package com.mes; |
| | | |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.job.PlcStorageCageTask; |
| | |
| | | BigStorageCageService bigStorageCageService; |
| | | @Autowired |
| | | PlcStorageCageTask plcStorageCageTask; |
| | | @Autowired |
| | | BigStorageCageDetailsService bigStorageCageDetailsService; |
| | | |
| | | @Test |
| | | public void testFindPath() { |
| | |
| | | log.info("获取大理片笼信息:{}", bigStorageCageService.selectBigStorageCageUsage()); |
| | | } |
| | | |
| | | @Test |
| | | public void selectBigStorageCageDetails() { |
| | | log.info("获取大理片笼信息:{}", bigStorageCageDetailsService.selectBigStorageCageDetails("P24060403|3|6")); |
| | | } |
| | | |
| | | } |
| | |
| | | /** |
| | | * 平均利用率 |
| | | */ |
| | | private Double avgAvailability; |
| | | private double avgAvailability; |
| | | |
| | | /** |
| | | * 有效利用率 |
| | | */ |
| | | private Double validAvailability; |
| | | private double validAvailability; |
| | | |
| | | /** |
| | | * 尾片利用率 |
| | | */ |
| | | private Double lastAvailability; |
| | | private double lastAvailability; |
| | | |
| | | /** |
| | | * 状态 |
| | |
| | | /** |
| | | * 小片总面积 |
| | | */ |
| | | private Double glassTotalArea; |
| | | private double glassTotalArea; |
| | | |
| | | /** |
| | | * 计划原片总数 |
| | |
| | | /** |
| | | * 计划原片总面积 |
| | | */ |
| | | private Double planPatternTotalArea; |
| | | private double planPatternTotalArea; |
| | | |
| | | /** |
| | | * 实际原片总数 |
| | |
| | | /** |
| | | * 实际原片总面积 |
| | | */ |
| | | private Double realityPatternTotalArea; |
| | | private double realityPatternTotalArea; |
| | | |
| | | /** |
| | | * 膜系id |
| | |
| | | /** |
| | | * 平均利用率 |
| | | */ |
| | | private Double avgCutPct; |
| | | private double avgCutPct; |
| | | |
| | | /** |
| | | * 有效利用率 |
| | | */ |
| | | private Double validCutPct; |
| | | private double validCutPct; |
| | | |
| | | /** |
| | | * 尾片利用率 |
| | | */ |
| | | private Double lastCutPct; |
| | | private double lastCutPct; |
| | | |
| | | /** |
| | | * 状态 |
| | |
| | | /** |
| | | * 小片总面积 |
| | | */ |
| | | private Double glassTotalArea; |
| | | private double glassTotalArea; |
| | | /** |
| | | * 计划原片总数 |
| | | */ |
| | |
| | | /** |
| | | * 计划原片总面积 |
| | | */ |
| | | private Double rawStockArea; |
| | | private double rawStockArea; |
| | | /** |
| | | * 实际原片总数 |
| | | */ |
| | |
| | | /** |
| | | * 实际原片总面积 |
| | | */ |
| | | private Double actualStockArea; |
| | | private double actualStockArea; |
| | | /** |
| | | * 膜系 |
| | | */ |
| | | private String glassType; |
| | | private String glassType; |
| | | /** |
| | | * 备注 |
| | | */ |
| | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Double width; |
| | | private double width; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | private Double glassThickness; |
| | | private double glassThickness; |
| | | |
| | | /** |
| | | * 原片版图片序 |
| | |
| | | /** |
| | | * 原片宽 |
| | | */ |
| | | private Double patternWidth; |
| | | private double patternWidth; |
| | | |
| | | /** |
| | | * 原片高 |
| | | */ |
| | | private Double patternHeight; |
| | | private double patternHeight; |
| | | |
| | | /** |
| | | * 原片厚度 |
| | | */ |
| | | private Double patternThickness; |
| | | private double patternThickness; |
| | | |
| | | /** |
| | | * 膜系 |
| | |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | # hangzhoumes: |
| | | # url: jdbc:mysql://192.168.1.199:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | # username: root |
| | | # password: beibo.123/ |
| | | # driver-class-name: com.mysql.cj.jdbc.Driver |
| | | # |
| | | # salve_hangzhoumes: |
| | | # url: jdbc:sqlserver://192.168.10.2:1433;databasename=hangzhoumes |
| | | # username: sa |
| | | # password: beibo.123/ |
| | | # driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | hangzhoumes: |
| | | url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://192.168.1.199:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://10.153.19.150:1433;databasename=hangzhoumes |
| | | url: jdbc:sqlserver://192.168.20.24:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | |
| | | <version>2.8.9</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.microsoft.sqlserver</groupId> |
| | | <artifactId>sqljdbc4</artifactId> |
| | | <version>4.0</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <properties> |
| | |
| | | package com.mes; |
| | | |
| | | //import com.mes.common.S7object; |
| | | |
| | | import com.mes.common.S7object; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.boot.ApplicationArguments; |
| | | import org.springframework.boot.ApplicationRunner; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @Order(1) |
| | | |
| | | public class AppRunnerConfig implements ApplicationRunner { |
| | | |
| | | |
| | | @Override |
| | | public void run(ApplicationArguments args) throws Exception { |
| | | log.info("启动完成"); |
| | | //S7object.getinstance().start(); |
| | | |
| | | S7object.getinstance().start(); |
| | | } |
| | | } |
| | |
| | | public class S7object extends Thread { |
| | | public S7control plccontrol; // PLC通讯类实例 |
| | | private EPlcType plcType = EPlcType.S1200; // 西门子PLC类型 |
| | | private String ip = "192.168.10.1"; // plc ip地址 |
| | | private String ip = "192.168.30.100"; // plc ip地址 |
| | | private int port = 102; // plc 端口号 |
| | | |
| | | |
| | |
| | | package com.mes.downglassinfo.controller; |
| | | |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | |
| | | @RequestMapping("/downGlassTask") |
| | | public class DownGlassTaskController { |
| | | |
| | | @Autowired |
| | | DownGlassInfoService downGlassInfoService; |
| | | |
| | | @PostMapping("/generateOutGlassTask") |
| | | @ApiOperation(value = "生成出片任务", notes = "生成出片任务") |
| | | public Result<Boolean> generateOutGlassTask(@RequestBody DownStorageCageDetails downStorageCageDetails) { |
| | | return Result.success(downGlassInfoService.generateOutGlassTask(downStorageCageDetails.getGlassId())); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.mes.downglassinfo.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springframework.data.annotation.Id; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | import java.io.Serializable; |
| | | |
| | |
| | | /** |
| | | * 下片玻璃信息表id |
| | | */ |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 流程卡号 |
| | | */ |
| | | private String flowCardId; |
| | | |
| | | /** |
| | | * 层号 |
| | | */ |
| | | private Integer layer; |
| | | |
| | | /** |
| | | * 顺序 |
| | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Double width; |
| | | private double width; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | private Double thickness; |
| | | private double thickness; |
| | | |
| | | /** |
| | | * 膜系 |
| | |
| | | package com.mes.downglassinfo.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | |
| | | /** |
| | | * id |
| | | */ |
| | | @TableId(value = "id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 玻璃id |
| | | */ |
| | | private String glassId; |
| | | |
| | | |
| | | /** |
| | | * 起始 |
| | | */ |
| | | private String startCell; |
| | | private Integer startCell; |
| | | |
| | | /** |
| | | * 目标 |
| | | */ |
| | | private String endCell; |
| | | private Integer endCell; |
| | | |
| | | /** |
| | | * 任务类型 1:进 2:出 |
| | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Double width; |
| | | private Integer width; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Double height; |
| | | private Integer height; |
| | | |
| | | /** |
| | | * 膜系 |
| | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | private Double thickness; |
| | | private Integer thickness; |
| | | |
| | | /** |
| | | * 流程卡号 |
| | | */ |
| | | private String flowCardId; |
| | | /** |
| | | * 层号 |
| | | */ |
| | | private int layer; |
| | | |
| | | /** |
| | | * 任务状态 0 未开始 1正在进行 2完成 |
| | | */ |
| | | private Integer taskStauts; |
| | | |
| | | /** |
| | | * 玻璃id |
| | | */ |
| | | private String glassId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | |
| | | package com.mes.downglassinfo.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.downworkstation.entity.dto.DownGlassInfoDTO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Repository |
| | | public interface DownGlassInfoMapper extends BaseMapper<DownGlassInfo>, MPJBaseMapper<DownGlassInfo> { |
| | | public interface DownGlassInfoMapper extends BaseMapper<DownGlassInfo> { |
| | | |
| | | |
| | | DownGlassInfoDTO queryDownGlassMaxLayer(@Param(value = "flowCardId") String flowCardId); |
| | | |
| | | Integer queryMaxSequence(@Param(value = "flowCardId") String flowCardId, @Param(value = "layer") int layer); |
| | | |
| | | List<DownGlassInfoDTO> queryWorkStationIsIn(@Param(value = "isDownload") Boolean isDownload); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downworkstation.entity.dto.DownGlassInfoDTO; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface DownGlassInfoService extends IService<DownGlassInfo> { |
| | | |
| | |
| | | * @param flowCardId |
| | | * @return // 根据流程卡号查询最大序号 |
| | | */ |
| | | Integer getMaxSequenceByFlowCardId(String flowCardId); |
| | | Integer getMaxSequenceByFlowCardId(String flowCardId, int layer); |
| | | |
| | | /** |
| | | * @param downGlassInfo 插入下片信息 |
| | |
| | | void insertDownGlassInfo(DownGlassInfo downGlassInfo); |
| | | |
| | | |
| | | DownGlassInfoDTO queryDownGlassMaxLayer(String flowCardId); |
| | | |
| | | Integer queryMaxSequence(String flowCardId, int layer); |
| | | |
| | | /** |
| | | * 获取架子绑定 流程卡的玻璃信息(已落架/未落架) |
| | | * |
| | | * @param isDownload true/false |
| | | * @return |
| | | */ |
| | | List<DownGlassInfoDTO> queryWorkStationIsIn(Boolean isDownload); |
| | | |
| | | /** |
| | | * 生成出片任务 |
| | | * |
| | | * @param glassId |
| | | * @return |
| | | */ |
| | | boolean generateOutGlassTask(String glassId); |
| | | } |
| | |
| | | package com.mes.downglassinfo.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.mapper.DownGlassInfoMapper; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.service.DownStorageCageDetailsService; |
| | | import com.mes.downworkstation.entity.dto.DownGlassInfoDTO; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.job.DownLoadCacheGlassTask; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class DownGlassInfoServiceImpl extends ServiceImpl<DownGlassInfoMapper, DownGlassInfo> implements DownGlassInfoService { |
| | | |
| | | // 根据流程卡号查询最大序号 |
| | | @Autowired |
| | | DownLoadCacheGlassTask downLoadCacheGlassTask; |
| | | |
| | | @Autowired |
| | | DownStorageCageDetailsService downStorageCageDetailsService; |
| | | |
| | | /** |
| | | * 根据流程卡号查询最大序号 |
| | | */ |
| | | @Override |
| | | public Integer getMaxSequenceByFlowCardId(String flowCardId) { |
| | | public Integer getMaxSequenceByFlowCardId(String flowCardId, int layer) { |
| | | LambdaQueryWrapper<DownGlassInfo> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
| | | lambdaQueryWrapper.eq(DownGlassInfo::getFlowCardId, flowCardId) |
| | | .eq(DownGlassInfo::getLayer, layer) |
| | | .select(DownGlassInfo::getSequence) |
| | | .orderByDesc(DownGlassInfo::getSequence) |
| | | .last("LIMIT 1"); |
| | |
| | | return downGlassInfo != null ? downGlassInfo.getSequence() : 0; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void insertDownGlassInfo(DownGlassInfo downGlassInfo) { |
| | | |
| | | |
| | | |
| | | baseMapper.insert(downGlassInfo); |
| | | } |
| | | |
| | | @Override |
| | | public DownGlassInfoDTO queryDownGlassMaxLayer(String flowCardId) { |
| | | return baseMapper.queryDownGlassMaxLayer(flowCardId); |
| | | } |
| | | |
| | | @Override |
| | | public Integer queryMaxSequence(String flowCardId, int layer) { |
| | | return baseMapper.queryMaxSequence(flowCardId, layer); |
| | | } |
| | | |
| | | @Override |
| | | public List<DownGlassInfoDTO> queryWorkStationIsIn(Boolean isDownload) { |
| | | return baseMapper.queryWorkStationIsIn(isDownload); |
| | | } |
| | | |
| | | @Override |
| | | public boolean generateOutGlassTask(String glassId) { |
| | | //更新卧式理片笼内玻璃状态 |
| | | downStorageCageDetailsService.update(new LambdaUpdateWrapper<DownStorageCageDetails>() |
| | | .set(DownStorageCageDetails::getState, Const.GLASS_STATE_OUT).eq(DownStorageCageDetails::getGlassId, glassId)); |
| | | DownStorageCageDetails details = downStorageCageDetailsService.getOne(new LambdaQueryWrapper<DownStorageCageDetails>() |
| | | .eq(DownStorageCageDetails::getGlassId, glassId)); |
| | | //生成下片信息 |
| | | DownGlassInfo downGlassInfo = new DownGlassInfo(); |
| | | BeanUtils.copyProperties(details, downGlassInfo); |
| | | //获取当前流程卡最大片序 |
| | | downGlassInfo.setSequence(this.getMaxSequenceByFlowCardId(details.getFlowCardId(), details.getLayer()) + 1); |
| | | this.save(downGlassInfo); |
| | | //生成任务信息 并向plc发送出片任务 |
| | | GlassInfo glassInfo = new GlassInfo(); |
| | | BeanUtils.copyProperties(details, glassInfo); |
| | | return downLoadCacheGlassTask.initDownGlassTask(glassInfo, details.getSlot(), 3001, 2); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | // |
| | | @ApiOperation("修改玻璃状态 功能:对笼内栅格玻璃进行【破损/拿走】 ") |
| | | @PostMapping("/ReportStatus") |
| | | @ResponseBody |
| | | public Result edgReportStatus(@RequestBody Map<String, String> arguments) { |
| | | String downStorageCageDetailsId=arguments.get("glassId"); |
| | | int controlsId=Integer.valueOf(arguments.get("controlsId")); |
| | | boolean isSucess=downStorageCageDetailsService.identWorn(downStorageCageDetailsId,controlsId); |
| | | return Result.build(200,"【破损/拿走】成功",1); |
| | | } |
| | | |
| | | |
| | | // Other CRUD operations can be defined here |
| | | } |
| | |
| | | */ |
| | | @ApiModelProperty(value = "启用状态", position = 5) |
| | | @TableField("enable_state") |
| | | private String enableState; |
| | | private Integer enableState; |
| | | |
| | | /** |
| | | * 剩余 |
| | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Double width; |
| | | private double width; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | private Double thickness; |
| | | private double thickness; |
| | | |
| | | /** |
| | | * 钢化版图id |
| | |
| | | * 玻璃间隙 |
| | | */ |
| | | private Integer gap; |
| | | /** |
| | | * 总层数 |
| | | */ |
| | | private Integer totalLayer; |
| | | /** |
| | | * 层数 |
| | | */ |
| | | private Integer layer; |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.downstorage.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import org.apache.ibatis.annotations.*; |
| | | |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Mapper |
| | | public interface DownStorageCageDetailsMapper extends MPJBaseMapper<DownStorageCageDetails> { |
| | | |
| | | DownStorageCageDetails getGlassInfoMaxCount(); |
| | | } |
| | |
| | | // * @return 直通查询 |
| | | // */ |
| | | // List<GlassInfo> DirectConnection(); |
| | | |
| | | /** |
| | | * @return 直通查询 |
| | | */ |
| | | boolean DirectConnection(GlassInfo glassInfo); |
| | | |
| | | DownStorageCageDetails getGlassInfoMaxCount(); |
| | | |
| | | /** |
| | | * @param glassId |
| | | * @param ControlsId |
| | | * @return 破损 |
| | | */ |
| | | boolean identWorn(String glassId, int ControlsId); |
| | | } |
| | |
| | | package com.mes.downstorage.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | |
| | | */ |
| | | public interface DownStorageCageService extends MPJBaseService<DownStorageCage> { |
| | | |
| | | DownGlassTask createDownGlassTask(GlassInfo glassInfo, String startCell, String endCell, String taskType); |
| | | DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, String startCell, String endCell, String taskType); |
| | | DownGlassTask createDownGlassTask(GlassInfo glassInfo, Integer startCell, Integer endCell, String taskType); |
| | | |
| | | DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, Integer startCell, Integer endCell, String taskType); |
| | | // List<Map<String, Object>> selectCacheLeisure(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * @return 找到空格子 |
| | | */ |
| | | List<DownStorageCageDetails> selectCacheEmpty() ; |
| | | DownStorageCage selectCacheEmpty(int currentSlot, boolean flag); |
| | | |
| | | /** |
| | | * @return 找到空格子 |
| | | */ |
| | | List<DownStorageCageDetails> selectCacheEmpty(); |
| | | |
| | | /** |
| | | * @param downStorageCage |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.yulichang.query.MPJLambdaQueryWrapper; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | |
| | | return count > 0; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public DownStorageCageDetails getGlassInfoMaxCount() { |
| | | return baseMapper.getGlassInfoMaxCount(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public boolean identWorn(String glassId, int ControlsId) { |
| | | List<DownStorageCageDetails> edgStorageCageDetails = baseMapper.selectList(new MPJLambdaQueryWrapper<DownStorageCageDetails>().selectAll(DownStorageCageDetails.class).eq(DownStorageCageDetails::getGlassId, glassId)); |
| | | if (edgStorageCageDetails.size() == 1) { |
| | | DownStorageCageDetails item = edgStorageCageDetails.get(0); |
| | | item.setState(ControlsId); |
| | | baseMapper.update(item, new MPJLambdaWrapper<DownStorageCageDetails>().selectAll(DownStorageCageDetails.class).eq(DownStorageCageDetails::getGlassId, glassId)); |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.downstorage.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | |
| | | //import com.mes.device.PlcParameterObject; |
| | | import com.google.common.base.Functions; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downglassinfo.service.DownGlassTaskService; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.mapper.DownStorageCageDetailsMapper; |
| | | import com.mes.downstorage.mapper.DownStorageCageMapper; |
| | |
| | | import com.mes.downstorage.service.DownStorageCageService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import net.sf.jsqlparser.statement.select.SelectItem; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private DownStorageCageDetailsMapper downStorageCageDetailsMapper; |
| | | |
| | | @Override |
| | | public DownGlassTask createDownGlassTask(GlassInfo glassInfo, String startCell, String endCell, String taskType) { |
| | | public DownGlassTask createDownGlassTask(GlassInfo glassInfo, Integer startCell, Integer endCell, String taskType) { |
| | | DownGlassTask downGlassTask = new DownGlassTask(); |
| | | |
| | | BeanUtils.copyProperties(glassInfo, downGlassTask); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, String startCell, String endCell, String taskType) { |
| | | public DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, Integer startCell, Integer endCell, String taskType) { |
| | | DownGlassTask downGlassTask = new DownGlassTask(); |
| | | |
| | | BeanUtils.copyProperties(glassInfo, downGlassTask); |
| | |
| | | downGlassTask.setEndCell(endCell); |
| | | return downGlassTask; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //找到空格子 |
| | | @Override |
| | | public List<DownStorageCageDetails> selectCacheEmpty() { |
| | | return baseMapper.selectJoinList(DownStorageCageDetails.class, |
| | | return this.selectJoinList(DownStorageCageDetails.class, |
| | | JoinWrappers.lambda(DownStorageCage.class) |
| | | .selectAll(DownStorageCage.class) |
| | | .select(DownStorageCageDetails::getWidth, DownStorageCageDetails::getHeight, DownStorageCageDetails::getGlassId) |
| | | .leftJoin(DownStorageCageDetails.class, on -> on |
| | | .eq(DownStorageCageDetails::getDeviceId, DownStorageCage::getDeviceId) |
| | | .eq(DownStorageCageDetails::getSlot, DownStorageCage::getSlot) |
| | | .eq(DownStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | ) |
| | | .eq(DownStorageCageDetails::getState, Const.GLASS_STATE_IN)) |
| | | .isNull(DownStorageCageDetails::getSlot) |
| | | ); |
| | | } |
| | | |
| | | //找到空格子 |
| | | @Override |
| | | public DownStorageCage selectCacheEmpty(int currentSlot, boolean flag) { |
| | | List<DownStorageCage> emptyList = this.selectJoinList(DownStorageCage.class, |
| | | JoinWrappers.lambda(DownStorageCage.class) |
| | | .selectAll(DownStorageCage.class) |
| | | .leftJoin(DownStorageCageDetails.class, on -> on |
| | | .eq(DownStorageCageDetails::getSlot, DownStorageCage::getSlot) |
| | | .eq(DownStorageCageDetails::getState, Const.GLASS_STATE_IN)) |
| | | .isNull(DownStorageCageDetails::getSlot) |
| | | .last("order by abs(t.slot - " + currentSlot + ") asc limit 2") |
| | | ); |
| | | if (flag && CollectionUtil.isNotEmpty(emptyList)) { |
| | | return emptyList.get(0); |
| | | } |
| | | if (CollectionUtil.isEmpty(emptyList) || emptyList.size() == 1) { |
| | | return null; |
| | | } |
| | | return emptyList.get(0); |
| | | } |
| | | |
| | | @Override |
| | |
| | | .leftJoin(DownStorageCageDetails.class, on -> on |
| | | .eq(DownStorageCageDetails::getDeviceId, DownStorageCage::getDeviceId) |
| | | .eq(DownStorageCageDetails::getSlot, DownStorageCage::getSlot) |
| | | .eq(DownStorageCageDetails::getState, Const.GLASS_STATE_IN)) |
| | | .eq(DownStorageCageDetails::getState, Const.GLASS_STATE_IN)) |
| | | .isNull(DownStorageCageDetails::getSlot) |
| | | .eq(DownStorageCage::getEnableState, 1) |
| | | .groupBy(DownStorageCageDetails::getFlowCardId) // 根据 flowCardId 分组 |
| | |
| | | |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | */ |
| | | private Integer workState; |
| | | |
| | | /** |
| | | * 层数 |
| | | */ |
| | | private Integer layer; |
| | | |
| | | |
| | | /** |
| | | * 总数量 |
| | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Double width; |
| | | private double width; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Double height; |
| | | private double height; |
| | | |
| | | /** |
| | | * 膜系 |
| | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | private Double thickness; |
| | | private double thickness; |
| | | |
| | | /** |
| | | * 流程卡号 |
| | |
| | | import lombok.Data;
|
| | | import lombok.EqualsAndHashCode;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | /**
|
| | | * <p>
|
| | | *
|
| | |
| | | /**
|
| | | * 宽
|
| | | */
|
| | | private Double width;
|
| | | private double width;
|
| | |
|
| | | /**
|
| | | * 高
|
| | | */
|
| | | private Double height;
|
| | | private Double totalwidth;
|
| | | private double height;
|
| | | private double totalwidth;
|
| | |
|
| | | private Double totalheight;
|
| | | private double totalheight;
|
| | | /**
|
| | | * 厚度
|
| | | */
|
| | | private Double thickness;
|
| | | private double thickness;
|
| | |
|
| | |
|
| | | private String Filmsid;
|
New file |
| | |
| | | package com.mes.downworkstation.entity.dto; |
| | | |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/6/21 16:06 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class DownGlassInfoDTO { |
| | | /** |
| | | * 流程卡号 |
| | | */ |
| | | private String flowCardId; |
| | | /** |
| | | * 层数 |
| | | */ |
| | | private Integer layer; |
| | | /** |
| | | * 落架数量 |
| | | */ |
| | | private Integer count; |
| | | |
| | | /** |
| | | * 流程卡未进片的玻璃信息 |
| | | */ |
| | | private List<GlassInfo> glassInfoList; |
| | | } |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | |
| | | // @Value("${mes.threshold}") |
| | | private int threshold; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | // @Scheduled(fixedDelay = 1000) |
| | | public void autoBindRack() { |
| | | log.info("根据缓存中已经进片的玻璃种数量最多的流程卡号自动绑定一个启用状态的空架子"); |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | if (downStorageCageDetailsService.DirectConnection(glassInfo)) { |
| | | //直通 |
| | | //log.info("3、如果当前玻璃属于版图id和片序的顺序则直通,执行下片任务"); |
| | | log.info("3、如果当前玻璃属于流程卡中的片序的顺序则直通,执行下片任务"); |
| | | log.info("3、如果当前玻璃属于流程卡中的片序的顺序则直通,执行下片任务"); |
| | | DownWorkstation downWorkstation = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>().eq(DownWorkstation::getFlowCardId, glassInfo.getFlowCardId())); |
| | | int WorkstationId = downWorkstation.getWorkstationId(); |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(glassInfo, "0", String.valueOf(WorkstationId), "3"); |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(glassInfo, 0, WorkstationId, "3"); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | |
| | | } else { |
| | | |
| | | // log.info("4、如果不属于版图id和片序的顺序执行进片任务"); |
| | | // log.info("4、如果不属于版图id和片序的顺序执行进片任务"); |
| | | log.info("4、如果不属于流程卡中的片序的顺序执行进片任务"); |
| | | |
| | | //添加进片任务 查找空格 |
| | |
| | | downStorageCageDetailsService.save(details); |
| | | log.info("7、玻璃信息已存入理片笼详情表,玻璃信息为{}", details); |
| | | |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(glassInfo, "0", item.getSlot() + "", "1"); |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(glassInfo, 0, item.getSlot(), "1"); |
| | | //添加进片任务 |
| | | log.info("8、生成进片任务信息存入任务表{}", downGlassTask); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | |
| | | * @param MESSendingWord |
| | | */ |
| | | private Boolean outTo(String MESSendingWord) { |
| | | // log.info("单片情况根据传入的料架号 查询符合按照版图id和片序出片,并且优先出满架的小片"); |
| | | // log.info("单片情况根据传入的料架号 查询符合按照版图id和片序出片,并且优先出满架的小片"); |
| | | log.info("单片情况根据传入的料架号 查询符合按照流程卡中顺序出片,并且优先出满架的小片"); |
| | | |
| | | // List<DownStorageCageDetails> list1to3 = downStorageCageDetailsService.CacheOut1(1, 3); |
| | |
| | | |
| | | DownStorageCageDetails selectedItem = null; |
| | | |
| | | String endCell = ""; |
| | | Integer endCell = null; |
| | | |
| | | // 优先 超出尺寸优先人工出片 人工处理 |
| | | if (!list1to6.isEmpty()) { |
| | |
| | | new LambdaQueryWrapper<DownWorkstation>() |
| | | .eq(DownWorkstation::getFlowCardId, selectedItem.getFlowCardId()) |
| | | ); |
| | | endCell = String.valueOf(downWorkstation.getWorkstationId()); |
| | | if (endCell.isEmpty()) { |
| | | endCell = "7"; |
| | | endCell = downWorkstation.getWorkstationId(); |
| | | if (endCell == null) { |
| | | endCell = 7; |
| | | } |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(selectedItem, "9", endCell, "2"); |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(selectedItem, 9, endCell, "2"); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | LambdaQueryWrapper<DownStorageCageDetails> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(DownStorageCageDetails::getGlassId, selectedItem.getGlassId()); |
| | |
| | | // 创建新的 DownGlassInfo 对象并设置相关属性 |
| | | DownGlassInfo newdownGlassInfo = new DownGlassInfo(); |
| | | |
| | | Integer maxSequence = downGlassInfoService.getMaxSequenceByFlowCardId(downGlassInfo.getFlowCardId()); |
| | | Integer maxSequence = downGlassInfoService.getMaxSequenceByFlowCardId(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer()); |
| | | // 初始化顺序字段值 |
| | | int sequence = maxSequence != null ? maxSequence + 1 : 1; |
| | | BeanUtils.copyProperties(downGlassInfo, newdownGlassInfo); |
New file |
| | |
| | | package com.mes.job; |
| | | |
| | | import cn.hutool.core.lang.Assert; |
| | | import cn.smallbun.screw.core.util.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.downglassinfo.service.DownGlassTaskService; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.service.DownStorageCageDetailsService; |
| | | import com.mes.downstorage.service.DownStorageCageService; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.entity.dto.DownGlassInfoDTO; |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.tools.S7control; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/5/8 8:17 |
| | | * @Description: |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class DownLoadCacheGlassTask { |
| | | |
| | | @Autowired |
| | | DownGlassTaskService downGlassTaskService; |
| | | @Autowired |
| | | GlassInfoService glassInfoService; |
| | | @Autowired |
| | | DownStorageCageDetailsService downStorageCageDetailsService; |
| | | @Autowired |
| | | DownStorageCageService downStorageCageService; |
| | | @Autowired |
| | | DownWorkstationService downWorkstationService; |
| | | @Autowired |
| | | DownGlassInfoService downGlassInfoService; |
| | | |
| | | @Value("${mes.threshold}") |
| | | private Integer threshold; |
| | | |
| | | @Value("${mes.throughWidth}") |
| | | private Integer throughWidth; |
| | | |
| | | @Value("${mes.throughHeight}") |
| | | private Integer throughHeight; |
| | | |
| | | @Value("${mes.maxWidth}") |
| | | private Integer maxWidth; |
| | | |
| | | @Value("${mes.maxHeight}") |
| | | private Integer maxHeight; |
| | | |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void plcHomeEdgTask() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String requestWord = plcParameterObject.getPlcParameter("requestWord").getValue(); |
| | | String glassIdeValue = plcParameterObject.getPlcParameter("requestID").getValue(); |
| | | //A08 A09表示线路相同 可做等价 无数据转int异常 |
| | | String out06Glassstate = plcParameterObject.getPlcParameter("glassStatus06").getValue(); |
| | | String out08Glassstate = plcParameterObject.getPlcParameter("glassStatus08").getValue(); |
| | | String out11Glassstate = plcParameterObject.getPlcParameter("glassStatus11").getValue(); |
| | | String out13Glassstate = plcParameterObject.getPlcParameter("glassStatus13").getValue(); |
| | | String confirmationWrodValue = plcParameterObject.getPlcParameter("confirmationWord").getValue(); |
| | | String confirmationWrodAddress = plcParameterObject.getPlcParameter("confirmationWord").getAddress(); |
| | | String currentSlot = plcParameterObject.getPlcParameter("currentCell").getValue(); |
| | | |
| | | log.info("1、获取到的请求字为:{},获取到的扫描ID为:{},获取到的确认字为:{},获取到的出片状态分别为:g06:{}、g08:{}、g11:{}、g13:{},当前格子号为:{}", |
| | | requestWord, glassIdeValue, confirmationWrodValue, out06Glassstate, out08Glassstate, out11Glassstate, out13Glassstate, currentSlot); |
| | | |
| | | if ("0".equals(requestWord)) { |
| | | if ("0".equals(confirmationWrodValue)) { |
| | | log.info("2、获取到的请求字为0,且确认字为0,不执行任务"); |
| | | return; |
| | | } |
| | | log.info("2、获取到的请求字为0,将确认字改为0"); |
| | | S7object.getinstance().plccontrol.writeWord(confirmationWrodAddress, (short) 0); |
| | | return; |
| | | } |
| | | if (!"0".equals(confirmationWrodValue)) { |
| | | log.info("2、获取到的请求字不为0,将确认字不为0,直接结束"); |
| | | return; |
| | | } |
| | | if ("1".equals(requestWord)) { |
| | | log.info("2、进片请求,且确认字为0,执行进片任务"); |
| | | inTo(glassIdeValue, requestWord, currentSlot); |
| | | } else if ("2".equals(requestWord)) { |
| | | //09空闲 :1 10空闲 :2 都空闲:3 其他0 |
| | | log.info("2、出片请求,且确认字为0,执行进片任务"); |
| | | outTo(out06Glassstate, out08Glassstate, out11Glassstate, out13Glassstate, glassIdeValue, currentSlot); |
| | | } else if ("3".equals(requestWord)) { |
| | | log.info("2、进片和出片都空闲,执行出片任务"); |
| | | //加笼子里面是否有玻璃,有先出,无玻璃先进 |
| | | boolean outFlase = outTo(out06Glassstate, out08Glassstate, out11Glassstate, out13Glassstate, glassIdeValue, currentSlot); |
| | | log.info("出片任务是否完成:{},失败且玻璃id:{}不为空则执行进片任务", outFlase, glassIdeValue); |
| | | if (!outFlase && StringUtils.isNotBlank(glassIdeValue)) { |
| | | inTo(glassIdeValue, requestWord, currentSlot); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void inTo(String glassId, String requestWord, String currentSlot) { |
| | | log.info("1、按照玻璃id:{}获取玻璃小片信息,当前格子为:{}", glassId, currentSlot); |
| | | //添加进片任务 查找空格 |
| | | DownStorageCage nearestEmpty = downStorageCageService.selectCacheEmpty(Integer.parseInt(currentSlot), Boolean.FALSE); |
| | | Assert.isTrue(null != nearestEmpty, "格子已满,无法执行进片操作"); |
| | | 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()); |
| | | return; |
| | | } |
| | | Boolean checkFlag = Boolean.FALSE; |
| | | //玻璃尺寸是否走人工下片 |
| | | if (glassInfo.getWidth() > maxWidth || glassInfo.getHeight() > maxHeight) { |
| | | log.info("该玻璃尺寸走人工下片,直接进片"); |
| | | } else { |
| | | log.info("该玻璃尺寸非人工下片"); |
| | | //获取该玻璃的流程卡是否已绑定架子 |
| | | DownWorkstation one = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>() |
| | | .eq(DownWorkstation::getLayer, glassInfo.getLayer()) |
| | | .eq(DownWorkstation::getFlowCardId, glassInfo.getFlowCardId())); |
| | | Boolean isBind = Boolean.FALSE; |
| | | if (null != one) { |
| | | log.info("该流程卡已绑定架子"); |
| | | isBind = Boolean.TRUE; |
| | | checkFlag = multilayerCheck(glassInfo, isBind); |
| | | } |
| | | if (!checkFlag && !isBind) { |
| | | log.info("该玻璃的流程卡未绑定架子,获取是否有空架子"); |
| | | List<DownWorkstation> list = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() |
| | | .isNull(DownWorkstation::getFlowCardId)); |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | log.info("有空架子,将流程卡与架子好绑定,执行进片任务 结束"); |
| | | //绑定流程卡 |
| | | downWorkstationService.update(new LambdaUpdateWrapper<DownWorkstation>() |
| | | .set(DownWorkstation::getFlowCardId, glassInfo.getFlowCardId()) |
| | | .set(DownWorkstation::getLayer, glassInfo.getLayer()) |
| | | .eq(DownWorkstation::getWorkstationId, list.get(0).getWorkstationId())); |
| | | checkFlag = Boolean.TRUE; |
| | | } |
| | | } |
| | | if (!checkFlag) { |
| | | log.info("无空架子,获取已绑定架子的流程卡信息,查看玻璃信息是否可被对调"); |
| | | List<DownGlassInfoDTO> downGlassInfoDTOList = downGlassInfoService.queryWorkStationIsIn(Boolean.FALSE); |
| | | log.info("获取架子上已绑定流程卡落架的数量及未落架的玻璃数据:{}", downGlassInfoDTOList); |
| | | if (CollectionUtils.isEmpty(downGlassInfoDTOList)) { |
| | | log.info("已绑定流程卡均无未落架玻璃,请及时处理架子上的玻璃,清除流程卡,执行进片任务"); |
| | | } else { |
| | | //替换玻璃信息 |
| | | endLoop: |
| | | for (DownGlassInfoDTO e : downGlassInfoDTOList) { |
| | | List<GlassInfo> glassInfoList = e.getGlassInfoList(); |
| | | for (GlassInfo item : glassInfoList) { |
| | | if (item.getWidth() == glassInfo.getWidth() && item.getHeight() == glassInfo.getHeight() |
| | | && item.getThickness() == glassInfo.getThickness() && item.getFilmsid().equals(glassInfo.getFilmsid())) { |
| | | //玻璃是否为多层 |
| | | 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 downStorageCageDetails = new DownStorageCageDetails(); |
| | | BeanUtils.copyProperties(glassInfo, downStorageCageDetails); |
| | | downStorageCageDetails.setState(Const.GLASS_STATE_IN); |
| | | downStorageCageDetails.setSlot(nearestEmpty.getSlot()); |
| | | downStorageCageDetailsService.save(downStorageCageDetails); |
| | | // 生成进片任务 |
| | | initDownGlassTask(glassInfo, 0, nearestEmpty.getSlot(), Const.GLASS_CACHE_TYPE_IN); |
| | | } |
| | | |
| | | public Boolean outTo(String glassStatus06, String out08Glassstate, String glassStatus11, String glassStatus13, String glassId, String currentSlot) { |
| | | if ("2".equals(glassStatus06) && "2".equals(glassStatus11) && "2".equals(glassStatus13)) { |
| | | 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)); |
| | | //获取待进片玻璃 |
| | | DownStorageCageDetails cageDetails = new DownStorageCageDetails(); |
| | | if (StringUtils.isNotBlank(glassId)) { |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | BeanUtils.copyProperties(glassInfo, cageDetails); |
| | | //获取当前笼子空格信息 |
| | | DownStorageCage empty = downStorageCageService.selectCacheEmpty(Integer.parseInt(currentSlot), Boolean.TRUE); |
| | | cageDetails.setSlot(empty.getSlot()); |
| | | tempList.add(cageDetails); |
| | | } |
| | | |
| | | log.info("笼内玻璃的数据有:{}", tempList); |
| | | if (CollectionUtils.isEmpty(tempList)) { |
| | | log.info("笼内没有玻璃,无法执行出片"); |
| | | return Boolean.FALSE; |
| | | } |
| | | Boolean flag08 = "1".equals(out08Glassstate) ? Boolean.TRUE : Boolean.FALSE; |
| | | if (!generateTaskByShelf(glassStatus11, flag08, glassStatus13, tempList, cageDetails)) { |
| | | return generateTaskByShelf(glassStatus11, !flag08, glassStatus13, tempList, cageDetails); |
| | | } |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | private Boolean multilayerCheck(GlassInfo glassInfo, boolean isBind) { |
| | | //查询该流程卡是否为多层 |
| | | if (glassInfo.getTotalLayer() > 1) { |
| | | log.info("按照流程卡获取当前流程卡各层已落架数量"); |
| | | DownGlassInfoDTO downGlassInfoDTO = downGlassInfoService.queryDownGlassMaxLayer(glassInfo.getFlowCardId()); |
| | | if (null == downGlassInfoDTO) { |
| | | if (isBind) { |
| | | return Boolean.TRUE; |
| | | } else { |
| | | log.info("架子已经占满,多层玻璃无法找到对应的格子,需执行替换玻璃的操作"); |
| | | return Boolean.FALSE; |
| | | } |
| | | |
| | | } |
| | | if (downGlassInfoDTO.getLayer().equals(glassInfo.getLayer())) { |
| | | log.info("当前玻璃的流程在架子上落架最多 直接进片"); |
| | | return Boolean.TRUE; |
| | | } |
| | | Integer sequence = downGlassInfoService.queryMaxSequence(glassInfo.getFlowCardId(), glassInfo.getLayer()); |
| | | log.info("获取当前玻璃需要放的次序:笼内同流程 同层数的通达次序+1:{}", sequence); |
| | | DownGlassInfo downGlassInfo = downGlassInfoService.getOne(new LambdaQueryWrapper<DownGlassInfo>() |
| | | .eq(DownGlassInfo::getFlowCardId, downGlassInfoDTO.getFlowCardId()) |
| | | .eq(DownGlassInfo::getLayer, downGlassInfoDTO.getLayer()).eq(DownGlassInfo::getSequence, sequence)); |
| | | log.info("拿当前版序获取玻璃信息{},按照次序判断当前玻璃是否尺寸对应的上(与数量最多的次序比较)。", downGlassInfo); |
| | | if (null != downGlassInfoDTO && downGlassInfo.getWidth() == glassInfo.getWidth() && downGlassInfo.getHeight() == glassInfo.getHeight()) { |
| | | log.info("相同次序玻璃对应上,可执行进片任务"); |
| | | return Boolean.TRUE; |
| | | } else { |
| | | log.info("同次序玻璃对应不上,需执行替换玻璃的操作"); |
| | | return Boolean.FALSE; |
| | | } |
| | | } else { |
| | | log.info("非多层玻璃,直接进片"); |
| | | return Boolean.TRUE; |
| | | } |
| | | } |
| | | |
| | | private Boolean generateTaskByShelf(String glassStatus, Boolean flag08, String glassStatus13, List<DownStorageCageDetails> tempList, DownStorageCageDetails cageDetails) { |
| | | //获取2个机械臂范围内的架子绑定的流程卡信息 |
| | | List<Integer> workList = new ArrayList(); |
| | | |
| | | if (flag08) { |
| | | if (!"2".equals(glassStatus)) { |
| | | workList.addAll(Const.G11_WORK_STATION); |
| | | } |
| | | } else { |
| | | if (!"2".equals(glassStatus)) { |
| | | workList.addAll(Const.G06_WORK_STATION); |
| | | } |
| | | } |
| | | List<DownStorageCageDetails> list = new ArrayList(); |
| | | Boolean isEmptyShelf = Boolean.FALSE; |
| | | //对笼内玻璃进行过滤,仅出符合逻辑的玻璃 |
| | | if (CollectionUtils.isNotEmpty(workList)) { |
| | | List<DownWorkstation> downWorkstationList = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() |
| | | .eq(DownWorkstation::getEnableState, 0).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()); |
| | | } |
| | | } else { |
| | | List<DownWorkstation> workstationsIsNotBind = downWorkstationList.stream().filter(item -> null == (item.getFlowCardId())).collect(Collectors.toList()); |
| | | Map<String, List<DownWorkstation>> listMap = downWorkstationList.stream().collect(Collectors.groupingBy(item -> item.getFlowCardId() + ":" + item.getLayer())); |
| | | if (CollectionUtils.isEmpty(workstationsIsNotBind)) { |
| | | log.info("不存在未绑定流程卡架子"); |
| | | //筛选出对应架子已绑定流程卡可下片的玻璃 |
| | | list = tempList.stream().filter(item -> listMap.containsKey(item.getFlowCardId() + ":" + item.getLayer())).collect(Collectors.toList()); |
| | | } else { |
| | | log.info("存在未绑定流程卡架子,直接获取笼内所有玻璃"); |
| | | isEmptyShelf = Boolean.TRUE; |
| | | //todo:如果禁用架子已绑定流程卡,因为时间不确定,笼子内的玻璃可重新绑定新架子 |
| | | // list = tempList.stream().filter(item -> !listMap.containsKey(item.getFlowCardId() + ":" + item.getLayer())).collect(Collectors.toList()); |
| | | list = tempList; |
| | | } |
| | | } |
| | | } else { |
| | | if (flag08 && !"2".equals(glassStatus13)) { |
| | | //直接走人工下片 |
| | | list = tempList.stream().filter(item -> item.getWidth() > maxWidth || item.getHeight() > maxHeight).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | if (CollectionUtils.isEmpty(list)) { |
| | | log.info("笼内玻璃无法执行出片"); |
| | | return Boolean.FALSE; |
| | | } |
| | | String tempGlassId = null; |
| | | Boolean isBind = Boolean.FALSE; |
| | | |
| | | for (DownStorageCageDetails item : list) { |
| | | if (item.getWidth() > maxWidth || item.getHeight() > maxHeight) { |
| | | if (flag08 && !"2".equals(glassStatus13)) { |
| | | log.info("玻璃宽度或高度超出阈值,执行人工下片"); |
| | | tempGlassId = item.getGlassId(); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | loop: |
| | | if (tempGlassId == null) { |
| | | //获取正在落架的绑定流程卡的信息(流程卡、层数、落架数量) |
| | | List<DownGlassInfoDTO> downGlassInfoDTOList = downGlassInfoService.queryWorkStationIsIn(Boolean.TRUE); |
| | | List<String> downGlassFlowList = downGlassInfoDTOList.stream().map(item -> item.getFlowCardId() + ":" + item.getLayer()).collect(Collectors.toList()); |
| | | if (CollectionUtils.isEmpty(downGlassFlowList)) { |
| | | //架子都未绑定流程卡,出笼内子数量最多尺寸最大的玻璃 |
| | | DownStorageCageDetails downStorageCageDetails = downStorageCageDetailsService.getGlassInfoMaxCount(); |
| | | //绑定流程卡,更新玻璃状态,生成出片任务, |
| | | tempGlassId = downStorageCageDetails.getGlassId(); |
| | | isBind = Boolean.TRUE; |
| | | break loop; |
| | | } |
| | | //将笼子内的玻璃进行过滤,仅获取无法落架的流程卡玻璃 |
| | | List<DownStorageCageDetails> noDownLoadList = list.stream().filter(item -> !downGlassFlowList.contains(item.getFlowCardId() + ":" + item.getLayer())).collect(Collectors.toList()); |
| | | if (CollectionUtils.isNotEmpty(noDownLoadList)) { |
| | | //是否有空架子 |
| | | // List<DownWorkstation> emptyShelfList = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() |
| | | // .isNull(DownWorkstation::getFlowCardId)); |
| | | if (isEmptyShelf) { |
| | | DownStorageCageDetails downStorageCageDetails = downStorageCageDetailsService.getGlassInfoMaxCount(); |
| | | //绑定流程卡,更新玻璃状态,生成出片任务 |
| | | tempGlassId = downStorageCageDetails.getGlassId(); |
| | | isBind = Boolean.TRUE; |
| | | break loop; |
| | | } |
| | | } |
| | | //将笼子内的玻璃进行过滤,仅获取可落架的流程卡玻璃 |
| | | List<DownStorageCageDetails> downLoadList = list.stream().filter(item -> downGlassFlowList.contains(item.getFlowCardId() + ":" + item.getLayer())).collect(Collectors.toList()); |
| | | if (CollectionUtils.isEmpty(downLoadList)) { |
| | | //不执行出片任务,笼内没有合适的出片玻璃 |
| | | return Boolean.FALSE; |
| | | } |
| | | //将笼内玻璃的流程卡+层号 和落架的流程卡 去重,得出展示无法落架的玻璃,判断玻璃数是否超过阈值 |
| | | //笼内玻璃是否可落架:笼内是否有需要中空的 |
| | | List<DownStorageCageDetails> multiLayerList = list.stream().filter(item -> item.getTotalLayer() >= 2).collect(Collectors.toList()); |
| | | if (CollectionUtils.isNotEmpty(multiLayerList)) { |
| | | for (DownStorageCageDetails item : multiLayerList) { |
| | | DownGlassInfoDTO downGlassInfoDTO = downGlassInfoService.queryDownGlassMaxLayer(item.getFlowCardId()); |
| | | if (null == downGlassInfoDTO) { |
| | | // 历史落架玻璃按照相关流程卡取数据库未找到最多玻璃信息,表明当前流程卡下的有层的玻璃均未落架,直接可出当前玻璃 |
| | | log.info(""); |
| | | isBind = Boolean.FALSE; |
| | | tempGlassId = item.getGlassId(); |
| | | break loop; |
| | | } |
| | | if (downGlassInfoDTO.getLayer().equals(downGlassInfoDTO.getLayer())) { |
| | | log.info("当前玻璃的流程在架子上落架最多,直接出片"); |
| | | //更新玻璃状态,生成出片任务 |
| | | tempGlassId = item.getGlassId(); |
| | | isBind = Boolean.FALSE; |
| | | break loop; |
| | | } |
| | | Integer sequence = downGlassInfoService.queryMaxSequence(item.getFlowCardId(), item.getLayer()); |
| | | log.info("获取当前玻璃需要放的次序:笼内同流程 同层数的通达次序+1:{}", sequence); |
| | | DownGlassInfo downGlassInfo = downGlassInfoService.getOne(new LambdaQueryWrapper<DownGlassInfo>() |
| | | .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; |
| | | break loop; |
| | | } |
| | | } |
| | | } |
| | | |
| | | Map<String, List<DownStorageCageDetails>> singleLayerMap = list.stream().filter(item -> item.getTotalLayer() == 1) |
| | | .collect(Collectors.groupingBy(item -> item.getFlowCardId() + item.getLayer(), Collectors.toList())); |
| | | if (tempGlassId == null) { |
| | | if (CollectionUtils.isNotEmpty(singleLayerMap)) { |
| | | //获取已落架流程卡信息,按落架数量排序 |
| | | for (DownGlassInfoDTO e : downGlassInfoDTOList) { |
| | | List<DownStorageCageDetails> downStorageCageDetails = singleLayerMap.get(e.getFlowCardId() + e.getLayer()); |
| | | if (CollectionUtils.isNotEmpty(downStorageCageDetails)) { |
| | | tempGlassId = downStorageCageDetails.get(0).getGlassId(); |
| | | isBind = Boolean.FALSE; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (tempGlassId == null) { |
| | | log.info("没有找到可以下片的的玻璃,结束任务"); |
| | | return Boolean.FALSE; |
| | | } else { |
| | | //按照出片的玻璃id更新笼内的玻璃状态为已出片 |
| | | return generateDownGlassOutTask(tempGlassId, Const.GLASS_CACHE_TYPE_OUT, isBind, cageDetails); |
| | | } |
| | | } |
| | | |
| | | public Boolean generateDownGlassOutTask(String glassId, Integer taskType, Boolean isBind, DownStorageCageDetails cageDetails) { |
| | | //按玻璃id获取玻璃信息 |
| | | DownStorageCageDetails downStorageCageDetails = null; |
| | | if (glassId.equals(cageDetails.getGlassId())) { |
| | | downStorageCageDetails = cageDetails; |
| | | taskType = 3; |
| | | } else { |
| | | downStorageCageDetails = downStorageCageDetailsService.getOne(new LambdaQueryWrapper<DownStorageCageDetails>() |
| | | .eq(DownStorageCageDetails::getGlassId, glassId)); |
| | | } |
| | | |
| | | Integer endCell = null; |
| | | if (isBind) { |
| | | //获取空架子信息,将空架子信息绑定流程卡 |
| | | DownWorkstation emptyDownWorkstation = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>() |
| | | .isNull(DownWorkstation::getFlowCardId).orderByDesc(DownWorkstation::getWorkstationId).last("limit 1")); |
| | | if (null != emptyDownWorkstation) { |
| | | log.info("获取到空架子信息,绑定流程卡"); |
| | | emptyDownWorkstation.setFlowCardId(downStorageCageDetails.getFlowCardId()); |
| | | emptyDownWorkstation.setLayer(downStorageCageDetails.getLayer()); |
| | | downWorkstationService.updateById(emptyDownWorkstation); |
| | | endCell = emptyDownWorkstation.getWorkstationId(); |
| | | } else { |
| | | log.info("没有空架子信息,无法绑定流程卡"); |
| | | return Boolean.FALSE; |
| | | } |
| | | } else { |
| | | DownWorkstation workstation = downWorkstationService.getOne(new LambdaUpdateWrapper<DownWorkstation>() |
| | | .eq(DownWorkstation::getFlowCardId, downStorageCageDetails.getFlowCardId()).eq(DownWorkstation::getLayer, downStorageCageDetails.getLayer())); |
| | | endCell = workstation.getWorkstationId(); |
| | | } |
| | | //更新详情表内的状态 |
| | | if (downStorageCageDetailsService.update(new LambdaUpdateWrapper<DownStorageCageDetails>() |
| | | .set(DownStorageCageDetails::getState, Const.GLASS_STATE_OUT).eq(DownStorageCageDetails::getGlassId, glassId))) { |
| | | log.info("更新详情表内的状态成功"); |
| | | } else { |
| | | log.info("更新详情表内的状态失败"); |
| | | return Boolean.FALSE; |
| | | } |
| | | //生成任务信息 |
| | | DownGlassInfo downGlassInfo = new DownGlassInfo(); |
| | | BeanUtils.copyProperties(downStorageCageDetails, downGlassInfo); |
| | | downGlassInfoService.save(downGlassInfo); |
| | | //生成任务信息 |
| | | GlassInfo glassInfo = new GlassInfo(); |
| | | BeanUtils.copyProperties(downStorageCageDetails, glassInfo); |
| | | return initDownGlassTask(glassInfo, downStorageCageDetails.getSlot(), endCell, taskType); |
| | | } |
| | | |
| | | public Boolean initDownGlassTask(GlassInfo glassInfo, Integer startCell, Integer endCell, Integer taskType) { |
| | | log.info("玻璃{}生成进片任务", glassInfo.getGlassId()); |
| | | DownGlassTask downGlassTask = new DownGlassTask(); |
| | | downGlassTask.setStartCell(startCell); |
| | | downGlassTask.setGlassId(glassInfo.getGlassId()); |
| | | downGlassTask.setEndCell(endCell); |
| | | downGlassTask.setTaskType(taskType + ""); |
| | | downGlassTask.setWidth((int) glassInfo.getWidth()); |
| | | downGlassTask.setHeight((int) glassInfo.getHeight()); |
| | | downGlassTask.setFlowCardId(glassInfo.getFlowCardId()); |
| | | downGlassTask.setLayer(glassInfo.getLayer()); |
| | | downGlassTask.setTaskStauts(0); |
| | | downGlassTask.setCreateTime(new Date()); |
| | | downGlassTaskService.save(downGlassTask); |
| | | //向plc发送命令 |
| | | return sendMessageToPlc((int) glassInfo.getWidth(), (int) glassInfo.getHeight(), (int) glassInfo.getThickness(), |
| | | startCell, endCell, taskType); |
| | | } |
| | | |
| | | private Boolean sendMessageToPlc(int width, int height, int thickness, int startCell, int endCell, int taskType) { |
| | | S7control s7control = S7object.getinstance().plccontrol; |
| | | PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject; |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Glass_width").getAddress(), (short) width); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Glass_height").getAddress(), (short) height); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Glass_thickness").getAddress(), (short) thickness); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Start_cell").getAddress(), (short) startCell); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("End_cell").getAddress(), (short) endCell); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("task_type").getAddress(), (short) taskType); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("confirmationWord").getAddress(), (short) 1); |
| | | return Boolean.TRUE; |
| | | } |
| | | } |
| | |
| | | {
|
| | | "plcAddressBegin": "DB100.0",
|
| | | "plcAddressLenght": "230",
|
| | | "dataType": "word",
|
| | | "parameteInfor": [
|
| | | {
|
| | | "codeId": "RequestWord",
|
| | | "addressIndex": "0",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G04ID",
|
| | | "addressIndex": "30",
|
| | | "addressLenght": "30"
|
| | | },
|
| | | {
|
| | | "codeId": "G06RobotTaskRequestWord",
|
| | | "addressIndex": "32",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G06ID",
|
| | | "addressIndex": "62",
|
| | | "addressLenght": "30"
|
| | | },
|
| | | {
|
| | | "codeId": "G11RobotTaskRequestWord",
|
| | | "addressIndex": "64",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G011ID",
|
| | | "addressIndex": "94",
|
| | | "addressLenght": "30"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "96",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "98",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "100",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "102",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "MESSendingWord",
|
| | | "addressIndex": "104",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InputGrid",
|
| | | "addressIndex": "106",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "OutputGrid",
|
| | | "addressIndex": "108",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "OutputID",
|
| | | "addressIndex": "110",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "FrontOrRearLowerSlice",
|
| | | "addressIndex": "112",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "114",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G06RobotTaskReply",
|
| | | "addressIndex": "116",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G06Rack",
|
| | | "addressIndex": "118",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G11RobotTaskReply",
|
| | | "addressIndex": "120",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G11Rack",
|
| | | "addressIndex": "122",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "124",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "126",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "128",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "130",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "132",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "134",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "136",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "138",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "MESTaskState",
|
| | | "addressIndex": "140",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "142",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "AlarmState",
|
| | | "addressIndex": "144",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "Alarm1",
|
| | | "addressIndex": "146",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "Alarm2",
|
| | | "addressIndex": "148",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "Alarm3",
|
| | | "addressIndex": "150",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "Alarm4",
|
| | | "addressIndex": "152",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "neirong",
|
| | | "addressIndex": "154",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "device",
|
| | | "addressIndex": "156",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "158",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "160",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InOut1",
|
| | | "addressIndex": "162",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InOut2",
|
| | | "addressIndex": "164",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InOut3",
|
| | | "addressIndex": "166",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InOut4",
|
| | | "addressIndex": "168",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InOut5",
|
| | | "addressIndex": "170",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InOut6",
|
| | | "addressIndex": "172",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "InOut7",
|
| | | "addressIndex": "174",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "176",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "178",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "180",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "182",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "addressIndex": "184",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G04ActionState",
|
| | | "addressIndex": "186",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G05ActionState",
|
| | | "addressIndex": "190",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G06ActionState",
|
| | | "addressIndex": "192",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G07ActionState",
|
| | | "addressIndex": "194",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G08ActionState",
|
| | | "addressIndex": "196",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G09ActionState",
|
| | | "addressIndex": "200",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G10ActionState",
|
| | | "addressIndex": "202",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G11ActionState",
|
| | | "addressIndex": "204",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G12ActionState",
|
| | | "addressIndex": "206",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G13ActionState",
|
| | | "addressIndex": "208",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G04IDS",
|
| | | "addressIndex": "210",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G05IDS",
|
| | | "addressIndex": "212",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G06IDS",
|
| | | "addressIndex": "214",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G07IDS",
|
| | | "addressIndex": "216",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G08IDS",
|
| | | "addressIndex": "218",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G09IDS",
|
| | | "addressIndex": "220",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G10IDS",
|
| | | "addressIndex": "222",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G11IDS",
|
| | | "addressIndex": "224",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G12IDS",
|
| | | "addressIndex": "226",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G13ID",
|
| | | "addressIndex": "230",
|
| | | "addressLenght": "2"
|
| | | }
|
| | | ]
|
| | | "plcAddressBegin": "DB11.0",
|
| | | "plcAddressLenght": "100",
|
| | | "dataType": "word",
|
| | | "parameteInfor": [
|
| | |
|
| | | {
|
| | | "codeId": "requestWord",
|
| | | "addressIndex": "0",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "requestID",
|
| | | "addressIndex": "2",
|
| | | "addressLenght": "30"
|
| | | },
|
| | | {
|
| | | "codeId": "currentCell",
|
| | | "addressIndex": "32",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "glassStatus08",
|
| | | "addressIndex": "36",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G06_glass_status",
|
| | | "addressIndex": "40",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G11_glass_status",
|
| | | "addressIndex": "42",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G13_glass_status",
|
| | | "addressIndex": "44",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G04_error_status",
|
| | | "addressIndex": "48",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G05_error_status",
|
| | | "addressIndex": "50",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G06_error_status",
|
| | | "addressIndex": "52",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "robot_error_status",
|
| | | "addressIndex": "54",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G08_error_status",
|
| | | "addressIndex": "56",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G09_error_status",
|
| | | "addressIndex": "58",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G10_error_status",
|
| | | "addressIndex": "60",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G11_error_status",
|
| | | "addressIndex": "62",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "robot_error_status",
|
| | | "addressIndex": "64",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G13_error_status",
|
| | | "addressIndex": "66",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "confirmationWord",
|
| | | "addressIndex": "72",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G06_prohibit_film_production",
|
| | | "addressIndex": "74",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G11_prohibit_film_production",
|
| | | "addressIndex": "76",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G13_prohibit_film_production",
|
| | | "addressIndex": "78",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "Glass_width",
|
| | | "addressIndex": "82",
|
| | | "addressLenght": "4"
|
| | | },
|
| | | {
|
| | | "codeId": "Glass_height",
|
| | | "addressIndex": "86",
|
| | | "addressLenght": "4"
|
| | | },
|
| | | {
|
| | | "codeId": "Glass_thickness",
|
| | | "addressIndex": "90",
|
| | | "addressLenght": "4"
|
| | | },
|
| | | {
|
| | | "codeId": "Start_cell",
|
| | | "addressIndex": "94",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "End_cell",
|
| | | "addressIndex": "96",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "task_type",
|
| | | "addressIndex": "98",
|
| | | "addressLenght": "2"
|
| | | }
|
| | |
|
| | | ]
|
| | | } |
| | |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://192.168.10.2:1433;databasename=hangzhoumes |
| | | url: jdbc:sqlserver://192.168.30.101:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: cz |
| | | active: dev |
| | | application: |
| | | name: unLoadGlass |
| | | |
| | |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | |
| | | mes: |
| | | maxWidth: 1000 #下片的最大宽度 |
| | | maxHeight: 1000 #下片的最大高度 |
| | | throughWidth: 3000 |
| | | throughHeight: 3000 |
| | | threshold: 5 #下片的最大阈值 |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.mes.downglassinfo.mapper.DownGlassInfoMapper"> |
| | | |
| | | <resultMap id="downGlassInfoDTO" type="com.mes.downworkstation.entity.dto.DownGlassInfoDTO"> |
| | | <result column="flow_card_id" property="flowCardId"/> |
| | | <result column="layer" property="layer"/> |
| | | <result column="count" property="count"/> |
| | | </resultMap> |
| | | <resultMap id="downGlassInfo" type="com.mes.downworkstation.entity.dto.DownGlassInfoDTO"> |
| | | <result column="flow_card_id" property="flowCardId"/> |
| | | <result column="layer" property="layer"/> |
| | | <result column="count" property="count"/> |
| | | <collection property="glassInfoList" ofType="com.mes.glassinfo.entity.GlassInfo"> |
| | | <id column="id" property="id"/> |
| | | <result column="flow_card_id" property="flowCardId"/> |
| | | <result column="glass_type" property="glassType"/> |
| | | <result column="width" property="width"/> |
| | | <result column="height" property="height"/> |
| | | <result column="thickness" property="thickness"/> |
| | | <result column="filmsid" property="filmsid"/> |
| | | <result column="total_layer" property="totalLayer"/> |
| | | <result column="layer" property="layer"/> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | | <select id="queryDownGlassMaxLayer" resultMap="downGlassInfoDTO"> |
| | | SELECT flow_card_id, |
| | | layer, |
| | | COUNT(layer) AS count |
| | | FROM |
| | | down_glass_info |
| | | WHERE |
| | | flow_card_id = #{flowCardId} |
| | | GROUP BY |
| | | flow_card_id, |
| | | layer |
| | | order by count desc limit 1 |
| | | </select> |
| | | <select id="queryMaxSequence" resultType="java.lang.Integer"> |
| | | SELECT max(sequence) + 1 as sequence |
| | | FROM down_glass_info |
| | | WHERE flow_card_id = #{flowCardId} |
| | | AND layer = #{layer} |
| | | </select> |
| | | |
| | | <select id="queryWorkStationIsIn" resultMap="downGlassInfo"> |
| | | SELECT T.* |
| | | <if test="!isDownload"> |
| | | ,T1.* |
| | | </if> |
| | | FROM ( |
| | | SELECT T.FLOW_CARD_ID, |
| | | T.LAYER, |
| | | COUNT(T.LAYER) AS COUNT |
| | | FROM |
| | | DOWN_WORKSTATION T |
| | | LEFT JOIN DOWN_GLASS_INFO T1 ON T.FLOW_CARD_ID = T1.FLOW_CARD_ID |
| | | GROUP BY T.FLOW_CARD_ID,LAYER |
| | | HAVING T.FLOW_CARD_ID IS NOT NULL |
| | | ) T |
| | | INNER JOIN GLASS_INFO T1 ON T.FLOW_CARD_ID = T1.FLOW_CARD_ID |
| | | AND T.LAYER = T1.LAYER |
| | | LEFT JOIN DOWN_GLASS_INFO T2 ON T1.GLASS_ID = T2.GLASS_ID |
| | | <where> |
| | | <if test="isDownload"> |
| | | AND T2.GLASS_ID IS NULL |
| | | </if> |
| | | <if test="!isDownload"> |
| | | AND T2.GLASS_ID IS not NULL |
| | | </if> |
| | | </where> |
| | | order by t.count desc |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.mes.downstorage.mapper.DownStorageCageDetailsMapper"> |
| | | |
| | | <resultMap id="downStorageCageDetails" type="com.mes.downstorage.entity.DownStorageCageDetails"> |
| | | <id column="id" property="id"/> |
| | | <result column="slot" property="slot"/> |
| | | <result column="glass_id" property="glassId"/> |
| | | <result column="sequence" property="sequence"/> |
| | | <result column="filmsid" property="filmsid"/> |
| | | <result column="flow_card_id" property="flowCardId"/> |
| | | <result column="glass_type" property="glassType"/> |
| | | <result column="width" property="width"/> |
| | | <result column="height" property="height"/> |
| | | <result column="thickness" property="thickness"/> |
| | | <result column="tempering_layout_id" property="temperingLayoutId"/> |
| | | <result column="tempering_feed_sequence" property="temperingFeedSequence"/> |
| | | <result column="state" property="state"/> |
| | | <result column="gap" property="gap"/> |
| | | <result column="total_layer" property="totalLayer"/> |
| | | <result column="layer" property="layer"/> |
| | | </resultMap> |
| | | |
| | | <select id="getGlassInfoMaxCount" resultMap="downStorageCageDetails"> |
| | | SELECT * |
| | | FROM DOWN_STORAGE_CAGE_DETAILS |
| | | WHERE (FLOW_CARD_ID, LAYER) = (SELECT FLOW_CARD_ID, LAYER |
| | | FROM DOWN_STORAGE_CAGE_DETAILS |
| | | WHERE STATE = 100 |
| | | GROUP BY FLOW_CARD_ID, LAYER |
| | | ORDER BY COUNT(FLOW_CARD_ID) DESC |
| | | LIMIT 1 ) |
| | | AND STATE = 100 |
| | | ORDER BY |
| | | WIDTH DESC, |
| | | HEIGHT DESC |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | package mes; |
| | | |
| | | import com.mes.UnLoadGlassApplication; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.downglassinfo.service.DownGlassTaskService; |
| | | import com.mes.downglassinfo.service.impl.DownGlassInfoServiceImpl; |
| | | import com.mes.downglassinfo.service.impl.DownGlassTaskServiceImpl; |
| | |
| | | */ |
| | | @Slf4j |
| | | @RunWith(SpringRunner.class) |
| | | @SpringBootTest(classes = UnLoadGlassApplication.class) |
| | | @SpringBootTest(classes = UnLoadGlassApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) |
| | | |
| | | public class UnloadGlassModuleApplicationTest { |
| | | |
| | |
| | | DownStorageCageService downStorageCageService; |
| | | @Autowired |
| | | DownGlassTaskService downGlassTaskService; |
| | | @Autowired |
| | | DownGlassInfoService downGlassInfoService; |
| | | |
| | | |
| | | |
| | |
| | | public void getMaxSequenceByFlowCardId() { |
| | | log.info("最大序号"); |
| | | |
| | | downGlassInfoServiceImpl.getMaxSequenceByFlowCardId("NG2023005"); |
| | | downGlassInfoServiceImpl.getMaxSequenceByFlowCardId("NG2023005",1); |
| | | } |
| | | |
| | | @Test |
| | |
| | | public void getUnloadingTaskState() { |
| | | |
| | | |
| | | downGlassTaskService.getUnloadingTaskState(); |
| | | downGlassInfoService.generateOutGlassTask("NG24031401A01-4-3-1-3"); |
| | | //downGlassTaskService.getUnloadingTaskState(); |
| | | } |
| | | |
| | | @Test |