Merge branch 'master' of http://bore.pub:10439/r/HangZhouMes
# Conflicts:
# hangzhoumesParent/common/servicebase/src/main/java/com/mes/damage/service/impl/DamageServiceImpl.java
27个文件已修改
38个文件已添加
1个文件已删除
| | |
| | | export default { |
| | | // serverUrl: "10.153.19.150:88/api", |
| | | serverUrl: "10.153.19.150:88/api", |
| | | // serverUrl: "192.168.1.199:88/api", |
| | | serverUrl: "127.0.0.1:88/api", |
| | | // serverUrl2: "10.153.19.150:88" |
| | | // serverUrl: "127.0.0.1:88/api", |
| | | serverUrl2: "10.153.19.150:88" |
| | | // serverUrl2: "192.168.1.199:88" |
| | | serverUrl2: "127.0.0.1:88" |
| | | // serverUrl2: "127.0.0.1:88" |
| | | |
| | | //serverUrl:"res.abeim.cn" |
| | | } |
| | |
| | | presponsibleequipment :'请选择责任设备', |
| | | remark :'备注', |
| | | premark :'请输入备注', |
| | | } |
| | | }, |
| | | film:{ |
| | | mes:'原片仓储详情', |
| | | warehousing:'入库', |
| | | operate: '操作', |
| | | exit:'编辑', |
| | | delete:'删除', |
| | | outbound:'出库', |
| | | deviceid:'设备ID', |
| | | slot:'栅格号', |
| | | enablestatea:'启用标记', |
| | | disable:'禁用', |
| | | start:'启用', |
| | | startslot:'开始工位', |
| | | endslot:'目标工位', |
| | | slotid:'格子ID', |
| | | width:'原片宽', |
| | | widtha:'原片宽:', |
| | | inwidth:'请输入原片宽', |
| | | height:'原片高', |
| | | inheight:'请输入原片高', |
| | | heighta:'原片高:', |
| | | thickness:'原片厚度', |
| | | inthickness:'请输入原片厚度', |
| | | thicknessa:'原片厚度:', |
| | | films:'膜系', |
| | | infilms:'请输入膜系', |
| | | filmsa:'膜系:', |
| | | createtime:'创建时间', |
| | | remainquantity:'剩余数量', |
| | | thickremainquantity:'原片剩余数量(张):', |
| | | inquantity:'请输入数量', |
| | | quantitya:'数量:', |
| | | enableid:'任务ID', |
| | | originateslot:'起始格子', |
| | | endslot:'目标格子', |
| | | patternquantity:'原片数量', |
| | | enabletype:'任务类型', |
| | | enablestate:'工位状态', |
| | | finish:'已完成', |
| | | unfinish:'未完成', |
| | | dedelete:'是否删除该条内容?', |
| | | dedisable:'是否禁用该条内容?', |
| | | deoutbound:'是否出库该条内容?', |
| | | selectwarehousing:'请选择吊装位', |
| | | inwarehousing:'吊装位:', |
| | | warehousing1:'吊装位1', |
| | | warehousing2:'吊装位2', |
| | | starttime :'开始时间', |
| | | endtime :'结束时间', |
| | | taskstatus :'任务状态', |
| | | built :'新建', |
| | | execution :'执行中', |
| | | finish :'完成', |
| | | tasktype :'任务类型', |
| | | stocke :'入库', |
| | | outbound :'出库', |
| | | dispatch :'调度', |
| | | inquire :'查询', |
| | | station :'工位', |
| | | }, |
| | | } |
| | |
| | | } |
| | | ] |
| | | }, |
| | | |
| | | { |
| | | /*----------- 仓储中心 ----------------*/ |
| | | { |
| | | path: 'GlassStorage', |
| | | name: 'GlassStorage', |
| | | component: () => import('../views/GlassStorage/MaterialRackManagement.vue'), |
| | | component: () => import('../views/GlassStorage/GlassStorage.vue'), |
| | | children:[ |
| | | { |
| | | path: '/GlassStorage/MaterialRackManagement', |
| | | name: 'MaterialRackManagement', |
| | | component: () => import('../views/GlassStorage/MaterialRackManagement.vue') |
| | | }, |
| | | { |
| | | path: '/GlassStorage/rawfilmstorage', |
| | | name: 'rawfilmstorage', |
| | | component: () => import('../views/GlassStorage/rawfilmstorage.vue') |
| | | } |
| | | ] |
| | | }, |
| | | }, |
| | | |
| | | /*----------- 可视化系统 ----------------*/ |
| | | { |
| | |
| | | // export const WebSocketHost = "192.168.1.199"; |
| | | // export const WebSocketHost = "10.153.19.150"; |
| | | export const WebSocketHost = "127.0.0.1"; |
| | | export const WebSocketHost = "10.153.19.150"; |
| | | // export const WebSocketHost = "127.0.0.1"; |
| | | export const host = "88"; |
New file |
| | |
| | | <script setup> |
| | | import {ArrowLeftBold, ArrowRight, Search} from "@element-plus/icons-vue" |
| | | import {useRouter} from "vue-router"; |
| | | let indexFlag=$ref(1) |
| | | function changeRouter(index){ |
| | | indexFlag=index |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <!-- <div id="main-div"> --> |
| | | |
| | | |
| | | <div id="main-body"> |
| | | <router-view /> |
| | | </div> |
| | | <!-- </div> --> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | #main-div{ |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | #div-title{ |
| | | height: 2%; |
| | | width: 100%; |
| | | } |
| | | #searchButton{ |
| | | margin-top: -5px; |
| | | margin-left: 1rem; |
| | | } |
| | | /* #searchButton1{ |
| | | //margin-left: 10rem; |
| | | } */ |
| | | /*main-body样式*/ |
| | | #main-body{ |
| | | width: 100%; |
| | | height: 95%; |
| | | /* margin-top: 1%; */ |
| | | } |
| | | #select{ |
| | | margin-left:0.5rem; |
| | | } |
| | | :deep(.indexTag .el-breadcrumb__inner){ |
| | | color: #5CADFE !important; |
| | | } |
| | | </style> |
New file |
| | |
| | | <script lang="ts" setup> |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {reactive} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | const router = useRouter() |
| | | import type { TableColumnCtx } from 'element-plus' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { useI18n } from 'vue-i18n' |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import request from "@/utils/request" |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { ref, onMounted, onUnmounted, onBeforeUnmount } from "vue"; |
| | | const tableDataa = ref([]) |
| | | const tableDatab = ref([]) |
| | | const { t } = useI18n() |
| | | const add = ref(false) |
| | | const dialogFormVisiblea = ref(false) |
| | | const dialogFormVisibleb = ref(false) |
| | | const dialogFormVisiblec = ref(false) |
| | | const timeRange = ref(["2022-01-01", "2025-01-01"]) |
| | | const selectValuesa = reactive([]); |
| | | let webSocket: WebSocket | null = null; |
| | | const value = ref('') |
| | | const options = [ |
| | | { |
| | | value: t('film.warehousing1'), |
| | | label: t('film.warehousing1'), |
| | | }, |
| | | { |
| | | value: t('film.warehousing2'), |
| | | label: t('film.warehousing2'), |
| | | } |
| | | ] |
| | | const report = ref({ |
| | | enableType: '', |
| | | enableState: '', |
| | | }); |
| | | onMounted(() => { |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/glassStorage/api/talk/rawGlass`; |
| | | const handleMessage = (data) => { |
| | | if(data.tasks !=null){ |
| | | tableDataa.value = data.tasks[0] |
| | | console.log(data.tasks[0]); |
| | | |
| | | } |
| | | if(data.rack !=null){ |
| | | tableDatab.value = data.rack[0] |
| | | } |
| | | }; |
| | | // 删除 |
| | | const opena = async(row) => { |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | t('film.dedelete'), |
| | | t('productStock.prompt'), |
| | | { |
| | | confirmButtonText: t('productStock.yes'), |
| | | cancelButtonText: t('productStock.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | const response = await request.post("/loadGlass/sys/user/deleteUser", [row.id]) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | // 禁用 |
| | | const openb = async(row) => { |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | t('film.dedisable'), |
| | | t('productStock.prompt'), |
| | | { |
| | | confirmButtonText: t('productStock.yes'), |
| | | cancelButtonText: t('productStock.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | const response = await request.post("/loadGlass/sys/user/deleteUser", [row.id]) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | // 出库 |
| | | const openc = async(row) => { |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | t('film.deoutbound'), |
| | | t('productStock.prompt'), |
| | | { |
| | | confirmButtonText: t('productStock.yes'), |
| | | cancelButtonText: t('productStock.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | const response = await request.post("/loadGlass/sys/user/deleteUser", [row.id]) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | // 查询数据 |
| | | const selectReportData = async () => { |
| | | let celllist=[] |
| | | let stateList=[] |
| | | if(selectValuesa[0]!=null&&selectValuesa[0]!='undefined'){ |
| | | if(selectValuesa[0]!=""){ |
| | | celllist=[selectValuesa[0]]; |
| | | } |
| | | } |
| | | if(selectValuesa[1]!=null&&selectValuesa[1]!='undefined'){ |
| | | if(selectValuesa[1]!=""){ |
| | | stateList=[selectValuesa[1]]; |
| | | } |
| | | } |
| | | const response = await request.post("/glassStorage/raw_glass_storage_task/selectRawglasstask", { |
| | | createTime: timeRange.value[0], |
| | | patternQuantity: timeRange.value[1], |
| | | enableType: stateList, |
| | | enableState: celllist |
| | | }) |
| | | if (response.code === 200) { |
| | | tableDataa.value = response.data; |
| | | ElMessage.success(response.message); |
| | | } |
| | | else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | }; |
| | | // 是否禁用 |
| | | const toggleEnableState = async (row: any) => { |
| | | if (!row.deviceId) { |
| | | ElMessage.error(t('basicData.updatanull')); |
| | | return; |
| | | } |
| | | const newState = row.enableState === 1 ? 0 : 1; |
| | | try { |
| | | // 发送请求到后端更新状态 |
| | | const response = await request.post('/glassStorage/rawGlassStorageDetails/updateEnableState', { deviceId: row.deviceId, enableState: newState }); |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | row.enableState = newState; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | ElMessage.error(t('basicData.glassnull')); |
| | | } |
| | | }; |
| | | const handleEdit = (row) => { |
| | | dialogFormVisiblec.value = true; |
| | | }; |
| | | function getStatusType1(enableType) { |
| | | switch (enableType) { |
| | | case 1: |
| | | return 'info'; |
| | | case 2: |
| | | return 'warning'; |
| | | case 3: |
| | | return 'success'; |
| | | } |
| | | } |
| | | function getStatusText1(enableType) { |
| | | switch (enableType) { |
| | | case 1: |
| | | return t('film.stocke');//入库 |
| | | case 2: |
| | | return t('film.outbound');//出库 |
| | | case 3: |
| | | return t('film.dispatch');//调度 |
| | | } |
| | | } |
| | | function getStatusType2(enableState) { |
| | | switch (enableState) { |
| | | case 1: |
| | | return 'info'; |
| | | case 2: |
| | | return 'warning'; |
| | | case 3: |
| | | return 'success'; |
| | | } |
| | | } |
| | | function getStatusText2(enableState) { |
| | | switch (enableState) { |
| | | case 1: |
| | | return t('film.built');//新建 |
| | | case 2: |
| | | return t('film.execution');//执行中 |
| | | case 3: |
| | | return t('film.finish');//完成 |
| | | } |
| | | } |
| | | onBeforeUnmount(() => { |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | <template> |
| | | <div> |
| | | <div style="display: flex; flex-direction: row; align-items: center; margin-top: 20px;"> |
| | | <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="dialogFormVisiblea = true">{{ $t('film.mes') }}</el-button> |
| | | <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="dialogFormVisibleb = true">{{ $t('film.warehousing') }}</el-button> |
| | | <el-date-picker style="margin-left: 10px;" v-model="timeRange" type="daterange" format="YYYY/MM/DD" value-format="YYYY-MM-DD" |
| | | :start-placeholder="$t('film.starttime')" :end-placeholder="$t('film.endtime')" :default-time="defaultTime" /> |
| | | <el-select v-model="selectValuesa[0]" clearable :placeholder="$t('film.taskstatus')" style="margin-left: 10px;" > |
| | | <el-option :label="$t('film.built')" value="1"></el-option> |
| | | <el-option :label="$t('film.execution')" value="2"></el-option> |
| | | <el-option :label="$t('film.finish')" value="3"></el-option> |
| | | </el-select> |
| | | <el-select v-model="selectValuesa[1]" clearable :placeholder="$t('film.tasktype')" style="margin-left: 10px;" > |
| | | <el-option :label="$t('film.stocke')" value="1"></el-option> |
| | | <el-option :label="$t('film.outbound')" value="2"></el-option> |
| | | <el-option :label="$t('film.dispatch')" value="3"></el-option> |
| | | </el-select> |
| | | <el-button type="primary" style="margin-left: 10px;" @click="selectReportData()">{{ $t('film.inquire') }}</el-button> |
| | | </div> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table height="300" ref="table" |
| | | :data="tableDataa" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="enableId" align="center" :label="$t('film.enableid')"/> |
| | | <el-table-column prop="originateSlot" align="center" :label="$t('film.originateslot')"/> |
| | | <el-table-column prop="endSlot" align="center" :label="$t('film.endslot')"/> |
| | | <el-table-column prop="patternQuantity" align="center" :label="$t('film.patternquantity')"/> |
| | | <el-table-column |
| | | align="center" |
| | | :label="$t('film.enabletype')" |
| | | prop="enableType" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusType1(scope.row.enableType)"> |
| | | {{ getStatusText1(scope.row.enableType) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | :label="$t('film.enablestate')" |
| | | prop="enableState" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusType2(scope.row.enableState)"> |
| | | {{ getStatusText2(scope.row.enableState) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="createTime" align="center" :label="$t('film.createtime')" /> |
| | | |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | <div class="awatch"> |
| | | <img src="../../assets/ypcc.png" alt="" style="width: 100%;height: 120%;margin-left: 10px;position: relative;margin-top: -20px;"> |
| | | |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisiblea" top="5vh" width="85%" > |
| | | <el-table ref="table" style="margin-top: 20px;height: 700px;" |
| | | :data="tableDatab" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="deviceId" fixed align="center" :label="$t('film.station')" min-width="80"/> |
| | | <el-table-column prop="patternWidth" align="center" :label="$t('film.width')" min-width="80" /> |
| | | <el-table-column prop="patternHeight" align="center" :label="$t('film.height')" min-width="80" /> |
| | | <el-table-column prop="patternThickness" align="center" :label="$t('film.thickness')" min-width="80" /> |
| | | <el-table-column prop="filmsId" align="center" :label="$t('film.films')" min-width="80" /> |
| | | <el-table-column prop="remainQuantity" align="center" :label="$t('film.remainquantity')" min-width="120" /> |
| | | <el-table-column |
| | | align="center" |
| | | :label="$t('film.enablestate')" |
| | | min-width="80" |
| | | prop="enablestate" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag |
| | | :type="scope.row.enableState == 1 ? 'success' : 'danger'" |
| | | @click="toggleEnableState(scope.row)" |
| | | > |
| | | {{ scope.row.enableState == 1 ? $t('film.start') : $t('film.disable')}} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" :label="$t('film.operate')" align="center" width="270"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="handleEdit(scope.row)">{{ $t('film.exit') }}</el-button> |
| | | <el-button size="mini" type="text" plain @click="opena(scope.row)">{{ $t('film.delete') }}</el-button> |
| | | <el-button size="mini" type="text" plain @click="openc(scope.row)">{{ $t('film.outbound') }}</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisibleb" top="15vh" width="60%"> |
| | | <div style="margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form size="mini" label-width="150px"> |
| | | <el-form label-width="70vm" label-position="right"> |
| | | <el-row > |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('film.widtha')" :required="true" style="width: 17vw;"> |
| | | <el-input :placeholder="$t('film.inwidth')" v-model="number" autocomplete="off" /> |
| | | </el-form-item> |
| | | </div></div> |
| | | </el-col> |
| | | <el-col :span="9"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('film.heighta')" :required="true" style="width: 17vw;"> |
| | | <el-input :placeholder="$t('film.inheight')" v-model="number" autocomplete="off" /> |
| | | </el-form-item></div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('film.thicknessa')" :required="true" style="width: 17vw;"> |
| | | <el-input :placeholder="$t('film.inthickness')" v-model="number" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | <el-col :span="9"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('film.filmsa')" :required="true" style="width: 17vw;"> |
| | | <el-input :placeholder="$t('film.infilms')" v-model="number" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('film.quantitya')" :required="true" style="width: 17vw;"> |
| | | <el-input :placeholder="$t('film.inquantity')" v-model="number" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | <el-col :span="9"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('film.inwarehousing')" :required="true" style="width: 17vw"> |
| | | <el-select :placeholder="$t('film.selectwarehousing')"> |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item></div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </el-form> |
| | | </div> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleConfirm"> |
| | | {{ $t('basicData.confirm') }} |
| | | </el-button> |
| | | <el-button @click="dialogFormVisibleb = false">{{ $t('basicData.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisiblec" top="21vh" width="40%"> |
| | | <div style="margin-left: 50px;margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form size="mini" label-width="100px"> |
| | | <el-form label-width="210px" label-position="right"> |
| | | <el-form-item :label="$t('film.thickremainquantity')" :required="true" style="width: 25vw"> |
| | | <el-input v-model="workstationId" autocomplete="off" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-form> |
| | | </div> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleConfirm"> |
| | | {{ $t('reportWork.sure') }} |
| | | </el-button> |
| | | <el-button @click="dialogFormVisiblec = false">{{ $t('reportWork.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | |
| | | #dt { display:block; float:left;line-height: 20px;margin-left: 100px;} |
| | | #dta { display:block; float:left;line-height: 20px;margin-left: 80%;} |
| | | .awatch{ |
| | | height: 400px; |
| | | width: 1500px; |
| | | max-width: 100%; |
| | | } |
| | | #dialog-footer { |
| | | text-align: center; |
| | | margin-top: -15px; |
| | | } |
| | | </style> |
| | |
| | | <artifactId>fastjson</artifactId> |
| | | <version>1.2.33</version> |
| | | </dependency> |
| | | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.github.yulichang</groupId>--> |
| | | <!-- <artifactId>mybatis-plus-join</artifactId>--> |
| | | <!-- <version>1.2.4</version>--> |
| | | <!-- </dependency>--> |
| | | <dependency> |
| | | <groupId>com.github.yulichang</groupId> |
| | | <artifactId>mybatis-plus-join-boot-starter</artifactId> |
| | |
| | | <artifactId>liquibase-core</artifactId> |
| | | <version>3.8.1</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.eclipse.milo</groupId> |
| | | <artifactId>sdk-client</artifactId> |
| | | <version>0.6.8</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.eclipse.milo</groupId> |
| | | <artifactId>sdk-server</artifactId> |
| | | <version>0.6.8</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | </project> |
| | |
| | | package com.mes.damage.controller; |
| | | |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.entity.DamagePrint; |
| | | import com.mes.damage.service.DamageService; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | int type =Integer.parseInt(map.get("type").toString()); |
| | | int status =Integer.parseInt(map.get("status").toString()); |
| | | String workingProcedure =map.get("workingProcedure").toString(); |
| | | return Result.build(200,"查询成功",damageService.selectDamage(startTime,endTime,type,status,workingProcedure)); |
| | | return Result.build(200,"查询成功",damageService.selectDamage(startTime,endTime,type, workingProcedure)); |
| | | } |
| | | |
| | | @ApiOperation("报工") |
| | |
| | | package com.mes.damage.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.entity.DamagePrint; |
| | |
| | | import com.mes.pp.entity.ReportingWorkDetail; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface DamageService extends MPJBaseService<Damage> { |
| | | |
| | | List<Damage> selectDamage(String startTime, String endTime, int type, int status, String workingProcedure); |
| | | List<Damage> selectDamage(String startTime, String endTime, int type, String workingProcedure); |
| | | |
| | | void submitDamage(List<Damage> damageList); |
| | | |
| | |
| | | gc.setOutputDir("D:\\Documents\\hangzhoumesParent5\\"); |
| | | |
| | | gc.setServiceName("%sService"); //去掉Service接口的首字母I |
| | | gc.setAuthor("wu"); |
| | | gc.setAuthor("wf"); |
| | | gc.setOpen(false); |
| | | mpg.setGlobalConfig(gc); |
| | | |
| | | // 3、数据源配置 |
| | | DataSourceConfig dsc = new DataSourceConfig(); |
| | | dsc.setUrl("jdbc:mysql://localhost:3306/pp?serverTimezone=GMT%2b8"); |
| | | dsc.setUrl("jdbc:mysql://10.153.19.150:3306/yiwumes?serverTimezone=GMT%2b8"); |
| | | dsc.setDriverName("com.mysql.cj.jdbc.Driver"); |
| | | dsc.setUsername("root"); |
| | | dsc.setPassword("beibo.123/"); |
| | |
| | | // 4、包配置 |
| | | PackageConfig pc = new PackageConfig(); |
| | | pc.setParent("com.mes"); |
| | | pc.setModuleName("flow_card"); //模块名 |
| | | pc.setModuleName("raw_glass_storage_station"); //模块名 |
| | | pc.setController("controller"); |
| | | pc.setService("service"); |
| | | pc.setMapper("mapper"); |
| | |
| | | // 5、策略配置 |
| | | StrategyConfig strategy = new StrategyConfig(); |
| | | |
| | | strategy.setInclude("flow_card"); |
| | | // strategy.setInclude("raw_glass_storage_details"); |
| | | // strategy.setInclude("raw_glass_storage_station"); |
| | | strategy.setInclude("raw_glass_storage_station"); |
| | | |
| | | strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略 |
| | | |
| | |
| | | Map<String, Damage> damageMaps=damageMapper.selectList(new MPJLambdaQueryWrapper<Damage>() |
| | | .selectAll(Damage.class) |
| | | .eq(Damage::getEngineerId,upPattenUsage1.getEngineeringId()) |
| | | .and(wrapper->wrapper.eq(Damage::getType,8) |
| | | .or() |
| | | .eq(Damage::getType,9)) |
| | | ).stream().collect(Collectors.toMap(Damage::getGlassId,Damage->Damage,(V1,V2)->V2)); |
| | | |
| | | List<Map<String, Object>> resultCutTerritory=new ArrayList<>(); |
| | |
| | | Map<String, Damage> damageMaps=damageMapper.selectList(new MPJLambdaQueryWrapper<Damage>() |
| | | .selectAll(Damage.class) |
| | | .eq(Damage::getEngineerId,current) |
| | | .and(wrapper->wrapper.eq(Damage::getType,8) |
| | | .or() |
| | | .eq(Damage::getType,9)) |
| | | ).stream().collect(Collectors.toMap(Damage::getGlassId,Damage->Damage,(V1,V2)->V2)); |
| | | |
| | | for (Map<String, Object> item : cutTerritory) { |
| | |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.common.utils.RedisUtil; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import com.mes.tools.WebSocketServer; |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: cz |
| | | active: dev |
| | | application: |
| | | name: cacheVerticalGlass |
| | | liquibase: |
| | | enabled: false |
| | | 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 |
| | | mes: |
| | | sequence: |
| | | order: false |
| | |
| | | package com.mes.job;
|
| | |
|
| | | import cn.hutool.json.JSONObject;
|
| | |
|
| | | import com.mes.rawglassdetails.entity.RawGlassStorageDetails;
|
| | | import com.mes.rawglassdetails.service.RawGlassStorageDetailsService;
|
| | | import com.mes.rawglassstation.entity.RawGlassStorageStation;
|
| | | import com.mes.rawglassstation.service.RawGlassStorageStationService;
|
| | | import com.mes.rawglasstask.entity.RawGlassStorageTask;
|
| | | import com.mes.rawglasstask.service.RawGlassStorageTaskService;
|
| | | import com.mes.shelfrack.entity.request.RawUsageAndShelfRack;
|
| | | import com.mes.shelfrack.service.ShelfRackService;
|
| | | import com.mes.storagetask.entity.request.StorageTaskRequest;
|
| | | import com.mes.storagetask.service.StorageTaskService;
|
| | | import com.mes.tools.WebSocketServer;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.scheduling.annotation.Scheduled;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | | import org.springframework.scheduling.annotation.Scheduled;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | @Slf4j
|
| | | @Component
|
| | |
| | | JSONObject jsonObject = new JSONObject();
|
| | | List<RawGlassStorageDetails> rack = rawGlassStorageDetailsService.list();
|
| | | List<RawGlassStorageStation> state = rawGlassStorageStationService.list();
|
| | | List<RawGlassStorageTask> tasks = rawGlassStorageTaskService.selectTasks();
|
| | |
|
| | | //List<RawGlassStorageTask> tasks = rawGlassStorageTaskService.list();
|
| | | List<RawGlassStorageTask> tasks = rawGlassStorageTaskService.findAll();
|
| | | jsonObject.append("rack",rack);
|
| | | jsonObject.append("state",state);
|
| | | jsonObject.append("tasks",tasks);
|
| | |
| | | package com.mes.rawglassdetails.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.mes.rawglassdetails.service.RawGlassStorageDetailsService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author wf |
| | | * @since 2024-09-10 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/raw_glass_storage_details/raw-glass-storage-details") |
| | | @RequestMapping("/rawGlassStorageDetails") |
| | | public class RawGlassStorageDetailsController { |
| | | |
| | | @Autowired |
| | | // RawGlassStorageDetailsService rawGlassStorageDetailsService; |
| | | private RawGlassStorageDetailsService rawGlassStorageDetailsService; |
| | | @ApiOperation("工位状态") |
| | | @PostMapping("/updateEnableState") |
| | | @ResponseBody |
| | | public Result<Boolean> updateStatus(@RequestBody Integer enableState) { |
| | | boolean result = rawGlassStorageDetailsService.updateRawGlassStorageDetails(String.valueOf(enableState)); |
| | | if (enableState == 1) { |
| | | return Result.build(1, "启用", result); |
| | | } else { |
| | | return Result.build(0, "禁用", result); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.time.LocalDateTime; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private LocalDateTime createTime; |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 剩余数量 |
| | |
| | | package com.mes.rawglassdetails.service; |
| | | |
| | | import com.mes.rawglassdetails.entity.RawGlassStorageDetails; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.rawglassdetails.entity.RawGlassStorageDetails; |
| | | import com.mes.rawglasstask.entity.RawGlassStorageTask; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author wf |
| | | * @since 2024-09-10 |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | public interface RawGlassStorageDetailsService extends IService<RawGlassStorageDetails> { |
| | | List<RawGlassStorageDetails> selectDetails(); |
| | | |
| | | boolean updateRawGlassStorageDetails(String films_id);//要大写这个 |
| | | /** |
| | | *删除表 |
| | |
| | | * @return boolean |
| | | */ |
| | | boolean insertRawGlassStorageDetails(RawGlassStorageDetails rw); |
| | | } |
| | | } |
| | |
| | | |
| | | 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.rawglassdetails.entity.RawGlassStorageDetails; |
| | | import com.mes.rawglassdetails.mapper.RawGlassStorageDetailsMapper; |
| | | import com.mes.rawglassdetails.service.RawGlassStorageDetailsService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.rawglasstask.entity.RawGlassStorageTask; |
| | | import com.mes.rawglasstask.mapper.RawGlassStorageTaskMapper; |
| | | import com.mes.rawglasstask.service.RawGlassStorageTaskService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author wf |
| | | * @since 2024-09-10 |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | @Service |
| | | public abstract class RawGlassStorageDetailsServiceImpl extends ServiceImpl<RawGlassStorageDetailsMapper, RawGlassStorageDetails> implements RawGlassStorageDetailsService { |
| | | @Slf4j |
| | | public class RawGlassStorageDetailsServiceImpl extends ServiceImpl<RawGlassStorageDetailsMapper, RawGlassStorageDetails> implements RawGlassStorageDetailsService { |
| | | |
| | | @Override |
| | | public boolean updateRawGlassStorageDetails(String films_id) { |
| | | UpdateWrapper<RawGlassStorageDetails> wrapper = new UpdateWrapper<>(); //这个类型定义错了,不应该是tasking |
| | | wrapper.set("films_id","1005") |
| | | .eq( "films_id",films_id); |
| | | .eq( "films_id",films_id); |
| | | |
| | | return update(wrapper);//这个方法默认返回的就是bool类型 所有可以直接return这个方法,ok了,你正常创建方法去上一层创 |
| | | } |
| | |
| | | QueryWrapper<RawGlassStorageDetails> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("device_id", device_id); |
| | | return remove(queryWrapper);//remove才是删除,delete得用另外的依赖,默认方法是remove返回bool |
| | | |
| | | } |
| | | |
| | | @Override |
| | | //返回类型 方法名 传输值 |
| | | //返回类型 方法名 传输值 |
| | | public List<RawGlassStorageDetails> selectDetails() { |
| | | // QueryWrapper<RawGlassStorageDetails>queryWrapper=new QueryWrapper<>(); |
| | | // queryWrapper.eq("id",rs.getId()); |
| | |
| | | return this.save(rw); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | package com.mes.rawglassstation.service; |
| | | |
| | | import com.mes.rawglassdetails.entity.RawGlassStorageDetails; |
| | | import com.mes.rawglassstation.entity.RawGlassStorageStation; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.rawglassstation.entity.RawGlassStorageStation; |
| | | import com.mes.rawglasstask.entity.RawGlassStorageTask; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author wf |
| | | * @since 2024-09-10 |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | public interface RawGlassStorageStationService extends IService<RawGlassStorageStation> { |
| | | List<RawGlassStorageStation> selectStations(); |
| | | boolean updateRawGlassStorageStation(String slot); |
| | | boolean deleteRawGlassStorageStation(String device_id); |
| | | boolean insertRawGlassStorageStation(RawGlassStorageStation rw); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.mes.rawglassdetails.entity.RawGlassStorageDetails; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.rawglassstation.entity.RawGlassStorageStation; |
| | | import com.mes.rawglassstation.mapper.RawGlassStorageStationMapper; |
| | | import com.mes.rawglassstation.service.RawGlassStorageStationService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author wf |
| | | * @since 2024-09-10 |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | @Service |
| | | public abstract class RawGlassStorageStationServiceImpl extends ServiceImpl<RawGlassStorageStationMapper, RawGlassStorageStation> implements RawGlassStorageStationService { |
| | | public List<RawGlassStorageStation> selectDetails() { |
| | | @Slf4j |
| | | public class RawGlassStorageStationServiceImpl extends ServiceImpl<RawGlassStorageStationMapper, RawGlassStorageStation> implements RawGlassStorageStationService { |
| | | @Override |
| | | public List<RawGlassStorageStation> selectStations() { |
| | | return list(); |
| | | } |
| | | @Override |
| | |
| | | public boolean insertRawGlassStorageStation(RawGlassStorageStation rw) { |
| | | return this.save(rw); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.rawglasstask.controller; |
| | | |
| | | |
| | | import com.mes.rawglasstask.entity.RawGlassStorageTask; |
| | | import com.mes.rawglasstask.entity.request.RawGlassTaskRequest; |
| | | import com.mes.rawglasstask.service.RawGlassStorageTaskService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | |
| | | * @since 2024-09-10 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/raw_glass_storage_task/raw-glass-storage-task") |
| | | @RequestMapping("/raw_glass_storage_task") |
| | | public class RawGlassStorageTaskController { |
| | | |
| | | @Autowired |
| | | private RawGlassStorageTaskService rwService; //这里是你定义调用的service,这个是报工的 |
| | | @ApiOperation("原片仓储数据查询") |
| | | @PostMapping("/selectRawglasstask") |
| | | public Result selectDamage(@RequestBody RawGlassTaskRequest rw) { |
| | | return Result.build(200,"查询成功", rwService.setRawGlassTaskRequest(rw)); |
| | | } |
| | | } |
| | | |
| | |
| | | public class RawGlassStorageTask implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | // public Object getEndTime; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 任务ID |
| | | */ |
| | | private Integer enableId; |
| | | |
| | | /** |
| | | * 起始格子 |
| | | */ |
| | | private Integer originateSlot; |
| | | |
| | | /** |
| | | * 目标格子 |
| | | */ |
| | | private Integer endSlot; |
| | | |
| | | /** |
| | | * 原片数量 |
| | | */ |
| | | private String patternQuantity; |
| | | |
| | | /** |
| | | * 任务类型 |
| | | */ |
| | | private Integer enableType; |
| | | |
| | | /** |
| | | * 任务状态 |
| | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private LocalDateTime createTime; |
| | | private String createTime; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.rawglasstask.entity.request; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.segments.MergeSegments; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.mes.rawglasstask.entity.RawGlassStorageTask; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class RawGlassTaskRequest { |
| | | |
| | | /** |
| | | * 任务类型 1 入库 2 出库 3 调度 |
| | | */ |
| | | private List<Integer> enableState; |
| | | /** |
| | | * 任务状态 1 新建 2 执行中 3 完成 |
| | | */ |
| | | private List<Integer> enableType; |
| | | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date patternQuantity; |
| | | |
| | | } |
| | |
| | | package com.mes.rawglasstask.service; |
| | | |
| | | import com.mes.rawglassstation.entity.RawGlassStorageStation; |
| | | import com.mes.rawglasstask.entity.RawGlassStorageTask; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.rawglasstask.entity.RawGlassStorageTask; |
| | | import com.mes.rawglasstask.entity.request.RawGlassTaskRequest; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author wf |
| | | * @since 2024-09-10 |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | public interface RawGlassStorageTaskService extends IService<RawGlassStorageTask> { |
| | | List<RawGlassStorageTask> selectTasks(); |
| | | |
| | | List<RawGlassStorageTask> findAll(); |
| | | String setRawGlassTaskRequest(RawGlassTaskRequest request); |
| | | |
| | | List<RawGlassStorageTask> selectTask(); |
| | | List<RawGlassStorageTask> selectTasking(RawGlassStorageTask rawGlassStorageTask); |
| | | boolean updateRawGlassStorageTask(String originate_slot); |
| | | boolean deleteRawGlassStorageTask(String id); |
| | | boolean insertRawGlassStorageTask(RawGlassStorageTask rw); |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.rawglasstask.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.assist.ISqlRunner; |
| | | 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.common.utils.RedisUtil; |
| | | import com.mes.pp.entity.request.Reportingdamage; |
| | | import com.mes.rawglasstask.entity.RawGlassStorageTask; |
| | | import com.mes.rawglasstask.entity.request.RawGlassTaskRequest; |
| | | import com.mes.rawglasstask.mapper.RawGlassStorageTaskMapper; |
| | | import com.mes.rawglasstask.service.RawGlassStorageTaskService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.DateFormat; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class RawGlassRawGlassStorageTaskServiceImpl extends ServiceImpl<RawGlassStorageTaskMapper, RawGlassStorageTask> implements RawGlassStorageTaskService { |
| | | |
| | | |
| | | @Autowired |
| | | RedisUtil redisUtil; |
| | | |
| | | @Override |
| | | public List<RawGlassStorageTask> findAll() { |
| | | RawGlassTaskRequest request = redisUtil.getCacheObject("rawGlassTaskRequest"); |
| | | if (null == request) { |
| | | request = new RawGlassTaskRequest(); |
| | | //设置默认时间 startDate:开始时间 endDate:结束时间 |
| | | DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
| | | Date startDate=null; |
| | | Date endDate=null; |
| | | try { |
| | | startDate= df.parse("2022-01-01"); |
| | | endDate= df.parse("2025-01-01"); |
| | | }catch (ParseException e){ |
| | | e.printStackTrace(); |
| | | } |
| | | request.setCreateTime(startDate);// |
| | | request.setPatternQuantity(endDate); |
| | | //return null; |
| | | } |
| | | |
| | | QueryWrapper<RawGlassStorageTask> queryWrapper = new QueryWrapper<>(); |
| | | //下面这个列是查询字段,不要可以删掉默认查询全部 |
| | | queryWrapper.ge("create_time", request.getCreateTime())//大于时间 |
| | | .le("create_time",request.getPatternQuantity());//小于时间 |
| | | // .orderByDesc("enable_id");//排序字段 |
| | | if(!request.getEnableType().isEmpty()&&request.getEnableType().size()>0){ |
| | | queryWrapper.eq("enable_type", request.getEnableType().get(0)); |
| | | }if(!request.getEnableState().isEmpty()&&request.getEnableState().size()>0){ |
| | | queryWrapper.eq("enable_state", request.getEnableState().get(0)); |
| | | } |
| | | |
| | | return baseMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public String setRawGlassTaskRequest(RawGlassTaskRequest request) { |
| | | if (request == null) { |
| | | redisUtil.deleteObject("rawGlassTaskRequest"); |
| | | } else { |
| | | redisUtil.setCacheObject("rawGlassTaskRequest", request); |
| | | } |
| | | log.info("前端传入参数:{}",request); |
| | | return "success"; |
| | | } |
| | | |
| | | @Override |
| | | public List<RawGlassStorageTask> selectTask() { |
| | | return list(); |
| | | } |
| | | |
| | | @Override |
| | | public List<RawGlassStorageTask> selectTasking(RawGlassStorageTask rw) { |
| | | QueryWrapper<RawGlassStorageTask> queryWrapper = new QueryWrapper<>(); |
| | | //下面这个列是查询字段,不要可以删掉默认查询全部 |
| | | queryWrapper.ge("create_time", rw.getCreateTime())//大于时间 |
| | | .le("create_time",rw.getPatternQuantity())//小于时间 |
| | | .groupBy("enable_id");//排序字段 |
| | | if(rw.getEnableType()!=null){ |
| | | queryWrapper.eq("enable_type", rw.getEnableType()); |
| | | }if(rw.getEnableState()!=null){ |
| | | queryWrapper.eq("enable_state", rw.getEnableState()); |
| | | } |
| | | return baseMapper.selectList(queryWrapper); |
| | | // return list(queryWrapper); |
| | | } |
| | | @Override |
| | | public boolean insertRawGlassStorageTask(RawGlassStorageTask rw) { |
| | | return this.save(rw); |
| | | } |
| | | @Override |
| | | public boolean updateRawGlassStorageTask(String originate_slot) { |
| | | UpdateWrapper<RawGlassStorageTask> wrapper = new UpdateWrapper<>(); |
| | | wrapper.set("originate_slot","1005") |
| | | .eq( "originate_slot",originate_slot); |
| | | return update(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public boolean deleteRawGlassStorageTask(String id) { |
| | | QueryWrapper<RawGlassStorageTask> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("id", id); |
| | | return remove(queryWrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://127.0.0.1:3306/yiwumes?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://10.153.19.150:3306/yiwumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | |
| | | import com.mes.GlassStorageApplication; |
| | | import com.mes.rawglassdetails.entity.RawGlassStorageDetails; |
| | | import com.mes.rawglassdetails.service.RawGlassStorageDetailsService; |
| | | import com.mes.rawglasstask.entity.RawGlassStorageTask; |
| | | import com.mes.rawglasstask.entity.request.RawGlassTaskRequest; |
| | | import com.mes.rawglasstask.service.RawGlassStorageTaskService; |
| | | import com.mes.rawusage.entity.RawUsage; |
| | | import com.mes.rawusage.service.RawUsageService; |
| | | import com.mes.shelfrack.service.ShelfRackService; |
| | |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import java.text.DateFormat; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private RawUsageService rawUsageService; |
| | | @Autowired |
| | | private RawGlassStorageDetailsService rawGlassStorageDetailsService; |
| | | |
| | | private RawGlassStorageDetailsService rawGlassStorageDetailsService; |
| | | @Autowired |
| | | private RawGlassStorageTaskService rawGlassStorageTaskService; |
| | | |
| | | @Test |
| | | public void testFindPath() { |
| | |
| | | shelfRackService.selectshelf_rack(); |
| | | } |
| | | |
| | | /** |
| | | * 测试 |
| | | */ |
| | | @Test |
| | | public void testWebSocket() { |
| | | List<RawGlassStorageTask> list=rawGlassStorageTaskService.findAll(); |
| | | log.info("返回内容:{}",list); |
| | | } |
| | | |
| | | /** |
| | | * 测试修改WebSocket 参数 |
| | | */ |
| | | @Test |
| | | public void testWebSocketArgument() { |
| | | RawGlassTaskRequest request=new RawGlassTaskRequest(); |
| | | //设置参数: |
| | | DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
| | | Date startDate=null; |
| | | Date endDate=null; |
| | | try { |
| | | startDate= df.parse("2022-01-01"); |
| | | endDate= df.parse("2025-01-01"); |
| | | }catch (ParseException e){ |
| | | e.printStackTrace(); |
| | | |
| | | request.setCreateTime(startDate);// |
| | | request.setPatternQuantity(endDate); |
| | | request.setEnableState(new ArrayList<Integer>()); |
| | | request.setEnableType(new ArrayList<Integer>()); |
| | | String list=rawGlassStorageTaskService.setRawGlassTaskRequest(request); |
| | | log.info("返回内容:{}",list); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Test |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: salve_hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://10.153.19.150:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | url: jdbc:sqlserver://10.153.19.150:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | pp: |
| | | url: jdbc:mysql://10.153.19.150:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | |
| | | discovery: |
| | | server-addr: 10.153.19.150:8848 |
| | | application: |
| | | name: temperingGlass |
| | | name: temperingGlass |
| | | redis: |
| | | database: 0 |
| | | host: 10.153.19.150 |
| | |
| | | port: 8084 |
| | | spring: |
| | | profiles: |
| | | active: dev |
| | | active: prod |
| | | application: |
| | | name: temperingGlass |
| | | liquibase: |
| | |
| | | --liquibase formatted sql |
| | | -- liquibase formatted sql |
| | | |
| | | --changeset zsh:20240904001 |
| | | --preconditions onFail:CONTINUE onError:CONTINUE |
| | | --precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'sys_dict_type'; |
| | | -- changeset zsh:20240904001 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | | -- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'sys_dict_type'; |
| | | CREATE TABLE sys_dict_type |
| | | ( |
| | | dict_id BIGINT AUTO_INCREMENT PRIMARY KEY, |
| | | dict_id INT AUTO_INCREMENT PRIMARY KEY, |
| | | dict_name VARCHAR(32) NOT NULL, |
| | | dict_type VARCHAR(32) NOT NULL, |
| | | state CHAR(1) NOT NULL DEFAULT TRUE, |
| | |
| | | create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, |
| | | deleted char(1) DEFAULT 0 |
| | | ); |
| | | --rollback DROP TABLE sys_dict_type; |
| | | -- rollback DROP TABLE sys_dict_type; |
| | | |
| | | --changeset zsh:20240904002 |
| | | --preconditions onFail:CONTINUE onError:CONTINUE |
| | | --precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'sys_dict_data'; |
| | | -- changeset zsh:20240904002 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | | -- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'sys_dict_data'; |
| | | CREATE TABLE sys_dict_data |
| | | ( |
| | | dict_id BIGINT AUTO_INCREMENT PRIMARY KEY, |
| | | dict_id INT AUTO_INCREMENT PRIMARY KEY, |
| | | dict_sort INT NOT NULL, |
| | | dict_label VARCHAR(32) NOT NULL, |
| | | dict_value VARCHAR(32) NOT NULL, |
| | |
| | | create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, |
| | | deleted char(1) DEFAULT 0 |
| | | ); |
| | | --rollback DROP TABLE sys_dict_data; |
| | | -- rollback DROP TABLE sys_dict_data; |
| | | |
| | | |
| | | --changeset zsh:20240904003 |
| | | --preconditions onFail:CONTINUE onError:CONTINUE |
| | | --precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM sys_dict_type WHERE dict_type in ('clearGlass', 'silver', 'doubleSilver', 'thirdSilver', 'ultraClear', 'heatReflect'); |
| | | -- changeset zsh:20240904003 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | | -- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM sys_dict_type WHERE dict_type in ('clearGlass', 'silver', 'doubleSilver', 'thirdSilver', 'ultraClear', 'heatReflect'); |
| | | INSERT INTO sys_dict_type (dict_name, dict_type, state, description, deleted) |
| | | VALUES ('白玻', 'clearGlass', '1', '0', '0'); |
| | | INSERT INTO sys_dict_type (dict_name, dict_type, state, description, deleted) |
| | |
| | | VALUES ('超白', 'ultraClear', '1', '4', '0'); |
| | | INSERT INTO sys_dict_type (dict_name, dict_type, state, description, deleted) |
| | | VALUES ('热反射', 'heatReflect', '1', '5', '0'); |
| | | --rollback DELETE FROM sys_dict_type WHERE dict_type in ('clearGlass', 'silver', 'doubleSilver', 'thirdSilver', 'ultraClear', 'heatReflect'); |
| | | -- rollback DELETE FROM sys_dict_type WHERE dict_type in ('clearGlass', 'silver', 'doubleSilver', 'thirdSilver', 'ultraClear', 'heatReflect'); |
| | | |
| | | --changeset zsh:20240904004 |
| | | --preconditions onFail:CONTINUE onError:CONTINUE |
| | | --precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM sys_dict_data WHERE dict_type in ('clearGlass', 'silver', 'doubleSilver', 'thirdSilver', 'ultraClear', 'heatReflect'); |
| | | -- changeset zsh:20240904004 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | | -- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM sys_dict_data WHERE dict_type in ('白玻', '单银', '双银'); |
| | | INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted) |
| | | VALUES (1, '白玻', 'clearGlass', '白玻', '0', '1', '1', '0'); |
| | | INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted) |
| | |
| | | VALUES (1, '双银lowe', 'doubleSilverLowe', '双银', '2', '1', '1', '0'); |
| | | INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted) |
| | | VALUES (2, '超白双银Lowe', 'ultraDoubleSilverLowe', '双银', '2', '1', '1', '0'); |
| | | --rollback DELETE FROM sys_dict_data WHERE dict_type in ('clearGlass', 'silver', 'doubleSilver', 'thirdSilver', 'ultraClear', 'heatReflect'); |
| | | -- rollback DELETE FROM sys_dict_data WHERE dict_type in ('白玻', '单银', '双银'); |
| | | |
| | | |
| | | -- changeset wangfei:20240918001 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | | -- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'raw_glass_storage_details'; |
| | | CREATE TABLE raw_glass_storage_details |
| | | ( |
| | | id bigint NOT NULL AUTO_INCREMENT, |
| | | device_id int NULL DEFAULT NULL COMMENT '设备id', |
| | | slot_id varchar(255) NULL DEFAULT NULL COMMENT '格子id', |
| | | pattern_width double(8, 2 |
| | | ) NULL DEFAULT NULL COMMENT '原片宽', |
| | | pattern_height double(8, 2) NULL DEFAULT NULL COMMENT '原片高', |
| | | pattern_thickness double(8, 2) NULL DEFAULT NULL COMMENT '原片厚度', |
| | | films_id varchar(255) NULL DEFAULT NULL COMMENT '膜系', |
| | | create_time datetime NOT NULL COMMENT '创建时间', |
| | | remain_quantity varchar(255) NULL DEFAULT NULL COMMENT '剩余数量', |
| | | PRIMARY KEY (id) USING BTREE |
| | | ); |
| | | -- rollback DROP TABLE raw_glass_storage_details; |
| | | |
| | | |
| | | -- changeset wangfei:20240918002 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | | -- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'raw_glass_storage_station'; |
| | | CREATE TABLE raw_glass_storage_station |
| | | ( |
| | | id bigint NOT NULL AUTO_INCREMENT, |
| | | device_id int NULL DEFAULT NULL COMMENT '设备id', |
| | | slot int NULL DEFAULT NULL COMMENT '栅格号', |
| | | enable_state varchar(255) NULL DEFAULT NULL COMMENT '启用标记', |
| | | start_slot int NULL DEFAULT NULL COMMENT '开始工位', |
| | | end_slot int NULL DEFAULT NULL COMMENT '目标工位', |
| | | PRIMARY KEY (id) USING BTREE |
| | | ); |
| | | -- rollback DROP TABLE raw_glass_storage_station; |
| | | |
| | | |
| | | -- changeset wangfei:20240918003 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | | -- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'raw_glass_storage_task'; |
| | | CREATE TABLE raw_glass_storage_task |
| | | ( |
| | | id bigint NOT NULL AUTO_INCREMENT, |
| | | enable_id int NULL DEFAULT NULL COMMENT '任务ID', |
| | | originate_slot int NULL DEFAULT NULL COMMENT '起始格子', |
| | | end_slot int NULL DEFAULT NULL COMMENT '目标格子', |
| | | pattern_quantity varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '原片数量', |
| | | enable_type int NULL DEFAULT NULL COMMENT '任务类型', |
| | | enable_state int NULL DEFAULT NULL COMMENT '任务状态', |
| | | create_time datetime NULL DEFAULT NULL COMMENT '创建时间', |
| | | PRIMARY KEY (id) USING BTREE |
| | | ); |
| | | -- rollback DROP TABLE raw_glass_storage_task; |
| | | |
| | | |
| | | |
New file |
| | |
| | | <databaseChangeLog |
| | | xmlns="http://www.liquibase.org/xml/ns/dbchangelog" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog |
| | | http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd"> |
| | | |
| | | <!-- 引入第一个SQL配置文件 --> |
| | | <include file="./changelog/changelog.sql" relativeToChangelogFile="false"/> |
| | | |
| | | <!-- 更多的include标签... --> |
| | | |
| | | </databaseChangeLog> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <parent> |
| | | <artifactId>moduleService</artifactId> |
| | | <groupId>com.mes</groupId> |
| | | <version>1.0-SNAPSHOT</version> |
| | | <relativePath>../pom.xml</relativePath> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>glassStorage</artifactId> |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml</artifactId> |
| | | <version>5.2.4</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.code.gson</groupId> |
| | | <artifactId>gson</artifactId> |
| | | <version>2.8.9</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <properties> |
| | | <maven.compiler.source>8</maven.compiler.source> |
| | | <maven.compiler.target>8</maven.compiler.target> |
| | | </properties> |
| | | |
| | | </project> |
New file |
| | |
| | | package com.mes; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/4/7 14:36RRRR |
| | | * @Description: |
| | | */ |
| | | @Slf4j |
| | | @SpringBootApplication |
| | | @EnableSwagger2WebMvc |
| | | @EnableDiscoveryClient |
| | | @MapperScan(basePackages = "com.mes.*.mapper") |
| | | @EnableScheduling |
| | | public class GlassStorageApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(GlassStorageApplication.class, args); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.job; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | |
| | | import com.mes.shelfrack.entity.request.RawUsageAndShelfRack; |
| | | import com.mes.shelfrack.service.ShelfRackService; |
| | | import com.mes.storagetask.entity.request.StorageTaskRequest; |
| | | import com.mes.storagetask.service.StorageTaskService; |
| | | import com.mes.tools.WebSocketServer; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class push { |
| | | |
| | | @Autowired |
| | | private StorageTaskService storageTaskService; |
| | | @Autowired |
| | | private ShelfRackService shelfRackService; |
| | | |
| | | |
| | | @Scheduled(fixedDelay = 2000) |
| | | public void sendDownWorkstations() { |
| | | log.info("发送任务信息和架子信息"); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | |
| | | List<RawUsageAndShelfRack> rack = shelfRackService.selectshelf_rack(); |
| | | List<StorageTaskRequest> tasks = storageTaskService.Tasks(); |
| | | |
| | | jsonObject.append("rack",rack); |
| | | jsonObject.append("tasks",tasks); |
| | | log.info(jsonObject.toString()); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("storageTask"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null&&webserver.session.isOpen()) { |
| | | log.info("已发送"); |
| | | webserver.sendMessage(String.valueOf(jsonObject)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.loadposition.controller; |
| | | |
| | | import com.mes.loadposition.entity.LoadPosition; |
| | | import com.mes.loadposition.service.LoadPositionService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/api/loadPosition") |
| | | @Api(tags = " 控制器") |
| | | public class LoadPositionController { |
| | | |
| | | @Autowired |
| | | private LoadPositionService loadPositionService; |
| | | |
| | | /** |
| | | * 列表查询 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "列表查询",notes = "列表查询",produces = "application/json") |
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")}) |
| | | @PostMapping("/findList") |
| | | public Result findList(@RequestBody LoadPosition params) { |
| | | List<LoadPosition> result = loadPositionService.findList(params); |
| | | return Result.success(result); |
| | | } |
| | | |
| | | /** |
| | | * 查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "查询", notes = "查询详情") |
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")}) |
| | | @GetMapping("/{id}") |
| | | public Result findById(@PathVariable("id") Long id) { |
| | | LoadPosition loadPosition = loadPositionService.getBaseMapper().selectById(id); |
| | | return Result.success(loadPosition); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | * |
| | | * @param loadPosition |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "新增", notes = "新增数据") |
| | | @ApiResponses({@ApiResponse(code = 200, message = "操作成功")}) |
| | | @PostMapping |
| | | public Result insert( @RequestBody LoadPosition loadPosition) { |
| | | boolean result = loadPositionService.save(loadPosition); |
| | | return Result.success(result); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * |
| | | * @param loadPosition |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "修改", notes = "修改数据") |
| | | @ApiResponses({@ApiResponse(code = 200, message = "操作成功")}) |
| | | @PutMapping |
| | | public Result update( @RequestBody LoadPosition loadPosition) { |
| | | boolean result = loadPositionService.updateById(loadPosition); |
| | | return Result.success(result); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "删除", notes = "删除数据") |
| | | @DeleteMapping("/{id}") |
| | | public Result delete(@PathVariable("id") Long id) { |
| | | int result = loadPositionService.getBaseMapper().deleteById(id); |
| | | return Result.success(result); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.loadposition.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | @Data |
| | | @Component |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("load_position") |
| | | @ApiModel(value = "LoadPosition", description = " ") |
| | | public class LoadPosition implements Serializable{ |
| | | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 架子编号 |
| | | */ |
| | | @ApiModelProperty("架子编号") |
| | | private String number; |
| | | |
| | | /** |
| | | * 机器编号 |
| | | */ |
| | | @ApiModelProperty("机器编号") |
| | | private Long machineId; |
| | | |
| | | /** |
| | | * 启用标记 |
| | | */ |
| | | @ApiModelProperty("启用标记") |
| | | private String flag; |
| | | |
| | | /** |
| | | * 工作状态 |
| | | */ |
| | | @ApiModelProperty("工作状态") |
| | | private String state; |
| | | |
| | | /** |
| | | * 仓储任务编号 |
| | | */ |
| | | @ApiModelProperty("仓储任务编号") |
| | | private Integer storageTaskId; |
| | | |
| | | /** |
| | | * 上片位类型 |
| | | */ |
| | | @ApiModelProperty("上片位类型") |
| | | private Integer typeFlag; |
| | | |
| | | /** |
| | | * 线路 |
| | | */ |
| | | @ApiModelProperty("线路") |
| | | private Integer routeGroup; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.loadposition.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.loadposition.entity.LoadPosition; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | * |
| | | */ |
| | | |
| | | public interface LoadPositionMapper extends BaseMapper<LoadPosition> { |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.mes.mapper.LoadPositionMapper"> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.mes.loadposition.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.loadposition.entity.LoadPosition; |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | public interface LoadPositionService extends IService<LoadPosition> { |
| | | |
| | | List<LoadPosition> findList(LoadPosition params); |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.loadposition.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.loadposition.entity.LoadPosition; |
| | | |
| | | import com.mes.loadposition.service.LoadPositionService; |
| | | import com.mes.loadposition.mapper.LoadPositionMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | @Service |
| | | public class LoadPositionServiceImpl extends ServiceImpl<LoadPositionMapper, LoadPosition> implements LoadPositionService { |
| | | |
| | | @Autowired |
| | | private LoadPositionMapper loadPositionMapper; |
| | | |
| | | @Override |
| | | public List<LoadPosition> findList(LoadPosition params){ |
| | | LambdaQueryWrapper<LoadPosition> query = Wrappers.lambdaQuery(LoadPosition.class); |
| | | return loadPositionMapper.selectList(query); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.rawusage.controller; |
| | | |
| | | import com.mes.shelfrack.entity.request.RawUsageAndShelfRack; |
| | | import com.mes.utils.Result; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.mes.rawusage.entity.RawUsage; |
| | | import com.mes.rawusage.service.RawUsageService; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/api/rawUsage") |
| | | @Api(tags = " 控制器") |
| | | public class RawUsageController { |
| | | |
| | | @Autowired |
| | | private RawUsageService rawUsageService; |
| | | |
| | | /** |
| | | * 列表查询 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "列表查询",notes = "列表查询",produces = "application/json") |
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")}) |
| | | @PostMapping("/findList") |
| | | public Result findList(@RequestBody RawUsage params) { |
| | | List<RawUsage> result = rawUsageService.findList(params); |
| | | return Result.success(result); |
| | | } |
| | | |
| | | /** |
| | | * 查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "查询", notes = "查询详情") |
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")}) |
| | | @GetMapping("/{id}") |
| | | public Result findById(@PathVariable("id") Long id) { |
| | | RawUsage rawUsage = rawUsageService.getById(id); |
| | | return Result.success(rawUsage); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | * |
| | | * @param rawUsage |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "新增", notes = "新增数据") |
| | | @ApiResponses({@ApiResponse(code = 200, message = "操作成功")}) |
| | | @PostMapping |
| | | public Result insert( @RequestBody RawUsage rawUsage) { |
| | | boolean result = rawUsageService.save(rawUsage); |
| | | return Result.success(result); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * |
| | | * @param rawUsage |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "修改", notes = "修改数据") |
| | | @ApiResponses({@ApiResponse(code = 200, message = "操作成功")}) |
| | | @PostMapping("/updaterawUsage") |
| | | public Result updaterawUsage(@RequestBody RawUsage rawUsage) { |
| | | boolean result = rawUsageService.updateById(rawUsage); |
| | | return Result.success(result); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "删除", notes = "删除数据") |
| | | @PostMapping("/id") |
| | | public Result delete(@RequestBody RawUsage rawUsage) { |
| | | rawUsageService.updateRawPackageAndStorageRack(rawUsage); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "入库", notes = "入库") |
| | | @PostMapping("/inStorage") |
| | | public Result inStorage(@RequestBody RawUsageAndShelfRack rawUsage) { |
| | | rawUsageService.inStorage(rawUsage); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "出库", notes = "出库") |
| | | @PostMapping("/outStorage") |
| | | public Result outStorage(@RequestBody RawUsageAndShelfRack rawUsage) { |
| | | rawUsageService.outStorage(rawUsage); |
| | | return Result.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.rawusage.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | @Data |
| | | @Component |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("raw_usage") |
| | | @ApiModel(value = "RawUsage", description = " ") |
| | | public class RawUsage implements Serializable{ |
| | | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 玻璃类型 |
| | | */ |
| | | @ApiModelProperty("玻璃类型") |
| | | private String rawType; |
| | | |
| | | /** |
| | | * 宽度 |
| | | */ |
| | | @ApiModelProperty("宽度") |
| | | private Float rawWidth; |
| | | |
| | | /** |
| | | * 高度 |
| | | */ |
| | | @ApiModelProperty("高度") |
| | | private Float rawHeight; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | @ApiModelProperty("厚度") |
| | | private Float rawThickness; |
| | | |
| | | /** |
| | | * 状态 |
| | | */ |
| | | @ApiModelProperty("状态") |
| | | private String state; |
| | | |
| | | /** |
| | | * 颜色 |
| | | */ |
| | | @ApiModelProperty("颜色") |
| | | private String color; |
| | | |
| | | /** |
| | | * 总数量 |
| | | */ |
| | | @ApiModelProperty("总数量") |
| | | private Integer pieces; |
| | | |
| | | /** |
| | | * 剩余数量 |
| | | */ |
| | | @ApiModelProperty("剩余数量") |
| | | private Integer leftPieces; |
| | | |
| | | /** |
| | | * 物料编码 |
| | | */ |
| | | @ApiModelProperty("物料编码") |
| | | private String qrcode; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty("创建时间") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 生产日期 |
| | | */ |
| | | @ApiModelProperty("生产日期") |
| | | private Date productionTime; |
| | | |
| | | /** |
| | | * 批次号 |
| | | */ |
| | | @ApiModelProperty("批次号") |
| | | private String batchId; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.rawusage.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.rawusage.entity.RawUsage; |
| | | /** |
| | | * |
| | | * |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | * |
| | | */ |
| | | |
| | | public interface RawUsageMapper extends BaseMapper<RawUsage> { |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.mes.rawusage.mapper.RawUsageMapper"> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.mes.rawusage.service; |
| | | |
| | | import com.mes.rawusage.entity.RawUsage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.shelfrack.entity.ShelfRack; |
| | | import com.mes.shelfrack.entity.request.RawUsageAndShelfRack; |
| | | |
| | | import java.util.List; |
| | | /** |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | public interface RawUsageService extends IService<RawUsage> { |
| | | |
| | | List<RawUsage> findList(RawUsage params); |
| | | |
| | | /** |
| | | * @param raw |
| | | * 修改 |
| | | */ |
| | | void updateRawPackageAndStorageRack(RawUsage raw); |
| | | |
| | | /** |
| | | * @param raw |
| | | * 入库 |
| | | */ |
| | | void inStorage(RawUsageAndShelfRack raw); |
| | | |
| | | |
| | | /** |
| | | * @param raw |
| | | * 出库 |
| | | */ |
| | | void outStorage(RawUsageAndShelfRack raw); |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.rawusage.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.rawusage.mapper.RawUsageMapper; |
| | | import com.mes.rawusage.entity.RawUsage; |
| | | import com.mes.rawusage.service.RawUsageService; |
| | | import com.mes.shelfrack.entity.ShelfRack; |
| | | import com.mes.shelfrack.entity.request.RawUsageAndShelfRack; |
| | | import com.mes.shelfrack.mapper.ShelfRackMapper; |
| | | import com.mes.storagetask.entity.StorageTask; |
| | | import com.mes.storagetask.mapper.StorageTaskMapper; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.lang.reflect.InvocationTargetException; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | import static cn.hutool.core.date.DateTime.now; |
| | | |
| | | /** |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | @Service |
| | | public class RawUsageServiceImpl extends ServiceImpl<RawUsageMapper, RawUsage> implements RawUsageService { |
| | | |
| | | @Autowired |
| | | private RawUsageMapper rawUsageMapper; |
| | | @Autowired |
| | | private ShelfRackMapper shelfRackMapper; |
| | | @Autowired |
| | | private StorageTaskMapper storageTaskMapper; |
| | | |
| | | @Override |
| | | public List<RawUsage> findList(RawUsage params){ |
| | | LambdaQueryWrapper<RawUsage> query = Wrappers.lambdaQuery(RawUsage.class); |
| | | return rawUsageMapper.selectList(query); |
| | | } |
| | | |
| | | @Override |
| | | public void updateRawPackageAndStorageRack(RawUsage raw) { |
| | | // Step 1: 查询raw_package_id |
| | | LambdaQueryWrapper<ShelfRack> queryWrapper = Wrappers.lambdaQuery(ShelfRack.class) |
| | | .eq(ShelfRack::getNumber, raw.getId()); |
| | | ShelfRack shelfRack = shelfRackMapper.selectOne(queryWrapper); |
| | | if (shelfRack == null) { |
| | | throw new RuntimeException("未找到与指定货架ID关联的原料包信息"); |
| | | } |
| | | |
| | | |
| | | // Step 2: 更新raw_package表 |
| | | RawUsage rawUsage=new RawUsage(); |
| | | |
| | | rawUsage.setState("空闲"); |
| | | rawUsage.setId(shelfRack.getRawPackageId()); |
| | | rawUsageMapper.updateById(rawUsage); |
| | | |
| | | // Step 3: 更新storage_rack表 |
| | | |
| | | ShelfRack rack = new ShelfRack(); |
| | | rack.setState("空闲"); |
| | | rack.setRawPackageId(null); // 设置RawPackageId为特定的空值,例如0 |
| | | LambdaQueryWrapper<ShelfRack> queryWrapper2 = Wrappers.lambdaQuery(ShelfRack.class) |
| | | .eq(ShelfRack::getNumber, raw.getId()); |
| | | shelfRackMapper.update(rack, queryWrapper2); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void inStorage(RawUsageAndShelfRack raw) { |
| | | RawUsage rawPackage = new RawUsage(); |
| | | BeanUtils.copyProperties(raw,rawPackage); |
| | | rawPackage.setRawType(raw.getRawThickness() + raw.getColor()); |
| | | rawPackage.setState("使用中"); |
| | | rawPackage.setLeftPieces(rawPackage.getPieces()); |
| | | rawUsageMapper.insert(rawPackage); |
| | | |
| | | // 更新架表 |
| | | ShelfRack rack = new ShelfRack(); |
| | | rack.setState("使用中"); |
| | | rack.setRawPackageId(rawPackage.getId()); // 设置RawPackageId为特定的空值,例如0 |
| | | LambdaQueryWrapper<ShelfRack> queryWrapper = Wrappers.lambdaQuery(ShelfRack.class) |
| | | .eq(ShelfRack::getNumber, raw.getNumber()); |
| | | shelfRackMapper.update(rack, queryWrapper); |
| | | StorageTask storageTask=new StorageTask(); |
| | | storageTask.setTaskState("等待中"); |
| | | storageTask.setTaskType("从仓位到吊装位"); |
| | | storageTask.setLoadRack(raw.getLoadRack()); |
| | | storageTask.setShelfRack(raw.getNumber()); |
| | | storageTask.setRouteGroup(1); |
| | | storageTask.setStartTime(now()); |
| | | storageTask.setFinishTime(now()); |
| | | insertTask(storageTask); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void outStorage(RawUsageAndShelfRack raw) { |
| | | ShelfRack rack = new ShelfRack(); |
| | | rack.setState("等待出库"); |
| | | rack.setRawPackageId(null); // 设置RawPackageId为特定的空值,例如0 |
| | | LambdaQueryWrapper<ShelfRack> queryWrapper = Wrappers.lambdaQuery(ShelfRack.class) |
| | | .eq(ShelfRack::getNumber, raw.getNumber()); |
| | | shelfRackMapper.update(rack, queryWrapper); |
| | | |
| | | |
| | | StorageTask storageTask=new StorageTask(); |
| | | storageTask.setTaskState("等待中"); |
| | | storageTask.setTaskType("从仓位到吊装位"); |
| | | storageTask.setLoadRack(raw.getLoadRack()); |
| | | storageTask.setShelfRack(raw.getNumber()); |
| | | storageTask.setRouteGroup(1); |
| | | storageTask.setStartTime(now()); |
| | | storageTask.setFinishTime(now()); |
| | | insertTask(storageTask); |
| | | } |
| | | |
| | | |
| | | public void insertTask(StorageTask storageTask) { |
| | | storageTaskMapper.insert(storageTask); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.shelfrack.controller; |
| | | |
| | | import com.mes.shelfrack.entity.request.RawUsageAndShelfRack; |
| | | import com.mes.utils.Result; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.mes.shelfrack.entity.ShelfRack; |
| | | import com.mes.shelfrack.service.ShelfRackService; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/api/shelfRack") |
| | | @Api(tags = " 控制器") |
| | | public class ShelfRackController { |
| | | |
| | | @Autowired |
| | | private ShelfRackService shelfRackService; |
| | | |
| | | /** |
| | | * 列表查询 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "列表查询",notes = "列表查询",produces = "application/json") |
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")}) |
| | | @PostMapping("/findList") |
| | | public Result findList(@RequestBody ShelfRack params) { |
| | | List<ShelfRack> result = shelfRackService.findList(params); |
| | | return Result.success(result); |
| | | } |
| | | |
| | | /** |
| | | * 查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "查询", notes = "查询详情") |
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")}) |
| | | @GetMapping("/{id}") |
| | | public Result findById(@PathVariable("id") Long id) { |
| | | ShelfRack shelfRack = shelfRackService.getBaseMapper().selectById(id); |
| | | return Result.success(shelfRack); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | * |
| | | * @param shelfRack |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "新增", notes = "新增数据") |
| | | @ApiResponses({@ApiResponse(code = 200, message = "操作成功")}) |
| | | @PostMapping |
| | | public Result insert( @RequestBody ShelfRack shelfRack) { |
| | | boolean result = shelfRackService.save(shelfRack); |
| | | return Result.success(result); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * |
| | | * @param shelfRack |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "修改", notes = "修改数据") |
| | | @ApiResponses({@ApiResponse(code = 200, message = "操作成功")}) |
| | | @PutMapping |
| | | public Result update( @RequestBody ShelfRack shelfRack) { |
| | | boolean result = shelfRackService.updateById(shelfRack); |
| | | return Result.success(result); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "删除", notes = "删除数据") |
| | | @DeleteMapping("/{id}") |
| | | public Result delete(@PathVariable("id") Long id) { |
| | | int result = shelfRackService.getBaseMapper().deleteById(id); |
| | | return Result.success(result); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "架子表格查询",notes = "架子表格查询",produces = "application/json") |
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")}) |
| | | @GetMapping("/findshelfrack") |
| | | public Result findshelfrack() { |
| | | List<RawUsageAndShelfRack> result = shelfRackService.selectshelf_rack(); |
| | | return Result.success(result); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.shelfrack.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | @Data |
| | | @Component |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("shelf_rack") |
| | | @ApiModel(value = "ShelfRack", description = " ") |
| | | public class ShelfRack implements Serializable{ |
| | | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 架子编号 |
| | | */ |
| | | @ApiModelProperty("架子编号") |
| | | private String number; |
| | | |
| | | /** |
| | | * 工作状态 |
| | | */ |
| | | @ApiModelProperty("工作状态") |
| | | private String state; |
| | | |
| | | /** |
| | | * 包号编号 |
| | | */ |
| | | @ApiModelProperty("包号编号") |
| | | private Integer rawPackageId; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty("修改时间") |
| | | private Date modTime; |
| | | |
| | | /** |
| | | * 启用状态 |
| | | */ |
| | | @ApiModelProperty("启用状态") |
| | | private String enableState; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.shelfrack.entity.request; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class RawUsageAndShelfRack { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty("ID") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("玻璃类型") |
| | | private String rawType; |
| | | |
| | | @ApiModelProperty("宽度") |
| | | private Float rawWidth; |
| | | |
| | | @ApiModelProperty("高度") |
| | | private Float rawHeight; |
| | | |
| | | @ApiModelProperty("厚度") |
| | | private Float rawThickness; |
| | | |
| | | @ApiModelProperty("颜色") |
| | | private String color; |
| | | |
| | | @ApiModelProperty("总数量") |
| | | private Integer pieces; |
| | | |
| | | @ApiModelProperty("剩余数量") |
| | | private Integer leftPieces; |
| | | |
| | | @ApiModelProperty("物料编码") |
| | | private String qrcode; |
| | | |
| | | @ApiModelProperty("创建时间") |
| | | |
| | | private Date createTime; |
| | | |
| | | |
| | | |
| | | private Date productionTime; |
| | | |
| | | @ApiModelProperty("批次号") |
| | | private String batchId; |
| | | |
| | | @ApiModelProperty("架子编号") |
| | | private String number; |
| | | |
| | | @ApiModelProperty("工作状态") |
| | | private String state; |
| | | |
| | | @ApiModelProperty("包号编号") |
| | | private Integer rawPackageId; |
| | | |
| | | |
| | | private Date modTime; |
| | | |
| | | @ApiModelProperty("启用状态") |
| | | private String enableState; |
| | | |
| | | @ApiModelProperty("上片位编号") |
| | | private String loadRack; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.shelfrack.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.shelfrack.entity.ShelfRack; |
| | | import com.mes.shelfrack.entity.request.RawUsageAndShelfRack; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | * |
| | | */ |
| | | |
| | | public interface ShelfRackMapper extends MPJBaseMapper<ShelfRack> { |
| | | |
| | | |
| | | List<RawUsageAndShelfRack> selectshelf_rack(); |
| | | } |
New file |
| | |
| | | package com.mes.shelfrack.service; |
| | | |
| | | import com.mes.shelfrack.entity.ShelfRack; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.shelfrack.entity.request.RawUsageAndShelfRack; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | public interface ShelfRackService extends IService<ShelfRack> { |
| | | |
| | | List<ShelfRack> findList(ShelfRack params); |
| | | |
| | | List<RawUsageAndShelfRack> selectshelf_rack(); |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.shelfrack.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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.rawusage.entity.RawUsage; |
| | | import com.mes.shelfrack.entity.request.RawUsageAndShelfRack; |
| | | import com.mes.shelfrack.mapper.ShelfRackMapper; |
| | | import com.mes.shelfrack.entity.ShelfRack; |
| | | import com.mes.shelfrack.service.ShelfRackService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | @Service |
| | | public class ShelfRackServiceImpl extends ServiceImpl<ShelfRackMapper, ShelfRack> implements ShelfRackService { |
| | | |
| | | @Autowired |
| | | private ShelfRackMapper shelfRackMapper; |
| | | |
| | | @Override |
| | | public List<ShelfRack> findList(ShelfRack params){ |
| | | LambdaQueryWrapper<ShelfRack> query = Wrappers.lambdaQuery(ShelfRack.class); |
| | | return shelfRackMapper.selectList(query); |
| | | } |
| | | |
| | | // |
| | | // public void yourMethodName() { |
| | | // List<Map<String, Object>> resultList = shelfRackMapper.selectMaps( |
| | | // new LambdaQueryWrapper<ShelfRack>() |
| | | // .select(ShelfRack::getNumber, RawUsage::getRawType, RawUsage::getRawWidth, |
| | | // RawUsage::getRawHeight, RawUsage::getRawThickness, ShelfRack::getModTime, |
| | | // ShelfRack::getEnableState, RawUsage::getPieces, RawUsage::getLeftPieces, |
| | | // "(datediff(now(), raw_usage.create_time)) as rukuTime", |
| | | // "(concat(if(ROUND(raw_usage.left_pieces / #{param1} * 100, 0) < 20, 20, ROUND(raw_usage.left_pieces / #{param1} * 100, 0)), '%')) as bfb") |
| | | // .leftJoin(RawUsage.class, RawUsage::getId, ShelfRack::getRawPackageId) |
| | | // .orderByAsc(ShelfRack::getNumber) |
| | | // ); |
| | | // |
| | | // // Process resultList as needed |
| | | // } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<RawUsageAndShelfRack> selectshelf_rack() { |
| | | return baseMapper.selectshelf_rack(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.storagetask.controller; |
| | | |
| | | import com.mes.shelfrack.entity.request.RawUsageAndShelfRack; |
| | | import com.mes.storagetask.entity.request.StorageTaskRequest; |
| | | import com.mes.utils.Result; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.mes.storagetask.entity.StorageTask; |
| | | import com.mes.storagetask.service.StorageTaskService; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/api/storageTask") |
| | | @Api(tags = " 控制器") |
| | | public class StorageTaskController { |
| | | |
| | | @Autowired |
| | | private StorageTaskService storageTaskService; |
| | | |
| | | /** |
| | | * 列表查询 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "列表查询",notes = "列表查询",produces = "application/json") |
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")}) |
| | | @PostMapping("/findList") |
| | | public Result findList(@RequestBody StorageTask params) { |
| | | List<StorageTask> result = storageTaskService.findList(params); |
| | | return Result.success(result); |
| | | } |
| | | |
| | | /** |
| | | * 查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "查询", notes = "查询详情") |
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")}) |
| | | @GetMapping("/{id}") |
| | | public Result findById(@PathVariable("id") Long id) { |
| | | StorageTask storageTask = storageTaskService.getBaseMapper().selectById(id); |
| | | return Result.success(storageTask); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | * |
| | | * @param storageTask |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "新增", notes = "新增数据") |
| | | @ApiResponses({@ApiResponse(code = 200, message = "操作成功")}) |
| | | @PostMapping |
| | | public Result insert( @RequestBody StorageTask storageTask) { |
| | | boolean result = storageTaskService.save(storageTask); |
| | | return Result.success(result); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * |
| | | * @param storageTask |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "修改", notes = "修改数据") |
| | | @ApiResponses({@ApiResponse(code = 200, message = "操作成功")}) |
| | | @PutMapping |
| | | public Result update( @RequestBody StorageTask storageTask) { |
| | | boolean result = storageTaskService.updateById(storageTask); |
| | | return Result.success(result); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "删除", notes = "删除数据") |
| | | @DeleteMapping("/{id}") |
| | | public Result delete(@PathVariable("id") Long id) { |
| | | int result = storageTaskService.getBaseMapper().deleteById(id); |
| | | return Result.success(result); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "任务查询",notes = "任务查询",produces = "application/json") |
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")}) |
| | | @GetMapping("/findTasks") |
| | | public Result findLatestTasks() { |
| | | List<StorageTaskRequest> result = storageTaskService.Tasks(); |
| | | return Result.success(result); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "任务操作", notes = "任务操作") |
| | | @PostMapping("/taskUpdate") |
| | | public Result taskUpdate(@RequestBody Map<String, Object> storageTaskMap) { |
| | | |
| | | StorageTask task = new StorageTask(); |
| | | task.setType((String) storageTaskMap.get("Type")); // 假设Type是存储在Map中的一个键 |
| | | task.setId((int) storageTaskMap.get("id")); |
| | | storageTaskService.taskUpdate(task); |
| | | return Result.success(); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.storagetask.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.apache.xmlbeans.impl.xb.xsdschema.Public; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | @Data |
| | | @Component |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("storage_task") |
| | | @ApiModel(value = "StorageTask", description = " ") |
| | | public class StorageTask implements Serializable{ |
| | | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 任务类型 |
| | | */ |
| | | @ApiModelProperty("任务类型") |
| | | private String taskType; |
| | | |
| | | /** |
| | | * 工作状态 |
| | | */ |
| | | @ApiModelProperty("工作状态") |
| | | private String taskState; |
| | | |
| | | /** |
| | | * 仓储架号 |
| | | */ |
| | | @ApiModelProperty("仓储架号") |
| | | private String shelfRack; |
| | | |
| | | /** |
| | | * 上片位编号 |
| | | */ |
| | | @ApiModelProperty("上片位编号") |
| | | private String loadRack; |
| | | |
| | | /** |
| | | * 线路 |
| | | */ |
| | | @ApiModelProperty("线路") |
| | | private Integer routeGroup; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty("创建时间") |
| | | private Date startTime; |
| | | |
| | | /** |
| | | * 完成时间 |
| | | */ |
| | | @ApiModelProperty("完成时间") |
| | | private Date finishTime; |
| | | |
| | | @ApiModelProperty("前端任务类型") |
| | | private String Type; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.storagetask.entity.request; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class StorageTaskRequest { |
| | | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 任务类型 |
| | | */ |
| | | @ApiModelProperty("任务类型") |
| | | private String taskType; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty("前端任务类型") |
| | | private String Type; |
| | | |
| | | /** |
| | | * 工作状态 |
| | | */ |
| | | @ApiModelProperty("工作状态") |
| | | private String taskState; |
| | | |
| | | /** |
| | | * 仓储架号 |
| | | */ |
| | | @ApiModelProperty("仓储架号") |
| | | private String shelfRack; |
| | | |
| | | /** |
| | | * 上片位编号 |
| | | */ |
| | | @ApiModelProperty("上片位编号") |
| | | private String loadRack; |
| | | |
| | | /** |
| | | * 线路 |
| | | */ |
| | | @ApiModelProperty("线路") |
| | | private Integer routeGroup; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty("创建时间") |
| | | private Date startTime; |
| | | |
| | | /** |
| | | * 完成时间 |
| | | */ |
| | | @ApiModelProperty("完成时间") |
| | | private Date finishTime; |
| | | |
| | | @ApiModelProperty("颜色") |
| | | private String color; |
| | | |
| | | @ApiModelProperty("厚度") |
| | | private Float rawThickness; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.storagetask.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.storagetask.entity.StorageTask; |
| | | import com.mes.storagetask.entity.request.StorageTaskRequest; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | * |
| | | */ |
| | | @Repository |
| | | public interface StorageTaskMapper extends BaseMapper<StorageTask> { |
| | | |
| | | |
| | | List<StorageTaskRequest> selectTasks(); |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.storagetask.service; |
| | | |
| | | import com.mes.storagetask.entity.StorageTask; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.storagetask.entity.request.StorageTaskRequest; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | public interface StorageTaskService extends IService<StorageTask> { |
| | | |
| | | List<StorageTask> findList(StorageTask params); |
| | | |
| | | Map<String, Optional<StorageTask>> findLatestTasks(); |
| | | |
| | | List<StorageTaskRequest> Tasks(); |
| | | |
| | | void taskUpdate(StorageTask storageTask); |
| | | } |
New file |
| | |
| | | package com.mes.storagetask.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.loadposition.entity.LoadPosition; |
| | | import com.mes.loadposition.mapper.LoadPositionMapper; |
| | | import com.mes.rawusage.entity.RawUsage; |
| | | import com.mes.rawusage.mapper.RawUsageMapper; |
| | | import com.mes.shelfrack.entity.ShelfRack; |
| | | import com.mes.shelfrack.entity.request.RawUsageAndShelfRack; |
| | | import com.mes.shelfrack.mapper.ShelfRackMapper; |
| | | import com.mes.storagetask.entity.request.StorageTaskRequest; |
| | | import com.mes.storagetask.mapper.StorageTaskMapper; |
| | | import com.mes.storagetask.entity.StorageTask; |
| | | import com.mes.storagetask.service.StorageTaskService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | | * @author system |
| | | * @since 2024-07-09 14:51:27 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class StorageTaskServiceImpl extends ServiceImpl<StorageTaskMapper, StorageTask> implements StorageTaskService { |
| | | |
| | | @Autowired |
| | | private StorageTaskMapper storageTaskMapper; |
| | | @Autowired |
| | | private LoadPositionMapper loadPositionMapper; |
| | | @Autowired |
| | | private ShelfRackMapper shelfRackMapper; |
| | | @Autowired |
| | | private RawUsageMapper rawUsageMapper; |
| | | |
| | | |
| | | @Override |
| | | public List<StorageTask> findList(StorageTask params){ |
| | | LambdaQueryWrapper<StorageTask> query = Wrappers.lambdaQuery(StorageTask.class); |
| | | return storageTaskMapper.selectList(query); |
| | | } |
| | | |
| | | |
| | | public Map<String, Optional<StorageTask>> findLatestTasks() { |
| | | Map<String, Optional<StorageTask>> latestTasks = new HashMap<>(); |
| | | |
| | | // 查询最新的已完成任务 |
| | | LambdaQueryWrapper<StorageTask> completedWrapper = new LambdaQueryWrapper<>(); |
| | | completedWrapper.eq(StorageTask::getTaskType, "已完成") |
| | | .orderByDesc(StorageTask::getId) |
| | | .last("LIMIT 1"); |
| | | Optional<StorageTask> latestCompletedTask = Optional.ofNullable(storageTaskMapper.selectOne(completedWrapper)); |
| | | latestTasks.put("已完成", latestCompletedTask); |
| | | |
| | | // 查询最新的等待中任务 |
| | | LambdaQueryWrapper<StorageTask> pendingWrapper = new LambdaQueryWrapper<>(); |
| | | pendingWrapper.eq(StorageTask::getTaskType, "等待中") |
| | | .orderByDesc(StorageTask::getId); |
| | | Optional<StorageTask> latestPendingTask = Optional.ofNullable(storageTaskMapper.selectOne(pendingWrapper)); |
| | | latestTasks.put("等待中", latestPendingTask); |
| | | log.info(latestTasks+""); |
| | | return latestTasks; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<StorageTaskRequest> Tasks() { |
| | | return baseMapper.selectTasks(); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void taskUpdate(StorageTask request) { |
| | | Integer taskId = request.getId(); |
| | | String taskType = request.getTaskType(); |
| | | String Type = request.getType(); |
| | | String taskState = request.getTaskState(); |
| | | String shelfRack = request.getShelfRack(); |
| | | String loadRack = request.getLoadRack(); |
| | | |
| | | if ("重新开始".equals(Type)) { |
| | | StorageTask storageTask = new StorageTask(); |
| | | storageTask.setTaskState("等待中"); |
| | | LambdaQueryWrapper<StorageTask> queryWrapper = Wrappers.lambdaQuery(StorageTask.class) |
| | | .eq(StorageTask::getId, request.getId()); |
| | | storageTaskMapper.update(request,queryWrapper); |
| | | } else if ("完成".equals(Type)) { |
| | | StorageTask existingTask = storageTaskMapper.selectById(taskId); |
| | | if (existingTask != null && "正在工作".equals(existingTask.getTaskState())) { |
| | | if ("从仓位到上片位".equals(taskType) || "从仓位到吊装位".equals(taskType)) { |
| | | LoadPosition loadPosition = new LoadPosition(); |
| | | loadPosition.setState("正在使用"); |
| | | loadPosition.setStorageTaskId(request.getId()); |
| | | LambdaQueryWrapper<LoadPosition> queryWrapper = Wrappers.lambdaQuery(LoadPosition.class) |
| | | .eq(LoadPosition::getNumber, request.getLoadRack()); |
| | | loadPositionMapper.update(loadPosition, queryWrapper); |
| | | StorageTask storageTask = new StorageTask(); |
| | | storageTask.setTaskState("正在使用"); |
| | | LambdaQueryWrapper<StorageTask> StorageTaskqueryWrapper = Wrappers.lambdaQuery(StorageTask.class) |
| | | .eq(StorageTask::getId, request.getId()); |
| | | storageTaskMapper.update(request,StorageTaskqueryWrapper); |
| | | } else if ("从上片位到仓位".equals(taskType)) { |
| | | LoadPosition loadPosition = new LoadPosition(); |
| | | loadPosition.setState("使用中"); |
| | | loadPosition.setStorageTaskId(null); |
| | | LambdaQueryWrapper<LoadPosition> queryWrapper = Wrappers.lambdaQuery(LoadPosition.class) |
| | | .eq(LoadPosition::getNumber, request.getLoadRack()); |
| | | loadPositionMapper.update(loadPosition, queryWrapper); |
| | | ShelfRack loshelfRack = new ShelfRack(); |
| | | LambdaQueryWrapper<RawUsage> RawUsagequeryWrapper = Wrappers.lambdaQuery(RawUsage.class) |
| | | .eq(RawUsage::getId,loshelfRack.getRawPackageId()); |
| | | RawUsage RawUsage = rawUsageMapper.selectOne(RawUsagequeryWrapper); |
| | | if(RawUsage.getLeftPieces()==0){ |
| | | loshelfRack.setState("空闲"); |
| | | }else { |
| | | loshelfRack.setState("使用中"); |
| | | } |
| | | LambdaQueryWrapper<ShelfRack> loshelfRackqueryWrapper = Wrappers.lambdaQuery(ShelfRack.class) |
| | | .eq(ShelfRack::getNumber, request.getLoadRack()); |
| | | shelfRackMapper.update(loshelfRack, loshelfRackqueryWrapper); |
| | | } else if ("从吊装位到仓位".equals(taskType)) { |
| | | LoadPosition loadPosition = new LoadPosition(); |
| | | loadPosition.setState("空闲"); |
| | | loadPosition.setStorageTaskId(null); |
| | | LambdaQueryWrapper<LoadPosition> queryWrapper = Wrappers.lambdaQuery(LoadPosition.class) |
| | | .eq(LoadPosition::getNumber, request.getLoadRack()); |
| | | loadPositionMapper.update(loadPosition, queryWrapper); |
| | | ShelfRack loshelfRack = new ShelfRack(); |
| | | LambdaQueryWrapper<RawUsage> RawUsagequeryWrapper = Wrappers.lambdaQuery(RawUsage.class) |
| | | .eq(RawUsage::getId,loshelfRack.getRawPackageId()); |
| | | RawUsage RawUsage = rawUsageMapper.selectOne(RawUsagequeryWrapper); |
| | | if(RawUsage.getLeftPieces()==1){ |
| | | loshelfRack.setEnableState("启用"); |
| | | }else { |
| | | loshelfRack.setEnableState(loshelfRack.getEnableState()); |
| | | } |
| | | loadPosition.setState("使用中"); |
| | | LambdaQueryWrapper<ShelfRack> loshelfRackqueryWrapper = Wrappers.lambdaQuery(ShelfRack.class) |
| | | .eq(ShelfRack::getNumber, request.getLoadRack()); |
| | | shelfRackMapper.update(loshelfRack, loshelfRackqueryWrapper); |
| | | } |
| | | StorageTask storageTask = new StorageTask(); |
| | | storageTask.setTaskState("已完成"); |
| | | LambdaQueryWrapper<StorageTask> StorageTaskqueryWrapper = Wrappers.lambdaQuery(StorageTask.class) |
| | | .eq(StorageTask::getId, request.getId()); |
| | | storageTaskMapper.update(storageTask, StorageTaskqueryWrapper); |
| | | } |
| | | } else if ("删除".equals(Type)) { |
| | | |
| | | LambdaQueryWrapper<StorageTask> StorageTaskqueryWrapper = Wrappers.lambdaQuery(StorageTask.class) |
| | | .eq(StorageTask::getId, request.getId()); |
| | | storageTaskMapper.delete(StorageTaskqueryWrapper); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://127.0.0.1:3306/yiwumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 10.153.19.150:8848 |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: 123456 |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://127.0.0.1:3306/yiwumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://10.153.19.150:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | pp: |
| | | url: jdbc:mysql://10.153.19.150:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 10.153.19.150:8848 |
| | | redis: |
| | | database: 0 |
| | | host: 10.153.19.150 |
| | | port: 6379 |
| | | password: 123456 |
New file |
| | |
| | | server: |
| | | port: 8086 |
| | | |
| | | spring: |
| | | profiles: |
| | | active: dev |
| | | application: |
| | | name: glassStorage |
| | | liquibase: |
| | | enabled: false |
| | | |
| | | |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.mes.shelfrack.mapper.ShelfRackMapper"> |
| | | |
| | | <resultMap id="ShelfRackResultMap" type="com.mes.shelfrack.entity.request.RawUsageAndShelfRack"> |
| | | <result property="number" column="number"/> |
| | | <result property="rawType" column="raw_type"/> |
| | | <result property="rawWidth" column="raw_width"/> |
| | | <result property="rawHeight" column="raw_height"/> |
| | | <result property="rawThickness" column="raw_thickness"/> |
| | | <result property="enableState" column="enable_state"/> |
| | | <result property="pieces" column="pieces"/> |
| | | <result property="createTime" column="createTime" /> |
| | | <result property="batchId" column="batch_id"/> |
| | | </resultMap> |
| | | <select id="selectshelf_rack" resultMap="ShelfRackResultMap"> |
| | | <![CDATA[ |
| | | SELECT a.number, b.raw_type, b.raw_width, b.raw_height, b.raw_thickness, a.enable_state, b.pieces, |
| | | b.batch_id,DATE_FORMAT(b.create_time, '%Y-%m-%d %H:%i:%s') as createTime |
| | | FROM shelf_rack AS a |
| | | LEFT JOIN raw_usage AS b ON a.raw_package_id = b.id |
| | | ]]> |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.mes.storagetask.mapper.StorageTaskMapper"> |
| | | |
| | | |
| | | <resultMap id="StorageTaskRequest" type="com.mes.storagetask.entity.request.StorageTaskRequest"> |
| | | <result property="loadRack" column="load_rack"/> |
| | | <result property="color" column="color"/> |
| | | <result property="taskState" column="task_state"/> |
| | | <result property="shelfRack" column="shelf_rack"/> |
| | | <result property="startTime" column="start_time"/> |
| | | <result property="rawThickness" column="raw_thickness"/> |
| | | <result property="routeGroup" column="route_group"/> |
| | | <result property="id" column="id" /> |
| | | <result property="taskType" column="task_type"/> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | <select id="selectTasks" resultMap="StorageTaskRequest"> |
| | | <![CDATA[ |
| | | SELECT d.*, g.raw_thickness, g.color |
| | | FROM ( |
| | | (SELECT * FROM storage_task AS a WHERE a.task_state = '已完成' ORDER BY a.id DESC LIMIT 1) |
| | | UNION ALL |
| | | (SELECT * FROM storage_task AS c WHERE c.task_state = '正在工作') |
| | | UNION ALL |
| | | (SELECT * FROM storage_task AS b WHERE b.task_state = '等待中') |
| | | ) AS d |
| | | LEFT JOIN shelf_rack AS f ON f.id = d.shelf_rack |
| | | LEFT JOIN raw_usage AS g ON g.id = f.raw_package_id |
| | | ]]> |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package mes; |
| | | |
| | | import com.mes.GlassStorageApplication; |
| | | import com.mes.rawusage.entity.RawUsage; |
| | | import com.mes.rawusage.service.RawUsageService; |
| | | import com.mes.shelfrack.entity.ShelfRack; |
| | | import com.mes.shelfrack.service.ShelfRackService; |
| | | import com.mes.storagetask.entity.StorageTask; |
| | | import com.mes.storagetask.service.StorageTaskService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/3/27 16:37 |
| | | * @Description: |
| | | */ |
| | | @Slf4j |
| | | @RunWith(SpringRunner.class) |
| | | @SpringBootTest(classes = GlassStorageApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) |
| | | |
| | | public class GlassStorageModuleApplicationTest { |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private StorageTaskService storageTaskService; |
| | | @Autowired |
| | | private ShelfRackService shelfRackService; |
| | | @Autowired |
| | | private RawUsageService rawUsageService; |
| | | |
| | | |
| | | @Test |
| | | public void testFindPath() { |
| | | log.info("完整路径:{}", Arrays.asList("123")); |
| | | } |
| | | |
| | | @Test |
| | | public void testCacheGlass() { |
| | | // storageTaskService.getBaseMapper().selectById(1); |
| | | //StorageTask storageTask=new StorageTask(); |
| | | // storageTask.setId(Long.valueOf("1")); |
| | | // storageTask.setTaskState("1"); |
| | | // storageTaskService.updateById(storageTask); |
| | | // storageTaskService.getBaseMapper().deleteById(1); |
| | | // storageTaskService.findList(storageTask); |
| | | ///storageTaskService.findLatestTasks(); |
| | | storageTaskService.Tasks(); |
| | | } |
| | | @Test |
| | | public void selectshelf_rack() { |
| | | |
| | | shelfRackService.selectshelf_rack(); |
| | | } |
| | | |
| | | |
| | | |
| | | @Test |
| | | public void updateRawPackageAndStorageRack() { |
| | | RawUsage raw=new RawUsage(); |
| | | |
| | | raw.setId(null); |
| | | rawUsageService.updateRawPackageAndStorageRack(raw); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |