Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
# Conflicts:
# hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/test/java/com/mes/CacheVerticalGlassModuleApplicationTest.java
| | |
| | | { |
| | | "plcAddressBegin":"DB.0", |
| | | "plcAddressLenght":"72", |
| | | "plcAddressBegin": "DB14.0", |
| | | "plcAddressLenght": "938", |
| | | "dataType":"word", |
| | | "parameteInfor":[ |
| | | { |
| | | "codeId": "D01Request", |
| | | "parameteInfor": [{ |
| | | "codeId": "D01ID", |
| | | "addressIndex":"0", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "D01ID1", |
| | | "addressIndex":"2", |
| | | "addressLenght":"6", |
| | | "addressLenght": "32", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D04Request", |
| | | "addressIndex":"8", |
| | | "codeId": "D02ID", |
| | | "addressIndex": "32", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID1", |
| | | "addressIndex": "64", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID2", |
| | | "addressIndex": "96", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID3", |
| | | "addressIndex": "128", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID4", |
| | | "addressIndex": "160", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID5", |
| | | "addressIndex": "192", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID6", |
| | | "addressIndex": "224", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D04ID", |
| | | "addressIndex": "256", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID1", |
| | | "addressIndex": "288", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID2", |
| | | "addressIndex": "328", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID3", |
| | | "addressIndex": "352", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID4", |
| | | "addressIndex": "384", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID5", |
| | | "addressIndex": "416", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID6", |
| | | "addressIndex": "448", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID1", |
| | | "addressIndex": "480", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID2", |
| | | "addressIndex": "512", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID3", |
| | | "addressIndex": "544", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID4", |
| | | "addressIndex": "576", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID5", |
| | | "addressIndex": "608", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID6", |
| | | "addressIndex": "640", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID1", |
| | | "addressIndex": "672", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID2", |
| | | "addressIndex": "704", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID3", |
| | | "addressIndex": "736", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID4", |
| | | "addressIndex": "768", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID5", |
| | | "addressIndex": "800", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID6", |
| | | "addressIndex": "832", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ToMES", |
| | | "addressIndex": "874", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D04ID1", |
| | | "addressIndex":"10", |
| | | "addressLenght":"6", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D02Go", |
| | | "addressIndex":"20", |
| | | "codeId": "D05ToMES", |
| | | "addressIndex": "876", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D05Go", |
| | | "addressIndex":"22", |
| | | "codeId": "D01ToMES", |
| | | "addressIndex": "878", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | } |
| | | , |
| | | }, |
| | | { |
| | | "codeId": "DeviceStatus", |
| | | "addressIndex":"70", |
| | | "codeId": "D04ToMES", |
| | | "addressIndex": "880", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "MESToD03", |
| | | "addressIndex": "888", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "MESToD05", |
| | | "addressIndex": "890", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "MESToPLC", |
| | | "addressIndex": "892", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport1", |
| | | "addressIndex": "914", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport2", |
| | | "addressIndex": "916", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport3", |
| | | "addressIndex": "918", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport4", |
| | | "addressIndex": "920", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport5", |
| | | "addressIndex": "922", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport6", |
| | | "addressIndex": "924", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport1", |
| | | "addressIndex": "926", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport2", |
| | | "addressIndex": "928", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport3", |
| | | "addressIndex": "930", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport4", |
| | | "addressIndex": "932", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport5", |
| | | "addressIndex": "934", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport6", |
| | | "addressIndex": "936", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "deviceState", |
| | | "addressIndex": "864", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01State", |
| | | "addressIndex": "866", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02State", |
| | | "addressIndex": "868", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03State", |
| | | "addressIndex": "870", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05State", |
| | | "addressIndex": "872", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "MESToD01", |
| | | "addressIndex": "894", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "MESToD04", |
| | | "addressIndex": "896", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | |
| | | deusername:'是否删除该用户?', |
| | | }, |
| | | customer:{ |
| | | addmenu:'添加菜单', |
| | | addmenua:'添加二级菜单', |
| | | addmenu:'添加一级菜单', |
| | | firstmenu:'一级菜单栏', |
| | | firstmenuname:'一级菜单名称:', |
| | | link:'链接', |
| | | inlink:'请输入链接', |
| | | linka:'链接:', |
| | |
| | | exit:'编辑', |
| | | delete:'删除', |
| | | semenu:'二级菜单栏', |
| | | semenuname:'二级菜单名称:', |
| | | menu:'菜单栏:', |
| | | inmenu:'请输入菜单栏', |
| | | inmenu:'请输入菜单名称', |
| | | sure:'确认', |
| | | cancel:'取消', |
| | | exmene:'修改菜单', |
| | | exmene:'修改一级菜单', |
| | | exmenea:'修改二级菜单', |
| | | yes:'是', |
| | | demenu:'是否删除该菜单?', |
| | | prompt:'提示', |
| | |
| | | cancel :'取消', |
| | | derole :'是否删除该角色', |
| | | prompt:'提示', |
| | | choice:'菜单权限:', |
| | | inchoice:'请选择菜单权限', |
| | | }, |
| | | replenish:{ |
| | | patchManagement:'补片管理', |
| | |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | // 用户点击了“是”,现在调用删除接口 |
| | | var url="/unLoadGlass/downStorage/deleteDownStorageCage?edgStorageCageId="+row.id; |
| | | var url="/unLoadGlass/downStorage/deleteDownStorageCage?downStorageCageId="+row.id; |
| | | console.log(url); |
| | | const response = await request.post(url, { |
| | | esdId: row.esdId |
| | |
| | | } else if (currentPage.value === 3) { |
| | | return 21; |
| | | } else if (currentPage.value === 4) { |
| | | return 21; |
| | | return 20; |
| | | } else if (currentPage.value === 5) { |
| | | return 21; |
| | | } else if (currentPage.value === 6) { |
| | | return 21; |
| | | return 25; |
| | | } else if (currentPage.value === 7) { |
| | | return 21; |
| | | return 51; |
| | | } else if (currentPage.value === 8) { |
| | | return 25; |
| | | } else { |
| | | return 21; // 默认值,可以根据实际需求修改 |
| | | return 25; // 默认值,可以根据实际需求修改 |
| | | } |
| | | }); |
| | | |
| | |
| | | } else if (i === 3) { |
| | | index += 21; |
| | | }else if (i === 4) { |
| | | index += 21; |
| | | index += 20; |
| | | }else if (i === 5) { |
| | | index += 21; |
| | | }else if (i === 6) { |
| | | index += 21; |
| | | index += 25; |
| | | }else if (i === 7) { |
| | | index += 21; |
| | | index += 51; |
| | | }else if (i === 8) { |
| | | index += 25; |
| | | } else { |
| | | index += 31; |
| | | index += 25; |
| | | } |
| | | } |
| | | return index; |
| | |
| | | // total += 10; |
| | | // } |
| | | // } |
| | | return 8; |
| | | return 9; |
| | | }); |
| | | |
| | | |
| | |
| | | const router = useRouter() |
| | | const add = ref(false) |
| | | const adda = ref(false) |
| | | const addc = ref(false) |
| | | const addb = ref(false) |
| | | |
| | | import { useI18n } from 'vue-i18n' |
| | | const { t } = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | const editingUser = ref({}); // 用于存储当前编辑的用户数据 |
| | | import request from "@/utils/request" |
| | | import { ref, onMounted } from "vue"; |
| | | // import { ref } from 'vue' |
| | |
| | | const selectedProjectNoa = ref(''); // 当前选中的角色 |
| | | // const options = ref<any[]>([]); // 下拉选项列表 |
| | | const menuName = ref(''); |
| | | const parentId = ref(''); |
| | | const listSort = ref(''); |
| | | const url = ref(''); |
| | | const currentRow = reactive({}); // 当前行的数据 |
| | | const tableData = ref([]) |
| | | const slot = ref('') |
| | | request.get("/loadGlass/sys/menu/nav").then((res) => { |
| | |
| | | const response = await request.post('/loadGlass/sys/role/queryRole',{ |
| | | key: '' |
| | | }); |
| | | if (response.code == 200) { |
| | | if (response.code === 200) { |
| | | titleSelectJsona.value.processTypea = response.data; |
| | | console.log(response.data); |
| | | |
| | |
| | | console.error('Error fetching options:', error); |
| | | } |
| | | }; |
| | | // 添加 |
| | | const handleBindRack = (row) => { |
| | | // selectedRow.value = row; // 更新选中的行数据 |
| | | currentRow.menuName = row.menuName; // 直接设置响应式属性 |
| | | currentRow.id = row.id; // 直接设置响应式属性 |
| | | // currentRow.slot = row.slot; |
| | | // window.localStorage.setItem('deviceId', row.deviceId) |
| | | // window.localStorage.setItem('slot', row.slot) |
| | | addb.value = true; // 打开绑定架子对话框 |
| | | }; |
| | | // 添加一级菜单 |
| | | const getTableRow = async () => { |
| | | try { |
| | | const response = await request.post('/loadGlass/sys/menu/save', { |
| | | menuName: menuName.value, |
| | | parentId: parentId.value, |
| | | listSort: listSort.value, |
| | | url: url.value, |
| | | }); |
| | | |
| | | if (response.code == 200) { |
| | | if (response.code === 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | add.value = false; |
| | | // tableData.value = response.data; |
| | | tableData.value = response.data; |
| | | menuName.value = ''; |
| | | listSort.value = ''; |
| | | url.value = ''; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | }; |
| | | // 添加二级菜单 |
| | | const getTableRowb = async () => { |
| | | try { |
| | | const dataToSend = { |
| | | parentId: currentRow.id, |
| | | // menuName: currentRow.menuName, |
| | | // children: [ |
| | | // { |
| | | menuName: menuName.value, |
| | | listSort: listSort.value, |
| | | url: url.value, |
| | | // } |
| | | // ] |
| | | }; |
| | | const response = await request.post('/loadGlass/sys/menu/save',dataToSend ); |
| | | if (response.code === 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | addb.value = false; |
| | | tableData.value = response.data; |
| | | menuName.value = ''; |
| | | listSort.value = ''; |
| | | url.value = ''; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | |
| | | }; |
| | | // 处理编辑按钮点击 |
| | | function handleEdit(row) { |
| | | editingUser.value = { ...row }; // 使用展开运算符复制当前行数据 |
| | | listSort.value = row.listSort; |
| | | menuName.value = row.menuName; |
| | | url.value = row.url; |
| | | adda.value = true; // 显示对话框 |
| | | } |
| | | // 修改二级菜单 |
| | | function handleEditc(row) { |
| | | listSort.value = row.listSort; |
| | | menuName.value = row.menuName; |
| | | url.value = row.url; |
| | | addc.value = true; // 显示对话框 |
| | | } |
| | | // 编辑 |
| | | const getTableRowa = async () => { |
| | | try { |
| | | const response = await request.post('/loadGlass/sys/menu/updateMenu', { |
| | | parentId: currentRow.id, |
| | | menuName: menuName.value, |
| | | parentId: parentId.value, |
| | | listSort: listSort.value, |
| | | url: url.value, |
| | | }); |
| | | if (response.code == 200) { |
| | | if (response.code === 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | editingUser.value = {}; |
| | | adda.value = false; |
| | | tableData.value = response.data; |
| | | menuName.value = ''; |
| | | listSort.value = ''; |
| | | url.value = ''; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | }; |
| | | // 编辑二级菜单 |
| | | const getTableRowac = async () => { |
| | | try { |
| | | const response = await request.post('/loadGlass/sys/menu/updateMenu', { |
| | | menuName: menuName.value, |
| | | listSort: listSort.value, |
| | | url: url.value, |
| | | }); |
| | | if (response.code === 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | addc.value = false; |
| | | tableData.value = response.data; |
| | | menuName.value = ''; |
| | | listSort.value = ''; |
| | | url.value = ''; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | |
| | | > |
| | | <el-table-column prop="menuName" :label="$t('customer.semenu')" align="center" min-width="140" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"/> |
| | | <el-table-column prop="url" :label="$t('customer.link')" align="center" min-width="160"/> |
| | | <el-table-column prop="id" align="center" :label="$t('customer.sort')" min-width="140"/> |
| | | <el-table-column prop="listSort" align="center" :label="$t('customer.sort')" min-width="140"/> |
| | | <el-table-column fixed="right" :label="$t('customer.operate')" align="center"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="handleEdit(scope.row)">{{ $t('customer.exit') }}</el-button> |
| | | <el-button size="mini" type="text" plain @click="handleEditc(scope.row)">{{ $t('customer.exit') }}</el-button> |
| | | <el-button size="mini" type="text" plain @click="opena(scope.row)">{{ $t('customer.delete') }}</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="menuName" :label="$t('customer.firstmenu')" align="center" min-width="120" /> |
| | | <el-table-column prop="url" :label="$t('customer.link')" align="center" min-width="200"/> |
| | | <el-table-column prop="id" align="center" :label="$t('customer.sort')" min-width="180" /> |
| | | <el-table-column prop="listSort" align="center" :label="$t('customer.sort')" min-width="180" /> |
| | | <el-table-column fixed="right" :label="$t('customer.operate')" align="center" width="200"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="handleBindRack(scope.row)">{{ $t('customer.addmenua') }}</el-button> |
| | | <el-button size="mini" type="text" plain @click="handleEdit(scope.row)">{{ $t('customer.exit') }}</el-button> |
| | | <el-button size="mini" type="text" plain @click="opena(scope.row)">{{ $t('customer.delete') }}</el-button> |
| | | </template> |
| | |
| | | <el-dialog v-model="add" top="23vh" width="37%" :title="$t('customer.addmenu')"> |
| | | <div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form size="mini" label-width="150px"> |
| | | <el-form label-width="150px" label-position="right"> |
| | | <el-row style="margin-top: -15px;margin-bottom: -2px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('customer.firstmenuname')" :required="true" style="width: 25vw"> |
| | | <el-input v-model="menuName" autocomplete="off" :placeholder="$t('customer.inmenu')"/> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('customer.linka')" :required="true" style="width: 25vw"> |
| | | <el-input v-model="url" autocomplete="off" :placeholder="$t('customer.inlink')"/> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('customer.sorta')" :required="true" style="width: 25vw"> |
| | | <el-input v-model="listSort" autocomplete="off" :placeholder="$t('customer.insort')"/> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </el-form> |
| | | </div> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="getTableRow"> |
| | | {{ $t('customer.sure') }} |
| | | </el-button> |
| | | <el-button @click="add = false">{{ $t('customer.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="addb" top="23vh" width="37%" :title="$t('customer.addmenua')"> |
| | | <div style="margin-bottom: 20px"> |
| | | <el-form> |
| | | <el-row style="margin-top: -15px;margin-bottom: -2px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('customer.firstmenuname')" style="width: 22vw"> |
| | | <!-- {{ currentRow.menuName }} --> |
| | | <el-input disabled v-model="currentRow.menuName" autocomplete="off"></el-input> |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </div> |
| | | <div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form size="mini" label-width="150px"> |
| | | <el-form label-width="150px" label-position="right"> |
| | | <el-row style="margin-top: -15px;margin-bottom: -2px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('customer.semenuname')" :required="true" style="width: 25vw"> |
| | | <el-input v-model="menuName" autocomplete="off" :placeholder="$t('customer.inmenu')"/> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('customer.linka')" :required="true" style="width: 25vw"> |
| | | <el-input v-model="url" autocomplete="off" :placeholder="$t('customer.inlink')"/> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('customer.sorta')" :required="true" style="width: 25vw"> |
| | | <el-input v-model="listSort" autocomplete="off" :placeholder="$t('customer.insort')"/> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </el-form> |
| | | </div> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="getTableRowb"> |
| | | {{ $t('customer.sure') }} |
| | | </el-button> |
| | | <el-button @click="addb = false">{{ $t('customer.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="adda" top="23vh" width="37%" :title="$t('customer.exmene')"> |
| | | <div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form ref="formRef" size="mini" label-width="150px"> |
| | | <el-form label-width="100px" label-position="right"> |
| | | <el-row style="margin-top: -15px;margin-bottom: -2px;"> |
| | | <el-col :span="6"> |
| | |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('customer.sorta')" :required="true" style="width: 25vw"> |
| | | <el-input v-model="parentId" autocomplete="off" :placeholder="$t('customer.insort')"/> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </el-form> |
| | | </div> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="getTableRow"> |
| | | {{ $t('customer.sure') }} |
| | | </el-button> |
| | | <el-button @click="add = false">{{ $t('customer.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="adda" top="23vh" width="37%" :title="$t('customer.exmene')"> |
| | | <div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form :model="editingUser" ref="formRef" size="mini" label-width="150px"> |
| | | <el-form label-width="100px" label-position="right"> |
| | | <el-row style="margin-top: -15px;margin-bottom: -2px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('customer.menu')" :required="true" style="width: 25vw"> |
| | | <el-input v-model="editingUser.menuName" autocomplete="off" :placeholder="$t('customer.inmenu')"/> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('customer.linka')" :required="true" style="width: 25vw"> |
| | | <el-input v-model="editingUser.url" autocomplete="off" :placeholder="$t('customer.inlink')"/> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('customer.sorta')" :required="true" style="width: 25vw"> |
| | | <el-input v-model="editingUser.parentId" autocomplete="off" :placeholder="$t('customer.insort')"/> |
| | | <el-input v-model="listSort" autocomplete="off" :placeholder="$t('customer.insort')"/> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="addc" top="23vh" width="37%" :title="$t('customer.exmenea')"> |
| | | <div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form ref="formRef" size="mini" label-width="150px"> |
| | | <el-form label-width="100px" label-position="right"> |
| | | <el-row style="margin-top: -15px;margin-bottom: -2px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('customer.menu')" :required="true" style="width: 25vw"> |
| | | <el-input v-model="menuName" autocomplete="off" :placeholder="$t('customer.inmenu')"/> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('customer.linka')" :required="true" style="width: 25vw"> |
| | | <el-input v-model="url" autocomplete="off" :placeholder="$t('customer.inlink')"/> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('customer.sorta')" :required="true" style="width: 25vw"> |
| | | <el-input v-model="listSort" autocomplete="off" :placeholder="$t('customer.insort')"/> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </el-form> |
| | | </div> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="getTableRowac"> |
| | | {{ $t('customer.sure') }} |
| | | </el-button> |
| | | <el-button @click="addc = false">{{ $t('customer.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <style scoped> |
| | |
| | | const router = useRouter() |
| | | const add = ref(false) |
| | | const adda = ref(false) |
| | | const editingUser = ref({}); // 用于存储当前编辑的用户数据 |
| | | import request from "@/utils/request" |
| | | import { ref, onMounted } from "vue"; |
| | | // import { ref } from 'vue' |
| | |
| | | const selectedProjectNoa = ref(''); // 当前选中的角色 |
| | | // const options = ref<any[]>([]); // 下拉选项列表 |
| | | const name = ref(''); |
| | | |
| | | const tableData = ref([]) |
| | | const options = ref([]) |
| | | const selectedOptions = ref('') |
| | | // 定义级联选择器的属性 |
| | | const cascaderProps = { |
| | | value: 'id', |
| | | label: 'menuName', |
| | | multiple: true |
| | | }; |
| | | const slot = ref('') |
| | | |
| | | const titleSelectJsona = ref({ |
| | |
| | | }; |
| | | // 添加 |
| | | const getTableRow = async () => { |
| | | try { |
| | | const response = await request.post('/loadGlass/sys/role/saveRole', { |
| | | name: name.value, |
| | | }); |
| | | |
| | | const lastId = selectedOptions.value[selectedOptions.value.length - 1]; |
| | | // sendDataToServer(dataToSend); |
| | | console.log(selectedOptions.value[selectedOptions.value.length - 1]); |
| | | // 可以进一步处理,如发送请求等 |
| | | try { |
| | | const dataToSend = { |
| | | name: name.value, |
| | | // id: selectedOptions.value, |
| | | menuList: [lastId] |
| | | // [ |
| | | // { |
| | | // menuName: selectedOptions.value, |
| | | // selectedOptions.value, |
| | | // } |
| | | // ] |
| | | }; |
| | | const response = await request.post('/loadGlass/sys/role/saveRole', dataToSend); |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | add.value = false; |
| | | name.value = ''; |
| | | selectedOptions.value = ''; |
| | | fetchOptionsa() |
| | | // tableData.value = response.data; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | // 处理错误 |
| | |
| | | }; |
| | | // 处理编辑按钮点击 |
| | | function handleEdit(row) { |
| | | editingUser.value = { ...row }; // 使用展开运算符复制当前行数据 |
| | | name.value = row.name; |
| | | selectedOptions.value = row.selectedOptions; |
| | | adda.value = true; // 显示对话框 |
| | | window.localStorage.setItem('id', row.id) |
| | | } |
| | | // 编辑 |
| | | const getTableRowa = async () => { |
| | | let id = window.localStorage.getItem('id') |
| | | |
| | | try { |
| | | const response = await request.post('/loadGlass/sys/role/updateRole', { |
| | | id: id, |
| | | name: name.value, |
| | | |
| | | }); |
| | | |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | editingUser.value = {}; |
| | | adda.value = false; |
| | | name.value = ''; |
| | | selectedOptions.value = ''; |
| | | fetchOptionsa() |
| | | tableData.value = response.data; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | // 处理错误 |
| | |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | // 用户点击了“是”,现在调用删除接口 |
| | | const response = await request.post("/loadGlass/sys/role/delete", { |
| | | ids: row.id, |
| | | }) |
| | | const response = await request.post("/loadGlass/sys/role/delete",[row.id]) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | fetchOptionsa() |
| | | } else { |
| | | // 删除失败,您可以处理错误或显示错误信息给用户 |
| | | ElMessage.error(response.msg); |
| | | ElMessage.error(response.message); |
| | | // alert('删除失败:' + deleteResponse.message); |
| | | } |
| | | } |
| | |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | request.get("/loadGlass/sys/menu/nav").then((res) => { |
| | | if (res.code == 200) { |
| | | console.log(res.data); |
| | | options.value = res.data.tree |
| | | console.log( options.value); |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }); |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | <el-dialog v-model="add" top="23vh" width="37%" :title="$t('delivery.addrole')" > |
| | | <el-dialog v-model="add" top="23vh" width="37%" :title="$t('productStock.addusername')" > |
| | | <div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form size="mini" label-width="150px"> |
| | | <el-form ref="formRef" size="mini" label-width="150px"> |
| | | <el-form label-width="100px" label-position="right"> |
| | | <el-row style="margin-top: -15px;margin-bottom: -2px;"> |
| | | <el-col :span="6"> |
| | |
| | | <div> |
| | | <el-form-item :label="$t('delivery.rolea')" :required="true" style="width: 25vw"> |
| | | <el-input :placeholder="$t('delivery.inrole')" v-model="name" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('delivery.choice')" :required="true" style="width: 25vw;"> |
| | | <el-cascader |
| | | v-model="selectedOptions" |
| | | :placeholder="$t('delivery.inchoice')" |
| | | :props="cascaderProps" |
| | | :options="options" |
| | | style="width: 330px" |
| | | clearable /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-dialog> |
| | | <el-dialog v-model="adda" top="23vh" width="37%" :title="$t('delivery.editrole')"> |
| | | <div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form :model="editingUser" ref="formRef" size="mini" label-width="150px"> |
| | | <el-form ref="formRef" size="mini" label-width="150px"> |
| | | <el-form label-width="100px" label-position="right"> |
| | | <el-row style="margin-top: -15px;margin-bottom: -2px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('delivery.rolea')" :required="true" style="width: 25vw"> |
| | | <el-input :placeholder="$t('delivery.inrole')" v-model="editingUser.name" autocomplete="off" /> |
| | | <el-input :placeholder="$t('delivery.inrole')" v-model="name" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('delivery.choice')" :required="true" style="width: 25vw;"> |
| | | <el-cascader |
| | | v-model="selectedOptions" |
| | | :placeholder="$t('delivery.inchoice')" |
| | | :props="cascaderProps" |
| | | :options="options" |
| | | style="width: 330px" |
| | | clearable /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | const router = useRouter() |
| | | const add = ref(false) |
| | | const adda = ref(false) |
| | | const editingUser = ref({}); // 用于存储当前编辑的用户数据 |
| | | import request from "@/utils/request" |
| | | import { ref, onMounted } from "vue"; |
| | | // import { ref } from 'vue' |
| | |
| | | const response = await request.post('/loadGlass/sys/role/queryRole',{ |
| | | key: '' |
| | | }); |
| | | if (response.code == 200) { |
| | | if (response.code === 200) { |
| | | titleSelectJsona.value.processTypea = response.data; |
| | | console.log(response.data); |
| | | |
| | |
| | | }; |
| | | // 处理编辑按钮点击 |
| | | function handleEdit(row) { |
| | | editingUser.value = { ...row }; // 使用展开运算符复制当前行数据 |
| | | userName.value = row.userName; |
| | | adda.value = true; // 显示对话框 |
| | | window.localStorage.setItem('id', row.id) |
| | | |
| | | } |
| | | // 添加 |
| | | const getTableRow = async () => { |
| | | try { |
| | | const response = await request.post('/loadGlass/sys/user/saveUser', { |
| | | userName: userName.value, |
| | | nickName: userName.value, |
| | | password: password.value, |
| | | name: selectedProjectNoa.value, |
| | | roleList: [ |
| | | { |
| | | id: selectedProjectNoa.value, |
| | | // name: selectedProjectNoa.value.name, |
| | | }] |
| | | // roleList: selectedProjectNoa.value.map(item => ({ |
| | | // id: item.id, |
| | | // name: item.name |
| | | // })) |
| | | }); |
| | | |
| | | if (response.code == 200) { |
| | | if (response.code === 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | add.value = false; |
| | | // tableData.value = response.data; |
| | | tableData.value = response.data; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | |
| | | }; |
| | | // 编辑 |
| | | const getTableRowa = async () => { |
| | | let id = window.localStorage.getItem('id') |
| | | try { |
| | | const response = await request.post('/loadGlass/sys/user/updateUser', { |
| | | id: id, |
| | | userName: userName.value, |
| | | password: password.value, |
| | | name: selectedProjectNoa.value, |
| | | }); |
| | | |
| | | if (response.code == 200) { |
| | | roleList: [ |
| | | { |
| | | id: selectedProjectNoa.value, |
| | | // roleKey: selectedProjectNoa.value.id, |
| | | }] |
| | | } |
| | | ); |
| | | if (response.code === 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | editingUser.value = {}; |
| | | adda.value = false; |
| | | tableData.value = response.data; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | // 处理错误 |
| | |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | // 用户点击了“是”,现在调用删除接口 |
| | | const response = await request.post("/loadGlass/sys/user/deleteUser", { |
| | | ids: [row.id], |
| | | }) |
| | | const response = await request.post("/loadGlass/sys/user/deleteUser", [row.id]) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | |
| | | } |
| | | }; |
| | | |
| | | 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> |
| | |
| | | v-for="item in titleSelectJsona['processTypea']" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item></div></div> |
| | |
| | | </el-dialog> |
| | | <el-dialog v-model="adda" top="23vh" width="37%" :title="$t('productStock.reusername')" > |
| | | <div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form :model="editingUser" ref="formRef" size="mini" label-width="150px"> |
| | | <el-form ref="formRef" size="mini" label-width="150px"> |
| | | <el-form label-width="100px" label-position="right"> |
| | | <el-row style="margin-top: -15px;margin-bottom: -2px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('productStock.usernamea')" :required="true" style="width: 25vw"> |
| | | <el-input :placeholder="$t('productStock.inusername')" v-model="editingUser.userName" autocomplete="off" /> |
| | | <el-input :placeholder="$t('productStock.inusername')" v-model="userName" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <!-- <el-table-column align="center" label="角色" min-width="80"> |
| | | <template #default="scope"> |
| | | <el-tag v-for="role in scope.row.roleList"> |
| | | {{role.name}} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> --> |
| | | <el-form-item :label="$t('productStock.rolea')" :required="true" style="width: 25vw;"> |
| | | <el-select |
| | | v-model="selectedProjectNoa" |
| | |
| | | v-for="item in titleSelectJsona['processTypea']" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('productStock.password')" :required="true" style="width: 25vw;"> |
| | | <el-input style="width: 340px;" |
| | | v-model="editingUser.password" |
| | | :placeholder="$t('productStock.inpassword')" |
| | | autocomplete="off" |
| | | :prefix-icon="Lock" |
| | | show-password/> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | { |
| | | "plcAddressBegin":"DB14.0", |
| | | "plcAddressLenght":"84", |
| | | "plcAddressLenght": "938", |
| | | "dataType":"word", |
| | | "parameteInfor":[ |
| | | { |
| | | "codeId": "D01Request", |
| | | "parameteInfor": [{ |
| | | "codeId": "D01ID", |
| | | "addressIndex":"0", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "D01ID1", |
| | | "addressIndex":"2", |
| | | "addressLenght":"6", |
| | | "addressLenght": "32", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D04Request", |
| | | "addressIndex":"34", |
| | | "codeId": "D02ID", |
| | | "addressIndex": "32", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID1", |
| | | "addressIndex": "64", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID2", |
| | | "addressIndex": "96", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID3", |
| | | "addressIndex": "128", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID4", |
| | | "addressIndex": "160", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID5", |
| | | "addressIndex": "192", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ID6", |
| | | "addressIndex": "224", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D04ID", |
| | | "addressIndex": "256", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID1", |
| | | "addressIndex": "288", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID2", |
| | | "addressIndex": "328", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID3", |
| | | "addressIndex": "352", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID4", |
| | | "addressIndex": "384", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID5", |
| | | "addressIndex": "416", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ID6", |
| | | "addressIndex": "448", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID1", |
| | | "addressIndex": "480", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID2", |
| | | "addressIndex": "512", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID3", |
| | | "addressIndex": "544", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID4", |
| | | "addressIndex": "576", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID5", |
| | | "addressIndex": "608", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01ID6", |
| | | "addressIndex": "640", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID1", |
| | | "addressIndex": "672", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID2", |
| | | "addressIndex": "704", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID3", |
| | | "addressIndex": "736", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID4", |
| | | "addressIndex": "768", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID5", |
| | | "addressIndex": "800", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02ID6", |
| | | "addressIndex": "832", |
| | | "addressLenght": "32", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ToMES", |
| | | "addressIndex": "874", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D04ID1", |
| | | "addressIndex":"10", |
| | | "addressLenght":"36", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "E01Status", |
| | | "addressIndex":"2", |
| | | "addressLenght":"68", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "E02Status", |
| | | "addressIndex":"2", |
| | | "addressLenght":"70", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "MaxTaskNo", |
| | | "addressIndex":"2", |
| | | "addressLenght":"72", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D02MaxWidth", |
| | | "addressIndex":"2", |
| | | "addressLenght":"74", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D05MaxWidth", |
| | | "addressIndex":"2", |
| | | "addressLenght":"76", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "GlassGap", |
| | | "addressIndex":"2", |
| | | "addressLenght":"78", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D02SitState", |
| | | "addressIndex":"80", |
| | | "codeId": "D05ToMES", |
| | | "addressIndex": "876", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D05SitState", |
| | | "addressIndex":"82", |
| | | "codeId": "D01ToMES", |
| | | "addressIndex": "878", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D04ToMES", |
| | | "addressIndex": "880", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "MESToD03", |
| | | "addressIndex": "888", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "MESToD05", |
| | | "addressIndex": "890", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "MESToPLC", |
| | | "addressIndex": "892", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport1", |
| | | "addressIndex": "914", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport2", |
| | | "addressIndex": "916", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport3", |
| | | "addressIndex": "918", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport4", |
| | | "addressIndex": "920", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport5", |
| | | "addressIndex": "922", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "StartAddToImport6", |
| | | "addressIndex": "924", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport1", |
| | | "addressIndex": "926", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport2", |
| | | "addressIndex": "928", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport3", |
| | | "addressIndex": "930", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport4", |
| | | "addressIndex": "932", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport5", |
| | | "addressIndex": "934", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "TargetAddToImport6", |
| | | "addressIndex": "936", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "deviceState", |
| | | "addressIndex": "864", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E01State", |
| | | "addressIndex": "866", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "E02State", |
| | | "addressIndex": "868", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03State", |
| | | "addressIndex": "870", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05State", |
| | | "addressIndex": "872", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "MESToD01", |
| | | "addressIndex": "894", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "MESToD04", |
| | | "addressIndex": "896", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | |
| | | * A09出片目标位置 d02卧转立 钢化出片 3001 |
| | | * A10出片目标位置 d05卧转立 人工出片 3002 |
| | | */ |
| | | public static final Integer TEMPERING_OUT_TARGET_POSITION = 3001; |
| | | //todo:临时将钢化出片线路改为人工出片 |
| | | public static final Integer TEMPERING_OUT_TARGET_POSITION = 3002; |
| | | public static final Integer ARTIFICIAL_OUT_TARGET_POSITION = 3002; |
| | | |
| | | /** |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | @DS("salve_hangzhoumes") |
| | | @DS("salve_hangzhoumes_1") |
| | | public interface TemperingGlassInfoMapper extends MPJBaseMapper<TemperingGlassInfo> { |
| | | |
| | | boolean saveBatch(@Param(value = "list") List<TemperingGlassInfo> list); |
| | |
| | | @PostMapping("/save") |
| | | // @PreAuthorize("hasAuthority('sys:menu:save')") |
| | | public Result save(@Validated @RequestBody SysMenu sysMenu) { |
| | | return Result.success(sysMenuService.save(sysMenu)); |
| | | sysMenuService.save(sysMenu); |
| | | GeneralRequest request=new GeneralRequest(); |
| | | return Result.success(sysMenuService.getMenuTree(request)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("修改菜单信息") |
| | | @PostMapping("/updateMenu") |
| | | // @PreAuthorize("hasAuthority('sys:menu:update')") |
| | | public Result updateMenu(@Validated @RequestBody SysMenu sysMenu) { |
| | | public Result<List<SysMenu>> updateMenu(@Validated @RequestBody SysMenu sysMenu) { |
| | | //return Result.success(sysMenu); |
| | | sysMenuService.updateMenu(sysMenu); |
| | | return Result.success(sysMenu); |
| | | GeneralRequest request=new GeneralRequest(); |
| | | return Result.build(200,"修改成功",sysMenuService.getMenuTree(request)); |
| | | } |
| | | |
| | | @ApiOperation("获取用户有权限的所有菜单") |
| | |
| | | @ApiOperation("删除菜单") |
| | | @PostMapping("/deleteMenu") |
| | | // @PreAuthorize("hasAuthority('sys:menu:delete')") |
| | | public Result<String> deleteMenu(Long menuId) { |
| | | return Result.success(sysMenuService.deleteMenu(menuId)); |
| | | public Result<List<SysMenu>> deleteMenu(Long menuId) { |
| | | GeneralRequest request=new GeneralRequest(); |
| | | return Result.build(200, sysMenuService.deleteMenu(menuId),sysMenuService.getMenuTree(request)); |
| | | } |
| | | |
| | | @ApiOperation("批量删除菜单") |
| | |
| | | // @PreAuthorize("hasAuthority('sys:role:delete')") |
| | | @Transactional |
| | | public Result<String> deleteRole(@RequestBody List<Long> ids) { |
| | | return Result.success(sysRoleService.deleteRole(ids)); |
| | | return Result.build(200,"删除成功",sysRoleService.deleteRole(ids)); |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiOperation("更新用户信息") |
| | | @PostMapping("/updateUser") |
| | | // @PreAuthorize("hasAuthority('sys:user:update')") |
| | | public Result<SysUserVO> updateUser(@Validated @RequestBody SysUserVO sysUser) { |
| | | return Result.success(sysUserService.updateUser(sysUser)); |
| | | public Result<List<SysUserVO>> updateUser(@Validated @RequestBody SysUserVO sysUser) { |
| | | //return Result.success(sysUserService.updateUser(sysUser)); |
| | | sysUserService.updateUser(sysUser); |
| | | GeneralRequest request=new GeneralRequest(); |
| | | request.setKey(""); |
| | | return Result.success(sysUserService.listByUserName(request)); |
| | | //更改了修改之后返回所有用户列表 |
| | | } |
| | | |
| | | @ApiOperation("重置密码") |
| | |
| | | import com.mes.userinfo.entity.SysUserRole; |
| | | import com.mes.userinfo.entity.vo.SysUserVO; |
| | | import com.mes.userinfo.mapper.SysUserMapper; |
| | | import com.mes.userinfo.mapper.SysUserRoleMapper; |
| | | import com.mes.userinfo.service.SysUserRoleService; |
| | | import com.mes.userinfo.service.SysUserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | |
| | | @Resource |
| | | BCryptPasswordEncoder passwordEncoder; |
| | | @Autowired |
| | | private SysUserRoleMapper sysUserRoleMapper; |
| | | |
| | | @Override |
| | | public Map<String, String> login(SysUser user) { |
| | |
| | | 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()); |
| | | // sysUserRoleService.remove(new LambdaQueryWrapper<SysUserRole>() |
| | | // .eq(SysUserRole::getUserId, sysUser.getId()).in(CollectionUtil.isNotEmpty(roleIds), SysUserRole::getRoleId, roleIds)); |
| | | SysUserRole sysUserRole = new SysUserRole(sysUser.getId(),roleIds.get(0)); |
| | | sysUserRoleMapper.updateById(sysUserRole); |
| | | // log.info("保存用户角色信息"); |
| | | // saveUserRole(user.getRoleList(), sysUser.getId()); |
| | | return user; |
| | | } |
| | | |
| | |
| | | return; |
| | | } |
| | | log.info("2、获取到的请求字为0,将确认字改为0"); |
| | | S7object.getinstance().plccontrol.writeWord(confirmationWrodAddress, (short) 0); |
| | | S7object.getinstance().plccontrol.writeWord(confirmationWrodAddress, 0); |
| | | return; |
| | | } |
| | | if (!"0".equals(confirmationWrodValue)) { |
| | |
| | | boolean taskCache = saveTaskCache(details.getGlassId(), 0, nearestEmpty.getSlot(), Const.GLASS_CACHE_TYPE_IN); |
| | | log.info("5、生成进片任务信息存入任务表是否完成:{}", taskCache); |
| | | |
| | | S7object.getinstance().plccontrol.writeWord(confirmationWrodAddress, (short) 1); |
| | | S7object.getinstance().plccontrol.writeWord(confirmationWrodAddress, 1); |
| | | log.info("6、发送确认字完成"); |
| | | |
| | | |
| | |
| | | } |
| | | boolean glassSizeStatus = saveGlassSize(glassInfo); |
| | | log.info("7、添加出片玻璃尺寸信息到磨边前玻璃表是否完成:{}", glassSizeStatus); |
| | | S7object.getinstance().plccontrol.writeWord(confirmationWrodAddress, (short) 1); |
| | | S7object.getinstance().plccontrol.writeWord(confirmationWrodAddress, 1); |
| | | log.info("8、发送确认字已完成"); |
| | | return Boolean.TRUE; |
| | | } |
| | |
| | | if (plccontrol == null) { |
| | | plccontrol = new S7control(plcType, ip, port, 0, 0); |
| | | |
| | | String PlcLoadGlass = S7object.class.getResource("/JsonFile/PlcCacheVerticalGlass.json").getPath(); |
| | | //log.info(PLCAutoMes.class.getResource("").getPath()); |
| | | String PlcLoadGlass = System.getProperty("user.dir") + "/JsonFile/PlcCacheVerticalGlass.json"; |
| | | System.out.println("获取到的文件路径为:" + PlcLoadGlass); |
| | | PlcMesObject = InitUtil.initword(PlcLoadGlass); |
| | | } |
| | | } |
| | |
| | | @Value("${mes.galssGap}") |
| | | private Integer galssGap; |
| | | |
| | | @Scheduled(fixedDelay = 5000) |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcToHomeEdgScan() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String d01Id = plcParameterObject.getPlcParameter("D01ID").getValue(); |
| | | String d04Id = plcParameterObject.getPlcParameter("D04ID").getValue(); |
| | | //D02id判断是否为空 确认是否空闲 允许进片 |
| | | String d02State = plcParameterObject.getPlcParameter("D02ID").getValue(); |
| | | String d03State = plcParameterObject.getPlcParameter("D03State").getValue(); |
| | | String d05State = plcParameterObject.getPlcParameter("D05State").getValue(); |
| | | String mesD03Address = plcParameterObject.getPlcParameter("MESToD03").getAddress(); |
| | | String mesD05Address = plcParameterObject.getPlcParameter("MESToD05").getAddress(); |
| | | |
| | | String mesD01Address = plcParameterObject.getPlcParameter("MESToD01").getAddress(); |
| | | String mesD04Address = plcParameterObject.getPlcParameter("MESToD04").getAddress(); |
| | | String d01ToMES = plcParameterObject.getPlcParameter("D01ToMES").getValue(); |
| | | if (!REQUEST_WORD.equals(d01ToMES)) { |
| | | log.info("请求字为{},结束本次扫描进卧转立任务", d01ToMES); |
| | | return; |
| | | } |
| | | |
| | | log.info("1、获取d01Id扫描ID为:{};获取d04Id扫描ID为:{};", d01Id, d04Id); |
| | | if (StringUtils.isBlank(d01Id) && StringUtils.isBlank(d04Id)) { |
| | |
| | | // Boolean flag01 = Boolean.FALSE; |
| | | // Boolean flag04 = Boolean.FALSE; |
| | | //按照线路及玻璃id获取相邻两块玻璃 卧转立上的玻璃 |
| | | if (StringUtils.isNotBlank(d01Id) && !REQUEST_WORD.equals(d03State)) { |
| | | judgeGlassTypeStatus(d01Id, Const.A09_OUT_TARGET_POSITION, mesD03Address); |
| | | if (StringUtils.isNotBlank(d01Id) && (StringUtils.isBlank(d02State) || !REQUEST_WORD.equals(d03State))) { |
| | | judgeGlassTypeStatus(d01Id, Const.A09_OUT_TARGET_POSITION, mesD01Address); |
| | | } |
| | | if (StringUtils.isNotBlank(d04Id) && !REQUEST_WORD.equals(d05State)) { |
| | | judgeGlassTypeStatus(d04Id, Const.A10_OUT_TARGET_POSITION, mesD05Address); |
| | | judgeGlassTypeStatus(d04Id, Const.A10_OUT_TARGET_POSITION, mesD04Address); |
| | | } |
| | | log.info("结束扫码任务"); |
| | | // if (flag01 && flag04) { |
| | |
| | | // } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 5000) |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcToHomeEdgFreeCarTask() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String e01Status = plcParameterObject.getPlcParameter("E01State").getValue(); |
| | | String d03ToMES = plcParameterObject.getPlcParameter("D03ToMES").getValue(); |
| | | String d05ToMES = plcParameterObject.getPlcParameter("D05ToMES").getValue(); |
| | | log.info("执行空车送片任务,获取到的大车状态为{},卧转立状态分别为d03:{},d05:{}", e01Status, d03ToMES, d05ToMES); |
| | | if (REQUEST_WORD.equals(e01Status)) { |
| | | log.info("进片大车非空闲"); |
| | | log.info("进片大车非空闲,结束送片任务"); |
| | | return; |
| | | } |
| | | List<BigStorageCageFeedTask> feedTaskList = bigStorageCageFeedTaskService.list(new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | if (!REQUEST_WORD.equals(d03ToMES) && !REQUEST_WORD.equals(d05ToMES)) { |
| | | log.info("卧转立没有送片请求,结束送片任务"); |
| | | return; |
| | | } |
| | | LambdaQueryWrapper<BigStorageCageFeedTask> wrapper = new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | .eq(BigStorageCageFeedTask::getTaskType, Const.BIG_STORAGE_IN_RUN) |
| | | .eq(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_UP)); |
| | | .eq(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_UP); |
| | | //获取可以启动卧转立的任务线路 |
| | | List<BigStorageCageFeedTask> feedTaskList = bigStorageCageFeedTaskService.list(wrapper); |
| | | if (CollectionUtils.isNotEmpty(feedTaskList)) { |
| | | if (feedTaskList.size() == 1) { |
| | | computeTargetByLine(feedTaskList.get(0).getLine()); |
| | |
| | | |
| | | } |
| | | |
| | | // @Scheduled(fixedDelay = 5000) |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcToHomeEdgOutTask() { |
| | | |
| | | List<BigStorageCageOutTask> outingList = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>().eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_NEW)); |
| | |
| | | } |
| | | //向plc发送进片确认 |
| | | if (flag) { |
| | | S7object.getinstance().plccontrol.writeWord(mesAddress, (short) 1); |
| | | S7object.getinstance().plccontrol.writeWord(mesAddress, 1); |
| | | } |
| | | //记录无法放下玻璃,后续判断启动 |
| | | return flag; |
| | |
| | | String mesD05Address = plcMesObject.getPlcParameter("MESToD05").getAddress(); |
| | | String outLine = line.equals(Const.A09_OUT_TARGET_POSITION) ? mesD03Address : mesD05Address; |
| | | for (int i = 1; i <= taskList.size(); i++) { |
| | | s7control.writeWord(plcMesObject.getPlcParameter("StartAddToImport" + i).getAddress(), (short) taskList.get(i - 1).getLine()); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("TargetAddToImport" + i).getAddress(), (short) taskList.get(i - 1).getTargetSlot()); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("StartAddToImport" + i).getAddress(), taskList.get(i - 1).getLine()); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("TargetAddToImport" + i).getAddress(), taskList.get(i - 1).getTargetSlot()); |
| | | } |
| | | s7control.writeWord(outLine, (short) 1); |
| | | s7control.writeWord(outLine, 2); |
| | | log.info("送片任务已发送完成,任务线路为:{},启动地址为{}", line, outLine); |
| | | } |
| | | |
| | | private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list, Boolean isTempering) { |
| | |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D03ToMES", |
| | | "addressIndex": "874", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D05ToMES", |
| | | "addressIndex": "876", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D01ToMES", |
| | | "addressIndex": "878", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "D04ToMES", |
| | | "addressIndex": "880", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "MESToD03", |
| | | "addressIndex": "888", |
| | | "addressLenght": "2", |
| | |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "MESToD01", |
| | | "addressIndex": "894", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | }, |
| | | { |
| | | "codeId": "MESToD04", |
| | | "addressIndex": "896", |
| | | "addressLenght": "2", |
| | | "ratio": "1", |
| | | "unit": "" |
| | | } |
| | | ] |
| | | } |
| | |
| | | SUM(case task_state when 2 then 1 else 0 end) as real_count |
| | | from big_storage_cage_feed_task |
| | | where task_state in (1, 2) |
| | | and target_slot is null |
| | | and (target_slot = 0 or target_slot is null) |
| | | group by line |
| | | ) t |
| | | where t.total_count = t.real_count |
| | |
| | | |
| | | @Test |
| | | public void judgeGlassTypeStatus() { |
| | | plcStorageCageTask.judgeGlassTypeStatus("P24060403|6|7", Const.A09_OUT_TARGET_POSITION,""); |
| | | plcStorageCageTask.judgeGlassTypeStatus("P24060403|6|7", Const.A09_OUT_TARGET_POSITION, "mesD03Address"); |
| | | } |
| | | |
| | | @Test |
New file |
| | |
| | | package com.mes.job; |
| | | import cn.hutool.json.JSONObject; |
| | | import com.mes.order.entity.Orders; |
| | | import com.mes.order.service.OrdersService; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.entity.request.AwaitingRepair; |
| | | import com.mes.pp.entity.request.Reportingdamage; |
| | | import com.mes.pp.service.OptimizeProjectService; |
| | | import com.mes.pp.service.ReportingWorkService; |
| | | import com.mes.tools.WebSocketServer; |
| | | 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.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author SNG-010 |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class PlcScreenTask { |
| | | |
| | | @Autowired |
| | | private ReportingWorkService reportingWorkService; |
| | | @Autowired |
| | | private OptimizeProjectService optimizeProjectService; |
| | | @Autowired |
| | | private OrdersService ordersService; |
| | | /** |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | |
| | | @Scheduled(fixedDelay = 2000) |
| | | public void screenHome(){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //正在等待进片的玻璃 |
| | | Reportingdamage reportingdamage = new Reportingdamage(); |
| | | reportingdamage.setReportingWorkTime("2024-05-11"); |
| | | //获取切割信息 |
| | | reportingdamage.setThisProcess("切割"); |
| | | List<Reportingdamage> cutting = reportingWorkService.selectDamage(reportingdamage); |
| | | jsonObject.append("cutting", cutting); |
| | | //获取磨边信息 |
| | | reportingdamage.setThisProcess("磨边"); |
| | | List<Reportingdamage> edging = reportingWorkService.selectDamage(reportingdamage); |
| | | jsonObject.append("edging", edging); |
| | | //获取钢化信息 |
| | | reportingdamage.setThisProcess("钢化"); |
| | | List<Reportingdamage> tempering = reportingWorkService.selectDamage(reportingdamage); |
| | | jsonObject.append("tempering", tempering); |
| | | //获取夹胶信息 |
| | | reportingdamage.setThisProcess("夹胶"); |
| | | List<Reportingdamage> doubling = reportingWorkService.selectDamage(reportingdamage); |
| | | jsonObject.append("doubling", doubling); |
| | | //获取中空信息 |
| | | reportingdamage.setThisProcess("中空"); |
| | | List<Reportingdamage> hollow = reportingWorkService.selectDamage(reportingdamage); |
| | | jsonObject.append("hollow", hollow); |
| | | //获取包装信息 |
| | | reportingdamage.setThisProcess("包装"); |
| | | List<Reportingdamage> packaging = reportingWorkService.selectDamage(reportingdamage); |
| | | jsonObject.append("packaging", packaging); |
| | | //获取次破未补信息 |
| | | List<AwaitingRepair>awaitingRepairs = reportingWorkService.selectAwaitingRepair(); |
| | | jsonObject.append("awaitingRepairs", awaitingRepairs); |
| | | //获取正在进行的工程 |
| | | List<OptimizeProject>optimizeProjects= optimizeProjectService.getDoingTask(); |
| | | jsonObject.append("DoingTask", optimizeProjects); |
| | | //获取当前订单 |
| | | List<Orders>orders=ordersService.selectOrders(); |
| | | jsonObject.append("orders", orders); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("screen"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | } else { |
| | | log.info("Home is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | // return; |
| | | // } |
| | | // log.info("2、获取到的请求字为0,将确认字改为0"); |
| | | // S7object.getinstance().plccontrol.WriteWord(MESSendingWord, (short) 0); |
| | | // S7object.getinstance().plccontrol.WriteWord(MESSendingWord, 0); |
| | | // return; |
| | | // } |
| | | // if (!"0".equals(confirmationWrodValue)) { |
| | | // log.info("2、获取到的请求字不为0,将确认字改为0"); |
| | | // S7object.getinstance().plccontrol.WriteWord(MESSendingWord, (short) 0); |
| | | // S7object.getinstance().plccontrol.WriteWord(MESSendingWord, 0); |
| | | // return; |
| | | // } |
| | | |
| | |
| | | |
| | | } |
| | | log.info("9、发送确认字完成"); |
| | | //S7object.getinstance().plccontrol.WriteWord(MESSendingWord, (short) 1); |
| | | //S7object.getinstance().plccontrol.WriteWord(MESSendingWord, 1); |
| | | } |
| | | |
| | | /** |
| | |
| | | updateDetail.setState(Const.GLASS_STATE_OUT); |
| | | downStorageCageDetailsService.update(updateDetail, wrapper); |
| | | log.info("更新出片玻璃的状态为{}", Const.GLASS_STATE_OUT); |
| | | // S7object.getinstance().plccontrol.WriteWord(MESSendingWord, (short) 2); |
| | | // S7object.getinstance().plccontrol.WriteWord(MESSendingWord, 2); |
| | | |
| | | return true; |
| | | } |
| | |
| | | return; |
| | | } |
| | | log.info("2、获取到的请求字为0,将确认字改为0"); |
| | | S7object.getinstance().plccontrol.writeWord(confirmationWrodAddress, (short) 0); |
| | | S7object.getinstance().plccontrol.writeWord(confirmationWrodAddress, 0); |
| | | return; |
| | | } |
| | | if (!"0".equals(confirmationWrodValue)) { |
| | |
| | | log.info("更新详情表内的状态失败"); |
| | | return Boolean.FALSE; |
| | | } |
| | | //更新落架玻璃数量 |
| | | |
| | | //生成任务信息 |
| | | DownGlassInfo downGlassInfo = new DownGlassInfo(); |
| | | BeanUtils.copyProperties(downStorageCageDetails, downGlassInfo); |
| | |
| | | private Boolean sendMessageToPlc(int width, int height, int thickness, int startCell, int endCell, int taskType) { |
| | | S7control s7control = S7object.getinstance().plccontrol; |
| | | PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject; |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Glass_width").getAddress(), (short) width); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Glass_height").getAddress(), (short) height); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Glass_thickness").getAddress(), (short) thickness); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Start_cell").getAddress(), (short) startCell); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("End_cell").getAddress(), (short) endCell); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("task_type").getAddress(), (short) taskType); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("confirmationWord").getAddress(), (short) 1); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Glass_width").getAddress(), width); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Glass_height").getAddress(), height); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Glass_thickness").getAddress(), thickness); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Start_cell").getAddress(), startCell); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("End_cell").getAddress(), endCell); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("task_type").getAddress(), taskType); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("confirmationWord").getAddress(), 1); |
| | | return Boolean.TRUE; |
| | | } |
| | | } |