Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
96个文件已修改
1 文件已重命名
48个文件已添加
156个文件已删除
| | |
| | | .idea/ |
| | | #忽略所有.iml文件 |
| | | *.iml |
| | | #忽略所有日志文件 |
| | | *.log |
| | | |
| | |
| | | export default { |
| | | serverUrl: "10.153.19.150:88/api", |
| | | serverUrl: "127.0.0.1:88/api", |
| | | //serverUrl: "localhost:88/api/", |
| | | serverUrl2: "10.153.19.150:8085" |
| | | serverUrl2: "10.153.19.150:88" |
| | | //serverUrl:"res.abeim.cn" |
| | | } |
| | |
| | | |
| | | //提取菜单模块列表 |
| | | let menuList = $ref([]) |
| | | request.get('/loadGlass/menu/sysMenu/list').then((res) => { |
| | | request.get('/loadGlass/sys/menu/getMenuTree').then((res) => { |
| | | if (res.code == 200) { |
| | | menuList = deepClone(res.data) |
| | | } else { |
| | |
| | | import { createRouter, createWebHistory } from 'vue-router' |
| | | import HomeView from '../views/HomeView.vue' |
| | | import {createRouter, createWebHashHistory} from 'vue-router' |
| | | |
| | | import User from '../views/sys/User.vue' |
| | | import Role from '../views/sys/Role.vue' |
| | | import Menu from '../views/sys/Menu.vue' |
| | | |
| | | const router = createRouter({ |
| | | history: createWebHistory(import.meta.env.BASE_URL), |
| | | history: createWebHashHistory(), |
| | | routes: [ |
| | | { |
| | | path: '/', |
| | |
| | | component: () => import('../views/Caching/caching.vue'), |
| | | children:[ |
| | | { |
| | | path: '/Caching/caching', |
| | | name: 'caching', |
| | | component: () => import('../views/Caching/caching.vue') |
| | | path: '/Caching/cachingbefore', |
| | | name: 'cachingbefore', |
| | | component: () => import('../views/Caching/cachingbefore.vue') |
| | | }, |
| | | { |
| | | path: '/Caching/cachingun', |
| | | name: 'cachingun', |
| | | component: () => import('../views/Caching/cachingun.vue') |
| | | }, |
| | | ] |
| | | }, |
| | |
| | | } |
| | | ] |
| | | }, |
| | | |
| | | /*----------- 可视化系统 ----------------*/ |
| | | { |
| | | path: 'Visualization', |
| | | name: 'screen', |
| | | component: () => import('../views/Visualization/screen.vue'), |
| | | children:[ |
| | | { |
| | | path: '/Visualization/screenone', |
| | | name: 'screenone', |
| | | component: () => import('../views/Visualization/screenone.vue') |
| | | }, |
| | | { |
| | | path: '/Visualization/screentwo', |
| | | name: 'screentwo', |
| | | component: () => import('../views/Visualization/screentwo.vue') |
| | | }, |
| | | { |
| | | path: '/Visualization/screenthree', |
| | | name: 'screenthree', |
| | | component: () => import('../views/Visualization/screenthree.vue') |
| | | } |
| | | ] |
| | | }, |
| | | |
| | | /*----------- 管理系统 ----------------*/ |
| | | { |
| | | path: 'sys', |
| | | name: 'screen', |
| | | component: () => import('../views/Visualization/screen.vue'), |
| | | children: [ |
| | | { |
| | | path: '/sys/users', |
| | | name: 'SysUser', |
| | | component: User |
| | | }, |
| | | { |
| | | path: '/sys/roles', |
| | | name: 'SysRole', |
| | | component: Role |
| | | }, |
| | | { |
| | | path: '/sys/menus', |
| | | name: 'SysMenu', |
| | | component: Menu |
| | | }, |
| | | ] |
| | | }, |
| | | { |
| | | path: '', |
| | | redirect:'/Slicecage/slicecage' |
| | | redirect: '/Slicecage/slicecage' |
| | | } |
| | | ] |
| | | }, |
| | |
| | | <script setup> |
| | | 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 { ref, onMounted } from "vue"; |
| | | // import { ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | // import LanguageMixin from './lang/LanguageMixin' |
| | | |
| | | const tableData = ref([]) |
| | | |
| | | // 发送获取表格数据的请求 |
| | | // const fetchTableData = async () => { |
| | | // try { |
| | | // // 发送获取表格数据的请求,并等待响应 |
| | | // // const response = await request.post("/loadGlass/optimizeProject/listByState", requestData); |
| | | // const response = await request.get("unLoadGlass/downStorage/selectStorageCage"); |
| | | |
| | | // // 检查响应状态 |
| | | // if (response.code === 200) { |
| | | // // 更新表格数据 |
| | | // console.log('成功获取表格数据:', response.data); |
| | | // tableData.splice(0, tableData.length, ...response.data); |
| | | // } else { |
| | | // // 请求失败,显示错误消息 |
| | | // ElMessage.error(response.msg); |
| | | // } |
| | | // } catch (error) { |
| | | // // 处理请求失败的情况 |
| | | // ElMessage.error('获取表格数据失败,请重试'); |
| | | // } |
| | | // }; |
| | | // onMounted(fetchTableData); |
| | | |
| | | |
| | | |
| | | request.get("unLoadGlass/downStorage/selectStorageCage").then((res) => { |
| | | if (res.code == 200) { |
| | | console.log(res.data); |
| | | tableData.value = res.data |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | |
| | | } |
| | | }); |
| | | |
| | | const dialogForm = () => { |
| | | ElMessageBox.confirm( |
| | | '是否报缺?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '是', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | // this.boxa = true |
| | | // this.box = false |
| | | |
| | | }) |
| | | import {ArrowLeftBold, ArrowRight, Search} from "@element-plus/icons-vue" |
| | | import {useRouter} from "vue-router"; |
| | | let indexFlag=$ref(1) |
| | | function changeRouter(index){ |
| | | indexFlag=index |
| | | } |
| | | const open = () => { |
| | | ElMessageBox.confirm( |
| | | '是否删除该条信息?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '是', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功!', |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: '删除失败', |
| | | }) |
| | | }) |
| | | } |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/returns/createReturns', query: { ReturnID: 'TH24010101' }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | alert('我接收到子组件传送的删除信息') |
| | | break |
| | | } |
| | | } |
| | | } |
| | | |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | id: 'OrderList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | showStatus: true |
| | | }, |
| | | data: [ |
| | | { |
| | | 'id': '1', |
| | | 'long': '5', |
| | | 'wide': '1005', |
| | | 'thick': '183.6', |
| | | } |
| | | ] |
| | | |
| | | }) |
| | | |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table height="240" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="id" align="center" label="玻璃ID" min-width="80" /> |
| | | <el-table-column prop="sequence" align="center" label="位置" min-width="120" /> |
| | | <el-table-column prop="width" align="center" label="宽" min-width="120" /> |
| | | <el-table-column prop="height" align="center" label="长" min-width="120" /> |
| | | <el-table-column fixed="right" label="操作" align="center" width="200"> |
| | | <template #default> |
| | | <el-button size="mini" type="text" plain @click="dialogForm">报缺</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | <!-- <div id="main-div"> --> |
| | | |
| | | </div> |
| | | <div id="awatch"> |
| | | <img src="../../assets/woshihuancun.png" alt="" style="width: 60%;height: 90%;margin-left: 260px;margin-top: 20px;"> |
| | | |
| | | </div> |
| | | <div id="main-body"> |
| | | <router-view /> |
| | | </div> |
| | | <!-- </div> --> |
| | | </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{ |
| | | text-align: center; |
| | | margin-top: -15px; |
| | | #main-div{ |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | #message{ |
| | | text-align: center; |
| | | align-items: center; |
| | | color: black; |
| | | width: 200px; |
| | | height: 100px; |
| | | background-color: #337ecc; |
| | | margin-left: 28%; |
| | | #div-title{ |
| | | height: 2%; |
| | | width: 100%; |
| | | } |
| | | #awatch{ |
| | | height: 460px; |
| | | /* margin-top: -60px; */ |
| | | #searchButton{ |
| | | margin-top: -5px; |
| | | margin-left: 1rem; |
| | | } |
| | | /* #searchButton1{ |
| | | //margin-left: 10rem; |
| | | } */ |
| | | /*main-body样式*/ |
| | | #main-body{ |
| | | width: 100%; |
| | | height: 95%; |
| | | /* margin-top: 1%; */ |
| | | } |
| | | #select{ |
| | | margin-left:0.5rem; |
| | | } |
| | | :deep(.indexTag .el-breadcrumb__inner){ |
| | | color: #5CADFE !important; |
| | | } |
| | | </style> |
New file |
| | |
| | | <script setup> |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {reactive} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | const router = useRouter() |
| | | const adda = ref(false) |
| | | |
| | | import request from "@/utils/request" |
| | | import { ref, onMounted } from "vue"; |
| | | // import { ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | // import LanguageMixin from './lang/LanguageMixin' |
| | | |
| | | const tableData = ref([]) |
| | | const slot = ref('') |
| | | |
| | | |
| | | request.post("/cacheGlass/edgStorageCage/selectEdgStorageCage").then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | console.log(res.data); |
| | | tableData.value = res.data |
| | | console.log(res.data[0].slot); |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | |
| | | } |
| | | }); |
| | | |
| | | // const getTableRow = (row,type) =>{ |
| | | // switch (type) { |
| | | // case 'delete':{ |
| | | // let flowData = ref({ |
| | | // id:0, |
| | | // slot:row.slot |
| | | // }) |
| | | // request.post("/cacheGlass/edgStorageCage/edgStorageCageGlass",flowData.value).then((res) => { |
| | | // if(res.code==200){ |
| | | // ElMessage.success(t('searchOrder.msgDeleteSuccess')) |
| | | // router.push({path:'/main/delivery/selectDelivery',query:{random:Math.random()}}) |
| | | // }else{ |
| | | // ElMessage.warning(res.msg) |
| | | // router.push("/login") |
| | | // } |
| | | // }) |
| | | |
| | | // return |
| | | // } |
| | | // } |
| | | // } |
| | | // let slots = ref({ |
| | | // id:0, |
| | | // slot: slot.value |
| | | // }) |
| | | const open = async(row) => { |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | '是否删除该条信息?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '是', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | // 用户点击了“是”,现在调用删除接口 |
| | | const deleteResponse = await request.post("/cacheGlass/edgStorageCage/edgStorageCageGlass", { |
| | | id:0, |
| | | slot: row.slot |
| | | }) |
| | | if (response.code == 200) { |
| | | // 删除成功,您可以根据需要处理成功的情况 |
| | | alert('删除成功!'); |
| | | } else { |
| | | // 删除失败,您可以处理错误或显示错误信息给用户 |
| | | alert('删除失败:' + deleteResponse.message); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | // 处理可能出现的错误,比如 ElMessageBox 抛出的异常等 |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | // const open = () => { |
| | | // ElMessageBox.confirm( |
| | | // '是否删除该条信息?', |
| | | // '提示', |
| | | // { |
| | | // confirmButtonText: '是', |
| | | // cancelButtonText: '取消', |
| | | // type: 'warning', |
| | | // } |
| | | // ) |
| | | // .then(() => { |
| | | // ElMessage({ |
| | | // type: 'success', |
| | | // message: '删除成功!', |
| | | // }) |
| | | // }) |
| | | // .catch(() => { |
| | | // ElMessage({ |
| | | // type: 'info', |
| | | // message: '删除失败', |
| | | // }) |
| | | // }) |
| | | // } |
| | | // 删除 |
| | | // const handleBindRacka = (row) => { |
| | | // adda.value = true; // 打开绑定架子对话框 |
| | | // }; |
| | | // // 删除 |
| | | // const handleConfirma = async () => { |
| | | // try { |
| | | // window.localStorage.setItem('slot', res.data.slot) |
| | | // let slot = window.localStorage.getItem('slot') |
| | | // const response = await request.post('/cacheGlass/edgStorageCage/edgStorageCageGlass', { |
| | | // slot: slot.value, |
| | | // id: 0 |
| | | // }); |
| | | |
| | | // if (response.code == 200) { |
| | | // // 绑定成功,处理逻辑 |
| | | // ElMessage.success(response.message); |
| | | // adda.value = false; |
| | | // } else { |
| | | // // 请求失败,显示错误消息 |
| | | // ElMessage.error(response.msg); |
| | | // } |
| | | // } catch (error) { |
| | | // // 处理错误 |
| | | // console.error(error); |
| | | // } |
| | | // }; |
| | | |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | id: 'OrderList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | showStatus: true |
| | | }, |
| | | data: [ |
| | | { |
| | | 'id': '1', |
| | | 'long': '5', |
| | | 'wide': '1005', |
| | | 'thick': '183.6', |
| | | } |
| | | ] |
| | | |
| | | }) |
| | | |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table height="240" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="slot" align="center" label="栅格号" min-width="80" /> |
| | | <el-table-column prop="glass_id" align="center" label="玻璃编号" min-width="80" /> |
| | | <el-table-column prop="width" align="center" label="宽" min-width="120" /> |
| | | <el-table-column prop="height" align="center" label="高" min-width="120" /> |
| | | <el-table-column |
| | | align="center" |
| | | label="启用状态" |
| | | min-width="80" |
| | | prop="enable_state" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag type="success" >{{ scope.row.enable_state==1?"启用":"未启用" }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="操作" align="center" width="200"> |
| | | <template #default="scope"> |
| | | <!-- <el-button size="mini" type="text" plain @click="handleBindRacka(scope.row)">报缺</el-button> --> |
| | | <el-button size="mini" type="text" plain @click="open(scope.row)">报缺</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | <!-- <el-dialog v-model="adda" top="30vh" width="25%" title="是否删除该条信息?" > |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleConfirma"> |
| | | 确认 |
| | | </el-button> |
| | | <el-button @click="adda = false">取消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> --> |
| | | </div> |
| | | <div id="awatch"> |
| | | <img src="../../assets/woshihuancun.png" alt="" style="width: 60%;height: 90%;margin-left: 260px;margin-top: 20px;"> |
| | | <div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: -124px;margin-left: 480px;"></div> |
| | | <div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: -30px;margin-left: 850px;"></div> |
| | | <div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: 30px;margin-left: 695px;"></div> |
| | | </div> |
| | | </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{ |
| | | text-align: center; |
| | | margin-top: -15px; |
| | | } |
| | | #message{ |
| | | text-align: center; |
| | | align-items: center; |
| | | color: black; |
| | | width: 200px; |
| | | height: 100px; |
| | | background-color: #337ecc; |
| | | margin-left: 28%; |
| | | } |
| | | #awatch{ |
| | | height: 460px; |
| | | /* margin-top: -60px; */ |
| | | } |
| | | </style> |
New file |
| | |
| | | <script setup> |
| | | 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 { ref, onMounted } from "vue"; |
| | | // import { ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | // import LanguageMixin from './lang/LanguageMixin' |
| | | |
| | | const tableData = ref([]) |
| | | |
| | | // 发送获取表格数据的请求 |
| | | // const fetchTableData = async () => { |
| | | // try { |
| | | // // 发送获取表格数据的请求,并等待响应 |
| | | // // const response = await request.post("/loadGlass/optimizeProject/listByState", requestData); |
| | | // const response = await request.get("unLoadGlass/downStorage/selectStorageCage"); |
| | | |
| | | // // 检查响应状态 |
| | | // if (response.code === 200) { |
| | | // // 更新表格数据 |
| | | // console.log('成功获取表格数据:', response.data); |
| | | // tableData.splice(0, tableData.length, ...response.data); |
| | | // } else { |
| | | // // 请求失败,显示错误消息 |
| | | // ElMessage.error(response.msg); |
| | | // } |
| | | // } catch (error) { |
| | | // // 处理请求失败的情况 |
| | | // ElMessage.error('获取表格数据失败,请重试'); |
| | | // } |
| | | // }; |
| | | // onMounted(fetchTableData); |
| | | |
| | | |
| | | |
| | | request.get("unLoadGlass/downStorage/selectStorageCage").then((res) => { |
| | | if (res.code == 200) { |
| | | console.log(res.data); |
| | | tableData.value = res.data |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | |
| | | } |
| | | }); |
| | | |
| | | const dialogForm = () => { |
| | | ElMessageBox.confirm( |
| | | '是否报缺?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '是', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | // this.boxa = true |
| | | // this.box = false |
| | | |
| | | }) |
| | | } |
| | | const open = () => { |
| | | ElMessageBox.confirm( |
| | | '是否删除该条信息?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '是', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功!', |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: '删除失败', |
| | | }) |
| | | }) |
| | | } |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/returns/createReturns', query: { ReturnID: 'TH24010101' }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | alert('我接收到子组件传送的删除信息') |
| | | break |
| | | } |
| | | } |
| | | } |
| | | |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | id: 'OrderList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | showStatus: true |
| | | }, |
| | | data: [ |
| | | { |
| | | 'id': '1', |
| | | 'long': '5', |
| | | 'wide': '1005', |
| | | 'thick': '183.6', |
| | | } |
| | | ] |
| | | |
| | | }) |
| | | |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table height="240" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="id" align="center" label="玻璃ID" min-width="80" /> |
| | | <el-table-column prop="sequence" align="center" label="位置" min-width="120" /> |
| | | <el-table-column prop="width" align="center" label="宽" min-width="120" /> |
| | | <el-table-column prop="height" align="center" label="长" min-width="120" /> |
| | | <el-table-column fixed="right" label="操作" align="center" width="200"> |
| | | <template #default> |
| | | <el-button size="mini" type="text" plain @click="dialogForm">报缺</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | |
| | | </div> |
| | | <div id="awatch"> |
| | | <img src="../../assets/woshihuancun.png" alt="" style="width: 60%;height: 90%;margin-left: 260px;margin-top: 20px;"> |
| | | <div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: -124px;margin-left: 480px;"></div> |
| | | <div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: -30px;margin-left: 850px;"></div> |
| | | <div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: 30px;margin-left: 695px;"></div> |
| | | </div> |
| | | </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{ |
| | | text-align: center; |
| | | margin-top: -15px; |
| | | } |
| | | #message{ |
| | | text-align: center; |
| | | align-items: center; |
| | | color: black; |
| | | width: 200px; |
| | | height: 100px; |
| | | background-color: #337ecc; |
| | | margin-left: 28%; |
| | | } |
| | | #awatch{ |
| | | height: 460px; |
| | | /* margin-top: -60px; */ |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <el-card style="margin-left: 10px; margin-top: 10px; margin-right: 10px;" v-loading="loading"> |
| | | <div style="display: flex;margin-bottom: 30px;"> |
| | | <div style="margin-left: 400px; font-size: 20px;">工程号:P20240305001 </div> |
| | | <div style="margin-left: 150px; font-size: 20px;">版图编号:1</div> |
| | | </div> |
| | | <el-scrollbar height="650px"> |
| | | <div id="home-card"> |
| | | <div id="home-item" v-for="n in 20" :key="n"> |
| | | <svg width="100%" height="400" xmlns="http://www.w3.org/2000/svg" style="margin-top: -100px;margin-left: -80px;"> |
| | | <defs> |
| | | <marker id="arrow" markerUnits="strokeWidth" markerWidth="12" markerHeight="12" viewBox="0 0 12 12" refX="6" |
| | | refY="6" orient="auto"> |
| | | <path d="M2,2 L10,6 L2,10 L2,2" style="fill: #911005;" /> |
| | | </marker> |
| | | </defs> |
| | | <g v-for="(rack, index) in racks" :key="index"> |
| | | <rect |
| | | :x="rack.x" |
| | | :y="rack.y" |
| | | :width="rack.width" |
| | | :height="rack.height" |
| | | :fill="rack.fillColor" |
| | | :data-index="index" |
| | | class="rack-rect" |
| | | style="stroke:#c8c9cc;stroke-width:3;" |
| | | @click="showRectInfo(rack)" |
| | | /> |
| | | <line x1='510' y1='309' x2='260' y2='310' stroke='#911005' stroke-width='2' marker-end='url(#arrow)'> |
| | | </line> |
| | | <text x="370" y="240" dominant-baseline="middle" text-anchor="middle">NG2024030501A-01</text> |
| | | <text x="370" y="260" dominant-baseline="middle" text-anchor="middle">500*300</text> |
| | | |
| | | <g v-for="(item, itemIndex) in rack.items" :key="itemIndex"> |
| | | <rect |
| | | :x="calculateItemXPosition(rack, item, itemIndex)" |
| | | :y="calculateItemYPosition(rack, item, itemIndex)" |
| | | :width="item.width" |
| | | :height="item.height" |
| | | :fill="item.fillColor" |
| | | /> |
| | | </g> |
| | | </g> |
| | | </svg> |
| | | </div> |
| | | </div> |
| | | </el-scrollbar> |
| | | </el-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import Swal from 'sweetalert2' |
| | | import request from "@/utils/request"; |
| | | |
| | | |
| | | request.get("/TidyUpGlassModule/CurrentCutTerritory").then((res) => { |
| | | if (res.code == 200) { |
| | | console.log(res.data); |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }); |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | loading: false, |
| | | racks: [ |
| | | { |
| | | x: 70, y: 126, width: 600, height: 240, fillColor: '#93d2f3', |
| | | items: [ |
| | | { position: 'top-left', width: 40, height: 30, fillColor: '#ffffff', content: 'NG123456',y: '20'}, |
| | | { position: 'bottom-left', width: 40, height: 30, fillColor: '#ffffff', content: 'NG1234567' }, |
| | | { position: 'bottom-right', width: 40, height: 30, fillColor: '#ffffff', content: 'NG12345678' } |
| | | ] |
| | | }, |
| | | |
| | | // Add more racks and items here as needed |
| | | ], |
| | | }; |
| | | }, |
| | | <template> |
| | | <!-- <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading"> --> |
| | | <div id="app" style="margin-top: 20px;"> |
| | | <div |
| | | :style="{ width: `${olWidth}px`, height: `${olHeight}px`,position: 'relative' }" |
| | | > |
| | | <div |
| | | v-for="(rect, index) in adjustedRects" |
| | | :key="index" |
| | | class="rect" |
| | | :style="{ position: 'absolute', top: `${rect.y_axis}px`, left: `${rect.x_axis}px`, width: `${rect.width}px`, height: `${rect.height}px` }" |
| | | > |
| | | <!-- 箭头 --> |
| | | <div id="arrow"></div> |
| | | <div id="line"></div> |
| | | <div class="centered-text" >NG24030401B01</div> |
| | | <!-- <div v-if="process_id" class="centered-text">{{ process_id }}</div> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | methods: { |
| | | calculateItemXPosition(rack, item, index) { |
| | | if (item.position === 'top-right' || item.position === 'bottom-right') { |
| | | return Math.min(rack.x + rack.width - item.width, rack.x + rack.width); |
| | | } else { |
| | | return rack.x; |
| | | } |
| | | }, |
| | | |
| | | calculateItemYPosition(rack, item, index) { |
| | | if (item.position === 'bottom-left' || item.position === 'bottom-right') { |
| | | return Math.min(rack.y + rack.height - item.height, rack.y + rack.height); |
| | | } else { |
| | | return rack.y; |
| | | } |
| | | }, |
| | | |
| | | showCustomAlert(content) { |
| | | Swal.fire({ |
| | | // type: 'warning', // 弹框类型 |
| | | title: '该片玻璃状态', //标题 |
| | | // text: "注销后将无法恢复,请谨慎操作!", //显示内容 |
| | | <script setup> |
| | | import { ref, onMounted } from 'vue'; |
| | | import request from "@/utils/request" |
| | | const olWidth = ref(); |
| | | const olHeight = ref(); |
| | | const process_id = ref(); // 用于存储process_id的响应式引用 |
| | | // const rects = ref([]); // 用于存储矩形数据的响应式引用 |
| | | const adjustedRects = ref([]); |
| | | onMounted(async () => { |
| | | try { |
| | | const response = await request.post('/cacheGlass/taskCache/currentCutTerritory'); // 替换为你的API端点 |
| | | if (response.code === 200) { |
| | | // const process_id = response.data[0].process_id |
| | | const rawRects = response.data; // 设置矩形数据 |
| | | console.log(response.data); |
| | | const { olWidth: newolWidth, olHeight: newolHeight, process_id: newprocess_id } = response.data; // 获取尺寸 |
| | | olWidth.value = newolWidth; // 设置容器宽度 |
| | | olHeight.value = newolHeight; // 设置容器高度 |
| | | process_id.value = newprocess_id; |
| | | |
| | | confirmButtonColor: '#3085d6',// 确定按钮的 颜色 |
| | | confirmButtonText: '人工拿走',// 确定按钮的 文字 |
| | | showCancelButton: true, // 是否显示取消按钮 |
| | | cancelButtonColor: '#d33', // 取消按钮的 颜色 |
| | | cancelButtonText: "破损", // 取消按钮的 文字 |
| | | adjustedRects.value = rawRects.map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | | x_axis: (rect.x_axis*100) * 0.005, // 将x值除以3 |
| | | y_axis: (rect.y_axis*100) * 0.005, |
| | | width: (rect.width*100) * 0.004 , |
| | | height:( rect.height*100) * 0.004 , |
| | | })); |
| | | console.log(rect); |
| | | |
| | | // focusCancel: true, // 是否聚焦 取消按钮 |
| | | reverseButtons: true // 是否 反转 两个按钮的位置 默认是 左边 确定 右边 取消 |
| | | }).then((isConfirm) => { |
| | | try { |
| | | //判断 是否 点击的 确定按钮 |
| | | if (isConfirm.value) { |
| | | Swal.fire("人工拿走", "点击了人工拿走", "success"); |
| | | } |
| | | else { |
| | | Swal.fire("破损", "点击了破损", "error"); |
| | | } |
| | | } catch (e) { |
| | | alert(e); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | showRectInfo(rectInfo) { |
| | | const contents = rectInfo.items.map(item => item.content).join(', '); |
| | | this.$nextTick(() => { |
| | | this.showCustomAlert(contents); |
| | | }); |
| | | }, |
| | | } |
| | | }; |
| | | </script> |
| | | // console.log( (rect.width*100) / 300 ); |
| | | } else { |
| | | // console.error('Failed to fetch rectangles from API.'); |
| | | console.error('Failed to fetch rects from API.'); |
| | | } |
| | | } catch (error) { |
| | | // console.error('Error fetching rectangles :', error); |
| | | console.error('Error fetching rects :', error); |
| | | } |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .rect { |
| | | border: 1px solid black; /* 设置矩形的边框 */ |
| | | background-color: lightblue; /* 设置矩形的背景色 */ |
| | | } |
| | | .centered-text { |
| | | /* 设置文字居中样式 */ |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | height: 100%; /* 确保div占据整个矩形的高度 */ |
| | | } |
| | | #rect { |
| | | position: relative; /* 确保箭头可以相对于矩形定位 */ |
| | | /* 其他样式 */ |
| | | } |
| | | |
| | | <style scoped> |
| | | .glass-rack { |
| | | width: 100%; |
| | | height: 80vh; |
| | | } |
| | | .rack-rect:hover { |
| | | cursor: pointer; |
| | | } |
| | | .custom-popover-class { |
| | | background-color: lightgrey; |
| | | color: black; |
| | | border: 1px solid black; |
| | | } |
| | | |
| | | #home-card { |
| | | width: 100%; |
| | | overflow: hidden; |
| | | padding: 10px 0px; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | #home-item { |
| | | border-style: solid; |
| | | border-width: 1px; |
| | | border-color: #E4E4E4; |
| | | width: calc(34% - 20px); |
| | | padding: 20px 0px 20px 20px; |
| | | margin-right: 20px; |
| | | margin-bottom: 10px; |
| | | display: flex; |
| | | justify-content: center; |
| | | /* align-items: center; */ |
| | | background: #fff; |
| | | width: 700px; |
| | | #home-img { |
| | | display: inline-block; |
| | | width: 160px; |
| | | height: 60px; |
| | | margin: 0; |
| | | padding: 0; |
| | | } |
| | | #home-right { |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: center; |
| | | align-items: flex-start; |
| | | margin-left: 10px; |
| | | #home-num { |
| | | font-size: 40px; |
| | | margin: 5px 0; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | #arrow { |
| | | position: absolute; |
| | | top: 70%; /* 箭头位于矩形中间 */ |
| | | left: 200px; /* 箭头在矩形左侧一些距离 */ |
| | | transform: translateY(-50%); /* 垂直居中 */ |
| | | width: 0; |
| | | height: 0; |
| | | border-top: 10px solid transparent; /* 上边框 */ |
| | | border-bottom: 10px solid transparent; /* 下边框 */ |
| | | border-right: 20px solid #911005; /* 右边框,形成箭头 */ |
| | | /* 根据需要调整边框大小和颜色 */ |
| | | } |
| | | |
| | | #line { |
| | | position: absolute; |
| | | top: 70%; /* 直线位于矩形中间 */ |
| | | left: 210px; /* 直线在箭头右侧一些距离 */ |
| | | transform: translateY(-50%); /* 垂直居中 */ |
| | | height: 2px; /* 直线的高度 */ |
| | | width: 240px; /* 直线的长度,根据需要调整 */ |
| | | background-color: #911005; /* 直线的颜色 */ |
| | | } |
| | | </style> |
| | |
| | | if (valid) { |
| | | loginLoadings.value = true |
| | | request |
| | | .post('/loadGlass/userinfo/login', userForm) |
| | | .post('/loadGlass/sys/user/login', userForm) |
| | | .then((res) => { |
| | | if (res['code'] == 200) { |
| | | store.$patch({user: res.data}) |
| | |
| | | ElMessage.success(`登录成功`) |
| | | } else { |
| | | ElMessage.error(res['msg']) |
| | | store.$patch({ |
| | | user: null, |
| | | }) |
| | | loginLoadings.value = false |
| | | return false |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | ElMessage.error('服务器连接失败') |
| | | store.$patch({ |
| | | user: null, |
| | | }) |
| | | loginLoadings.value = false |
| | | return false |
| | | }) |
| | |
| | | <div v-if="dialogFormVisible" > |
| | | <el-card style="margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading"> |
| | | <div style="display: flex;margin-bottom: 20px;"> |
| | | <div style="margin-left: 400px;font-size: 20px;">工程号:P20240305001 </div> |
| | | <div style="margin-left: 450px;font-size: 20px;">工程号:P20240305001 </div> |
| | | <div style="margin-left: 150px;font-size: 20px;">版图编号:1</div> |
| | | </div> |
| | | <div> |
| | | <div id="boxa" style="width: 400px;height: 120px;margin-left: 260px;"> |
| | | <div id="boxa" style="width: 200px;height: 300px;margin-left: 70px;"> |
| | | <div style="margin-top: 35px;"> NG202405060798A01-1</div> |
| | | <div> 500×1500</div> |
| | | <div> 500×1000</div> |
| | | </div> |
| | | <div id="boxa" style="width: 400px;height: 120px;"> |
| | | <div id="boxa" style="width: 200px;height: 300px;"> |
| | | <div style="margin-top: 35px;"> NG202405060798A01-1</div> |
| | | <div> 500×1500</div> |
| | | <div> 500×1000</div> |
| | | </div> |
| | | <div id="boxa" style="width: 200px;height: 300px;"> |
| | | <div style="margin-top: 35px;"> NG202405060798A01-1</div> |
| | | <div> 500×1000</div> |
| | | </div> |
| | | <div id="boxa" style="width: 200px;height: 300px;"> |
| | | <div style="margin-top: 35px;"> NG202405060798A01-1</div> |
| | | <div> 500×1000</div> |
| | | </div> |
| | | <div id="boxa" style="width: 200px;height: 300px;"> |
| | | <div style="margin-top: 35px;"> NG202405060798A01-1</div> |
| | | <div> 500×1000</div> |
| | | </div> |
| | | <div id="boxa" style="width: 200px;height: 300px;"> |
| | | <div style="margin-top: 35px;"> NG202405060798A01-1</div> |
| | | <div> 500×1000</div> |
| | | </div> |
| | | </div> |
| | | <div style="margin-top: 20px;"> |
| | | <div id="boxa" style="width: 400px;height: 120px;margin-left: 260px;"> |
| | | <div id="boxa" style="width: 200px;height: 300px;margin-left: 70px;"> |
| | | <div style="margin-top: 35px;"> NG202405060798A01-1</div> |
| | | <div> 500×1500</div> |
| | | <div> 500×1000</div> |
| | | </div> |
| | | <div id="boxb" style="width: 400px;height: 120px;"> |
| | | <div id="boxa" style="width: 200px;height: 300px;"> |
| | | <div style="margin-top: 35px;"> NG202405060798A01-1</div> |
| | | <div> 500×1500</div> |
| | | <div> 500×1000</div> |
| | | </div> |
| | | <div id="boxa" style="width: 200px;height: 300px;"> |
| | | <div style="margin-top: 35px;"> NG202405060798A01-1</div> |
| | | <div> 500×1000</div> |
| | | </div> |
| | | <div id="boxa" style="width: 200px;height: 300px;"> |
| | | <div style="margin-top: 35px;"> NG202405060798A01-1</div> |
| | | <div> 500×1000</div> |
| | | </div> |
| | | <div id="boxa" style="width: 200px;height: 300px;"> |
| | | <div style="margin-top: 35px;"> NG202405060798A01-1</div> |
| | | <div> 500×1000</div> |
| | | </div> |
| | | <div id="boxb" style="width: 200px;height: 300px;"> |
| | | <div style="margin-top: 35px;"> NG202405060798A01-1</div> |
| | | <div> 500×1000</div> |
| | | </div> |
| | | </div> |
| | | </el-card> |
| | |
| | | import {useRouter} from "vue-router" |
| | | const router = useRouter() |
| | | import type { TableColumnCtx } from 'element-plus' |
| | | |
| | | |
| | | // import { ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | const dialogFormVisible = ref(false) |
| | | const blind = ref(false) |
| | | const blinda = ref(false) |
| | | const blindb = ref(false) |
| | | const add = ref(false) |
| | | const adda = ref(false) |
| | | const flake = ref(false) |
| | | const flakea = ref(false) |
| | | // const value = ref('') |
| | | import request from "@/utils/request" |
| | | |
| | | |
| | | import { ref, onMounted } from "vue"; |
| | | // import http from "@/http/index"; |
| | | |
| | | |
| | | let ruleForm = ref({ |
| | | // engineeringId: '', |
| | | workstationId: '', |
| | | patternHeigth: '', |
| | | patternWidth: '', |
| | | filmsId: '', |
| | | patternThickness: '', |
| | | number: '', |
| | | |
| | | |
| | | }) |
| | | const tableDataa = ref([]) |
| | | |
| | | const requestData = { |
| | | // projectNo:"P24030805", |
| | | state:100 |
| | | }; |
| | | |
| | | |
| | | const tableData = reactive([]); |
| | | // let filterData = ref({ |
| | | // damageDetails: { |
| | | // state: '', |
| | | // }, |
| | | |
| | | |
| | | // }) |
| | | // 发送获取表格数据的请求 |
| | | const fetchTableData = async () => { |
| | | try { |
| | | // 发送获取表格数据的请求,并等待响应 |
| | | // const response = await request.post("/loadGlass/optimizeProject/listByState", requestData); |
| | | const response = await request.get("/loadGlass/up-patten-usage/prioritylist"); |
| | | |
| | | |
| | | // 检查响应状态 |
| | | if (response.code === 200) { |
| | | // 更新表格数据 |
| | | console.log('成功获取表格数据:', response.data); |
| | | tableData.splice(0, tableData.length, ...response.data); |
| | | window.localStorage.setItem('engineeringId', response.data[0].engineeringId) |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | |
| | | if (res.code == 200) { |
| | | console.log(res.data); |
| | | tableDataa.value = res.data |
| | | // workstationId.value = res.data[0].workstationId |
| | | window.localStorage.setItem('patternWidth', res.data.patternWidth) |
| | | window.localStorage.setItem('workstationId', res.data.workstationId) |
| | | let workstationIda = window.localStorage.getItem('workstationId') |
| | | let patternWidth = window.localStorage.getItem('patternWidth') |
| | | if (patternWidth !== '' || workstationIda == '1') { |
| | | flake.value = true |
| | | } else if (patternWidth !== '' || workstationIda == '2') { |
| | | flakea.value = true |
| | | } |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | // router.push("/login") |
| | | } |
| | | }); |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | processType: [], |
| | | |
| | | }) |
| | | // const getBasicData = ref({ |
| | | // id: '', |
| | | // projectNo: '', |
| | | // }) |
| | | // const requestData = { |
| | | // // projectNo:"P24030805", |
| | | // state:100 |
| | | // }; |
| | | // request.post("/loadGlass/optimizeProject/listByState", requestData) |
| | | // .then((res) => { |
| | | // if (res.code == 200) { |
| | | // titleSelectJson.value.processType = res.data; |
| | | // console.log(res.data); |
| | | // } else { |
| | | // ElMessage.warning(res.msg) |
| | | // // router.push("/login") |
| | | // } |
| | | // }); |
| | | // 初始请求参数 |
| | | const requestData = { |
| | | state: 100 |
| | | }; |
| | | // 响应式数据 |
| | | const selectedProjectNo = ref(''); // 当前选中的工程号 |
| | | const options = ref<any[]>([]); // 下拉选项列表 |
| | | |
| | | // 调用接口获取选项数据的函数 |
| | | const fetchOptions = async (queryString: string) => { |
| | | try { |
| | | // 发送请求到后端接口 |
| | | const response = await request.post('/loadGlass/optimizeProject/listByState', { |
| | | ...requestData, |
| | | query: queryString // 将查询字符串作为参数传递 |
| | | }); |
| | | |
| | | if (response.code == 200) { |
| | | titleSelectJson.value.processType = response.data; |
| | | |
| | | }) |
| | | const getBasicData = ref({ |
| | | id: '', |
| | | projectNo: '', |
| | | }) |
| | | request.post("/loadGlass/optimizeProject/listByState", requestData) |
| | | .then((res) => { |
| | | if (res.code == 200) { |
| | | titleSelectJson.value.processType = res.data; |
| | | console.log(res.data); |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }); |
| | | |
| | | // titleSelectJson.value.processType = response.data(item => ({ |
| | | // // options.value = response.data.data.map(item => ({ |
| | | // value: item.projectNo, |
| | | // // label: item.id // 假设后端返回的数据中有 字段作为显示标签 |
| | | // })); |
| | | console.log(response.data); |
| | | |
| | | } else { |
| | | ElMessage.warning(response.data); |
| | | } |
| | | } catch (error) { |
| | | console.error('Error fetching options:', error); |
| | | } |
| | | }; |
| | | |
| | | // 处理用户输入变化的方法 |
| | | const handleInputChange = async (value: string) => { |
| | | if (value) { |
| | | await fetchOptions(value); |
| | | } else { |
| | | options.value = []; // 清空选项列表 |
| | | } |
| | | }; |
| | | |
| | | // 初始化加载数据(如果需要) |
| | | onMounted(() => { |
| | | // 在组件挂载后调用 fetchOptions('') 来加载初始数据(如果需要) |
| | | fetchOptions(''); |
| | | }); |
| | | |
| | | // const billall = () => { |
| | | // request.post("/loadGlass/optimizeProject/listByState", requestData) |
| | | // .then((res: any) => { |
| | |
| | | let titleUploadData = ref({ |
| | | projectNo:'', |
| | | }) |
| | | // const billall = { |
| | | // data () { |
| | | // return { |
| | | // form: { |
| | | // projectNo: '', |
| | | // }, |
| | | // billall:[], |
| | | // } |
| | | // }, |
| | | // methods:{ |
| | | |
| | | // } |
| | | // } |
| | | // const engineeringId = ref(''); |
| | | const workstationId = ref(''); |
| | | const patternHeigth = ref(''); |
| | | const patternWidth = ref(''); |
| | | const filmsId = ref(''); |
| | | const patternThickness = ref(''); |
| | | const number = ref(''); |
| | | |
| | | |
| | | // 添加 |
| | | const handleConfirm = async () => { |
| | | try { |
| | |
| | | patternThickness: patternThickness.value, |
| | | number: number.value |
| | | }); |
| | | |
| | | |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | add.value = false; |
| | | window.localStorage.setItem('workstationId', response.data.workstationId) |
| | | let workstationId = window.localStorage.getItem('workstationId') |
| | | if (workstationId == '1') { |
| | | flake.value = true |
| | | } else if (workstationId == '2'){ |
| | | flakea.value = true |
| | | } |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | |
| | | patternThickness: 0, |
| | | number: 0 |
| | | }); |
| | | |
| | | |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | adda.value = false; |
| | | window.localStorage.setItem('workstationId', response.data.workstationId) |
| | | let workstationId = window.localStorage.getItem('workstationId') |
| | | if (workstationId == '1') { |
| | | flake.value = false |
| | | } else if (workstationId == '2'){ |
| | | flakea.value = false |
| | | } |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | |
| | | console.error(error); |
| | | } |
| | | }; |
| | | onMounted(fetchTableData); |
| | | interface User { |
| | | id: string |
| | | name: string |
| | | amount1: string |
| | | amount2: string |
| | | amount3: number |
| | | } |
| | | |
| | | interface SpanMethodProps { |
| | | row: User |
| | | column: TableColumnCtx<User> |
| | | rowIndex: number |
| | | columnIndex: number |
| | | } |
| | | |
| | | const objectSpanMethod = ({ |
| | | row, |
| | | column, |
| | | rowIndex, |
| | | columnIndex, |
| | | }: SpanMethodProps) => { |
| | | if (columnIndex === 0) { |
| | | if (rowIndex % 2 === 0) { |
| | | return { |
| | | rowspan: 2, |
| | | colspan: 1, |
| | | } |
| | | // 开始上片 |
| | | const handle = async () => { |
| | | try { |
| | | let engineeringId = window.localStorage.getItem('engineeringId') |
| | | console.log(engineeringId); |
| | | if (engineeringId !== '') { |
| | | const response = await request.post('/loadGlass/engineering/engineering/changeTask', { |
| | | engineeringId: engineeringId, |
| | | state: 1, |
| | | }) |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | blind.value = false; |
| | | } else { |
| | | return { |
| | | rowspan: 0, |
| | | colspan: 0, |
| | | } |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } |
| | | } |
| | | |
| | | const open = () => { |
| | | ElMessageBox.confirm( |
| | | '是否删除该条信息?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '是', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功!', |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | else { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: '删除失败', |
| | | message: '工程号不能为空!', |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | // 暂停 |
| | | const handlea = async () => { |
| | | try { |
| | | let engineeringId = window.localStorage.getItem('engineeringId') |
| | | console.log(engineeringId); |
| | | if (engineeringId !== '') { |
| | | const response = await request.post('/loadGlass/engineering/engineering/changeTask', { |
| | | engineeringId: engineeringId, |
| | | state: 0, |
| | | }) |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | blinda.value = false; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } |
| | | else { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: '工程号不能为空!', |
| | | }) |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | // 开始上片 |
| | | const handleb = async () => { |
| | | try { |
| | | let engineeringId = window.localStorage.getItem('engineeringId') |
| | | console.log(engineeringId); |
| | | if (engineeringId !== '') { |
| | | const response = await request.post('/loadGlass/engineering/engineering/changeTask', { |
| | | engineeringId: engineeringId, |
| | | state: 0, |
| | | }) |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | blindb.value = false; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } |
| | | else { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: '工程号不能为空!', |
| | | }) |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | onMounted(fetchTableData); |
| | | |
| | | // const open = () => { |
| | | // ElMessageBox.confirm( |
| | | // '是否删除该条信息?', |
| | | // '提示', |
| | | // { |
| | | // confirmButtonText: '是', |
| | | // cancelButtonText: '取消', |
| | | // type: 'warning', |
| | | // } |
| | | // ) |
| | | // .then(() => { |
| | | // ElMessage({ |
| | | // type: 'success', |
| | | // message: '删除成功!', |
| | | // }) |
| | | // }) |
| | | // .catch(() => { |
| | | // ElMessage({ |
| | | // type: 'info', |
| | | // message: '删除失败', |
| | | // }) |
| | | // }) |
| | | // } |
| | | // 开始上片 |
| | | const handleBind = (row) => { |
| | | // engineeringId.value = row.engineeringId; |
| | | |
| | | blind.value = true; // 打开绑定架子对话框 |
| | | }; |
| | | // 暂停 |
| | | const handleBinda = (row) => { |
| | | // engineeringId.value = row.engineeringId; |
| | | |
| | | blinda.value = true; // 打开绑定架子对话框 |
| | | }; |
| | | // 停止任务 |
| | | const handleBindb = (row) => { |
| | | // engineeringId.value = row.engineeringId; |
| | | |
| | | blindb.value = true; // 打开绑定架子对话框 |
| | | }; |
| | | // 添加 |
| | | const handleBindRack = (row) => { |
| | | workstationId.value = row.workstationId; // 假设rackNumber是架号字段的属性名 |
| | | |
| | | add.value = true; // 打开绑定架子对话框 |
| | | }; |
| | | // 删除 |
| | | const handleBindRacka = (row) => { |
| | | workstationId.value = row.workstationId; // 假设rackNumber是架号字段的属性名 |
| | | |
| | | adda.value = true; // 打开绑定架子对话框 |
| | | }; |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | |
| | | ], |
| | | }) |
| | | </script> |
| | | |
| | | |
| | | <template> |
| | | <div> |
| | | <div id="dotClass"> |
| | |
| | | <el-button style="margin-left: 30px;margin-top: -3px;" >手动确认</el-button> |
| | | </div> |
| | | <el-button style="margin-top: 5px;margin-left: 15px;" id="searchButton" type="primary" @click="dialogFormVisible = true">选择工程</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="primary">开始上片</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="warning" >暂停</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="danger" >停止任务</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="primary" @click="handleBind">开始上片</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="warning" @click="handleBinda">暂停</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="danger" @click="handleBindb">停止任务</el-button> |
| | | |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 15px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table |
| | |
| | | min-width="80" |
| | | prop="state" |
| | | > |
| | | <!-- <el-tag type="success" v-if="damageDetails.state === 1">就绪</el-tag> --> |
| | | <!-- <el-tag type="danger" v-if="row.enableState==2">未就绪</el-tag> --> |
| | | <template #default="scope"> |
| | | <el-tag type="success" >{{ scope.row.state==1?"就绪":"未就绪" }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | |
| | | </el-card> |
| | | <el-dialog v-model="blind" top="30vh" width="25%" title="是否开始上片?" > |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handle"> |
| | | 确认 |
| | | </el-button> |
| | | <el-button @click="blind = false">取消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="blinda" top="30vh" width="25%" title="是否暂停?" > |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handlea"> |
| | | 确认 |
| | | </el-button> |
| | | <el-button @click="blinda = false">取消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="blindb" top="30vh" width="25%" title="是否停止任务?" > |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleb"> |
| | | 确认 |
| | | </el-button> |
| | | <el-button @click="blindb = false">取消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <div id="parent"> |
| | | <img src="../../assets/shangpianji.png" alt="" style="max-width: 20%;max-height: 20%;margin-top: 20px;margin-left: 500px;"> |
| | | <div id="overlay" v-show="flake"></div> |
| | | <div id="overlaya" v-show="flakea"></div> |
| | | </div> |
| | | <div style="margin-top: -350px;margin-left: 650px;"> |
| | | <el-table :data="tableDataa" border style="width: 60%" |
| | |
| | | <el-table-column prop="filmsId" align="center" label="膜系" min-width="80" /> |
| | | <el-table-column prop="number" align="center" label="数量" min-width="80" /> |
| | | <el-table-column fixed="right" label="操作" align="center" width="150"> |
| | | <template #default> |
| | | <el-button size="mini" type="text" plain @click="add = true">添加</el-button> |
| | | <el-button size="mini" type="text" plain @click="adda = true">删除</el-button> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="handleBindRack(scope.row)">添加</el-button> |
| | | <el-button size="mini" type="text" plain @click="handleBindRacka(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <el-dialog v-model="dialogFormVisible" top="24vh" width="30%" title="工程" > |
| | | <div style="margin-left: 50px;margin-bottom: 10px;"> |
| | | <el-form-item label="工程号:" :required="true"> |
| | | <el-select v-model="getBasicData.projectNo" clearable placeholder="请选择工程" style="width: 220px" |
| | | > |
| | | <el-option |
| | | v-for="item in titleSelectJson['processType']" |
| | | :key="item.id" |
| | | :label="item.projectNo" |
| | | :value="item.projectNo" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </div> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="dialogFormVisible = false"> |
| | | 确认 |
| | | </el-button> |
| | | <el-button @click="dialogFormVisible = false">取消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <el-dialog v-model="add" top="23vh" width="45%" title="添加原片" > |
| | | <div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form size="mini" label-width="150px"> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="adda" top="25vh" width="25%" title="是否删除" > |
| | | <el-dialog v-model="adda" top="30vh" width="25%" title="是否删除该条信息?" > |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleConfirma"> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | |
| | | |
| | | <el-dialog v-model="dialogFormVisible" top="24vh" width="30%" title="工程" > |
| | | <div style="margin-left: 50px;margin-bottom: 10px;"> |
| | | <el-form-item label="工程号:" :required="true"> |
| | | <el-select |
| | | v-model="selectedProjectNo" |
| | | filterable |
| | | clearable |
| | | placeholder="请选择工程" |
| | | style="width: 220px" |
| | | @input="handleInputChange" |
| | | > |
| | | <el-option |
| | | v-for="item in titleSelectJson['processType']" |
| | | :key="item.id" |
| | | :label="item.projectNo" |
| | | :value="item.projectNo" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-select v-model="getBasicData.projectNo" clearable placeholder="请选择工程" style="width: 220px" |
| | | > |
| | | <el-option |
| | | v-for="item in titleSelectJson['processType']" |
| | | :key="item.id" |
| | | :label="item.projectNo" |
| | | :value="item.projectNo" |
| | | /> |
| | | </el-select> --> |
| | | </el-form-item> |
| | | </div> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="dialogFormVisible = false"> |
| | | 确认 |
| | | </el-button> |
| | | <el-button @click="dialogFormVisible = false">取消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </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{ |
| | |
| | | width: 212px; |
| | | height: 15px; |
| | | background-color: #529b2e; |
| | | margin-top: -407px; |
| | | margin-left: 171px; |
| | | margin-top: -404px; |
| | | margin-left: 542px; |
| | | } |
| | | #overlaya{ |
| | | position: absolute; |
| | |
| | | width: 212px; |
| | | height: 15px; |
| | | background-color: #529b2e; |
| | | margin-top: -40px; |
| | | margin-left: 167px; |
| | | margin-top: -38px; |
| | | margin-left: 537px; |
| | | } |
| | | |
| | | |
| | | </style> |
| | |
| | | <script lang="ts" setup> |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {reactive} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | import {reactive, ref} from 'vue' |
| | | import {useRouter} from 'vue-router' |
| | | import {ElMessage, ElMessageBox} from 'element-plus' |
| | | |
| | | const router = useRouter() |
| | | |
| | | import { ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | const dialogFormVisible = ref(false) |
| | | const dialogFormVisiblea = ref(false) |
| | | const dialogFormVisibleb = ref(false) |
| | | |
| | | const carposition1 = ref(40) |
| | | const carposition2 = ref(200) |
| | | const timers1 = ref(true) |
| | | const timers2 = ref(true) |
| | | const cellshow = ref(false) |
| | | const cellshow1 = ref(true) |
| | | const cellshow2 = ref(true) |
| | | const million = ref(0) |
| | | const million1 = ref(0) |
| | | |
| | | const loading = null |
| | | const handleSelectionChange = null |
| | | |
| | | const currentPage4 = ref(4) |
| | | const pageSize4 = ref(100) |
| | |
| | | c: '123456789', |
| | | d: '1568251', |
| | | e: '1', |
| | | f: '100', |
| | | f: '100*100', |
| | | g: '', |
| | | }, |
| | | ] |
| | |
| | | c: '123456789', |
| | | d: '1568251', |
| | | e: '1', |
| | | f: '100', |
| | | f: '100*100', |
| | | g: '', |
| | | } |
| | | }, |
| | | ] |
| | | const dialogForm = () => { |
| | | ElMessageBox.confirm( |
| | | '确定要急停吗?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '是', |
| | | cancelButtonText: '否', |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '急停成功!', |
| | | ElMessageBox.confirm('确定要急停吗?', '提示', { |
| | | confirmButtonText: '是', |
| | | cancelButtonText: '否', |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '急停成功!', |
| | | }) |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: '急停失败', |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: '急停失败', |
| | | }) |
| | | }) |
| | | } |
| | | const getTableRow = (row,type) =>{ |
| | | |
| | | 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 == 200) { |
| | | timers1.value = false |
| | | } else if (carposition1.value == 40) { |
| | | timers1.value = true |
| | | } |
| | | if (timers1.value == true) { |
| | | carposition1.value = carposition1.value + 16 |
| | | } else { |
| | | carposition1.value = carposition1.value - 16 |
| | | } |
| | | |
| | | if (carposition2.value == 200) { |
| | | timers2.value = false |
| | | } else if (carposition2.value == 40) { |
| | | timers2.value = true |
| | | } |
| | | if (timers2.value == true) { |
| | | carposition2.value += 16 |
| | | } else { |
| | | carposition2.value -= 16 |
| | | } |
| | | } else { |
| | | } |
| | | } else { |
| | | million1.value = million.value |
| | | if (cellshow.value == true) { |
| | | cellshow.value = false |
| | | } else { |
| | | cellshow.value = true |
| | | } |
| | | if (cellshow1.value == true) { |
| | | cellshow1.value = false |
| | | } else { |
| | | cellshow1.value = true |
| | | } |
| | | if (cellshow2.value == true) { |
| | | cellshow2.value = false |
| | | } else { |
| | | cellshow2.value = true |
| | | } |
| | | } |
| | | }, 100000) |
| | | |
| | | const getTableRow = (row, type) => { |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | case 'edit': { |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/returns/createReturns', query: { ReturnID: 'TH24010101' }}) |
| | | router.push({ |
| | | path: '/main/returns/createReturns', |
| | | query: {ReturnID: 'TH24010101'}, |
| | | }) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | case 'delete': { |
| | | alert('我接收到子组件传送的删除信息') |
| | | break |
| | | } |
| | |
| | | } |
| | | |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | border: 'full', //表格加边框 |
| | | keepSource: true, //保持源数据 |
| | | align: 'center', //文字居中 |
| | | stripe: true, //斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 50}, //鼠标移动或选择高亮 |
| | | id: 'OrderList', |
| | | showFooter: true,//显示脚 |
| | | showFooter: true, //显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | scrollY: {enabled: true}, //开启虚拟滚动 |
| | | showOverflow: true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | useKey: true, |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | filterConfig: { |
| | | //筛选配置项 |
| | | remote: true, |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | storage: true, |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | showStatus: true |
| | | showStatus: true, |
| | | }, |
| | | data: [ |
| | | data: [ |
| | | { |
| | | 'id': '1', |
| | | 'long': '5', |
| | | 'wide': '1005', |
| | | 'thick': '183.6', |
| | | } |
| | | id: '1', |
| | | long: '5', |
| | | wide: '1005', |
| | | thick: '183.6', |
| | | }, |
| | | ], |
| | | }) |
| | | </script> |
| | |
| | | <template> |
| | | <div style="height: 700px;"> |
| | | <!-- <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="primary" @click="dialogFormVisible = true">手动进片</el-button> --> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="primary" @click="dialogFormVisiblea = true">订单信息</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="success" @click="dialogFormVisibleb = true">出片队列</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="danger">终止进片</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="danger">终止出片</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="danger" @click="dialogForm">软急停</el-button> |
| | | |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 5px;" v-loading="loading"> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" |
| | | id="searchButton" |
| | | type="primary" |
| | | @click="dialogFormVisiblea = true">订单信息 |
| | | </el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" |
| | | id="searchButton" |
| | | type="success" |
| | | @click="dialogFormVisibleb = true">出片队列 |
| | | </el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" |
| | | id="searchButton" |
| | | type="danger">终止进片 |
| | | </el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" |
| | | id="searchButton" |
| | | type="danger">终止出片 |
| | | </el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" |
| | | id="searchButton" |
| | | type="danger" |
| | | @click="dialogForm">软急停 |
| | | </el-button> |
| | | |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 5px;" |
| | | v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 100px;"> |
| | | <el-table height="100%" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="id" align="center" label="出片玻璃ID" min-width="80" /> |
| | | <el-table-column prop="a" align="center" label="笼子" min-width="120" /> |
| | | <el-table-column prop="b" align="center" label="格子" min-width="120" /> |
| | | <el-table-column prop="c" align="center" label="工程号" min-width="120" /> |
| | | <el-table-column prop="d" align="center" label="流程卡号" min-width="120" /> |
| | | <el-table-column prop="e" align="center" label="钢化版图号" min-width="157" /> |
| | | <el-table-column prop="f" align="center" label="尺寸" min-width="120" /> |
| | | <el-table-column prop="g" align="center" label="结束任务" min-width="120" /> |
| | | <el-table height="100%" |
| | | ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="id" |
| | | align="center" |
| | | label="出片玻璃ID" |
| | | min-width="80"/> |
| | | <el-table-column prop="a" |
| | | align="center" |
| | | label="笼子" |
| | | min-width="120"/> |
| | | <el-table-column prop="b" |
| | | align="center" |
| | | label="格子" |
| | | min-width="120"/> |
| | | <el-table-column prop="c" |
| | | align="center" |
| | | label="工程号" |
| | | min-width="120"/> |
| | | <el-table-column prop="d" |
| | | align="center" |
| | | label="流程卡号" |
| | | min-width="120"/> |
| | | <el-table-column prop="e" |
| | | align="center" |
| | | label="钢化版图号" |
| | | min-width="157"/> |
| | | <el-table-column prop="f" |
| | | align="center" |
| | | label="尺寸" |
| | | min-width="120"/> |
| | | <el-table-column prop="g" |
| | | align="center" |
| | | label="结束任务" |
| | | min-width="120"> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" |
| | | id="searchButton" |
| | | type="text">完成任务 |
| | | </el-button> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 3px;" v-loading="loading"> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 3px;" |
| | | v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 100px;"> |
| | | <el-table height="100%" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableDatab" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="id" align="center" label="进片玻璃ID" min-width="80" /> |
| | | <el-table-column prop="a" align="center" label="笼子" min-width="120" /> |
| | | <el-table-column prop="b" align="center" label="格子" min-width="120" /> |
| | | <el-table-column prop="c" align="center" label="工程号" min-width="120" /> |
| | | <el-table-column prop="d" align="center" label="流程卡号" min-width="120" /> |
| | | <el-table-column prop="e" align="center" label="钢化版图号" min-width="157" /> |
| | | <el-table-column prop="f" align="center" label="尺寸" min-width="120" /> |
| | | <el-table-column prop="g" align="center" label="结束任务" min-width="120" /> |
| | | <el-table height="100%" |
| | | ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableDatab" |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="id" |
| | | align="center" |
| | | label="进片玻璃ID" |
| | | min-width="80"/> |
| | | <el-table-column prop="a" |
| | | align="center" |
| | | label="笼子" |
| | | min-width="120"/> |
| | | <el-table-column prop="b" |
| | | align="center" |
| | | label="格子" |
| | | min-width="120"/> |
| | | <el-table-column prop="c" |
| | | align="center" |
| | | label="工程号" |
| | | min-width="120"/> |
| | | <el-table-column prop="d" |
| | | align="center" |
| | | label="流程卡号" |
| | | min-width="120"/> |
| | | <el-table-column prop="e" |
| | | align="center" |
| | | label="钢化版图号" |
| | | min-width="157"/> |
| | | <el-table-column prop="f" |
| | | align="center" |
| | | label="尺寸" |
| | | min-width="120"/> |
| | | <el-table-column prop="g" |
| | | align="center" |
| | | label="结束任务" |
| | | min-width="120"> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" |
| | | id="searchButton" |
| | | type="text">完成任务 |
| | | </el-button> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | <div style="padding: 10px;display: flex;height:110px;"> |
| | | <div v-for="n in 9" :key="n" id="occupy"> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#1</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;"/> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#2</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;"/> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#3</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;"/> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#4</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;"/> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#5</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;"/> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#6</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;"/> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#7</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;"/> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <div id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#8</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;"/> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | <!-- <div v-for="n in 8" :key="n" id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#1</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">使用率</span><span id="zhi">33%</span> |
| | | <span id="biao">使用率</span><span id="zhi">35%</span> |
| | | </el-col> |
| | | <hr style="width:80%;margin: 0 auto;" /> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | | <span id="biao">空间(片数)</span><span id="zhi">555</span> |
| | | <span id="biao">空闲(格子数)</span><span id="zhi">555</span> |
| | | </el-col> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | <!-- <div id="awatch"> |
| | | <img src="../../assets/lpl.jpg" alt="" style="width: 10%;height: 10%;margin-left: 160px;"> |
| | | <img src="../../assets/cp.png" alt="" style="width: 70%;height: 70%;margin-left: 160px;"> |
| | | </div> --> |
| | | <!-- // 父级框 --> |
| | | <div class="img-list"> |
| | | <!-- // 浮在上方的图片 --> |
| | | <img class="check-img" src="../../assets/lpl.jpg" alt="" style="width: 13%;height: 12%;margin-left: 160px;"> |
| | | <img class="check-imga" src="../../assets/lpl.jpg" alt="" style="width: 13%;height: 12%;margin-left: 160px;"> |
| | | <!-- // 底图 --> |
| | | <img class="data-img " src="../../assets/dlpl.png" alt="" style="width: 1200px;height: 400px;margin-left: 130px;margin-top: 50px;"> |
| | | </div> |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisible" top="12vh" width="85%" title="请确认玻璃信息" > |
| | | <div style="margin-left: 50px;margin-bottom: 10px;"> |
| | | <div style="display: flex;"> |
| | | <p style="margin-top: 4px;">确认状态:</p> |
| | | <el-button style="margin-left: 10px;size: mini;" type="success">允许</el-button> |
| | | <el-button style="margin-left: 10px;size: mini;" type="danger">不允许</el-button> |
| | | <p style="margin-left: 60px;margin-top: 4px;">当前状态:</p> |
| | | <div style="margin-top: 4px; margin-left: 10px;">手动</div> |
| | | <el-button style="margin-left: 10px;size: mini;" type="primary">切换</el-button> |
| | | <el-input placeholder="请输入玻璃id" style="width: 180px;size: mini;margin-left: 60px;"></el-input> |
| | | <el-button style="margin-left: 10px;size: mini;" type="primary">添加</el-button> |
| | | <p style="margin-left: 60px;margin-top: 4px;">玻璃id:</p> |
| | | <el-input style="width: 180px;size: mini;margin-left: 30px;"></el-input> |
| | | </div> |
| | | <div style="display: flex;"> |
| | | <p style="margin-left: 290px;margin-top: 20px;font-weight: bold;">上片位</p> |
| | | <p style="margin-left: 630px;margin-top: 20px;font-weight: bold;">扫码位</p> |
| | | </div> |
| | | <div style="display: flex;"> |
| | | <div style="margin-top: 20px;"> |
| | | <p style="margin-top: 10px;margin-left: 100px;margin-bottom: 20px;">当前信息</p> |
| | | <el-form label-position="right" label-width="90px"> |
| | | <el-form-item style="width: 20vw" label="玻璃id:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入玻璃id"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="订单编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入订单编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="列表编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入列表编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="箱子编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入箱子编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="长:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入长"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="宽:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入宽"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <!-- // 父级框 --> |
| | | <div class="img-dlpl"> |
| | | <div class="img-car1" |
| | | :style="'z-index:999;left:247px;top:' + carposition1 + 'px;position:absolute;'"> |
| | | <div v-show="cellshow1" |
| | | style="margin-top:10px;width:200px;height:5px;background-color:red;"></div> |
| | | </div> |
| | | <div style="margin-top: 20px;"> |
| | | <p style="margin-top: 10px;margin-left: 100px;margin-bottom: 20px;">修改信息</p> |
| | | <el-form label-position="right" label-width="90px"> |
| | | <el-form-item style="width: 20vw" label="玻璃id:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入玻璃id"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="订单编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入订单编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="列表编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入列表编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="箱子编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入箱子编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="长:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入长"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="宽:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入宽"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <div class="img-car2" |
| | | :style="'z-index:999;left:704px;top:' + carposition2 + 'px;position:absolute;'"> |
| | | <div v-show="cellshow2" |
| | | style="margin-top:10px;width:200px;height:5px;background-color:red;"></div> |
| | | </div> |
| | | <div style="margin-top: 20px;"> |
| | | <p style="margin-top: 10px;margin-left: 100px;margin-bottom: 20px;">修改信息</p> |
| | | <el-form label-position="right" label-width="90px"> |
| | | <el-form-item style="width: 20vw" label="玻璃id:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入玻璃id"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="订单编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入订单编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="列表编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入列表编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="箱子编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入箱子编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="长:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入长"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="宽:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入宽"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div style="margin-top: 20px;"> |
| | | <p style="margin-top: 10px;margin-left: 100px;margin-bottom: 20px;">当前信息</p> |
| | | <el-form label-position="right" label-width="90px"> |
| | | <el-form-item style="width: 20vw" label="玻璃id:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入玻璃id"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="订单编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入订单编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="列表编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入列表编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="箱子编号:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入箱子编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="长:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入长"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" label="宽:"> |
| | | <el-input style="width: 180px" size="mini" placeholder="请输入宽"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div v-show="cellshow" |
| | | style="width: 200px;height: 5px;position: absolute;top:60px;left: 490px;background-color: red;"> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisible" |
| | | top="12vh" |
| | | width="85%" |
| | | title="请确认玻璃信息"> |
| | | <div style="margin-left: 50px;margin-bottom: 10px;"> |
| | | <div style="display: flex;"> |
| | | <p style="margin-top: 4px;">确认状态:</p> |
| | | <el-button style="margin-left: 10px;size: mini;" |
| | | type="success">允许 |
| | | </el-button> |
| | | <el-button style="margin-left: 10px;size: mini;" |
| | | type="danger">不允许 |
| | | </el-button> |
| | | <p style="margin-left: 60px;margin-top: 4px;">当前状态:</p> |
| | | <div style="margin-top: 4px; margin-left: 10px;">手动</div> |
| | | <el-button style="margin-left: 10px;size: mini;" |
| | | type="primary">切换 |
| | | </el-button> |
| | | <el-input placeholder="请输入玻璃id" |
| | | style="width: 180px;size: mini;margin-left: 60px;"></el-input> |
| | | <el-button style="margin-left: 10px;size: mini;" |
| | | type="primary">添加 |
| | | </el-button> |
| | | <p style="margin-left: 60px;margin-top: 4px;">玻璃id:</p> |
| | | <el-input style="width: 180px;size: mini;margin-left: 30px;"></el-input> |
| | | </div> |
| | | <div style="display: flex;"> |
| | | <p style="margin-left: 290px;margin-top: 20px;font-weight: bold;">上片位</p> |
| | | <p style="margin-left: 630px;margin-top: 20px;font-weight: bold;">扫码位</p> |
| | | </div> |
| | | <div style="display: flex;"> |
| | | <div style="margin-top: 20px;"> |
| | | <p style="margin-top: 10px;margin-left: 100px;margin-bottom: 20px;">当前信息</p> |
| | | <el-form label-position="right" |
| | | label-width="90px"> |
| | | <el-form-item style="width: 20vw" |
| | | label="玻璃id:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入玻璃id"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" |
| | | label="订单编号:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入订单编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" |
| | | label="列表编号:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入列表编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" |
| | | label="箱子编号:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入箱子编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" |
| | | label="长:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入长"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" |
| | | label="宽:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入宽"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="dialogFormVisible = false"> |
| | | 确认 |
| | | </el-button> |
| | | <el-button @click="dialogFormVisible = false">取消</el-button> |
| | | <div style="margin-top: 20px;"> |
| | | <p style="margin-top: 10px;margin-left: 100px;margin-bottom: 20px;">修改信息</p> |
| | | <el-form label-position="right" |
| | | label-width="90px"> |
| | | <el-form-item style="width: 20vw" |
| | | label="玻璃id:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入玻璃id"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" |
| | | label="订单编号:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入订单编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" |
| | | label="列表编号:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入列表编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" |
| | | label="箱子编号:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入箱子编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" |
| | | label="长:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入长"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" |
| | | label="宽:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入宽"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div style="margin-top: 20px;"> |
| | | <p style="margin-top: 10px;margin-left: 100px;margin-bottom: 20px;">修改信息</p> |
| | | <el-form label-position="right" |
| | | label-width="90px"> |
| | | <el-form-item style="width: 20vw" |
| | | label="玻璃id:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入玻璃id"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" |
| | | label="订单编号:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入订单编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" |
| | | label="列表编号:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入列表编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" |
| | | label="箱子编号:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入箱子编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" |
| | | label="长:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入长"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" |
| | | label="宽:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入宽"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div style="margin-top: 20px;"> |
| | | <p style="margin-top: 10px;margin-left: 100px;margin-bottom: 20px;">当前信息</p> |
| | | <el-form label-position="right" |
| | | label-width="90px"> |
| | | <el-form-item style="width: 20vw" |
| | | label="玻璃id:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入玻璃id"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" |
| | | label="订单编号:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入订单编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" |
| | | label="列表编号:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入列表编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" |
| | | label="箱子编号:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入箱子编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" |
| | | label="长:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入长"></el-input> |
| | | </el-form-item> |
| | | <el-form-item style="width: 20vw" |
| | | label="宽:"> |
| | | <el-input style="width: 180px" |
| | | size="mini" |
| | | placeholder="请输入宽"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisiblea" top="10vh" width="85%" title="订单信息" > |
| | | <el-input placeholder="请输入工程号" style="width: 180px;size: mini;"></el-input> |
| | | <el-button style="margin-left: 10px;size: mini;" type="primary">查询</el-button> |
| | | <el-table ref="table" style="margin-top: 20px;height: 500px;" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableDataa" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="ida" align="center" label="玻璃id" min-width="80" /> |
| | | <el-table-column prop="typea" align="center" label="工程号" min-width="120" /> |
| | | <el-table-column prop="typea" align="center" label="长" min-width="120" /> |
| | | <el-table-column prop="typea" align="center" label="宽" min-width="120" /> |
| | | <el-table-column prop="typea" align="center" label="厚" min-width="120" /> |
| | | </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> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisibleb" top="10vh" width="85%" title="出片队列" > |
| | | <div style="display: flex;"> |
| | | <p style="margin-top: 4px;">队列状态:</p> |
| | | <p style="margin-top: 4px;">开始</p> |
| | | <el-button style="margin-left: 10px;size: mini;" type="danger">停止</el-button> |
| | | <el-button style="margin-left: 10px;size: mini;" type="primary">添加</el-button> |
| | | </div> |
| | | <el-table ref="table" style="margin-top: 20px;height: 500px;" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableDatab" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="id" align="center" label="铝框id" min-width="80" /> |
| | | <el-table-column prop="type" align="center" label="玻璃id" min-width="120" /> |
| | | <el-table-column prop="type" align="center" label="订单编号" min-width="120" /> |
| | | <el-table-column prop="type" align="center" label="列表编号" min-width="120" /> |
| | | <el-table-column prop="type" align="center" label="箱子编号" min-width="120" /> |
| | | <el-table-column prop="type" align="center" label="长" min-width="120" /> |
| | | <el-table-column prop="type" align="center" label="宽" min-width="120" /> |
| | | <el-table-column prop="type" align="center" label="玻璃状态" min-width="120" /> |
| | | <el-table-column prop="type" align="center" label="顺序" min-width="120" /> |
| | | <el-table-column prop="type" align="center" label="完成" min-width="120" /> |
| | | <el-table-column prop="type" align="center" label="操作" min-width="120" /> |
| | | </el-table> |
| | | </el-dialog> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" |
| | | @click="dialogFormVisible = false"> |
| | | 确认 |
| | | </el-button> |
| | | <el-button @click="dialogFormVisible = false">取消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisiblea" |
| | | top="10vh" |
| | | width="85%" |
| | | title="订单信息"> |
| | | <el-input placeholder="请输入工程号" |
| | | style="width: 180px;size: mini;"></el-input> |
| | | <el-button style="margin-left: 10px;size: mini;" |
| | | type="primary">查询 |
| | | </el-button> |
| | | <el-table ref="table" |
| | | style="margin-top: 20px;height: 500px;" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableDataa" |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="ida" |
| | | align="center" |
| | | label="玻璃id" |
| | | min-width="80"/> |
| | | <el-table-column prop="typea" |
| | | align="center" |
| | | label="工程号" |
| | | min-width="120"/> |
| | | <el-table-column prop="typea" |
| | | align="center" |
| | | label="长" |
| | | min-width="120"/> |
| | | <el-table-column prop="typea" |
| | | align="center" |
| | | label="宽" |
| | | min-width="120"/> |
| | | <el-table-column prop="typea" |
| | | align="center" |
| | | label="厚" |
| | | min-width="120"/> |
| | | </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> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisibleb" |
| | | top="10vh" |
| | | width="85%" |
| | | title="出片队列"> |
| | | <div style="display: flex;"> |
| | | <p style="margin-top: 4px;">队列状态:</p> |
| | | <p style="margin-top: 4px;">开始</p> |
| | | <el-button style="margin-left: 10px;size: mini;" |
| | | type="danger">停止 |
| | | </el-button> |
| | | <el-button style="margin-left: 10px;size: mini;" |
| | | type="primary">添加 |
| | | </el-button> |
| | | </div> |
| | | <el-table ref="table" |
| | | style="margin-top: 20px;height: 500px;" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableDatab" |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="id" |
| | | align="center" |
| | | label="铝框id" |
| | | min-width="80"/> |
| | | <el-table-column prop="type" |
| | | align="center" |
| | | label="玻璃id" |
| | | min-width="120"/> |
| | | <el-table-column prop="type" |
| | | align="center" |
| | | label="订单编号" |
| | | min-width="120"/> |
| | | <el-table-column prop="type" |
| | | align="center" |
| | | label="列表编号" |
| | | min-width="120"/> |
| | | <el-table-column prop="type" |
| | | align="center" |
| | | label="箱子编号" |
| | | min-width="120"/> |
| | | <el-table-column prop="type" |
| | | align="center" |
| | | label="长" |
| | | min-width="120"/> |
| | | <el-table-column prop="type" |
| | | align="center" |
| | | label="宽" |
| | | min-width="120"/> |
| | | <el-table-column prop="type" |
| | | align="center" |
| | | label="玻璃状态" |
| | | min-width="120"/> |
| | | <el-table-column prop="type" |
| | | align="center" |
| | | label="顺序" |
| | | min-width="120"/> |
| | | <el-table-column prop="type" |
| | | align="center" |
| | | label="完成" |
| | | min-width="120"/> |
| | | <el-table-column prop="type" |
| | | align="center" |
| | | label="操作" |
| | | min-width="120"/> |
| | | </el-table> |
| | | </el-dialog> |
| | | |
| | | </template> |
| | | <style scoped> |
| | | #dt { |
| | | display: block; |
| | | float: left; |
| | | line-height: 20px; |
| | | margin-left: 100px; |
| | | } |
| | | |
| | | #dt { display:block; float:left;line-height: 20px;margin-left: 100px;} |
| | | #dta { display:block; float:left;line-height: 20px;margin-left: 80%;} |
| | | #dialog-footer{ |
| | | #dta { |
| | | display: block; |
| | | float: left; |
| | | line-height: 20px; |
| | | margin-left: 80%; |
| | | } |
| | | |
| | | #dialog-footer { |
| | | text-align: center; |
| | | margin-top: -15px; |
| | | } |
| | | #message{ |
| | | |
| | | #message { |
| | | text-align: center; |
| | | align-items: center; |
| | | color: black; |
| | | width: 200px; |
| | | height: 100px; |
| | | background-color: #337ecc; |
| | | margin-left: 28%; |
| | | width: 200px; |
| | | height: 100px; |
| | | background-color: #337ecc; |
| | | margin-left: 28%; |
| | | } |
| | | #awatch{ |
| | | |
| | | #awatch { |
| | | height: 450px; |
| | | } |
| | | |
| | | #occupy { |
| | | height: 100%; |
| | | width: 10%; |
| | | background-color: white; |
| | | margin: 0px 8px 0px 8px; |
| | | border: 1px #EBEEF5 solid; |
| | | text-align: center; |
| | | padding: 5px; |
| | | height: 100%; |
| | | width: 15%; |
| | | background-color: white; |
| | | margin: 0px 8px 0px 8px; |
| | | border: 1px #ebeef5 solid; |
| | | text-align: center; |
| | | padding: 5px; |
| | | } |
| | | #biao { |
| | | font-size: 12px; |
| | | font-size: 12px; |
| | | } |
| | | #zhi { |
| | | font-size: 18px; |
| | | font-weight: bold; |
| | | font-size: 18px; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | #demo-pagination-block + #demo-pagination-block { |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | #demo-pagination-block #demonstration { |
| | | margin-bottom: 16px; |
| | | } |
| | | |
| | | ::-webkit-scrollbar { |
| | | width: 0 !important; |
| | | } |
| | | ::-webkit-scrollbar { |
| | | width: 0 !important;height: 0; |
| | | } |
| | | .img-list{ |
| | | |
| | | position:relative; |
| | | width: 0 !important; |
| | | } |
| | | .data-img{ |
| | | @apply float-none ; |
| | | |
| | | width:100%; |
| | | height:16rem; |
| | | |
| | | ::-webkit-scrollbar { |
| | | width: 0 !important; |
| | | height: 0; |
| | | } |
| | | |
| | | .img-list { |
| | | position: relative; |
| | | } |
| | | |
| | | .data-img { |
| | | @apply float-none; |
| | | |
| | | width: 100%; |
| | | height: 16rem; |
| | | background: rgba(0, 0, 0, 0); |
| | | opacity: 1; |
| | | border-radius: 0.5rem 0.5rem 0px 0px; |
| | | |
| | | } |
| | | .check-img{ |
| | | |
| | | .check-img { |
| | | position: absolute; |
| | | width: 3.3125rem; |
| | | height: 2.9375rem; |
| | | top:20rem; |
| | | top: 20rem; |
| | | right: 57rem; |
| | | z-index: 10; |
| | | |
| | | } |
| | | .check-imga{ |
| | | |
| | | .check-imga { |
| | | position: absolute; |
| | | width: 3.3125rem; |
| | | height: 2.9375rem; |
| | | top:15rem; |
| | | right: 29rem; |
| | | top: 15rem; |
| | | right: 28.5rem; |
| | | z-index: 10; |
| | | |
| | | } |
| | | |
| | | .vertical { |
| | | width: 45px; |
| | | height: 25px; |
| | | background-color: #409eff; |
| | | top: 485px; /* 初始位置 */ |
| | | left: 899px; /* 水平居中 */ |
| | | transform: translateX(-50%); |
| | | animation: move-vertical 6s infinite; /* 从上到下动画,持续6秒,无限循环 */ |
| | | } |
| | | |
| | | @keyframes move-vertical { |
| | | 0% { |
| | | top: 485px; /* 起始位置 */ |
| | | } |
| | | 100% { |
| | | top: calc(100% - 210px); /* 从上到下结束位置 */ |
| | | } |
| | | } |
| | | |
| | | .img-dlpl { |
| | | margin-left: 200px; |
| | | background-image: url('../../assets/dlpl.png'); |
| | | background-repeat: no-repeat; |
| | | background-attachment: local; |
| | | min-height: 400px; |
| | | width: 1200px; |
| | | max-width: 100%; |
| | | background-size: 1200px 400px; |
| | | overflow: hidden; |
| | | position: relative; |
| | | } |
| | | |
| | | .img-car1 { |
| | | background-image: url('../../assets/lpl.jpg'); |
| | | position: absolute; |
| | | background-repeat: no-repeat; |
| | | background-attachment: local; |
| | | min-height: 200px; |
| | | width: 200px; |
| | | max-width: 100%; |
| | | background-size: 200px 70px; |
| | | overflow: hidden; |
| | | position: relative; |
| | | } |
| | | |
| | | .img-car2 { |
| | | background-image: url('../../assets/lpla.jpg'); |
| | | position: absolute; |
| | | background-repeat: no-repeat; |
| | | background-attachment: local; |
| | | min-height: 200px; |
| | | width: 200px; |
| | | max-width: 100%; |
| | | background-size: 200px 70px; |
| | | overflow: hidden; |
| | | position: relative; |
| | | } |
| | | </style> |
| | |
| | | :width="rack.width" |
| | | :height="rack.height" |
| | | :fill="rack.fillColor" |
| | | :data-index="index" |
| | | class="rack-rect" |
| | | @click="showRectInfo(rack)" |
| | | :data-index="index" |
| | | class="rack-rect" |
| | | @click="showRectInfo(rack)" |
| | | /> |
| | | <rect |
| | | :x="calculateItemXPosition(rack, rack.item, index)" |
| | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | <script setup> |
| | | import Swal from 'sweetalert2' |
| | | export default { |
| | | data() { |
| | | return { |
| | | racks: [ |
| | | { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456' } }, |
| | | { x: 50, y: 270, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 20, width: 10, fillColor: 'yellow', content: 'NG1234567' } }, |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 30, width: 20, fillColor: 'yellow', content: 'NG12345678' } }, |
| | | { x: 280, y: 270, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 35, width: 23, fillColor: 'yellow', content: 'NG123456910' } }, |
| | | { x: 140, y: 420, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 30, width: 100, fillColor: 'yellow', content: 'NG1234561454' } } |
| | | ] |
| | | }; |
| | | }, |
| | | methods: { |
| | | // 计算内部物品的 x 坐标位置 |
| | | calculateItemXPosition(rack, item, index) { |
| | | if (index === 0 || index === 1) { // 如果是第一或第二个物品 |
| | | return rack.x; // 返回左边界 x 坐标 |
| | | } else if (index === 2 || index === 3) { // 如果是第三或第四个物品 |
| | | return rack.x + rack.width - item.width; // 返回右边界 x 坐标 |
| | | } else { |
| | | return rack.x + (rack.width - item.width) / 2; // 返回水平居中的 x 坐标 |
| | | } |
| | | }, |
| | | // 计算内部物品的 y 坐标位置 |
| | | calculateItemYPosition(rack, item, index) { |
| | | if (index === 0 || index === 1) { // 如果是第一或第二个物品 |
| | | return rack.y + (rack.height - item.height) / 2; // 返回垂直居中的 y 坐标 |
| | | } else if (index === 2 || index === 3) { // 如果是第三或第四个物品 |
| | | return rack.y + (rack.height - item.height) / 2; // 返回垂直居中的 y 坐标 |
| | | } else { |
| | | return rack.y + rack.height - item.height; // 返回底部对齐的 y 坐标 |
| | | } |
| | | }, |
| | | showCustomAlert(content) { |
| | | var str="架号 : 111\n" + |
| | | "长 : 111\n" + |
| | | "宽 : 111\n" + |
| | | "厚 : 111\n"+ |
| | | "玻璃ID : 111\n"+ |
| | | "膜系 : 111\n"; |
| | | |
| | | Swal.fire({ |
| | | title: '玻璃信息', |
| | | html: '<pre>' + str + '</pre>', |
| | | customClass: { |
| | | popup: 'format-pre' |
| | | } |
| | | }); |
| | | const racks = [ |
| | | { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456' } }, |
| | | { x: 50, y: 270, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 20, width: 10, fillColor: 'yellow', content: 'NG1234567' } }, |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 30, width: 20, fillColor: 'yellow', content: 'NG12345678' } }, |
| | | { x: 280, y: 270, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 35, width: 23, fillColor: 'yellow', content: 'NG123456910' } }, |
| | | { x: 140, y: 420, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 30, width: 100, fillColor: 'yellow', content: 'NG1234561454' } } |
| | | ]; |
| | | |
| | | }, |
| | | showRectInfo( rectInfo) { |
| | | const content = rectInfo.item.content; |
| | | this.$nextTick(() => { |
| | | this.showCustomAlert(content); |
| | | }); |
| | | }, |
| | | const calculateItemXPosition = (rack, item, index) => { |
| | | if (index === 0 || index === 1) { |
| | | return rack.x; |
| | | } else if (index === 2 || index === 3) { |
| | | return rack.x + rack.width - item.width; |
| | | } else { |
| | | return rack.x + (rack.width - item.width) / 2; |
| | | } |
| | | }; |
| | | |
| | | const calculateItemYPosition = (rack, item, index) => { |
| | | if (index === 0 || index === 1) { |
| | | return rack.y + (rack.height - item.height) / 2; |
| | | } else if (index === 2 || index === 3) { |
| | | return rack.y + (rack.height - item.height) / 2; |
| | | } else { |
| | | return rack.y + rack.height - item.height; |
| | | } |
| | | }; |
| | | |
| | | const showCustomAlert = (content) => { |
| | | var str="架号 : 111\n" + |
| | | "长 : 111\n" + |
| | | "宽 : 111\n" + |
| | | "厚 : 111\n"+ |
| | | "玻璃ID : 111\n"+ |
| | | "膜系 : 111\n"; |
| | | |
| | | Swal.fire({ |
| | | title: '玻璃信息', |
| | | html: '<pre>' + str + '</pre>', |
| | | customClass: { |
| | | popup: 'format-pre' |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | const showRectInfo = (rectInfo) => { |
| | | const content = rectInfo.item.content; |
| | | showCustomAlert(content); |
| | | }; |
| | | |
| | | </script> |
| | | |
| | | <style scoped> |
| | |
| | | margin-left: 20px; |
| | | width: 500px; |
| | | margin-top: 10px; |
| | | /* background-color: antiquewhite; */ |
| | | } |
| | | .rack-rect:hover { |
| | | cursor: pointer; |
| | |
| | | padding: 10px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | </style> |
| | | </style> |
| | |
| | | <template> |
| | | <div class="glass-rack"> |
| | | <div> |
| | | <div > |
| | | <svg width="500" height="500" xmlns="http://www.w3.org/2000/svg"> |
| | | <g stroke="null" id="Layer_1"> |
| | | <!-- 使用 v-for 循环渲染数据 --> |
| | |
| | | :width="rack.width" |
| | | :height="rack.height" |
| | | :fill="rack.fillColor" |
| | | :data-index="index" |
| | | class="rack-rect" |
| | | @click="showRectInfo(rack)" |
| | | :data-index="index" |
| | | class="rack-rect" |
| | | @click="showRectInfo(rack)" |
| | | /> |
| | | <rect |
| | | :x="calculateItemXPosition(rack, rack.item, index)" |
| | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | <script setup> |
| | | import Swal from 'sweetalert2' |
| | | export default { |
| | | data() { |
| | | return { |
| | | racks: [ |
| | | { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456' } }, |
| | | { x: 50, y: 270, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 20, width: 10, fillColor: 'yellow', content: 'NG1234567' } }, |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 30, width: 20, fillColor: 'yellow', content: 'NG12345678' } }, |
| | | { x: 280, y: 270, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 35, width: 23, fillColor: 'yellow', content: 'NG123456910' } }, |
| | | { x: 140, y: 420, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 30, width: 100, fillColor: 'yellow', content: 'NG1234561454' } } |
| | | ] |
| | | }; |
| | | }, |
| | | methods: { |
| | | calculateItemXPosition(rack, item, index) { |
| | | if (index === 0 || index === 1) { |
| | | return rack.x; |
| | | } else if (index === 2 || index === 3) { |
| | | return rack.x + rack.width - item.width; |
| | | } else { |
| | | return rack.x + (rack.width - item.width) / 2; |
| | | } |
| | | }, |
| | | calculateItemYPosition(rack, item, index) { |
| | | if (index === 0 || index === 1) { |
| | | return rack.y + (rack.height - item.height) / 2; |
| | | } else if (index === 2 || index === 3) { |
| | | return rack.y + (rack.height - item.height) / 2; |
| | | } else { |
| | | return rack.y + rack.height - item.height; |
| | | } |
| | | }, |
| | | showCustomAlert(content) { |
| | | var str="架号 : 111\n" + |
| | | "长 : 111\n" + |
| | | "宽 : 111\n" + |
| | | "厚 : 111\n"+ |
| | | "玻璃ID : 111\n"+ |
| | | "膜系 : 111\n"; |
| | | |
| | | Swal.fire({ |
| | | title: '玻璃信息', |
| | | html: '<pre>' + str + '</pre>', |
| | | customClass: { |
| | | popup: 'format-pre' |
| | | } |
| | | }); |
| | | const racks = [ |
| | | { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456' } }, |
| | | { x: 50, y: 270, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 20, width: 10, fillColor: 'yellow', content: 'NG1234567' } }, |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 30, width: 20, fillColor: 'yellow', content: 'NG12345678' } }, |
| | | { x: 280, y: 270, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 35, width: 23, fillColor: 'yellow', content: 'NG123456910' } }, |
| | | { x: 140, y: 420, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 30, width: 100, fillColor: 'yellow', content: 'NG1234561454' } } |
| | | ]; |
| | | |
| | | }, |
| | | showRectInfo( rectInfo) { |
| | | const content = rectInfo.item.content; |
| | | this.$nextTick(() => { |
| | | this.showCustomAlert(content); |
| | | }); |
| | | }, |
| | | const calculateItemXPosition = (rack, item, index) => { |
| | | if (index === 0 || index === 1) { |
| | | return rack.x; |
| | | } else if (index === 2 || index === 3) { |
| | | return rack.x + rack.width - item.width; |
| | | } else { |
| | | return rack.x + (rack.width - item.width) / 2; |
| | | } |
| | | }; |
| | | |
| | | const calculateItemYPosition = (rack, item, index) => { |
| | | if (index === 0 || index === 1) { |
| | | return rack.y + (rack.height - item.height) / 2; |
| | | } else if (index === 2 || index === 3) { |
| | | return rack.y + (rack.height - item.height) / 2; |
| | | } else { |
| | | return rack.y + rack.height - item.height; |
| | | } |
| | | }; |
| | | |
| | | const showCustomAlert = (content) => { |
| | | var str="架号 : 111\n" + |
| | | "长 : 111\n" + |
| | | "宽 : 111\n" + |
| | | "厚 : 111\n"+ |
| | | "玻璃ID : 111\n"+ |
| | | "膜系 : 111\n"; |
| | | |
| | | Swal.fire({ |
| | | title: '玻璃信息', |
| | | html: '<pre>' + str + '</pre>', |
| | | customClass: { |
| | | popup: 'format-pre' |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | const showRectInfo = (rectInfo) => { |
| | | const content = rectInfo.item.content; |
| | | showCustomAlert(content); |
| | | }; |
| | | |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .glass-rack { |
| | | margin-left: 20px; |
| | | width: 500px; |
| | | margin-top: 10px; |
| | | } |
| | | .rack-rect:hover { |
| | | cursor: pointer; |
| | |
| | | padding: 10px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | </style> |
| | | </style> |
| | |
| | | if (typeof WebSocket === "undefined") { |
| | | console.log("您的浏览器不支持WebSocket"); |
| | | } else { |
| | | let socketUrl = "ws://" + "localhost"+":88" + "/api/unLoadGlass/api/talk/" + viewname; |
| | | let socketUrl = "ws://" + "localhost"+":88" + "/api/talk/" + viewname; |
| | | if (socket != null) { |
| | | socket.close(); |
| | | socket = null; |
| | |
| | | if (!msg.data) { |
| | | return; // 如果收到空数据,则直接返回,不执行后续逻辑 |
| | | } |
| | | |
| | | |
| | | |
| | | let obj = JSON.parse(msg.data); |
| | | |
| | |
| | | initWebSocket(); |
| | | onMounted(fetchTableData); |
| | | // setInterval(fetchTableData, 2000) |
| | | fetchTableData |
| | | |
| | | const open = () => { |
| | | ElMessageBox.confirm( |
| | |
| | | } |
| | | #main-body{ |
| | | margin-top: -20px; |
| | | margin-left: 300px; |
| | | margin-left: 200px; |
| | | } |
| | | #main-bodya{ |
| | | margin-top: -10px; |
New file |
| | |
| | | <script setup> |
| | | import {ArrowLeftBold, ArrowRight, Search} from "@element-plus/icons-vue" |
| | | import {useRouter} from "vue-router"; |
| | | let indexFlag=$ref(1) |
| | | function changeRouter(index){ |
| | | indexFlag=index |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <!-- <div id="main-div"> --> |
| | | |
| | | |
| | | <div id="main-body"> |
| | | <router-view /> |
| | | </div> |
| | | <!-- </div> --> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | #main-div{ |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | #div-title{ |
| | | height: 2%; |
| | | width: 100%; |
| | | } |
| | | #searchButton{ |
| | | margin-top: -5px; |
| | | margin-left: 1rem; |
| | | } |
| | | /* #searchButton1{ |
| | | //margin-left: 10rem; |
| | | } */ |
| | | /*main-body样式*/ |
| | | #main-body{ |
| | | width: 100%; |
| | | height: 95%; |
| | | /* margin-top: 1%; */ |
| | | } |
| | | #select{ |
| | | margin-left:0.5rem; |
| | | } |
| | | :deep(.indexTag .el-breadcrumb__inner){ |
| | | color: #5CADFE !important; |
| | | } |
| | | </style> |
New file |
| | |
| | | <script setup> |
| | | 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 { ref, onMounted } from "vue"; |
| | | // import { ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | // import LanguageMixin from './lang/LanguageMixin' |
| | | |
| | | const tableData = ref([]) |
| | | |
| | | // 发送获取表格数据的请求 |
| | | // const fetchTableData = async () => { |
| | | // try { |
| | | // // 发送获取表格数据的请求,并等待响应 |
| | | // // const response = await request.post("/loadGlass/optimizeProject/listByState", requestData); |
| | | // const response = await request.get("unLoadGlass/downStorage/selectStorageCage"); |
| | | |
| | | // // 检查响应状态 |
| | | // if (response.code === 200) { |
| | | // // 更新表格数据 |
| | | // console.log('成功获取表格数据:', response.data); |
| | | // tableData.splice(0, tableData.length, ...response.data); |
| | | // } else { |
| | | // // 请求失败,显示错误消息 |
| | | // ElMessage.error(response.msg); |
| | | // } |
| | | // } catch (error) { |
| | | // // 处理请求失败的情况 |
| | | // ElMessage.error('获取表格数据失败,请重试'); |
| | | // } |
| | | // }; |
| | | // onMounted(fetchTableData); |
| | | |
| | | |
| | | |
| | | request.get("unLoadGlass/downStorage/selectStorageCage").then((res) => { |
| | | if (res.code == 200) { |
| | | console.log(res.data); |
| | | tableData.value = res.data |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | |
| | | } |
| | | }); |
| | | |
| | | const dialogForm = () => { |
| | | ElMessageBox.confirm( |
| | | '是否报缺?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '是', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | // this.boxa = true |
| | | // this.box = false |
| | | |
| | | }) |
| | | } |
| | | const open = () => { |
| | | ElMessageBox.confirm( |
| | | '是否删除该条信息?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '是', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功!', |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: '删除失败', |
| | | }) |
| | | }) |
| | | } |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/returns/createReturns', query: { ReturnID: 'TH24010101' }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | alert('我接收到子组件传送的删除信息') |
| | | break |
| | | } |
| | | } |
| | | } |
| | | |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | id: 'OrderList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | showStatus: true |
| | | }, |
| | | data: [ |
| | | { |
| | | 'id': '1', |
| | | 'long': '5', |
| | | 'wide': '1005', |
| | | 'thick': '183.6', |
| | | } |
| | | ] |
| | | |
| | | }) |
| | | |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <!-- 父级框 --> |
| | | <div class="container"> |
| | | <img src="../../assets/d1.png" style="width: 1500px;height: 750px;" alt="Your Image"> |
| | | <div class="moving-rect vertical"></div> |
| | | <div class="moving-rect all"></div> |
| | | <div class="moving-rect horizontal"></div> |
| | | <div class="moving-rect xiao"></div> |
| | | <div class="moving-rect zhan"></div> |
| | | <div class="moving-rect tu"></div> |
| | | <div class="moving-rect zi"></div> |
| | | <div class="moving-rect xia"></div> |
| | | <div class="moving-rect zan"></div> |
| | | <div class="moving-rect fa"></div> |
| | | <div class="moving-rect hua"></div> |
| | | <div class="moving-rect shui"></div> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | .container { |
| | | position: relative; |
| | | display: inline-block; /* 使容器大小适应图片大小 */ |
| | | } |
| | | |
| | | img { |
| | | display: block; /* 让图片以块级元素显示 */ |
| | | max-width: 100%; /* 确保图片不超出容器 */ |
| | | } |
| | | |
| | | .moving-rect { |
| | | width: 100px; |
| | | height: 50px; |
| | | position: absolute; |
| | | } |
| | | |
| | | .vertical { |
| | | width: 45px; |
| | | height: 25px; |
| | | background-color: #409EFF; |
| | | top: 510px; /* 初始位置 */ |
| | | left: 899px; /* 水平居中 */ |
| | | transform: translateX(-50%); |
| | | animation: move-vertical 6s infinite; /* 从上到下动画,持续6秒,无限循环 */ |
| | | } |
| | | |
| | | @keyframes move-vertical { |
| | | 0% { |
| | | top: 510px; /* 起始位置 */ |
| | | } |
| | | 100% { |
| | | top: calc(100% - 210px); /* 从上到下结束位置 */ |
| | | } |
| | | } |
| | | .all { |
| | | width: 45px; |
| | | height: 25px; |
| | | background-color: #409EFF; |
| | | top: 490px; /* 垂直居中 */ |
| | | right: 560px; /* 初始位置 */ |
| | | transform: translateY(-50%); |
| | | animation: move-all 6s infinite; /* 从右到左动画,持续6秒,无限循环 */ |
| | | } |
| | | @keyframes move-all { |
| | | 0% { |
| | | right: 560px; /* 起始位置 */ |
| | | } |
| | | 100% { |
| | | right: calc(100% - 863px); /* 从右到左结束位置 */ |
| | | } |
| | | } |
| | | .horizontal { |
| | | width: 45px; |
| | | height: 25px; |
| | | background-color: #409EFF; |
| | | top: 488px; /* 垂直居中 */ |
| | | right: 210px; /* 初始位置 */ |
| | | transform: translateY(-50%); |
| | | animation: move-horizontal 6s infinite; /* 从右到左动画,持续6秒,无限循环 */ |
| | | } |
| | | |
| | | @keyframes move-horizontal { |
| | | 0% { |
| | | right: 210px; /* 起始位置 */ |
| | | } |
| | | 100% { |
| | | right: calc(100% - 1030px); /* 从右到左结束位置 */ |
| | | } |
| | | } |
| | | |
| | | .xiao { |
| | | width: 45px; |
| | | height: 25px; |
| | | background-color: #409EFF; |
| | | top: 569px; /* 垂直居中 */ |
| | | right: 660px; /* 初始位置 */ |
| | | transform: translateY(-50%); |
| | | animation: move-xiao 6s infinite; /* 从右到左动画,持续6秒,无限循环 */ |
| | | } |
| | | @keyframes move-xiao { |
| | | 0% { |
| | | right: 660px; /* 起始位置 */ |
| | | } |
| | | 100% { |
| | | right: calc(100% - 820px); /* 从右到左结束位置 */ |
| | | } |
| | | } |
| | | .tu { |
| | | width: 45px; |
| | | height: 25px; |
| | | background-color: #409EFF; |
| | | top: 569px; /* 垂直居中 */ |
| | | right: 778px; /* 初始位置 */ |
| | | transform: translateY(-50%); |
| | | animation: move-tu 6s infinite; /* 从右到左动画,持续6秒,无限循环 */ |
| | | } |
| | | @keyframes move-tu { |
| | | 0% { |
| | | right: 778px; /* 起始位置 */ |
| | | } |
| | | 100% { |
| | | right: calc(100% - 580px); /* 从右到左结束位置 */ |
| | | } |
| | | } |
| | | .zhan { |
| | | width: 45px; |
| | | height: 25px; |
| | | background-color: #409EFF; |
| | | top: 632px; /* 垂直居中 */ |
| | | right: 572px; /* 初始位置 */ |
| | | transform: translateY(-50%); |
| | | animation: move-zhan 6s infinite; /* 从右到左动画,持续6秒,无限循环 */ |
| | | } |
| | | @keyframes move-zhan { |
| | | 0% { |
| | | right: 572px; /* 起始位置 */ |
| | | } |
| | | 100% { |
| | | right: calc(100% - 885px); /* 从右到左结束位置 */ |
| | | } |
| | | } |
| | | .zi { |
| | | width: 45px; |
| | | height: 25px; |
| | | background-color: #409EFF; |
| | | top: 632px; /* 垂直居中 */ |
| | | right: 710px; /* 初始位置 */ |
| | | transform: translateY(-50%); |
| | | animation: move-zi 6s infinite; /* 从右到左动画,持续6秒,无限循环 */ |
| | | } |
| | | @keyframes move-zi { |
| | | 0% { |
| | | right: 710px; /* 起始位置 */ |
| | | } |
| | | 100% { |
| | | right: calc(100% - 645px); /* 从右到左结束位置 */ |
| | | } |
| | | } |
| | | .xia { |
| | | width: 45px; |
| | | height: 25px; |
| | | background-color: #409EFF; |
| | | top: 628px; /* 垂直居中 */ |
| | | right: 1185px; /* 初始位置 */ |
| | | transform: translateY(-50%); |
| | | animation: move-xia 6s infinite; /* 从右到左动画,持续6秒,无限循环 */ |
| | | } |
| | | @keyframes move-xia { |
| | | 0% { |
| | | right: 1185px; /* 起始位置 */ |
| | | } |
| | | 100% { |
| | | right: calc(100% - 198px); /* 从右到左结束位置 */ |
| | | } |
| | | } |
| | | |
| | | .zan { |
| | | width: 25px; |
| | | height: 45px; |
| | | background-color: #409EFF; |
| | | top: 570px; /* 初始位置 */ |
| | | left: 172px; /* 水平居中 */ |
| | | transform: translateX(-50%); |
| | | animation: move-zan 6s infinite; /* 从上到下动画,持续6秒,无限循环 */ |
| | | } |
| | | |
| | | @keyframes move-zan { |
| | | 0% { |
| | | top: 570px; /* 起始位置 */ |
| | | } |
| | | 100% { |
| | | top: calc(100% - 242px); /* 从下到上结束位置 */ |
| | | } |
| | | } |
| | | .fa { |
| | | width: 25px; |
| | | height: 45px; |
| | | background-color: #409EFF; |
| | | top: 150px; /* 初始位置 */ |
| | | left: 172px; /* 水平居中 */ |
| | | transform: translateX(-50%); |
| | | animation: move-fa 6s infinite; /* 从上到下动画,持续6秒,无限循环 */ |
| | | } |
| | | |
| | | @keyframes move-fa { |
| | | 0% { |
| | | top: 150px; /* 起始位置 */ |
| | | } |
| | | 100% { |
| | | top: calc(100% - 660px); /* 从下到上结束位置 */ |
| | | } |
| | | } |
| | | .hua { |
| | | width: 45px; |
| | | height: 25px; |
| | | background-color: #409EFF; |
| | | top: 117px; /* 垂直居中 */ |
| | | right: 1250px; /* 初始位置 */ |
| | | transform: translateY(-50%); |
| | | animation: move-hua 6s infinite; /* 从左到右动画,持续6秒,无限循环 */ |
| | | } |
| | | @keyframes move-hua { |
| | | 0% { |
| | | right: 1250px; /* 起始位置 */ |
| | | } |
| | | 100% { |
| | | right: calc(100% - 360px); /* 结束位置 */ |
| | | } |
| | | } |
| | | .shui { |
| | | width: 45px; |
| | | height: 25px; |
| | | background-color: #409EFF; |
| | | top: 117px; /* 垂直居中 */ |
| | | right: 1050px; /* 初始位置 */ |
| | | transform: translateY(-50%); |
| | | animation: move-shui 6s infinite; /* 从左到右动画,持续6秒,无限循环 */ |
| | | } |
| | | @keyframes move-shui { |
| | | 0% { |
| | | right: 1050px; /* 起始位置 */ |
| | | } |
| | | 100% { |
| | | right: calc(100% - 610px); /* 结束位置 */ |
| | | } |
| | | } |
| | | |
| | | </style> |
New file |
| | |
| | | <script setup> |
| | | 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 { ref, onMounted } from "vue"; |
| | | // import { ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | // import LanguageMixin from './lang/LanguageMixin' |
| | | |
| | | const tableData = ref([]) |
| | | |
| | | // 发送获取表格数据的请求 |
| | | // const fetchTableData = async () => { |
| | | // try { |
| | | // // 发送获取表格数据的请求,并等待响应 |
| | | // // const response = await request.post("/loadGlass/optimizeProject/listByState", requestData); |
| | | // const response = await request.get("unLoadGlass/downStorage/selectStorageCage"); |
| | | |
| | | // // 检查响应状态 |
| | | // if (response.code === 200) { |
| | | // // 更新表格数据 |
| | | // console.log('成功获取表格数据:', response.data); |
| | | // tableData.splice(0, tableData.length, ...response.data); |
| | | // } else { |
| | | // // 请求失败,显示错误消息 |
| | | // ElMessage.error(response.msg); |
| | | // } |
| | | // } catch (error) { |
| | | // // 处理请求失败的情况 |
| | | // ElMessage.error('获取表格数据失败,请重试'); |
| | | // } |
| | | // }; |
| | | // onMounted(fetchTableData); |
| | | |
| | | |
| | | |
| | | request.get("unLoadGlass/downStorage/selectStorageCage").then((res) => { |
| | | if (res.code == 200) { |
| | | console.log(res.data); |
| | | tableData.value = res.data |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | |
| | | } |
| | | }); |
| | | |
| | | const dialogForm = () => { |
| | | ElMessageBox.confirm( |
| | | '是否报缺?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '是', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | // this.boxa = true |
| | | // this.box = false |
| | | |
| | | }) |
| | | } |
| | | const open = () => { |
| | | ElMessageBox.confirm( |
| | | '是否删除该条信息?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '是', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功!', |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: '删除失败', |
| | | }) |
| | | }) |
| | | } |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/returns/createReturns', query: { ReturnID: 'TH24010101' }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | alert('我接收到子组件传送的删除信息') |
| | | break |
| | | } |
| | | } |
| | | } |
| | | |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | id: 'OrderList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | showStatus: true |
| | | }, |
| | | data: [ |
| | | { |
| | | 'id': '1', |
| | | 'long': '5', |
| | | 'wide': '1005', |
| | | 'thick': '183.6', |
| | | } |
| | | ] |
| | | |
| | | }) |
| | | |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | |
| | | <div id="awatch"> |
| | | <img src="../../assets/d3.png" alt="" style="width: 100%;height: 160%;margin-top: 20px;"> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | |
| | | #awatch{ |
| | | height: 460px; |
| | | /* margin-top: -60px; */ |
| | | } |
| | | </style> |
New file |
| | |
| | | <script setup> |
| | | 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 { ref, onMounted } from "vue"; |
| | | // import { ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | // import LanguageMixin from './lang/LanguageMixin' |
| | | |
| | | const tableData = ref([]) |
| | | |
| | | // 发送获取表格数据的请求 |
| | | // const fetchTableData = async () => { |
| | | // try { |
| | | // // 发送获取表格数据的请求,并等待响应 |
| | | // // const response = await request.post("/loadGlass/optimizeProject/listByState", requestData); |
| | | // const response = await request.get("unLoadGlass/downStorage/selectStorageCage"); |
| | | |
| | | // // 检查响应状态 |
| | | // if (response.code === 200) { |
| | | // // 更新表格数据 |
| | | // console.log('成功获取表格数据:', response.data); |
| | | // tableData.splice(0, tableData.length, ...response.data); |
| | | // } else { |
| | | // // 请求失败,显示错误消息 |
| | | // ElMessage.error(response.msg); |
| | | // } |
| | | // } catch (error) { |
| | | // // 处理请求失败的情况 |
| | | // ElMessage.error('获取表格数据失败,请重试'); |
| | | // } |
| | | // }; |
| | | // onMounted(fetchTableData); |
| | | |
| | | |
| | | |
| | | request.get("unLoadGlass/downStorage/selectStorageCage").then((res) => { |
| | | if (res.code == 200) { |
| | | console.log(res.data); |
| | | tableData.value = res.data |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | |
| | | } |
| | | }); |
| | | |
| | | const dialogForm = () => { |
| | | ElMessageBox.confirm( |
| | | '是否报缺?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '是', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | // this.boxa = true |
| | | // this.box = false |
| | | |
| | | }) |
| | | } |
| | | const open = () => { |
| | | ElMessageBox.confirm( |
| | | '是否删除该条信息?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '是', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功!', |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: '删除失败', |
| | | }) |
| | | }) |
| | | } |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/returns/createReturns', query: { ReturnID: 'TH24010101' }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | alert('我接收到子组件传送的删除信息') |
| | | break |
| | | } |
| | | } |
| | | } |
| | | |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | id: 'OrderList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | showStatus: true |
| | | }, |
| | | data: [ |
| | | { |
| | | 'id': '1', |
| | | 'long': '5', |
| | | 'wide': '1005', |
| | | 'thick': '183.6', |
| | | } |
| | | ] |
| | | |
| | | }) |
| | | |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | |
| | | <div id="awatch"> |
| | | <img src="../../assets/d2.png" alt="" style="width: 100%;height: 160%;margin-top: 20px;"> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | |
| | | #awatch{ |
| | | height: 460px; |
| | | /* margin-top: -60px; */ |
| | | } |
| | | </style> |
| | |
| | | https: false, |
| | | proxy: { |
| | | '/api': { |
| | | target: 'http://10.153.19.150:88/', |
| | | target: 'http://127.0.0.1:88/', |
| | | changeOrigin: true, |
| | | rewrite: (path) => path.replace(/^\/api/, '/'), |
| | | }, |
| | |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.github.yulichang</groupId> |
| | | <artifactId>mybatis-plus-join-boot-starter</artifactId> |
| | | <version>1.4.8</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>dynamic-datasource-spring-boot-starter</artifactId> |
| | | <version>3.3.1</version> |
| | |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>fastjson</artifactId> |
| | | <version>1.2.33</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.github.yulichang</groupId> |
| | | <artifactId>mybatis-plus-join</artifactId> |
| | | <version>1.2.4</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
New file |
| | |
| | | package com.mes.common.config; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/4/24 10:33 |
| | | * @Description: |
| | | */ |
| | | public class Const { |
| | | public static final String DEFULT_PASSWORD = "123456"; |
| | | public static final Long DEFULT_ROLE = 1L; |
| | | } |
| | |
| | | import springfox.documentation.builders.PathSelectors; |
| | | import springfox.documentation.builders.RequestHandlerSelectors; |
| | | import springfox.documentation.schema.ModelRef; |
| | | import springfox.documentation.service.ApiInfo; |
| | | import springfox.documentation.service.Contact; |
| | | import springfox.documentation.service.Parameter; |
| | | import springfox.documentation.service.*; |
| | | import springfox.documentation.spi.DocumentationType; |
| | | import springfox.documentation.spi.service.contexts.SecurityContext; |
| | | import springfox.documentation.spring.web.plugins.Docket; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | .apis(RequestHandlerSelectors.basePackage("com.mes")) |
| | | .paths(PathSelectors.any()) |
| | | .build() |
| | | .globalOperationParameters(pars); |
| | | .globalOperationParameters(pars) |
| | | .securitySchemes(Collections.EMPTY_LIST) |
| | | .securityContexts(Arrays.asList(securityContext())); |
| | | } |
| | | |
| | | @Bean |
| | | public Docket adminApiConfig() { |
| | | List<Parameter> pars = new ArrayList<>(); |
| | | ParameterBuilder tokenPar = new ParameterBuilder(); |
| | | tokenPar.name("adminId") |
| | | .description("用户token") |
| | | .defaultValue("1") |
| | | .modelRef(new ModelRef("string")) |
| | | .parameterType("header") |
| | | .required(false) |
| | | private SecurityContext securityContext() { |
| | | return SecurityContext.builder() |
| | | .securityReferences(defaultAuth()) |
| | | .forPaths(PathSelectors.any()) |
| | | .build(); |
| | | pars.add(tokenPar.build()); |
| | | |
| | | return new Docket(DocumentationType.SWAGGER_2) |
| | | .groupName("adminApi") |
| | | .apiInfo(adminApiInfo()) |
| | | .select() |
| | | //只显示admin路径下的页面 |
| | | .apis(RequestHandlerSelectors.basePackage("com.mes")) |
| | | .paths(PathSelectors.any()) |
| | | .build() |
| | | .globalOperationParameters(pars); |
| | | } |
| | | |
| | | private List<SecurityReference> defaultAuth() { |
| | | AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything"); |
| | | AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; |
| | | authorizationScopes[0] = authorizationScope; |
| | | return Arrays.asList(new SecurityReference("Authorization", authorizationScopes)); |
| | | } |
| | | |
| | | |
| | | private ApiInfo webApiInfo() { |
| | | return new ApiInfoBuilder() |
| | | .title("网站-API文档") |
| | | .description("本文档描述了mes网站微服务接口定义") |
| | | .version("1.0") |
| | | .contact(new Contact("zhan_py", "", "")) |
| | | .build(); |
| | | } |
| | | |
| | | private ApiInfo adminApiInfo() { |
| | | return new ApiInfoBuilder() |
| | | .title("后台管理系统-API文档") |
| | | .description("本文档描述了mes后台系统服务接口定义") |
| | | .version("1.0") |
| | | .contact(new Contact("zhan_py", "", "")) |
| | | .build(); |
New file |
| | |
| | | package com.mes.entity.request; |
| | | |
| | | import cn.hutool.db.Page; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/4/22 11:21 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class GeneralRequest { |
| | | |
| | | private String key; |
| | | |
| | | private Page page; |
| | | } |
| | |
| | | |
| | | |
| | | import com.mes.common.filter.JwtAuthenticationTokenFilter; |
| | | import com.mes.common.handler.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.security.authentication.AuthenticationManager; |
| | | import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; |
| | | import org.springframework.security.config.annotation.web.builders.HttpSecurity; |
| | | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; |
| | | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; |
| | | import org.springframework.security.config.http.SessionCreationPolicy; |
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; |
| | | |
| | | @Configuration |
| | | //@EnableWebSecurity |
| | | @EnableWebSecurity |
| | | @EnableGlobalMethodSecurity(prePostEnabled = true) |
| | | public class TokenWebSecurityConfig extends WebSecurityConfigurerAdapter { |
| | | @Autowired |
| | | private JwtAuthenticationTokenFilter jwtAuthenticationTokenFilter; |
| | | @Autowired |
| | | LoginFailureHandler loginFailureHandler; |
| | | |
| | | @Autowired |
| | | LoginSuccessHandler loginSuccessHandler; |
| | | |
| | | @Autowired |
| | | JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint; |
| | | |
| | | @Autowired |
| | | JwtAccessDeniedHandler jwtAccessDeniedHandler; |
| | | |
| | | @Autowired |
| | | JwtLogoutSuccessHandler jwtLogoutSuccessHandler; |
| | | |
| | | @Bean |
| | | public PasswordEncoder passwordEncoder() { |
| | |
| | | */ |
| | | @Override |
| | | protected void configure(HttpSecurity http) throws Exception { |
| | | http |
| | | //关闭csrf |
| | | .csrf().disable() |
| | | //不通过Session获取SecurityContext |
| | | .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS) |
| | | |
| | | http.cors().and().csrf().disable() |
| | | |
| | | // 登录配置 |
| | | .formLogin() |
| | | .successHandler(loginSuccessHandler) |
| | | .failureHandler(loginFailureHandler) |
| | | |
| | | .and() |
| | | .logout() |
| | | .logoutSuccessHandler(jwtLogoutSuccessHandler) |
| | | |
| | | // 禁用session |
| | | .and() |
| | | .sessionManagement() |
| | | .sessionCreationPolicy(SessionCreationPolicy.STATELESS) |
| | | |
| | | // 配置拦截规则 |
| | | .and() |
| | | .authorizeRequests() |
| | | // 对于登录接口 允许匿名访问 |
| | | .antMatchers("/userinfo/login").anonymous() |
| | | .antMatchers("/hello").permitAll() |
| | | // 除上面外的所有请求全部需要鉴权认证 |
| | | .anyRequest().permitAll(); |
| | | // http.addFilterBefore(jwtAuthenticationTokenFilter, UsernamePasswordAuthenticationFilter.class); |
| | | .antMatchers("/sys/user/login").anonymous() |
| | | .antMatchers("/swagger-ui.html").permitAll() |
| | | .antMatchers("/webjars/**").permitAll() |
| | | .antMatchers("/v2/**").permitAll() |
| | | .antMatchers("/swagger-resources/**").permitAll() |
| | | .anyRequest().authenticated() |
| | | |
| | | // 异常处理器 |
| | | .and() |
| | | .exceptionHandling() |
| | | .authenticationEntryPoint(jwtAuthenticationEntryPoint) |
| | | .accessDeniedHandler(jwtAccessDeniedHandler) |
| | | |
| | | // 配置自定义的过滤器 |
| | | .and() |
| | | .addFilterBefore(jwtAuthenticationTokenFilter, UsernamePasswordAuthenticationFilter.class); |
| | | } |
| | | |
| | | @Bean |
| | |
| | | |
| | | import com.mes.common.utils.JwtUtil; |
| | | import com.mes.common.utils.RedisUtil; |
| | | import com.mes.menu.mapper.SysMenuMapper; |
| | | import com.mes.common.utils.UserInfoUtils; |
| | | import com.mes.userinfo.entity.LoginUser; |
| | | import com.mes.userinfo.service.SysUserService; |
| | | import io.jsonwebtoken.Claims; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; |
| | |
| | | private RedisUtil redisUtil; |
| | | |
| | | @Resource |
| | | private SysMenuMapper menuMapper; |
| | | private SysUserService sysUserService; |
| | | |
| | | @Override |
| | | protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { |
| | |
| | | //解析token |
| | | String userid; |
| | | try { |
| | | Claims claims = JwtUtil.parseJWT(token); |
| | | Claims claims = JwtUtil.getClaimByToken(token); |
| | | userid = claims.getSubject(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | String redisKey = "login:" + userid; |
| | | LoginUser loginUser = redisUtil.getCacheObject(redisKey); |
| | | if (Objects.isNull(loginUser)) { |
| | | response.setHeader("token", ""); |
| | | throw new RuntimeException("用户未登录"); |
| | | } |
| | | //将用户信息放入当前线程 |
| | | UserInfoUtils.set(loginUser.getUser()); |
| | | //存入SecurityContextHolder,以供后面的过滤器使用 |
| | | List<String> permissionKeyList = menuMapper.selectPermsByUserId(Long.parseLong(userid)); |
| | | List<String> permissionKeyList = sysUserService.getUserAuthorityInfo(Long.parseLong(userid)); |
| | | List<GrantedAuthority> authorities = permissionKeyList.stream(). |
| | | map(SimpleGrantedAuthority::new) |
| | | .collect(Collectors.toList()); |
New file |
| | |
| | | package com.mes.common.handler; |
| | | |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.mes.utils.Result; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.security.access.AccessDeniedException; |
| | | import org.springframework.security.web.access.AccessDeniedHandler; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | |
| | | @Component |
| | | public class JwtAccessDeniedHandler implements AccessDeniedHandler { |
| | | |
| | | @Override |
| | | public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException) throws IOException, ServletException { |
| | | |
| | | response.setContentType("application/json;charset=UTF-8"); |
| | | response.setStatus(HttpServletResponse.SC_FORBIDDEN); |
| | | |
| | | ServletOutputStream outputStream = response.getOutputStream(); |
| | | |
| | | Result result = Result.error(HttpStatus.FORBIDDEN.value(), "权限不足"); |
| | | |
| | | outputStream.write(JSONUtil.toJsonStr(result).getBytes("UTF-8")); |
| | | |
| | | outputStream.flush(); |
| | | outputStream.close(); |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.common.handler; |
| | | |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.mes.utils.Result; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.security.core.AuthenticationException; |
| | | import org.springframework.security.web.AuthenticationEntryPoint; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | |
| | | @Component |
| | | public class JwtAuthenticationEntryPoint implements AuthenticationEntryPoint { |
| | | |
| | | @Override |
| | | public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { |
| | | |
| | | response.setContentType("application/json;charset=UTF-8"); |
| | | response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); |
| | | ServletOutputStream outputStream = response.getOutputStream(); |
| | | |
| | | Result result = Result.error(HttpStatus.UNAUTHORIZED.value(), "认证失败请重新登录"); |
| | | |
| | | outputStream.write(JSONUtil.toJsonStr(result).getBytes("UTF-8")); |
| | | |
| | | outputStream.flush(); |
| | | outputStream.close(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.common.handler; |
| | | |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.mes.utils.Result; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; |
| | | import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | |
| | | @Component |
| | | public class JwtLogoutSuccessHandler implements LogoutSuccessHandler { |
| | | |
| | | private static final String header = "Authorization"; |
| | | |
| | | @Override |
| | | public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { |
| | | |
| | | if (authentication != null) { |
| | | new SecurityContextLogoutHandler().logout(request, response, authentication); |
| | | } |
| | | |
| | | response.setContentType("application/json;charset=UTF-8"); |
| | | ServletOutputStream outputStream = response.getOutputStream(); |
| | | |
| | | response.setHeader(header, ""); |
| | | |
| | | Result result = Result.success(""); |
| | | |
| | | outputStream.write(JSONUtil.toJsonStr(result).getBytes("UTF-8")); |
| | | |
| | | outputStream.flush(); |
| | | outputStream.close(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.common.handler; |
| | | |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.mes.utils.Result; |
| | | import org.springframework.security.core.AuthenticationException; |
| | | import org.springframework.security.web.authentication.AuthenticationFailureHandler; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | |
| | | @Component |
| | | public class LoginFailureHandler implements AuthenticationFailureHandler { |
| | | |
| | | @Override |
| | | public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException { |
| | | |
| | | response.setContentType("application/json;charset=UTF-8"); |
| | | ServletOutputStream outputStream = response.getOutputStream(); |
| | | |
| | | Result result = Result.error("用户名或密码错误"); |
| | | |
| | | outputStream.write(JSONUtil.toJsonStr(result).getBytes("UTF-8")); |
| | | |
| | | outputStream.flush(); |
| | | outputStream.close(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.common.handler; |
| | | |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.mes.common.utils.JwtUtil; |
| | | import com.mes.utils.Result; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.security.web.authentication.AuthenticationSuccessHandler; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | |
| | | @Component |
| | | public class LoginSuccessHandler implements AuthenticationSuccessHandler { |
| | | |
| | | private static final String header = "Authorization"; |
| | | |
| | | @Override |
| | | public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { |
| | | response.setContentType("application/json;charset=UTF-8"); |
| | | ServletOutputStream outputStream = response.getOutputStream(); |
| | | |
| | | // 生成jwt,并放置到请求头中 |
| | | String jwt = JwtUtil.generateToken(authentication.getName()); |
| | | response.setHeader(header, jwt); |
| | | |
| | | Result result = Result.success(""); |
| | | |
| | | outputStream.write(JSONUtil.toJsonStr(result).getBytes("UTF-8")); |
| | | |
| | | outputStream.flush(); |
| | | outputStream.close(); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | import io.jsonwebtoken.Claims; |
| | | import io.jsonwebtoken.JwtBuilder; |
| | | import io.jsonwebtoken.Jwts; |
| | | import io.jsonwebtoken.SignatureAlgorithm; |
| | | import lombok.Data; |
| | | |
| | | import javax.crypto.SecretKey; |
| | | import javax.crypto.spec.SecretKeySpec; |
| | | import java.util.Base64; |
| | | import java.util.Date; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/4/9 19:15 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class JwtUtil { |
| | | |
| | | //有效期为 |
| | | public static final Long JWT_TTL = 60 * 60 * 1000L;// 60 * 60 *1000 一个小时 |
| | | //设置秘钥明文 |
| | | public static final String JWT_KEY = "sangeng"; |
| | | private static final long expire = 60 * 60 * 1000L; |
| | | private static final String secret = "beibo"; |
| | | private static final String header = "Authorization"; |
| | | |
| | | public static String getUUID() { |
| | | String token = UUID.randomUUID().toString().replaceAll("-", ""); |
| | | return token; |
| | | } |
| | | // 生成jwt |
| | | public static String generateToken(String username) { |
| | | |
| | | /** |
| | | * 生成jtw |
| | | * |
| | | * @param subject token中要存放的数据(json格式) |
| | | * @return |
| | | */ |
| | | public static String createJWT(String subject) { |
| | | JwtBuilder builder = getJwtBuilder(subject, null, getUUID());// 设置过期时间 |
| | | return builder.compact(); |
| | | } |
| | | Date nowDate = new Date(); |
| | | Date expireDate = new Date(nowDate.getTime() + 1000 * expire); |
| | | |
| | | /** |
| | | * 生成jtw |
| | | * |
| | | * @param subject token中要存放的数据(json格式) |
| | | * @param ttlMillis token超时时间 |
| | | * @return |
| | | */ |
| | | public static String createJWT(String subject, Long ttlMillis) { |
| | | JwtBuilder builder = getJwtBuilder(subject, ttlMillis, getUUID());// 设置过期时间 |
| | | return builder.compact(); |
| | | } |
| | | |
| | | private static JwtBuilder getJwtBuilder(String subject, Long ttlMillis, String uuid) { |
| | | SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256; |
| | | SecretKey secretKey = generalKey(); |
| | | long nowMillis = System.currentTimeMillis(); |
| | | Date now = new Date(nowMillis); |
| | | if (ttlMillis == null) { |
| | | ttlMillis = JwtUtil.JWT_TTL; |
| | | } |
| | | long expMillis = nowMillis + ttlMillis; |
| | | Date expDate = new Date(expMillis); |
| | | return Jwts.builder() |
| | | .setId(uuid) //唯一的ID |
| | | .setSubject(subject) // 主题 可以是JSON数据 |
| | | .setIssuer("sg") // 签发者 |
| | | .setIssuedAt(now) // 签发时间 |
| | | .signWith(signatureAlgorithm, secretKey) //使用HS256对称加密算法签名, 第二个参数为秘钥 |
| | | .setExpiration(expDate); |
| | | .setHeaderParam("typ", "JWT") |
| | | .setSubject(username) |
| | | .setIssuedAt(nowDate) |
| | | .setExpiration(expireDate)// 7天過期 |
| | | .signWith(SignatureAlgorithm.HS512, secret) |
| | | .compact(); |
| | | } |
| | | |
| | | /** |
| | | * 创建token |
| | | * |
| | | * @param id |
| | | * @param subject |
| | | * @param ttlMillis |
| | | * @return |
| | | */ |
| | | public static String createJWT(String id, String subject, Long ttlMillis) { |
| | | JwtBuilder builder = getJwtBuilder(subject, ttlMillis, id);// 设置过期时间 |
| | | return builder.compact(); |
| | | // 解析jwt |
| | | public static Claims getClaimByToken(String jwt) { |
| | | try { |
| | | return Jwts.parser() |
| | | .setSigningKey(secret) |
| | | .parseClaimsJws(jwt) |
| | | .getBody(); |
| | | } catch (Exception e) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | String token = "eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJjYWM2ZDVhZi1mNjVlLTQ0MDAtYjcxMi0zYWEwOGIyOTIwYjQiLCJzdWIiOiJzZyIsImlzcyI6InNnIiwiaWF0IjoxNjM4MTA2NzEyLCJleHAiOjE2MzgxMTAzMTJ9.JVsSbkP94wuczb4QryQbAke3ysBDIL5ou8fWsbt_ebg"; |
| | | Claims claims = parseJWT(token); |
| | | System.out.println(claims); |
| | | // jwt是否过期 |
| | | public static boolean isTokenExpired(Claims claims) { |
| | | return claims.getExpiration().before(new Date()); |
| | | } |
| | | |
| | | /** |
| | | * 生成加密后的秘钥 secretKey |
| | | * |
| | | * @return |
| | | */ |
| | | public static SecretKey generalKey() { |
| | | byte[] encodedKey = Base64.getDecoder().decode(JwtUtil.JWT_KEY); |
| | | SecretKey key = new SecretKeySpec(encodedKey, 0, encodedKey.length, "AES"); |
| | | return key; |
| | | } |
| | | |
| | | /** |
| | | * 解析 |
| | | * |
| | | * @param jwt |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static Claims parseJWT(String jwt) throws Exception { |
| | | SecretKey secretKey = generalKey(); |
| | | return Jwts.parser() |
| | | .setSigningKey(secretKey) |
| | | .parseClaimsJws(jwt) |
| | | .getBody(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | public Collection<String> keys(final String pattern) { |
| | | return redisTemplate.keys(pattern); |
| | | } |
| | | |
| | | /** |
| | | * 判断key是否存在 |
| | | * |
| | | * @param key 键 |
| | | * @return true 存在 false不存在 |
| | | */ |
| | | public boolean hasKey(String key) { |
| | | try { |
| | | return redisTemplate.hasKey(key); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return false; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.common.utils; |
| | | |
| | | import com.mes.userinfo.entity.SysUser; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/4/25 15:41 |
| | | * @Description: |
| | | */ |
| | | public class UserInfoUtils { |
| | | private static InheritableThreadLocal<SysUser> tokenPool = new InheritableThreadLocal<SysUser>(); |
| | | |
| | | public static SysUser get() { |
| | | return tokenPool.get(); |
| | | } |
| | | |
| | | public static void set(SysUser user) { |
| | | tokenPool.set(user); |
| | | } |
| | | |
| | | public static void remove() { |
| | | if (get() != null) { |
| | | tokenPool.remove(); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.mes.menu.controller; |
| | | |
| | | |
| | | import com.mes.entity.request.GeneralRequest; |
| | | import com.mes.menu.entity.SysMenu; |
| | | import com.mes.menu.service.SysMenuService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiModel; |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 菜单表 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-04-11 |
| | | */ |
| | | @ApiModel("获取菜单信息") |
| | | @Api(description = "菜单管理") |
| | | @RestController |
| | | @RequestMapping("/menu/sysMenu") |
| | | @RequestMapping("/sys/menu") |
| | | public class SysMenuController { |
| | | |
| | | @Autowired |
| | | SysMenuService sysMenuService; |
| | | private SysMenuService sysMenuService; |
| | | |
| | | @ApiOperation("新增菜单") |
| | | @PostMapping("/save") |
| | | // @PreAuthorize("hasAuthority('sys:menu:save')") |
| | | public Result save(@Validated @RequestBody SysMenu sysMenu) { |
| | | return Result.success(sysMenuService.save(sysMenu)); |
| | | } |
| | | |
| | | @ApiOperation("修改菜单信息") |
| | | @PostMapping("/updateMenu") |
| | | // @PreAuthorize("hasAuthority('sys:menu:update')") |
| | | public Result updateMenu(@Validated @RequestBody SysMenu sysMenu) { |
| | | sysMenuService.updateMenu(sysMenu); |
| | | return Result.success(sysMenu); |
| | | } |
| | | |
| | | @ApiOperation("获取用户有权限的所有菜单") |
| | | @GetMapping("/list") |
| | | public Result<List<SysMenu>> getMenuTree() { |
| | | return Result.success(sysMenuService.getMenuTree()); |
| | | @GetMapping("/getMenuTree") |
| | | public Result<List<SysMenu>> getMenuTree(GeneralRequest request) { |
| | | return Result.success(sysMenuService.getMenuTree(request)); |
| | | } |
| | | |
| | | @ApiOperation("获取用户的权限") |
| | | @GetMapping("/getAuthorityInfo") |
| | | public Result<List<String>> getAuthorityInfo() { |
| | | return Result.success(sysMenuService.getAuthorityInfo()); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("用户当前用户的菜单和权限信息") |
| | | @GetMapping("/nav") |
| | | public Result<Map<Object, Object>> nav() { |
| | | return Result.success(sysMenuService.nav()); |
| | | } |
| | | |
| | | @ApiOperation("删除菜单") |
| | | @PostMapping("/deleteMenu") |
| | | // @PreAuthorize("hasAuthority('sys:menu:delete')") |
| | | public Result<String> deleteMenu(Long menuId) { |
| | | return Result.success(sysMenuService.deleteMenu(menuId)); |
| | | } |
| | | |
| | | @ApiOperation("批量删除菜单") |
| | | @PostMapping("/batchDeleteMenu") |
| | | // @PreAuthorize("hasAuthority('sys:menu:delete')") |
| | | public Result<String> batchDeleteMenu(@RequestBody List<Long> menuIds) { |
| | | return Result.success(sysMenuService.batchDeleteMenu(menuIds)); |
| | | } |
| | | |
| | | } |
| | |
| | | * 自增id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | private Long id; |
| | | |
| | | /** |
| | | * 父id |
| | | */ |
| | | private Integer parentId; |
| | | private Long parentId; |
| | | |
| | | /** |
| | | * 模块名称 |
| | |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 权限 |
| | | */ |
| | | private String perms; |
| | | |
| | | /** |
| | | * 子菜单 |
| | | */ |
| | | @TableField(exist = false) |
| | |
| | | package com.mes.menu.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.menu.entity.SysMenu; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | |
| | | * @since 2024-04-11 |
| | | */ |
| | | @Mapper |
| | | public interface SysMenuMapper extends BaseMapper<SysMenu> { |
| | | public interface SysMenuMapper extends MPJBaseMapper<SysMenu> { |
| | | |
| | | List<String> selectPermsByUserId(long parseLong); |
| | | } |
| | |
| | | package com.mes.menu.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.entity.request.GeneralRequest; |
| | | import com.mes.menu.entity.SysMenu; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface SysMenuService extends IService<SysMenu> { |
| | | |
| | | List<SysMenu> getMenuTree(); |
| | | /** |
| | | * 更新菜单信息 |
| | | * |
| | | * @param menu |
| | | * @return |
| | | */ |
| | | SysMenu updateMenu(SysMenu menu); |
| | | |
| | | /** |
| | | * 获取用户有权限的菜单树 |
| | | * |
| | | * @return |
| | | */ |
| | | List<SysMenu> getMenuTree(GeneralRequest request); |
| | | |
| | | /** |
| | | * 获取用户的权限 |
| | | * |
| | | * @return |
| | | */ |
| | | List<String> getAuthorityInfo(); |
| | | |
| | | |
| | | /** |
| | | * 获取用户菜单及权限信息 |
| | | * |
| | | * @return |
| | | */ |
| | | Map<Object, Object> nav(); |
| | | |
| | | /** |
| | | * 删除菜单信息 |
| | | * |
| | | * @param menuId |
| | | * @return |
| | | */ |
| | | String deleteMenu(Long menuId); |
| | | |
| | | /** |
| | | * 批量删除菜单信息 |
| | | * |
| | | * @param menuIds |
| | | * @return |
| | | */ |
| | | String batchDeleteMenu(List<Long> menuIds); |
| | | |
| | | } |
| | |
| | | package com.mes.menu.service.impl; |
| | | |
| | | import cn.hutool.core.map.MapUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.common.utils.UserInfoUtils; |
| | | import com.mes.entity.request.GeneralRequest; |
| | | import com.mes.menu.entity.SysMenu; |
| | | import com.mes.menu.mapper.SysMenuMapper; |
| | | import com.mes.menu.service.SysMenuService; |
| | | import com.mes.role.entity.SysRoleMenu; |
| | | import com.mes.role.service.SysRoleMenuService; |
| | | import com.mes.userinfo.entity.SysUser; |
| | | import com.mes.userinfo.entity.SysUserRole; |
| | | import com.mes.userinfo.mapper.SysUserRoleMapper; |
| | | import com.mes.userinfo.service.SysUserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | @Slf4j |
| | | public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements SysMenuService { |
| | | |
| | | @Autowired |
| | | SysUserService sysUserService; |
| | | |
| | | @Autowired |
| | | SysUserRoleMapper sysUserRoleMapper; |
| | | |
| | | @Autowired |
| | | SysRoleMenuService sysRoleMenuService; |
| | | |
| | | @Override |
| | | public List<SysMenu> getMenuTree() { |
| | | List<SysMenu> menuList = this.baseMapper.selectList(null); |
| | | public SysMenu updateMenu(SysMenu menu) { |
| | | baseMapper.updateById(menu); |
| | | // 清除所有与该菜单相关的权限缓存 |
| | | sysUserService.clearUserAuthorityInfoByMenuId(menu.getId()); |
| | | return menu; |
| | | } |
| | | |
| | | @Override |
| | | public List<SysMenu> getMenuTree(GeneralRequest request) { |
| | | //todo:需要先获取用户的角色,角色下的菜单权限,拿到菜单id获取所有菜单 |
| | | SysUser user = UserInfoUtils.get(); |
| | | MPJLambdaWrapper<SysUserRole> wrapper = new MPJLambdaWrapper<>(); |
| | | |
| | | wrapper.selectAll(SysMenu.class).distinct() |
| | | .leftJoin(SysUser.class, SysUser::getId, SysUserRole::getUserId) |
| | | .leftJoin(SysRoleMenu.class, SysRoleMenu::getRoleId, SysUserRole::getRoleId) |
| | | .leftJoin(SysMenu.class, SysMenu::getId, SysRoleMenu::getMenuId) |
| | | .eq(SysUser::getId, user.getId()) |
| | | .like(StringUtils.isNotBlank(request.getKey()), SysMenu::getMenuName, request.getKey()); |
| | | |
| | | List<SysMenu> menuList = sysUserRoleMapper.selectJoinList(SysMenu.class, wrapper); |
| | | return create(menuList); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> getAuthorityInfo() { |
| | | SysUser user = UserInfoUtils.get(); |
| | | log.info("获取用户信息,用户名为{}", user); |
| | | // 获取权限信息 |
| | | // ROLE_admin,ROLE_normal,sys:user:list,.... |
| | | return sysUserService.getUserAuthorityInfo(user.getId()); |
| | | } |
| | | |
| | | @Override |
| | | public Map<Object, Object> nav() { |
| | | List<SysMenu> menuTree = getMenuTree(new GeneralRequest()); |
| | | List<String> authorityInfo = getAuthorityInfo(); |
| | | return MapUtil.builder().put("authoritys", authorityInfo) |
| | | .put("tree", menuTree).map(); |
| | | } |
| | | |
| | | @Override |
| | | public String deleteMenu(Long menuId) { |
| | | int count = this.count(new LambdaQueryWrapper<SysMenu>().eq(SysMenu::getParentId, menuId)); |
| | | if (count > 0) { |
| | | return "无法删除,请先删除子菜单"; |
| | | } |
| | | |
| | | // 清除所有与该菜单相关的权限缓存 |
| | | sysUserService.clearUserAuthorityInfoByMenuId(menuId); |
| | | |
| | | this.removeById(menuId); |
| | | |
| | | // 同步删除中间关联表 |
| | | sysRoleMenuService.remove(new LambdaQueryWrapper<SysRoleMenu>().eq(SysRoleMenu::getMenuId, menuId)); |
| | | return "删除成功"; |
| | | } |
| | | |
| | | @Override |
| | | public String batchDeleteMenu(List<Long> menuIds) { |
| | | menuIds.stream().forEach(e -> deleteMenu(e)); |
| | | return "批量删除成功"; |
| | | } |
| | | |
| | | |
| | |
| | | private List<SysMenu> getChildren(SysMenu menu, List<SysMenu> menus) { |
| | | List<SysMenu> res = menus.stream() |
| | | .filter(item -> item.getParentId().equals(menu.getId())) |
| | | .map(item -> { |
| | | item.setChildren(getChildren(item, menus)); |
| | | return item; |
| | | }).collect(Collectors.toList()); |
| | | .collect(Collectors.toList()); |
| | | log.info("菜单树:{}", JSONUtil.toJsonStr(res)); |
| | | return res; |
| | | } |
| | |
| | | package com.mes.role.controller; |
| | | |
| | | |
| | | import com.mes.entity.request.GeneralRequest; |
| | | import com.mes.role.entity.SysRole; |
| | | import com.mes.role.entity.vo.SysRoleVO; |
| | | import com.mes.role.service.SysRoleService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | | 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; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 角色表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-04-11 |
| | | */ |
| | | @Api(description = "角色管理") |
| | | @RestController |
| | | @RequestMapping("/role/sys-role") |
| | | @RequestMapping("/sys/role") |
| | | public class SysRoleController { |
| | | |
| | | } |
| | | @Autowired |
| | | private SysRoleService sysRoleService; |
| | | |
| | | @ApiOperation("新增角色及角色下的权限信息") |
| | | @PostMapping("/saveRole") |
| | | // @PreAuthorize("hasAuthority('sys:role:save')") |
| | | public Result<SysRole> saveRole(@Validated @RequestBody SysRoleVO sysRoleVO) { |
| | | return Result.success(sysRoleService.saveRole(sysRoleVO)); |
| | | } |
| | | |
| | | @ApiOperation("编辑角色及角色下的权限信息") |
| | | @PostMapping("/updateRole") |
| | | // @PreAuthorize("hasAuthority('sys:role:save')") |
| | | public Result<String> updateRole(@Validated @RequestBody SysRoleVO sysRoleVO) { |
| | | return Result.success(sysRoleService.updateRole(sysRoleVO)); |
| | | } |
| | | |
| | | @ApiOperation("查询角色及角色下的权限信息") |
| | | @PostMapping("/queryRole") |
| | | // @PreAuthorize("hasAuthority('sys:role:save')") |
| | | public Result<List<SysRoleVO>> queryRole(@Validated @RequestBody GeneralRequest request) { |
| | | return Result.success(sysRoleService.queryRole(request)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("删除角色及角色下的权限信息") |
| | | @PostMapping("/delete") |
| | | // @PreAuthorize("hasAuthority('sys:role:delete')") |
| | | @Transactional |
| | | public Result<String> deleteRole(@RequestBody List<Long> ids) { |
| | | return Result.success(sysRoleService.deleteRole(ids)); |
| | | } |
| | | |
| | | } |
| | |
| | | /** |
| | | * 角色ID |
| | | */ |
| | | @TableId(value = "role_id", type = IdType.AUTO) |
| | | @TableId(type = IdType.NONE) |
| | | private Long roleId; |
| | | |
| | | /** |
New file |
| | |
| | | package com.mes.role.entity.vo; |
| | | |
| | | import com.mes.menu.entity.SysMenu; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/4/26 13:57 |
| | | * @Description: |
| | | */ |
| | | @Api(description = "角色信息") |
| | | @Data |
| | | public class SysRoleVO implements Serializable { |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "角色ID", position = 2) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "角色名称", position = 3) |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "角色权限字符串", position = 4) |
| | | private String roleKey; |
| | | |
| | | @ApiModelProperty(value = "角色状态(0正常 1停用)", position = 5) |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "删除标志", position = 6) |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "备注", position = 7) |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "角色菜单信息", position = 8) |
| | | private List<SysMenu> menuList; |
| | | |
| | | } |
| | |
| | | package com.mes.role.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.role.entity.SysRole; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | |
| | | * @since 2024-04-11 |
| | | */ |
| | | @Mapper |
| | | public interface SysRoleMapper extends BaseMapper<SysRole> { |
| | | public interface SysRoleMapper extends MPJBaseMapper<SysRole> { |
| | | |
| | | } |
| | |
| | | package com.mes.role.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.entity.request.GeneralRequest; |
| | | import com.mes.role.entity.SysRole; |
| | | import com.mes.role.entity.vo.SysRoleVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface SysRoleService extends IService<SysRole> { |
| | | |
| | | /** |
| | | * 创建角色信息 |
| | | * |
| | | * @param sysRoleVO |
| | | * @return |
| | | */ |
| | | SysRole saveRole(SysRoleVO sysRoleVO); |
| | | |
| | | /** |
| | | * 修改角色信息及权限 |
| | | * |
| | | * @param sysRoleVO |
| | | * @return |
| | | */ |
| | | String updateRole(SysRoleVO sysRoleVO); |
| | | |
| | | /** |
| | | * 按照角色名查询角色信息 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | List<SysRoleVO> queryRole(GeneralRequest request); |
| | | |
| | | /** |
| | | * 查询角色及角色下的权限信息 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | String deleteRole(List<Long> ids); |
| | | } |
| | |
| | | package com.mes.role.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.entity.request.GeneralRequest; |
| | | import com.mes.menu.entity.SysMenu; |
| | | import com.mes.role.entity.SysRole; |
| | | import com.mes.role.entity.SysRoleMenu; |
| | | import com.mes.role.entity.vo.SysRoleVO; |
| | | import com.mes.role.mapper.SysRoleMapper; |
| | | import com.mes.role.service.SysRoleMenuService; |
| | | import com.mes.role.service.SysRoleService; |
| | | import com.mes.userinfo.entity.SysUserRole; |
| | | import com.mes.userinfo.service.SysUserRoleService; |
| | | import com.mes.userinfo.service.SysUserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-04-11 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService { |
| | | |
| | | @Autowired |
| | | SysRoleMenuService sysRoleMenuService; |
| | | |
| | | @Autowired |
| | | SysUserService sysUserService; |
| | | |
| | | @Autowired |
| | | SysUserRoleService sysUserRoleService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public SysRole saveRole(SysRoleVO sysRoleVO) { |
| | | log.info("保存角色信息,生成对应的角色id"); |
| | | SysRole sysRole = new SysRole(); |
| | | BeanUtils.copyProperties(sysRoleVO, sysRole); |
| | | this.save(sysRole); |
| | | //保存角色权限信息 |
| | | saveRoleMenu(sysRole.getId(), sysRoleVO.getMenuList()); |
| | | return sysRole; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public String updateRole(SysRoleVO sysRoleVO) { |
| | | log.info("保存角色信息,生成对应的角色id"); |
| | | SysRole sysRole = new SysRole(); |
| | | BeanUtils.copyProperties(sysRoleVO, sysRole); |
| | | this.updateById(sysRole); |
| | | //保存角色权限信息 |
| | | return saveRoleMenu(sysRole.getId(), sysRoleVO.getMenuList()); |
| | | } |
| | | |
| | | @Override |
| | | public List<SysRoleVO> queryRole(GeneralRequest request) { |
| | | MPJLambdaWrapper<SysRole> wrapper = new MPJLambdaWrapper<>(); |
| | | wrapper.selectAll(SysRole.class) |
| | | .selectCollection(SysMenu.class, SysRoleVO::getMenuList) |
| | | .leftJoin(SysRoleMenu.class, SysRoleMenu::getRoleId, SysRole::getId) |
| | | .leftJoin(SysMenu.class, SysMenu::getId, SysRoleMenu::getMenuId) |
| | | .like(StringUtils.hasText(request.getKey()), SysRole::getName, request.getKey()); |
| | | return baseMapper.selectJoinList(SysRoleVO.class, wrapper); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public String deleteRole(List<Long> ids) { |
| | | log.info("删除角色信息"); |
| | | this.removeByIds(ids); |
| | | |
| | | log.info("删除中间表信息"); |
| | | sysUserRoleService.remove(new LambdaQueryWrapper<SysUserRole>().in(SysUserRole::getRoleId, ids)); |
| | | sysRoleMenuService.remove(new LambdaQueryWrapper<SysRoleMenu>().in(SysRoleMenu::getRoleId, ids)); |
| | | |
| | | log.info("清空缓存中的权限信息"); |
| | | ids.stream().forEach(id -> sysUserService.clearUserAuthorityInfoByRoleId(id)); |
| | | return "success"; |
| | | } |
| | | |
| | | /** |
| | | * 保存角色权限信息 |
| | | * |
| | | * @param roleId |
| | | * @param menuList |
| | | * @return |
| | | */ |
| | | private String saveRoleMenu(Long roleId, List<SysMenu> menuList) { |
| | | log.info("配置角色菜单关心"); |
| | | List<SysRoleMenu> roleMenuList = menuList.stream().map(menu -> { |
| | | SysRoleMenu roleMenu = new SysRoleMenu(); |
| | | roleMenu.setRoleId(roleId); |
| | | roleMenu.setMenuId(menu.getId()); |
| | | return roleMenu; |
| | | }).collect(Collectors.toList()); |
| | | log.info("清空角色权限表中该角色信息"); |
| | | |
| | | |
| | | // 先删除原来的记录,再保存新的 |
| | | sysRoleMenuService.remove(new LambdaQueryWrapper<SysRoleMenu>().eq(SysRoleMenu::getRoleId, roleId)); |
| | | sysRoleMenuService.saveBatch(roleMenuList); |
| | | |
| | | // 删除缓存 |
| | | sysUserService.clearUserAuthorityInfoByRoleId(roleId); |
| | | return "success"; |
| | | } |
| | | } |
| | |
| | | package com.mes.userinfo.controller; |
| | | |
| | | |
| | | import com.mes.entity.request.GeneralRequest; |
| | | import com.mes.userinfo.entity.SysUser; |
| | | import com.mes.userinfo.entity.vo.SysUserVO; |
| | | import com.mes.userinfo.service.SysUserService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | 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; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-11 |
| | | */ |
| | | @Api(description = "用户管理") |
| | | @RestController |
| | | @RequestMapping("/userinfo") |
| | | @RequestMapping("/sys/user") |
| | | public class SysUserController { |
| | | |
| | | @Autowired |
| | | private SysUserService sysUserService; |
| | | |
| | | @ApiOperation("用户登录") |
| | | @PostMapping("/login") |
| | | public Result login(@RequestBody SysUser user) { |
| | | return sysUserService.login(user); |
| | | public Result<Map<String, String>> login(@RequestBody SysUser user) { |
| | | return Result.success(sysUserService.login(user)); |
| | | } |
| | | |
| | | @GetMapping("/hello") |
| | | public Result hello() { |
| | | return Result.success("eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJlZjMyMjQ4NDcyODE0ZWFlYWRlOTBkYmZjYWFlZmNmZSIsInN1YiI6IjEiLCJpc3MiOiJzZyIsImlhdCI6MTcxMjkwMjI0NCwiZXhwIjoxNzEyOTA1ODQ0fQ.DlJkhkiwjZSqprdLzKaTB3yuyxGukerKeF0FbJK_6HY"); |
| | | @ApiOperation("退出登录") |
| | | @PostMapping("/logout") |
| | | // @PreAuthorize("hasRole('ROLE_admin')") |
| | | @PreAuthorize("hasAuthority('xt:yh')") |
| | | public Result<String> logout() { |
| | | return Result.success(sysUserService.logout()); |
| | | } |
| | | |
| | | @ApiOperation("新增用户信息") |
| | | @PostMapping("/saveUser") |
| | | // @PreAuthorize("hasAuthority('sys:user:save')") |
| | | public Result<String> saveUser(@Validated @RequestBody SysUserVO sysUser) { |
| | | return Result.success(sysUserService.saveUser(sysUser)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("更新用户信息") |
| | | @PostMapping("/updateUser") |
| | | // @PreAuthorize("hasAuthority('sys:user:update')") |
| | | public Result<SysUserVO> updateUser(@Validated @RequestBody SysUserVO sysUser) { |
| | | return Result.success(sysUserService.updateUser(sysUser)); |
| | | } |
| | | |
| | | @ApiOperation("重置密码") |
| | | @PostMapping("/resetPassword") |
| | | // @PreAuthorize("hasAuthority('sys:user:resetPassword')") |
| | | public Result resetPassword(String userId) { |
| | | return Result.success(sysUserService.resetPassword(Long.parseLong(userId))); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("获取用户列表") |
| | | @PostMapping("/listByUserName") |
| | | // @PreAuthorize("hasAuthority('sys:user:list')") |
| | | public Result<List<SysUserVO>> listByUserName(@RequestBody GeneralRequest request) { |
| | | return Result.success(sysUserService.listByUserName(request)); |
| | | } |
| | | |
| | | @ApiOperation("删除用户信息") |
| | | @PostMapping("/deleteUser") |
| | | // @PreAuthorize("hasAuthority('sys:user:delete')") |
| | | public Result<String> deleteUser(@RequestBody List<Long> ids) { |
| | | return Result.success(sysUserService.deleteUser(ids)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @AllArgsConstructor |
| | | public class SysUserRole implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @TableId(value = "user_id", type = IdType.AUTO) |
| | | @TableId(type = IdType.NONE) |
| | | private Long userId; |
| | | |
| | | /** |
New file |
| | |
| | | package com.mes.userinfo.entity.vo; |
| | | |
| | | import com.mes.role.entity.SysRole; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户表 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-04-11 |
| | | */ |
| | | @Api(description = "用户信息") |
| | | @Data |
| | | public class SysUserVO implements Serializable { |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @ApiModelProperty(value = "主键", position = 2) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 用户名 |
| | | */ |
| | | @ApiModelProperty(value = "用户名", position = 3) |
| | | private String userName; |
| | | |
| | | /** |
| | | * 昵称 |
| | | */ |
| | | @ApiModelProperty(value = "昵称", position = 4) |
| | | private String nickName; |
| | | |
| | | /** |
| | | * 密码 |
| | | */ |
| | | @ApiModelProperty(value = "密码", position = 5) |
| | | private String password; |
| | | |
| | | /** |
| | | * 头像 |
| | | */ |
| | | @ApiModelProperty(value = "头像", position = 6) |
| | | private String avatar; |
| | | |
| | | /** |
| | | * 用户的角色信息 |
| | | */ |
| | | @ApiModelProperty(value = "用户的角色信息", position = 7) |
| | | private List<SysRole> roleList; |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.userinfo.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.userinfo.entity.SysUser; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | |
| | | * @since 2024-04-11 |
| | | */ |
| | | @Mapper |
| | | public interface SysUserMapper extends BaseMapper<SysUser> { |
| | | public interface SysUserMapper extends MPJBaseMapper<SysUser> { |
| | | |
| | | } |
| | |
| | | package com.mes.userinfo.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.userinfo.entity.SysUserRole; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | |
| | | * @since 2024-04-11 |
| | | */ |
| | | @Mapper |
| | | public interface SysUserRoleMapper extends BaseMapper<SysUserRole> { |
| | | public interface SysUserRoleMapper extends MPJBaseMapper<SysUserRole> { |
| | | |
| | | } |
| | |
| | | package com.mes.userinfo.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.userinfo.entity.SysUserRole; |
| | | |
| | | /** |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-11 |
| | | */ |
| | | public interface SysUserRoleService extends IService<SysUserRole> { |
| | | public interface SysUserRoleService extends MPJBaseService<SysUserRole> { |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.userinfo.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.entity.request.GeneralRequest; |
| | | import com.mes.userinfo.entity.SysUser; |
| | | import com.mes.utils.Result; |
| | | import com.mes.userinfo.entity.vo.SysUserVO; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface SysUserService extends IService<SysUser> { |
| | | |
| | | Result login(SysUser user); |
| | | /** |
| | | * 用户登录 |
| | | * |
| | | * @param user |
| | | * @return |
| | | */ |
| | | Map<String, String> login(SysUser user); |
| | | |
| | | Result logout(); |
| | | /** |
| | | * 退出登录 |
| | | * |
| | | * @return |
| | | */ |
| | | String logout(); |
| | | |
| | | /** |
| | | * 新增用户信息 |
| | | * |
| | | * @param user |
| | | * @return |
| | | */ |
| | | String saveUser(SysUserVO user); |
| | | |
| | | /** |
| | | * 更新用户信息 |
| | | * |
| | | * @param sysUser |
| | | * @return |
| | | */ |
| | | SysUserVO updateUser(SysUserVO sysUser); |
| | | |
| | | /** |
| | | * 重置密码 |
| | | * |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | String resetPassword(Long userId); |
| | | |
| | | /** |
| | | * 按名称获取用户信息 |
| | | * |
| | | * @param userName |
| | | * @return |
| | | */ |
| | | SysUser queryByUserName(String userName); |
| | | |
| | | /** |
| | | * 按关键字获取用户信息列表 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | List<SysUserVO> listByUserName(GeneralRequest request); |
| | | |
| | | /** |
| | | * 删除用户信息 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | String deleteUser(List<Long> ids); |
| | | |
| | | /** |
| | | * 获取用户角色权限信息 |
| | | * |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | List<String> getUserAuthorityInfo(Long userId); |
| | | |
| | | /** |
| | | * 清空用户权限信息通过用户信息 |
| | | */ |
| | | void clearUserAuthorityInfo(String userName); |
| | | |
| | | /** |
| | | * 清空用户权限信息通过角色id |
| | | * |
| | | * @param roleId |
| | | */ |
| | | void clearUserAuthorityInfoByRoleId(Long roleId); |
| | | |
| | | /** |
| | | * 清空用户权限信息通过菜单id |
| | | * |
| | | * @param menuId |
| | | */ |
| | | void clearUserAuthorityInfoByMenuId(Long menuId); |
| | | } |
| | |
| | | package com.mes.userinfo.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.common.utils.JwtUtil; |
| | | import com.mes.common.utils.RedisUtil; |
| | | import com.mes.common.utils.UserInfoUtils; |
| | | import com.mes.entity.request.GeneralRequest; |
| | | import com.mes.menu.mapper.SysMenuMapper; |
| | | import com.mes.role.entity.SysRole; |
| | | import com.mes.role.entity.SysRoleMenu; |
| | | import com.mes.role.service.SysRoleService; |
| | | import com.mes.userinfo.entity.LoginUser; |
| | | import com.mes.userinfo.entity.SysUser; |
| | | import com.mes.userinfo.entity.SysUserRole; |
| | | import com.mes.userinfo.entity.vo.SysUserVO; |
| | | import com.mes.userinfo.mapper.SysUserMapper; |
| | | import com.mes.userinfo.service.SysUserRoleService; |
| | | import com.mes.userinfo.service.SysUserService; |
| | | import com.mes.utils.Result; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.authentication.AuthenticationManager; |
| | | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.security.core.context.SecurityContextHolder; |
| | | import org.springframework.security.core.userdetails.UserDetails; |
| | | import org.springframework.security.core.userdetails.UserDetailsService; |
| | | import org.springframework.security.core.userdetails.UsernameNotFoundException; |
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-04-11 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService, UserDetailsService { |
| | | |
| | | @Autowired |
| | | private AuthenticationManager authenticationManager; |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | @Resource |
| | | private SysMenuMapper sysMenuMapper; |
| | | |
| | | @Resource |
| | | private SysUserRoleService sysUserRoleService; |
| | | |
| | | @Resource |
| | | private SysRoleService sysRoleService; |
| | | |
| | | @Resource |
| | | BCryptPasswordEncoder passwordEncoder; |
| | | |
| | | @Override |
| | | public Result login(SysUser user) { |
| | | public Map<String, String> login(SysUser user) { |
| | | UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(user.getUserName(), user.getPassword()); |
| | | Authentication authenticate = authenticationManager.authenticate(authenticationToken); |
| | | if (Objects.isNull(authenticate)) { |
| | |
| | | //使用userid生成token |
| | | LoginUser loginUser = (LoginUser) authenticate.getPrincipal(); |
| | | String userId = loginUser.getUser().getId().toString(); |
| | | String jwt = JwtUtil.createJWT(userId); |
| | | String jwt = JwtUtil.generateToken(userId); |
| | | |
| | | //查询权限信息 |
| | | // List<String> perms = sysMenuMapper.selectPermsByUserId(userId); |
| | | //authenticate存入redis |
| | | redisUtil.setCacheObject("login:" + userId, loginUser); |
| | | //把token响应给前端 |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("token", jwt); |
| | | return Result.success(map); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public Result logout() { |
| | | Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); |
| | | LoginUser loginUser = (LoginUser) authentication.getPrincipal(); |
| | | Long userid = loginUser.getUser().getId(); |
| | | redisUtil.deleteObject("login:" + userid); |
| | | return Result.success("退出成功"); |
| | | public String logout() { |
| | | log.info("用户退出"); |
| | | SysUser user = UserInfoUtils.get(); |
| | | redisUtil.deleteObject("login:" + user.getId()); |
| | | return "注销成功"; |
| | | } |
| | | |
| | | @Transactional |
| | | @Override |
| | | public String saveUser(SysUserVO user) { |
| | | log.info("保存用户信息"); |
| | | // 默认密码 |
| | | String password = passwordEncoder.encode(Const.DEFULT_PASSWORD); |
| | | user.setPassword(password); |
| | | SysUser sysUser = new SysUser(); |
| | | BeanUtils.copyProperties(user, sysUser); |
| | | this.save(sysUser); |
| | | saveUserRole(user.getRoleList(), sysUser.getId()); |
| | | return "success"; |
| | | } |
| | | |
| | | @Transactional |
| | | @Override |
| | | public SysUserVO updateUser(SysUserVO user) { |
| | | log.info("更新用户信息"); |
| | | SysUser sysUser = new SysUser(); |
| | | BeanUtils.copyProperties(user, sysUser); |
| | | this.updateById(sysUser); |
| | | log.info("删除用户角色信息"); |
| | | List<Long> roleIds = user.getRoleList().stream().map(SysRole::getId).collect(Collectors.toList()); |
| | | sysUserRoleService.remove(new LambdaQueryWrapper<SysUserRole>() |
| | | .eq(SysUserRole::getUserId, sysUser.getId()).in(CollectionUtil.isNotEmpty(roleIds), SysUserRole::getRoleId, roleIds)); |
| | | log.info("保存用户角色信息"); |
| | | saveUserRole(user.getRoleList(), sysUser.getId()); |
| | | return user; |
| | | } |
| | | |
| | | @Override |
| | | public String resetPassword(Long userId) { |
| | | log.info("重置密码为{}", Const.DEFULT_PASSWORD); |
| | | SysUser sysUser = new SysUser(); |
| | | sysUser.setId(userId); |
| | | String password = passwordEncoder.encode(Const.DEFULT_PASSWORD); |
| | | sysUser.setPassword(password); |
| | | this.updateById(sysUser); |
| | | return "success"; |
| | | } |
| | | |
| | | @Override |
| | | public SysUser queryByUserName(String userName) { |
| | | return baseMapper.selectOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUserName, userName)); |
| | | } |
| | | |
| | | @Override |
| | | public List<SysUserVO> listByUserName(GeneralRequest request) { |
| | | MPJLambdaWrapper<SysUser> wrapper = new MPJLambdaWrapper<>(); |
| | | wrapper.selectAll(SysUser.class) |
| | | .selectCollection(SysRole.class, SysUserVO::getRoleList) |
| | | .leftJoin(SysUserRole.class, SysUserRole::getUserId, SysUser::getId) |
| | | .leftJoin(SysRole.class, SysRole::getId, SysUserRole::getRoleId) |
| | | .like(StringUtils.hasText(request.getKey()), SysUser::getUserName, request.getKey()); |
| | | return baseMapper.selectJoinList(SysUserVO.class, wrapper); |
| | | } |
| | | |
| | | @Transactional |
| | | @Override |
| | | public String deleteUser(List<Long> ids) { |
| | | this.removeByIds(ids); |
| | | sysUserRoleService.remove(new QueryWrapper<SysUserRole>().in("user_id", ids)); |
| | | return "success"; |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<String> getUserAuthorityInfo(Long userId) { |
| | | SysUser sysUser = baseMapper.selectById(userId); |
| | | |
| | | // ROLE_admin,ROLE_normal,sys:user:list,.... |
| | | String authority = ""; |
| | | if (redisUtil.hasKey("GrantedAuthority:" + sysUser.getUserName())) { |
| | | authority = redisUtil.getCacheObject("GrantedAuthority:" + sysUser.getUserName()); |
| | | |
| | | } else { |
| | | // 获取角色编码 |
| | | List<SysRole> roles = sysRoleService.list(new QueryWrapper<SysRole>() |
| | | .inSql("id", "select role_id from sys_user_role where user_id = " + userId)); |
| | | |
| | | if (roles.size() > 0) { |
| | | String roleCodes = roles.stream().map(r -> "ROLE_" + r.getRoleKey()).collect(Collectors.joining(",")); |
| | | authority = roleCodes.concat(","); |
| | | } |
| | | |
| | | // 获取菜单操作编码 |
| | | List<String> perms = sysMenuMapper.selectPermsByUserId(userId); |
| | | if (perms.size() > 0) { |
| | | String menuPerms = String.join(",", perms); |
| | | authority = authority.concat(menuPerms); |
| | | } |
| | | |
| | | redisUtil.setCacheObject("GrantedAuthority:" + sysUser.getUserName(), authority, 60 * 60, TimeUnit.SECONDS); |
| | | } |
| | | return Arrays.stream(authority.split(",")).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @Override |
| | | public void clearUserAuthorityInfo(String userName) { |
| | | redisUtil.deleteObject("GrantedAuthority:" + userName); |
| | | } |
| | | |
| | | @Override |
| | | public void clearUserAuthorityInfoByRoleId(Long roleId) { |
| | | List<SysUser> sysUsers = this.list(new QueryWrapper<SysUser>() |
| | | .inSql("id", "select user_id from sys_user_role where role_id = " + roleId)); |
| | | |
| | | sysUsers.forEach(u -> { |
| | | this.clearUserAuthorityInfo(u.getUserName()); |
| | | }); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void clearUserAuthorityInfoByMenuId(Long menuId) { |
| | | MPJLambdaWrapper<SysUserRole> wrapper = new MPJLambdaWrapper<SysUserRole>().selectAll(SysUser.class).distinct() |
| | | .leftJoin(SysUser.class, SysUser::getId, SysUserRole::getUserId) |
| | | .leftJoin(SysRoleMenu.class, SysRoleMenu::getRoleId, SysUserRole::getRoleId) |
| | | .eq(SysRoleMenu::getMenuId, menuId); |
| | | List<SysUser> sysUsers = sysUserRoleService.selectJoinList(SysUser.class, wrapper); |
| | | sysUsers.forEach(u -> { |
| | | this.clearUserAuthorityInfo(u.getUserName()); |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 实现UserDetailsService接口,从数据库内获取用户及权限信息 |
| | | * |
| | | * @param username |
| | | * @return |
| | | * @throws UsernameNotFoundException |
| | | */ |
| | | @Override |
| | | public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { |
| | | LambdaQueryWrapper<SysUser> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | |
| | | return new LoginUser(user, perms); |
| | | } |
| | | |
| | | |
| | | private void saveUserRole(List<SysRole> roles, Long userId) { |
| | | log.info("保存用户角色信息"); |
| | | List<SysUserRole> userRoles = new ArrayList<>(); |
| | | if (CollectionUtils.isEmpty(roles)) { |
| | | log.info("保存用户角色信息为空,给默认普通用户角色"); |
| | | userRoles.add(new SysUserRole(userId, Const.DEFULT_ROLE)); |
| | | } else { |
| | | log.info("保存用户角色信息"); |
| | | userRoles = roles.stream().map(e -> new SysUserRole(userId, e.getId())).collect(Collectors.toList()); |
| | | } |
| | | sysUserRoleService.saveBatch(userRoles); |
| | | } |
| | | |
| | | } |
| | |
| | | <artifactId>spring-cloud-starter-gateway</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
| | |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 10.153.19.150:8848 |
| | | server-addr: 127.0.0.1:8848 |
| | | gateway: |
| | | discovery: |
| | | locator: |
| | |
| | | <artifactId>junit</artifactId> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.yulichang</groupId> |
| | | <artifactId>mybatis-plus-join</artifactId> |
| | | <version>1.1.6</version> |
| | | </dependency> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.github.yulichang</groupId>--> |
| | | <!-- <artifactId>mybatis-plus-join-boot-starter</artifactId>--> |
| | | <!-- <version>1.4.12</version>--> |
| | | <!-- </dependency>--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.github.yulichang</groupId>--> |
| | | <!-- <artifactId>mybatis-plus-join</artifactId>--> |
| | | <!-- <version>1.1.6</version>--> |
| | | <!-- </dependency>--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.github.yulichang</groupId>--> |
| | | <!-- <artifactId>mybatis-plus-join-boot-starter</artifactId>--> |
| | | <!-- <version>1.4.12</version>--> |
| | | <!-- </dependency>--> |
| | | </dependencies> |
| | | |
| | | <properties> |
New file |
| | |
| | | package com.mes; |
| | | |
| | | import com.mes.common.PlcHomeEdg; |
| | | import org.springframework.boot.ApplicationArguments; |
| | | import org.springframework.boot.ApplicationRunner; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | @Order(1) |
| | | |
| | | public class AppRunnerConfig implements ApplicationRunner { |
| | | |
| | | @Override |
| | | public void run(ApplicationArguments args) throws Exception { |
| | | // TODO Auto-generated method stub |
| | | // |
| | | //System.out.println("启动完成"); |
| | | new PlcHomeEdg().start(); |
| | | |
| | | } |
| | | } |
| | |
| | | package com.mes; |
| | | |
| | | import com.mes.common.WebSocketServer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | import org.springframework.context.ConfigurableApplicationContext; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | import com.mes.edgstoragecage.service.*; |
| | | |
| | |
| | | |
| | | public static void main(String[] args) { |
| | | try { |
| | | SpringApplication.run(CacheGlassModuleApplication.class, args); |
| | | SpringApplication springApplication = new SpringApplication(CacheGlassModuleApplication.class); |
| | | ConfigurableApplicationContext applicationContext = springApplication.run(args); |
| | | WebSocketServer.setApplicationContext(applicationContext); |
| | | //SpringApplication.run(CacheGlassModuleApplication.class, args); |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage()); |
| | | } |
| | |
| | | |
| | | public class PLCAutoMes extends Thread { |
| | | |
| | | // // 用于存储应用程序的配置信息 |
| | | // private Configuration config; |
| | | private static InitUtil initUtil; |
| | | // public static PlcParameterObject PlcMesObject; |
| | | // public static PlcParameterObject PlcReadObject; |
| | | // public static PlcParameterObject PlcframeObject; |
| | | |
| | | // // 创建一个自定义的 S7 控制器消息处理器对象 |
| | | // MessageHandler customS7Control = new MessageHandler(); |
| | | |
| | | // 单例实例 |
| | | private static PLCAutoMes instance; |
| | | // private static String PlcMes = PLCAutoMes.class.getResource("/JsonFile/PlcMes.json").getPath(); |
| | | private static String PlcAlbania = PLCAutoMes.class.getResource("/JsonFile/PlcAlbania.json").getPath(); |
| | | // private static String PlcRead = PLCAutoMes.class.getResource("/JsonFile/PlcRead.json").getPath(); |
| | | // private static String Plcframe = PLCAutoMes.class.getResource("/JsonFile/Plcframe.json").getPath(); |
| | | // private static String PlcParameter = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcParameter.json").getPath(); |
| | | |
| | | // private static String PlcSign = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcSign.json").getPath(); |
| | | |
| | | // private static String PlcState = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcState.json").getPath(); |
| | | |
| | | // private static String PlcAlarm = PLCAutoMes.class.getResource("/JsonFile/PlcAlarm.json").getPath(); |
| | | // private static String PlcTest = PLCAutoMes.class.getResource("/JsonFile/PlcTest.json").getPath(); |
| | | |
| | | // 调用initword方法 |
| | | |
| | | // public static PlcParameterObject plcParameterObject = initUtil.initword(PlcParameter); |
| | | // public static PlcBitObject plcPlcTest = initUtil.initbit(PlcTest); |
| | | // public static PlcBitObject plcBitObject = initUtil.initbit(PlcSign); |
| | | // public static PlcParameterObject plcStateObject= initUtil.initword(PlcState); |
| | | // public static PlcBitObject plcPlcAlarm = initUtil.initbit(PlcAlarm); |
| | | public static PlcParameterObject PlcMesObject = InitUtil.initword(PlcAlbania); |
| | | // public static PlcParameterObject PlcReadObject = initUtil.initword(PlcRead); |
| | | // public static PlcParameterObject PlcframeObject = initUtil.initword(Plcframe); |
| | | |
| | | // 私有构造函数 |
| | | public PLCAutoMes() throws IOException { |
| | | //config = new Configuration("config.properties"); |
| | | initUtil = new InitUtil(); |
| | | } |
| | | |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | // System.out.println(jsonFilePath); |
| | | |
| | | //readAndUpdateWordValues(PlcReadObject); |
| | | readAndUpdateWordValues(PlcMesObject); |
| | | //readAndUpdateWordValues(PlcframeObject); |
| | | // readAndUpdateWordValues(PlcframeObject); |
| | | |
| | | // readAndUpdateWordValues(plcStateObject); |
| | | // int index = PlcMesObject.getPlcParameter("AddStart").getAddressIndex(); |
| | | // // System.out.println(index); |
| | | // PlcMesObject.getPlcParameter("AddStart").getAddress(index); |
| | | // // System.out.println(PlcMesObject.getPlcParameter("AddStart").getAddress(index)); |
| | | // List<String> addresses = new ArrayList<>(); |
| | | // addresses.add("FeedID"); |
| | | // addresses.add("AddStart"); |
| | | // // System.out.println(addresses); |
| | | // // System.out.println(PlcMesObject.getPlcParameterValues(addresses)); |
| | | // List<String> addresses2 = new ArrayList<>(); |
| | | // addresses2.add("FeedID"); |
| | | // addresses2.add("FeedCarStatus"); |
| | | |
| | | //System.out.println(PlcReadObject.getPlcParameterValues(addresses2)); |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.common; |
| | | import cn.hutool.json.JSONObject; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | |
| | | public class PlcHomeEdg extends Thread { |
| | | @Override |
| | | public void run() { |
| | | while (this != null) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | try { |
| | | Thread.sleep(1000); |
| | | // 注入mapper |
| | | // HomeService = WebSocketServer.applicationContext.getBean(HomeService.class); |
| | | // QueueMapper = WebSocketServer.applicationContext.getBean(QueueMapper.class); |
| | | |
| | | |
| | | // //读取DB105区文件 |
| | | // PlcParameterObject plcmes=PLCAutoMes.PlcMesObject; |
| | | // |
| | | // String PlcRequest=plcmes.getPlcParameter("GaToMES").getValue();//请求 |
| | | // String MesSend=plcmes.getPlcParameter("MESToGaStatus").getValue();//发送 |
| | | // double width=Double.valueOf(plcmes.getPlcParameter("width").getValue());//宽 |
| | | // double height=Double.valueOf(plcmes.getPlcParameter("Height").getValue());//高 |
| | | |
| | | //获取测量的长,宽 |
| | | boolean istest = true; |
| | | // String PlcRequest = "1"; |
| | | // String MesSend = "0"; |
| | | // double width = 516; |
| | | // double height = 507; |
| | | //System.out.println(111); |
| | | // //查询当前订单任务 |
| | | //List<FlowCard> OrderTask = storageCageService.SelectOrderTask(); |
| | | //jsonObject.append("OrderTask", OrderTask); |
| | | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | // jsonObject.append("params", new short[] { 30, 40, }); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("Home"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | if (webserver != null) { |
| | | |
| | | List<String> messages = webserver.getMessages(); |
| | | |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | | webserver.clearMessages(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
File was renamed from UnLoadGlassModule/src/main/java/com/mes/tools/WebSocketServer.java |
| | |
| | | package com.mes.tools; |
| | | package com.mes.common; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | |
| | | @Component("webSocketServer") |
| | | public class WebSocketServer { |
| | | |
| | | // @Autowired |
| | | // HomeMapper homeMapper; |
| | | |
| | | public static ConfigurableApplicationContext applicationContext; |
| | | |
| | |
| | | } else { |
| | | webSocketServers.add(this); |
| | | } |
| | | |
| | | |
| | | log.info("有新用户加入,username={}, 当前在线人数为:{}", username, sessionMap.get(username).size()); |
| | | |
| | | // JSONObject result = new JSONObject(); |
| | |
| | | public void onClose(Session session, @PathParam("username") String username) { |
| | | List<WebSocketServer> webSocketServers = sessionMap.get(username); |
| | | ArrayList<WebSocketServer> arrayListwebserver = new ArrayList<WebSocketServer>(); |
| | | if (webSocketServers.size()>1) { |
| | | if (webSocketServers.size() > 1) { |
| | | for (WebSocketServer webSocketServer : webSocketServers) { |
| | | if(webSocketServer!=this){ |
| | | if (webSocketServer != this) { |
| | | arrayListwebserver.add(webSocketServer); |
| | | } |
| | | } |
| | | sessionMap.put(username, arrayListwebserver); |
| | | log.info("移除username={}一名用户session, {}的当前在线人数为:{}", username, username, sessionMap.get(username).size()); |
| | | }else{ |
| | | } else { |
| | | sessionMap.remove(username); |
| | | log.info("移除username={}一名用户session, {}连接关闭, 当前连接数为:{}", username, username, sessionMap.size()); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | * 后台收到客户端发送过来的消息 |
| | | * onMessage 是一个消息的中转站 |
| | | * 接受 浏览器端 socket.send 发送过来的 json数据 |
| | | * |
| | | * |
| | | * @param message 客户端发送过来的消息 |
| | | */ |
| | | @OnMessage |
| | |
| | | public void clearMessages() { |
| | | messages.clear(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageService; |
| | | import com.mes.edgstoragecage.service.impl.EdgStorageCageServiceImpl; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import com.mes.taskcache.service.impl.TaskCacheServiceImpl; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.awt.image.ImageProducer; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | @Api(tags = "理片笼缓存") |
| | | @Api(description = "理片笼缓存") |
| | | @RestController |
| | | @RequestMapping("/edgStorageCage") |
| | | public class EdgStorageCageController { |
| | |
| | | @PostMapping("/selectEdgStorageCage") |
| | | @ResponseBody |
| | | public Result selectEdgStorageCage () { |
| | | List<Map> list=edgStorageCageService.selectEdgStorageCages(); |
| | | List<Map<String, Object>> list=edgStorageCageService.selectEdgStorageCages(); |
| | | return Result.build(200,"成功",list); |
| | | } |
| | | @ApiOperation("添加磨边缓存理片笼信息 功能:笼内绑定玻璃 参数(EdgStorageCage edgStorageCage)") |
| | | @PostMapping("/insertEdgStorageCage") |
| | | @ResponseBody |
| | | public Result insertEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage) { |
| | | boolean isSucess=edgStorageCageService.updateEdgStorageCage(edgStorageCage); |
| | | return Result.build(200,"添加成功",1); |
| | | } |
| | | @ApiOperation("修改磨边缓存理片笼信息 功能:对笼内栅格进行【启用/禁用】/ 【更换】笼内栅格玻璃信息") |
| | | // @ApiOperation("添加磨边缓存理片笼信息 功能:笼内绑定玻璃 参数(EdgStorageCage edgStorageCage)") |
| | | // @PostMapping("/insertEdgStorageCage") |
| | | // @ResponseBody |
| | | // public Result insertEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage) { |
| | | // boolean isSucess=edgStorageCageService.updateEdgStorageCage(edgStorageCage); |
| | | // return Result.build(200,"添加成功",1); |
| | | // } |
| | | @ApiOperation("修改磨边缓存理片笼信息 功能:对笼内栅格进行【启用/禁用】") |
| | | @PostMapping("/updateEdgStorageCage") |
| | | @ResponseBody |
| | | public Result updateEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage) { |
| | | boolean isSucess=edgStorageCageService.updateEdgStorageCage(edgStorageCage); |
| | | return Result.build(200,"更换成功",1); |
| | | } |
| | | @ApiOperation("删除磨边缓存理片笼信息 功能:对笼内栅格玻璃进行【清除】") |
| | | @PostMapping("/deleteEdgStorageCage") |
| | | @ApiOperation("磨边缓存理片笼信息 功能:对笼内栅格玻璃进行【清除/更换/绑定】 EdgStorageCage格子信息,EdgStorageCageDetails 玻璃信息 ") |
| | | @PostMapping("/edgStorageCageGlass") |
| | | @ResponseBody |
| | | public Result deleteEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage, EdgStorageCageDetails edgStorageCageDetails) { |
| | | boolean isSucess=edgStorageCageService.updateEdgStorageCage(edgStorageCage); |
| | | public Result edgStorageCageGlass(@RequestBody EdgStorageCage edgStorageCage,@RequestBody EdgStorageCageDetails edgStorageCageDetails) { |
| | | boolean isSucess=edgStorageCageService.updateEdgStorageCageDetails(edgStorageCage,edgStorageCageDetails); |
| | | return Result.build(200,"删除成功",1); |
| | | } |
| | | |
| | |
| | | * 获取 切割当前版图 |
| | | * @return |
| | | */ |
| | | List<OptimizeDetail> selectCutTerritory(); |
| | | List<Map<String, Object>> selectCutTerritory(); |
| | | |
| | | /** |
| | | * 获取 工程下的当前版图 |
| | | * @param current |
| | | * @return |
| | | */ |
| | | List<OptimizeDetail> selectCurrentCutTerritory(String current); |
| | | List<Map<String, Object>> selectCurrentCutTerritory(String current); |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * 查询笼内空格 |
| | | * @return |
| | | */ |
| | | List<Map> selectCacheEmpty(); |
| | | List<Map<String, Object>> selectCacheEmpty(); |
| | | |
| | | /** |
| | | * 查询笼内出片顺序详情 |
| | | * @return |
| | | */ |
| | | List<Map> selectCacheOut(); |
| | | List<Map<String, Object>> selectCacheOut(); |
| | | |
| | | /** |
| | | * 查询笼内详情 |
| | | * @return |
| | | */ |
| | | List<Map> selectEdgStorageCages(); |
| | | List<Map<String, Object>> selectEdgStorageCages(); |
| | | |
| | | /** |
| | | * 修改理片笼内信息 |
| | | * 修改理片笼信息 |
| | | * @param edgStorageCage |
| | | * @return |
| | | */ |
| | | boolean updateEdgStorageCage(EdgStorageCage edgStorageCage); |
| | | |
| | | boolean updateEdgStorageCageDetails(EdgStorageCage edgStorageCage, EdgStorageCageDetails edgStorageCageDetails); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.query.MPJLambdaQueryWrapper; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.edgstoragecage.mapper.EdgStorageCageDetailsMapper; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import com.mes.pp.entity.OptimizeLayout; |
| | | import com.mes.pp.mapper.OptimizeDetailMapper; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import com.mes.uppattenusage.mapper.UpPattenUsageMapper; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @return |
| | | */ |
| | | public boolean identWorn(String glassId, int ControlsId) { |
| | | List<EdgStorageCageDetails> edgStorageCageDetails = baseMapper.selectList(new QueryWrapper<EdgStorageCageDetails>().eq("glass_id", glassId)); |
| | | List<EdgStorageCageDetails> edgStorageCageDetails = baseMapper.selectList(new MPJLambdaQueryWrapper<EdgStorageCageDetails>().selectAll(EdgStorageCageDetails.class).eq(EdgStorageCageDetails::getGlassId,glassId)); |
| | | if (edgStorageCageDetails.size() == 1) { |
| | | EdgStorageCageDetails item=edgStorageCageDetails.get(0); |
| | | item.setState(ControlsId); |
| | | baseMapper.update(edgStorageCageDetails.get(0), new QueryWrapper<EdgStorageCageDetails>().eq("glass_id", glassId)); |
| | | baseMapper.update(edgStorageCageDetails.get(0), new MPJLambdaWrapper<EdgStorageCageDetails>().selectAll(EdgStorageCageDetails.class).eq(EdgStorageCageDetails::getGlassId,glassId)); |
| | | return true; |
| | | } |
| | | // Sql版本 |
| | | // List<EdgStorageCageDetails> edgStorageCageDetails = baseMapper.selectList(new QueryWrapper<EdgStorageCageDetails>().eq("glass_id", glassId)); |
| | | // if (edgStorageCageDetails.size() == 1) { |
| | | // EdgStorageCageDetails item=edgStorageCageDetails.get(0); |
| | | // item.setState(ControlsId); |
| | | // baseMapper.update(edgStorageCageDetails.get(0), new QueryWrapper<EdgStorageCageDetails>().eq("glass_id", glassId)); |
| | | // return true; |
| | | // } |
| | | return false; |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<OptimizeDetail> selectCutTerritory() { |
| | | List<UpPattenUsage> upPattenUsage=upPattenUsageMapper.selectList(new QueryWrapper<UpPattenUsage>() |
| | | .eq("state", 1)); |
| | | public List<Map<String, Object>> selectCutTerritory() { |
| | | List<UpPattenUsage> upPattenUsage=upPattenUsageMapper.selectList(new MPJLambdaWrapper<UpPattenUsage>() |
| | | .selectAll(UpPattenUsage.class) |
| | | .eq(UpPattenUsage::getState, 1)); |
| | | |
| | | if(!upPattenUsage.isEmpty()){ |
| | | UpPattenUsage upPattenUsage1=upPattenUsage.get(0); |
| | | return optimizeDetailMapper.selectList(new QueryWrapper<OptimizeDetail>() |
| | | .eq("project_no", upPattenUsage1.getEngineeringId()) |
| | | .eq("stock_id",upPattenUsage1.getLayoutSequence()) |
| | | return optimizeDetailMapper.selectJoinMaps(JoinWrappers.lambda(OptimizeDetail.class) |
| | | .selectAll(OptimizeDetail.class) |
| | | .selectAs(OptimizeLayout::getWidth,"olWidth") |
| | | .selectAs(OptimizeLayout::getWidth,"olHeight") |
| | | .leftJoin(OptimizeLayout.class,on->on |
| | | .eq(OptimizeLayout::getProjectNo,OptimizeDetail::getProjectNo) |
| | | .eq(OptimizeLayout::getStockId,OptimizeDetail::getStockId)) |
| | | .eq(OptimizeDetail::getProjectNo, upPattenUsage1.getEngineeringId()) |
| | | .eq(OptimizeDetail::getStockId,upPattenUsage1.getLayoutSequence()) |
| | | ); |
| | | |
| | | // Sql版本 |
| | | // return optimizeDetailMapper.selectJoinMaps(new MPJQueryWrapper<OptimizeDetail>().selectAll(OptimizeDetail.class) |
| | | // .select("ol.width as olwidth","ol.height as olheight") |
| | | // .leftJoin("optimize_layout ol on t.project_no=ol.project_no and t.stock_id=ol.stock_id") |
| | | // .eq("t.project_no", upPattenUsage1.getEngineeringId()) |
| | | // .eq("t.stock_id",upPattenUsage1.getLayoutSequence()) |
| | | // ); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<OptimizeDetail> selectCurrentCutTerritory(String current) { |
| | | return optimizeDetailMapper.selectList(new QueryWrapper<OptimizeDetail>().eq("project_no", current)); |
| | | public List<Map<String, Object>> selectCurrentCutTerritory(String current) { |
| | | |
| | | return optimizeDetailMapper.selectJoinMaps(JoinWrappers.lambda(OptimizeDetail.class) |
| | | .selectAll(OptimizeDetail.class) |
| | | .selectAs(OptimizeLayout::getWidth,"olWidth") |
| | | .selectAs(OptimizeLayout::getWidth,"olHeight") |
| | | .leftJoin(OptimizeLayout.class,on->on |
| | | .eq(OptimizeLayout::getProjectNo,OptimizeDetail::getProjectNo) |
| | | .eq(OptimizeLayout::getStockId,OptimizeDetail::getStockId)) |
| | | .eq(OptimizeDetail::getProjectNo, current) |
| | | ); |
| | | //Sql版本 |
| | | // return optimizeDetailMapper.selectJoinMaps(new MPJQueryWrapper<OptimizeDetail>().selectAll(OptimizeDetail.class) |
| | | // .select("ol.width as olwidth","ol.height as olheight") |
| | | // .leftJoin("optimize_layout ol on t.project_no=ol.project_no and t.stock_id=ol.stock_id") |
| | | // .eq("t.project_no",current) |
| | | // ); |
| | | } |
| | | |
| | | ; |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.edgstoragecage.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.query.MPJLambdaQueryWrapper; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map> selectCacheEmpty(){ |
| | | return baseMapper.selectJoinList( |
| | | Map.class,new MPJQueryWrapper<EdgStorageCage>().selectAll(EdgStorageCage.class) |
| | | .select("escd.glass_id","escd.flow_card_id","escd.width","escd.height") |
| | | .leftJoin("edg_storage_cage_details escd on t.device_id=escd.device_id and t.slot=escd.slot") |
| | | .isNull("escd.slot") |
| | | public List<Map<String, Object>> selectCacheEmpty(){ |
| | | return baseMapper.selectJoinMaps(JoinWrappers.lambda(EdgStorageCage.class).selectAll(EdgStorageCage.class) |
| | | .select(EdgStorageCageDetails::getWidth, EdgStorageCageDetails::getHeight,EdgStorageCageDetails::getGlassId) |
| | | .leftJoin(EdgStorageCageDetails.class,on->on |
| | | .eq(EdgStorageCageDetails::getDeviceId,EdgStorageCage::getDeviceId) |
| | | .eq(EdgStorageCageDetails::getSlot,EdgStorageCage::getSlot)) |
| | | .isNull(EdgStorageCageDetails::getSlot) |
| | | ); |
| | | |
| | | // return baseMapper.selectJoinMaps(new MPJQueryWrapper<EdgStorageCage>().selectAll(EdgStorageCage.class) |
| | | // .select("escd.glass_id","escd.flow_card_id","escd.width","escd.height") |
| | | // .leftJoin("edg_storage_cage_details escd on t.device_id=escd.device_id and t.slot=escd.slot") |
| | | // .isNull("escd.slot") |
| | | // ); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map> selectCacheOut(){ |
| | | return upPattenUsageMapper.selectJoinList( |
| | | Map.class,new MPJQueryWrapper<UpPattenUsage>().selectAll(UpPattenUsage.class) |
| | | .select("escd.glass_id","escd.flow_card_id","escd.width","escd.height") |
| | | .leftJoin("edg_storage_cage_details escd on t.device_id=escd.device_id and t.slot=escd.slot") |
| | | .isNotNull("escd.slot") |
| | | .orderByAsc("escd.tempering_layout_id","escd.tempering_feed_sequence") |
| | | public List<Map<String, Object>> selectCacheOut(){ |
| | | |
| | | return upPattenUsageMapper.selectJoinMaps(JoinWrappers.lambda(UpPattenUsage.class).selectAll(UpPattenUsage.class) |
| | | .select(EdgStorageCageDetails::getWidth, EdgStorageCageDetails::getHeight,EdgStorageCageDetails::getGlassId) |
| | | .leftJoin(EdgStorageCageDetails.class,on->on |
| | | .eq(EdgStorageCageDetails::getDeviceId,EdgStorageCage::getDeviceId) |
| | | .eq(EdgStorageCageDetails::getSlot,EdgStorageCage::getSlot)) |
| | | .isNull(EdgStorageCageDetails::getSlot) |
| | | ); |
| | | // return upPattenUsageMapper.selectJoinMaps(new MPJQueryWrapper<UpPattenUsage>().selectAll(UpPattenUsage.class) |
| | | // .select("escd.glass_id","escd.flow_card_id","escd.width","escd.height") |
| | | // .leftJoin("edg_storage_cage_details escd on t.device_id=escd.device_id and t.slot=escd.slot") |
| | | // .isNotNull("escd.slot") |
| | | // .orderByAsc("escd.tempering_layout_id","escd.tempering_feed_sequence") |
| | | // ); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map> selectEdgStorageCages(){ |
| | | return baseMapper.selectJoinList( |
| | | Map.class,new MPJQueryWrapper<EdgStorageCage>().selectAll(EdgStorageCage.class) |
| | | .select("escd.glass_id","escd.flow_card_id","escd.width","escd.height") |
| | | .leftJoin("edg_storage_cage_details escd on t.device_id=escd.device_id and t.slot=escd.slot") |
| | | public List<Map<String, Object>> selectEdgStorageCages(){ |
| | | return baseMapper.selectJoinMaps(JoinWrappers.lambda(EdgStorageCage.class) |
| | | .selectAll(EdgStorageCage.class) |
| | | .selectAs(EdgStorageCageDetails::getId,"esdId") |
| | | .select(EdgStorageCageDetails::getGlassId,EdgStorageCageDetails::getWidth,EdgStorageCageDetails::getHeight,EdgStorageCageDetails::getId) |
| | | .leftJoin(EdgStorageCageDetails.class,on->on |
| | | .eq(EdgStorageCageDetails::getDeviceId,EdgStorageCage::getDeviceId) |
| | | .eq(EdgStorageCageDetails::getSlot,EdgStorageCage::getSlot)) |
| | | ); |
| | | // return baseMapper.selectJoinMaps(new MPJQueryWrapper<EdgStorageCage>().selectAll(EdgStorageCage.class) |
| | | // .select("escd.glass_id","escd.flow_card_id","escd.width","escd.height") |
| | | // .leftJoin("edg_storage_cage_details escd on t.device_id=escd.device_id and t.slot=escd.slot") |
| | | // ); |
| | | } |
| | | |
| | | /** |
| | | * 修改理片笼内信息 功能:对笼内栅格玻璃 【添加/删除/更换】 |
| | | * 修改理片笼信息 功能:对笼内栅格玻璃 【启用/禁用】 |
| | | * @param edgStorageCage |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean updateEdgStorageCage(EdgStorageCage edgStorageCage){ |
| | | baseMapper.updateById(edgStorageCage); |
| | | EdgStorageCage edgItem=baseMapper.selectById(edgStorageCage.getId()); |
| | | edgItem.setEnableState(edgStorageCage.getEnableState()); |
| | | baseMapper.updateById(edgItem); |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | *修改理片笼信息 功能:对笼内栅格玻璃 【添加/删除/更换】 |
| | | * @param edgStorageCage |
| | | * @param edgStorageCageDetails |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean updateEdgStorageCageDetails(EdgStorageCage edgStorageCage,EdgStorageCageDetails edgStorageCageDetails){ |
| | | EdgStorageCage edgItem=baseMapper.selectById(edgStorageCage.getId()); |
| | | EdgStorageCageDetails edgDItem=edgStorageCageDetailsMapper.selectById(edgStorageCageDetails.getId()); |
| | | if (edgItem!=null){ |
| | | if(edgDItem==null){ |
| | | //移除玻璃 |
| | | EdgStorageCageDetails result=edgStorageCageDetailsMapper.selectOne(new MPJLambdaWrapper<EdgStorageCageDetails>().eq(EdgStorageCageDetails::getId,edgStorageCageDetails.getId())); |
| | | result.setSlot(0); |
| | | edgStorageCageDetailsMapper.updateById(result); |
| | | }else{ |
| | | //1.绑定新的玻璃 2.更换玻璃 上一片清除 重新绑定 |
| | | EdgStorageCageDetails lastResult=edgStorageCageDetailsMapper.selectOne(new MPJLambdaWrapper<EdgStorageCageDetails>().eq(EdgStorageCageDetails::getSlot,edgStorageCage.getSlot())); |
| | | lastResult.setSlot(0); |
| | | edgStorageCageDetailsMapper.updateById(lastResult); |
| | | EdgStorageCageDetails result=edgStorageCageDetailsMapper.selectById(edgStorageCageDetails.getId()); |
| | | result.setSlot(edgStorageCageDetails.getSlot()); |
| | | edgStorageCageDetailsMapper.updateById(result); |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.mes.glassinfo.service.impl.GlassInfoServiceImpl; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | @Api(tags = "玻璃信息小片") |
| | | @Api(description = "玻璃信息小片") |
| | | @RestController |
| | | @RequestMapping("/glassInfo") |
| | | public class GlassInfoController { |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.query.MPJLambdaQueryWrapper; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public List<GlassInfo> selectId(String glassId){ |
| | | return baseMapper.selectList(new QueryWrapper<GlassInfo>().eq("glass_id",glassId)); |
| | | return baseMapper.selectList(new MPJLambdaWrapper<GlassInfo>().selectAll(GlassInfo.class).eq(GlassInfo::getGlassId,glassId)); |
| | | // return baseMapper.selectList(new QueryWrapper<GlassInfo>().eq("glass_id",glassId)); |
| | | }; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<GlassInfo> selectFlowCardId(String flowCardId){ |
| | | return baseMapper.selectList(new QueryWrapper<GlassInfo>().eq("flow_card_id",flowCardId)); |
| | | return baseMapper.selectList(new MPJLambdaWrapper<GlassInfo>().selectAll(GlassInfo.class).eq(GlassInfo::getFlowCardId,flowCardId)); |
| | | //Sql版本 |
| | | // return baseMapper.selectList(new QueryWrapper<GlassInfo>().eq("flow_card_id",flowCardId)); |
| | | }; |
| | | } |
| | |
| | | |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageService; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import com.mes.taskcache.service.TaskCacheService; |
| | | import com.mes.utils.Result; |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | @Api(tags = "识别显示") |
| | | @Api(description = "识别显示") |
| | | @RestController |
| | | @RequestMapping("/taskCache") |
| | | public class TaskCacheController { |
| | |
| | | @PostMapping("/cutTerritory") |
| | | @ResponseBody |
| | | public Result cutTerritory(String current) { |
| | | List<OptimizeDetail> h = edgStorageCageDetailsService.selectCurrentCutTerritory(current); |
| | | List<Map<String, Object>> h = edgStorageCageDetailsService.selectCurrentCutTerritory(current); |
| | | return Result.build(200,"成功",h); |
| | | } |
| | | @ApiOperation("识别显示 当前版图 参数()") |
| | | @PostMapping("/currentCutTerritory") |
| | | @ResponseBody |
| | | public Result currentCutTerritory() { |
| | | List<OptimizeDetail> h = edgStorageCageDetailsService.selectCutTerritory(); |
| | | List<Map<String, Object>> h = edgStorageCageDetailsService.selectCutTerritory(); |
| | | return Result.build(200,"成功",h); |
| | | } |
| | | @ApiOperation("识别操作: 破损/拿走 参数(ID,功能[200:拿走,201:破损])") |
| | |
| | | package com.mes.taskcache.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.query.MPJLambdaQueryWrapper; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.taskcache.mapper.TaskCacheMapper; |
| | | import com.mes.taskcache.service.TaskCacheService; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public List<TaskCache> selectEdgInfo(String line) { |
| | | return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("end_cell",line)); |
| | | return baseMapper.selectList(new MPJLambdaWrapper<TaskCache>().selectAll(TaskCache.class).eq(TaskCache::getEndCell,line)); |
| | | // return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("end_cell",line)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<TaskCache> selectCacheInfo(){ |
| | | return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("task_status",0)); |
| | | return baseMapper.selectList(new MPJLambdaWrapper<TaskCache>().selectAll(TaskCache.class).eq(TaskCache::getTaskStatus,0)); |
| | | // return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("task_status",0)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<TaskCache> selectInputTaskCache(){ |
| | | return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("task_status",0).eq("task_type",1)); |
| | | return baseMapper.selectList(new MPJLambdaWrapper<TaskCache>().selectAll(TaskCache.class).eq(TaskCache::getTaskStatus,0).eq(TaskCache::getTaskType,1)); |
| | | |
| | | // return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("task_status",0).eq("task_type",1)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<TaskCache> selectOutTaskCache(){ |
| | | return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("task_status",0).eq("task_type",2)); |
| | | return baseMapper.selectList(new MPJLambdaWrapper<TaskCache>().selectAll(TaskCache.class).eq(TaskCache::getTaskStatus,0).eq(TaskCache::getTaskType,2)); |
| | | // return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("task_status",0).eq("task_type",2)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<TaskCache> selectLastOutCacheInfo(String line){ |
| | | return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("end_xxxxcell",line).eq("task_status",1).orderByDesc("ID")); |
| | | return baseMapper.selectList(new MPJLambdaWrapper<TaskCache>().selectAll(TaskCache.class).eq(TaskCache::getEndCell,line).eq(TaskCache::getTaskStatus,1).orderByDesc(TaskCache::getID)); |
| | | // return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("end_cell",line).eq("task_status",1).orderByDesc("ID")); |
| | | } |
| | | } |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | pp: |
| | | url: jdbc:mysql://127.0.0.1:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | application: |
| | | name: cacheGlass |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: 123456 |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://192.168.56.10:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: root |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | pp: |
| | | url: jdbc:mysql://192.168.56.10:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: root |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | application: |
| | | name: cacheGlass |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: 123456 |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | pp: |
| | | url: jdbc:mysql://10.153.19.150:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 10.153.19.150:8848 |
| | | application: |
| | | name: cacheGlass |
| | | redis: |
| | | database: 0 |
| | | host: 10.153.19.150 |
| | | port: 6379 |
| | | password: 123456 |
| | |
| | | server: |
| | | port: 8081 |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | pp: |
| | | url: jdbc:mysql://10.153.19.150:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | # pp: |
| | | # url: jdbc:mysql://10.153.19.150:3306/pp?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 |
| | | # username: sa |
| | | # password: beibo.123/ |
| | | # driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 10.153.19.150:8848 |
| | | profiles: |
| | | active: prod |
| | | application: |
| | | name: cacheGlass |
| | | redis: |
| | | database: 0 |
| | | host: 10.153.19.150 |
| | | port: 6379 |
| | | password: 123456 |
| | | session: |
| | | store-type: redis |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration scan="true" scanPeriod="10 seconds"> |
| | | <!-- logger上下文名称(根据业务修改) --> |
| | | <contextName>cacheGlass</contextName> |
| | | |
| | | <!-- 定义了一个名为serverName的属性,它的值来自于logging.file.name,如果没有找到该属性默认为MyServerName(根据业务修改) --> |
| | | <springProperty name="serverName" source="logging.file.name" defaultValue="cacheGlass"/> |
| | | <springProperty name="logging.path" source="logging.file.path" defaultValue="././logs/"/> |
| | | |
| | | <!-- 彩色日志依赖的渲染类 --> |
| | | <!-- 定义了一个名为clr的转换规则,它使用org.springframework.boot.logging.logback.ColorConverter类进行转换,这个元素通常用于将日志输出中的文本着色,以便更容易地区分不同的日志级别或其他信息 --> |
| | | <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/> |
| | | <!-- WhitespaceThrowableProxyConverter和ExtendedWhitespaceThrowableProxyConverter都是用于将异常信息转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示的类。它们之间的区别在于,ExtendedWhitespaceThrowableProxyConverter在输出异常信息时会包含更多的详细信息,例如异常的类名、方法名和行号等 --> |
| | | <!-- 定义了一个名为wex的转换规则,它使用org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter类进行转换,这个元素通常用于将异常信息转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示 --> |
| | | <conversionRule conversionWord="wex" |
| | | converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/> |
| | | <!-- 定义了一个名为wEx的转换规则,它使用org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter类进行转换,这个元素通常用于将异常信息转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示 --> |
| | | <conversionRule conversionWord="wEx" |
| | | converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/> |
| | | |
| | | <!-- 彩色日志格式 --> |
| | | <!-- value值是日志输出模板, :-是属性名和其默认值之间的分隔符,作用与:相同 --> |
| | | <!-- 定义日志输出格式的转换规则,%d{yyyy-MM-dd HH:mm:ss.SSS}表示日期和时间,%clr表示将输出文本着色,{faint}表示使用淡色 --> |
| | | <!-- %5p表示日志级别输出右对齐,左边以空格填充 --> |
| | | <!-- ${PID:- }表示进程ID,%clr表示将输出文本着色,{magenta}表示使用洋红色 --> |
| | | <!-- -表示一个分隔符 --> |
| | | <!-- %t:显示产生该日志的线程名;%15:若字符长度小于15,则左边用空格填充;%.15:若字符长度超过15,截去多余字符 --> |
| | | <!-- %-40:若字符长度小于40,则右边用空格填充;%.40:若字符长度超过40,截去多余字符;logger{39}对应的是“logging.WARNING”级别。具体来说,Python的logging模块定义了以下几个级别(从低到高):NOTSET、DEBUG、INFO、WARNING、ERROR、CRITICAL。因此,logger{39}表示的是WARNING级别,即日志记录器会记录所有WARNING级别及以上的日志信息 --> |
| | | <!-- %m表示日志消息;%n表示换行符;${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}表示异常信息。如果日志输出中包含异常信息,这个规则将会将其转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示 --> |
| | | <property name="CONSOLE_LOG_PATTERN" |
| | | value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
| | | |
| | | <!--1. 输出到控制台--> |
| | | <!-- 定义控制台日志输出的appender,class="ch.qos.logback.core.ConsoleAppender"表示使用Logback框架提供的ConsoleAppender类来输出日志到控制台 --> |
| | | <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
| | | <!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息--> |
| | | <!-- 定义日志输出级别的过滤器,class="ch.qos.logback.classic.filter.ThresholdFilter"表示使用Logback框架提供的ThresholdFilter类来过滤日志输出,<level>debug</level>表示只输出debug级别及以上的日志 --> |
| | | <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
| | | <level>debug</level> |
| | | </filter> |
| | | <encoder> |
| | | <!-- ${CONSOLE_LOG_PATTERN}表示控制台日志输出格式,UTF-8表示编码格式 --> |
| | | <Pattern>${CONSOLE_LOG_PATTERN}</Pattern> |
| | | <!-- 设置字符集 --> |
| | | <charset>UTF-8</charset> |
| | | </encoder> |
| | | </appender> |
| | | <!--2. 输出到文档--> |
| | | <!-- 2.1 level为 DEBUG 日志,时间滚动输出 --> |
| | | <!-- 定义文件日志输出的appender,class="ch.qos.logback.core.rolling.RollingFileAppender"表示使用Logback框架提供的RollingFileAppender类来输出日志到文件 --> |
| | | <appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_debug.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> <!-- 设置字符集 --> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <!-- 定义日志文件滚动策略的标签,class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"表示使用Logback框架提供的TimeBasedRollingPolicy类来定义日志文件的滚动策略 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 日志归档 --> |
| | | <!-- 定义日志文件名的模式。在这个模式中,${logging.path}表示日志文件的路径,%d{yyyy-MM-dd}表示日期格式,%i表示文件索引 --> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <!-- 定义日志文件滚动策略的标签,class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"表示使用Logback框架提供的SizeAndTimeBasedFNATP类来定义日志文件的滚动策略,<maxFileSize>100MB</maxFileSize>表示日志文件的最大大小为100MB。这个滚动策略通常用于按照时间和文件大小滚动日志文件,以便更好地管理日志文件的大小和数量 --> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录debug级别的 --> |
| | | <!-- 定义日志输出级别的过滤器。在这个过滤器中,class="ch.qos.logback.classic.filter.LevelFilter"表示使用Logback框架提供的LevelFilter类来过滤日志输出,<level>debug</level>表示只输出debug级别及以上的日志 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>debug</level> |
| | | <!-- <onMatch>ACCEPT</onMatch>表示如果日志事件与过滤器匹配,则接受该事件,<onMismatch>DENY</onMismatch>表示如果日志事件与过滤器不匹配,则拒绝该事件 --> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 2.2 level为 INFO 日志,时间滚动输出 --> |
| | | <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_info.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 天天日志归档路径以及格式 --> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录info级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>info</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 2.3 level为 WARN 日志,时间滚动输出 --> |
| | | <appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_warn.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> <!-- 此处设置字符集 --> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录warn级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>warn</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 2.4 level为 ERROR 日志,时间滚动输出 --> |
| | | <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_error.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> <!-- 此处设置字符集 --> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录ERROR级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>ERROR</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 4.1 开发环境:打印控制台--> |
| | | <!-- 用于在Spring Boot应用程序中配置日志记录的标签。在这个标签中,name="dev"表示这个配置文件只在dev环境中生效,<logger name="com.myClass.controller" level="debug"/>表示为com.myClass.controller(根据业务修改)这个包下的类配置日志输出级别为debug --> |
| | | <!-- <springProfile name="dev">--> |
| | | <!-- <logger name="com.myClass.controller" level="debug"/>--> |
| | | <!-- </springProfile>--> |
| | | <!-- 用于配置日志输出的标签。在这个标签中,level="info"表示日志输出级别为info,<appender-ref ref="CONSOLE"/>、<appender-ref ref="DEBUG_FILE"/>、<appender-ref ref="INFO_FILE"/>、<appender-ref ref="WARN_FILE"/>、<appender-ref ref="ERROR_FILE"/>表示将日志输出到不同的appender中,分别为控制台、debug文件、info文件、warn文件和error文件 --> |
| | | <root level="info"> |
| | | <appender-ref ref="CONSOLE"/> |
| | | <appender-ref ref="DEBUG_FILE"/> |
| | | <appender-ref ref="INFO_FILE"/> |
| | | <appender-ref ref="WARN_FILE"/> |
| | | <appender-ref ref="ERROR_FILE"/> |
| | | </root> |
| | | </configuration> |
| | |
| | | package com.mes; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.query.MPJLambdaQueryWrapper; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageService; |
| | | import com.mes.edgstoragecage.service.impl.EdgStorageCageServiceImpl; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import com.mes.pp.entity.OptimizeLayout; |
| | | import com.mes.pp.mapper.OptimizeDetailMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | |
| | | |
| | | @Test |
| | | public void testCacheGlass() { |
| | | List<Map> map= edgStorageCageService.selectEdgStorageCages(); |
| | | List<Map<String, Object>> map= edgStorageCageService.selectEdgStorageCages(); |
| | | log.info("笼内信息:{}", Arrays.asList(map)); |
| | | } |
| | | @Test |
| | | public void testselectCacheEmpty() { |
| | | List<Map> map= edgStorageCageService.selectCacheEmpty(); |
| | | public void testSelectCacheEmpty() { |
| | | List<Map<String, Object>> map= edgStorageCageService.selectCacheEmpty(); |
| | | log.info("笼内空格:{}", Arrays.asList(map)); |
| | | } |
| | | @Test |
| | | public void testScan() { |
| | | List<OptimizeDetail> map= edgStorageCageDetailsService.selectCutTerritory(); |
| | | List<Map<String, Object>> map= edgStorageCageDetailsService.selectCutTerritory(); |
| | | log.info("切割当前版图信息:{}", Arrays.asList(map)); |
| | | } |
| | | |
| | |
| | | log.info("切割当前版图信息:{}", Arrays.asList(optimizeDetail)); |
| | | |
| | | } |
| | | @Test |
| | | public void testOptimizeDetail() { |
| | | |
| | | List<Map<String, Object>> map2=optimizeDetailMapper.selectJoinMaps(JoinWrappers.lambda(OptimizeDetail.class) |
| | | .selectAll(OptimizeDetail.class) |
| | | .selectAs(OptimizeLayout::getWidth,"olWidth") |
| | | .selectAs(OptimizeLayout::getWidth,"olHeight") |
| | | .select(OptimizeLayout::getWidth,OptimizeLayout::getHeight) |
| | | .leftJoin(OptimizeLayout.class,on-> on.eq(OptimizeLayout::getProjectNo,OptimizeDetail::getProjectNo) |
| | | .eq(OptimizeLayout::getStockId,OptimizeDetail::getStockId)) |
| | | .eq(OptimizeDetail::getProjectNo,"P24032204" ) |
| | | .eq(OptimizeDetail::getStockId,5) |
| | | ); |
| | | log.info("切割当前版图信息1:{}", Arrays.asList(map2)); |
| | | } |
| | | |
| | | } |
| | |
| | | <artifactId>cacheVerticalGlass</artifactId> |
| | | <dependencies> |
| | | |
| | | <dependency> |
| | | <groupId>com.github.yulichang</groupId> |
| | | <artifactId>mybatis-plus-join</artifactId> |
| | | <version>1.1.6</version> |
| | | </dependency> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.github.yulichang</groupId>--> |
| | | <!-- <artifactId>mybatis-plus-join</artifactId>--> |
| | | <!-- <version>1.1.6</version>--> |
| | | <!-- </dependency>--> |
| | | <dependency> |
| | | <groupId>junit</groupId> |
| | | <artifactId>junit</artifactId> |
| | |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | |
| | | /** |
| | |
| | | @EnableSwagger2 |
| | | @EnableDiscoveryClient |
| | | @MapperScan(basePackages = "com.mes.*.mapper") |
| | | @EnableScheduling |
| | | public class CacheVerticalClassModuleApplication { |
| | | public static void main(String[] args) { |
| | | try { |
| | |
| | | |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | @ApiModel("理片笼信息") |
| | | @Api(description = "理片笼信息") |
| | | @RestController |
| | | @RequestMapping("/bigStorageCage") |
| | | public class BigStorageCageController { |
| | |
| | | |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import io.swagger.annotations.ApiModel; |
| | | 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; |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | @ApiModel(description = "理片笼详情") |
| | | @Api(description = "理片笼详情") |
| | | @RestController |
| | | @RequestMapping("/bigStorageCageDetails") |
| | | public class BigStorageCageDetailsController { |
| | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | @ApiModel(description = "<p> 大理片笼 </p>") |
| | | @Api(description = "大理片笼") |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class BigStorageCage implements Serializable { |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.io.Serializable; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | @ApiModel(description = "<p> 大理片笼详情 </p>") |
| | | @Api(description = "大理片笼详情") |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class BigStorageCageDetails implements Serializable { |
| | |
| | | bigStorageCageMapper.update(bigStorageCage, bigStorageCageWrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<BigStorageCage> querybigStorageCageDetail() { |
| | | //1、获取大理片笼信息 |
| | |
| | | |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.mes.bigstoragetask.service.BigStorageCageFeedTaskService; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-16 |
| | | */ |
| | | @ApiModel("进片任务信息") |
| | | @Api(description = "进片任务信息") |
| | | @RestController |
| | | @RequestMapping("/big-storage-cage-feed-task") |
| | | public class BigStorageCageFeedTaskController { |
| | |
| | | |
| | | import com.mes.bigstoragetask.entity.BigStorageCageOutTask; |
| | | import com.mes.bigstoragetask.service.BigStorageCageOutTaskService; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-16 |
| | | */ |
| | | @ApiModel("出片任务信息") |
| | | @Api(description = "出片任务信息") |
| | | @RestController |
| | | @RequestMapping("/big-storage-cage-out-task") |
| | | public class BigStorageCageOutTaskController { |
New file |
| | |
| | | package com.mes.job; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.mes.bigstoragetask.service.BigStorageCageFeedTaskService; |
| | | import com.mes.bigstoragetask.service.BigStorageCageOutTaskService; |
| | | import com.mes.edgstoragetask.service.TaskCacheService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.menu.service.SysMenuService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Component |
| | | @Slf4j |
| | | public class PlcStorageCageTask { |
| | | |
| | | @Autowired |
| | | private BigStorageCageService bigStorageCageService; |
| | | @Autowired |
| | | private BigStorageCageDetailsService bigStorageCageDetailsService; |
| | | @Autowired |
| | | private GlassInfoService glassInfoService; |
| | | @Autowired |
| | | private BigStorageCageFeedTaskService bigStorageCageFeedTaskService; |
| | | @Autowired |
| | | private BigStorageCageOutTaskService bigStorageCageOutTaskService; |
| | | @Autowired |
| | | private TaskCacheService taskCacheService; |
| | | |
| | | @Autowired |
| | | private SysMenuService sysMenuService; |
| | | |
| | | /** |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcStorageCageTask() throws InterruptedException { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | try { |
| | | Thread.sleep(300); |
| | | boolean bigStorageCageFullAlarm = false; |
| | | |
| | | String plcD01FeedReq = "0"; |
| | | String plcD04FeedReq = "0"; |
| | | String plcFeedGlassid = "111"; |
| | | String plcFeedReqLine = "0"; |
| | | if ("1".equals(plcD01FeedReq)) { |
| | | plcFeedReqLine = "1"; |
| | | } else { |
| | | //plc任务发送字0 |
| | | } |
| | | if ("1".equals(plcD04FeedReq)) { |
| | | plcFeedReqLine = "2"; |
| | | } else { |
| | | //plc任务发送字0 |
| | | } |
| | | |
| | | if (!("0".equals(plcFeedReqLine))) { |
| | | log.info("1、Plc进片请求时"); |
| | | BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails(); |
| | | GlassInfo glassInfo = glassInfoService.getById(plcFeedGlassid); |
| | | log.info("2、根据玻璃id获取玻璃信息" + glassInfo); |
| | | BigStorageCageDetails slotInfo = bigStorageCageService.feedGlass(glassInfo, bigStorageCageDetails); |
| | | if (slotInfo != null) { |
| | | int taskType = taskCacheService.judgeTasktype(); |
| | | log.info("3、查询任务表判断当前任务类型为上车等到还是上车启动" + taskType); |
| | | bigStorageCageFeedTaskService.addFeedTask(slotInfo, Integer.parseInt(plcFeedReqLine), taskType); |
| | | log.info("4、添加任务到任务表"); |
| | | //plc任务发送字1 |
| | | bigStorageCageFullAlarm = false; |
| | | } else { |
| | | //理片笼爆笼报警 |
| | | bigStorageCageFullAlarm = true; |
| | | } |
| | | } else { |
| | | List<BigStorageCageFeedTask> bigStorageCageFeedTaskList = bigStorageCageFeedTaskService.querybigStorageCageFeedTask(1); |
| | | log.info("5、查询任务表是否有已经完成的进片任务" + bigStorageCageFeedTaskList.size()); |
| | | for (BigStorageCageFeedTask bigStorageCageFeedTask : bigStorageCageFeedTaskList |
| | | ) { |
| | | BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails(); |
| | | bigStorageCageDetails.setId(bigStorageCageFeedTask.getId()); |
| | | bigStorageCageDetails.setState(1); |
| | | bigStorageCageDetailsService.updateById(bigStorageCageDetails); |
| | | log.info("6、修改理片笼详情玻璃状态"); |
| | | bigStorageCageFeedTaskService.removeById(bigStorageCageFeedTask); |
| | | log.info("7、删除已经完成的进片任务"); |
| | | } |
| | | } |
| | | |
| | | //出片请求 |
| | | String plcOutReq = "0"; |
| | | boolean result = false; |
| | | if ("1".equals(plcOutReq)) { |
| | | result = bigStorageCageService.outGlass(); |
| | | log.info("8、出片请求时调用出片接口" + result); |
| | | if (result) { |
| | | //plc任务发送字1 |
| | | } |
| | | } else { |
| | | bigStorageCageOutTaskService.updateOutTask(); |
| | | //plc任务发送字0 |
| | | } |
| | | |
| | | //显示剩余空格子 |
| | | |
| | | //报警信息 |
| | | jsonObject.append("bigStorageCageFullAlarm", bigStorageCageFullAlarm); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: 123456 |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://192.168.56.10:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: root |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: 123456 |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://10.153.19.150: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 |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 10.153.19.150:8848 |
| | | redis: |
| | | database: 0 |
| | | host: 10.153.19.150 |
| | | port: 6379 |
| | | password: 123456 |
| | |
| | | port: 8082 |
| | | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://10.153.19.150: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 |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 10.153.19.150:8848 |
| | | profiles: |
| | | active: prod |
| | | application: |
| | | name: cacheVerticalGlass |
| | | redis: |
| | | database: 0 |
| | | host: 10.153.19.150 |
| | | port: 6379 |
| | | password: 123456 |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | configuration: |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration scan="true" scanPeriod="10 seconds"> |
| | | <!-- logger上下文名称(根据业务修改) --> |
| | | <contextName>cacheVerticalGlass</contextName> |
| | | |
| | | <!-- 定义了一个名为serverName的属性,它的值来自于logging.file.name,如果没有找到该属性默认为MyServerName(根据业务修改) --> |
| | | <springProperty name="serverName" source="logging.file.name" defaultValue="cacheVerticalGlass"/> |
| | | <springProperty name="logging.path" source="logging.file.path" defaultValue="././logs/"/> |
| | | |
| | | <!-- 彩色日志依赖的渲染类 --> |
| | | <!-- 定义了一个名为clr的转换规则,它使用org.springframework.boot.logging.logback.ColorConverter类进行转换,这个元素通常用于将日志输出中的文本着色,以便更容易地区分不同的日志级别或其他信息 --> |
| | | <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/> |
| | | <!-- WhitespaceThrowableProxyConverter和ExtendedWhitespaceThrowableProxyConverter都是用于将异常信息转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示的类。它们之间的区别在于,ExtendedWhitespaceThrowableProxyConverter在输出异常信息时会包含更多的详细信息,例如异常的类名、方法名和行号等 --> |
| | | <!-- 定义了一个名为wex的转换规则,它使用org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter类进行转换,这个元素通常用于将异常信息转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示 --> |
| | | <conversionRule conversionWord="wex" |
| | | converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/> |
| | | <!-- 定义了一个名为wEx的转换规则,它使用org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter类进行转换,这个元素通常用于将异常信息转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示 --> |
| | | <conversionRule conversionWord="wEx" |
| | | converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/> |
| | | |
| | | <!-- 彩色日志格式 --> |
| | | <!-- value值是日志输出模板, :-是属性名和其默认值之间的分隔符,作用与:相同 --> |
| | | <!-- 定义日志输出格式的转换规则,%d{yyyy-MM-dd HH:mm:ss.SSS}表示日期和时间,%clr表示将输出文本着色,{faint}表示使用淡色 --> |
| | | <!-- %5p表示日志级别输出右对齐,左边以空格填充 --> |
| | | <!-- ${PID:- }表示进程ID,%clr表示将输出文本着色,{magenta}表示使用洋红色 --> |
| | | <!-- -表示一个分隔符 --> |
| | | <!-- %t:显示产生该日志的线程名;%15:若字符长度小于15,则左边用空格填充;%.15:若字符长度超过15,截去多余字符 --> |
| | | <!-- %-40:若字符长度小于40,则右边用空格填充;%.40:若字符长度超过40,截去多余字符;logger{39}对应的是“logging.WARNING”级别。具体来说,Python的logging模块定义了以下几个级别(从低到高):NOTSET、DEBUG、INFO、WARNING、ERROR、CRITICAL。因此,logger{39}表示的是WARNING级别,即日志记录器会记录所有WARNING级别及以上的日志信息 --> |
| | | <!-- %m表示日志消息;%n表示换行符;${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}表示异常信息。如果日志输出中包含异常信息,这个规则将会将其转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示 --> |
| | | <property name="CONSOLE_LOG_PATTERN" |
| | | value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
| | | |
| | | <!--1. 输出到控制台--> |
| | | <!-- 定义控制台日志输出的appender,class="ch.qos.logback.core.ConsoleAppender"表示使用Logback框架提供的ConsoleAppender类来输出日志到控制台 --> |
| | | <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
| | | <!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息--> |
| | | <!-- 定义日志输出级别的过滤器,class="ch.qos.logback.classic.filter.ThresholdFilter"表示使用Logback框架提供的ThresholdFilter类来过滤日志输出,<level>debug</level>表示只输出debug级别及以上的日志 --> |
| | | <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
| | | <level>debug</level> |
| | | </filter> |
| | | <encoder> |
| | | <!-- ${CONSOLE_LOG_PATTERN}表示控制台日志输出格式,UTF-8表示编码格式 --> |
| | | <Pattern>${CONSOLE_LOG_PATTERN}</Pattern> |
| | | <!-- 设置字符集 --> |
| | | <charset>UTF-8</charset> |
| | | </encoder> |
| | | </appender> |
| | | <!--2. 输出到文档--> |
| | | <!-- 2.1 level为 DEBUG 日志,时间滚动输出 --> |
| | | <!-- 定义文件日志输出的appender,class="ch.qos.logback.core.rolling.RollingFileAppender"表示使用Logback框架提供的RollingFileAppender类来输出日志到文件 --> |
| | | <appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_debug.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> <!-- 设置字符集 --> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <!-- 定义日志文件滚动策略的标签,class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"表示使用Logback框架提供的TimeBasedRollingPolicy类来定义日志文件的滚动策略 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 日志归档 --> |
| | | <!-- 定义日志文件名的模式。在这个模式中,${logging.path}表示日志文件的路径,%d{yyyy-MM-dd}表示日期格式,%i表示文件索引 --> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <!-- 定义日志文件滚动策略的标签,class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"表示使用Logback框架提供的SizeAndTimeBasedFNATP类来定义日志文件的滚动策略,<maxFileSize>100MB</maxFileSize>表示日志文件的最大大小为100MB。这个滚动策略通常用于按照时间和文件大小滚动日志文件,以便更好地管理日志文件的大小和数量 --> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录debug级别的 --> |
| | | <!-- 定义日志输出级别的过滤器。在这个过滤器中,class="ch.qos.logback.classic.filter.LevelFilter"表示使用Logback框架提供的LevelFilter类来过滤日志输出,<level>debug</level>表示只输出debug级别及以上的日志 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>debug</level> |
| | | <!-- <onMatch>ACCEPT</onMatch>表示如果日志事件与过滤器匹配,则接受该事件,<onMismatch>DENY</onMismatch>表示如果日志事件与过滤器不匹配,则拒绝该事件 --> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 2.2 level为 INFO 日志,时间滚动输出 --> |
| | | <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_info.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 天天日志归档路径以及格式 --> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录info级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>info</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 2.3 level为 WARN 日志,时间滚动输出 --> |
| | | <appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_warn.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> <!-- 此处设置字符集 --> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录warn级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>warn</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 2.4 level为 ERROR 日志,时间滚动输出 --> |
| | | <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_error.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> <!-- 此处设置字符集 --> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录ERROR级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>ERROR</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 4.1 开发环境:打印控制台--> |
| | | <!-- 用于在Spring Boot应用程序中配置日志记录的标签。在这个标签中,name="dev"表示这个配置文件只在dev环境中生效,<logger name="com.myClass.controller" level="debug"/>表示为com.myClass.controller(根据业务修改)这个包下的类配置日志输出级别为debug --> |
| | | <!-- <springProfile name="dev">--> |
| | | <!-- <logger name="com.myClass.controller" level="debug"/>--> |
| | | <!-- </springProfile>--> |
| | | <!-- 用于配置日志输出的标签。在这个标签中,level="info"表示日志输出级别为info,<appender-ref ref="CONSOLE"/>、<appender-ref ref="DEBUG_FILE"/>、<appender-ref ref="INFO_FILE"/>、<appender-ref ref="WARN_FILE"/>、<appender-ref ref="ERROR_FILE"/>表示将日志输出到不同的appender中,分别为控制台、debug文件、info文件、warn文件和error文件 --> |
| | | <root level="info"> |
| | | <appender-ref ref="CONSOLE"/> |
| | | <appender-ref ref="DEBUG_FILE"/> |
| | | <appender-ref ref="INFO_FILE"/> |
| | | <appender-ref ref="WARN_FILE"/> |
| | | <appender-ref ref="ERROR_FILE"/> |
| | | </root> |
| | | </configuration> |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | pp: |
| | | url: jdbc:mysql://127.0.0.1:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: 123456 |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://192.168.56.10:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: root |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | pp: |
| | | url: jdbc:mysql://192.168.56.10:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: root |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: 123456 |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | pp: |
| | | url: jdbc:mysql://10.153.19.150:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 10.153.19.150:8848 |
| | | redis: |
| | | database: 0 |
| | | host: 10.153.19.150 |
| | | port: 6379 |
| | | password: 123456 |
| | |
| | | server: |
| | | port: 8083 |
| | | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | pp: |
| | | url: jdbc:mysql://10.153.19.150:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 10.153.19.150:8848 |
| | | profiles: |
| | | active: prod |
| | | application: |
| | | name: loadGlass |
| | | redis: |
| | | database: 0 |
| | | host: 10.153.19.150 |
| | | port: 6379 |
| | | password: 123456 |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | |
| | | test: |
| | | common: 123789 |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration scan="true" scanPeriod="10 seconds"> |
| | | <!-- logger上下文名称(根据业务修改) --> |
| | | <contextName>loadGlass</contextName> |
| | | |
| | | <!-- 定义了一个名为serverName的属性,它的值来自于logging.file.name,如果没有找到该属性默认为MyServerName(根据业务修改) --> |
| | | <springProperty name="serverName" source="logging.file.name" defaultValue="loadGlass"/> |
| | | <springProperty name="logging.path" source="logging.file.path" defaultValue="././logs/"/> |
| | | |
| | | <!-- 彩色日志依赖的渲染类 --> |
| | | <!-- 定义了一个名为clr的转换规则,它使用org.springframework.boot.logging.logback.ColorConverter类进行转换,这个元素通常用于将日志输出中的文本着色,以便更容易地区分不同的日志级别或其他信息 --> |
| | | <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/> |
| | | <!-- WhitespaceThrowableProxyConverter和ExtendedWhitespaceThrowableProxyConverter都是用于将异常信息转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示的类。它们之间的区别在于,ExtendedWhitespaceThrowableProxyConverter在输出异常信息时会包含更多的详细信息,例如异常的类名、方法名和行号等 --> |
| | | <!-- 定义了一个名为wex的转换规则,它使用org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter类进行转换,这个元素通常用于将异常信息转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示 --> |
| | | <conversionRule conversionWord="wex" |
| | | converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/> |
| | | <!-- 定义了一个名为wEx的转换规则,它使用org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter类进行转换,这个元素通常用于将异常信息转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示 --> |
| | | <conversionRule conversionWord="wEx" |
| | | converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/> |
| | | |
| | | <!-- 彩色日志格式 --> |
| | | <!-- value值是日志输出模板, :-是属性名和其默认值之间的分隔符,作用与:相同 --> |
| | | <!-- 定义日志输出格式的转换规则,%d{yyyy-MM-dd HH:mm:ss.SSS}表示日期和时间,%clr表示将输出文本着色,{faint}表示使用淡色 --> |
| | | <!-- %5p表示日志级别输出右对齐,左边以空格填充 --> |
| | | <!-- ${PID:- }表示进程ID,%clr表示将输出文本着色,{magenta}表示使用洋红色 --> |
| | | <!-- -表示一个分隔符 --> |
| | | <!-- %t:显示产生该日志的线程名;%15:若字符长度小于15,则左边用空格填充;%.15:若字符长度超过15,截去多余字符 --> |
| | | <!-- %-40:若字符长度小于40,则右边用空格填充;%.40:若字符长度超过40,截去多余字符;logger{39}对应的是“logging.WARNING”级别。具体来说,Python的logging模块定义了以下几个级别(从低到高):NOTSET、DEBUG、INFO、WARNING、ERROR、CRITICAL。因此,logger{39}表示的是WARNING级别,即日志记录器会记录所有WARNING级别及以上的日志信息 --> |
| | | <!-- %m表示日志消息;%n表示换行符;${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}表示异常信息。如果日志输出中包含异常信息,这个规则将会将其转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示 --> |
| | | <property name="CONSOLE_LOG_PATTERN" |
| | | value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
| | | |
| | | <!--1. 输出到控制台--> |
| | | <!-- 定义控制台日志输出的appender,class="ch.qos.logback.core.ConsoleAppender"表示使用Logback框架提供的ConsoleAppender类来输出日志到控制台 --> |
| | | <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
| | | <!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息--> |
| | | <!-- 定义日志输出级别的过滤器,class="ch.qos.logback.classic.filter.ThresholdFilter"表示使用Logback框架提供的ThresholdFilter类来过滤日志输出,<level>debug</level>表示只输出debug级别及以上的日志 --> |
| | | <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
| | | <level>debug</level> |
| | | </filter> |
| | | <encoder> |
| | | <!-- ${CONSOLE_LOG_PATTERN}表示控制台日志输出格式,UTF-8表示编码格式 --> |
| | | <Pattern>${CONSOLE_LOG_PATTERN}</Pattern> |
| | | <!-- 设置字符集 --> |
| | | <charset>UTF-8</charset> |
| | | </encoder> |
| | | </appender> |
| | | <!--2. 输出到文档--> |
| | | <!-- 2.1 level为 DEBUG 日志,时间滚动输出 --> |
| | | <!-- 定义文件日志输出的appender,class="ch.qos.logback.core.rolling.RollingFileAppender"表示使用Logback框架提供的RollingFileAppender类来输出日志到文件 --> |
| | | <appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_debug.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> <!-- 设置字符集 --> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <!-- 定义日志文件滚动策略的标签,class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"表示使用Logback框架提供的TimeBasedRollingPolicy类来定义日志文件的滚动策略 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 日志归档 --> |
| | | <!-- 定义日志文件名的模式。在这个模式中,${logging.path}表示日志文件的路径,%d{yyyy-MM-dd}表示日期格式,%i表示文件索引 --> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <!-- 定义日志文件滚动策略的标签,class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"表示使用Logback框架提供的SizeAndTimeBasedFNATP类来定义日志文件的滚动策略,<maxFileSize>100MB</maxFileSize>表示日志文件的最大大小为100MB。这个滚动策略通常用于按照时间和文件大小滚动日志文件,以便更好地管理日志文件的大小和数量 --> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录debug级别的 --> |
| | | <!-- 定义日志输出级别的过滤器。在这个过滤器中,class="ch.qos.logback.classic.filter.LevelFilter"表示使用Logback框架提供的LevelFilter类来过滤日志输出,<level>debug</level>表示只输出debug级别及以上的日志 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>debug</level> |
| | | <!-- <onMatch>ACCEPT</onMatch>表示如果日志事件与过滤器匹配,则接受该事件,<onMismatch>DENY</onMismatch>表示如果日志事件与过滤器不匹配,则拒绝该事件 --> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 2.2 level为 INFO 日志,时间滚动输出 --> |
| | | <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_info.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 天天日志归档路径以及格式 --> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录info级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>info</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 2.3 level为 WARN 日志,时间滚动输出 --> |
| | | <appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_warn.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> <!-- 此处设置字符集 --> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录warn级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>warn</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 2.4 level为 ERROR 日志,时间滚动输出 --> |
| | | <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_error.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> <!-- 此处设置字符集 --> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录ERROR级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>ERROR</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 4.1 开发环境:打印控制台--> |
| | | <!-- 用于在Spring Boot应用程序中配置日志记录的标签。在这个标签中,name="dev"表示这个配置文件只在dev环境中生效,<logger name="com.myClass.controller" level="debug"/>表示为com.myClass.controller(根据业务修改)这个包下的类配置日志输出级别为debug --> |
| | | <!-- <springProfile name="dev">--> |
| | | <!-- <logger name="com.myClass.controller" level="debug"/>--> |
| | | <!-- </springProfile>--> |
| | | <!-- 用于配置日志输出的标签。在这个标签中,level="info"表示日志输出级别为info,<appender-ref ref="CONSOLE"/>、<appender-ref ref="DEBUG_FILE"/>、<appender-ref ref="INFO_FILE"/>、<appender-ref ref="WARN_FILE"/>、<appender-ref ref="ERROR_FILE"/>表示将日志输出到不同的appender中,分别为控制台、debug文件、info文件、warn文件和error文件 --> |
| | | <root level="info"> |
| | | <appender-ref ref="CONSOLE"/> |
| | | <appender-ref ref="DEBUG_FILE"/> |
| | | <appender-ref ref="INFO_FILE"/> |
| | | <appender-ref ref="WARN_FILE"/> |
| | | <appender-ref ref="ERROR_FILE"/> |
| | | </root> |
| | | </configuration> |
| | |
| | | package com.mes; |
| | | |
| | | import com.mes.common.utils.UserInfoUtils; |
| | | import com.mes.menu.entity.SysMenu; |
| | | import com.mes.menu.service.SysMenuService; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import com.mes.pp.service.OptimizeDetailService; |
| | | import com.mes.userinfo.entity.SysUser; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | |
| | | @Resource |
| | | OptimizeDetailService optimizationDetailService; |
| | | |
| | | @Resource |
| | | SysMenuService service; |
| | | |
| | | @Test |
| | | public void test1() { |
| | | SysUser user = new SysUser(); |
| | | user.setId(1l); |
| | | UserInfoUtils.set(user); |
| | | List<SysMenu> menuTree = service.getMenuTree(null); |
| | | System.out.println("获取记录数:" + menuTree); |
| | | } |
| | | |
| | | @Test |
| | | public void test() { |
| | | List<OptimizeDetail> list = optimizationDetailService.list(); |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | application: |
| | | name: temperingGlass |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: 123456 |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://192.168.56.10:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: root |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | application: |
| | | name: temperingGlass |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: 123456 |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 10.153.19.150:8848 |
| | | redis: |
| | | database: 0 |
| | | host: 10.153.19.150 |
| | | port: 6379 |
| | | password: 123456 |
| | |
| | | server: |
| | | port: 8084 |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 10.153.19.150:8848 |
| | | profiles: |
| | | active: prod |
| | | application: |
| | | name: temperingGlass |
| | | redis: |
| | | database: 0 |
| | | host: 10.153.19.150 |
| | | port: 6379 |
| | | password: 123456 |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | configuration: |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration scan="true" scanPeriod="10 seconds"> |
| | | <!-- logger上下文名称(根据业务修改) --> |
| | | <contextName>temperingGlass</contextName> |
| | | |
| | | <!-- 定义了一个名为serverName的属性,它的值来自于logging.file.name,如果没有找到该属性默认为MyServerName(根据业务修改) --> |
| | | <springProperty name="serverName" source="logging.file.name" defaultValue="temperingGlass"/> |
| | | <springProperty name="logging.path" source="logging.file.path" defaultValue="././logs/"/> |
| | | |
| | | <!-- 彩色日志依赖的渲染类 --> |
| | | <!-- 定义了一个名为clr的转换规则,它使用org.springframework.boot.logging.logback.ColorConverter类进行转换,这个元素通常用于将日志输出中的文本着色,以便更容易地区分不同的日志级别或其他信息 --> |
| | | <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/> |
| | | <!-- WhitespaceThrowableProxyConverter和ExtendedWhitespaceThrowableProxyConverter都是用于将异常信息转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示的类。它们之间的区别在于,ExtendedWhitespaceThrowableProxyConverter在输出异常信息时会包含更多的详细信息,例如异常的类名、方法名和行号等 --> |
| | | <!-- 定义了一个名为wex的转换规则,它使用org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter类进行转换,这个元素通常用于将异常信息转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示 --> |
| | | <conversionRule conversionWord="wex" |
| | | converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/> |
| | | <!-- 定义了一个名为wEx的转换规则,它使用org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter类进行转换,这个元素通常用于将异常信息转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示 --> |
| | | <conversionRule conversionWord="wEx" |
| | | converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/> |
| | | |
| | | <!-- 彩色日志格式 --> |
| | | <!-- value值是日志输出模板, :-是属性名和其默认值之间的分隔符,作用与:相同 --> |
| | | <!-- 定义日志输出格式的转换规则,%d{yyyy-MM-dd HH:mm:ss.SSS}表示日期和时间,%clr表示将输出文本着色,{faint}表示使用淡色 --> |
| | | <!-- %5p表示日志级别输出右对齐,左边以空格填充 --> |
| | | <!-- ${PID:- }表示进程ID,%clr表示将输出文本着色,{magenta}表示使用洋红色 --> |
| | | <!-- -表示一个分隔符 --> |
| | | <!-- %t:显示产生该日志的线程名;%15:若字符长度小于15,则左边用空格填充;%.15:若字符长度超过15,截去多余字符 --> |
| | | <!-- %-40:若字符长度小于40,则右边用空格填充;%.40:若字符长度超过40,截去多余字符;logger{39}对应的是“logging.WARNING”级别。具体来说,Python的logging模块定义了以下几个级别(从低到高):NOTSET、DEBUG、INFO、WARNING、ERROR、CRITICAL。因此,logger{39}表示的是WARNING级别,即日志记录器会记录所有WARNING级别及以上的日志信息 --> |
| | | <!-- %m表示日志消息;%n表示换行符;${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}表示异常信息。如果日志输出中包含异常信息,这个规则将会将其转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示 --> |
| | | <property name="CONSOLE_LOG_PATTERN" |
| | | value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
| | | |
| | | <!--1. 输出到控制台--> |
| | | <!-- 定义控制台日志输出的appender,class="ch.qos.logback.core.ConsoleAppender"表示使用Logback框架提供的ConsoleAppender类来输出日志到控制台 --> |
| | | <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
| | | <!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息--> |
| | | <!-- 定义日志输出级别的过滤器,class="ch.qos.logback.classic.filter.ThresholdFilter"表示使用Logback框架提供的ThresholdFilter类来过滤日志输出,<level>debug</level>表示只输出debug级别及以上的日志 --> |
| | | <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
| | | <level>debug</level> |
| | | </filter> |
| | | <encoder> |
| | | <!-- ${CONSOLE_LOG_PATTERN}表示控制台日志输出格式,UTF-8表示编码格式 --> |
| | | <Pattern>${CONSOLE_LOG_PATTERN}</Pattern> |
| | | <!-- 设置字符集 --> |
| | | <charset>UTF-8</charset> |
| | | </encoder> |
| | | </appender> |
| | | <!--2. 输出到文档--> |
| | | <!-- 2.1 level为 DEBUG 日志,时间滚动输出 --> |
| | | <!-- 定义文件日志输出的appender,class="ch.qos.logback.core.rolling.RollingFileAppender"表示使用Logback框架提供的RollingFileAppender类来输出日志到文件 --> |
| | | <appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_debug.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> <!-- 设置字符集 --> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <!-- 定义日志文件滚动策略的标签,class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"表示使用Logback框架提供的TimeBasedRollingPolicy类来定义日志文件的滚动策略 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 日志归档 --> |
| | | <!-- 定义日志文件名的模式。在这个模式中,${logging.path}表示日志文件的路径,%d{yyyy-MM-dd}表示日期格式,%i表示文件索引 --> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <!-- 定义日志文件滚动策略的标签,class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"表示使用Logback框架提供的SizeAndTimeBasedFNATP类来定义日志文件的滚动策略,<maxFileSize>100MB</maxFileSize>表示日志文件的最大大小为100MB。这个滚动策略通常用于按照时间和文件大小滚动日志文件,以便更好地管理日志文件的大小和数量 --> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录debug级别的 --> |
| | | <!-- 定义日志输出级别的过滤器。在这个过滤器中,class="ch.qos.logback.classic.filter.LevelFilter"表示使用Logback框架提供的LevelFilter类来过滤日志输出,<level>debug</level>表示只输出debug级别及以上的日志 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>debug</level> |
| | | <!-- <onMatch>ACCEPT</onMatch>表示如果日志事件与过滤器匹配,则接受该事件,<onMismatch>DENY</onMismatch>表示如果日志事件与过滤器不匹配,则拒绝该事件 --> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 2.2 level为 INFO 日志,时间滚动输出 --> |
| | | <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_info.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 天天日志归档路径以及格式 --> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录info级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>info</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 2.3 level为 WARN 日志,时间滚动输出 --> |
| | | <appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_warn.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> <!-- 此处设置字符集 --> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录warn级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>warn</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 2.4 level为 ERROR 日志,时间滚动输出 --> |
| | | <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_error.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> <!-- 此处设置字符集 --> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录ERROR级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>ERROR</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 4.1 开发环境:打印控制台--> |
| | | <!-- 用于在Spring Boot应用程序中配置日志记录的标签。在这个标签中,name="dev"表示这个配置文件只在dev环境中生效,<logger name="com.myClass.controller" level="debug"/>表示为com.myClass.controller(根据业务修改)这个包下的类配置日志输出级别为debug --> |
| | | <!-- <springProfile name="dev">--> |
| | | <!-- <logger name="com.myClass.controller" level="debug"/>--> |
| | | <!-- </springProfile>--> |
| | | <!-- 用于配置日志输出的标签。在这个标签中,level="info"表示日志输出级别为info,<appender-ref ref="CONSOLE"/>、<appender-ref ref="DEBUG_FILE"/>、<appender-ref ref="INFO_FILE"/>、<appender-ref ref="WARN_FILE"/>、<appender-ref ref="ERROR_FILE"/>表示将日志输出到不同的appender中,分别为控制台、debug文件、info文件、warn文件和error文件 --> |
| | | <root level="info"> |
| | | <appender-ref ref="CONSOLE"/> |
| | | <appender-ref ref="DEBUG_FILE"/> |
| | | <appender-ref ref="INFO_FILE"/> |
| | | <appender-ref ref="WARN_FILE"/> |
| | | <appender-ref ref="ERROR_FILE"/> |
| | | </root> |
| | | </configuration> |
| | |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>com.github.yulichang</groupId> |
| | | <artifactId>mybatis-plus-join</artifactId> |
| | | <version>1.2.4</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.microsoft.sqlserver</groupId> |
| | | <artifactId>sqljdbc4</artifactId> |
| | | <version>4.0</version> |
New file |
| | |
| | | package com.mes.common; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downglassinfo.service.DownGlassTaskService; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.mapper.DownStorageCageDetailsMapper; |
| | | import com.mes.downstorage.service.DownStorageCageService; |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.tools.WebSocketServer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.util.List; |
| | | import java.util.function.Supplier; |
| | | |
| | | @Slf4j |
| | | public class Plcdownglass extends Thread { |
| | | |
| | | public static final String RESULT_IN = "1"; |
| | | public static final String RESULT_OUT = "2"; |
| | | public static final String RESULT_IN_OUT = "3"; |
| | | |
| | | @Autowired |
| | | private DownStorageCageService downStorageCageService; |
| | | @Autowired |
| | | private DownWorkstationService downWorkstationService; |
| | | |
| | | // private final Supplier<DownWorkstationService> plcServiceSupplier; |
| | | // |
| | | // public Plcdownglass() { |
| | | // this.plcServiceSupplier = () -> WebSocketServer.applicationContext.getBean(DownWorkstationService.class); |
| | | // } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void run() { |
| | | while (this != null) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | try { |
| | | Thread.sleep(100); |
| | | downWorkstationService = WebSocketServer.applicationContext.getBean(DownWorkstationService.class); |
| | | downStorageCageService = WebSocketServer.applicationContext.getBean(DownStorageCageService.class); |
| | | // String result = S7control.getinstance().ReadWord("DB14.0", 1).get(0) + ""; |
| | | // String number = S7control.getinstance().ReadWord("DB14.2", 1).get(0) + ""; |
| | | String result ="1"; |
| | | String number ="1"; |
| | | // 进片请求 |
| | | if (RESULT_IN.equals(result)) { |
| | | downStorageCageService.processInto(number); |
| | | } |
| | | // 出片请求 |
| | | else if (RESULT_OUT.equals(result)) { |
| | | downStorageCageService.processOut(); |
| | | } |
| | | // 进出片请求 |
| | | else if (RESULT_IN_OUT.equals(result)) { |
| | | // 先出后进 |
| | | if (!downStorageCageService.processOut()) { |
| | | downStorageCageService.processInto(number); |
| | | } |
| | | } |
| | | |
| | | |
| | | downWorkstationService.insertdownglassinfo(); |
| | | |
| | | |
| | | |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | package com.mes.common; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.mes.downworkstation.service.DownGlassLogic; |
| | | |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import com.mes.tools.WebSocketServer; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.function.Supplier; |
| | | |
| | | @Component |
| | | public class Plchome extends Thread { |
| | | private int i = 1; |
| | | private static final Logger log = LogManager.getLogger(Plchome.class); |
| | | @Autowired |
| | | private DownWorkstationService downWorkstationService; |
| | | |
| | | private final Supplier<DownGlassLogic> plcServiceSupplier; |
| | | // private final Supplier<DownGlassLogic> plcServiceSupplier; |
| | | |
| | | public Plchome() { |
| | | this.plcServiceSupplier = () -> WebSocketServer.applicationContext.getBean(DownGlassLogic.class); |
| | | } |
| | | // public Plchome() { |
| | | // this.plcServiceSupplier = () -> WebSocketServer.applicationContext.getBean(DownGlassLogic.class); |
| | | // } |
| | | |
| | | |
| | | @Override |
| | |
| | | while (!Thread.currentThread().isInterrupted()) { |
| | | try { |
| | | i++; |
| | | Thread.sleep(100); |
| | | DownGlassLogic plcService = plcServiceSupplier.get(); |
| | | |
| | | |
| | | //当下片任务表状态为1时候将数据插入到下片玻璃信息表 |
| | | plcService.insertdownglassinfo(); |
| | | |
| | | |
| | | //当机械手任务表中状态为1 更新已经落架数量,并且把下片任务表的那条记录删掉 工位表流程卡绑定了架子 |
| | | plcService.downWorkstation(); |
| | | Thread.sleep(1000); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | System.out.println(77); |
| | | downWorkstationService = WebSocketServer.applicationContext.getBean(DownWorkstationService.class); |
| | | List<Map<String, Object>> yy= downWorkstationService.getTotalGlassDimensionsByWorkstation(); |
| | | jsonObject.append("data", yy); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unloadglass"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | log.info("准备向 WebSocket 服务器发送消息: {}", jsonObject.toString()); |
| | | } |
| | | } |
| | | |
| | | |
| | | } catch (InterruptedException e) { |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | // System.out.println(arraylist6); |
| | | jsonObject.append("data", 1); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unloadglass"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | log.info("准备向 WebSocket 服务器发送消息: {}", jsonObject.toString()); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | package com.mes.config; |
| | | |
| | | import com.mes.common.Plcdownglass; |
| | | import com.mes.common.Plchome; |
| | | import com.mes.device.PLCAutoMes; |
| | | import org.springframework.boot.ApplicationArguments; |
| | |
| | | // |
| | | System.out.println("启动完成"); |
| | | |
| | | |
| | | //new Plcdownglass().start(); |
| | | |
| | | // new PLCAutoMes().start(); |
| | | // |
| | | // new Plchome().start(); |
| | | // new Plchome().start(); |
| | | |
| | | } |
| | | } |
| | |
| | | @Repository |
| | | public interface DownGlassInfoMapper extends BaseMapper<DownGlassInfo> { |
| | | |
| | | // @Select("SELECT MAX(sequence) FROM down_glass_info WHERE flow_card_id = #{flowCardId} LIMIT 1") |
| | | // Integer getMaxSequenceByFlowCardId(@Param("flowCardId") String flowCardId); |
| | | //// |
| | | // @Delete("delete from down_glass_task where flow_card_id = #{flowCardId}") |
| | | // void deletetask(@Param("flowCardId") String flowCardId); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | void updateTaskStateToZero(long id); |
| | | |
| | | void deleteTask(long id); |
| | | void deleteTask(String id); |
| | | |
| | | DownGlassTask selectLastOutCacheInfo(String endCell); |
| | | |
| | | Integer insertCacheTask(Long id, String start, String end, String type, double width, double height, String filmsId, double thickness, String flowCardId); |
| | | Integer insertCacheTask(DownGlassTask downGlassTask); |
| | | |
| | | List<DownGlassTask> selectInputTaskCache(); |
| | | |
| | | /** |
| | | * 查询出片任务 |
| | | * @return |
| | | */ |
| | | List<DownGlassTask> selectOutTaskCache(); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downglassinfo.mapper.DownGlassInfoMapper; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.downglassinfo.service.DownGlassTaskService; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.mapper.DownWorkstationMapper; |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import com.mes.downworkstation.service.DownWorkstationTaskService; |
| | | import com.mes.tools.WebSocketServer; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class DownGlassInfoServiceImpl extends ServiceImpl<DownGlassInfoMapper, DownGlassInfo> implements DownGlassInfoService { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void deleteTask(long id) { |
| | | public void deleteTask(String id) { |
| | | LambdaQueryWrapper<DownGlassTask> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(DownGlassTask::getId, id); |
| | | queryWrapper.eq(DownGlassTask::getFlowCardId, id); |
| | | |
| | | baseMapper.delete(queryWrapper); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Integer insertCacheTask(Long id, String start, String end, String type, double width, double height, String filmsId, double thickness, String flowCardId) { |
| | | public Integer insertCacheTask(DownGlassTask downGlassTask) { |
| | | DownGlassTask glassInfo = new DownGlassTask(); |
| | | glassInfo.setId(id); |
| | | glassInfo.setStartCell(start); |
| | | glassInfo.setEndCell(end); |
| | | glassInfo.setTaskType(type); |
| | | glassInfo.setWidth(width); |
| | | glassInfo.setHeight(height); |
| | | glassInfo.setFilmsid(filmsId); |
| | | glassInfo.setThickness(thickness); |
| | | glassInfo.setFlowCardId(flowCardId); |
| | | glassInfo.setId(downGlassTask.getId()); |
| | | glassInfo.setStartCell(downGlassTask.getStartCell()); |
| | | glassInfo.setEndCell(downGlassTask.getEndCell()); |
| | | glassInfo.setTaskType(downGlassTask.getTaskType()); |
| | | glassInfo.setWidth(downGlassTask.getWidth()); |
| | | glassInfo.setHeight(downGlassTask.getHeight()); |
| | | glassInfo.setFilmsid(downGlassTask.getFilmsid()); |
| | | glassInfo.setThickness(downGlassTask.getThickness()); |
| | | glassInfo.setFlowCardId(downGlassTask.getFlowCardId()); |
| | | glassInfo.setTaskStauts(0); // 默认任务状态为0 |
| | | |
| | | int rows = baseMapper.insert(glassInfo); |
| | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<DownGlassTask> selectInputTaskCache(){ |
| | | return baseMapper.selectList(new QueryWrapper<DownGlassTask>().eq("task_status",0).eq("task_type",1)); |
| | | } |
| | | |
| | | /** |
| | | * 查询待出片任务 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DownGlassTask> selectOutTaskCache(){ |
| | | return baseMapper.selectList(new QueryWrapper<DownGlassTask>().eq("task_status",0).eq("task_type",2)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | @Api(tags = "缓存") |
| | | @Api(description = "缓存") |
| | | @RestController |
| | | @RequestMapping("/downStorage") |
| | | public class DownStorageCageDetailsController { |
| | |
| | | @GetMapping("/selectStorageCage") |
| | | @ResponseBody |
| | | public Result selectEdgStorageCage () { |
| | | List<Map> list=downStorageCageService.getCacheInfo(); |
| | | List<Map> list=downStorageCageDetailsService.getCacheInfo(); |
| | | return Result.build(200,"成功",list); |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | @ApiModel(description = "<p> 缓存</p>") |
| | | @Api(description = "缓存") |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class DownStorageCage implements Serializable { |
| | |
| | | /** |
| | | * 玻璃id |
| | | */ |
| | | private Integer glassId; |
| | | private String glassId; |
| | | |
| | | /** |
| | | * 小片在格内的顺序 |
| | |
| | | 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; |
| | |
| | | * @since 2024-03-27 |
| | | */ |
| | | @Mapper |
| | | public interface DownStorageCageDetailsMapper extends BaseMapper<DownStorageCageDetails> { |
| | | // |
| | | // @Select("select * from `glass_info` where id=#{id}") |
| | | // GlassInfo SelectGlassId(String id); |
| | | // 查询笼子内空闲 |
| | | @Select("select escd.* from down_storage_cage as esc LEFT JOIN down_storage_cage_details as escd on esc.slot=escd.slot where escd.slot is null order by escd.slot") |
| | | List<DownStorageCageDetails> SelectCacheLeisure(); |
| | | |
| | | // 查询符合工位的出片玻璃 |
| | | @Select("select escd.* from down_storage_cage as esc LEFT JOIN down_storage_cage_details as escd on esc.slot=escd.slot left join down_workstation as dw on escd.flow_card_id=dw.flow_card_id WHERE escd.slot IS NOT NULL and dw.workstation_id BETWEEN #{start} and #{end} order by escd.tempering_layout_id,escd.tempering_feed_sequence") |
| | | List<DownStorageCageDetails> SelectCacheOut(int start,int end); |
| | | //SELECT* from (SELECT DISTINCT escd.* from down_storage_cage as esc LEFT JOIN down_storage_cage_details as escd on esc.slot=escd.slot left join down_workstation as dw on escd.flow_card_id=dw.flow_card_id WHERE escd.slot IS NOT NULL and dw.workstation_id BETWEEN 1 and 5 order by escd.tempering_layout_id,escd.tempering_feed_sequence) as cc ORDER BY cc.width desc |
| | | // 查询笼子内信息 |
| | | @Select("select escd.* from down_storage_cage as esc LEFT JOIN down_storage_cage_details as escd on esc.slot=escd.slot order by esc.slot") |
| | | List<DownStorageCageDetails> SelectCachInfo(); |
| | | |
| | | // 查询可进此片玻璃的栅格号 找到相同版图id并且大于前面的顺序的空格 |
| | | @Select("select escd.* from down_storage_cage as esc LEFT JOIN down_storage_cage_details as escd on esc.slot=escd.slot where escd.slot is not null and escd.tempering_layout_id=#{tempering_layout_id} and escd.tempering_feed_sequence<#{tempering_feed_sequence} and esc.remain_width-#{width}>0 order by escd.tempering_feed_sequence") |
| | | List<DownStorageCageDetails> SelectIsExistIntoCache(Integer tempering_layout_id, Integer tempering_feed_sequence, |
| | | double width); |
| | | |
| | | // 查询可进此片玻璃的栅格号 |
| | | @Select("select escd.* from down_storage_cage as esc LEFT JOIN down_storage_cage_details as escd on esc.slot=escd.slot where escd.slot is not null escd.tempering_layout_id<#{tempering_layout_id} and esc.remain_width-#{width}>0 order by escd.tempering_layout_id desc,escd.tempering_feed_sequence") |
| | | List<DownStorageCageDetails> SelectIsExistIntoCache(Integer tempering_layout_id, double width); |
| | | |
| | | // // 查询全部任务 |
| | | // @Select("select * from down_glass_task") |
| | | // List<DownGlassTask> SelectCacheInfoAll(); |
| | | // |
| | | // // 查询进片任务 |
| | | // @Select("select * from down_glass_task where task_type='1' and task_stauts='0'") |
| | | // List<DownGlassTask> SelectInputCacheInfo(); |
| | | // |
| | | // // 查询出片任务 |
| | | // @Select("select * from down_glass_task where task_type='2' and task_stauts='0'") |
| | | // List<DownGlassTask> SelectOutCacheInfo(); |
| | | |
| | | // 查询 A06 或 A11 最新的一片 出片任务 |
| | | // @Select("select * from down_glass_task where task_type='2' and task_stauts='2' and end_cell=#{EndCell} limit 1") |
| | | // GlassInfo SelectLastOutCacheInfo(String EndCell); |
| | | |
| | | // 修改笼子内信息 |
| | | // @Update("update") |
| | | // Integer UpdateCache(@Param("id") Integer id, @Param("order_id") String order_id); |
| | | |
| | | // 添加下片任务 |
| | | @Insert("INSERT into down_glass_task VALUES(#{id},#{start},#{end},#{type},0,)") |
| | | Integer insertCacheTask(String id, String start, String end, String type,double width,double height,Integer filmsId,double thickness,String flowCardId); |
| | | |
| | | public interface DownStorageCageDetailsMapper extends MPJBaseMapper<DownStorageCageDetails> { |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | @Mapper |
| | | public interface DownStorageCageMapper extends MPJBaseMapper<DownStorageCage> { |
| | | |
| | | } |
| | |
| | | package com.mes.downstorage.service; |
| | | |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | //修改理片笼内信息 |
| | | boolean updatedownStorageCageDetails(DownStorageCageDetails details); |
| | | List<DownStorageCageDetails> getCacheLeisure(); |
| | | List<DownStorageCageDetails> getCacheOut(int start, int end); |
| | | List<Map> getCacheInfo(); |
| | | |
| | | |
| | | List<DownStorageCageDetails> getIsExistIntoCacheByflowcardid(String flowcardid, double width); |
| | | |
| | | List<DownStorageCageDetails> CacheOut(int start, int end); |
| | | } |
| | |
| | | package com.mes.downstorage.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | public interface DownStorageCageService extends IService<DownStorageCage> { |
| | | public interface DownStorageCageService extends MPJBaseService<DownStorageCage> { |
| | | public List<Map> gettask(); |
| | | |
| | | // List<Map<String, Object>> selectCacheLeisure(); |
| | | List<DownStorageCageDetails> getCacheLeisure(); |
| | | List<DownStorageCageDetails> getCacheOut(int start, int end); |
| | | List<Map> getCacheInfo(); |
| | | List<DownStorageCageDetails> getIsExistIntoCacheByLayoutAndSequence(Integer tempering_layout_id, Integer tempering_feed_sequence, double width); |
| | | List<DownStorageCageDetails> getIsExistIntoCacheByLayout(Integer tempering_layout_id, double width); |
| | | List<DownStorageCageDetails> getIsExistIntoCacheByflowcardid(String flowcardid, double width); |
| | | List<DownStorageCageDetails> IsExistIntoCacheByflowcardid(String flowcardid, double width); |
| | | |
| | | List<Map> selectCacheEmpty(); |
| | | boolean processInto(String Number); |
| | | boolean processOut(); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.github.yulichang.wrapper.MPJAbstractLambdaWrapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.mapper.DownStorageCageDetailsMapper; |
| | | |
| | | import com.mes.downstorage.mapper.DownStorageCageMapper; |
| | | import com.mes.downstorage.service.DownStorageCageDetailsService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class DownStorageCageDetailsServiceImpl extends ServiceImpl<DownStorageCageDetailsMapper, DownStorageCageDetails> implements DownStorageCageDetailsService { |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private DownStorageCageMapper downStorageCageMapper; |
| | | @Autowired |
| | | private DownStorageCageDetailsMapper downStorageCageDetailsMapper; |
| | | @Override |
| | | public void addDownStorageCageDetails(DownStorageCageDetails details) { |
| | | this.save(details); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<DownStorageCageDetails> CacheOut(int start, int end) { |
| | | log.info("单片情况根据传入的工位查询符合按照大小出片,并且优先出满架的小片"); |
| | | return downStorageCageDetailsMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("t.*") |
| | | .leftJoin("(SELECT t1.* FROM down_storage_cage_details t1 " |
| | | + "JOIN (SELECT flow_card_id, MAX(width) AS max_width FROM glass_info GROUP BY flow_card_id) t " |
| | | + "ON t1.flow_card_id = t.flow_card_id WHERE t1.width = t.max_width) t3" |
| | | + " ON t.glass_id = t3.glass_id") |
| | | .leftJoin("down_workstation t4 ON t3.flow_card_id = t4.flow_card_id") |
| | | .isNull(Boolean.parseBoolean("t.glass_id"), "SELECT glass_id FROM down_glass_info") |
| | | .between("t4.workstation_id", start, end) |
| | | // 根据 racks_number 排序 |
| | | .orderByDesc("t4.racks_number") |
| | | |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // Other business methods can be implemented here |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<DownStorageCageDetails> getCacheOut(int start, int end) { |
| | | log.info("根据传入的工位查询符合按照顺序和大小出片的小片"); |
| | | return downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCage>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .leftJoin("down_workstation dw on escd.flow_card_id = dw.flow_card_id") |
| | | .leftJoin("glass_info gi on dw.flow_card_id = gi.flowcard_id and gi.flowcard_id=escd.flow_card_id ") |
| | | .isNotNull("escd.slot") |
| | | .between("dw.workstation_id", start, end) |
| | | .orderByDesc("escd.width") |
| | | .orderByDesc("escd.height") |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<Map> getCacheInfo() { |
| | | log.info(" 查询笼子内信息"); |
| | | return downStorageCageMapper.selectJoinList( |
| | | Map.class, new MPJQueryWrapper<DownStorageCage>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .orderByAsc("t.slot") |
| | | ); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<DownStorageCageDetails> getCacheLeisure() { |
| | | log.info(" 查询笼子内空闲"); |
| | | List<DownStorageCageDetails> list = downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCage>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .isNull("escd.slot") |
| | | |
| | | .orderByAsc("escd.slot") |
| | | ); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<DownStorageCageDetails> getIsExistIntoCacheByflowcardid(String flowcardid, double width) { |
| | | log.info(" 查询可进此片玻璃的栅格号 找到空格"); |
| | | |
| | | return downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCage>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .isNull("escd.slot") |
| | | .apply("t.remain_width - " + width + " > 0") |
| | | .orderByAsc("escd.sequence") |
| | | ); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.downstorage.service.impl; |
| | | |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.mes.common.PLCAutoMes; |
| | | import com.mes.common.S7control; |
| | | import com.mes.device.PlcParameterObject; |
| | | 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.DownStorageCageDetailsService; |
| | | import com.mes.downstorage.service.DownStorageCageService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.tools.WebSocketServer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | public class DownStorageCageServiceImpl extends ServiceImpl<DownStorageCageMapper, DownStorageCage> implements DownStorageCageService { |
| | | @Autowired |
| | | private DownStorageCageMapper downStorageCageMapper; |
| | | |
| | | @Autowired |
| | | private GlassInfoService glassInfoService; |
| | | |
| | | @Autowired |
| | | private DownGlassTaskService downGlassTaskService; |
| | | @Autowired |
| | | private DownStorageCageDetailsService downStorageCageDetailsService; |
| | | @Override |
| | | public List<Map> gettask(){ |
| | | downStorageCageMapper.selectList(null); |
| | |
| | | }; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<DownStorageCageDetails> getCacheLeisure() { |
| | | log.info(" 查询笼子内空闲"); |
| | | List<DownStorageCageDetails> list = downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | public List<Map> selectCacheEmpty(){ |
| | | return baseMapper.selectJoinList( |
| | | Map.class,new MPJQueryWrapper<DownStorageCage>().selectAll(DownStorageCage.class) |
| | | .select("escd.glass_id","escd.flow_card_id","escd.width","escd.height") |
| | | .leftJoin("down_storage_cage_details escd on t.device_id=escd.device_id and t.slot=escd.slot") |
| | | .isNull("escd.slot") |
| | | .orderByAsc("escd.slot") |
| | | ); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | // @Override |
| | | // public List<Map> getCacheOut(int start, int end) { |
| | | // log.info(" 根据传入的工位查询符合按照顺序和大小出片的小片"); |
| | | // List<Map> map = downStorageCageMapper.selectJoinList( |
| | | // Map.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | // .select("escd.*") |
| | | // .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | // .leftJoin("down_workstation dw on escd.flow_card_id = dw.flow_card_id") |
| | | // .isNotNull("escd.slot") |
| | | // .between("dw.workstation_id", start, end) |
| | | // .orderByAsc("escd.tempering_layout_id, escd.tempering_feed_sequence") |
| | | // ); |
| | | // return map; |
| | | // } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<DownStorageCageDetails> getCacheOut(int start, int end) { |
| | | log.info("根据传入的工位查询符合按照顺序和大小出片的小片"); |
| | | return downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .leftJoin("down_workstation dw on escd.flow_card_id = dw.flow_card_id") |
| | | .leftJoin("glass_info gi on dw.flow_card_id = gi.flowcard_id and gi.flowcard_id=escd.flow_card_id ") |
| | | .isNotNull("escd.slot") |
| | | .between("dw.workstation_id", start, end) |
| | | .orderByDesc("escd.width") |
| | | .orderByDesc("escd.height") |
| | | ); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<Map> getCacheInfo() { |
| | | log.info(" 查询笼子内信息"); |
| | | return downStorageCageMapper.selectJoinList( |
| | | Map.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .orderByAsc("t.slot") |
| | | ); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public DownGlassTask createDownGlassTask(GlassInfo glassInfo, String startCell, String endCell,String taskType ) { |
| | | DownGlassTask downGlassTask = new DownGlassTask(); |
| | | downGlassTask.setId(glassInfo.getId()); |
| | | downGlassTask.setStartCell(startCell); |
| | | downGlassTask.setTaskType(taskType); |
| | | downGlassTask.setEndCell(endCell); |
| | | downGlassTask.setWidth(glassInfo.getWidth()); |
| | | downGlassTask.setHeight(glassInfo.getHeight()); |
| | | downGlassTask.setFilmsid(String.valueOf(glassInfo.getFilmsid())); |
| | | downGlassTask.setThickness(glassInfo.getThickness()); |
| | | downGlassTask.setFlowCardId(glassInfo.getFlowcardId()); |
| | | |
| | | return downGlassTask; |
| | | } |
| | | |
| | | |
| | | public DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, String startCell, String endCell,String taskType ) { |
| | | DownGlassTask downGlassTask = new DownGlassTask(); |
| | | downGlassTask.setId(glassInfo.getId()); |
| | | downGlassTask.setStartCell(startCell); |
| | | downGlassTask.setTaskType(taskType); |
| | | downGlassTask.setEndCell(endCell); |
| | | downGlassTask.setWidth(glassInfo.getWidth()); |
| | | downGlassTask.setHeight(glassInfo.getHeight()); |
| | | downGlassTask.setFilmsid(String.valueOf(glassInfo.getFilmsid())); |
| | | downGlassTask.setThickness(glassInfo.getThickness()); |
| | | downGlassTask.setFlowCardId(glassInfo.getFlowCardId()); |
| | | |
| | | @Override |
| | | public List<DownStorageCageDetails> getIsExistIntoCacheByLayoutAndSequence(Integer tempering_layout_id, Integer tempering_feed_sequence, double width) { |
| | | log.info(" 查询可进此片玻璃的栅格号 找到相同版图id并且大于前面的顺序的空格"); |
| | | List<DownStorageCageDetails> list = downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .isNotNull("escd.slot") |
| | | .eq("escd.tempering_layout_id", tempering_layout_id) |
| | | .lt("escd.tempering_feed_sequence", tempering_feed_sequence) |
| | | .gt("t.remain_width", width) |
| | | .orderByAsc("escd.tempering_feed_sequence") |
| | | ); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<DownStorageCageDetails> getIsExistIntoCacheByflowcardid(String flowcardid, double width) { |
| | | log.info(" 查询可进此片玻璃的栅格号 找到相同流程卡号的空格"); |
| | | |
| | | return downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .isNotNull("escd.slot") |
| | | .eq("escd.flow_card_id", flowcardid) |
| | | .gt("t.remain_width", width) |
| | | .orderByAsc("escd.tempering_feed_sequence") |
| | | ); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<DownStorageCageDetails> IsExistIntoCacheByflowcardid(String flowcardid, double width) { |
| | | log.info(" 查询可进此片玻璃的栅格号"); |
| | | return downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .isNotNull("escd.slot") |
| | | .lt("escd.flow_card_id", flowcardid) |
| | | // 条件 t.remain_width - width > 0 |
| | | .apply("t.remain_width - " + width + " > 0") |
| | | .orderByDesc("escd.tempering_layout_id, escd.tempering_feed_sequence") |
| | | ); |
| | | |
| | | return downGlassTask; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<DownStorageCageDetails> getIsExistIntoCacheByLayout(Integer tempering_layout_id, double width) { |
| | | log.info(" 查询可进此片玻璃的栅格号"); |
| | | return downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .isNotNull("escd.slot") |
| | | .lt("escd.tempering_layout_id", tempering_layout_id) |
| | | // 条件 t.remain_width - width > 0 |
| | | .apply("t.remain_width - " + width + " > 0") |
| | | .orderByDesc("escd.tempering_layout_id, escd.tempering_feed_sequence") |
| | | ); |
| | | public boolean processInto(String Number) { |
| | | |
| | | //按id查询玻璃信息表里的玻璃 |
| | | GlassInfo GlassInfo = glassInfoService.selectGlassId(Number); |
| | | PlcParameterObject plcmes = PLCAutoMes.PlcMesObject; |
| | | //存在此玻璃编号 |
| | | if (GlassInfo != null) { |
| | | //同找到同流程卡附近空格 |
| | | List<DownStorageCageDetails> list = downStorageCageDetailsService.getIsExistIntoCacheByflowcardid(GlassInfo.getFlowcardId(), GlassInfo.getWidth()); |
| | | |
| | | List<Map> selectCacheEmpty=selectCacheEmpty(); |
| | | |
| | | // list<Map> list=selectCacheEmpty(); |
| | | // list<Map> = downStorageCageService.selectCacheEmpty(); |
| | | if (selectCacheEmpty.size() > 0) { |
| | | //存在空格 |
| | | //1.生成任务: 起始位置0 结束位置this.slot 任务类型 1 (进片任务) |
| | | //2.回复 1进片 |
| | | DownStorageCageDetails item = list.get(0); |
| | | |
| | | //selectInfo.insertCacheTask(GlassInfo.getId() + "", "0", item.getSlot() + "", "1", GlassInfo.getWidth(), GlassInfo.getHeight(), GlassInfo.getFilmsid(), GlassInfo.getThickness(), GlassInfo.getFlowcardId()); |
| | | |
| | | DownGlassTask downGlassTask = createDownGlassTask(GlassInfo,"0",item.getSlot()+"","1"); |
| | | |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | |
| | | S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(), (short) 1); |
| | | |
| | | |
| | | //完成后插入小片数据到缓存表 |
| | | return true; |
| | | } |
| | | |
| | | } else { |
| | | // ID编号不存在 不处理/回复PLC 进行报警提示 |
| | | } |
| | | //返回结果 |
| | | return false; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 理片 出 |
| | | * @return |
| | | */ |
| | | // |
| | | @Override |
| | | public boolean processOut() { |
| | | // 查询任务 |
| | | |
| | | |
| | | PlcParameterObject plcmes = PLCAutoMes.PlcMesObject; |
| | | |
| | | List<DownStorageCageDetails> list = downStorageCageDetailsService.CacheOut(1, 5); |
| | | List<DownStorageCageDetails> list2 = downStorageCageDetailsService.CacheOut(6, 10); |
| | | List<DownStorageCageDetails> list3 = downStorageCageDetailsService.CacheOut(1, 10); |
| | | //自动绑定架子 |
| | | |
| | | |
| | | |
| | | |
| | | // 优先 超出尺寸优先人工出片 人工处理 |
| | | |
| | | if (!list3.isEmpty()) { |
| | | DownStorageCageDetails item3 = list3.get(0); |
| | | if (item3.getHeight() >= 1 && item3.getWidth() >= 1) { |
| | | |
| | | String endcell = "13"; |
| | | String SendEndcell = "1"; |
| | | |
| | | // selectInfo.insertCacheTask(item3.getGlassId() + "", "0", endcell, "2", item3.getWidth(), item3.getHeight(), item3.getFilmsid(), item3.getThickness(), item3.getFlowCardId()); |
| | | |
| | | DownGlassTask downGlassTask =createDownGlassTask(item3,"0",endcell,"2"); |
| | | |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.28").getAddress(), SendEndcell); |
| | | S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.20").getAddress(), "1"); |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | |
| | | //如果同时前后端都空闲 优先后端出片并且优先满架 |
| | | else if (!list2.isEmpty()&&!list3.isEmpty()) { |
| | | |
| | | DownStorageCageDetails item3 = list2.get(0); |
| | | String endcell = "11"; |
| | | String SendEndcell = "1"; |
| | | // selectInfo.insertCacheTask(item3.getGlassId() + "", "0", endcell, "2", item3.getWidth(), item3.getHeight(), item3.getFilmsid(), item3.getThickness(), item3.getFlowCardId()); |
| | | DownGlassTask downGlassTask =createDownGlassTask(item3,"0",endcell,"2"); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | |
| | | S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.28").getAddress(), SendEndcell); |
| | | S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.20").getAddress(), "1"); |
| | | return true; |
| | | |
| | | } |
| | | // 按照大小符合前端出片 |
| | | else if (!list.isEmpty()) { |
| | | DownStorageCageDetails item = list.get(0); |
| | | |
| | | // 出到 G06 |
| | | //selectInfo.insertCacheTask(item.getGlassId() + "", "0", "06", "2", item.getWidth(), item.getHeight(), item.getFilmsid(), item.getThickness(), item.getFlowCardId()); |
| | | |
| | | DownGlassTask downGlassTask =createDownGlassTask(item,"0","06","2"); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.28").getAddress(), "1"); |
| | | S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.20").getAddress(), "1"); |
| | | return true; |
| | | |
| | | // 按照大小符合后端出片 |
| | | } else if (!list2.isEmpty()) { |
| | | DownStorageCageDetails item2 = list2.get(0); |
| | | |
| | | // 出到 G11 |
| | | // selectInfo.insertCacheTask(item2.getGlassId() + "", "0", "11", "2", item2.getWidth(), item2.getHeight(), item2.getFilmsid(), item2.getThickness(), item2.getFlowCardId()); |
| | | DownGlassTask downGlassTask =createDownGlassTask(item2,"0","11","2"); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | |
| | | S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.28").getAddress(), "2"); |
| | | S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.20").getAddress(), "1"); |
| | | return true; |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | // 返回结果 |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | */ |
| | | |
| | | @RestController |
| | | @Api(tags = "工位") |
| | | @Api(description = "工位") |
| | | @RequestMapping("/downWorkStation") |
| | | public class DownWorkstationController { |
| | | |
| | |
| | | |
| | | |
| | | |
| | | @ApiOperation("获取工位显示图") |
| | | @GetMapping("/getwo") |
| | | public ResponseEntity<Map<String, Object>> getwo() { |
| | | Map<String, Object> responseData = new HashMap<>(); |
| | | try { |
| | | List<Map<String, Object>> data = downWorkstationService.getTotalGlassDimensionsByWorkstation(); |
| | | responseData.put("code", 200); |
| | | responseData.put("msg", "成功"); |
| | | responseData.put("data", data); |
| | | return ResponseEntity.ok(responseData); |
| | | } catch (Exception e) { |
| | | responseData.put("code", 500); |
| | | responseData.put("msg", "失败"); |
| | | responseData.put("data", null); |
| | | return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(responseData); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springframework.data.annotation.Id; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | |
| | | * id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @Id |
| | | private Long id; |
| | | |
| | | /** |
New file |
| | |
| | | package com.mes.downworkstation.entity;
|
| | |
|
| | | import com.baomidou.mybatisplus.annotation.IdType;
|
| | | import com.baomidou.mybatisplus.annotation.TableField;
|
| | | import com.baomidou.mybatisplus.annotation.TableId;
|
| | | import lombok.Data;
|
| | | import lombok.EqualsAndHashCode;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | /**
|
| | | * <p>
|
| | | *
|
| | | * </p>
|
| | | *
|
| | | * @author zhoush
|
| | | * @since 2024-03-27
|
| | | */
|
| | | @Data
|
| | | @EqualsAndHashCode(callSuper = false)
|
| | |
|
| | | public class DownWorkstionAndDownGlassinfo
|
| | | {
|
| | | /**
|
| | | * 下片工位表id
|
| | | */
|
| | | @TableId(value = "id", type = IdType.AUTO)
|
| | | private Integer id;
|
| | |
|
| | | /**
|
| | | * 工位id
|
| | | */
|
| | | private Integer workstationId;
|
| | |
|
| | | /**
|
| | | * 流程卡号
|
| | | */
|
| | | private String flowCardId;
|
| | |
|
| | | /**
|
| | | * 设备id
|
| | | */
|
| | | private Integer deviceId;
|
| | |
|
| | | /**
|
| | | * 启用状态
|
| | | */
|
| | | private Integer enableState;
|
| | |
|
| | | /**
|
| | | * 工作状态
|
| | | */
|
| | | private Integer workState;
|
| | |
|
| | |
|
| | | @TableField("total_quantity")
|
| | | private Integer totalquantity;
|
| | |
|
| | | @TableField("racks_number")
|
| | | private Integer Racksnumber;
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | /**
|
| | | * 顺序
|
| | | */
|
| | | private Integer sequence;
|
| | |
|
| | | /**
|
| | | * 宽
|
| | | */
|
| | | private Double width;
|
| | |
|
| | | /**
|
| | | * 高
|
| | | */
|
| | | private Double height;
|
| | | private Double totalwidth;
|
| | |
|
| | | private Double totalheight;
|
| | | /**
|
| | | * 厚度
|
| | | */
|
| | | private Double thickness;
|
| | |
|
| | |
|
| | | private String Filmsid;
|
| | | }
|
| | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.annotation.InterceptorIgnore; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Select; |
| | |
| | | @InterceptorIgnore(tenantLine = "true") |
| | | @DS("hangzhoumes") // 指定使用 hangzhoumes 数据源 |
| | | |
| | | public interface DownWorkstationMapper extends BaseMapper<DownWorkstation> { |
| | | public interface DownWorkstationMapper extends MPJBaseMapper<DownWorkstation> { |
| | | |
| | | |
| | | //查询工位表和任务表中状态为1的流程卡号和已落架数量 |
| | | @Select("SELECT dwt.flow_card_id,dw.id,dw.racks_number FROM down_workstation_task dwt JOIN down_workstation dw ON dwt.flow_card_id = dw.flow_card_id WHERE dwt.state = 1 LIMIT 1") |
| | | List<DownWorkstation> selectdownWorkstationstate(); |
| | | |
| | | |
| | | // @Select("SELECT flow_card_id,filmsid,width,height,thickness FROM down_glass_task WHERE task_stauts = 1;") |
| | | // List<DownGlassTask> selectunloadingtaskstate(); |
| | | //更新落架数量 |
| | | // @Update("UPDATE down_workstation SET racks_number = #{racksNumber} " + |
| | | // "WHERE flow_card_id = #{flowCardId}") |
| | | // void update_racks_number(@Param("flowCardId") String flowCardId, |
| | | // @Param("racksNumber") Integer racksNumber); |
| | | |
| | | //插入机械任务表 |
| | | // @Insert("INSERT INTO down_workstation_task (flow_card_id, width, height, thickness, filmsid,state) " + |
| | | // "VALUES (#{flowCardId}, #{width}, #{height}, #{thickness}, #{filmsid},1)") |
| | | // void insertdownWorkstationtask(DownGlassInfo downGlassInfo); |
| | | |
| | | //根据工位id更新实体类接收的数据 |
| | | // @Update("UPDATE down_workstation SET width = #{width}, height = #{height}, flow_card_id = #{flowCardId} WHERE workstation_id = #{workstationId}") |
| | | // void updateFlowCardId(DownWorkstation downWorkstation); |
| | | |
| | | |
| | | // @Update("UPDATE down_workstation_task SET state = 0 WHERE flow_card_id = #{flowCardId}") |
| | | // void update_task_state_to_zero(@Param("flowCardId") String flowCardId); |
| | | |
| | | |
| | | // @Select("SELECT * FROM down_workstation WHERE workstation_id BETWEEN #{startId} AND #{endId}") |
| | | // List<DownWorkstation> getDownWorkstationsInRange(@Param("startId") int startId, @Param("endId") int endId); |
| | | |
| | | |
| | | // @Select("SELECT DISTINCT flowcard_id from glass_info") |
| | | // @ResultType(Map.class) |
| | | // List<Map<String, Object>> getflowCardId(); |
| | | |
| | | // @Update("UPDATE down_workstation SET flow_card_id = NULL, total_quantity = 0, racks_number = 0 WHERE workstation_id = #{workstationId}") |
| | | // void clearFlowCardInfoByWorkstationId(@Param("workstationId") int workstationId); |
| | | |
| | | // 获取总数量 |
| | | // @Select("SELECT total_quantity FROM down_workstation WHERE workstation_id = #{workstationId}") |
| | | // int getTotalQuantity(@Param("workstationId") int workstationId); |
| | | |
| | | // 获取落架数量 |
| | | // @Select("SELECT racks_number FROM down_workstation WHERE workstation_id = #{workstationId}") |
| | | // int getRacksNumber(@Param("workstationId") int workstationId); |
| | | |
| | | } |
| | |
| | | package com.mes.downworkstation.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.entity.DownWorkstationTask; |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | @DS("salve_hangzhoumes") |
| | | public interface DownWorkstationTaskMapper extends BaseMapper<DownWorkstationTask> { |
| | | |
| | | List<DownWorkstationTask> selectList(); |
| | |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | |
| | | int updateFlowCardIdAndCount(String flowCardId, int glassInfoCount, int workstationId); |
| | | |
| | | |
| | | void insertdownglassinfo(); |
| | | List<Map<String, Object>> getTotalGlassDimensionsByWorkstation(); |
| | | } |
| | |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downworkstation.entity.DownWorkstationTask; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | |
| | | void insertdownWorkstationtask(DownGlassInfo downGlassInfo); |
| | | |
| | | void updateTaskStateToZero(long Id); |
| | | |
| | | List<DownWorkstationTask> getTaskState(); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downglassinfo.mapper.DownGlassInfoMapper; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.downglassinfo.service.DownGlassTaskService; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.entity.DownWorkstationTask; |
| | | import com.mes.downworkstation.entity.DownWorkstionAndDownGlassinfo; |
| | | import com.mes.downworkstation.mapper.DownWorkstationMapper; |
| | | import com.mes.downworkstation.mapper.DownWorkstationTaskMapper; |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import com.mes.downworkstation.service.DownWorkstationTaskService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class DownWorkstationServiceImpl extends ServiceImpl<DownWorkstationMapper, DownWorkstation> implements DownWorkstationService { |
| | | |
| | | @Autowired |
| | | private DownWorkstationMapper downWorkstationMapper; |
| | | @Autowired |
| | | private DownWorkstationTaskMapper downWorkstationTaskMapper; |
| | | @Autowired |
| | | private DownGlassInfoService downGlassInfoService; |
| | | @Autowired |
| | | private DownGlassInfoMapper downGlassInfoMapper; |
| | | @Autowired |
| | | private DownGlassTaskService downGlassTaskService; |
| | | |
| | | |
| | | @Autowired |
| | | private DownWorkstationTaskService downWorkstationTaskService; |
| | | |
| | | // @Override |
| | | // @Override |
| | | // public List<DownWorkstation> gettwoDownWorkstations() { |
| | | // return downWorkstationMapper.getDownWorkstationsInRange(6,10); |
| | | // } |
| | |
| | | return result != null ? result.getTotalquantity() : 0; |
| | | } |
| | | |
| | | //工位显示 |
| | | @Override |
| | | public List<Map<String, Object>> getTotalGlassDimensionsByWorkstation() { |
| | | MPJQueryWrapper<DownWorkstionAndDownGlassinfo> queryWrapper = new MPJQueryWrapper<>(); |
| | | queryWrapper.select("t.workstation_id", "t.flow_card_id", "COALESCE(SUM(b.width), 0) AS totalwidth", "COALESCE(SUM(b.height), 0) AS totalheight") |
| | | .leftJoin("down_glass_info b on t.flow_card_id = b.flow_card_id") |
| | | .groupBy("t.workstation_id", "t.flow_card_id"); |
| | | |
| | | // List<DownWorkstionAndDownGlassinfo> workstationList = downWorkstationMapper.selectJoinList(DownWorkstionAndDownGlassinfo.class, queryWrapper); |
| | | List<DownWorkstionAndDownGlassinfo> workstationList = null; |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (DownWorkstionAndDownGlassinfo downWorkstionAndDownGlassinfo : workstationList) { |
| | | Map<String, Object> rack = new HashMap<>(); |
| | | |
| | | // 创建子项(item)对象 |
| | | Map<String, Object> item = new HashMap<>(); |
| | | item.put("height", downWorkstionAndDownGlassinfo.getTotalheight()); // 设置子项高度,根据实际情况设置 |
| | | item.put("width", downWorkstionAndDownGlassinfo.getTotalwidth()); // 设置子项宽度,根据实际情况设置 |
| | | item.put("fillColor", "yellow"); // 设置子项颜色 |
| | | item.put("content", downWorkstionAndDownGlassinfo.getFlowCardId()); // 使用流程卡号作为子项内容 |
| | | |
| | | rack.put("item", item); // 将子项对象放入货架对象中 |
| | | |
| | | result.add(rack); // 将货架对象添加到结果列表中 |
| | | //log.info("货架对象: {}", rack); |
| | | } |
| | | |
| | | return result; // 返回最终结果 |
| | | } |
| | | |
| | | |
| | | // @Override |
| | | // public int getTotalQuantity(int workstationId) { |
| | | // Integer totalQuantity = downWorkstationMapper.getTotalQuantity(workstationId); |
| | | // return totalQuantity != null ? totalQuantity : 0; |
| | | // } |
| | | |
| | | // @Override |
| | | // @Override |
| | | // public int getRacksNumber(int workstationId) { |
| | | // Integer racksNumber = downWorkstationMapper.getRacksNumber(workstationId); |
| | | // return racksNumber != null ? racksNumber : 0; |
| | |
| | | DownWorkstation result = baseMapper.selectOne(queryWrapper); |
| | | return result != null ? result.getRacksnumber() : 0; |
| | | } |
| | | //根据条件获取工位玻璃信息 |
| | | |
| | | //根据条件获取工位玻璃信息 |
| | | @Override |
| | | public List<DownWorkstation> getoneDownWorkstations(int startId, int endId) { |
| | | QueryWrapper<DownWorkstation> queryWrapper = new QueryWrapper<>(); |
| | |
| | | @Override |
| | | public void updateracksnumber(String flowCardId, int racksNumber) { |
| | | UpdateWrapper<DownWorkstation> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.set("racks_number",racksNumber).eq("flow_card_id", flowCardId); |
| | | updateWrapper.set("racks_number", racksNumber).eq("flow_card_id", flowCardId); |
| | | baseMapper.update(null, updateWrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | |
| | | public DownWorkstation selectByFlowCardId(String flowcardid) { |
| | | QueryWrapper<DownWorkstation> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("flow_card_id", flowcardid); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | return baseMapper.selectOne(queryWrapper); |
| | | } |
| | | |
| | | |
| | | @Transactional |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void insertdownglassinfo() { |
| | | |
| | | |
| | | List<DownGlassTask> taskdownGlassInf = downGlassTaskService.getUnloadingTaskState(); |
| | | // |
| | | |
| | | |
| | | if (taskdownGlassInf != null && !taskdownGlassInf.isEmpty()) { |
| | | |
| | | // |
| | | |
| | | for (DownGlassTask downGlassInfo : taskdownGlassInf) { |
| | | // 创建新的 DownGlassInfo 对象并设置相关属性 |
| | | DownGlassInfo newdownGlassInfo = new DownGlassInfo(); |
| | | |
| | | newdownGlassInfo.setFlowCardId(downGlassInfo.getFlowCardId()); |
| | | Integer maxSequence = downGlassInfoService.getMaxSequenceByFlowCardId(downGlassInfo.getFlowCardId()); |
| | | // 初始化顺序字段值 |
| | | int sequence = maxSequence != null ? maxSequence + 1 : 1; |
| | | // newdownGlassInfo.setId(downGlassInfo.getId()); |
| | | newdownGlassInfo.setWidth(downGlassInfo.getWidth()); |
| | | newdownGlassInfo.setHeight(downGlassInfo.getHeight()); |
| | | newdownGlassInfo.setThickness(downGlassInfo.getThickness()); |
| | | newdownGlassInfo.setFilmsid(downGlassInfo.getFilmsid()); |
| | | // 设置顺序字段值 |
| | | newdownGlassInfo.setSequence(sequence); |
| | | |
| | | // 插入数据到下片玻璃信息表 |
| | | downGlassInfoService.insertDownGlassInfo(newdownGlassInfo); |
| | | //插入数据到机械手任务表 |
| | | |
| | | downWorkstationTaskService.insertdownWorkstationtask(newdownGlassInfo); |
| | | //更新下片任务表状态为0 |
| | | downGlassTaskService.updateTaskStateToZero(downGlassInfo.getId()); |
| | | //删除下片任务表中的记录 |
| | | downGlassTaskService.deleteTask(downGlassInfo.getFlowCardId()); |
| | | |
| | | sequence++; // 递增顺序字段值 |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | try { |
| | | //查询下片工位表中架子是否绑定了流程卡号 工位表和任务表中状态为1的流程卡号和已落架数量 |
| | | List<DownWorkstationTask> taskdownWorkstation = downWorkstationTaskService.getTaskState(); |
| | | if (taskdownWorkstation != null && !taskdownWorkstation.isEmpty()) { |
| | | //,如果已经绑定则更新已落架数量,并且删除下片任务表中的记录 |
| | | for (DownWorkstationTask downWorkstation : taskdownWorkstation) { |
| | | //更新下片工位表中已落架数量 |
| | | DownWorkstation downWorkstation1 = selectByFlowCardId(downWorkstation.getFlowCardId()); |
| | | updateracksnumber(downWorkstation.getFlowCardId(), downWorkstation1.getRacksnumber() + 1); |
| | | //更新机械任务表中状态为0 |
| | | downWorkstationTaskService.updateTaskStateToZero(downWorkstation.getId()); |
| | | //删除机械任务表 |
| | | downWorkstationTaskService.removeById(downWorkstation.getId()); |
| | | |
| | | |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | // 打印异常信息 |
| | | e.printStackTrace(); |
| | | // 或者可以进行其他异常处理,比如记录日志或者返回特定的错误信息 |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.downworkstation.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downworkstation.entity.DownWorkstationTask; |
| | | import com.mes.downworkstation.mapper.DownWorkstationTaskMapper; |
| | | import com.mes.downworkstation.service.DownWorkstationTaskService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | public void insertdownWorkstationtask(DownGlassInfo downGlassInfo) { |
| | | DownWorkstationTask entity = new DownWorkstationTask(); |
| | | // 查询当前最大的 id 值 |
| | | Long maxId = getMaxId(); |
| | | // 如果没有记录,则将 id 设置为 1;否则,将 id 设置为当前最大 id 值加 1 |
| | | Long newId = (maxId == null) ? 1 : maxId + 1; |
| | | |
| | | entity.setId(newId); // 设置手动递增的 id |
| | | entity.setFlowCardId(downGlassInfo.getFlowCardId()); |
| | | entity.setWidth(downGlassInfo.getWidth()); |
| | | entity.setHeight(downGlassInfo.getHeight()); |
| | |
| | | baseMapper.insert(entity); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // 查询最大的 ID |
| | | private Long getMaxId() { |
| | | QueryWrapper<DownWorkstationTask> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("MAX(id) as max_id"); |
| | | List<Object> list = baseMapper.selectObjs(wrapper); |
| | | if (list != null && !list.isEmpty()) { |
| | | Object obj = list.get(0); |
| | | if (obj != null) { |
| | | return Long.parseLong(obj.toString()); |
| | | } |
| | | } |
| | | // 如果没有查询到结果,则返回 0 |
| | | return 0L; |
| | | } |
| | | @Override |
| | | public List<DownWorkstationTask> getTaskState() { |
| | | QueryWrapper<DownWorkstationTask> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("state", 1); |
| | | return baseMapper.selectList(queryWrapper); |
| | | } |
| | | @Override |
| | | public void updateTaskStateToZero(long id) { |
| | | UpdateWrapper<DownWorkstationTask> updateWrapper = new UpdateWrapper<>(); |
| | |
| | | package com.mes.glassinfo.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | |
| | | /** |
| | | * 流程卡 |
| | | */ |
| | | @TableField("flow_card_Id") |
| | | private String flowcardId; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 工程号 |
| | | */ |
| | | private Integer engineerId; |
| | | private String engineerId; |
| | | |
| | | /** |
| | | * 生产规则id |
| | | */ |
| | | private Integer ruleId; |
| | | |
| | | |
| | | /** |
| | | * 玻璃id |
| | | */ |
| | | private String glassId; |
| | | } |
| | |
| | | public interface GlassInfoMapper extends BaseMapper<GlassInfo> { |
| | | |
| | | |
| | | // @Select("SELECT COUNT(*) FROM glass_info WHERE flowcard_id = #{flowCardId}") |
| | | // int getGlassInfoCountByFlowCardId(@Param("flowCardId") String flowCardId); |
| | | |
| | | // @Update("UPDATE down_workstation SET total_quantity = #{glassInfoCount},flow_card_id=#{flowCardId} WHERE workstation_id = #{workstationId}") |
| | | // int updateFlowCardIdAndCount(@Param("flowCardId") String flowCardId, @Param("glassInfoCount") int glassInfoCount,@Param("workstationId")int workstationId); |
| | | |
| | | } |
| | |
| | | @Override |
| | | public int getGlassInfoCountByFlowCardId(String flowCardId) { |
| | | QueryWrapper<GlassInfo> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("flowcard_id", flowCardId); |
| | | queryWrapper.eq("flow_card_id", flowCardId); |
| | | |
| | | return baseMapper.selectCount(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getFlowCardId() { |
| | | return baseMapper.selectMaps(new QueryWrapper<GlassInfo>().select("DISTINCT flowcard_id")); |
| | | return baseMapper.selectMaps(new QueryWrapper<GlassInfo>().select("DISTINCT flow_card_id")); |
| | | } |
| | | |
| | | |
| | |
| | | @Override |
| | | public GlassInfo selectGlassId(String id) { |
| | | QueryWrapper<GlassInfo> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("id", id); |
| | | queryWrapper.eq("glass_id", id); |
| | | |
| | | return baseMapper.selectOne(queryWrapper); |
| | | } |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: 123456 |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://192.168.56.10:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: root |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://192.168.56.10:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: 123456 |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://10.153.19.150: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 |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 10.153.19.150:8848 |
| | | redis: |
| | | database: 0 |
| | | host: 10.153.19.150 |
| | | port: 6379 |
| | | password: 123456 |
| | |
| | | port: 8085 |
| | | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://10.153.19.150: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 |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 10.153.19.150:8848 |
| | | profiles: |
| | | active: prod |
| | | application: |
| | | name: unLoadGlass |
| | | redis: |
| | | database: 0 |
| | | host: 10.153.19.150 |
| | | port: 6379 |
| | | password: 123456 |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | configuration: |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration scan="true" scanPeriod="10 seconds"> |
| | | <!-- logger上下文名称(根据业务修改) --> |
| | | <contextName>unLoadGlass</contextName> |
| | | |
| | | <!-- 定义了一个名为serverName的属性,它的值来自于logging.file.name,如果没有找到该属性默认为MyServerName(根据业务修改) --> |
| | | <springProperty name="serverName" source="logging.file.name" defaultValue="unLoadGlass"/> |
| | | <springProperty name="logging.path" source="logging.file.path" defaultValue="././logs/"/> |
| | | |
| | | <!-- 彩色日志依赖的渲染类 --> |
| | | <!-- 定义了一个名为clr的转换规则,它使用org.springframework.boot.logging.logback.ColorConverter类进行转换,这个元素通常用于将日志输出中的文本着色,以便更容易地区分不同的日志级别或其他信息 --> |
| | | <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/> |
| | | <!-- WhitespaceThrowableProxyConverter和ExtendedWhitespaceThrowableProxyConverter都是用于将异常信息转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示的类。它们之间的区别在于,ExtendedWhitespaceThrowableProxyConverter在输出异常信息时会包含更多的详细信息,例如异常的类名、方法名和行号等 --> |
| | | <!-- 定义了一个名为wex的转换规则,它使用org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter类进行转换,这个元素通常用于将异常信息转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示 --> |
| | | <conversionRule conversionWord="wex" |
| | | converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/> |
| | | <!-- 定义了一个名为wEx的转换规则,它使用org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter类进行转换,这个元素通常用于将异常信息转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示 --> |
| | | <conversionRule conversionWord="wEx" |
| | | converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/> |
| | | |
| | | <!-- 彩色日志格式 --> |
| | | <!-- value值是日志输出模板, :-是属性名和其默认值之间的分隔符,作用与:相同 --> |
| | | <!-- 定义日志输出格式的转换规则,%d{yyyy-MM-dd HH:mm:ss.SSS}表示日期和时间,%clr表示将输出文本着色,{faint}表示使用淡色 --> |
| | | <!-- %5p表示日志级别输出右对齐,左边以空格填充 --> |
| | | <!-- ${PID:- }表示进程ID,%clr表示将输出文本着色,{magenta}表示使用洋红色 --> |
| | | <!-- 表示一个分隔符 --> |
| | | <!-- %t:显示产生该日志的线程名;%15:若字符长度小于15,则左边用空格填充;%.15:若字符长度超过15,截去多余字符 --> |
| | | <!-- %-40:若字符长度小于40,则右边用空格填充;%.40:若字符长度超过40,截去多余字符;logger{39}对应的是“logging.WARNING”级别。具体来说,Python的logging模块定义了以下几个级别(从低到高):NOTSET、DEBUG、INFO、WARNING、ERROR、CRITICAL。因此,logger{39}表示的是WARNING级别,即日志记录器会记录所有WARNING级别及以上的日志信息 --> |
| | | <!-- %m表示日志消息;%n表示换行符;${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}表示异常信息。如果日志输出中包含异常信息,这个规则将会将其转换为字符串,并将其中的换行符替换为空格,以便更容易地在日志输出中显示 --> |
| | | <property name="CONSOLE_LOG_PATTERN" |
| | | value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
| | | |
| | | <!--1. 输出到控制台--> |
| | | <!-- 定义控制台日志输出的appender,class="ch.qos.logback.core.ConsoleAppender"表示使用Logback框架提供的ConsoleAppender类来输出日志到控制台 --> |
| | | <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
| | | <!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息--> |
| | | <!-- 定义日志输出级别的过滤器,class="ch.qos.logback.classic.filter.ThresholdFilter"表示使用Logback框架提供的ThresholdFilter类来过滤日志输出,<level>debug</level>表示只输出debug级别及以上的日志 --> |
| | | <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
| | | <level>debug</level> |
| | | </filter> |
| | | <encoder> |
| | | <!-- ${CONSOLE_LOG_PATTERN}表示控制台日志输出格式,UTF-8表示编码格式 --> |
| | | <Pattern>${CONSOLE_LOG_PATTERN}</Pattern> |
| | | <!-- 设置字符集 --> |
| | | <charset>UTF-8</charset> |
| | | </encoder> |
| | | </appender> |
| | | <!--2. 输出到文档--> |
| | | <!-- 2.1 level为 DEBUG 日志,时间滚动输出 --> |
| | | <!-- 定义文件日志输出的appender,class="ch.qos.logback.core.rolling.RollingFileAppender"表示使用Logback框架提供的RollingFileAppender类来输出日志到文件 --> |
| | | <appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_debug.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> <!-- 设置字符集 --> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <!-- 定义日志文件滚动策略的标签,class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"表示使用Logback框架提供的TimeBasedRollingPolicy类来定义日志文件的滚动策略 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 日志归档 --> |
| | | <!-- 定义日志文件名的模式。在这个模式中,${logging.path}表示日志文件的路径,%d{yyyy-MM-dd}表示日期格式,%i表示文件索引 --> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <!-- 定义日志文件滚动策略的标签,class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"表示使用Logback框架提供的SizeAndTimeBasedFNATP类来定义日志文件的滚动策略,<maxFileSize>100MB</maxFileSize>表示日志文件的最大大小为100MB。这个滚动策略通常用于按照时间和文件大小滚动日志文件,以便更好地管理日志文件的大小和数量 --> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录debug级别的 --> |
| | | <!-- 定义日志输出级别的过滤器。在这个过滤器中,class="ch.qos.logback.classic.filter.LevelFilter"表示使用Logback框架提供的LevelFilter类来过滤日志输出,<level>debug</level>表示只输出debug级别及以上的日志 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>debug</level> |
| | | <!-- <onMatch>ACCEPT</onMatch>表示如果日志事件与过滤器匹配,则接受该事件,<onMismatch>DENY</onMismatch>表示如果日志事件与过滤器不匹配,则拒绝该事件 --> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 2.2 level为 INFO 日志,时间滚动输出 --> |
| | | <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_info.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 天天日志归档路径以及格式 --> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录info级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>info</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 2.3 level为 WARN 日志,时间滚动输出 --> |
| | | <appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_warn.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> <!-- 此处设置字符集 --> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录warn级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>warn</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 2.4 level为 ERROR 日志,时间滚动输出 --> |
| | | <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${logging.path}/${serverName}/web_error.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> <!-- 此处设置字符集 --> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <fileNamePattern>${logging.path}/${serverName}/web-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录ERROR级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>ERROR</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!-- 4.1 开发环境:打印控制台--> |
| | | <!-- 用于在Spring Boot应用程序中配置日志记录的标签。在这个标签中,name="dev"表示这个配置文件只在dev环境中生效,<logger name="com.myClass.controller" level="debug"/>表示为com.myClass.controller(根据业务修改)这个包下的类配置日志输出级别为debug --> |
| | | <!-- <springProfile name="dev">--> |
| | | <!-- <logger name="com.myClass.controller" level="debug"/>--> |
| | | <!-- </springProfile>--> |
| | | <!-- 用于配置日志输出的标签。在这个标签中,level="info"表示日志输出级别为info,<appender-ref ref="CONSOLE"/>、<appender-ref ref="DEBUG_FILE"/>、<appender-ref ref="INFO_FILE"/>、<appender-ref ref="WARN_FILE"/>、<appender-ref ref="ERROR_FILE"/>表示将日志输出到不同的appender中,分别为控制台、debug文件、info文件、warn文件和error文件 --> |
| | | <root level="info"> |
| | | <appender-ref ref="CONSOLE"/> |
| | | <appender-ref ref="DEBUG_FILE"/> |
| | | <appender-ref ref="INFO_FILE"/> |
| | | <appender-ref ref="WARN_FILE"/> |
| | | <appender-ref ref="ERROR_FILE"/> |
| | | </root> |
| | | </configuration> |
New file |
| | |
| | | package com.mes; |
| | | |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downglassinfo.mapper.DownGlassTaskMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/3/27 16:37 |
| | | * @Description: |
| | | */ |
| | | @Slf4j |
| | | @RunWith(SpringRunner.class) |
| | | @SpringBootTest(classes = UnLoadGlassApplication.class) |
| | | public class UnLoadGlassApplicationTest { |
| | | |
| | | @Autowired |
| | | DownGlassTaskMapper downGlassTaskMapper; |
| | | |
| | | @Test |
| | | public void testFindPath() { |
| | | log.info("完整路径:{}", Arrays.asList("123")); |
| | | } |
| | | |
| | | @Test |
| | | public void testCacheGlass() { |
| | | DownGlassTask glassTask = new DownGlassTask(); |
| | | glassTask.setId(1L); |
| | | glassTask.setTaskType("1"); |
| | | glassTask.setHeight(100.01); |
| | | glassTask.setWidth(200.02); |
| | | int i = downGlassTaskMapper.insert(glassTask); |
| | | log.info("插入结果:{}", i); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.mes.UnLoadGlassApplication; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.service.DownStorageCageDetailsService; |
| | | import com.mes.downstorage.service.impl.DownStorageCageDetailsServiceImpl; |
| | | import com.mes.downstorage.service.impl.DownStorageCageServiceImpl; |
| | | |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import com.mes.downworkstation.service.impl.DownWorkstationServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | |
| | | |
| | | @Autowired |
| | | DownStorageCageServiceImpl downStorageCageServiceImpl; |
| | | @Autowired |
| | | DownStorageCageDetailsServiceImpl downStorageCageDetailsServiceImpl; |
| | | @Autowired |
| | | DownStorageCageDetailsService downStorageCageDetailsService; |
| | | @Autowired |
| | | DownWorkstationServiceImpl downWorkstationServiceImpl; |
| | | |
| | | @Test |
| | | public void testFindPath() { |
| | |
| | | |
| | | @Test |
| | | public void testCacheGlass() { |
| | | List<Map> map= downStorageCageServiceImpl.getCacheInfo(); |
| | | List<Map> map = downStorageCageDetailsServiceImpl.getCacheInfo(); |
| | | log.info("笼内信息:{}", Arrays.asList(map)); |
| | | } |
| | | |
| | | @Test |
| | | public void testselectCacheEmpty() { |
| | | List<DownStorageCageDetails> map= downStorageCageServiceImpl.getCacheLeisure(); |
| | | List<DownStorageCageDetails> map = downStorageCageDetailsServiceImpl.getCacheLeisure(); |
| | | log.info("笼内空格:{}", Arrays.asList(map)); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void testgetCacheOut() { |
| | | List<DownStorageCageDetails> map= downStorageCageServiceImpl.getCacheOut(1,5); |
| | | List<DownStorageCageDetails> map = downStorageCageDetailsServiceImpl.getCacheOut(1, 5); |
| | | log.info("根据传入的工位查询符合按照顺序和大小出片的小片:{}", Arrays.asList(map)); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Test |
| | | public void testupdateFlowCardIdAndCount() { |
| | | log.info("绑定流程卡号和数量"); |
| | | downWorkstationServiceImpl.updateFlowCardIdAndCount("1", 1, 1); |
| | | |
| | | } |
| | | |
| | | @Test |
| | | public void testplc() { |
| | | log.info("测试"); |
| | | downWorkstationServiceImpl.insertdownglassinfo(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | @Test |
| | | public void testin2() { |
| | | log.info("测试进片"); |
| | | downStorageCageDetailsServiceImpl.getIsExistIntoCacheByflowcardid("NG2023005",500); |
| | | |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void selectCacheEmpty() { |
| | | log.info("测试进片"); |
| | | downStorageCageDetailsServiceImpl.getCacheLeisure(); |
| | | |
| | | } |
| | | |
| | | @Test |
| | | public void CacheEmpty() { |
| | | log.info("测试出片"); |
| | | downStorageCageDetailsService.CacheOut(1,10); |
| | | |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void getTotalGlassDimensionsByWorkstation() { |
| | | log.info("工位显示"); |
| | | downWorkstationServiceImpl.getTotalGlassDimensionsByWorkstation(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | </dependency> |
| | | |
| | | <!--开发者工具--> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-devtools</artifactId> |
| | | <optional>true</optional> |
| | | </dependency> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.springframework.boot</groupId>--> |
| | | <!-- <artifactId>spring-boot-devtools</artifactId>--> |
| | | <!-- <optional>true</optional>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |