Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
# Conflicts:
# hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/impl/EdgStorageCageDetailsServiceImpl.java
# hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java
# hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/taskcache/service/impl/TaskCacheServiceImpl.java
65个文件已修改
3 文件已重命名
20个文件已添加
8个文件已删除
| | |
| | | "sortablejs": "^1.15.1", |
| | | "sweetalert2": "^11.10.7", |
| | | "vue": "^3.3.4", |
| | | "vue-i18n": "^9.11.0", |
| | | "vue-i18n": "^9.13.1", |
| | | "vue-router": "^4.2.4", |
| | | "vxe-table": "^4.5.15", |
| | | "xe-utils": "^3.5.14", |
| | |
| | | "integrity": "sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A==" |
| | | }, |
| | | "node_modules/@intlify/core-base": { |
| | | "version": "9.11.0", |
| | | "resolved": "https://registry.npmmirror.com/@intlify/core-base/-/core-base-9.11.0.tgz", |
| | | "integrity": "sha512-cveOqAstjLZIiyatcP/HrzrQ87cZI8ScPQna3yvoM8zjcjcIRK1MRvmxUNlPdg0rTNJMZw7rixPVM58O5aHVPA==", |
| | | "version": "9.13.1", |
| | | "resolved": "https://registry.npmmirror.com/@intlify/core-base/-/core-base-9.13.1.tgz", |
| | | "integrity": "sha512-+bcQRkJO9pcX8d0gel9ZNfrzU22sZFSA0WVhfXrf5jdJOS24a+Bp8pozuS9sBI9Hk/tGz83pgKfmqcn/Ci7/8w==", |
| | | "dependencies": { |
| | | "@intlify/message-compiler": "9.11.0", |
| | | "@intlify/shared": "9.11.0" |
| | | "@intlify/message-compiler": "9.13.1", |
| | | "@intlify/shared": "9.13.1" |
| | | }, |
| | | "engines": { |
| | | "node": ">= 16" |
| | | } |
| | | }, |
| | | "node_modules/@intlify/message-compiler": { |
| | | "version": "9.11.0", |
| | | "resolved": "https://registry.npmmirror.com/@intlify/message-compiler/-/message-compiler-9.11.0.tgz", |
| | | "integrity": "sha512-x31Gl7cscnoI4UUY1yaIy8e7vVMVW1VVlTXZz4SIHKqoSEUkfmgqK8NAx1e7RcoHEbICR7uyCbud0ZL1s4OGXQ==", |
| | | "version": "9.13.1", |
| | | "resolved": "https://registry.npmmirror.com/@intlify/message-compiler/-/message-compiler-9.13.1.tgz", |
| | | "integrity": "sha512-SKsVa4ajYGBVm7sHMXd5qX70O2XXjm55zdZB3VeMFCvQyvLew/dLvq3MqnaIsTMF1VkkOb9Ttr6tHcMlyPDL9w==", |
| | | "dependencies": { |
| | | "@intlify/shared": "9.11.0", |
| | | "@intlify/shared": "9.13.1", |
| | | "source-map-js": "^1.0.2" |
| | | }, |
| | | "engines": { |
| | |
| | | } |
| | | }, |
| | | "node_modules/@intlify/shared": { |
| | | "version": "9.11.0", |
| | | "resolved": "https://registry.npmmirror.com/@intlify/shared/-/shared-9.11.0.tgz", |
| | | "integrity": "sha512-KHSNgi7sRjmSm7aD8QH8WFt9VfKaekJuJ473opbJlkGY3EDnDUU8ikIhG8PbasQbgNvbY3m3tWNGqk2omIdwMA==", |
| | | "version": "9.13.1", |
| | | "resolved": "https://registry.npmmirror.com/@intlify/shared/-/shared-9.13.1.tgz", |
| | | "integrity": "sha512-u3b6BKGhE6j/JeRU6C/RL2FgyJfy6LakbtfeVF8fJXURpZZTzfh3e05J0bu0XPw447Q6/WUp3C4ajv4TMS4YsQ==", |
| | | "engines": { |
| | | "node": ">= 16" |
| | | } |
| | |
| | | } |
| | | }, |
| | | "node_modules/vue-i18n": { |
| | | "version": "9.11.0", |
| | | "resolved": "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.11.0.tgz", |
| | | "integrity": "sha512-vU4gY6lu8Pdfs9BgKGiDAJmFDf88cceR47KcSB0VW4xJzUrXR/7qwqM7A8dQ2nedhoIDxoOm5Ro4pFd2KvJqbA==", |
| | | "version": "9.13.1", |
| | | "resolved": "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.13.1.tgz", |
| | | "integrity": "sha512-mh0GIxx0wPtPlcB1q4k277y0iKgo25xmDPWioVVYanjPufDBpvu5ySTjP5wOrSvlYQ2m1xI+CFhGdauv/61uQg==", |
| | | "dependencies": { |
| | | "@intlify/core-base": "9.11.0", |
| | | "@intlify/shared": "9.11.0", |
| | | "@intlify/core-base": "9.13.1", |
| | | "@intlify/shared": "9.13.1", |
| | | "@vue/devtools-api": "^6.5.0" |
| | | }, |
| | | "engines": { |
| | |
| | | "integrity": "sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A==" |
| | | }, |
| | | "@intlify/core-base": { |
| | | "version": "9.11.0", |
| | | "resolved": "https://registry.npmmirror.com/@intlify/core-base/-/core-base-9.11.0.tgz", |
| | | "integrity": "sha512-cveOqAstjLZIiyatcP/HrzrQ87cZI8ScPQna3yvoM8zjcjcIRK1MRvmxUNlPdg0rTNJMZw7rixPVM58O5aHVPA==", |
| | | "version": "9.13.1", |
| | | "resolved": "https://registry.npmmirror.com/@intlify/core-base/-/core-base-9.13.1.tgz", |
| | | "integrity": "sha512-+bcQRkJO9pcX8d0gel9ZNfrzU22sZFSA0WVhfXrf5jdJOS24a+Bp8pozuS9sBI9Hk/tGz83pgKfmqcn/Ci7/8w==", |
| | | "requires": { |
| | | "@intlify/message-compiler": "9.11.0", |
| | | "@intlify/shared": "9.11.0" |
| | | "@intlify/message-compiler": "9.13.1", |
| | | "@intlify/shared": "9.13.1" |
| | | } |
| | | }, |
| | | "@intlify/message-compiler": { |
| | | "version": "9.11.0", |
| | | "resolved": "https://registry.npmmirror.com/@intlify/message-compiler/-/message-compiler-9.11.0.tgz", |
| | | "integrity": "sha512-x31Gl7cscnoI4UUY1yaIy8e7vVMVW1VVlTXZz4SIHKqoSEUkfmgqK8NAx1e7RcoHEbICR7uyCbud0ZL1s4OGXQ==", |
| | | "version": "9.13.1", |
| | | "resolved": "https://registry.npmmirror.com/@intlify/message-compiler/-/message-compiler-9.13.1.tgz", |
| | | "integrity": "sha512-SKsVa4ajYGBVm7sHMXd5qX70O2XXjm55zdZB3VeMFCvQyvLew/dLvq3MqnaIsTMF1VkkOb9Ttr6tHcMlyPDL9w==", |
| | | "requires": { |
| | | "@intlify/shared": "9.11.0", |
| | | "@intlify/shared": "9.13.1", |
| | | "source-map-js": "^1.0.2" |
| | | } |
| | | }, |
| | | "@intlify/shared": { |
| | | "version": "9.11.0", |
| | | "resolved": "https://registry.npmmirror.com/@intlify/shared/-/shared-9.11.0.tgz", |
| | | "integrity": "sha512-KHSNgi7sRjmSm7aD8QH8WFt9VfKaekJuJ473opbJlkGY3EDnDUU8ikIhG8PbasQbgNvbY3m3tWNGqk2omIdwMA==" |
| | | "version": "9.13.1", |
| | | "resolved": "https://registry.npmmirror.com/@intlify/shared/-/shared-9.13.1.tgz", |
| | | "integrity": "sha512-u3b6BKGhE6j/JeRU6C/RL2FgyJfy6LakbtfeVF8fJXURpZZTzfh3e05J0bu0XPw447Q6/WUp3C4ajv4TMS4YsQ==" |
| | | }, |
| | | "@jridgewell/sourcemap-codec": { |
| | | "version": "1.4.15", |
| | |
| | | } |
| | | }, |
| | | "vue-i18n": { |
| | | "version": "9.11.0", |
| | | "resolved": "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.11.0.tgz", |
| | | "integrity": "sha512-vU4gY6lu8Pdfs9BgKGiDAJmFDf88cceR47KcSB0VW4xJzUrXR/7qwqM7A8dQ2nedhoIDxoOm5Ro4pFd2KvJqbA==", |
| | | "version": "9.13.1", |
| | | "resolved": "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.13.1.tgz", |
| | | "integrity": "sha512-mh0GIxx0wPtPlcB1q4k277y0iKgo25xmDPWioVVYanjPufDBpvu5ySTjP5wOrSvlYQ2m1xI+CFhGdauv/61uQg==", |
| | | "requires": { |
| | | "@intlify/core-base": "9.11.0", |
| | | "@intlify/shared": "9.11.0", |
| | | "@intlify/core-base": "9.13.1", |
| | | "@intlify/shared": "9.13.1", |
| | | "@vue/devtools-api": "^6.5.0" |
| | | } |
| | | }, |
| | |
| | | "sortablejs": "^1.15.1", |
| | | "sweetalert2": "^11.10.7", |
| | | "vue": "^3.3.4", |
| | | "vue-i18n": "^9.11.0", |
| | | "vue-i18n": "^9.13.1", |
| | | "vue-router": "^4.2.4", |
| | | "vxe-table": "^4.5.15", |
| | | "xe-utils": "^3.5.14", |
| | |
| | | export default { |
| | | created() { |
| | | const localStorageLang = localStorage.getItem('preferredLanguage'); |
| | | if (localStorageLang) { |
| | | this.$i18n.locale = localStorageLang; |
| | | } |
| | | }, |
| | | methods: { |
| | | switchLanguage(lang) { |
| | | this.$i18n.locale = lang; |
| | | localStorage.setItem('preferredLanguage', lang); |
| | | } |
| | | created() { |
| | | const localStorageLang = localStorage.getItem('preferredLanguage'); |
| | | if (localStorageLang) { |
| | | this.$i18n.locale = localStorageLang; |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | switchLanguage(lang) { |
| | | this.$i18n.locale = lang; |
| | | localStorage.setItem('preferredLanguage', lang); |
| | | } |
| | | } |
| | | } |
| | |
| | | // i18n.js |
| | | |
| | | |
| | | import { createI18n } from 'vue-i18n' |
| | | import zhCn from './lang/locales/zh-CN.json' |
| | | import enUs from './lang/locales/en-US.json' |
| | | |
| | | |
| | | const i18n = createI18n({ |
| | | locale: 'zh-CN', // 设置默认语言 |
| | | messages: { |
| | |
| | | 'en-US': enUs |
| | | } |
| | | }) |
| | | |
| | | export default i18n |
| | | |
| | | export default i18n |
| | |
| | | import './assets/main.css' |
| | | |
| | | |
| | | import { createApp } from 'vue' |
| | | import { createPinia } from 'pinia' |
| | | import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' |
| | |
| | | import VXETable from 'vxe-table' |
| | | import 'vxe-table/lib/style.css' |
| | | // import i18n from './lang/i18n' |
| | | |
| | | |
| | | |
| | | |
| | | const app = createApp(App) |
| | | const pinia = createPinia() |
| | | pinia.use(piniaPluginPersistedstate ) |
| | |
| | | app.use(ElementPlus,{ |
| | | locale: zhCn, |
| | | }) |
| | | |
| | | app.mount('#app') |
| | | |
| | | app.mount('#app') |
| | |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | // 用户点击了“是”,现在调用删除接口 |
| | | const deleteResponse = await request.post("/cacheGlass/edgStorageCage/edgStorageCageGlass", { |
| | | id: row.id, |
| | | var url="/cacheGlass/edgStorageCage/edgStorageCageGlass?edgStorageCageId="+row.id; |
| | | console.log(url); |
| | | const deleteResponse = await request.post(url, { |
| | | esdId: row.esdId |
| | | }) |
| | | if (response.code == 200) { |
| | | // 删除成功,您可以根据需要处理成功的情况 |
| | | alert('删除成功!'); |
| | | if (response.code == 200) { |
| | | // 删除成功,您可以根据需要处理成功的情况 |
| | | // ElMessage({ |
| | | // type: 'success', |
| | | // message: '删除成功!', |
| | | // }) |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | // 删除失败,您可以处理错误或显示错误信息给用户 |
| | | alert('删除失败:' + deleteResponse.message); |
| | |
| | | import {ElMessage} from 'element-plus' |
| | | import request from '@/utils/request' |
| | | import userInfo from '@/stores/userInfo' |
| | | |
| | | |
| | | const store = userInfo() |
| | | let ruleFormRef = ref<FormInstance>() |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | |
| | | |
| | | const userForm = reactive({ |
| | | userName: '', |
| | | password: '', |
| | | }) |
| | | |
| | | |
| | | if (typeof route.query.id != 'undefined') { |
| | | userForm.userId = <string>route.query.id |
| | | } |
| | | |
| | | |
| | | const validateUser = (rule: any, value: any, callback: any) => { |
| | | if (value === '') { |
| | | callback(new Error('请输入你的账号')) |
| | |
| | | callback() |
| | | } |
| | | } |
| | | |
| | | |
| | | const validatePass = (rule: any, value: any, callback: any) => { |
| | | if (value === '') { |
| | | callback(new Error('请输入你的密码')) |
| | |
| | | callback() |
| | | } |
| | | } |
| | | |
| | | |
| | | const rules = reactive<FormRules<typeof userForm>>({ |
| | | userId: [{validator: validateUser, trigger: 'blur'}], |
| | | pass: [{validator: validatePass, trigger: 'blur'}], |
| | | }) |
| | | |
| | | |
| | | //登陆方法 |
| | | const submitForm = (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | |
| | | if (res['code'] == 200) { |
| | | store.$patch({user: res.data}) |
| | | console.log(res.data) |
| | | |
| | | |
| | | router.push('/main') |
| | | ElMessage.success(`登录成功`) |
| | | } else { |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | function register() { |
| | | router.push({ |
| | | path: '/register', |
| | | }) |
| | | } |
| | | |
| | | |
| | | let loginLoadings = ref(false) |
| | | let registerLoadings = ref(false) |
| | | |
| | | |
| | | const keyDown = (e) => { |
| | | // 回车则执行登录方法 enter键的ASCII是13 |
| | | if (e.keyCode == 13 || e.keyCode == 100) { |
| | |
| | | window.removeEventListener('keydown', keyDown) |
| | | }) |
| | | </script> |
| | | |
| | | |
| | | <template> |
| | | <div class="mainDiv"> |
| | | <div id="main-login"> |
| | |
| | | @click="register" |
| | | plain>注册 |
| | | </el-button> |
| | | |
| | | |
| | | </el-form-item> |
| | | </div> |
| | | </el-form> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | |
| | | <style scoped> |
| | | .mainDiv { |
| | | overflow: hidden; |
| | | min-width: 718px; |
| | | background-image: url('../../src/assets/background.jpg'); |
| | | } |
| | | |
| | | |
| | | #main-login { |
| | | margin: 150px auto 0 auto; |
| | | height: 70vh; |
| | | width: 80vw; |
| | | } |
| | | |
| | | |
| | | #img-div { |
| | | width: 55%; |
| | | height: 100%; |
| | |
| | | align-items: center; |
| | | float: left; |
| | | } |
| | | |
| | | |
| | | #img-pic { |
| | | max-height: 90%; |
| | | max-width: 100%; |
| | | } |
| | | |
| | | |
| | | #div-login { |
| | | margin-top: 5%; |
| | | /* margin-top: 20%; */ |
| | |
| | | border-radius: 4px; |
| | | box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0), 0 6px 5px 0 rgba(0, 0, 0, 0.19); |
| | | } |
| | | |
| | | |
| | | #center { |
| | | margin-top: -30px; |
| | | } |
| | | |
| | | |
| | | .el-form { |
| | | width: 60%; |
| | | margin: 20% auto auto; |
| | | } |
| | | |
| | | |
| | | #submitForm { |
| | | display: flex; |
| | | justify-content: space-evenly; |
| | | margin-top: 2rem; |
| | | } |
| | | |
| | | |
| | | :deep(.el-form-item__content) { |
| | | flex: unset; |
| | | } |
| | |
| | | // import http from "@/http/index"; |
| | | |
| | | let ruleForm = ref({ |
| | | // engineeringId: '', |
| | | projectNo: '', |
| | | workstationId: '', |
| | | patternHeigth: '', |
| | | patternHeight: '', |
| | | patternWidth: '', |
| | | filmsId: '', |
| | | patternThickness: '', |
| | |
| | | ElMessage.error('获取表格数据失败,请重试'); |
| | | } |
| | | }; |
| | | request.get("/loadGlass/LoadGlass/list").then((res) => { |
| | | if (res.code == 200) { |
| | | console.log(res.data); |
| | | tableDataa.value = res.data |
| | | 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 |
| | | request.get("/loadGlass/LoadGlass/list").then((res) => { |
| | | if (res.code === 200) { |
| | | console.log(res.data); |
| | | tableDataa.value = res.data; |
| | | |
| | | if (tableDataa.value.length === 2) { |
| | | if (tableDataa.value[0].patternWidth > 0) { |
| | | flake.value = true; |
| | | } |
| | | |
| | | if (tableDataa.value[1].patternWidth > 0) { |
| | | flakea.value = true; |
| | | } |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | // router.push("/login") |
| | | } |
| | | }); |
| | | } |
| | | } else { |
| | | ElMessage.warning(res.msg); |
| | | // router.push("/login"); |
| | | } |
| | | }); |
| | | // request.get("/loadGlass/LoadGlass/list").then((res) => { |
| | | // window.localStorage.setItem('patternWidth', res.data.patternWidth) |
| | | // window.localStorage.setItem('workstationId', res.data.workstationId) |
| | | // if (res.code == 200) { |
| | | // console.log(res.data); |
| | | // tableDataa.value = res.data |
| | | // console.log(res.data.patternWidth); |
| | | |
| | | // let workstationId = window.localStorage.getItem('workstationId') |
| | | // let patternWidth = window.localStorage.getItem('patternWidth') |
| | | // if (patternWidth !== '' || workstationId == '1') { |
| | | // flake.value = true |
| | | // } else if (patternWidth !== '' || workstationId == '2') { |
| | | // flakea.value = true |
| | | // } |
| | | // } else { |
| | | // ElMessage.warning(res.msg) |
| | | // // router.push("/login") |
| | | // } |
| | | // }); |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | processType: [], |
| | | |
| | | }) |
| | | const titleSelectJsona = ref({ |
| | | processTypea: [], |
| | | |
| | | }) |
| | | // const getBasicData = ref({ |
| | |
| | | }; |
| | | // 响应式数据 |
| | | const selectedProjectNo = ref(''); // 当前选中的工程号 |
| | | const selectedProjectNoa = ref(''); // 当前选中的工程号 |
| | | const options = ref<any[]>([]); // 下拉选项列表 |
| | | |
| | | // 调用接口获取选项数据的函数 |
| | |
| | | |
| | | if (response.code == 200) { |
| | | titleSelectJson.value.processType = response.data; |
| | | |
| | | // titleSelectJson.value.processType = response.data(item => ({ |
| | | // // options.value = response.data.data.map(item => ({ |
| | | // value: item.projectNo, |
| | | // // label: item.id // 假设后端返回的数据中有 字段作为显示标签 |
| | | // })); |
| | | console.log(response.data); |
| | | |
| | | } else { |
| | |
| | | console.error('Error fetching options:', error); |
| | | } |
| | | }; |
| | | |
| | | // 开始上片下拉选 |
| | | const fetchOptionsa = async (queryString: string) => { |
| | | try { |
| | | // 发送请求到后端接口 |
| | | const response = await request.get('/loadGlass/engineering/engineering/selectTask'); |
| | | if (response.code == 200) { |
| | | titleSelectJsona.value.processTypea = response.data; |
| | | console.log(response.data); |
| | | |
| | | } else { |
| | | ElMessage.warning(response.data); |
| | | } |
| | | } catch (error) { |
| | | console.error('Error fetching options:', error); |
| | | } |
| | | }; |
| | | // 处理用户输入变化的方法 |
| | | const handleInputChange = async (value: string) => { |
| | | if (value) { |
| | |
| | | options.value = []; // 清空选项列表 |
| | | } |
| | | }; |
| | | |
| | | // 处理用户输入变化的方法 |
| | | const handleInputChangea = async (value: string) => { |
| | | if (value) { |
| | | await fetchOptionsa(value); |
| | | } else { |
| | | options.value = []; // 清空选项列表 |
| | | } |
| | | }; |
| | | // 初始化加载数据(如果需要) |
| | | onMounted(() => { |
| | | // 在组件挂载后调用 fetchOptions('') 来加载初始数据(如果需要) |
| | | fetchOptions(''); |
| | | }); |
| | | |
| | | onMounted(() => { |
| | | // 在组件挂载后调用 fetchOptions('') 来加载初始数据(如果需要) |
| | | fetchOptionsa(''); |
| | | }); |
| | | // const billall = () => { |
| | | // request.post("/loadGlass/optimizeProject/listByState", requestData) |
| | | // .then((res: any) => { |
| | |
| | | // } |
| | | const user = ref(''); |
| | | // 定义表头上传数据 |
| | | let titleUploadData = ref({ |
| | | projectNo:'', |
| | | }) |
| | | // const engineeringId = ref(''); |
| | | // let titleUploadData = ref({ |
| | | // projectNo:'', |
| | | // }) |
| | | const projectNo = ref(''); |
| | | const workstationId = ref(''); |
| | | const patternHeigth = ref(''); |
| | | const patternHeight = ref(''); |
| | | const patternWidth = ref(''); |
| | | const filmsId = ref(''); |
| | | const patternThickness = ref(''); |
| | | const number = ref(''); |
| | | |
| | | // 添加 |
| | | const handleConfirm = async () => { |
| | | try { |
| | | const response = await request.post('/loadGlass/LoadGlass/updateGlassMessage', { |
| | | id: workstationId.value, |
| | | workstationId: workstationId.value, |
| | | patternHeigth: patternHeigth.value, |
| | | patternHeight: patternHeight.value, |
| | | patternWidth: patternWidth.value, |
| | | filmsId: filmsId.value, |
| | | patternThickness: patternThickness.value, |
| | |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | window.location.reload() |
| | | add.value = false; |
| | | window.localStorage.setItem('workstationId', response.data.workstationId) |
| | | let workstationId = window.localStorage.getItem('workstationId') |
| | |
| | | try { |
| | | const response = await request.post('/loadGlass/LoadGlass/updateGlassMessage', { |
| | | workstationId: workstationId.value, |
| | | patternHeigth: 0, |
| | | patternHeight: 0, |
| | | patternWidth: 0, |
| | | filmsId: "", |
| | | patternThickness: 0, |
| | |
| | | console.error(error); |
| | | } |
| | | }; |
| | | // 开始上片 |
| | | const handle = async () => { |
| | | // 选择工程确认 |
| | | const handleup = 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, |
| | | const response = await request.post('/loadGlass/up-patten-usage/saveUpPattenUsage', { |
| | | engineerId: selectedProjectNo.value, |
| | | }) |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | blind.value = false; |
| | | window.location.reload() |
| | | dialogFormVisible.value = false; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } |
| | | else { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: '工程号不能为空!', |
| | | }) |
| | | } |
| | | } |
| | | catch (error) { |
| | |
| | | console.error(error); |
| | | } |
| | | } |
| | | // 开始上片 |
| | | const handle = async () => { |
| | | try { |
| | | const response = await request.post('/loadGlass/engineering/engineering/changeTask', { |
| | | engineerId: selectedProjectNoa.value, |
| | | state: 1, |
| | | }) |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | window.location.reload() |
| | | blind.value = false; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | // 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: engineerId.va, |
| | | // state: 1, |
| | | // }) |
| | | // if (response.code == 200) { |
| | | // // 绑定成功,处理逻辑 |
| | | // ElMessage.success(response.message); |
| | | // blind.value = false; |
| | | // } else { |
| | | // // 请求失败,显示错误消息 |
| | | // ElMessage.error(response.msg); |
| | | // } |
| | | // } |
| | | // else { |
| | | // ElMessage({ |
| | | // type: 'info', |
| | | // message: '工程号不能为空!', |
| | | // }) |
| | | // } |
| | | // } |
| | | // catch (error) { |
| | | // // 处理错误 |
| | | // console.error(error); |
| | | // } |
| | | // } |
| | | // 暂停 |
| | | const handlea = async () => { |
| | | try { |
| | |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | window.location.reload() |
| | | blinda.value = false; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | |
| | | console.error(error); |
| | | } |
| | | } |
| | | // 开始上片 |
| | | // 停止任务 |
| | | const handleb = async () => { |
| | | try { |
| | | let engineeringId = window.localStorage.getItem('engineeringId') |
| | |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | window.location.reload() |
| | | blindb.value = false; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | |
| | | } |
| | | } |
| | | onMounted(fetchTableData); |
| | | |
| | | function getStatusText(state: number) { |
| | | switch (state) { |
| | | case 0: |
| | | return '等待中'; |
| | | case 1: |
| | | case 2: |
| | | return '上片中'; |
| | | case 100: |
| | | return '已完成'; |
| | | default: |
| | | return '未知状态'; |
| | | } |
| | | } |
| | | |
| | | function getStatusType(state: number) { |
| | | // 这里假设只有100时类型不是success,其他都是success |
| | | return state === 100 ? 'info' : 'success'; // 根据需要调整类型 |
| | | } |
| | | // const open = () => { |
| | | // ElMessageBox.confirm( |
| | | // '是否删除该条信息?', |
| | |
| | | min-width="80" |
| | | prop="state" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag type="success" >{{ scope.row.state==1?"就绪":"未就绪" }}</el-tag> |
| | | </template> |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusType(scope.row.state)"> |
| | | {{ getStatusText(scope.row.state) }} |
| | | </el-tag> |
| | | </template> |
| | | <!-- <template #default="scope"> |
| | | <el-tag type="success" >{{ scope.row.state==0?"等待中":"上片中" }}</el-tag> |
| | | </template> --> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | |
| | | </el-card> |
| | | <el-dialog v-model="blind" top="30vh" width="25%" title="是否开始上片?" > |
| | | <el-dialog v-model="blind" top="24vh" width="30%" title="是否开始上片?" > |
| | | <div style="margin-left: 50px;margin-bottom: 10px;"> |
| | | <el-form-item label="工程号:" :required="true"> |
| | | <el-select |
| | | v-model="selectedProjectNoa" |
| | | filterable |
| | | clearable |
| | | placeholder="请选择工程" |
| | | style="width: 220px" |
| | | @input="handleInputChangea" |
| | | > |
| | | <el-option |
| | | v-for="item in titleSelectJsona['processTypea']" |
| | | :key="item.id" |
| | | :label="item.engineerId" |
| | | :value="item.engineerId" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </div> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handle"> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- <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"> |
| | |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" |
| | | > |
| | | <el-table-column prop="patternWidth" align="center" label="宽" min-width="80" /> |
| | | <el-table-column prop="patternHeigth" align="center" label="长" min-width="80" /> |
| | | <el-table-column prop="patternHeight" align="center" label="长" min-width="80" /> |
| | | <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"> |
| | |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item label="长:" :required="true" style="width: 14vw"> |
| | | <el-input v-model="patternHeigth" autocomplete="off" /> |
| | | <el-input v-model="patternHeight" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | <el-col :span="9"> |
| | |
| | | :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 type="primary" @click="handleup"> |
| | | 确认 |
| | | </el-button> |
| | | <el-button @click="dialogFormVisible = false">取消</el-button> |
| | |
| | | <svg width="500" height="500" xmlns="http://www.w3.org/2000/svg"> |
| | | <g stroke="null" id="Layer_1"> |
| | | <!-- 使用 v-for 循环渲染数据 --> |
| | | <g v-for="(rack, index) in racks" :key="index"> |
| | | <g v-for="(rack, index) in racks" :key="index" :data="tableData"> |
| | | <rect |
| | | :x="rack.x" |
| | | :y="rack.y" |
| | |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | <script setup> |
| | | import { ref, watchEffect } from 'vue'; |
| | | import Swal from 'sweetalert2' |
| | | |
| | | const racks = [ |
| | | import request from "@/utils/request"; |
| | | const racks = ref([ |
| | | { 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' } } |
| | | ]; |
| | | |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG12345678' } }, |
| | | |
| | | { x: 140, y: 420, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: 'NG1234561454' } } |
| | | |
| | | ]); |
| | | |
| | | watchEffect(() => { |
| | | // 触发数据变化时重新渲染 |
| | | }); |
| | | |
| | | |
| | | const calculateItemXPosition = (rack, item, index) => { |
| | | if (index === 0 || index === 1) { |
| | | if (index === 0 ) { |
| | | return rack.x; |
| | | } else if (index === 2 || index === 3) { |
| | | } else if (index === 1 ) { |
| | | 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) { |
| | | if (index === 0 ) { |
| | | return rack.y + (rack.height - item.height) / 2; |
| | | } else if (index === 2 || index === 3) { |
| | | } else if (index === 1) { |
| | | return rack.y + (rack.height - item.height) / 2; |
| | | } else { |
| | | return rack.y + rack.height - item.height; |
| | | } |
| | | }; |
| | | |
| | | |
| | | const fetchFlowCardId = async () => { |
| | | try { |
| | | const response = await request.get('unLoadGlass/downWorkStation/getwo'); |
| | | |
| | | if (response.code === 200) { |
| | | console.log(response); |
| | | // 遍历响应数据并替换racks数组中的item属性 |
| | | response.data.forEach((itemData, index) => { |
| | | if (index < racks.value.length) { |
| | | const rack = racks.value[index]; |
| | | const newItem = { |
| | | content: itemData.item.content, |
| | | fillColor: itemData.item.fillColor, |
| | | width: itemData.item.width === 0 ? "" : 10, |
| | | height: itemData.item.height === 0 ? "" : 90 |
| | | }; |
| | | |
| | | if (index === 2 && itemData.item.width > 0) { |
| | | newItem.width = 100; |
| | | newItem.height = 20; |
| | | } |
| | | |
| | | rack.item = newItem; |
| | | |
| | | console.log(racks.value); // 打印更新后的 racks 值 |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } else { |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } catch (error) { |
| | | console.error(error); |
| | | } |
| | | }; |
| | | |
| | | fetchFlowCardId() |
| | | // setTimeout(fetchFlowCardId(),1000); |
| | | //setInterval(fetchFlowCardId, 2000) |
| | | |
| | | |
| | | const showCustomAlert = (content) => { |
| | | var str="架号 : 111\n" + |
| | | "长 : 111\n" + |
| | |
| | | :height="rack.item.height" |
| | | :fill="rack.item.fillColor" |
| | | /> |
| | | <text :x="rack.x + rack.width / 2" :y="rack.y - 10" text-anchor="middle">{{ index + 6 }}号工位</text> |
| | | <text :x="rack.x + rack.width / 2" :y="rack.y - 10" text-anchor="middle">{{ index + 4 }}号工位</text> |
| | | <text :x="rack.x + rack.width / 2" :y="rack.y + rack.height + 20" text-anchor="middle">{{ rack.item.content }}</text> |
| | | </g> |
| | | </g> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, watchEffect } from 'vue'; |
| | | import Swal from 'sweetalert2' |
| | | import request from "@/utils/request"; |
| | | |
| | | const racks = [ |
| | | const racks = ref([ |
| | | { 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' } } |
| | | ]; |
| | | |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG12345678' } }, |
| | | |
| | | { x: 140, y: 420, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: 'NG1234561454' } } |
| | | |
| | | ]); |
| | | |
| | | watchEffect(() => { |
| | | // 触发数据变化时重新渲染 |
| | | }); |
| | | // 计算元素位置的函数 |
| | | const calculateItemXPosition = (rack, item, index) => { |
| | | if (index === 0 || index === 1) { |
| | | if (index === 0) { |
| | | return rack.x; |
| | | } else if (index === 2 || index === 3) { |
| | | } else if (index === 1) { |
| | | 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) { |
| | | if (index === 0) { |
| | | return rack.y + (rack.height - item.height) / 2; |
| | | } else if (index === 2 || index === 3) { |
| | | } else if (index === 1) { |
| | | 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 fetchFlowCardId = async () => { |
| | | try { |
| | | const response = await request.get('unLoadGlass/downWorkStation/getwo2'); |
| | | |
| | | if (response.code === 200) { |
| | | console.log(response); |
| | | // 遍历响应数据并替换racks数组中的item属性 |
| | | response.data.forEach((itemData, index) => { |
| | | if (index < racks.value.length) { |
| | | const rack = racks.value[index]; |
| | | const newItem = { |
| | | content: itemData.item.content, |
| | | fillColor: itemData.item.fillColor, |
| | | width: itemData.item.width === 0 ? "" : 10, |
| | | height: itemData.item.height === 0 ? "" : 90 |
| | | }; |
| | | |
| | | if (index === 2 && itemData.item.width > 0) { |
| | | newItem.width = 100; |
| | | newItem.height = 20; |
| | | } |
| | | }); |
| | | |
| | | rack.item = newItem; |
| | | |
| | | console.log(racks.value); // 打印更新后的 racks 值 |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } else { |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } catch (error) { |
| | | console.error(error); |
| | | } |
| | | }; |
| | | |
| | | fetchFlowCardId() |
| | | |
| | | // 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); |
| | |
| | | import Landingindication from "./Landingindication.vue"; |
| | | import Landingindicationtwo from "./Landingindicationtwo.vue"; |
| | | import request from "@/utils/request"; |
| | | |
| | | const dialogFormVisiblea = ref(false) |
| | | |
| | | |
| | |
| | | const workstationId = ref(''); |
| | | const flowCardId = ref(''); |
| | | const flowCardOptions = ref([]); |
| | | |
| | | const tableData = reactive([]); |
| | | |
| | | // 方法 |
| | | const handleSelectionChange = () => { |
| | |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | console.log('绑定成功'); |
| | | |
| | | ElMessage.success(response.message); |
| | | updatePageData(); |
| | | dialogFormVisiblea.value = false; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | }; |
| | | |
| | | |
| | | const updatePageData = () => { |
| | | // 假设你的页面上有一个名为 tableData 的 Vue 组件 |
| | | // 你可以直接更新 tableData 的数据 |
| | | fetchTableData() |
| | | |
| | | // 使用 $forceUpdate() 强制更新组件 |
| | | |
| | | }; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | const tableData = reactive([]); |
| | | |
| | | |
| | | // 发送获取表格数据的请求 |
| | | const fetchTableData = async () => { |
| | |
| | | <version>1.4.2</version> |
| | | </dependency> |
| | | |
| | | <!--引入redis,排除lettuce的引用--> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-data-redis</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>io.lettuce</groupId> |
| | | <artifactId>lettuce-core</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <!-- 引入Jedis客戶端--> |
| | | <dependency> |
| | | <groupId>redis.clients</groupId> |
| | | <artifactId>jedis</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | |
| | | <maven.compiler.source>8</maven.compiler.source> |
| | | <maven.compiler.target>8</maven.compiler.target> |
| | | </properties> |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>com.microsoft.sqlserver</groupId> |
| | | <artifactId>sqljdbc4</artifactId> |
| | | <version>4.0</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | </project> |
| | |
| | | public static final Integer GLASS_STATE_TAKE = 200; |
| | | public static final Integer A10_OUT_TARGET_DAMAGE = 201; |
| | | |
| | | /** |
| | | * 卧式理片笼详情表玻璃状态 |
| | | * 进片任务1 |
| | | * 出片任务2 |
| | | */ |
| | | public static final Integer GLASS_CACHE_TYPE_IN = 1; |
| | | public static final Integer GLASS_CACHE_TYPE_OUT = 2; |
| | | |
| | | /** |
| | | * 磨边任务玻璃状态 |
| | | * 进片任务1 |
| | | * 出片任务2 |
| | | */ |
| | | public static final Integer EDG_GLASS_BEFORE = 0; |
| | | public static final Integer EDG_GLASS_START = 1; |
| | | public static final Integer EDG_GLASS_SUCCESS = 2; |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.engineering.controller; |
| | | |
| | | |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.mes.engineering.service.EngineeringService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-04-22 |
| | | */ |
| | | @RestController |
| | | @Slf4j |
| | | @RequestMapping("/engineering/engineering") |
| | | public class EngineeringController { |
| | | @Autowired |
| | | private EngineeringService engineeringService; |
| | | |
| | | @ApiOperation("开始/暂停任务/传递工程号和状态,开始是1 暂停是0") |
| | | @PostMapping("/changeTask") //调用上片任务 |
| | | @ResponseBody |
| | | public Result <Boolean> changeTask(@RequestBody Engineering engineering) { |
| | | boolean work=engineeringService.changeTask(engineering.getEngineerId(),engineering.getState()); |
| | | log.info("StartorStop:{},{}", work,engineering); |
| | | return Result.build(200, engineering.getEngineerId(),work); |
| | | } |
| | | |
| | | @ApiOperation("查询可以上片的工程号") |
| | | @GetMapping("/selectTask") //调用上片任务 |
| | | @ResponseBody |
| | | public Result <List<Engineering>> selectTask() { |
| | | List<Engineering> engineering=engineeringService.selectTask(); |
| | | log.info("可领取任务返回:{}", engineering); |
| | | return Result.build(200, "",engineering); |
| | | } |
| | | } |
| | | |
File was renamed from hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/entity/Engineering.java |
| | |
| | | /** |
| | | * 膜系id |
| | | */ |
| | | private Integer filmsId; |
| | | private String filmsId; |
| | | |
| | | /** |
| | | * 备注 |
New file |
| | |
| | | package com.mes.engineering.entity; |
| | | |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * @author SNG-010 |
| | | */ |
| | | @Setter |
| | | @Getter |
| | | public class OptimizeEngineering { |
| | | |
| | | // Getter methods |
| | | // Setter methods |
| | | /** |
| | | * 工程号 |
| | | */ |
| | | private String projectNo; |
| | | |
| | | /** |
| | | * 工程名 |
| | | */ |
| | | private String projectName; |
| | | |
| | | /** |
| | | * 平均利用率 |
| | | */ |
| | | private Double avgCutPct; |
| | | |
| | | /** |
| | | * 有效利用率 |
| | | */ |
| | | private Double validCutPct; |
| | | |
| | | /** |
| | | * 尾片利用率 |
| | | */ |
| | | private Double lastCutPct; |
| | | |
| | | /** |
| | | * 状态 |
| | | */ |
| | | private Integer state; |
| | | |
| | | /** |
| | | * 小片总数 |
| | | */ |
| | | private Integer glassTotal; |
| | | /** |
| | | * 小片总面积 |
| | | */ |
| | | private Double glassTotalArea; |
| | | /** |
| | | * 计划原片总数 |
| | | */ |
| | | private Integer rawStockQty; |
| | | /** |
| | | * 计划原片总面积 |
| | | */ |
| | | private Double rawStockArea; |
| | | /** |
| | | * 实际原片总数 |
| | | */ |
| | | private Integer actualStockQty; |
| | | /** |
| | | * 实际原片总面积 |
| | | */ |
| | | private Double actualStockArea; |
| | | /** |
| | | * 膜系 |
| | | */ |
| | | private String glassType; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.engineering.service; |
| | | |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-04-22 |
| | | */ |
| | | public interface EngineeringService extends IService<Engineering> { |
| | | |
| | | |
| | | /** |
| | | * 开始/暂停任务 |
| | | * @return boolean |
| | | */ |
| | | boolean changeTask(String projectId, Integer state); |
| | | /** |
| | | * 查询钢化信息 |
| | | * @return List<Engineering> |
| | | */ |
| | | List<Engineering> selectEngineering(String engineeringId); |
| | | /** |
| | | * 保存钢化信息 |
| | | */ |
| | | void saveEngineering(List<Engineering> engineering); |
| | | /** |
| | | * 查询是否有上片任务 |
| | | * @return Engineering |
| | | */ |
| | | Engineering selectInitiate(Integer state); |
| | | |
| | | List<Engineering> selectTask(); |
| | | } |
New file |
| | |
| | | package com.mes.engineering.service.impl; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.engineering.mapper.EngineeringMapper; |
| | | import com.mes.engineering.service.EngineeringService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.mapper.OptimizeProjectMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-04-22 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class EngineeringServiceImpl extends ServiceImpl<EngineeringMapper, Engineering> implements EngineeringService { |
| | | |
| | | @Autowired |
| | | OptimizeProjectMapper optimizeProjectMapper; |
| | | @Autowired |
| | | private EngineeringMapper engineeringMapper; |
| | | |
| | | //开始/暂停任务 |
| | | @Override |
| | | public boolean changeTask(String projectId, Integer state) { |
| | | //暂停正在进行工程 |
| | | LambdaUpdateChainWrapper<Engineering> pauseWrapper = new LambdaUpdateChainWrapper<>(this.getBaseMapper()); |
| | | pauseWrapper.set(Engineering::getState,0); |
| | | pauseWrapper.eq(Engineering::getState,1); |
| | | pauseWrapper.update(); |
| | | //使用projectId作为条件开始工程 |
| | | LambdaUpdateChainWrapper<Engineering> wrapper = new LambdaUpdateChainWrapper<>(this.getBaseMapper()); |
| | | wrapper.set(Engineering::getState,state); |
| | | wrapper.eq(Engineering::getEngineerId,projectId); |
| | | return wrapper.update(); |
| | | } |
| | | |
| | | @Override |
| | | @DS("pp") |
| | | public List<Engineering> selectEngineering(String engineeringId) { |
| | | //查询钢化工程信息 |
| | | List<OptimizeProject> optimizeEngineerings = null; |
| | | if (engineeringId != null) { |
| | | QueryWrapper<OptimizeProject> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("project_no,project_name,avg_cut_pct,valid_cut_pct,last_cut_pct,glass_total,glass_total_area,raw_stock_qty,raw_stock_area,glass_type,remark ") |
| | | .eq("project_no", engineeringId); |
| | | optimizeEngineerings = optimizeProjectMapper.selectList(wrapper); |
| | | |
| | | } |
| | | List<Engineering> resultList=new ArrayList<>(); |
| | | // 遍历查询结果赋值 |
| | | if (optimizeEngineerings != null) { |
| | | for (OptimizeProject map : optimizeEngineerings) { |
| | | // 创建一个新的 OptimizeProject 对象 |
| | | Engineering engineering = new Engineering(); |
| | | // 将 Map 中的每个键值对映射到 OptimizeProject 对象的相应字段上 |
| | | engineering.setEngineerId( map.getProjectNo());//工程id |
| | | engineering.setEngineerName( map.getProjectName());//工程名称 |
| | | engineering.setAvgAvailability( map.getAvgCutPct());//平均优化率 |
| | | engineering.setValidAvailability( map.getValidCutPct());//有效优化率 |
| | | engineering.setLastAvailability( map.getLastCutPct());//尾片优化率 |
| | | engineering.setState(0);//状态 |
| | | engineering.setGlassTotal( map.getGlassTotal());//小片玻璃总数 |
| | | engineering.setGlassTotalArea( map.getGlassTotalArea());//小片总面积 |
| | | engineering.setPlanPatternTotal( map.getRawStockQty());//计划原片总数 |
| | | engineering.setPlanPatternTotalArea( map.getRawStockArea());//计划原片总面积 |
| | | engineering.setFilmsId( map.getGlassType());//膜系 |
| | | engineering.setNotes( map.getRemark());//备注 |
| | | // 将映射后的对象添加到结果列表中 |
| | | resultList.add(engineering); |
| | | } |
| | | } |
| | | log.info("查询出钢化工程集合保存到实体类{}",resultList); |
| | | return resultList; |
| | | } |
| | | |
| | | @Override |
| | | public void saveEngineering(List<Engineering> engineering) { |
| | | this.saveBatch(engineering); |
| | | //保存钢化工程信息 |
| | | } |
| | | |
| | | @Override |
| | | public Engineering selectInitiate(Integer state) { |
| | | //查询是否有开始上片的工程任务 |
| | | QueryWrapper<Engineering> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("state", state); |
| | | return this.getOne(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<Engineering> selectTask() { |
| | | //查询可开始任务的工程 |
| | | QueryWrapper<Engineering> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("state", 0); |
| | | return engineeringMapper.selectList(wrapper); |
| | | } |
| | | |
| | | } |
| | |
| | | /** |
| | | * 流程卡玻璃类型 |
| | | */ |
| | | private Integer glassType; |
| | | private String glassType; |
| | | |
| | | /** |
| | | * 宽 |
| | |
| | | /** |
| | | * 流程卡号 |
| | | */ |
| | | private String projectId; |
| | | private String processId; |
| | | |
| | | /** |
| | | * 工程种类 |
| | |
| | | package com.mes.glassinfo.service; |
| | | |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import java.util.List; |
| | | |
| | |
| | | * @since 2024-04-29 |
| | | */ |
| | | public interface GlassInfoService extends MPJBaseService<GlassInfo> { |
| | | |
| | | /** |
| | | * 查询小片表 |
| | | * @return List<GlassInfo> |
| | | */ |
| | | List<GlassInfo> selectGlassInfo(String engineeringId); |
| | | /** |
| | | * 保存小片表 |
| | | */ |
| | | void saveGlassInfo(List<GlassInfo> glassinfo); |
| | | } |
| | | |
| | |
| | | import com.mes.glassinfo.entity.OptimizeGlassinfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.mapper.OptimizeProjectMapper; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | OptimizeProjectMapper optimizeProjectMapper; |
| | | @Override |
| | | @DS("pp") |
| | | |
| | | public List<GlassInfo> selectGlassInfo(String engineeringId) { |
| | | List<OptimizeGlassinfo> optimizeGlassinfos=null; |
| | | if (engineeringId != null) { |
| | | optimizeGlassinfos = optimizeProjectMapper.selectJoinList(OptimizeGlassinfo.class, new MPJQueryWrapper<OptimizeProject>() |
| | | .select("b.process_id,t.type,b.width,b.height,t.glass_thickness,t.glass_type,b.p_width,b.p_height,b.stock_id,b.heat_layout_id,b.heat_layout_sort,b.x_axis,b.y_axis,b.project_no,b.glass_id") |
| | | .leftJoin("optimize_detail b on t.project_no=b.project_no") |
| | | .eq("t.state",200) |
| | | .eq("t.state",100) |
| | | .eq("t.project_no", engineeringId)); |
| | | } |
| | | |
| | |
| | | GlassInfo glassInfo = new GlassInfo(); |
| | | // 将 Map 中的每个键值对映射到 OptimizeGlassinfo 对象的相应字段上 |
| | | glassInfo.setEngineerId(map.getProjectNo()); |
| | | glassInfo.setFlowCardId(map.getProjectId()); |
| | | glassInfo.setFlowCardId(map.getProcessId()); |
| | | glassInfo.setFilmsid(map.getGlassType()); |
| | | glassInfo.setGlassType(map.getType()); |
| | | glassInfo.setWidth(map.getWidth()); |
| | | glassInfo.setHeight(map.getHeight()); |
| | | glassInfo.setEdgWidth(map.getPWidth()); |
| | | glassInfo.setEdgHeight(map.getPHeight()); |
| | | glassInfo.setThickness(map.getGlassThickness()); |
| | | glassInfo.setPatternSequence(map.getStockId());// |
| | | glassInfo.setTemperingLayoutId(map.getHeatLayoutId());//钢化版图id |
| | |
| | | log.info("查询出glassinfopro的数据{}:",optimizeGlassinfos); |
| | | return resultList; |
| | | } |
| | | |
| | | @Override |
| | | public void saveGlassInfo(List<GlassInfo> glassinfo) { |
| | | this.saveBatch(glassinfo); |
| | | } |
| | | } |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @ApiOperation("显示工程选择信息") |
| | | @PostMapping("/listByState") //显示工程选择信息 |
| | | @ResponseBody |
| | | public Result<List<OptimizeProject>> listByState(@RequestBody OptimizeRequest optimizeRequest) { |
| | | log.info("将请求参数封装在请求类里面"); |
| | | List<OptimizeProject> glass = optimizeProjectService.listByState(optimizeRequest); |
| | |
| | | return Result.build(200, "", glass); |
| | | } |
| | | |
| | | @ApiOperation("保存工程信息") |
| | | @PostMapping("/saveProject") //显示工程选择信息 |
| | | public Result<List<OptimizeProject>> saveProject(@RequestBody OptimizeRequest optimizeRequest) { |
| | | log.info("获取选择好的工程id进行查询数据后保存"); |
| | | List<OptimizeProject> glass = optimizeProjectService.selectSaveProject(optimizeRequest); |
| | | log.info("显示工程选择信息后保存到upPattenUsage表:{}", glass); |
| | | optimizeProjectService.insetupPattenUsage(glass); |
| | | //void insetProject(glass); |
| | | return Result.build(200, "", glass); |
| | | } |
| | | // @ApiOperation("保存工程信息") |
| | | // @PostMapping("/saveProject") //显示工程选择信息 |
| | | // public Result<List<OptimizeProject>> saveProject(@RequestBody OptimizeRequest optimizeRequest) { |
| | | // log.info("获取选择好的工程id进行查询数据后保存"); |
| | | // List<OptimizeProject> glass = optimizeProjectService.selectSaveProject(optimizeRequest); |
| | | // log.info("显示工程选择信息后保存到upPattenUsage表:{}", glass); |
| | | // optimizeProjectService.insetupPattenUsage(glass); |
| | | // //void insetProject(glass); |
| | | // return Result.build(200, "", glass); |
| | | // } |
| | | |
| | | } |
| | | |
| | |
| | | /** |
| | | * 第一次平均切裁率 |
| | | */ |
| | | private String fristCutPct; |
| | | private Double fristCutPct; |
| | | |
| | | /** |
| | | * 使用的原料数 |
| | |
| | | /** |
| | | * 使用的原料面积 |
| | | */ |
| | | private String rawStockArea; |
| | | private Double rawStockArea; |
| | | |
| | | /** |
| | | * 平均切裁率 |
| | | */ |
| | | private String avgCutPct; |
| | | private Double avgCutPct; |
| | | |
| | | /** |
| | | * 有效切裁率 |
| | | */ |
| | | private String validCutPct; |
| | | private Double validCutPct; |
| | | |
| | | /** |
| | | * 尾片切裁率 |
| | | */ |
| | | private String lastCutPct; |
| | | private Double lastCutPct; |
| | | |
| | | /** |
| | | * g混排程度 |
| | |
| | | /** |
| | | * g上片宽 |
| | | */ |
| | | private Float loadWidth; |
| | | private Double loadWidth; |
| | | |
| | | /** |
| | | * g上片长 |
| | | */ |
| | | private Float loadLength; |
| | | private Double loadLength; |
| | | |
| | | /** |
| | | * x间隔 |
| | | */ |
| | | private Float xSpace; |
| | | private Double xSpace; |
| | | |
| | | /** |
| | | * y间隔 |
| | | */ |
| | | private Float ySpace; |
| | | private Double ySpace; |
| | | |
| | | /** |
| | | * g平均装载率 |
| | | */ |
| | | private Float loadRate; |
| | | private Double loadRate; |
| | | |
| | | /** |
| | | * 流程卡集合 |
| | |
| | | package com.mes.pp.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.entity.request.OptimizeRequest; |
| | |
| | | |
| | | /** |
| | | * 查询可领取的任务工程信息 |
| | | * @return |
| | | * @return List<OptimizeProject> |
| | | */ |
| | | List<OptimizeProject> listByState(OptimizeRequest optimizeRequest); |
| | | |
| | | /** |
| | | * 查询保存到原片使用详情表的数据 |
| | | * @return |
| | | * 将工程信息更新状态为已领取 |
| | | */ |
| | | List<OptimizeProject> selectSaveProject(OptimizeRequest optimizeRequest); |
| | | /** |
| | | * 将工程信息保存到原片使用详情表 |
| | | * @return |
| | | */ |
| | | void insetupPattenUsage(List<OptimizeProject> glass); |
| | | void changeTask(String engineeringId, int i); |
| | | } |
| | |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.entity.request.OptimizeRequest; |
| | | import com.mes.pp.mapper.OptimizeProjectMapper; |
| | | import com.mes.pp.service.OptimizeProjectService; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import com.mes.uppattenusage.mapper.UpPattenUsageMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | @Override |
| | | public void insetupPattenUsage(List<OptimizeProject> glass) { |
| | | log.info("循环查询结果保存到UpPattenUsage表中"); |
| | | for (OptimizeProject project : glass) { |
| | | UpPattenUsage upPattenUsage = new UpPattenUsage(); |
| | | upPattenUsage.setEngineeringId(project.getProjectNo()); |
| | | upPattenUsage.setFilmsId(project.getGlassType()); |
| | | upPattenUsage.setState(project.getState()); |
| | | upPattenUsageMapper.insert(upPattenUsage); |
| | | } |
| | | public void changeTask(String engineeringId, int state) { |
| | | UpdateWrapper<OptimizeProject> wrapper = new UpdateWrapper<>(); |
| | | wrapper.eq("project_no",engineeringId) |
| | | .set("state",state); |
| | | boolean updateSuccess = this.update(wrapper); |
| | | log.info("工程表更新状态{}",updateSuccess); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<OptimizeProject> selectSaveProject(OptimizeRequest optimizeRequest) { |
| | | log.info("将参数传入到查询类里,工程号做非空判断模糊查询"); |
| | | |
| | | log.info("返回工程信息"); |
| | | return this.baseMapper.saveProject(optimizeRequest); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.mes.uppattenusage.controller; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.engineering.service.EngineeringService; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.service.OptimizeProjectService; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.uppattenusage.service.UpPattenUsageService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | // |
| | | //import com.mes.uppattenusage.service.GlassInfoService; |
| | | //import com.mes.uppattenusage.entity.OptimizeUpPattenUsage; |
| | | //import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | //import com.mes.glassinfo.entity.GlassInfo; |
| | | //import com.mes.uppattenusage.service.UpPattenUsageService; |
| | | //import com.mes.utils.Result; |
| | | //import io.swagger.annotations.ApiOperation; |
| | | //import lombok.extern.slf4j.Slf4j; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.web.bind.annotation.GetMapping; |
| | | //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-18 |
| | | // */ |
| | | //@RestController |
| | | //@RequestMapping("/up-patten-usage") |
| | | //@Slf4j |
| | | //public class UpPattenUsageController { |
| | | // |
| | | // @Autowired |
| | | // private UpPattenUsageService upPattenUsageService; |
| | | // @Autowired |
| | | // private GlassInfoService glassInfoService; |
| | | // @ApiOperation("显示正在出片的工程信息") |
| | | // @GetMapping("/prioritylist") //查询现在上片机的玻璃信息 |
| | | // public Result<List<UpPattenUsage>> prioritylist() { |
| | | // List<UpPattenUsage> glass = upPattenUsageService.prioritylist(1); |
| | | // log.info("显示工位上的玻璃信息:{}", glass); |
| | | // return Result.build(200, "", glass); |
| | | // } |
| | | // |
| | | // @ApiOperation("点击选择工程保存后进行调用,传入工程号") |
| | | // @GetMapping("/saveUpPattenUsage") //查询现在上片机的玻璃信息 |
| | | // public Result<Integer> saveUpPattenUsage(String engineeringId) { |
| | | // List<UpPattenUsage> upPattenUsages = upPattenUsageService.selectSaveUpPattenUsage(engineeringId); |
| | | // log.info("将查询出的UpPattenUsage数据保存到数据库表里"); |
| | | // upPattenUsageService.saveUpPattenUsage(upPattenUsages); |
| | | // log.info("从PP表查询glassinfo的数据并保存到表里"); |
| | | // List<GlassInfo> glassinfo=glassInfoService.selectGlassInfo(engineeringId); |
| | | // return Result.build(200, "", 200); |
| | | // } |
| | | //} |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-04-18 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/up-patten-usage") |
| | | @Slf4j |
| | | public class UpPattenUsageController { |
| | | |
| | | @Autowired |
| | | private UpPattenUsageService upPattenUsageService; |
| | | @Autowired |
| | | private GlassInfoService glassInfoService; |
| | | @Autowired |
| | | private EngineeringService engineeringService; |
| | | @Autowired |
| | | private OptimizeProjectService optimizeProjectService; |
| | | @ApiOperation("显示正在出片的工程信息") |
| | | @GetMapping("/prioritylist") //查询现在上片机的玻璃信息 |
| | | @ResponseBody |
| | | public Result<List<UpPattenUsage>> prioritylist() { |
| | | List<UpPattenUsage> glass = upPattenUsageService.prioritylist(); |
| | | log.info("显示正在出片的工程信息:{}", glass); |
| | | return Result.build(200, "", glass); |
| | | } |
| | | |
| | | @ApiOperation("点击选择工程保存后进行调用,传入工程号") |
| | | @PostMapping("/saveUpPattenUsage") //查询现在上片机的玻璃信息 |
| | | @ResponseBody |
| | | public Result<Engineering> saveUpPattenUsage(@RequestBody Engineering engineering) { |
| | | log.info("engineeringId:{}", engineering); |
| | | UpPattenUsage upPattenUsage= upPattenUsageService.selectedEngineering(engineering.getEngineerId()); |
| | | if (upPattenUsage!=null){ |
| | | log.info("已保存过"); |
| | | return Result.build(200, "已保存的工程", null); |
| | | }else { |
| | | List<UpPattenUsage> upPattenUsages = upPattenUsageService.selectSaveUpPattenUsage(engineering.getEngineerId()); |
| | | log.info("将查询出的UpPattenUsage数据保存到数据库表里"); |
| | | upPattenUsageService.saveUpPattenUsage(upPattenUsages); |
| | | log.info("从PP表查询glassinfo的数据并保存到表里"); |
| | | List<GlassInfo> glassinfo=glassInfoService.selectGlassInfo(engineering.getEngineerId()); |
| | | glassInfoService.saveGlassInfo(glassinfo); |
| | | log.info("从PP表查询engineering的数据并保存到表里"); |
| | | List<Engineering> listengineering= engineeringService.selectEngineering(engineering.getEngineerId()); |
| | | engineeringService.saveEngineering(listengineering); |
| | | log.info("更改pp表状态为已领取"); |
| | | optimizeProjectService.changeTask(engineering.getEngineerId(), 200); |
| | | // List<UpPattenUsage> data=upPattenUsageService.prioritylist(); |
| | | // log.info("显示保存后的上片顺序表"); |
| | | return Result.build(200, "", engineering); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | /** |
| | | * 原片版图片序 |
| | | */ |
| | | private Integer heatLayoutSort; |
| | | private Integer stockId; |
| | | |
| | | /** |
| | | * 状态 |
| | |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-04-18 |
| | | */ |
| | | public interface UpPattenUsageService extends MPJBaseService<UpPattenUsage> { |
| | | List<UpPattenUsage> prioritylist(int state); |
| | | |
| | | /** |
| | | * 查询工位上的玻璃信息 |
| | | * @return List<UpPattenUsage> |
| | | */ |
| | | List<UpPattenUsage> prioritylist(); |
| | | /** |
| | | * 查询上片顺序信息 |
| | | * @return List<UpPattenUsage> |
| | | */ |
| | | List<UpPattenUsage> selectSaveUpPattenUsage(String engineeringId); |
| | | |
| | | /** |
| | | * 保存上片顺序信息 |
| | | */ |
| | | void saveUpPattenUsage(List<UpPattenUsage> upPattenUsages); |
| | | /** |
| | | * 更新上片表状态 |
| | | */ |
| | | void updateUpPattenUsageState(UpPattenUsage upPattenUsage, Integer state); |
| | | /** |
| | | * 判断此工程是否已保存过 |
| | | * @return UpPattenUsage |
| | | */ |
| | | UpPattenUsage selectedEngineering(String engineeringId); |
| | | /** |
| | | * 查询正在执行的上片任务 |
| | | * @return UpPattenUsage |
| | | */ |
| | | UpPattenUsage selectOverTask(); |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.engineering.service.EngineeringService; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.mapper.OptimizeProjectMapper; |
| | | import com.mes.uppattenusage.entity.OptimizeUpPattenUsage; |
| | |
| | | |
| | | @Autowired |
| | | OptimizeProjectMapper optimizeProjectMapper; |
| | | @Autowired |
| | | EngineeringService engineeringService; |
| | | @Override |
| | | public List<UpPattenUsage> prioritylist(int state) { |
| | | log.info("将参数传入到查询类里,工程号做非空判断模糊查询"); |
| | | LambdaQueryWrapper<UpPattenUsage> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(UpPattenUsage::getState,state); |
| | | log.info("返回工程信息"); |
| | | return this.list(wrapper); |
| | | public List<UpPattenUsage> prioritylist() { |
| | | //获取正在上片的任务id |
| | | Engineering engineering= engineeringService.selectInitiate(1); |
| | | log.info("将参数传入到查询类里{}",engineering); |
| | | if(engineering!=null){ |
| | | LambdaQueryWrapper<UpPattenUsage> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(UpPattenUsage::getEngineeringId,engineering.getEngineerId()); |
| | | return this.list(wrapper); |
| | | }else { |
| | | return null; |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | List<OptimizeUpPattenUsage> upPattenUsageList = null; |
| | | if (engineeringId != null) { |
| | | upPattenUsageList = optimizeProjectMapper.selectJoinList(OptimizeUpPattenUsage.class, new MPJQueryWrapper<OptimizeProject>() |
| | | .select("t.project_no,t.glass_type,b.width,b.height,REGEXP_REPLACE(t.glass_thickness,'\\D','')as glass_thickness,b.heat_layout_sort") |
| | | .select("t.project_no,t.glass_type,b.width,b.height,REGEXP_REPLACE(t.glass_thickness,'\\D','')as glass_thickness,b.stock_id") |
| | | .leftJoin("optimize_layout b on t.project_no=b.project_no") |
| | | .eq("b.project_no", engineeringId)); |
| | | } |
| | |
| | | // 创建一个新的 OptimizeProject 对象 |
| | | UpPattenUsage optimizeProject = new UpPattenUsage(); |
| | | // 将 Map 中的每个键值对映射到 OptimizeProject 对象的相应字段上 |
| | | optimizeProject.setEngineeringId((String) map.getProjectNo()); |
| | | optimizeProject.setFilmsId((String) map.getGlassType()); |
| | | optimizeProject.setWidth((Double) map.getWidth()); |
| | | optimizeProject.setHeight((Double) map.getHeight()); |
| | | optimizeProject.setThickness((Double)map.getHeight()); |
| | | optimizeProject.setLayoutSequence((Integer) map.getHeatLayoutSort()); |
| | | optimizeProject.setEngineeringId(map.getProjectNo()); |
| | | optimizeProject.setFilmsId( map.getGlassType()); |
| | | optimizeProject.setWidth(map.getWidth()); |
| | | optimizeProject.setHeight( map.getHeight()); |
| | | optimizeProject.setThickness(map.getGlassThickness()); |
| | | optimizeProject.setLayoutSequence( map.getStockId()); |
| | | optimizeProject.setState(0); |
| | | // 将映射后的对象添加到结果列表中 |
| | | resultList.add(optimizeProject); |
| | |
| | | //保存原片使用详情表 |
| | | } |
| | | |
| | | //@Override |
| | | public void selectSaveGlassinfo(String engineeringId) { |
| | | //保存玻璃信息表 |
| | | //optimizeProjectMapper.selectJoinList(); |
| | | @Override |
| | | public void updateUpPattenUsageState(UpPattenUsage upPattenUsage, Integer state) { |
| | | upPattenUsage.setState(state); |
| | | boolean updateSuccess=this.updateById(upPattenUsage); |
| | | log.info("更新状态{}",updateSuccess); |
| | | //更新状态 |
| | | } |
| | | |
| | | @Override |
| | | public UpPattenUsage selectedEngineering(String engineeringId) { |
| | | QueryWrapper<UpPattenUsage>wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("engineering_id",engineeringId) |
| | | .last("limit 1"); |
| | | return this.getOne(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public UpPattenUsage selectOverTask() { |
| | | QueryWrapper<UpPattenUsage>wrapper = new QueryWrapper<>(); |
| | | wrapper.gt("state",0) |
| | | .lt("state",99) |
| | | .last("limit 1"); |
| | | return this.getOne(wrapper); |
| | | } |
| | | |
| | | |
| | |
| | | .antMatchers("/webjars/**").permitAll() |
| | | .antMatchers("/v2/**").permitAll() |
| | | .antMatchers("/swagger-resources/**").permitAll() |
| | | .antMatchers("/**").permitAll() |
| | | .anyRequest().authenticated() |
| | | |
| | | // 异常处理器 |
| | |
| | | //放行 |
| | | filterChain.doFilter(request, response); |
| | | } |
| | | } |
| | | } |
| | |
| | | spring: |
| | | datasource: |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8&characterEncoding=utf-8&useSSL=false |
| | | url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8&characterEncoding=utf-8&useSSL=false |
| | | username: root |
| | | password: beibo.123/ |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | server-addr: 10.153.19.150:8848 |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | host: 10.153.19.150 |
| | | port: 6379 |
| | | password: 123456 |
| | |
| | | |
| | | public static void main(String[] args) { |
| | | try { |
| | | // 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()); |
New file |
| | |
| | | package com.mes.edgglasstask.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-05-11 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/edgGlassTaskInfo") |
| | | public class EdgGlassTaskInfoController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.edgglasstask.entity; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-05-11 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class EdgGlassTaskInfo implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private String glassId; |
| | | |
| | | private Integer width; |
| | | |
| | | private Integer height; |
| | | |
| | | private Integer thickness; |
| | | |
| | | private Integer glassType; |
| | | |
| | | private Integer status; |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.edgglasstask.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.edgglasstask.entity.EdgGlassTaskInfo; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-05-11 |
| | | */ |
| | | @DS("salve_hangzhoumes") |
| | | public interface EdgGlassTaskInfoMapper extends BaseMapper<EdgGlassTaskInfo> { |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.edgglasstask.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.edgglasstask.entity.EdgGlassTaskInfo; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-05-11 |
| | | */ |
| | | public interface EdgGlassTaskInfoService extends IService<EdgGlassTaskInfo> { |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.edgglasstask.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.edgglasstask.entity.EdgGlassTaskInfo; |
| | | import com.mes.edgglasstask.mapper.EdgGlassTaskInfoMapper; |
| | | import com.mes.edgglasstask.service.EdgGlassTaskInfoService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-05-11 |
| | | */ |
| | | @Service |
| | | public class EdgGlassTaskInfoServiceImpl extends ServiceImpl<EdgGlassTaskInfoMapper, EdgGlassTaskInfo> implements EdgGlassTaskInfoService { |
| | | |
| | | } |
| | |
| | | package com.mes.edgstoragecage.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; |
| | |
| | | * 玻璃间隙 |
| | | */ |
| | | private Integer gap; |
| | | /** |
| | | * 玻璃间隙 |
| | | */ |
| | | @TableField(exist = false) |
| | | private Integer count; |
| | | |
| | | |
| | | } |
| | |
| | | /** |
| | | * 查询笼内版图差值范围内的 此尺寸玻璃 如无则按照 钢化版图序号 以及玻璃序号 |
| | | * @param glassId |
| | | * @param poor |
| | | * @param threshold |
| | | * @return |
| | | */ |
| | | EdgStorageCageDetails selectConformGlass(String glassId, int poor); |
| | | EdgStorageCageDetails selectConformGlass(String glassId, int threshold); |
| | | |
| | | /** |
| | | * 获取出片信息数据 |
| | | * @param glassId |
| | | * @param poor |
| | | * @param threshold |
| | | * @return |
| | | */ |
| | | EdgStorageCageDetails selectOutGlass(String glassId, int poor); |
| | | EdgStorageCageDetails selectOutGlass(String glassId, int threshold); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 查询笼内版图差值范围内的 此尺寸玻璃 如无则按照 钢化版图序号 以及玻璃序号 |
| | | * |
| | | * @param glassId |
| | | * @param poor |
| | | * @param threshold |
| | | * @return |
| | | */ |
| | | @Override |
| | | public EdgStorageCageDetails selectConformGlass(String glassId, int poor){ |
| | | public EdgStorageCageDetails selectConformGlass(String glassId, int threshold) { |
| | | //1.去笼内查询此尺寸的玻璃 目前版图差值内的玻璃 是否有同尺寸的 |
| | | //1.1 有同尺寸的 则生成同尺寸的任务 |
| | | //1.2 无同尺寸的 则生成版图顺序最小的出片 |
| | | EdgStorageCageDetails edgStorageCageDetails= baseMapper.selectOne(new MPJLambdaQueryWrapper<EdgStorageCageDetails>() |
| | | EdgStorageCageDetails edgStorageCageDetails = baseMapper.selectOne(new MPJLambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .selectAll(EdgStorageCageDetails.class) |
| | | .eq(EdgStorageCageDetails::getGlassId,glassId) |
| | | .eq(EdgStorageCageDetails::getGlassId, glassId) |
| | | ); |
| | | List<EdgStorageCageDetails> listEdgStorageCageDetails= baseMapper.selectList(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getState,100) |
| | | .orderByAsc(EdgStorageCageDetails::getTemperingLayoutId,EdgStorageCageDetails::getTemperingFeedSequence) |
| | | List<EdgStorageCageDetails> listEdgStorageCageDetails = baseMapper.selectList(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .lt(EdgStorageCageDetails::getState, 200) |
| | | .orderByAsc(EdgStorageCageDetails::getTemperingLayoutId, EdgStorageCageDetails::getTemperingFeedSequence) |
| | | ); |
| | | EdgStorageCageDetails minTemperingLayoutId=new EdgStorageCageDetails(); |
| | | if(!listEdgStorageCageDetails.isEmpty()){ |
| | | minTemperingLayoutId=listEdgStorageCageDetails.get(0); |
| | | EdgStorageCageDetails minTemperingLayoutId = new EdgStorageCageDetails(); |
| | | if (!listEdgStorageCageDetails.isEmpty()) { |
| | | minTemperingLayoutId = listEdgStorageCageDetails.get(0); |
| | | } |
| | | EdgStorageCageDetails result=new EdgStorageCageDetails(); |
| | | boolean a=minTemperingLayoutId!=null; |
| | | if(edgStorageCageDetails!=null&&minTemperingLayoutId!=null){ |
| | | List <EdgStorageCageDetails> list= edgStorageCageMapper.selectJoinList(EdgStorageCageDetails.class,new MPJLambdaWrapper<EdgStorageCage>() |
| | | EdgStorageCageDetails result = new EdgStorageCageDetails(); |
| | | if (edgStorageCageDetails != null && minTemperingLayoutId != null) { |
| | | result = edgStorageCageMapper.selectJoinOne(EdgStorageCageDetails.class, new MPJLambdaWrapper<EdgStorageCage>() |
| | | .selectAll(EdgStorageCageDetails.class) |
| | | .leftJoin(EdgStorageCageDetails.class,on->on |
| | | .eq(EdgStorageCageDetails::getDeviceId,EdgStorageCage::getDeviceId) |
| | | .eq(EdgStorageCageDetails::getSlot,EdgStorageCage::getSlot)) |
| | | .leftJoin(EdgStorageCageDetails.class, on -> on |
| | | .eq(EdgStorageCageDetails::getDeviceId, EdgStorageCage::getDeviceId) |
| | | .eq(EdgStorageCageDetails::getSlot, EdgStorageCage::getSlot)) |
| | | .isNotNull(EdgStorageCageDetails::getSlot) |
| | | .eq(EdgStorageCageDetails::getWidth,edgStorageCageDetails.getWidth()) |
| | | .eq(EdgStorageCageDetails::getHeight,edgStorageCageDetails.getHeight()) |
| | | .ge(EdgStorageCageDetails::getTemperingLayoutId,minTemperingLayoutId.getTemperingLayoutId()) |
| | | .le(EdgStorageCageDetails::getTemperingLayoutId,minTemperingLayoutId.getTemperingLayoutId()+poor) |
| | | .orderByAsc(EdgStorageCageDetails::getTemperingLayoutId,EdgStorageCageDetails::getTemperingFeedSequence) |
| | | .eq(EdgStorageCageDetails::getWidth, edgStorageCageDetails.getWidth()) |
| | | .eq(EdgStorageCageDetails::getHeight, edgStorageCageDetails.getHeight()) |
| | | .ge(EdgStorageCageDetails::getTemperingLayoutId, minTemperingLayoutId.getTemperingLayoutId()) |
| | | .le(EdgStorageCageDetails::getTemperingLayoutId, minTemperingLayoutId.getTemperingLayoutId() + threshold) |
| | | .orderByAsc(EdgStorageCageDetails::getTemperingLayoutId, EdgStorageCageDetails::getTemperingFeedSequence) |
| | | ); |
| | | if(!list.isEmpty()){ |
| | | result=list.get(0); |
| | | } |
| | | } |
| | | |
| | | if (result==null){ |
| | | result=edgStorageCageMapper.selectJoinOne(EdgStorageCageDetails.class,new MPJLambdaWrapper<EdgStorageCage>() |
| | | if (result == null) { |
| | | result = edgStorageCageMapper.selectJoinOne(EdgStorageCageDetails.class, new MPJLambdaWrapper<EdgStorageCage>() |
| | | .selectAll(EdgStorageCageDetails.class) |
| | | .leftJoin(EdgStorageCageDetails.class,on->on |
| | | .eq(EdgStorageCageDetails::getDeviceId,EdgStorageCage::getDeviceId) |
| | | .eq(EdgStorageCageDetails::getSlot,EdgStorageCage::getSlot)) |
| | | .leftJoin(EdgStorageCageDetails.class, on -> on |
| | | .eq(EdgStorageCageDetails::getDeviceId, EdgStorageCage::getDeviceId) |
| | | .eq(EdgStorageCageDetails::getSlot, EdgStorageCage::getSlot)) |
| | | .isNotNull(EdgStorageCageDetails::getSlot) |
| | | .orderByAsc(EdgStorageCageDetails::getTemperingLayoutId,EdgStorageCageDetails::getTemperingFeedSequence) |
| | | .orderByAsc(EdgStorageCageDetails::getTemperingLayoutId, EdgStorageCageDetails::getTemperingFeedSequence) |
| | | ); |
| | | } |
| | | return result; |
| | |
| | | * 查询笼内版图差值范围内的 此尺寸玻璃 如无则按照 钢化版图序号 以及玻璃序号 |
| | | * |
| | | * @param glassId |
| | | * @param poor |
| | | * @param threshold |
| | | * @return |
| | | */ |
| | | @Override |
| | | public EdgStorageCageDetails selectOutGlass(String glassId, int poor) { |
| | | public EdgStorageCageDetails selectOutGlass(String glassId, int threshold) { |
| | | EdgStorageCageDetails oldEdgStorageCageDetails = null; |
| | | if (StringUtils.isNotEmpty(glassId)) { |
| | | oldEdgStorageCageDetails = baseMapper.selectOne(new MPJLambdaQueryWrapper<EdgStorageCageDetails>() |
| | |
| | | |
| | | EdgStorageCageDetails outEdgStorageCageDetails = null; |
| | | |
| | | //todo:获取笼子内最大版图id和最小版图id插值,判断是否大于阈值,大于阈值直接出最小版图玻璃 |
| | | //todo:逻辑1:获取两条线已出最后一块玻璃在笼内相同尺寸所剩数量,优先走数量少的线 |
| | | //todo:逻辑2:优先走空闲的线 |
| | | //todo:需要在卧式理片笼详情表中新增状态,用来表示玻璃进出理片笼情况 |
| | | if (oldEdgStorageCageDetails != null && minTemperingLayoutId != null) { |
| | | log.info("按照上一片已出玻璃宽度{},高度{},及版图id区间{}到{}获取出片任务玻璃信息", oldEdgStorageCageDetails.getWidth() |
| | | , oldEdgStorageCageDetails.getHeight(), minTemperingLayoutId.getTemperingLayoutId(), minTemperingLayoutId.getTemperingLayoutId() + poor); |
| | | outEdgStorageCageDetails = this.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .notIn(CollectionUtils.isNotEmpty(glassIds), EdgStorageCageDetails::getGlassId, glassIds) |
| | | .eq(EdgStorageCageDetails::getWidth, oldEdgStorageCageDetails.getWidth()) |
| | | .eq(EdgStorageCageDetails::getHeight, oldEdgStorageCageDetails.getHeight()) |
| | | .orderByAsc(EdgStorageCageDetails::getTemperingLayoutId, EdgStorageCageDetails::getTemperingFeedSequence) |
| | | .last("limit 1")); |
| | | log.info("出片任务的玻璃信息:{}", outEdgStorageCageDetails); |
| | | } |
| | | // if (queryMaxMinDiff(threshold)) |
| | | //todo:逻辑1:获取两条线已出最后一块玻璃在笼内相同尺寸所剩数量,优先走数量少的线 |
| | | //todo:需要在卧式理片笼详情表中新增状态,用来表示玻璃进出理片笼情况 |
| | | if (oldEdgStorageCageDetails != null && minTemperingLayoutId != null) { |
| | | log.info("按照上一片已出玻璃宽度{},高度{},及版图id区间{}到{}获取出片任务玻璃信息", oldEdgStorageCageDetails.getWidth() |
| | | , oldEdgStorageCageDetails.getHeight(), minTemperingLayoutId.getTemperingLayoutId(), minTemperingLayoutId.getTemperingLayoutId() + threshold); |
| | | outEdgStorageCageDetails = this.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .notIn(CollectionUtils.isNotEmpty(glassIds), EdgStorageCageDetails::getGlassId, glassIds) |
| | | .eq(EdgStorageCageDetails::getWidth, oldEdgStorageCageDetails.getWidth()) |
| | | .eq(EdgStorageCageDetails::getHeight, oldEdgStorageCageDetails.getHeight()) |
| | | .orderByAsc(EdgStorageCageDetails::getTemperingLayoutId, EdgStorageCageDetails::getTemperingFeedSequence) |
| | | .last("limit 1")); |
| | | log.info("出片任务的玻璃信息:{}", outEdgStorageCageDetails); |
| | | } |
| | | if (outEdgStorageCageDetails == null) { |
| | | outEdgStorageCageDetails = minTemperingLayoutId; |
| | | } |
| | | return outEdgStorageCageDetails; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | |
| | | @Override |
| | | public EdgStorageCage selectNearestEmpty(int currentSlot) { |
| | | return this.selectJoinOne(EdgStorageCage.class,new MPJLambdaWrapper<EdgStorageCage>() |
| | | return this.selectJoinOne(EdgStorageCage.class, new MPJLambdaWrapper<EdgStorageCage>() |
| | | .selectAll(EdgStorageCage.class) |
| | | .leftJoin(EdgStorageCageDetails.class,on->on |
| | | .eq(EdgStorageCageDetails::getSlot,EdgStorageCage::getSlot) |
| | | .leftJoin(EdgStorageCageDetails.class, on -> on |
| | | .eq(EdgStorageCageDetails::getSlot, EdgStorageCage::getSlot) |
| | | .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)) |
| | | .isNull(EdgStorageCageDetails::getSlot) |
| | | .last("order by abs(slot - 4) asc limit 1") |
| | | .last("order by abs(t.slot - " + currentSlot + ") asc limit 1") |
| | | ); |
| | | } |
| | | |
| | | /** |
| | | * 查询笼内空格 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<EdgStorageCage> selectCacheEmpty(){ |
| | | return baseMapper.selectJoinList(EdgStorageCage.class,new MPJLambdaWrapper<EdgStorageCage>() |
| | | public List<EdgStorageCage> selectCacheEmpty() { |
| | | return baseMapper.selectJoinList(EdgStorageCage.class, new MPJLambdaWrapper<EdgStorageCage>() |
| | | .selectAll(EdgStorageCage.class) |
| | | .leftJoin(EdgStorageCageDetails.class,on->on |
| | | .eq(EdgStorageCageDetails::getSlot,EdgStorageCage::getSlot) |
| | | .eq(EdgStorageCageDetails::getState,"100")) |
| | | .leftJoin(EdgStorageCageDetails.class, on -> on |
| | | .eq(EdgStorageCageDetails::getSlot, EdgStorageCage::getSlot) |
| | | .eq(EdgStorageCageDetails::getState, "100")) |
| | | .isNull(EdgStorageCageDetails::getSlot) |
| | | .last("order by abs(slot - 4) asc") |
| | | .last("order by abs(t.slot - 4) asc") |
| | | ); |
| | | } |
| | | |
| | | /** |
| | | * 查询笼内出片任务 按钢化版图号+版图内序号 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> selectCacheOut(){ |
| | | 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)) |
| | | .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) |
| | |
| | | |
| | | /** |
| | | * 理片缓存详情 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> selectEdgStorageCages(){ |
| | | 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)) |
| | | .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") |
| | |
| | | |
| | | /** |
| | | * 修改理片笼信息 功能:对笼内栅格玻璃 【启用/禁用】 |
| | | * |
| | | * @param edgStorageCage |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean updateEdgStorageCage(EdgStorageCage edgStorageCage){ |
| | | EdgStorageCage edgItem=baseMapper.selectById(edgStorageCage.getId()); |
| | | public boolean updateEdgStorageCage(EdgStorageCage edgStorageCage) { |
| | | EdgStorageCage edgItem = baseMapper.selectById(edgStorageCage.getId()); |
| | | edgItem.setEnableState(edgStorageCage.getEnableState()); |
| | | baseMapper.updateById(edgItem); |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | *修改理片笼信息 功能:对笼内栅格玻璃 【添加/删除/更换】 |
| | | * 修改理片笼信息 功能:对笼内栅格玻璃 【添加/删除/更换】 |
| | | * |
| | | * @param edgStorageCageId |
| | | * @param edgStorageCageDetails |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean updateEdgStorageCageDetails(int edgStorageCageId,EdgStorageCageDetails edgStorageCageDetails){ |
| | | EdgStorageCage edgItem=baseMapper.selectById(edgStorageCageId); |
| | | log.info("正常"+edgItem); |
| | | EdgStorageCageDetails edgDItem=edgStorageCageDetailsMapper.selectById(edgStorageCageDetails.getId()); |
| | | if (edgItem!=null){ |
| | | public boolean updateEdgStorageCageDetails(int edgStorageCageId, EdgStorageCageDetails edgStorageCageDetails) { |
| | | EdgStorageCage edgItem = baseMapper.selectById(edgStorageCageId); |
| | | log.info("正常" + edgItem); |
| | | EdgStorageCageDetails edgDItem = edgStorageCageDetailsMapper.selectById(edgStorageCageDetails.getId()); |
| | | if (edgItem != null) { |
| | | //移除 |
| | | EdgStorageCageDetails result=edgStorageCageDetailsMapper.selectOne(new MPJLambdaWrapper<EdgStorageCageDetails>().eq(EdgStorageCageDetails::getSlot,edgStorageCageId)); |
| | | if (result!=null){ |
| | | EdgStorageCageDetails result = edgStorageCageDetailsMapper.selectOne(new MPJLambdaWrapper<EdgStorageCageDetails>().eq(EdgStorageCageDetails::getSlot, edgStorageCageId)); |
| | | if (result != null) { |
| | | result.setSlot(0); |
| | | edgStorageCageDetailsMapper.updateById(result); |
| | | } |
| | | //添加 |
| | | if(edgDItem!=null){ |
| | | if (edgDItem != null) { |
| | | //只传格子 :移除玻璃 |
| | | EdgStorageCageDetails newresult=edgStorageCageDetailsMapper.selectById(edgStorageCageDetails.getId()); |
| | | EdgStorageCageDetails newresult = edgStorageCageDetailsMapper.selectById(edgStorageCageDetails.getId()); |
| | | newresult.setSlot(edgItem.getSlot()); |
| | | edgStorageCageDetailsMapper.updateById(newresult); |
| | | } |
| | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.lang.Assert; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.edgglasstask.entity.EdgGlassTaskInfo; |
| | | import com.mes.edgglasstask.service.EdgGlassTaskInfoService; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import com.mes.taskcache.service.TaskCacheService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | |
| | | @Autowired |
| | | EdgStorageCageDetailsService edgStorageCageDetailsService; |
| | | |
| | | @Autowired |
| | | EdgGlassTaskInfoService edgGlassTaskInfoService; |
| | | |
| | | @Value("${mes.threshold}") |
| | | private int threshold; |
| | | |
| | | @Value("${mes.ratio}") |
| | | private int ratio; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void plcHomeEdgTask() { |
| | |
| | | String taskRequestTypeValue = plcParameterObject.getPlcParameter("A06_request_word").getValue(); |
| | | String glassIdeValue = plcParameterObject.getPlcParameter("A05_scanning_ID").getValue(); |
| | | String confirmationWrodValue = plcParameterObject.getPlcParameter("MES_confirmation_word").getValue(); |
| | | // 1为A09空闲,2为A10空闲,3为A09A10都空闲,0为A09A10都有玻璃 |
| | | String outGlassstate = plcParameterObject.getPlcParameter("A09_glass_status").getValue(); |
| | | //A08 A09表示线路相同 可做等价 无数据转int异常 |
| | | String out08Glassstate = plcParameterObject.getPlcParameter("A08_glass_status").getValue(); |
| | | String out10Glassstate = plcParameterObject.getPlcParameter("A10_glass_status").getValue(); |
| | | String confirmationWrodAddress = plcParameterObject.getPlcParameter("MES_confirmation_word").getAddress(); |
| | | String currentSlot = plcParameterObject.getPlcParameter("Current_slot").getValue(); |
| | | log.info("1、获取到的请求字为:{},获取到的扫描ID为:{},获取到的确认字为:{},获取到的出片状态为:{},当前格子号为:{}", |
| | | taskRequestTypeValue, glassIdeValue, confirmationWrodValue, outGlassstate, currentSlot); |
| | | |
| | | // String taskRequestTypeValue = "2"; |
| | | // String glassIdeValue = "2222222222"; |
| | | // String confirmationWrodValue = "0"; |
| | | // //A08 A09表示线路相同 可做等价 |
| | | // Integer out08Glassstate = 1; |
| | | // Integer out10Glassstate = 0; |
| | | // String confirmationWrodAddress = "DB11.38"; |
| | | // String currentSlot = "1"; |
| | | |
| | | |
| | | log.info("1、获取到的请求字为:{},获取到的扫描ID为:{},获取到的确认字为:{},获取到的出片状态分别为:A09:{}、A10:{},当前格子号为:{}", |
| | | taskRequestTypeValue, glassIdeValue, confirmationWrodValue, out08Glassstate, out10Glassstate, currentSlot); |
| | | |
| | | if ("0".equals(taskRequestTypeValue)) { |
| | | if ("0".equals(confirmationWrodValue)) { |
| | |
| | | S7object.getinstance().plccontrol.WriteWord(confirmationWrodAddress, (short) 0); |
| | | return; |
| | | } |
| | | |
| | | if ("1".equals(taskRequestTypeValue)) { |
| | | log.info("3、进片请求,且确认字为0,执行进片任务"); |
| | | log.info("2、进片请求,且确认字为0,执行进片任务"); |
| | | inTo(glassIdeValue, confirmationWrodAddress, currentSlot); |
| | | } else if ("2".equals(taskRequestTypeValue)) { |
| | | //09空闲 :1 10空闲 :2 都空闲:3 其他0 |
| | | log.info("3、出片请求,且确认字为0,执行进片任务"); |
| | | outTo(Integer.parseInt(outGlassstate), confirmationWrodAddress, currentSlot); |
| | | log.info("2、出片请求,且确认字为0,执行进片任务"); |
| | | outTo(Integer.parseInt(out08Glassstate), |
| | | Integer.parseInt(out10Glassstate), confirmationWrodAddress); |
| | | } else if ("3".equals(taskRequestTypeValue)) { |
| | | log.info("3、进片和出片都空闲,执行出片任务"); |
| | | if ("0".equals(outGlassstate)) { |
| | | inTo(glassIdeValue, confirmationWrodAddress, currentSlot); |
| | | log.info("2、进片和出片都空闲,执行出片任务"); |
| | | //加笼子里面是否有玻璃,有先出,无玻璃先进 |
| | | int count = edgStorageCageDetailsService.count(new LambdaQueryWrapper<EdgStorageCageDetails>().eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)); |
| | | if (("1".equals(out08Glassstate) || "1".equals(out10Glassstate)) && count > 0) { |
| | | boolean outFlase = outTo(Integer.parseInt(out08Glassstate), |
| | | Integer.parseInt(out10Glassstate), confirmationWrodAddress); |
| | | log.info("出片任务是否完成:{},失败且玻璃id:{}不为空则执行进片任务", outFlase, glassIdeValue); |
| | | if (!outFlase && StringUtils.isNotBlank(glassIdeValue)) { |
| | | inTo(glassIdeValue, confirmationWrodAddress, currentSlot); |
| | | } |
| | | } else { |
| | | outTo(Integer.parseInt(outGlassstate), confirmationWrodAddress, currentSlot); |
| | | inTo(glassIdeValue, confirmationWrodAddress, currentSlot); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 进片任务 |
| | | * |
| | | * @param glassId |
| | | * @param confirmationWrodAddress |
| | | * @param currentSlot |
| | |
| | | log.info("2、获取到的玻璃信息为{}", glassInfo); |
| | | //添加进片任务 查找空格 |
| | | EdgStorageCage nearestEmpty = edgStorageCageService.selectNearestEmpty(Integer.parseInt(currentSlot)); |
| | | Assert.isTrue(nearestEmpty == null, "格子已满"); |
| | | Assert.isTrue(null != nearestEmpty, "格子已满"); |
| | | log.info("3、查询卧式理片笼里面的空格:{}", nearestEmpty); |
| | | |
| | | log.info("4、将玻璃信息插入卧式理片笼,当前玻璃信息:{}", glassInfo); |
| | |
| | | details.setDeviceId(nearestEmpty.getDeviceId()); |
| | | edgStorageCageDetailsService.save(details); |
| | | log.info("5、玻璃信息已存入理片笼详情表,玻璃信息为{}", details); |
| | | |
| | | //添加进片任务 |
| | | TaskCache taskCache = new TaskCache(); |
| | | taskCache.setGlassId(glassId); |
| | | taskCache.setTaskStatus(0); |
| | | taskCache.setStartCell(0); |
| | | taskCache.setEndCell(nearestEmpty.getSlot()); |
| | | taskCache.setTaskType(1); |
| | | taskCache.setCreateTime(new Date()); |
| | | taskCacheService.insertTaskCache(taskCache); |
| | | log.info("6、生成进片任务信息存入任务表{}", taskCache); |
| | | boolean taskCache = saveTaskCache(details.getGlassId(), 0, nearestEmpty.getSlot(), Const.GLASS_CACHE_TYPE_IN); |
| | | log.info("6、生成进片任务信息存入任务表是否完成:{}", taskCache); |
| | | |
| | | S7object.getinstance().plccontrol.WriteWord(confirmationWrodAddress, (short) 1); |
| | | log.info("7、发送确认字完成"); |
| | |
| | | |
| | | /** |
| | | * 出片任务 |
| | | * @param line |
| | | * |
| | | * @param out08Glassstate |
| | | * @param out10Glassstate |
| | | * @param confirmationWrodAddress |
| | | * @param currentSlot |
| | | */ |
| | | private void outTo(int line, String confirmationWrodAddress, String currentSlot) { |
| | | Assert.isTrue(line != 0, "A09、A10都有玻璃,无法出片"); |
| | | log.info("1、出片任务出【{}】号线,备注(09空闲:1;10空闲:2;都空闲:3)", line); |
| | | private boolean outTo(int out08Glassstate, int out10Glassstate, String confirmationWrodAddress) { |
| | | //逻辑步骤: |
| | | // 0、A09、A10是否空闲,是否可以执行出片任务 |
| | | // 1、获取钢化版图是否超过阈值 |
| | | // 1.1、超过阈值:获取当前最小版图需要出片的玻璃信息 |
| | | // 1.1.1、获取两条线最后一次出片的任务信息 |
| | | // 1.1.2、按照出片信息去详情表查询格子在笼子里面剩余相同尺寸的玻璃数据 |
| | | // 1.1.3、判断哪条线玻璃数量在理片笼内的数据最少,决定最小版图走该条线(问题:如果这条线非空闲,直接结束) |
| | | // 1.2、未超过阈值: |
| | | // 1.2.1、获取程序那条线空闲 |
| | | // 1.2.2、获取该条线最后一次出片的任务信息 |
| | | // 1.2.3、按照出片信息去详情表查询格子在笼子里面剩余相同尺寸的玻璃数据且以版图id、版序升序排序 取第一块玻璃出片 |
| | | // 2、如果没有历史出片任务 |
| | | // 2.1、出当前版图id最小版序最小的玻璃(问题:两条线都没有历史任务,出片时两条线的玻璃尺寸相同,是否找尺寸不同的) |
| | | Assert.isFalse(out08Glassstate == 0 && out10Glassstate == 0, "A09、A10都有玻璃,无法出片"); |
| | | log.info("0、出片任务出的状态:A09:【{}】;A10:【{}】)", out08Glassstate, out10Glassstate); |
| | | //定义出片玻璃信息 |
| | | int endcell = 0; |
| | | EdgStorageCageDetails glassInfo = null; |
| | | boolean flag = queryMaxMinDiff(threshold); |
| | | log.info("1、获取钢化版图是否超过阈值:{}", flag); |
| | | if (flag) { |
| | | glassInfo = queryMinGlass(0.0, 0.0); |
| | | log.info("1.1、超过阈值:获取当前最小版图需要出片的玻璃信息:{}", glassInfo); |
| | | Integer a09Count = queryCountByTaskLine(Const.A09_OUT_TARGET_POSITION).size(); |
| | | Integer a10Count = queryCountByTaskLine(Const.A10_OUT_TARGET_POSITION).size(); |
| | | log.info("1.2、获取笼子剩余数量A09为{},A10为{}", a09Count, a10Count); |
| | | |
| | | List<TaskCache> oldTaskCacheList; |
| | | if (line == 2) { |
| | | endcell = Const.A10_OUT_TARGET_POSITION; |
| | | oldTaskCacheList = taskCacheService.selectLastOutCacheInfos(Const.A10_OUT_TARGET_POSITION); |
| | | // 假设已知 outXXGlassstate 的值只有 0 和 1 两种情况,且 0 表示某种状态,1 表示另一种状态 |
| | | int targetPositionWhenStateZero = (out08Glassstate == 0) ? Const.A10_OUT_TARGET_POSITION : Const.A09_OUT_TARGET_POSITION; |
| | | int targetPositionWhenStateOne = (out10Glassstate == 0) ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | endcell = (a10Count <= a09Count) ? targetPositionWhenStateZero : targetPositionWhenStateOne; |
| | | } else { |
| | | endcell = Const.A09_OUT_TARGET_POSITION; |
| | | oldTaskCacheList = taskCacheService.selectLastOutCacheInfos(Const.A09_OUT_TARGET_POSITION); |
| | | //当前任务出完无玻璃 更换玻璃 获取另一条线路 |
| | | endcell = out08Glassstate == 1 ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | int othercell = endcell == Const.A10_OUT_TARGET_POSITION ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | List<EdgStorageCageDetails> details = queryCountByTaskLine(endcell); |
| | | if (details.size() > 0) { |
| | | glassInfo = details.get(0); |
| | | } else { |
| | | //去理片笼里面查 |
| | | glassInfo = queryChangeGlassInfo(othercell); |
| | | } |
| | | } |
| | | log.info("2、判断出片线路{},获取最后该条线已出片的任务信息{}(备注:0待执行,1已执行).都空闲优先出A09线", endcell, oldTaskCacheList); |
| | | |
| | | String glassId = ""; |
| | | if (CollectionUtil.isNotEmpty(oldTaskCacheList)) { |
| | | glassId = oldTaskCacheList.get(0).getGlassId(); |
| | | } |
| | | EdgStorageCageDetails glassInfo = edgStorageCageDetailsService.selectOutGlass(glassId, threshold); |
| | | log.info("3、按照历史已出玻璃id{}和阈值{},拿出理片笼内的出片信息{}", glassId, threshold, glassInfo); |
| | | |
| | | if (glassInfo != null) { |
| | | log.info("4、添加出片任务,玻璃id:{},任务类型:{},起始位置:{},结束位置:{}", glassInfo.getGlassId(), |
| | | 2, glassInfo.getSlot(), endcell); |
| | | TaskCache taskCache = new TaskCache(); |
| | | taskCache.setGlassId(glassInfo.getGlassId()); |
| | | taskCache.setTaskStatus(0); |
| | | taskCache.setStartCell(glassInfo.getSlot()); |
| | | taskCache.setEndCell(endcell); |
| | | taskCache.setTaskType(2); |
| | | taskCache.setCreateTime(new Date()); |
| | | taskCacheService.insertTaskCache(taskCache); |
| | | |
| | | LambdaQueryWrapper<EdgStorageCageDetails> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(EdgStorageCageDetails::getGlassId, glassInfo.getGlassId()); |
| | | EdgStorageCageDetails updateDetail = new EdgStorageCageDetails(); |
| | | updateDetail.setState(Const.GLASS_STATE_OUT); |
| | | edgStorageCageDetailsService.update(updateDetail, wrapper); |
| | | log.info("5、更新出片玻璃的状态为{}", Const.GLASS_STATE_OUT); |
| | | |
| | | boolean taskCacheStatus = saveTaskCache(glassInfo.getGlassId(), glassInfo.getSlot(), endcell, Const.GLASS_CACHE_TYPE_OUT); |
| | | log.info("6、添加出片任务是否完成:{}", taskCacheStatus); |
| | | |
| | | boolean glassSizeStatus = saveGlassSize(glassInfo); |
| | | log.info("7、添加出片玻璃尺寸信息到磨边前玻璃表是否完成:{}", glassSizeStatus); |
| | | |
| | | S7object.getinstance().plccontrol.WriteWord(confirmationWrodAddress, (short) 1); |
| | | log.info("8、发送确认字已完成"); |
| | | return Boolean.TRUE; |
| | | } |
| | | return Boolean.FALSE; |
| | | } |
| | | |
| | | /** |
| | | * 获取详情表内最大最小版图id的差值,判断是否出最小版图玻璃 |
| | | * |
| | | * @return |
| | | */ |
| | | private boolean queryMaxMinDiff(int threshold) { |
| | | //获取笼子内最大版图id和最小版图id插值,判断是否大于阈值,大于阈值直接出最小版图玻璃 |
| | | QueryWrapper<EdgStorageCageDetails> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.select("max(tempering_layout_id)-min(tempering_layout_id) as diff") |
| | | .eq("state", Const.GLASS_STATE_IN); |
| | | List<Object> list = edgStorageCageDetailsService.listObjs(queryWrapper); |
| | | if (CollectionUtil.isNotEmpty(list)) { |
| | | Long diff = (Long) list.get(0); |
| | | return diff > threshold; |
| | | } else { |
| | | return Boolean.FALSE; |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取当前最小版图需要出片的玻璃信息 |
| | | * |
| | | * @param width |
| | | * @param height |
| | | */ |
| | | private EdgStorageCageDetails queryMinGlass(Double width, Double height) { |
| | | return edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getState, 100) |
| | | .eq(width != 0, EdgStorageCageDetails::getWidth, width) |
| | | .eq(height != 0, EdgStorageCageDetails::getHeight, height) |
| | | .orderByAsc(EdgStorageCageDetails::getTemperingLayoutId, EdgStorageCageDetails::getTemperingFeedSequence) |
| | | .last("limit 1")); |
| | | } |
| | | |
| | | /** |
| | | * 获取任务表中指定线路笼子内还剩余的玻璃数量 |
| | | */ |
| | | private List<EdgStorageCageDetails> queryCountByTaskLine(int line) { |
| | | //获取任务表中最后一次出片的玻璃id |
| | | LambdaQueryWrapper<TaskCache> queryWrapper = new LambdaQueryWrapper<TaskCache>().eq(TaskCache::getTaskType, Const.GLASS_CACHE_TYPE_OUT) |
| | | .eq(TaskCache::getEndCell, line).orderByDesc(TaskCache::getCreateTime); |
| | | List<TaskCache> taskCacheList = taskCacheService.list(queryWrapper); |
| | | if (CollectionUtil.isEmpty(taskCacheList)) { |
| | | return new ArrayList<>(); |
| | | } |
| | | TaskCache taskCache = taskCacheList.get(0); |
| | | MPJQueryWrapper<EdgStorageCageDetails> mpjLambdaWrapper = new MPJQueryWrapper<>(); |
| | | mpjLambdaWrapper.select("t1.*") |
| | | .innerJoin("edg_storage_cage_details t1 on t.width = t1.width and t.height = t1.height") |
| | | .eq("t.glass_id", taskCache.getGlassId()) |
| | | .ne("t1.glass_id", taskCache.getGlassId()) |
| | | .orderByAsc("t1.tempering_layout_id", "t1.tempering_feed_sequence"); |
| | | List<EdgStorageCageDetails> details = edgStorageCageDetailsService.selectJoinList(EdgStorageCageDetails.class, mpjLambdaWrapper); |
| | | if (CollectionUtil.isEmpty(details)) { |
| | | return new ArrayList<>(); |
| | | } |
| | | return details; |
| | | } |
| | | |
| | | /** |
| | | * 更换出片玻璃 |
| | | * |
| | | * @param othercell |
| | | * @return |
| | | */ |
| | | private EdgStorageCageDetails queryChangeGlassInfo(int othercell) { |
| | | //获取笼子内数量前二的玻璃数量 |
| | | MPJLambdaWrapper<EdgStorageCageDetails> wrapper = new MPJLambdaWrapper<>(); |
| | | wrapper.select(EdgStorageCageDetails::getWidth, EdgStorageCageDetails::getHeight) |
| | | .selectCount(EdgStorageCageDetails::getGlassId, EdgStorageCageDetails::getCount) |
| | | .groupBy(EdgStorageCageDetails::getWidth, EdgStorageCageDetails::getHeight) |
| | | .last("order by count(t.glass_id) desc limit 2"); |
| | | List<EdgStorageCageDetails> list = edgStorageCageDetailsService.list(wrapper); |
| | | log.info("获取笼子内数量前二的玻璃数量:{}", list); |
| | | if (CollectionUtil.isEmpty(list)) { |
| | | log.info("笼子里没有玻璃"); |
| | | return null; |
| | | } |
| | | //一片玻璃直接出 |
| | | //获取宽高拍第一的玻璃信息 |
| | | EdgStorageCageDetails firstSize = list.get(0); |
| | | Integer firstCount = firstSize.getCount(); |
| | | Double firstWidth = firstSize.getWidth(); |
| | | Double firstHeight = firstSize.getHeight(); |
| | | if (list.size() == 1) { |
| | | return queryMinGlass(firstWidth, firstHeight); |
| | | } |
| | | //获取宽高拍第二的玻璃信息 |
| | | EdgStorageCageDetails secondSize = list.get(1); |
| | | //获取任务表中最后一次出片的玻璃id |
| | | LambdaQueryWrapper<TaskCache> queryWrapper = new LambdaQueryWrapper<TaskCache>().eq(TaskCache::getTaskType, Const.GLASS_CACHE_TYPE_OUT) |
| | | .eq(TaskCache::getEndCell, othercell).orderByDesc(TaskCache::getCreateTime); |
| | | List<TaskCache> taskCacheList = taskCacheService.list(queryWrapper); |
| | | log.info("获取任务表中{}线最后一次出片的玻璃任务信息:{}", othercell, taskCacheList); |
| | | if (CollectionUtil.isEmpty(taskCacheList)) { |
| | | log.info("{}线没有出片任务信息,直接出片", othercell); |
| | | return queryMinGlass(firstSize.getWidth(), firstSize.getHeight()); |
| | | } |
| | | |
| | | Integer secondCount = secondSize.getCount(); |
| | | Double secondWidth = secondSize.getWidth(); |
| | | Double secondHeight = secondSize.getHeight(); |
| | | //获取数量前2的玻璃数量比例 |
| | | Integer mix = firstCount / secondCount; |
| | | log.info("获取玻璃数量前2的玻璃占比为:{}", mix); |
| | | |
| | | if (mix >= 2) { |
| | | log.info("获取玻璃数量前2的玻璃占比为{},大于2,直接出玻璃数据的最多的,宽:{},高:{}", mix, firstWidth, firstHeight); |
| | | return queryMinGlass(firstWidth, firstHeight); |
| | | } else { |
| | | log.info("获取玻璃数量前2的玻璃占比为{},小于2", mix); |
| | | TaskCache taskCache = taskCacheList.get(0); |
| | | EdgStorageCageDetails outGlassInfo = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>().eq(EdgStorageCageDetails::getGlassId, taskCache.getGlassId())); |
| | | log.info("{}线有出片任务信息,任务信息为{},玻璃信息为{}", othercell, taskCache, outGlassInfo); |
| | | if (outGlassInfo.getWidth().equals(firstWidth) && outGlassInfo.getHeight().equals(firstHeight)) { |
| | | log.info("数量最多的宽{}高{}和{}线任务的宽{}高{}相同,出数量排第二的玻璃,宽{}高{}", |
| | | firstWidth, firstHeight, othercell, outGlassInfo.getWidth(), outGlassInfo.getHeight(), secondWidth, secondHeight); |
| | | return queryMinGlass(secondWidth, secondHeight); |
| | | } else { |
| | | log.info("数量第二多的宽{}高{}和{}线任务的宽{}高{}相同,出数量排第二的玻璃,宽{}高{}", |
| | | secondWidth, secondHeight, othercell, outGlassInfo.getWidth(), outGlassInfo.getHeight(), firstWidth, firstHeight); |
| | | return queryMinGlass(firstWidth, firstHeight); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 添加理片笼任务 |
| | | * |
| | | * @param glassId |
| | | * @param startcell |
| | | * @param endcell |
| | | * @param taskType |
| | | * @return |
| | | */ |
| | | private boolean saveTaskCache(String glassId, int startcell, int endcell, int taskType) { |
| | | TaskCache taskCache = new TaskCache(); |
| | | taskCache.setGlassId(glassId); |
| | | taskCache.setTaskStatus(0); |
| | | taskCache.setStartCell(startcell); |
| | | taskCache.setEndCell(endcell); |
| | | taskCache.setTaskType(taskType); |
| | | taskCache.setCreateTime(new Date()); |
| | | return taskCacheService.save(taskCache); |
| | | } |
| | | |
| | | /** |
| | | * 添加理片笼任务 |
| | | * |
| | | * @param glassInfo |
| | | * @return |
| | | */ |
| | | private boolean saveGlassSize(EdgStorageCageDetails glassInfo) { |
| | | EdgGlassTaskInfo edgGlassTaskInfo = new EdgGlassTaskInfo(); |
| | | BeanUtils.copyProperties(glassInfo, edgGlassTaskInfo); |
| | | edgGlassTaskInfo.setHeight((int) (glassInfo.getEdgHeight() * ratio)); |
| | | edgGlassTaskInfo.setWidth((int) (glassInfo.getWidth() * ratio)); |
| | | edgGlassTaskInfo.setThickness((int) (glassInfo.getThickness() * ratio)); |
| | | edgGlassTaskInfo.setStatus(Const.EDG_GLASS_BEFORE); |
| | | return edgGlassTaskInfoService.save(edgGlassTaskInfo); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | public interface TaskCacheService extends IService<TaskCache> { |
| | | |
| | | /** |
| | | * 添加理片笼任务 |
| | | * @param taskCache |
| | | * @return |
| | | */ |
| | | boolean insertTaskCache(TaskCache taskCache); |
| | | |
| | | boolean insertTaskCache(TaskCache taskCache); |
| | | /** |
| | | * 查询磨边任务 |
| | | * @param line |
| | |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "A09_glass_status", |
| | | "codeId": "A08_glass_status", |
| | | "addressIndex":"68", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | |
| | | profiles: |
| | | active: dev |
| | | application: |
| | | name: unLoadGlass |
| | | name: cacheGlass |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | mes: |
| | | threshold: 3 |
| | | ratio: 10 |
New file |
| | |
| | | package com.mes; |
| | | |
| | | import com.mes.common.S7object; |
| | | import com.mes.job.PlcStorageCageTask; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.boot.ApplicationArguments; |
| | | import org.springframework.boot.ApplicationRunner; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @Order(1) |
| | | |
| | | public class AppRunnerConfig implements ApplicationRunner { |
| | | |
| | | private final PlcStorageCageTask plcStorageCageTask; |
| | | |
| | | public AppRunnerConfig(PlcStorageCageTask plcStorageCageTask) { |
| | | this.plcStorageCageTask = plcStorageCageTask; |
| | | } |
| | | |
| | | @Override |
| | | public void run(ApplicationArguments args) throws Exception { |
| | | log.info("启动完成"); |
| | | S7object.getinstance().start(); |
| | | |
| | | } |
| | | } |
| | |
| | | */ |
| | | public interface BigStorageCageService extends IService<BigStorageCage> { |
| | | |
| | | void updateRemainWidth(int Slot); |
| | | void updateRemainWidth(int slot); |
| | | |
| | | BigStorageCageDetails feedGlass(GlassInfo glassInfo, BigStorageCageDetails bigStorageCageDetails); |
| | | |
| | |
| | | bigStorageCageDetails.setSlot(layoutSlotInfo.getSlot()); |
| | | } else { |
| | | log.info("3、查询理片笼内片序+1等于当前玻璃片序的玻璃的结果为空时获取当前玻璃版图id是否存在理片笼内"); |
| | | LambdaQueryWrapper<BigStorageCageDetails> BigStorageCageDetailslambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | BigStorageCageDetailslambdaQueryWrapper |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailslambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | bigStorageCageDetailslambdaQueryWrapper |
| | | .select(BigStorageCageDetails::getTemperingLayoutId); |
| | | layoutSlotInfo = bigStorageCageDetailsMapper.selectOne(BigStorageCageDetailslambdaQueryWrapper); |
| | | layoutSlotInfo = bigStorageCageDetailsMapper.selectOne(bigStorageCageDetailslambdaQueryWrapper); |
| | | |
| | | if(layoutSlotInfo != null){ |
| | | log.info("4、获取笼子内适合的格子"); |
| | |
| | | .apply("LEFT JOIN (SELECT device_id, tempering_layout_id FROM big_storage_cage_details) b ON a.device_id = b.device_id AND a.slot = b.slot") |
| | | .orderByAsc("layoutCount") |
| | | .orderByAsc("a.device_id"); |
| | | List<Map<String, Object>> BigStorageCageDetailsCount= bigStorageCageDetailsMapper.selectMaps(queryWrapper); |
| | | List<Map<String, Object>> bigStorageCageDetailsCount= bigStorageCageDetailsMapper.selectMaps(queryWrapper); |
| | | |
| | | log.info("5、查询笼子内是否有合适的格子"); |
| | | for (Map<String, Object> map : BigStorageCageDetailsCount) { |
| | | for (Map<String, Object> map : bigStorageCageDetailsCount) { |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | int deviceId = Integer.parseInt(entry.getKey()); |
| | | BigStorageCage bigStorageCage=bigStorageCageSlot(deviceId); |
| | |
| | | } |
| | | } |
| | | } |
| | | log.info("6、当找到合适的格子时添加玻璃到笼子表"); |
| | | |
| | | if (bigStorageCageDetails.getSlot() != null) { |
| | | log.info("6、当找到合适的格子时添加玻璃到笼子表"); |
| | | bigStorageCageDetails.setState(0); |
| | | bigStorageCageDetailsMapper.insert(bigStorageCageDetails); |
| | | updateRemainWidth(bigStorageCageDetails.getSlot()) ; |
New file |
| | |
| | | package com.mes.common; |
| | | |
| | | import com.github.xingshuangs.iot.protocol.s7.enums.EPlcType; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.tools.InitUtil; |
| | | import com.mes.tools.S7control; |
| | | |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/4/9 15:13 |
| | | * @Description: |
| | | */ |
| | | public class S7object extends Thread { |
| | | public S7control plccontrol; // PLC通讯类实例 |
| | | private EPlcType plcType = EPlcType.S1200; // 西门子PLC类型 |
| | | private String ip = "192.168.10.1"; // plc ip地址 |
| | | private int port = 102; // plc 端口号 |
| | | |
| | | |
| | | public PlcParameterObject PlcMesObject; |
| | | private static volatile S7object instance = null; |
| | | |
| | | private S7object() { |
| | | 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()); |
| | | PlcMesObject = InitUtil.initword(PlcLoadGlass); |
| | | } |
| | | } |
| | | |
| | | // 单例模式 获取类的唯一实例 |
| | | public static S7object getinstance() { |
| | | if (instance == null) { |
| | | synchronized (S7object.class) { |
| | | if (instance == null) { |
| | | instance = new S7object(); |
| | | } |
| | | } |
| | | } |
| | | return instance; |
| | | } |
| | | |
| | | @Override |
| | | public void run() { |
| | | while (this != null) { |
| | | try { |
| | | Thread.sleep(100); |
| | | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | byte[] getplcvlues= plccontrol.ReadByte(PlcMesObject.getPlcAddressBegin(),PlcMesObject.getPlcAddressLength()); |
| | | PlcMesObject.setPlcParameterList(getplcvlues); |
| | | |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.common; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.context.ConfigurableApplicationContext; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.websocket.*; |
| | | import javax.websocket.server.PathParam; |
| | | import javax.websocket.server.ServerEndpoint; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | | @ServerEndpoint(value = "/api/talk/{username}") |
| | | @Component("webSocketServer") |
| | | public class WebSocketServer { |
| | | |
| | | |
| | | public static ConfigurableApplicationContext applicationContext; |
| | | |
| | | // 解决无法注入mapper问题 //使用方法 |
| | | // homeMapper=WebSocketServer.applicationContext.getBean(HomeMapper.class); |
| | | public static void setApplicationContext(ConfigurableApplicationContext configurableApplicationContext) { |
| | | WebSocketServer.applicationContext = configurableApplicationContext; |
| | | } |
| | | |
| | | private static final Logger log = LoggerFactory.getLogger(WebSocketServer.class); |
| | | private List<String> messages; |
| | | /** |
| | | * 记录当前在线连接数 |
| | | */ |
| | | public static final Map<String, ArrayList<WebSocketServer>> sessionMap = new ConcurrentHashMap<>(); |
| | | |
| | | String username; |
| | | Session session; |
| | | |
| | | public WebSocketServer() { |
| | | this.messages = new ArrayList<>(); |
| | | } |
| | | |
| | | /** |
| | | * 连接建立成功调用的方法 |
| | | */ |
| | | @OnOpen |
| | | public void onOpen(Session session, @PathParam("username") String username) { |
| | | this.username = username; |
| | | this.session = session; |
| | | List<WebSocketServer> webSocketServers = sessionMap.get(username); |
| | | if (webSocketServers == null) { |
| | | ArrayList<WebSocketServer> arrayListwebserver = new ArrayList<WebSocketServer>(); |
| | | arrayListwebserver.add(this); |
| | | sessionMap.put(username, arrayListwebserver); |
| | | } else { |
| | | webSocketServers.add(this); |
| | | } |
| | | |
| | | log.info("有新用户加入,username={}, 当前在线人数为:{}", username, sessionMap.get(username).size()); |
| | | |
| | | // JSONObject result = new JSONObject(); |
| | | // JSONArray array = new JSONArray(); |
| | | // result.set("users", array); |
| | | // for (Object key : sessionMap.keySet()) { |
| | | // JSONObject jsonObject = new JSONObject(); |
| | | // jsonObject.set("username", key); |
| | | // array.add(jsonObject); |
| | | // } |
| | | |
| | | // sendAllMessage(JSONUtil.toJsonStr(result)); // 后台发送消息给所有的客户端 |
| | | } |
| | | |
| | | /** |
| | | * 连接关闭调用的方法 |
| | | */ |
| | | @OnClose |
| | | 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) { |
| | | for (WebSocketServer webSocketServer : webSocketServers) { |
| | | if (webSocketServer != this) { |
| | | arrayListwebserver.add(webSocketServer); |
| | | } |
| | | } |
| | | sessionMap.put(username, arrayListwebserver); |
| | | log.info("移除username={}一名用户session, {}的当前在线人数为:{}", username, username, sessionMap.get(username).size()); |
| | | } else { |
| | | sessionMap.remove(username); |
| | | log.info("移除username={}一名用户session, {}连接关闭, 当前连接数为:{}", username, username, sessionMap.size()); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 收到客户端消息后调用的方法 |
| | | * 后台收到客户端发送过来的消息 |
| | | * onMessage 是一个消息的中转站 |
| | | * 接受 浏览器端 socket.send 发送过来的 json数据 |
| | | * |
| | | * @param message 客户端发送过来的消息 |
| | | */ |
| | | @OnMessage |
| | | public void onMessage(String message, Session session, @PathParam("username") String username) { |
| | | log.info("服务端收到用户username={}的消息:{}", username, message); |
| | | JSONObject obj = JSONUtil.parseObj(message); |
| | | String text = obj.getStr("data"); |
| | | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.set("message", text); |
| | | this.messages.add(text); |
| | | this.sendMessage(jsonObject.toString()); // JSONUtil.toJsonStr(jsonObject) |
| | | |
| | | } |
| | | |
| | | @OnError |
| | | public void onError(Session session, Throwable error) { |
| | | log.error("发生错误"); |
| | | error.printStackTrace(); |
| | | } |
| | | |
| | | /** |
| | | * 服务端发送消息给客户端 |
| | | */ |
| | | public void sendMessage(String message) { |
| | | try { |
| | | // log.info("服务端给客户端[{}]发送消息{}", this.session.getId(), message); |
| | | this.session.getBasicRemote().sendText(message); |
| | | } catch (Exception e) { |
| | | log.error("服务端发送消息给客户端失败", e); |
| | | } |
| | | } |
| | | |
| | | // /** |
| | | // * 服务端发送消息给所有客户端 |
| | | // */ |
| | | // public void sendAllMessage(String message) { |
| | | // try { |
| | | // for (WebSocketServer webSocketServer : sessionMap.values()) { |
| | | // // log.info("服务端给客户端[{}]发送消息{}", this.session.getId(), message); |
| | | // webSocketServer.sendMessage(message); |
| | | // } |
| | | // } catch (Exception e) { |
| | | // log.error("服务端发送消息给客户端失败", e); |
| | | // } |
| | | // } |
| | | |
| | | public List<String> getMessages() { |
| | | return messages; |
| | | |
| | | } |
| | | |
| | | public void clearMessages() { |
| | | messages.clear(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageOutTask; |
| | | import com.mes.bigstoragetask.service.BigStorageCageFeedTaskService; |
| | | import com.mes.bigstoragetask.service.BigStorageCageOutTaskService; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.WebSocketServer; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.edgstoragetask.service.TaskCacheService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Component |
| | | @Slf4j |
| | | public class PlcStorageCageTask { |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private BigStorageCageService bigStorageCageService; |
| | | @Autowired |
| | | @Resource |
| | | private BigStorageCageDetailsService bigStorageCageDetailsService; |
| | | @Autowired |
| | | @Resource |
| | | private GlassInfoService glassInfoService; |
| | | @Autowired |
| | | @Resource |
| | | private BigStorageCageFeedTaskService bigStorageCageFeedTaskService; |
| | | @Autowired |
| | | @Resource |
| | | private BigStorageCageOutTaskService bigStorageCageOutTaskService; |
| | | @Autowired |
| | | @Resource |
| | | private TaskCacheService taskCacheService; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private SysMenuService sysMenuService; |
| | | |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | /** |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | |
| | | 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 plcFeedGlassid = ""; |
| | | String plcFeedReqLine = "0"; |
| | | if ("1".equals(plcD01FeedReq)) { |
| | | if ("1".equals(plcParameterObject.getPlcParameter("D01Request").getValue())) { |
| | | plcFeedReqLine = "1"; |
| | | } else { |
| | | //plc任务发送字0 |
| | | plcFeedGlassid=plcParameterObject.getPlcParameter("D01ID1").getValue(); |
| | | } |
| | | if ("1".equals(plcD04FeedReq)) { |
| | | if ("1".equals(plcParameterObject.getPlcParameter("D04Request").getValue())) { |
| | | plcFeedReqLine = "2"; |
| | | } else { |
| | | //plc任务发送字0 |
| | | plcFeedGlassid=plcParameterObject.getPlcParameter("D04ID1").getValue(); |
| | | } |
| | | |
| | | if (!("0".equals(plcFeedReqLine))) { |
| | |
| | | log.info("3、查询任务表判断当前任务类型为上车等到还是上车启动" + taskType); |
| | | bigStorageCageFeedTaskService.addFeedTask(slotInfo, Integer.parseInt(plcFeedReqLine), taskType); |
| | | log.info("4、添加任务到任务表"); |
| | | //plc任务发送字1 |
| | | bigStorageCageFullAlarm = false; |
| | | } else { |
| | | //理片笼爆笼报警 |
| | | bigStorageCageFullAlarm = true; |
| | | } |
| | | } else { |
| | |
| | | } |
| | | } |
| | | |
| | | //出片请求 |
| | | 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 |
| | | //查询出片表是否有任务未完成的任务 |
| | | List<BigStorageCageOutTask> bigStorageCageOutTask=bigStorageCageOutTaskService.querybigStorageCageOutTask(0); |
| | | if(bigStorageCageOutTask.size()==0){ |
| | | bigStorageCageService.outGlass(); |
| | | log.info("8、没有未完成任务时调用出片接口"); |
| | | } |
| | | |
| | | //显示剩余空格子 |
| | | bigStorageCageOutTaskService.updateOutTask(); |
| | | log.info("9、根据任务表状态修改钢化小片表任务状态"); |
| | | |
| | | //报警信息 |
| | | jsonObject.append("bigStorageCageFullAlarm", bigStorageCageFullAlarm); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("Home"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | List<String> messages = webserver.getMessages(); |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | | webserver.clearMessages(); |
| | | } |
| | | } else { |
| | | log.info("Home is closed"); |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
New file |
| | |
| | | { |
| | | "plcAddressBegin":"DB.0", |
| | | "plcAddressLenght":"72", |
| | | "dataType":"word", |
| | | "parameteInfor":[ |
| | | { |
| | | "codeId": "D01Request", |
| | | "addressIndex":"0", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "D01ID1", |
| | | "addressIndex":"2", |
| | | "addressLenght":"6", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D04Request", |
| | | "addressIndex":"8", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D04ID1", |
| | | "addressIndex":"10", |
| | | "addressLenght":"6", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D02Go", |
| | | "addressIndex":"20", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "D05Go", |
| | | "addressIndex":"22", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | } |
| | | , |
| | | { |
| | | "codeId": "DeviceStatus", |
| | | "addressIndex":"70", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | } |
| | | ] |
| | | } |
New file |
| | |
| | | package com.mes; |
| | | |
| | | import com.mes.common.S7object; |
| | | import com.mes.job.PlcLoadGlassTask; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.boot.ApplicationArguments; |
| | | import org.springframework.boot.ApplicationRunner; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @Order(1) |
| | | |
| | | public class AppRunnerConfig implements ApplicationRunner { |
| | | |
| | | private final PlcLoadGlassTask plcLoadGlassTask; |
| | | |
| | | public AppRunnerConfig(PlcLoadGlassTask plcLoadGlassTask) { |
| | | this.plcLoadGlassTask = plcLoadGlassTask; |
| | | } |
| | | |
| | | @Override |
| | | public void run(ApplicationArguments args) throws Exception { |
| | | log.info("启动完成"); |
| | | S7object.getinstance().start(); |
| | | |
| | | } |
| | | } |
| | |
| | | package com.mes.common; |
| | | |
| | | import com.github.xingshuangs.iot.protocol.s7.enums.EPlcType; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.tools.InitUtil; |
| | | import com.mes.tools.S7control; |
| | | |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/4/9 15:13 |
| | | * @Description: |
| | | */ |
| | | public class S7object { |
| | | public class S7object extends Thread { |
| | | public S7control plccontrol; // PLC通讯类实例 |
| | | private EPlcType plcType = EPlcType.S1500; // 西门子PLC类型 |
| | | private EPlcType plcType = EPlcType.S1200; // 西门子PLC类型 |
| | | private String ip = "192.168.10.1"; // plc ip地址 |
| | | private int port = 102; // plc 端口号 |
| | | |
| | | |
| | | public PlcParameterObject PlcMesObject; |
| | | private static volatile S7object instance = null; |
| | | |
| | | private S7object() { |
| | | if (plccontrol == null) { |
| | | plccontrol = new S7control(plcType, ip, port, 0, 0); |
| | | |
| | | String PlcLoadGlass = S7object.class.getResource("/JsonFile/PlcLoadGlass.json").getPath(); |
| | | //log.info(PLCAutoMes.class.getResource("").getPath()); |
| | | PlcMesObject = InitUtil.initword(PlcLoadGlass); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | return instance; |
| | | } |
| | | |
| | | @Override |
| | | public void run() { |
| | | while (this != null) { |
| | | try { |
| | | Thread.sleep(100); |
| | | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | byte[] getplcvlues = plccontrol.ReadByte(PlcMesObject.getPlcAddressBegin(), PlcMesObject.getPlcAddressLength()); |
| | | PlcMesObject.setPlcParameterList(getplcvlues); |
| | | |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.common; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.context.ConfigurableApplicationContext; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.websocket.*; |
| | | import javax.websocket.server.PathParam; |
| | | import javax.websocket.server.ServerEndpoint; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | | @ServerEndpoint(value = "/api/talk/{username}") |
| | | @Component("webSocketServer") |
| | | public class WebSocketServer { |
| | | |
| | | |
| | | public static ConfigurableApplicationContext applicationContext; |
| | | |
| | | // 解决无法注入mapper问题 //使用方法 |
| | | // homeMapper=WebSocketServer.applicationContext.getBean(HomeMapper.class); |
| | | public static void setApplicationContext(ConfigurableApplicationContext configurableApplicationContext) { |
| | | WebSocketServer.applicationContext = configurableApplicationContext; |
| | | } |
| | | |
| | | private static final Logger log = LoggerFactory.getLogger(WebSocketServer.class); |
| | | private List<String> messages; |
| | | /** |
| | | * 记录当前在线连接数 |
| | | */ |
| | | public static final Map<String, ArrayList<WebSocketServer>> sessionMap = new ConcurrentHashMap<>(); |
| | | |
| | | String username; |
| | | Session session; |
| | | |
| | | public WebSocketServer() { |
| | | this.messages = new ArrayList<>(); |
| | | } |
| | | |
| | | /** |
| | | * 连接建立成功调用的方法 |
| | | */ |
| | | @OnOpen |
| | | public void onOpen(Session session, @PathParam("username") String username) { |
| | | this.username = username; |
| | | this.session = session; |
| | | List<WebSocketServer> webSocketServers = sessionMap.get(username); |
| | | if (webSocketServers == null) { |
| | | ArrayList<WebSocketServer> arrayListwebserver = new ArrayList<WebSocketServer>(); |
| | | arrayListwebserver.add(this); |
| | | sessionMap.put(username, arrayListwebserver); |
| | | } else { |
| | | webSocketServers.add(this); |
| | | } |
| | | |
| | | log.info("有新用户加入,username={}, 当前在线人数为:{}", username, sessionMap.get(username).size()); |
| | | |
| | | // JSONObject result = new JSONObject(); |
| | | // JSONArray array = new JSONArray(); |
| | | // result.set("users", array); |
| | | // for (Object key : sessionMap.keySet()) { |
| | | // JSONObject jsonObject = new JSONObject(); |
| | | // jsonObject.set("username", key); |
| | | // array.add(jsonObject); |
| | | // } |
| | | |
| | | // sendAllMessage(JSONUtil.toJsonStr(result)); // 后台发送消息给所有的客户端 |
| | | } |
| | | |
| | | /** |
| | | * 连接关闭调用的方法 |
| | | */ |
| | | @OnClose |
| | | 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) { |
| | | for (WebSocketServer webSocketServer : webSocketServers) { |
| | | if (webSocketServer != this) { |
| | | arrayListwebserver.add(webSocketServer); |
| | | } |
| | | } |
| | | sessionMap.put(username, arrayListwebserver); |
| | | log.info("移除username={}一名用户session, {}的当前在线人数为:{}", username, username, sessionMap.get(username).size()); |
| | | } else { |
| | | sessionMap.remove(username); |
| | | log.info("移除username={}一名用户session, {}连接关闭, 当前连接数为:{}", username, username, sessionMap.size()); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 收到客户端消息后调用的方法 |
| | | * 后台收到客户端发送过来的消息 |
| | | * onMessage 是一个消息的中转站 |
| | | * 接受 浏览器端 socket.send 发送过来的 json数据 |
| | | * |
| | | * @param message 客户端发送过来的消息 |
| | | */ |
| | | @OnMessage |
| | | public void onMessage(String message, Session session, @PathParam("username") String username) { |
| | | log.info("服务端收到用户username={}的消息:{}", username, message); |
| | | JSONObject obj = JSONUtil.parseObj(message); |
| | | String text = obj.getStr("data"); |
| | | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.set("message", text); |
| | | this.messages.add(text); |
| | | this.sendMessage(jsonObject.toString()); // JSONUtil.toJsonStr(jsonObject) |
| | | |
| | | } |
| | | |
| | | @OnError |
| | | public void onError(Session session, Throwable error) { |
| | | log.error("发生错误"); |
| | | error.printStackTrace(); |
| | | } |
| | | |
| | | /** |
| | | * 服务端发送消息给客户端 |
| | | */ |
| | | public void sendMessage(String message) { |
| | | try { |
| | | // log.info("服务端给客户端[{}]发送消息{}", this.session.getId(), message); |
| | | this.session.getBasicRemote().sendText(message); |
| | | } catch (Exception e) { |
| | | log.error("服务端发送消息给客户端失败", e); |
| | | } |
| | | } |
| | | |
| | | // /** |
| | | // * 服务端发送消息给所有客户端 |
| | | // */ |
| | | // public void sendAllMessage(String message) { |
| | | // try { |
| | | // for (WebSocketServer webSocketServer : sessionMap.values()) { |
| | | // // log.info("服务端给客户端[{}]发送消息{}", this.session.getId(), message); |
| | | // webSocketServer.sendMessage(message); |
| | | // } |
| | | // } catch (Exception e) { |
| | | // log.error("服务端发送消息给客户端失败", e); |
| | | // } |
| | | // } |
| | | |
| | | public List<String> getMessages() { |
| | | return messages; |
| | | |
| | | } |
| | | |
| | | public void clearMessages() { |
| | | messages.clear(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.job; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.mes.common.S7object; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.engineering.service.EngineeringService; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import com.mes.uppattenusage.service.UpPattenUsageService; |
| | | import com.mes.workstation.entity.UpWorkstation; |
| | | import com.mes.workstation.service.UpWorkstationService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * @author SNG-010 |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class PlcLoadGlassTask { |
| | | |
| | | @Autowired |
| | | private UpWorkstationService upWorkstationService; |
| | | @Autowired |
| | | private EngineeringService engineeringService; |
| | | @Autowired |
| | | private UpPattenUsageService upPattenUsageService; |
| | | |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | |
| | | /** |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcLoadGlassTask() throws InterruptedException { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | try { |
| | | Thread.sleep(300); |
| | | upWorkstationService.selectPriority(); |
| | | //获取是否有上片请求 |
| | | String loadRequest = plcParameterObject.getPlcParameter("loadRequest").getValue(); |
| | | String mesToPlc = plcParameterObject.getPlcParameter("MesToPlc").getValue(); |
| | | //判断开始上片的工程号 |
| | | Engineering engineering = engineeringService.selectInitiate(1); |
| | | if ("1".equals(loadRequest) && engineering != null) { |
| | | log.info("开始上片任务"); |
| | | UpPattenUsage upPattenUsage = upWorkstationService.selectPriority(engineering); |
| | | log.info("当有请求时查询当前上片顺序的玻璃信息{}", upPattenUsage); |
| | | UpWorkstation upwork = upWorkstationService.selectWorkstation(upPattenUsage); |
| | | log.info("符合的尺寸的工位玻璃:{}", upwork); |
| | | if (upwork != null) { |
| | | int workId = upwork.getWorkstationId();//工位id |
| | | double width = upwork.getPatternWidth();//宽度 |
| | | double height = upwork.getPatternHeight();//高度 |
| | | S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("WorkId").getAddress(), workId); |
| | | S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("GlassWidth").getAddress(), (long) width); |
| | | S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("GlassHeight").getAddress(), (long) height); |
| | | S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("MesToPlc").getAddress(), 1); |
| | | //更改上片表状态 |
| | | upPattenUsageService.updateUpPattenUsageState(upPattenUsage, workId); |
| | | |
| | | } |
| | | } |
| | | if("1".equals(mesToPlc)&& "0".equals(loadRequest)){ |
| | | //请求字为零时,任务字清零 |
| | | S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("MesToPlc").getAddress(), 0); |
| | | } |
| | | //执行后休眠300毫秒 |
| | | //Thread.sleep(300); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcLoadGlassReport(){ |
| | | //获取是否有汇报 |
| | | String loadStatus = plcParameterObject.getPlcParameter("PlcStatus").getValue(); |
| | | if (loadStatus != null) { |
| | | log.info(loadStatus); |
| | | switch (loadStatus) { |
| | | case "1": |
| | | log.info("收到汇报任务完成"); |
| | | S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("MesToPlcStatus").getAddress(), 1); |
| | | break; |
| | | case "2": |
| | | log.info("收到汇报未完成任务"); |
| | | //减少工位数量,恢复任务状态 |
| | | overTask(loadStatus, 0); |
| | | break; |
| | | case "3": |
| | | log.info("收到汇报玻璃破损"); |
| | | overTask(loadStatus, 0); |
| | | break; |
| | | case "0": |
| | | log.info("收到汇报清0状态"); |
| | | //减少工位数量,完成任务状态 |
| | | overTask(loadStatus, 100); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void overTask(String loadStatus, int state) { |
| | | UpPattenUsage upPattenUsage = upPattenUsageService.selectOverTask(); |
| | | if (upPattenUsage != null) { |
| | | log.info("收到汇报清{}状态", loadStatus); |
| | | //减少工位数量 |
| | | upWorkstationService.reduceWorkstationNumber(upPattenUsage.getState()); |
| | | //完成上片表状态 |
| | | upPattenUsageService.updateUpPattenUsageState(upPattenUsage, state); |
| | | S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("MesToPlcStatus").getAddress(), 0); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | private UpWorkstationService upWorkstationService; |
| | | @ApiOperation("显示工位上的玻璃信息") |
| | | @GetMapping("/list") //查询现在上片机的玻璃信息 |
| | | @ResponseBody |
| | | public Result<List<UpWorkstation>> list() { |
| | | List<UpWorkstation> glass = upWorkstationService.list(); |
| | | log.info("显示工位上的玻璃信息:{}", glass); |
| | |
| | | /** |
| | | * 原片高 |
| | | */ |
| | | private Double patternHeigth; |
| | | private Double patternHeight; |
| | | |
| | | /** |
| | | * 原片厚度 |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.workstation.entity.UpWorkSequence; |
| | | import com.mes.workstation.entity.UpWorkstation; |
| | | import io.lettuce.core.dynamic.annotation.Param; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | package com.mes.workstation.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.workstation.entity.UpWorkSequence; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import com.mes.workstation.entity.UpWorkstation; |
| | | |
| | | /** |
| | |
| | | * @since 2024-04-07 |
| | | */ |
| | | public interface UpWorkstationService extends IService<UpWorkstation> { |
| | | //PlcParameterObject plcmes=PLCAutoMes.PlcMesObject; |
| | | |
| | | |
| | | |
| | | //判断优先吸片位置后发送出片任务 |
| | | UpWorkSequence selectPriority(); |
| | | |
| | | //查询正在进行的工程 |
| | | |
| | | |
| | | //判断优先吸片玻璃 |
| | | /** |
| | | * 判断优先吸片位置 |
| | | * @return UpPattenUsage |
| | | */ |
| | | UpPattenUsage selectPriority(Engineering engineering); |
| | | /** |
| | | * 查询正在进行的单片信息 |
| | | * @return UpWorkstation |
| | | */ |
| | | UpWorkstation selectWorkstation(UpPattenUsage upPattenUsage); |
| | | /** |
| | | * 减少工位数量 |
| | | */ |
| | | void reduceWorkstationNumber(Integer upworkId); |
| | | /** |
| | | * 增加人工输入的工位玻璃信息 |
| | | * |
| | | * @param upwork |
| | | */ |
| | | //修改工位表增加玻璃信息或者删除玻璃信息 |
| | | void updateGlassMessage(UpWorkstation upwork); |
| | | |
| | | |
| | |
| | | package com.mes.workstation.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.engineering.entity.Engineering; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import com.mes.uppattenusage.mapper.UpPattenUsageMapper; |
| | | import com.mes.workstation.entity.UpWorkSequence; |
| | |
| | | public class UpWorkstationServiceImpl extends ServiceImpl<UpWorkstationMapper, UpWorkstation> implements UpWorkstationService { |
| | | @Resource |
| | | UpPattenUsageMapper upPattenUsageMapper; |
| | | public static final String DB_100_10 = "DB_100_10"; |
| | | |
| | | //判断是否可以吸片进行任务 |
| | | public boolean isCanLoadGlass() { |
| | | String loadstart = "吸片信号";//plcmes.getPlcParameter("吸片信号").getValue(); |
| | | return "1".equals(loadstart); |
| | | |
| | | } |
| | | //显示正在进行任务的工程信息 |
| | | @Resource |
| | | UpWorkstationMapper upWorkstationMapper; |
| | | |
| | | |
| | | //判断优先吸片位置后发送出片任务 |
| | | |
| | | public UpWorkSequence selectPriority() { |
| | | UpWorkSequence upwork= this.baseMapper.selectPriority(1); |
| | | String start = "1";//plcmes.getPlcParameter("吸片信号").getValue(); |
| | | UpPattenUsage uplist=new UpPattenUsage(); |
| | | if(start.equals("1")){ |
| | | //发送出片任务 |
| | | UpdateWrapper<UpPattenUsage> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("state",1).last("LIMIT 1"); |
| | | uplist= upPattenUsageMapper.selectOne(updateWrapper); |
| | | log.info("查询出本次出片的玻璃信息[]",uplist); |
| | | } |
| | | return upwork; |
| | | public UpPattenUsage selectPriority(Engineering engineering) { |
| | | QueryWrapper<UpPattenUsage> wrapper=new QueryWrapper<>(); |
| | | wrapper.eq("state", 0) |
| | | .eq("engineering_id",engineering.getEngineerId()) |
| | | .orderByAsc("layout_sequence") |
| | | .last("limit 1"); |
| | | return upPattenUsageMapper.selectOne(wrapper); |
| | | } |
| | | |
| | | //判断工位是否有符合条件的玻璃 |
| | | @Override |
| | | public UpWorkstation selectWorkstation(UpPattenUsage upPattenUsage) { |
| | | QueryWrapper<UpWorkstation> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("pattern_width", upPattenUsage.getWidth()) |
| | | .eq("pattern_height", upPattenUsage.getHeight()) |
| | | .eq("pattern_thickness", upPattenUsage.getThickness()) |
| | | .eq("films_id", upPattenUsage.getFilmsId()) |
| | | .gt("number", 0) |
| | | .orderByAsc("number") |
| | | .last("limit 1"); |
| | | return this.baseMapper.selectOne(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void reduceWorkstationNumber(Integer upworkId) { |
| | | UpdateWrapper<UpWorkstation> wrapper = new UpdateWrapper<>(); |
| | | wrapper.eq("id", upworkId) |
| | | .setSql("number = number - 1"); |
| | | boolean updateResult = upWorkstationMapper.update(null, wrapper) > 0; |
| | | log.info("减少工位数量{}",updateResult); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 增加人工输入的工位玻璃信息/删除人工搬走的玻璃信息 |
| | | * @param upwork |
| | | */ |
| | | @Override |
| | | public void updateGlassMessage(UpWorkstation upwork) { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | { |
| | | "plcAddressBegin":"DB14.0", |
| | | "plcAddressLenght":"98", |
| | | "dataType":"word", |
| | | "parameteInfor":[ |
| | | { |
| | | "codeId": "loadRequest", |
| | | "addressIndex":"0", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "PlcStatus", |
| | | "addressIndex":"10", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "MesToPlc", |
| | | "addressIndex":"20", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "WorkId", |
| | | "addressIndex":"24", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "GlassWidth", |
| | | "addressIndex":"26", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "GlassHeight", |
| | | "addressIndex":"28", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | } |
| | | , |
| | | { |
| | | "codeId": "MesToPlcStatus", |
| | | "addressIndex":"40", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "MesToPlcStatusId", |
| | | "addressIndex":"42", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | }, |
| | | { |
| | | "codeId": "MesTaskStatus", |
| | | "addressIndex":"56", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"" |
| | | } |
| | | ] |
| | | } |
| | |
| | | name: loadGlass |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | # configuration: |
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl 打印sql语句 |
| | |
| | | package com.mes; |
| | | |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.engineering.service.EngineeringService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.pp.mapper.OptimizeProjectMapper; |
| | | import com.mes.uppattenusage.entity.OptimizeUpPattenUsage; |
| | | import com.mes.pp.service.OptimizeProjectService; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import com.mes.uppattenusage.service.impl.UpPattenUsageServiceImpl; |
| | | import com.mes.workstation.entity.UpWorkstation; |
| | | import com.mes.workstation.service.UpWorkstationService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/3/27 16:37 |
| | | * @Description: |
| | | |
| | | */ |
| | | @Slf4j |
| | | @RunWith(SpringRunner.class) |
| | | @SpringBootTest(classes = LoadGlassModuleApplication.class) |
| | | public class LoadGlassModuleApplicationTest { |
| | | |
| | | @Resource |
| | | private OptimizeProjectMapper optimizeProjectMapper; |
| | | // @Resource |
| | | // private OptimizeProjectMapper optimizeProjectMapper; |
| | | @Autowired |
| | | private UpPattenUsageServiceImpl upPattenUsageService; |
| | | @Autowired |
| | | private GlassInfoService glassInfoService; |
| | | @Autowired |
| | | private EngineeringService engineeringService; |
| | | @Autowired |
| | | private UpWorkstationService workstationService; |
| | | @Autowired |
| | | private OptimizeProjectService optimizeProjectService; |
| | | @Test |
| | | public void test() { |
| | | // List<OptimizeProject> list = optimizeProjectMapper.saveProject("P24032204"); |
| | |
| | | |
| | | @Test |
| | | public void testFindPa() { |
| | | List<UpPattenUsage> glass = upPattenUsageService.selectSaveUpPattenUsage("P24032204"); |
| | | log.info("完整路径:{}", Arrays.asList(glass)); |
| | | Engineering engineering= engineeringService.selectInitiate(1); |
| | | log.info("开始上片的工程:{}", Arrays.asList(engineering)); |
| | | UpPattenUsage upPattenUsage = workstationService.selectPriority(engineering); |
| | | log.info("上片顺序:{}", Arrays.asList(upPattenUsage)); |
| | | UpWorkstation glass2=workstationService.selectWorkstation(upPattenUsage); |
| | | log.info("符合的工位玻璃{}",glass2); |
| | | workstationService.reduceWorkstationNumber(glass2.getWorkstationId()); |
| | | //减少数量 |
| | | upPattenUsageService.updateUpPattenUsageState(upPattenUsage,1); |
| | | //更新状态 |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void textglassinfo(){ |
| | | List<GlassInfo> glass= glassInfoService.selectGlassInfo("P24032204"); |
| | | public void textengineering(){ |
| | | List<Engineering> glass= engineeringService.selectEngineering("P24032204"); |
| | | engineeringService.saveEngineering(glass); |
| | | log.info("glassinfo:{}", Arrays.asList(glass)); |
| | | } |
| | | @Test |
| | | public void textengineering2(){ |
| | | //更新工程表状态为已领取 |
| | | //optimizeProjectService.changeTask("P24050801",200); |
| | | engineeringService.changeTask("P24051102",1); |
| | | } |
| | | @Test |
| | | public void textengineering3(){ |
| | | //判断是否已保存过工程号到上片表 |
| | | UpPattenUsage upPattenUsage=upPattenUsageService.selectOverTask(); |
| | | log.info("上片表任务中的数据{}",upPattenUsage); |
| | | } |
| | | @Test |
| | | public void textengineering4(){ |
| | | //判断是否已保存过工程号到上片表 |
| | | List<Engineering> engineerings=engineeringService.selectTask(); |
| | | log.info("上片表任务中的数据{}",engineerings); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.mes; |
| | | |
| | | import com.mes.common.S7object; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.boot.ApplicationArguments; |
| | | import org.springframework.boot.ApplicationRunner; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * @author SNG-012 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | @Order(1) |
| | | |
| | | public class AppRunnerConfig implements ApplicationRunner { |
| | | |
| | | |
| | | @Override |
| | | public void run(ApplicationArguments args) throws Exception { |
| | | log.info("启动完成"); |
| | | S7object.getinstance().start(); |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.common; |
| | | |
| | | import com.github.xingshuangs.iot.protocol.s7.enums.EPlcType; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.tools.InitUtil; |
| | | import com.mes.tools.S7control; |
| | | |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/4/9 15:13 |
| | | * @Description: |
| | | */ |
| | | public class S7object extends Thread { |
| | | public S7control plccontrol; // PLC通讯类实例 |
| | | private EPlcType plcType = EPlcType.S1200; // 西门子PLC类型 |
| | | private String ip = "192.168.10.1"; // plc ip地址 |
| | | private int port = 102; // plc 端口号 |
| | | |
| | | |
| | | public PlcParameterObject PlcMesObject; |
| | | private static volatile S7object instance = null; |
| | | |
| | | private S7object() { |
| | | if (plccontrol == null) { |
| | | plccontrol = new S7control(plcType, ip, port, 0, 0); |
| | | |
| | | String PlcCacheGlass=S7object.class.getResource("/JsonFile/PlcdownGlass.json").getPath(); |
| | | //log.info(PLCAutoMes.class.getResource("").getPath()); |
| | | PlcMesObject = InitUtil.initword(PlcCacheGlass); |
| | | } |
| | | } |
| | | |
| | | // 单例模式 获取类的唯一实例 |
| | | public static S7object getinstance() { |
| | | if (instance == null) { |
| | | synchronized (S7object.class) { |
| | | if (instance == null) { |
| | | instance = new S7object(); |
| | | } |
| | | } |
| | | } |
| | | return instance; |
| | | } |
| | | |
| | | @Override |
| | | public void run() { |
| | | while (this != null) { |
| | | try { |
| | | Thread.sleep(100); |
| | | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | byte[] getplcvlues= plccontrol.ReadByte(PlcMesObject.getPlcAddressBegin(),PlcMesObject.getPlcAddressLength()); |
| | | PlcMesObject.setPlcParameterList(getplcvlues); |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * 玻璃id |
| | | */ |
| | | private String glassId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date CreateTime; |
| | | } |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | void updateTaskStateToZero(String id); |
| | | void updateTaskState(String id); |
| | | |
| | | /** |
| | | * 删除任务 |
| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public List<DownGlassTask> getUnloadingTaskState() { |
| | | QueryWrapper<DownGlassTask> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("task_stauts", 1); |
| | | queryWrapper.eq("task_stauts", 0); |
| | | return baseMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void updateTaskStateToZero(String id) { |
| | | public void updateTaskState(String id) { |
| | | UpdateWrapper<DownGlassTask> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.set("task_stauts", 0).eq("id", id); |
| | | updateWrapper.set("task_stauts", 2).eq("id", id); |
| | | baseMapper.update(new DownGlassTask(), updateWrapper); |
| | | } |
| | | |
| | |
| | | // 如果主键值不存在,则进行插入操作 |
| | | DownGlassTask newDownGlassTask = new DownGlassTask(); |
| | | BeanUtils.copyProperties(downGlassTask, newDownGlassTask); |
| | | newDownGlassTask.setTaskStauts(0); // 默认任务状态为0 |
| | | |
| | | newDownGlassTask.setTaskStauts(1); // 默认任务状态为1 |
| | | newDownGlassTask.setCreateTime(new Date()); |
| | | int rows = baseMapper.insert(newDownGlassTask); |
| | | return rows > 0 ? rows : null; |
| | | } |
| | |
| | | package com.mes.downstorage.service; |
| | | |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface DownStorageCageDetailsService { |
| | | public interface DownStorageCageDetailsService extends MPJBaseService<DownStorageCageDetails> { |
| | | /** |
| | | * @return //添加理片笼内信息 |
| | | */ |
| | |
| | | List<DownStorageCageDetails> CacheOut(int start, int end); |
| | | |
| | | /** |
| | | * @return 查询空格子 |
| | | * @return 出片 |
| | | */ |
| | | // List<DownStorageCageDetails> selectCacheEmpty2(); |
| | | |
| | | List<DownStorageCageDetails> CacheOut1(int start, int end); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | */ |
| | | public interface DownStorageCageService extends MPJBaseService<DownStorageCage> { |
| | | |
| | | |
| | | DownGlassTask createDownGlassTask(GlassInfo glassInfo, String startCell, String endCell, String taskType); |
| | | DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, String startCell, String endCell, String taskType); |
| | | // List<Map<String, Object>> selectCacheLeisure(); |
| | | |
| | | |
| | | /** |
| | | * @param Number |
| | | * @return 进片 |
| | | */ |
| | | boolean processInto(String Number); |
| | | |
| | | /** |
| | | |
| | | * @return 空格 |
| | | */ |
| | | |
| | | /** |
| | | * @return 出片 |
| | | */ |
| | | boolean processOut(); |
| | | |
| | | |
| | | /** |
| | |
| | | package com.mes.downstorage.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | |
| | | |
| | |
| | | |
| | | import com.mes.downstorage.mapper.DownStorageCageMapper; |
| | | import com.mes.downstorage.service.DownStorageCageDetailsService; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.mapper.DownWorkstationMapper; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class DownStorageCageDetailsServiceImpl extends ServiceImpl<DownStorageCageDetailsMapper, DownStorageCageDetails> implements DownStorageCageDetailsService { |
| | | |
| | | @Autowired(required=false) |
| | | @Autowired(required = false) |
| | | private DownStorageCageMapper downStorageCageMapper; |
| | | @Autowired |
| | | private DownStorageCageDetailsMapper downStorageCageDetailsMapper; |
| | | @Autowired |
| | | private GlassInfoMapper glassInfoMapper; |
| | | @Autowired |
| | | private DownWorkstationMapper downWorkstationMapper; |
| | | |
| | | @Override |
| | | public void addDownStorageCageDetails(DownStorageCageDetails details) { |
| | |
| | | |
| | | @Override |
| | | //修改理片笼内信息 功能:对笼内栅格玻璃 【添加/删除/更换】 |
| | | public boolean updatedownStorageCageDetails(DownStorageCageDetails details){ |
| | | public boolean updatedownStorageCageDetails(DownStorageCageDetails details) { |
| | | baseMapper.updateById(details); |
| | | return true; |
| | | } |
| | |
| | | |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // @Override |
| | |
| | | // } |
| | | |
| | | |
| | | @Override |
| | | public List<DownStorageCageDetails> CacheOut1(int start, int end) { |
| | | |
| | | |
| | | List<DownStorageCageDetails> cageDetails = downStorageCageDetailsMapper.selectList(null); |
| | | // Step 5: 判断 down_storage_cage_details 结果数量是否为9,如果是,则执行另外一个查询 |
| | | if (cageDetails.size() == 9) { |
| | | log.info("1、笼子满了的时候,按照笼内版图id 版图片序出"); |
| | | List<DownWorkstation> workstationList = downWorkstationMapper.selectList(new QueryWrapper<DownWorkstation>().between("workstation_id", start, end)); |
| | | |
| | | |
| | | List<String> flowCardIds = new ArrayList<>(); |
| | | for (DownWorkstation workstation : workstationList) { |
| | | flowCardIds.add(workstation.getFlowCardId()); |
| | | } |
| | | |
| | | if (flowCardIds.isEmpty()) { |
| | | log.error("未找到对应的 flow_card_id"); |
| | | return Collections.emptyList(); // 返回空列表或者抛出异常,视情况而定 |
| | | } |
| | | LambdaQueryWrapper<DownStorageCageDetails> anotherQueryWrapper = Wrappers.lambdaQuery(); |
| | | |
| | | anotherQueryWrapper.orderByAsc(DownStorageCageDetails::getTemperingLayoutId); |
| | | anotherQueryWrapper.orderByDesc(DownStorageCageDetails::getTemperingFeedSequence); |
| | | anotherQueryWrapper.in(DownStorageCageDetails::getFlowCardId, flowCardIds); |
| | | anotherQueryWrapper.last("LIMIT 1"); |
| | | return downStorageCageDetailsMapper.selectList(anotherQueryWrapper); |
| | | } else { |
| | | |
| | | // Step 1: 查询 DownWorkstation 表获取对应 workstation_id 的 flow_card_id |
| | | List<DownWorkstation> workstationList = downWorkstationMapper.selectList(new QueryWrapper<DownWorkstation>().between("workstation_id", start, end)); |
| | | |
| | | |
| | | List<String> flowCardIds = new ArrayList<>(); |
| | | for (DownWorkstation workstation : workstationList) { |
| | | flowCardIds.add(workstation.getFlowCardId()); |
| | | } |
| | | |
| | | if (flowCardIds.isEmpty()) { |
| | | log.error("2、未找到对应的 flow_card_id"); |
| | | return Collections.emptyList(); // 返回空列表或者抛出异常,视情况而定 |
| | | } |
| | | log.info("流程卡:{}", flowCardIds); |
| | | LambdaQueryWrapper<GlassInfo> queryWrapper2 = Wrappers.lambdaQuery(); |
| | | queryWrapper2.select(GlassInfo::getFlowCardId, |
| | | GlassInfo::getGlassId, |
| | | GlassInfo::getTemperingLayoutId, |
| | | GlassInfo::getTemperingFeedSequence) |
| | | .notInSql(GlassInfo::getGlassId, "SELECT glass_id FROM down_glass_info") |
| | | .orderByAsc(GlassInfo::getTemperingLayoutId) |
| | | .orderByDesc(GlassInfo::getTemperingFeedSequence) |
| | | .last("LIMIT 1"); |
| | | |
| | | // 查询 GlassInfo 表 |
| | | List<GlassInfo> glassInfos = glassInfoMapper.selectList(queryWrapper2); |
| | | if (glassInfos.isEmpty()) { |
| | | log.error("未找到对应的玻璃信息"); |
| | | return Collections.emptyList(); // 返回空列表或者抛出异常,视情况而定 |
| | | } |
| | | // Step 3: 构造查询 down_storage_cage_details 表的条件 |
| | | List<String> glassIds = glassInfos.stream().map(GlassInfo::getGlassId).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<DownStorageCageDetails> cageDetailsQueryWrapper = Wrappers.lambdaQuery(); |
| | | cageDetailsQueryWrapper.in(DownStorageCageDetails::getGlassId, glassIds); |
| | | cageDetailsQueryWrapper.in(DownStorageCageDetails::getFlowCardId, flowCardIds); |
| | | |
| | | log.info("按照流程卡的版图id 版图片序出"); |
| | | // Step 4: 查询 down_storage_cage_details 表并返回结果 |
| | | return downStorageCageDetailsMapper.selectList(cageDetailsQueryWrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.downstorage.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | 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; |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | @Slf4j |
| | | @Service |
| | | public class DownStorageCageServiceImpl extends ServiceImpl<DownStorageCageMapper, DownStorageCage> implements DownStorageCageService { |
| | | @Autowired(required=false) |
| | | @Autowired(required = false) |
| | | private DownStorageCageMapper downStorageCageMapper; |
| | | |
| | | @Autowired |
| | |
| | | @Autowired |
| | | private DownStorageCageDetailsMapper downStorageCageDetailsMapper; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public DownGlassTask createDownGlassTask(GlassInfo glassInfo, String startCell, String endCell,String taskType ) { |
| | | @Override |
| | | public DownGlassTask createDownGlassTask(GlassInfo glassInfo, String startCell, String endCell, String taskType) { |
| | | DownGlassTask downGlassTask = new DownGlassTask(); |
| | | |
| | | BeanUtils.copyProperties(glassInfo,downGlassTask); |
| | | BeanUtils.copyProperties(glassInfo, downGlassTask); |
| | | |
| | | downGlassTask.setStartCell(startCell); |
| | | downGlassTask.setTaskType(taskType); |
| | | downGlassTask.setEndCell(endCell); |
| | | downGlassTask.setTaskType(taskType); |
| | | downGlassTask.setEndCell(endCell); |
| | | return downGlassTask; |
| | | } |
| | | |
| | | |
| | | public DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, String startCell, String endCell,String taskType ) { |
| | | @Override |
| | | public DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, String startCell, String endCell, String taskType) { |
| | | DownGlassTask downGlassTask = new DownGlassTask(); |
| | | |
| | | BeanUtils.copyProperties(glassInfo,downGlassTask); |
| | | BeanUtils.copyProperties(glassInfo, downGlassTask); |
| | | downGlassTask.setStartCell(startCell); |
| | | downGlassTask.setTaskType(taskType); |
| | | downGlassTask.setEndCell(endCell); |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public boolean processInto(String Number) { |
| | | |
| | | //按id查询玻璃信息表里的玻璃 |
| | | GlassInfo GlassInfo = glassInfoService.selectGlassId(Number); |
| | | PlcParameterObject plcmes = PLCAutoMes.PlcMesObject; |
| | | //存在此玻璃编号 |
| | | if (GlassInfo != null) { |
| | | //同找到同流程卡附近空格 |
| | | List<DownStorageCageDetails> list = selectCacheEmpty(); |
| | | |
| | | if (list.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"; |
| | | |
| | | |
| | | |
| | | 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"; |
| | | |
| | | 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 |
| | | |
| | | |
| | | 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 |
| | | |
| | | 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; |
| | | } |
| | | |
| | | //找到空格子 |
| | | //找到空格子 |
| | | @Override |
| | | public List<DownStorageCageDetails> selectCacheEmpty() { |
| | | return baseMapper.selectJoinList(DownStorageCageDetails.class, |
| | |
| | | .isNull(DownStorageCageDetails::getSlot) |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 修改理片笼信息 功能:对笼内栅格玻璃 【启用/禁用】 |
| | | * |
| | | * @param downStorageCage |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean updateDownStorageCage(DownStorageCage downStorageCage){ |
| | | DownStorageCage downItem=baseMapper.selectById(downStorageCage.getId()); |
| | | public boolean updateDownStorageCage(DownStorageCage downStorageCage) { |
| | | DownStorageCage downItem = baseMapper.selectById(downStorageCage.getId()); |
| | | downItem.setEnableState(downStorageCage.getEnableState()); |
| | | baseMapper.updateById(downItem); |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | *修改理片笼信息 功能:对笼内栅格玻璃 【添加/删除/更换】 |
| | | * 修改理片笼信息 功能:对笼内栅格玻璃 【添加/删除/更换】 |
| | | * |
| | | * @param downStorageCageId |
| | | * @param downStorageCageDetails |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean updateDownStorageCageDetails(int downStorageCageId,DownStorageCageDetails downStorageCageDetails){ |
| | | DownStorageCage downItem=baseMapper.selectById(downStorageCageId); |
| | | log.info("正常"+downItem); |
| | | if(downStorageCageDetails !=null){ |
| | | DownStorageCageDetails edgDItem=downStorageCageDetailsMapper.selectById(downStorageCageDetails.getId()); |
| | | public boolean updateDownStorageCageDetails(int downStorageCageId, DownStorageCageDetails downStorageCageDetails) { |
| | | DownStorageCage downItem = baseMapper.selectById(downStorageCageId); |
| | | log.info("正常" + downItem); |
| | | if (downStorageCageDetails != null) { |
| | | DownStorageCageDetails edgDItem = downStorageCageDetailsMapper.selectById(downStorageCageDetails.getId()); |
| | | //添加 |
| | | if(edgDItem!=null){ |
| | | if (edgDItem != null) { |
| | | //只传格子 :移除玻璃 |
| | | DownStorageCageDetails newresult=downStorageCageDetailsMapper.selectById(downStorageCageDetails.getId()); |
| | | DownStorageCageDetails newresult = downStorageCageDetailsMapper.selectById(downStorageCageDetails.getId()); |
| | | newresult.setSlot(downItem.getSlot()); |
| | | downStorageCageDetailsMapper.updateById(newresult); |
| | | } |
| | | } |
| | | |
| | | if (downItem!=null){ |
| | | if (downItem != null) { |
| | | //移除 |
| | | DownStorageCageDetails result=downStorageCageDetailsMapper.selectOne(new MPJLambdaWrapper<DownStorageCageDetails>().eq(DownStorageCageDetails::getSlot,downStorageCageId)); |
| | | if (result!=null){ |
| | | DownStorageCageDetails result = downStorageCageDetailsMapper.selectOne(new MPJLambdaWrapper<DownStorageCageDetails>().eq(DownStorageCageDetails::getSlot, downStorageCageId)); |
| | | if (result != null) { |
| | | result.setSlot(0); |
| | | downStorageCageDetailsMapper.updateById(result); |
| | | } |
| | |
| | | @GetMapping("/getone") |
| | | public ResponseEntity<?> getOneDownWorkstations() { |
| | | try { |
| | | List<DownWorkstation> data = downWorkstationService.getoneDownWorkstations(1,5); |
| | | List<DownWorkstation> data = downWorkstationService.getoneDownWorkstations(1,6); |
| | | // 构建符合预期格式的响应数据 |
| | | Map<String, Object> responseData = new HashMap<>(); |
| | | responseData.put("code", 200); |
| | |
| | | |
| | | |
| | | |
| | | @ApiOperation("获取工位显示图") |
| | | @ApiOperation("获取工位显示图1") |
| | | @GetMapping("/getwo") |
| | | public ResponseEntity<Map<String, Object>> getwo() { |
| | | Map<String, Object> responseData = new HashMap<>(); |
| | | try { |
| | | List<Map<String, Object>> data = downWorkstationService.getTotalGlassDimensionsByWorkstation(); |
| | | List<Map<String, Object>> data = downWorkstationService.getTotalGlassDimensionsByWorkstation(1,3); |
| | | responseData.put("code", 200); |
| | | responseData.put("msg", "成功"); |
| | | responseData.put("data", data); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @ApiOperation("获取工位显示图1") |
| | | @GetMapping("/getwo2") |
| | | public ResponseEntity<Map<String, Object>> getw2o() { |
| | | Map<String, Object> responseData = new HashMap<>(); |
| | | try { |
| | | List<Map<String, Object>> data = downWorkstationService.getTotalGlassDimensionsByWorkstation(4,6); |
| | | 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); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | * 玻璃ID |
| | | */ |
| | | private String glassId; |
| | | |
| | | /** |
| | | * 工位id |
| | | */ |
| | | private String workstationid; |
| | | |
| | | /** |
| | | * 机器人 |
| | | */ |
| | | private String Robot; |
| | | } |
| | |
| | | */ |
| | | int updateFlowCardIdAndCount(String flowCardId, int glassInfoCount, int workstationId); |
| | | |
| | | void insertdownglassinfo(); |
| | | |
| | | |
| | | /** |
| | | * @return // |
| | | * 工位显示 |
| | | */ |
| | | List<Map<String, Object>> getTotalGlassDimensionsByWorkstation(); |
| | | List<Map<String, Object>> getTotalGlassDimensionsByWorkstation(int start,int end); |
| | | |
| | | |
| | | /** |
| | | * @param flowcardid |
| | | * 根据流程卡号查询 |
| | | * @return |
| | | */ |
| | | DownWorkstation selectByFlowCardId(String flowcardid); |
| | | } |
| | |
| | | /** |
| | | * @param downGlassInfo 插入任务 |
| | | */ |
| | | void insertdownWorkstationtask(DownGlassInfo downGlassInfo); |
| | | void insertdownWorkstationtask(DownGlassInfo downGlassInfo,String workstationid); |
| | | |
| | | /** |
| | | * @param downWorkstationTask 更新任务状态 |
| | | */ |
| | | void updateTaskStateToZero(DownWorkstationTask downWorkstationTask); |
| | | void updateTaskState(DownWorkstationTask downWorkstationTask); |
| | | |
| | | /** |
| | | * @return 获取任务状态为1的信息 |
| | |
| | | |
| | | //工位显示 |
| | | @Override |
| | | public List<Map<String, Object>> getTotalGlassDimensionsByWorkstation() { |
| | | public List<Map<String, Object>> getTotalGlassDimensionsByWorkstation(int start,int end) { |
| | | MPJQueryWrapper<DownWorkstation> 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"); |
| | | .groupBy("t.workstation_id", "t.flow_card_id") |
| | | .orderByAsc("t.workstation_id").between("t.workstation_id", start, end) |
| | | |
| | | ; |
| | | |
| | | 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()); // 使用流程卡号作为子项内容 |
| | | item.put("height", downWorkstionAndDownGlassinfo.getTotalheight()); |
| | | item.put("width", downWorkstionAndDownGlassinfo.getTotalwidth()); |
| | | item.put("fillColor", "yellow"); |
| | | item.put("content", downWorkstionAndDownGlassinfo.getFlowCardId()); |
| | | |
| | | rack.put("item", item); // 将子项对象放入货架对象中 |
| | | // 查询 DownGlassInfo 并添加到 item 中 |
| | | MPJQueryWrapper<DownGlassInfo> glassInfoQueryWrapper = new MPJQueryWrapper<>(); |
| | | glassInfoQueryWrapper.select("*"); // 查询所有列 |
| | | glassInfoQueryWrapper.eq("flow_card_id", downWorkstionAndDownGlassinfo.getFlowCardId()); |
| | | List<DownGlassInfo> downGlassInfoList = downGlassInfoMapper.selectList(glassInfoQueryWrapper); |
| | | |
| | | result.add(rack); // 将货架对象添加到结果列表中 |
| | | //log.info("货架对象: {}", rack); |
| | | |
| | | if (!downGlassInfoList.isEmpty()) { |
| | | |
| | | item.put("downGlassInfoList", downGlassInfoList); |
| | | |
| | | } |
| | | |
| | | rack.put("item", item); |
| | | result.add(rack); |
| | | } |
| | | |
| | | log.info("result"+(result)); |
| | | return result; // 返回最终结果 |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public DownWorkstation selectByFlowCardId(String flowcardid) { |
| | | QueryWrapper<DownWorkstation> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("flow_card_id", flowcardid); |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void insertdownglassinfo() { |
| | | |
| | | |
| | | List<DownGlassTask> taskdownGlassInf = downGlassTaskService.getUnloadingTaskState(); |
| | | // |
| | | |
| | | |
| | | if (taskdownGlassInf != null && !taskdownGlassInf.isEmpty()) { |
| | | |
| | | // |
| | | |
| | | for (DownGlassTask downGlassInfo : taskdownGlassInf) { |
| | | // 创建新的 DownGlassInfo 对象并设置相关属性 |
| | | DownGlassInfo newdownGlassInfo = new DownGlassInfo(); |
| | | // newdownGlassInfo.setId(downGlassInfo.getId()); |
| | | 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.setGlassId(downGlassInfo.getGlassId()); |
| | | 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.getGlassId()); |
| | | //删除下片任务表中的记录 |
| | | downGlassTaskService.deleteTask(downGlassInfo.getGlassId()); |
| | | |
| | | 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); |
| | | //删除机械任务表 |
| | | downWorkstationTaskService.deleteTask(downWorkstation); |
| | | |
| | | |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | // 打印异常信息 |
| | | e.printStackTrace(); |
| | | // 或者可以进行其他异常处理,比如记录日志或者返回特定的错误信息 |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | public class DownWorkstationTaskServiceImpl extends ServiceImpl<DownWorkstationTaskMapper, DownWorkstationTask> implements DownWorkstationTaskService { |
| | | |
| | | |
| | | public void insertdownWorkstationtask(DownGlassInfo downGlassInfo) { |
| | | public void insertdownWorkstationtask(DownGlassInfo downGlassInfo,String workstationid) { |
| | | DownWorkstationTask entity = new DownWorkstationTask(); |
| | | // 查询当前最大的 id 值 |
| | | Long maxId = getMaxId(); |
| | |
| | | BeanUtils.copyProperties(downGlassInfo,entity); |
| | | entity.setId(newId); // 设置手动递增的 id |
| | | entity.setState(1); |
| | | entity.setWorkstationid(workstationid); |
| | | baseMapper.insert(entity); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void updateTaskStateToZero(DownWorkstationTask downWorkstationTask) { |
| | | public void updateTaskState(DownWorkstationTask downWorkstationTask) { |
| | | LambdaUpdateWrapper<DownWorkstationTask> lambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
| | | |
| | | lambdaUpdateWrapper.set(DownWorkstationTask::getState, 0) |
| | | lambdaUpdateWrapper.set(DownWorkstationTask::getState, 2) |
| | | .eq(DownWorkstationTask::getGlassId, downWorkstationTask.getGlassId()); |
| | | |
| | | baseMapper.update(new DownWorkstationTask(), lambdaUpdateWrapper); |
New file |
| | |
| | | package com.mes.job; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.lang.Assert; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.mapper.DownGlassInfoMapper; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.service.DownStorageCageDetailsService; |
| | | import com.mes.downstorage.service.DownStorageCageService; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.entity.DownWorkstationTask; |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import com.mes.downworkstation.service.DownWorkstationTaskService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downglassinfo.service.DownGlassTaskService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/5/8 8:17 |
| | | * @Description: |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class DownCacheGlassTask { |
| | | |
| | | |
| | | @Autowired |
| | | DownGlassTaskService downGlassTaskService; |
| | | @Autowired |
| | | GlassInfoService glassInfoService; |
| | | @Autowired |
| | | DownStorageCageDetailsService downStorageCageDetailsService; |
| | | @Autowired |
| | | DownStorageCageService downStorageCageService; |
| | | @Autowired |
| | | DownWorkstationService downWorkstationService; |
| | | @Autowired |
| | | DownGlassInfoService downGlassInfoService; |
| | | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private DownWorkstationTaskService downWorkstationTaskService; |
| | | |
| | | // @Value("${mes.threshold}") |
| | | private int threshold; |
| | | |
| | | //@Scheduled(fixedDelay = 1000) |
| | | public void plcdownGlassTask() { |
| | | // PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | // String taskRequestTypeValue = plcParameterObject.getPlcParameter("A06_request_word").getValue(); |
| | | // String glassIdeValue = plcParameterObject.getPlcParameter("A05_scanning_ID").getValue(); |
| | | // String confirmationWrodValue = plcParameterObject.getPlcParameter("MES_confirmation_word").getValue(); |
| | | // String outGlassstate = plcParameterObject.getPlcParameter("A09_glass_status").getValue(); |
| | | // String confirmationWrodAddress = plcParameterObject.getPlcParameter("MES_confirmation_word").getAddress(); |
| | | // String G06RobotTaskRequestWord = plcParameterObject.getPlcParameter("G06RobotTaskRequestWord").getAddress(); |
| | | |
| | | |
| | | String taskRequestTypeValue ="3"; |
| | | String glassIdeValue ="NG24041101C002-2-6-1-6"; |
| | | String confirmationWrodValue ="1"; |
| | | String outGlassstate="1"; |
| | | String confirmationWrodAddress="1"; |
| | | String G11RobotTaskRequestWord ="1"; |
| | | String G06RobotTaskRequestWord ="1"; |
| | | String G13RobotTaskRequestWord ="1"; |
| | | |
| | | log.info("1、获取到的请求字为:{},获取到的扫描ID为:{},获取到的确认字为:{},获取到的出片状态为:{}", |
| | | taskRequestTypeValue, glassIdeValue, confirmationWrodValue, outGlassstate); |
| | | |
| | | // if ("0".equals(taskRequestTypeValue)) { |
| | | // if ("0".equals(confirmationWrodValue)) { |
| | | // log.info("2、获取到的请求字为0,且确认字为0,不执行任务"); |
| | | // return; |
| | | // } |
| | | // log.info("2、获取到的请求字为0,将确认字改为0"); |
| | | // S7object.getinstance().plccontrol.WriteWord(confirmationWrodAddress, (short) 0); |
| | | // return; |
| | | // } |
| | | // if (!"0".equals(confirmationWrodValue)) { |
| | | // log.info("2、获取到的请求字不为0,将确认字改为0"); |
| | | // S7object.getinstance().plccontrol.WriteWord(confirmationWrodAddress, (short) 0); |
| | | // return; |
| | | // } |
| | | |
| | | if ("1".equals(taskRequestTypeValue)) { |
| | | log.info("3、进片请求,且确认字为0,执行进片任务"); |
| | | inTo(glassIdeValue, confirmationWrodAddress); |
| | | } else if ("2".equals(taskRequestTypeValue)) { |
| | | |
| | | log.info("3、出片请求,且确认字为0,执行进片任务"); |
| | | outTo( confirmationWrodAddress); |
| | | |
| | | } else if ("3".equals(taskRequestTypeValue)) { |
| | | log.info("3、进片和出片都空闲,执行出片任务"); |
| | | if (outTo(confirmationWrodAddress)) { |
| | | inTo(glassIdeValue, confirmationWrodAddress); |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | if (("1".equals(G11RobotTaskRequestWord) || "1".equals(G06RobotTaskRequestWord)) || "1".equals(G13RobotTaskRequestWord)) { |
| | | log.info("4、有机器人下片请求,执行下片任务"); |
| | | insertdownglassinfo(); |
| | | } |
| | | |
| | | //自动绑定架子,如果工位表没有绑定架子,默认将笼子中数量最多的流程卡号绑定机器手2的空架子 |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 进片任务 |
| | | * @param glassId |
| | | * @param confirmationWrodAddress |
| | | * @param |
| | | */ |
| | | private void inTo(String glassId, String confirmationWrodAddress) { |
| | | log.info("1、按照玻璃id:{}获取玻璃小片信息", glassId); |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | if (glassInfo == null) { |
| | | log.info("2、此玻璃编号不存在"); |
| | | return; |
| | | } |
| | | log.info("2、获取到的玻璃信息为{}", glassInfo); |
| | | |
| | | // if(glassInfo.getFlowCardId()=){ |
| | | // |
| | | // } |
| | | //添加进片任务 查找空格 |
| | | List<DownStorageCageDetails> list = downStorageCageService.selectCacheEmpty(); |
| | | if(list.size()>0){ |
| | | DownStorageCageDetails item = list.get(0); |
| | | |
| | | |
| | | |
| | | log.info("3、查询卧式理片笼里面的空格:{}", list); |
| | | log.info("4、将玻璃信息插入卧式理片笼,当前玻璃信息:{}", glassInfo); |
| | | DownStorageCageDetails details = new DownStorageCageDetails(); |
| | | BeanUtils.copyProperties(glassInfo, details); |
| | | details.setState(1); |
| | | details.setGlassId(glassInfo.getGlassId()); |
| | | details.setSlot(item.getSlot()); |
| | | details.setDeviceId(item.getDeviceId()); |
| | | downStorageCageDetailsService.save(details); |
| | | log.info("5、玻璃信息已存入理片笼详情表,玻璃信息为{}", details); |
| | | |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(glassInfo, "0", item.getSlot() + "", "1"); |
| | | //添加进片任务 |
| | | log.info("6、生成进片任务信息存入任务表{}", downGlassTask); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | } |
| | | //S7object.getinstance().plccontrol.WriteWord(confirmationWrodAddress, (short) 1); |
| | | log.info("7、发送确认字完成"); |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 出片任务 |
| | | * |
| | | * @param confirmationWrodAddress |
| | | * |
| | | */ |
| | | private Boolean outTo( String confirmationWrodAddress) { |
| | | log.info("单片情况根据传入的料架号 查询符合按照版图id和片序出片,并且优先出满架的小片"); |
| | | List<DownStorageCageDetails> list = downStorageCageDetailsService.CacheOut1(1,3); |
| | | |
| | | List<DownStorageCageDetails> list2 = downStorageCageDetailsService.CacheOut1(4,6); |
| | | |
| | | List<DownStorageCageDetails> list3 = downStorageCageDetailsService.CacheOut1(1,6); |
| | | // 优先 超出尺寸优先人工出片 人工处理 |
| | | if (!list3.isEmpty()) { |
| | | |
| | | DownStorageCageDetails item3 = list3.get(0); |
| | | if (item3.getHeight() >= 2500 && item3.getWidth() >= 2660) { |
| | | log.info("人工处理"); |
| | | String endcell = "7"; |
| | | |
| | | |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(item3, "9", endcell, "2"); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | // S7object.getinstance().plccontrol.WriteWord(confirmationWrodAddress, (short) 2); |
| | | |
| | | return true; |
| | | } |
| | | else if (!list2.isEmpty() && !list3.isEmpty()) { |
| | | log.info("前后端都空闲 优先后端出片并且优先满架"); |
| | | DownStorageCageDetails item4 = list2.get(0); |
| | | |
| | | DownWorkstation downWorkstation = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>().eq(DownWorkstation::getFlowCardId, item4.getFlowCardId())); |
| | | String endcell = String.valueOf(downWorkstation.getWorkstationId()); |
| | | |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(item4, "9", endcell, "2"); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | |
| | | //S7object.getinstance().plccontrol.WriteWord(confirmationWrodAddress, (short) 2); |
| | | |
| | | return true; |
| | | |
| | | } |
| | | // 按照版图id和片序符合前端出片 |
| | | else if (!list.isEmpty()) { |
| | | log.info("前端出片"); |
| | | DownStorageCageDetails item = list.get(0); |
| | | DownWorkstation downWorkstation = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>().eq(DownWorkstation::getFlowCardId, item.getFlowCardId())); |
| | | String endcell = String.valueOf(downWorkstation.getWorkstationId()); |
| | | // 出到 G06 |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(item, "9", endcell, "2"); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | // S7object.getinstance().plccontrol.WriteWord(confirmationWrodAddress, (short) 2); |
| | | |
| | | |
| | | return true; |
| | | // 按照版图id和片序符合后端出片 |
| | | } else if (!list2.isEmpty()) { |
| | | log.info("后端出片"); |
| | | DownStorageCageDetails item2 = list2.get(0); |
| | | DownWorkstation downWorkstation = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>().eq(DownWorkstation::getFlowCardId, item2.getFlowCardId())); |
| | | String endcell = String.valueOf(downWorkstation.getWorkstationId()); |
| | | // 出到 G11 |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(item2, "9", endcell, "2"); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | // S7object.getinstance().plccontrol.WriteWord(confirmationWrodAddress, (short) 2); |
| | | return true; |
| | | } |
| | | } |
| | | //如果同时前后端都空闲 优先后端出片并且优先满架 |
| | | |
| | | // 返回结果 |
| | | return false; |
| | | } |
| | | |
| | | |
| | | // |
| | | public void insertdownglassinfo() { |
| | | try { |
| | | |
| | | List<DownGlassTask> taskdownGlassInf = downGlassTaskService.getUnloadingTaskState(); |
| | | if (taskdownGlassInf != null && !taskdownGlassInf.isEmpty()) { |
| | | |
| | | for (DownGlassTask downGlassInfo : taskdownGlassInf) { |
| | | // 创建新的 DownGlassInfo 对象并设置相关属性 |
| | | DownGlassInfo newdownGlassInfo = new DownGlassInfo(); |
| | | |
| | | Integer maxSequence = downGlassInfoService.getMaxSequenceByFlowCardId(downGlassInfo.getFlowCardId()); |
| | | // 初始化顺序字段值 |
| | | int sequence = maxSequence != null ? maxSequence + 1 : 1; |
| | | BeanUtils.copyProperties(downGlassInfo, newdownGlassInfo); |
| | | // 设置顺序字段值 |
| | | newdownGlassInfo.setSequence(sequence); |
| | | // 插入数据到下片玻璃信息表 |
| | | downGlassInfoService.insertDownGlassInfo(newdownGlassInfo); |
| | | log.info("插入数据到下片玻璃信息表"); |
| | | DownWorkstation downWorkstation1 = downWorkstationService.selectByFlowCardId(downGlassInfo.getFlowCardId()); |
| | | downWorkstationService.updateracksnumber(downGlassInfo.getFlowCardId(), downWorkstation1.getRacksnumber() + 1); |
| | | log.info("更新落架数量"); |
| | | sequence++; // 递增顺序字段值 |
| | | |
| | | |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | // 打印异常信息 |
| | | e.printStackTrace(); |
| | | // 或者可以进行其他异常处理,比如记录日志或者返回特定的错误信息 |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "codeId": "G06RobotTaskRequestWord",
|
| | | "addressIndex": "4",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "codeId": "G06ID",
|
| | | "addressIndex": "6",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "codeId": "G11RobotTaskRequestWord",
|
| | | "addressIndex": "8",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "codeId": "G011ID",
|
| | | "addressIndex": "10",
|
| | | "addressLenght": "2"
|
| | | },
|
| | |
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "出片ID",
|
| | | "codeId": "OutputID",
|
| | | "addressIndex": "26",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "前端后端下片",
|
| | | "codeId": "FrontOrRearLowerSlice",
|
| | | "addressIndex": "28",
|
| | | "addressLenght": "2"
|
| | | },
|
| | |
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "codeId": "G06RobotTaskReply",
|
| | | "addressIndex": "32",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "codeId": "G06Rack",
|
| | | "addressIndex": "34",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "codeId": "G11RobotTaskReply",
|
| | | "addressIndex": "36",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "spare",
|
| | | "codeId": "G11Rack",
|
| | | "addressIndex": "38",
|
| | | "addressLenght": "2"
|
| | | },
|
| | |
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "MES任务状态",
|
| | | "codeId": "MESTaskState",
|
| | | "addressIndex": "56",
|
| | | "addressLenght": "2"
|
| | | },
|
| | |
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "报警状态",
|
| | | "codeId": "AlarmState",
|
| | | "addressIndex": "60",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "报警字1",
|
| | | "codeId": "Alarm1",
|
| | | "addressIndex": "62",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "报警字2",
|
| | | "codeId": "Alarm2",
|
| | | "addressIndex": "64",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "报警字3",
|
| | | "codeId": "Alarm3",
|
| | | "addressIndex": "66",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "报警字4",
|
| | | "codeId": "Alarm4",
|
| | | "addressIndex": "68",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "内容",
|
| | | "codeId": "neirong",
|
| | | "addressIndex": "70",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "设备状态字",
|
| | | "codeId": "device",
|
| | | "addressIndex": "72",
|
| | | "addressLenght": "2"
|
| | | },
|
| | |
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "输入输出1",
|
| | | "codeId": "InOut1",
|
| | | "addressIndex": "78",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "输入输出2",
|
| | | "codeId": "InOut2",
|
| | | "addressIndex": "80",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "输入输出3",
|
| | | "codeId": "InOut3",
|
| | | "addressIndex": "82",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "输入输出4",
|
| | | "codeId": "InOut4",
|
| | | "addressIndex": "84",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "输入输出5",
|
| | | "codeId": "InOut5",
|
| | | "addressIndex": "86",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "输入输出6",
|
| | | "codeId": "InOut6",
|
| | | "addressIndex": "88",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "输入输出7",
|
| | | "codeId": "InOut7",
|
| | | "addressIndex": "90",
|
| | | "addressLenght": "2"
|
| | | },
|
| | |
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G04动作状态",
|
| | | "codeId": "G04ActionState",
|
| | | "addressIndex": "102",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G05动作状态",
|
| | | "codeId": "G05ActionState",
|
| | | "addressIndex": "104",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G06动作状态",
|
| | | "codeId": "G06ActionState",
|
| | | "addressIndex": "106",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G07动作状态",
|
| | | "codeId": "G07ActionState",
|
| | | "addressIndex": "108",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G08动作状态",
|
| | | "codeId": "G08ActionState",
|
| | | "addressIndex": "110",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G09动作状态",
|
| | | "codeId": "G09ActionState",
|
| | | "addressIndex": "112",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G10动作状态",
|
| | | "codeId": "G10ActionState",
|
| | | "addressIndex": "114",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G11动作状态",
|
| | | "codeId": "G11ActionState",
|
| | | "addressIndex": "116",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G12动作状态",
|
| | | "codeId": "G12ActionState",
|
| | | "addressIndex": "118",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G13动作状态",
|
| | | "codeId": "G13ActionState",
|
| | | "addressIndex": "120",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G04ID",
|
| | | "codeId": "G04IDS",
|
| | | "addressIndex": "122",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G05ID",
|
| | | "codeId": "G05IDS",
|
| | | "addressIndex": "124",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G06ID",
|
| | | "codeId": "G06IDS",
|
| | | "addressIndex": "126",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G07ID",
|
| | | "codeId": "G07IDS",
|
| | | "addressIndex": "128",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G08ID",
|
| | | "codeId": "G08IDS",
|
| | | "addressIndex": "130",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G09ID",
|
| | | "codeId": "G09IDS",
|
| | | "addressIndex": "132",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G10ID",
|
| | | "codeId": "G10IDS",
|
| | | "addressIndex": "134",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G11ID",
|
| | | "codeId": "G11IDS",
|
| | | "addressIndex": "136",
|
| | | "addressLenght": "2"
|
| | | },
|
| | | {
|
| | | "codeId": "G12ID",
|
| | | "codeId": "G12IDS",
|
| | | "addressIndex": "138",
|
| | | "addressLenght": "2"
|
| | | },
|
| | |
| | | @Test |
| | | public void CacheEmpty() { |
| | | log.info("测试出片"); |
| | | downStorageCageDetailsService.CacheOut(1,10); |
| | | downStorageCageDetailsService.CacheOut(1,2); |
| | | |
| | | } |
| | | @Test |
| | | public void CacheEmpty1() { |
| | | log.info("测试出片"); |
| | | downStorageCageDetailsServiceImpl.CacheOut1(1,6); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Test |
| | | public void getTotalGlassDimensionsByWorkstation() { |
| | | log.info("工位显示"); |
| | | downWorkstationService.getTotalGlassDimensionsByWorkstation(); |
| | | downWorkstationService.getTotalGlassDimensionsByWorkstation(1,3); |
| | | |
| | | } |
| | | |
| | |
| | | public void updateTaskStateToZero() { |
| | | log.info("更新状态0"); |
| | | |
| | | downGlassTaskServiceImpl.updateTaskStateToZero("3"); |
| | | downGlassTaskServiceImpl.updateTaskState("3"); |
| | | } |
| | | |
| | | |