Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
# Conflicts:
# UI-Project/src/views/GlassStorage/MaterialRackManagement.vue
| | |
| | | layoutnumber:'钢化版图号', |
| | | numberglasses:'玻璃数量', |
| | | specifytemperinga:'是否指定钢化该条信息?', |
| | | temperedswitch:'钢化开关', |
| | | dutyinformation:'值班信息', |
| | | line:'线路', |
| | | process:'工序', |
| | | team:'班组', |
| | | basic:'设备', |
| | | add:'确认保存', |
| | | }, |
| | | workOrder:{ |
| | | glassID:'玻璃ID', |
| | |
| | | }, |
| | | reportmanage:{ |
| | | productiontime :'生产时间', |
| | | starttime :'开始时间', |
| | | endtime :'结束时间', |
| | | ctype :'清选择类型', |
| | | cstate :'清选择状态', |
| | | cprocess :'清选择工序', |
| | | all :'全部', |
| | | completed :'完工', |
| | | broke :'破损', |
| | |
| | | number :'序号', |
| | | layer :'层', |
| | | typebreakage :'破损类型', |
| | | ptypebreakage :' 请选择破损类型', |
| | | causebreakage :'破损原因', |
| | | pcausebreakage :'请选择破损原因', |
| | | responsibleprocess :'责任工序', |
| | | responsiblepersonnel :'责任人员', |
| | | presponsiblepersonnel :'请输入责任人员', |
| | | responsibleteam :'责任班组', |
| | | presponsibleteam :'请选择责任班组', |
| | | responsibleequipment :'责任设备', |
| | | presponsibleequipment :'请选择责任设备', |
| | | remark :'备注', |
| | | premark :'请输入备注', |
| | | }, |
| | | } |
| | |
| | | <img src="../assets/northGlass.ico" |
| | | alt="" |
| | | style="max-width: 100%;max-height: 100%"> |
| | | <h3 style="margin: 1rem ;font-weight: bold;width: 33vw;"> {{ $t('main.titleFirst') }}{{ user }}{{ $t('main.titleLast') }}</h3> |
| | | <h3 style="margin: 1rem ;font-weight: bold;width: 33vw;"> {{ $t('main.titleFirst') }}{{ userName }}{{ $t('main.titleLast') }}</h3> |
| | | <!-- <div class="header-left"> |
| | | <el-button :icon="isCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold'" @click="toggleCollapse" |
| | | style="height:30px;"></el-button> |
| | |
| | | // WebSocketService.js
|
| | |
|
| | | let socket = null;
|
| | | let messages='' ;
|
| | | export const initializeWebSocket = (socketUrl, messageHandler) => {
|
| | | let messages='' ;
|
| | | if (typeof WebSocket === "undefined") {
|
| | | console.log("Your browser does not support WebSocket");
|
| | | return null;
|
| | |
| | | }); |
| | | } |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | |
| | | // adjustedRects.value = data.currentCutTerritory[0] |
| | | adjustedRects.value = data.currentCutTerritory[0].map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | |
| | | if(data.intoGlass!=null){ |
| | | adjustedRects1.value = data.intoGlass[0].map(rect => { |
| | | console.log( adjustedRects1.value); |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta; |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;; |
| | | let newX = rect.yCoordinate; |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = rect.height * 0.12; |
| | | adjustedHeight = rect.width * 0.1; |
| | | adjustedWidtha = rect.height; |
| | | adjustedHeighta = rect.width; |
| | | newX = 5087 - (rect.xCoordinate + rect.height); |
| | | if (rect.width < rect.height) { |
| | | widtha = rect.height; |
| | | heighta = rect.width; |
| | | } else { |
| | | adjustedWidth = rect.width * 0.12; |
| | | adjustedHeight = rect.height * 0.1; |
| | | adjustedWidtha = rect.width; |
| | | adjustedHeighta = rect.height; |
| | | newX = 5087 - (rect.xCoordinate + rect.width); |
| | | widtha = rect.width; |
| | | heighta = rect.height; |
| | | } |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = widtha * 0.12; |
| | | adjustedHeight = heighta * 0.1; |
| | | adjustedWidtha = widtha; |
| | | adjustedHeighta = heighta; |
| | | newX = 5087 - (rect.yCoordinate + widtha); |
| | | } else { |
| | | adjustedWidth = heighta * 0.12; |
| | | adjustedHeight = widtha * 0.1; |
| | | adjustedWidtha = heighta; |
| | | adjustedHeighta = widtha; |
| | | newX = 5087 - (rect.yCoordinate + heighta); |
| | | } |
| | | // if (rect.angle === 0) { |
| | | // adjustedWidth = heighta * 0.12; |
| | | // adjustedHeight = widtha * 0.1; |
| | | // adjustedWidtha = heighta; |
| | | // adjustedHeighta = widtha; |
| | | // newX = 5087 - (rect.xCoordinate + heighta); |
| | | // } else { |
| | | // adjustedWidth = widtha * 0.12; |
| | | // adjustedHeight = heighta * 0.1; |
| | | // adjustedWidtha = widtha; |
| | | // adjustedHeighta = heighta; |
| | | // newX = 5087 - (rect.xCoordinate + widtha); |
| | | // } |
| | | return { |
| | | ...rect, |
| | | xcoordinate: newX * 0.12, |
| | | ycoordinate: rect.yCoordinate * 0.1, |
| | | ycoordinate: rect.xCoordinate * 0.1, |
| | | width: adjustedWidth, |
| | | height: adjustedHeight, |
| | | widtha: adjustedWidtha, |
| | |
| | | if(data.intoGlass2!=null){ |
| | | adjustedRects2.value = data.intoGlass2[0].map(rect => { |
| | | console.log( adjustedRects2.value); |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta; |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;; |
| | | let newX = rect.yCoordinate; |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = rect.height * 0.12; |
| | | adjustedHeight = rect.width * 0.1; |
| | | adjustedWidtha = rect.height; |
| | | adjustedHeighta = rect.width; |
| | | newX = 5087 - (rect.xCoordinate + rect.height); |
| | | if (rect.width < rect.height) { |
| | | widtha = rect.height; |
| | | heighta = rect.width; |
| | | } else { |
| | | adjustedWidth = rect.width * 0.12; |
| | | adjustedHeight = rect.height * 0.1; |
| | | adjustedWidtha = rect.width; |
| | | adjustedHeighta = rect.height; |
| | | newX = 5087 - (rect.xCoordinate + rect.width); |
| | | widtha = rect.width; |
| | | heighta = rect.height; |
| | | } |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = widtha * 0.12; |
| | | adjustedHeight = heighta * 0.1; |
| | | adjustedWidtha = widtha; |
| | | adjustedHeighta = heighta; |
| | | newX = 5087 - (rect.yCoordinate + widtha); |
| | | } else { |
| | | adjustedWidth = heighta * 0.12; |
| | | adjustedHeight = widtha * 0.1; |
| | | adjustedWidtha = heighta; |
| | | adjustedHeighta = widtha; |
| | | newX = 5087 - (rect.yCoordinate + heighta); |
| | | } |
| | | // if (rect.angle === 0) { |
| | | // adjustedWidth = heighta * 0.12; |
| | | // adjustedHeight = widtha * 0.1; |
| | | // adjustedWidtha = heighta; |
| | | // adjustedHeighta = widtha; |
| | | // newX = 5087 - (rect.xCoordinate + heighta); |
| | | // } else { |
| | | // adjustedWidth = widtha * 0.12; |
| | | // adjustedHeight = heighta * 0.1; |
| | | // adjustedWidtha = widtha; |
| | | // adjustedHeighta = heighta; |
| | | // newX = 5087 - (rect.xCoordinate + widtha); |
| | | // } |
| | | return { |
| | | ...rect, |
| | | xcoordinate: newX * 0.12, |
| | | ycoordinate: rect.yCoordinate * 0.1, |
| | | ycoordinate: rect.xCoordinate * 0.1, |
| | | width: adjustedWidth, |
| | | height: adjustedHeight, |
| | | widtha: adjustedWidtha, |
| | |
| | | // 进炉前 |
| | | if(data.waitingGlass!=null){ |
| | | adjustedRectsa.value = data.waitingGlass[0].map(rect => { |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta; |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;; |
| | | let newX = rect.yCoordinate; |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = rect.width * 0.24; |
| | | adjustedHeight = rect.height * 0.16; |
| | | adjustedWidtha = rect.width; |
| | | adjustedHeighta = rect.height; |
| | | newX = 5190 - (rect.yCoordinate + rect.width); |
| | | if (rect.width < rect.height) { |
| | | widtha = rect.height; |
| | | heighta = rect.width; |
| | | } else { |
| | | adjustedWidth = rect.height * 0.24; |
| | | adjustedHeight = rect.width * 0.16; |
| | | adjustedWidtha = rect.height; |
| | | adjustedHeighta = rect.width; |
| | | newX = 5190 - (rect.yCoordinate + rect.height); |
| | | widtha = rect.width; |
| | | heighta = rect.height; |
| | | } |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = widtha * 0.24; |
| | | adjustedHeight = heighta * 0.16; |
| | | adjustedWidtha = widtha; |
| | | adjustedHeighta = heighta; |
| | | newX = 5190 - (rect.yCoordinate + widtha); |
| | | } else { |
| | | adjustedWidth = heighta * 0.24; |
| | | adjustedHeight = widtha * 0.16; |
| | | adjustedWidtha = heighta; |
| | | adjustedHeighta = widtha; |
| | | newX = 5190 - (rect.yCoordinate + heighta); |
| | | } |
| | | return { |
| | | ...rect, |
| | |
| | | // 已出炉 |
| | | if(data.outGlass!=null){ |
| | | adjustedRectsb.value = data.outGlass[0].map(rect => { |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta; |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;; |
| | | let newX = rect.yCoordinate; |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = rect.width * 0.24; |
| | | adjustedHeight = rect.height * 0.16; |
| | | adjustedWidtha = rect.width; |
| | | adjustedHeighta = rect.height; |
| | | newX = 5190 - (rect.yCoordinate + rect.width); |
| | | if (rect.width < rect.height) { |
| | | widtha = rect.height; |
| | | heighta = rect.width; |
| | | } else { |
| | | adjustedWidth = rect.height * 0.24; |
| | | adjustedHeight = rect.width * 0.16; |
| | | adjustedWidtha = rect.height; |
| | | adjustedHeighta = rect.width; |
| | | newX = 5190 - (rect.yCoordinate + rect.height); |
| | | widtha = rect.width; |
| | | heighta = rect.height; |
| | | } |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = widtha * 0.24; |
| | | adjustedHeight = heighta * 0.16; |
| | | adjustedWidtha = widtha; |
| | | adjustedHeighta = heighta; |
| | | // newX = 5190 - (rect.yCoordinate + widtha); |
| | | } else { |
| | | adjustedWidth = heighta * 0.24; |
| | | adjustedHeight = widtha * 0.16; |
| | | adjustedWidtha = heighta; |
| | | adjustedHeighta = widtha; |
| | | // newX = 5190 - (rect.yCoordinate + heighta); |
| | | } |
| | | return { |
| | | ...rect, // 复制原始对象的其他属性 |
| | |
| | | // 更新 tableData 的数据 |
| | | if(data.overGlass!=null){ |
| | | adjustedRects.value = data.overGlass[0].map(rect => { |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta; |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta; |
| | | let newX = rect.yCoordinate; |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = rect.width * 0.24; |
| | | adjustedHeight = rect.height * 0.16; |
| | | adjustedWidtha = rect.width; |
| | | adjustedHeighta = rect.height; |
| | | newX = 5190 - (rect.yCoordinate + rect.width); |
| | | if (rect.width < rect.height) { |
| | | widtha = rect.height; |
| | | heighta = rect.width; |
| | | } else { |
| | | adjustedWidth = rect.height * 0.24; |
| | | adjustedHeight = rect.width * 0.16; |
| | | adjustedWidtha = rect.height; |
| | | adjustedHeighta = rect.width; |
| | | newX = 5190 - (rect.yCoordinate + rect.height); |
| | | widtha = rect.width; |
| | | heighta = rect.height; |
| | | } |
| | | if (rect.angle === 0) { |
| | | adjustedWidth = widtha * 0.24; |
| | | adjustedHeight = heighta * 0.16; |
| | | adjustedWidtha = widtha; |
| | | adjustedHeighta = heighta; |
| | | // newX = 5190 - (rect.yCoordinate + rect.width); |
| | | } else { |
| | | adjustedWidth = heighta * 0.24; |
| | | adjustedHeight = widtha * 0.16; |
| | | adjustedWidtha = heighta; |
| | | adjustedHeighta = widtha; |
| | | // newX = 5190 - (rect.yCoordinate + rect.height); |
| | | } |
| | | return { |
| | | ...rect, |
| | |
| | | <template> |
| | | <div style="height: 600px;"> |
| | | <div style="display: flex; flex-direction: row; align-items: center; margin-top: 20px;"> |
| | | <span style="margin-left: 10px;" class="demonstration">生产时间</span> |
| | | <span style="margin-left: 10px;" class="demonstration">{{ $t('reportmanage.productiontime') }}</span> |
| | | <el-date-picker style="margin-left: 10px;" v-model="timeRange" type="daterange" format="YYYY/MM/DD" value-format="YYYY-MM-DD" |
| | | start-placeholder="开始时间" end-placeholder="结束时间" :default-time="defaultTime" /> |
| | | <el-select v-model="report.type" placeholder="清选择类型" style="margin-left: 10px;" > |
| | | <el-option label="全部" value="0"></el-option> |
| | | <el-option label="完工" value="1"></el-option> |
| | | <el-option label="破损" value="2"></el-option> |
| | | <el-option label="拿走" value="3"></el-option> |
| | | :start-placeholder="$t('reportmanage.starttime')" :end-placeholder="$t('reportmanage.endtime')" :default-time="defaultTime" /> |
| | | <el-select v-model="report.type" :placeholder="$t('reportmanage.ctype')" style="margin-left: 10px;" > |
| | | <el-option :label="$t('reportmanage.all')" value="0"></el-option> |
| | | <el-option :label="$t('reportmanage.completed')" value="1"></el-option> |
| | | <el-option :label="$t('reportmanage.broke')" value="2"></el-option> |
| | | <el-option :label="$t('reportmanage.takeout')" value="3"></el-option> |
| | | </el-select> |
| | | <el-select v-model="report.status" placeholder="清选择状态" style="margin-left: 10px;" > |
| | | <el-option label="全部" value="0"></el-option> |
| | | <el-option label="未报工" value="1"></el-option> |
| | | <el-option label="待报工" value="2"></el-option> |
| | | <el-option label="已报工" value="3"></el-option> |
| | | <el-select v-model="report.status" :placeholder="$t('reportmanage.cstate')" style="margin-left: 10px;" > |
| | | <el-option :label="$t('reportmanage.all')" value="0"></el-option> |
| | | <el-option :label="$t('reportmanage.dreportwork')" value="1"></el-option> |
| | | <el-option :label="$t('reportmanage.pendingwork')" value="2"></el-option> |
| | | <el-option :label="$t('reportmanage.reportwork')" value="3"></el-option> |
| | | </el-select> |
| | | <el-select v-model="report.workingProcedure" placeholder="清选择工序" style="margin-left: 10px;" > |
| | | <el-option label="全部" value="0"></el-option> |
| | | <el-option label="切割" value="1"></el-option> |
| | | <el-option label="磨边" value="2"></el-option> |
| | | <el-option label="钢化" value="3"></el-option> |
| | | <el-select v-model="report.workingProcedure" :placeholder="$t('reportmanage.cprocess')" style="margin-left: 10px;" > |
| | | <el-option :label="$t('reportmanage.all')" value="0"></el-option> |
| | | <el-option :label="$t('reportmanage.incise')" value="1"></el-option> |
| | | <el-option :label="$t('reportmanage.edging')" value="2"></el-option> |
| | | <el-option :label="$t('reportmanage.steel')" value="3"></el-option> |
| | | </el-select> |
| | | <el-button type="primary" style="margin-left: 10px;" @click="selectReportData()">查询</el-button> |
| | | <el-button type="success" style="margin-left: 10px;" >报工</el-button> |
| | | <el-button type="primary" style="margin-left: 10px;" @click="selectReportData()">{{ $t('reportmanage.inquire') }}</el-button> |
| | | <el-button type="success" style="margin-left: 10px;" @click="handleConfirm">{{ $t('reportmanage.signingwork') }}</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="550" ref="table" :data="reportData" |
| | | <el-table height="540" ref="table" :data="reportData" |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }"> |
| | | <el-table-column prop="teamsGroupsName" align="center" label="报工班组" min-width="120" /> |
| | | <el-table-column prop="deviceName" align="center" label="报工设备" min-width="120" /> |
| | | <el-table-column prop="line" align="center" label="线路" min-width="120" /> |
| | | <el-table-column prop="workingProcedure" align="center" label="工序" min-width="120" /> |
| | | <el-table-column prop="glassId" align="center" label="玻璃id" min-width="120" /> |
| | | <el-table-column prop="engineerId" align="center" label="工程号" min-width="120" /> |
| | | <el-table-column prop="temperingLayoutId" align="center" label="钢化版图id" min-width="120" /> |
| | | <el-table-column prop="damageTime" align="center" label="生产时间" min-width="120" /> |
| | | <el-table-column prop="type" align="center" label="类型" min-width="120" /> |
| | | <el-table-column prop="status" align="center" label="状态" min-width="120" /> |
| | | <el-table-column prop="processId" align="center" label="流程卡" min-width="120" /> |
| | | <el-table-column prop="orderNumber" align="center" label="序号" min-width="120" /> |
| | | <el-table-column prop="technologyNumber" align="center" label="层" min-width="120" /> |
| | | <el-table-column prop="breakageType" align="center" label="破损类型" min-width="120" /> |
| | | <el-table-column prop="breakageReason" align="center" label="破损原因" min-width="120" /> |
| | | <el-table-column prop="responsibleProcess" align="center" label="责任工序" min-width="120" /> |
| | | <el-table-column prop="responsiblePersonnel" align="center" label="责任人员" min-width="120" /> |
| | | <el-table-column prop="responsibleTeam" align="center" label="责任班组" min-width="120" /> |
| | | <el-table-column prop="responsibleEquipment" align="center" label="责任设备" min-width="120" /> |
| | | <el-table-column prop="remark" align="center" label="备注" min-width="120" /> |
| | | <el-table-column prop="teamsGroupsName" align="center" :label="$t('reportmanage.reporteam')" min-width="120" /> |
| | | <el-table-column prop="deviceName" align="center" :label="$t('reportmanage.reportingequipment')" min-width="120" /> |
| | | <el-table-column prop="line" align="center" :label="$t('reportmanage.line')" min-width="120" /> |
| | | <el-table-column prop="workingProcedure" align="center" :label="$t('reportmanage.process')" min-width="120" /> |
| | | <el-table-column prop="glassId" align="center" :label="$t('reportmanage.glassID')" min-width="130" /> |
| | | <el-table-column prop="engineerId" align="center" :label="$t('reportmanage.projectnumber')" min-width="120" /> |
| | | <el-table-column prop="temperingLayoutId" align="center" :label="$t('reportmanage.layoutID')" min-width="120" /> |
| | | <el-table-column prop="damageTime" align="center" :label="$t('reportmanage.productiontime')" min-width="230" /> |
| | | <el-table-column prop="type" align="center" :label="$t('reportmanage.type')" min-width="120" /> |
| | | <el-table-column prop="status" align="center" :label="$t('reportmanage.state')" min-width="120" /> |
| | | <el-table-column prop="processId" align="center" :label="$t('reportmanage.processcards')" min-width="140" /> |
| | | <el-table-column prop="orderNumber" align="center" :label="$t('reportmanage.number')" min-width="120" /> |
| | | <el-table-column prop="technologyNumber" align="center" :label="$t('reportmanage.layer')" min-width="120" /> |
| | | <el-table-column prop="breakageType" align="center" :label="$t('reportmanage.typebreakage')" min-width="180"> |
| | | <template #default="{ row }"> |
| | | <el-select |
| | | v-model="selectValuesa[row.id]" |
| | | filterable |
| | | :placeholder="$t('reportmanage.pcausebreakage')" |
| | | clearable |
| | | @input="handleInputChangea($event, row.id)" |
| | | > |
| | | <el-option |
| | | v-for="item in selectOptionsa" |
| | | :key="item.basicName" |
| | | :label="item.basicName" |
| | | :value="item.basicName" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="breakageReason" align="center" :label="$t('reportmanage.causebreakage')" min-width="180"> |
| | | <template #default="{ row }"> |
| | | <el-select |
| | | v-model="selectValuesb[row.id]" |
| | | filterable |
| | | :placeholder="$t('reportmanage.ptypebreakage')" |
| | | clearable |
| | | @input="handleInputChangea($event, row.id)" |
| | | > |
| | | <el-option |
| | | v-for="item in selectOptionsb" |
| | | :key="item.basicName" |
| | | :label="item.basicName" |
| | | :value="item.basicName" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" :label="$t('reportmanage.responsibleprocess')" min-width="120"> |
| | | <template #default="{ row }"> |
| | | <span>{{ '切割磨边钢化' }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="responsiblePersonnel" align="center" :label="$t('reportmanage.responsiblepersonnel')" min-width="180"> |
| | | <template #default="{ row }"> |
| | | <el-input :placeholder="$t('reportmanage.presponsiblepersonnel')" v-model="inputValuesa[row.id]" autocomplete="off" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="responsibleTeam" align="center" :label="$t('reportmanage.responsibleteam')" min-width="180"> |
| | | <template #default="{ row }"> |
| | | <el-select |
| | | v-model="selectValuesc[row.id]" |
| | | filterable |
| | | :placeholder="$t('reportmanage.presponsibleteam')" |
| | | clearable |
| | | @input="handleInputChangea($event, row.id)" |
| | | > |
| | | <el-option |
| | | v-for="item in selectOptionsc" |
| | | :key="item.basicName" |
| | | :label="item.basicName" |
| | | :value="item.basicName" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="responsibleEquipment" align="center" :label="$t('reportmanage.responsibleequipment')" min-width="180"> |
| | | <template #default="{ row }"> |
| | | <el-select |
| | | v-model="selectValuesd[row.id]" |
| | | filterable |
| | | :placeholder="$t('reportmanage.presponsibleequipment')" |
| | | clearable |
| | | @input="handleInputChangea($event, row.id)" |
| | | > |
| | | <el-option |
| | | v-for="item in selectOptionsd" |
| | | :key="item.basicName" |
| | | :label="item.basicName" |
| | | :value="item.basicName" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="remark" align="center" :label="$t('reportmanage.remark')" min-width="180"> |
| | | <template #default="{ row }"> |
| | | <el-input :placeholder="$t('reportmanage.premark')" v-model="inputValuesb[row.id]" autocomplete="off" /> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | |
| | | workingProcedure: '0', |
| | | }); |
| | | const reportData = ref([]) |
| | | const timeRange = ref(["2022-01-01", "2022-01-01"]) |
| | | const timeRange = ref(["2022-01-01", "2025-01-01"]) |
| | | const selectOptionsa = ref([]); |
| | | const selectOptionsb = ref([]); |
| | | const selectOptionsc = ref([]); |
| | | const selectOptionsd = ref([]); |
| | | const selectValuesa = reactive({}); |
| | | const selectValuesb = reactive({}); |
| | | const selectValuesc = reactive({}); |
| | | const selectValuesd = reactive({}); |
| | | const inputValuesa = reactive({}); |
| | | const inputValuesb = reactive({}); |
| | | |
| | | |
| | | // 查询数据 |
| | |
| | | status:"2" |
| | | }) |
| | | }; |
| | | |
| | | // 报工 |
| | | const handleConfirm = async () => { |
| | | const response = await request.post("/cacheVerticalGlass/damage/submitDamage", reportData.value) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | }; |
| | | const fetchTableData = async () => { |
| | | try { |
| | | const response = await request.post('/cacheVerticalGlass/basic_data_produce/selectBasicDataProduceGroup'); |
| | | if (response.code == 200) { |
| | | selectOptionsa.value = response.data.breakagetype.filter(item => item !== null) |
| | | .map(item => ({ basicName: item.basicName })); |
| | | selectOptionsb.value = response.data.breakagereason.filter(item => item !== null) |
| | | .map(item => ({ basicName: item.basicName })); |
| | | selectOptionsc.value = response.data.teamsgroups.filter(item => item !== null) |
| | | .map(item => ({ basicName: item.basicName })); |
| | | selectOptionsd.value = response.data.device.filter(item => item !== null) |
| | | .map(item => ({ basicName: item.basicName })); |
| | | } else { |
| | | ElMessage.warning(response.data); |
| | | } |
| | | } catch (error) { |
| | | console.error('Error fetching options:', error); |
| | | } |
| | | }; |
| | | const handleInputChangea = (value, rowId) => { |
| | | // 更新对应行的 select 值 |
| | | selectValuesa[rowId] = value; |
| | | selectValuesb[rowId] = value; |
| | | selectValuesc[rowId] = value; |
| | | selectValuesd[rowId] = value; |
| | | inputValuesa[rowId] = value; |
| | | inputValuesb[rowId] = value; |
| | | }; |
| | | fetchTableData(); |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/screen`; |
| | | const handleMessage = (data) => { |
| | | // adjustedRects.value = data.device[0].map(rect => ({ |
| | |
| | | |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | fetchTableData(); |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onBeforeUnmount(() => { |
| | |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <div id="dotClass"> |
| | |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { tr } from "element-plus/es/locale"; |
| | | const dialogFormVisible = ref(false) |
| | | const dialoglea = ref(false) |
| | | const dialogFormVisiblea = ref(false) |
| | | const dialogFormVisibleb = ref(false) |
| | | const dialogFormVisiblec = ref(false) |
| | |
| | | const tableDatad = ref([]) |
| | | const tableDataf = ref([]) |
| | | const tableDatae = ref([]) |
| | | const tableDataxx = ref([]) |
| | | const carPosition = ref([]) |
| | | const ganghua = ref('') |
| | | const adjustedRects = ref([]); |
| | | const project = ref([]); |
| | | const adjust = ref([]); |
| | |
| | | // } |
| | | return 9; |
| | | }); |
| | | |
| | | |
| | | setInterval(() => { |
| | | localStorage.clear(); // 清除所有localStorage数据 |
| | | console.log(11111); |
| | | }, 60000); |
| | | // function cleanUp() { |
| | | // console.log('执行清理操作'); |
| | | // } |
| | | // // 假设我们每2分钟执行一次清理 |
| | | // setInterval(cleanUp, 1 * 60 * 1000); |
| | | |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | const handlezhiban = () => { |
| | | fetchFlowCardId(); |
| | | dialoglea.value = true; // 打开绑定架子对话框 |
| | | }; |
| | | const fetchFlowCardId = async () => { |
| | | try { |
| | | // var url="/cacheVerticalGlass/work_assignment/selectWorkAssignment?line=" + 2001 + "&workingProcedure='冷加工'"; |
| | | // const response = await request.post(url) |
| | | const response = await request.post('/cacheVerticalGlass/work_assignment/selectWorkAssignment',{ |
| | | line: 2001, |
| | | workingProcedure : '冷加工' |
| | | }); |
| | | if (response.code === 200) { |
| | | ElMessage.error(response.message); |
| | | tableDataxx.value = response.data; |
| | | console.log(tableDataxx.value); |
| | | |
| | | } |
| | | else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | console.error(error); |
| | | } |
| | | }; |
| | | function handleRowClick(row) { |
| | | selectedRow.value = row; // 更新选中的行数据 |
| | | } |
| | | const handleChange = async () => { |
| | | try { |
| | | const body = { |
| | | flag: ganghua.value, // 使用 ganghua.value 获取当前开关的状态 |
| | | }; |
| | | |
| | | var url="/cacheVerticalGlass/bigStorageCageDetails/temperingSwitch?flag="+ganghua.value; |
| | | const response = await request.post(url) |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | ganghua.value = response.data |
| | | }else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheVerticalGlass/api/talk/slicecage`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | console.log(data.temperingSwitch[0]); |
| | | if(data.bigStorageCageDetailsOutTask!=null){ |
| | | tableDatac.value = data.bigStorageCageDetailsOutTask[0] |
| | | adjusta.value = data.bigStorageCageDetailsOutTask[0].filter(rect => rect.slot !== null && rect.slot !== undefined); |
| | | } else { |
| | | tableDatac.value = '', |
| | | adjusta.value = '' |
| | | } |
| | | if(data.bigStorageCageDetailsFeedTask!=null){ |
| | | tableDatad.value = data.bigStorageCageDetailsFeedTask[0] |
| | | adjust.value = data.bigStorageCageDetailsFeedTask[0].filter(rect => rect.slot !== null && rect.slot !== undefined); |
| | | }else{ |
| | | tableDatad.value = '' |
| | | } |
| | | |
| | | // adjust.value = data.bigStorageCageDetailsFeedTask[0].map(rect => ({ |
| | |
| | | // }); |
| | | if(data.bigStorageCageInfo!=null){ |
| | | tableData.value = data.bigStorageCageInfo[0] |
| | | }else{ |
| | | tableData.value = '' |
| | | } |
| | | if(data.temperingGlassInfoList!=null){ |
| | | tableDatab.value = data.temperingGlassInfoList[0] |
| | | }else{ |
| | | tableDatab.value = '' |
| | | } |
| | | if(data.bigStorageCageUsage!=null){ |
| | | tableDatae.value = data.bigStorageCageUsage[0] |
| | | }else{ |
| | | tableDatae.value = '' |
| | | } |
| | | if(data.carPostion!=null){ |
| | | carPosition.value = data.carPostion[0] |
| | | }else{ |
| | | carPosition.value = '' |
| | | } |
| | | |
| | | |
| | | if(data.temperingSwitch!=null){ |
| | | ganghua.value = data.temperingSwitch[0] |
| | | }else{ |
| | | ganghua.value = '' |
| | | } |
| | | console.log(data.temperingSwitch[0]); |
| | | if(data.bigStorageCageInfos!=null){ |
| | | window.localStorage.setItem('length', data.bigStorageCageInfos[0][1].length) |
| | | let length = window.localStorage.getItem('length') |
| | |
| | | height: 20/length, |
| | | top: 29/length |
| | | })); |
| | | }else{ |
| | | adjustedRects.value = '' |
| | | } |
| | | |
| | | |
| | |
| | | <div style="height: 600px;"> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="primary" @click="dialogFormVisiblea = true">{{ $t('searchOrder.cageinformation') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="success" @click="dialogFormVisibleb = true">{{ $t('searchOrder.productionqueue') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="info" @click="dialogFormVisiblec = true">{{ $t('searchOrder.temperingqueries') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="warning" @click="dialogFormVisiblec = true">{{ $t('searchOrder.temperingqueries') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="info" @click="handlezhiban">{{ $t('searchOrder.dutyinformation') }}</el-button> |
| | | <el-switch style="margin-top: 5px;margin-left: 10px;" v-model="ganghua" class="mb-2" :inactive-text="$t('searchOrder.temperedswitch')" @change="handleChange" /> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 5px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 100px;"> |
| | | <el-table height="100px" ref="table" |
| | |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | |
| | | <el-dialog v-model="dialoglea" top="5vh" width="85%" :title="$t('searchOrder.dutyinformation')"> |
| | | <el-table ref="table" style="margin-top: 20px;height: 400px;" |
| | | :data="tableDataxx" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="line" fixed align="center" :label="$t('searchOrder.line')" min-width="150"/> |
| | | <el-table-column prop="workProcesses" fixed align="center" :label="$t('searchOrder.process')" min-width="120" /> |
| | | <el-table-column prop="teamsGroupsName" align="center" :label="$t('searchOrder.team')" min-width="150" /> |
| | | <el-table-column prop="deviceName" align="center" :label="$t('searchOrder.basic')" min-width="150" /> |
| | | </el-table> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleConfirm"> |
| | | {{ $t('searchOrder.add') }} |
| | | </el-button> |
| | | <el-button @click="dialoglea = false">{{ $t('basicData.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | <style scoped> |
| | | #dt { display:block; float:left;line-height: 20px;margin-left: 100px;} |
| | |
| | | * 出片任务101 |
| | | * 人工下片102 |
| | | * 出片中103 |
| | | * 调度中104 |
| | | * 拿走200 |
| | | * 破损201 |
| | | */ |
| | |
| | | public static final Integer GLASS_STATE_OUT = 101; |
| | | public static final Integer GLASS_STATE_ARTIFICIAL = 102; |
| | | public static final Integer GLASS_STATE_OUT_ING = 103; |
| | | public static final Integer GLASS_STATE_SCHEDULE_ING = 104; |
| | | public static final Integer GLASS_STATE_TAKE = 200; |
| | | public static final Integer GLASS_STATE_DAMAGE = 201; |
| | | public static final List<Integer> GLASS_STATE_IN_ALL = Arrays.asList(100, 102, 103); |
| | | public static final List<Integer> GLASS_STATE_IN_ALL = Arrays.asList(100, 102, 103, 104); |
| | | |
| | | /** |
| | | * 卧式理片笼详情表玻璃状态 |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.pp.entity.BasicDataProduce; |
| | | import com.mes.pp.entity.ReportingWork; |
| | | import com.mes.work_assignment.entity.WorkAssignment; |
| | | import com.mes.work_assignment.mapper.WorkAssignmentMapper; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | import java.sql.Timestamp; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * 提交报工 |
| | | */ |
| | | @Override |
| | | public void submitDamage(String startTime, String endTime, int type, int status, String workingProcedure){ |
| | | public void submitDamage(String startTime, String endTime, int type, int status, String workingProcedures){ |
| | | LambdaUpdateWrapper<Damage> damageUpdateWrapper=new LambdaUpdateWrapper<>(); |
| | | damageUpdateWrapper.between(Damage::getDamageTime,startTime,endTime); |
| | | LambdaQueryWrapper<Damage> damageLambdaQueryWrapper=new LambdaQueryWrapper<>() |
| | | ; damageUpdateWrapper.between(Damage::getDamageTime,startTime,endTime); |
| | | damageLambdaQueryWrapper.between(Damage::getDamageTime,startTime,endTime); |
| | | if (type!=0){ |
| | | damageUpdateWrapper.eq(Damage::getType,type); |
| | | damageLambdaQueryWrapper.eq(Damage::getType,type); |
| | | } |
| | | if (status!=0){ |
| | | damageUpdateWrapper.eq(Damage::getStatus,status); |
| | | damageLambdaQueryWrapper.eq(Damage::getStatus,status); |
| | | } |
| | | if(!"0".equals(workingProcedure)){ |
| | | damageUpdateWrapper.eq(Damage::getWorkingProcedure,workingProcedure); |
| | | if(!"0".equals(workingProcedures)){ |
| | | damageUpdateWrapper.eq(Damage::getWorkingProcedure,workingProcedures); |
| | | damageLambdaQueryWrapper.eq(Damage::getWorkingProcedure,workingProcedures); |
| | | } |
| | | Damage damage=new Damage(); |
| | | damage.setStatus(2); |
| | | baseMapper.update(damage,damageUpdateWrapper); |
| | | // Damage damage=new Damage(); |
| | | // damage.setStatus(2); |
| | | // baseMapper.update(damage,damageUpdateWrapper); |
| | | List<Damage> damageList = baseMapper.selectList(damageLambdaQueryWrapper); |
| | | Map<String, Map<String, Map<String, Map<String, List<Damage>>>>> resultMap = damageList.stream() |
| | | .collect(Collectors.groupingBy( |
| | | Damage::getProcessId, |
| | | Collectors.groupingBy( |
| | | Damage::getWorkingProcedure, |
| | | Collectors.groupingBy( |
| | | Damage::getDeviceName, |
| | | Collectors.groupingBy(Damage::getTeamsGroupsName) |
| | | ) |
| | | ) |
| | | )); |
| | | // 遍历 resultMap |
| | | for (Map.Entry<String, Map<String, Map<String, Map<String, List<Damage>>>>> processEntry : resultMap.entrySet()) { |
| | | String processId = processEntry.getKey(); |
| | | System.out.println("ProcessId: " + processId); |
| | | |
| | | // 获取第二层的 Map,按 workingProcedure 分组的结果 |
| | | Map<String, Map<String, Map<String, List<Damage>>>> workingProcedureMap = processEntry.getValue(); |
| | | |
| | | // 遍历 workingProcedureMap |
| | | for (Map.Entry<String, Map<String, Map<String, List<Damage>>>> workingProcedureEntry : workingProcedureMap.entrySet()) { |
| | | String workingProcedure = workingProcedureEntry.getKey(); |
| | | System.out.println(" WorkingProcedure: " + workingProcedure); |
| | | |
| | | // 获取第三层的 Map,按 deviceName 分组的结果 |
| | | Map<String, Map<String, List<Damage>>> deviceNameMap = workingProcedureEntry.getValue(); |
| | | |
| | | // 遍历 deviceNameMap |
| | | for (Map.Entry<String, Map<String, List<Damage>>> deviceNameEntry : deviceNameMap.entrySet()) { |
| | | String deviceName = deviceNameEntry.getKey(); |
| | | System.out.println(" DeviceName: " + deviceName); |
| | | |
| | | // 获取第四层的 Map,按 teamsGroupsName 分组的结果 |
| | | Map<String, List<Damage>> teamsGroupsNameMap = deviceNameEntry.getValue(); |
| | | |
| | | // 遍历 teamsGroupsNameMap |
| | | for (Map.Entry<String, List<Damage>> teamsGroupsNameEntry : teamsGroupsNameMap.entrySet()) { |
| | | String teamsGroupsName = teamsGroupsNameEntry.getKey(); |
| | | System.out.println(" TeamsGroupsName: " + teamsGroupsName); |
| | | |
| | | // 获取 Damage 列表 |
| | | List<Damage> damageListForTeamsGroupsName = teamsGroupsNameEntry.getValue(); |
| | | |
| | | // 使用 stream 对 damageListForTeamsGroupsName 进行再次分组 |
| | | Map<Integer, Map<Integer, Map<String, List<Damage>>>> groupedByOrderTechBreakage = damageListForTeamsGroupsName.stream() |
| | | .collect(Collectors.groupingBy( |
| | | Damage::getOrderNumber, |
| | | Collectors.groupingBy( |
| | | Damage::getTechnologyNumber, |
| | | Collectors.groupingBy( |
| | | Damage::getBreakageType, |
| | | Collectors.toList() |
| | | ) |
| | | ) |
| | | )); |
| | | |
| | | // 遍历 groupedByOrderTechBreakage |
| | | for (Map.Entry<Integer, Map<Integer, Map<String, List<Damage>>>> orderEntry : groupedByOrderTechBreakage.entrySet()) { |
| | | Integer orderNumber = orderEntry.getKey(); |
| | | System.out.println(" OrderNumber: " + orderNumber); |
| | | |
| | | // 获取第二层的 Map,按 technologyNumber 分组的结果 |
| | | Map<Integer, Map<String, List<Damage>>> technologyNumberMap = orderEntry.getValue(); |
| | | |
| | | // 遍历 technologyNumberMap |
| | | for (Map.Entry<Integer, Map<String, List<Damage>>> technologyEntry : technologyNumberMap.entrySet()) { |
| | | Integer technologyNumber = technologyEntry.getKey(); |
| | | System.out.println(" TechnologyNumber: " + technologyNumber); |
| | | |
| | | // 获取第三层的 Map,按 breakageType 分组的结果 |
| | | Map<String, List<Damage>> breakageTypeMap = technologyEntry.getValue(); |
| | | |
| | | // 遍历 breakageTypeMap |
| | | for (Map.Entry<String, List<Damage>> breakageTypeEntry : breakageTypeMap.entrySet()) { |
| | | String breakageType = breakageTypeEntry.getKey(); |
| | | System.out.println(" BreakageType: " + breakageType); |
| | | |
| | | ReportingWork reportingWork=new ReportingWork(); |
| | | reportingWork.setProcessId(processId); |
| | | reportingWork.setThisProcess(workingProcedure); |
| | | reportingWork.setDeviceName(deviceName); |
| | | reportingWork.setTeamsGroupsName(teamsGroupsName); |
| | | // 获取 Damage 列表 |
| | | List<Damage> damageListForBreakageType = breakageTypeEntry.getValue(); |
| | | int completedQuantity=0; |
| | | int breakageQuantity=0; |
| | | // 遍历 Damage 列表 |
| | | for (Damage damage : damageListForBreakageType) { |
| | | // 打印或处理每个 Damage 对象 |
| | | System.out.println(" Damage: " + damage.toString()); |
| | | if(damage.getType()==1){ |
| | | completedQuantity+=1; |
| | | }else if(damage.getType()==2){ |
| | | breakageQuantity+=1; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
New file |
| | |
| | | package com.mes.pp.controller; |
| | | |
| | | |
| | | import com.mes.pp.service.BasicDataProduceService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-07-25 |
| | | */ |
| | | @Api(description = "生产基础数据") |
| | | @RestController |
| | | @RequestMapping("/basic_data_produce") |
| | | public class BasicDataProduceController { |
| | | |
| | | @Autowired |
| | | //获取待选择的工程号 |
| | | private BasicDataProduceService basicDataProduceService; |
| | | |
| | | @ApiOperation("查询基础数据") |
| | | @PostMapping("/selectBasicDataProduceGroup") //显示工程选择信息 |
| | | @ResponseBody |
| | | public Result selectBasicDataProduceGroup() { |
| | | return Result.build(200, "查询成功", basicDataProduceService.selectBasicDataProduceGroup()); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.pp.controller; |
| | | |
| | | |
| | | import com.mes.pp.entity.BasicDataProduce; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.entity.request.OptimizeRequest; |
| | | import com.mes.pp.service.BasicDataProduceService; |
| | | import com.mes.pp.service.OptimizeProjectService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-07-26 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/damage_details") |
| | | public class DamageDetailsController { |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.pp.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-07-25 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/reporting-work-detail") |
| | | public class ReportingWorkDetailController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.pp.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.time.LocalDateTime; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-07-25 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class BasicDataProduce implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 基础数据类型 |
| | | */ |
| | | private String basicType; |
| | | |
| | | /** |
| | | * 基础数据名称 |
| | | */ |
| | | private String basicName; |
| | | |
| | | /** |
| | | * 基础数据类别 |
| | | */ |
| | | private String basicCategory; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Timestamp createTime; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | private Timestamp updateTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.pp.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-07-26 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class DamageDetails implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * <次破明细表> |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 报工编号 |
| | | */ |
| | | private String reportingWorkId; |
| | | |
| | | /** |
| | | * 流程卡号 |
| | | */ |
| | | private String processId; |
| | | |
| | | /** |
| | | * 序号 |
| | | */ |
| | | private Integer orderNumber; |
| | | |
| | | /** |
| | | * 工艺确认序号(层号) |
| | | */ |
| | | private Integer technologyNumber; |
| | | |
| | | /** |
| | | * 次破数量 |
| | | */ |
| | | private Integer breakageQuantity; |
| | | |
| | | /** |
| | | * 次破类型 |
| | | */ |
| | | private String breakageType; |
| | | |
| | | /** |
| | | * 次破原因 |
| | | */ |
| | | private String breakageReason; |
| | | |
| | | /** |
| | | * 可利用(默认0,需要返工1) |
| | | */ |
| | | private Integer available; |
| | | |
| | | /** |
| | | * 返工/补片数量 |
| | | */ |
| | | private Integer quantity; |
| | | |
| | | /** |
| | | * 返工工序 |
| | | */ |
| | | private String returnProcess; |
| | | |
| | | /** |
| | | * 责任工序 |
| | | */ |
| | | private String responsibleProcess; |
| | | |
| | | /** |
| | | * 责任人员 |
| | | */ |
| | | private String responsiblePersonnel; |
| | | |
| | | /** |
| | | * 责任班组 |
| | | */ |
| | | private String responsibleTeam; |
| | | |
| | | /** |
| | | * 责任设备 |
| | | */ |
| | | private String responsibleEquipment; |
| | | |
| | | /** |
| | | * 质检员 |
| | | */ |
| | | private String qualityInspector; |
| | | |
| | | /** |
| | | * 补片状态(默认0,已补片1) |
| | | */ |
| | | private Integer patchStatus; |
| | | |
| | | /** |
| | | * 质检状态(默认0,1待质检1,已质检2) |
| | | */ |
| | | private Integer qualityInsStatus; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.pp.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.time.LocalDateTime; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-07-25 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class ReportingWorkDetail implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * <报工明细> |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 报工编号 |
| | | */ |
| | | private String reportingWorkId; |
| | | |
| | | /** |
| | | * 序号 |
| | | */ |
| | | private Integer orderNumber; |
| | | |
| | | /** |
| | | * 工艺确认序号 |
| | | */ |
| | | private Integer technologyNumber; |
| | | |
| | | /** |
| | | * 完工数量 |
| | | */ |
| | | private Integer completedQuantity; |
| | | |
| | | /** |
| | | * 次破数量 |
| | | */ |
| | | private Integer breakageQuantity; |
| | | |
| | | /** |
| | | * 次破类型 |
| | | */ |
| | | private String breakageType; |
| | | |
| | | /** |
| | | * 次破原因 |
| | | */ |
| | | private String breakageReason; |
| | | |
| | | /** |
| | | * 可利用(1可利用0默认) |
| | | */ |
| | | private Integer available; |
| | | |
| | | /** |
| | | * 退回工序 |
| | | */ |
| | | private String returnProcess; |
| | | |
| | | /** |
| | | * 责任工序 |
| | | */ |
| | | private String responsibleProcess; |
| | | |
| | | /** |
| | | * 责任人员 |
| | | */ |
| | | private String responsiblePersonnel; |
| | | |
| | | /** |
| | | * 责任班组 |
| | | */ |
| | | private String responsibleTeam; |
| | | |
| | | /** |
| | | * 责任设备 |
| | | */ |
| | | private String responsibleEquipment; |
| | | |
| | | /** |
| | | * 质检员 |
| | | */ |
| | | private String qualityInspector; |
| | | |
| | | /** |
| | | * 补片状态 |
| | | */ |
| | | private Integer patchStatus; |
| | | |
| | | /** |
| | | * 在制品名称 |
| | | */ |
| | | private String workProgress; |
| | | |
| | | /** |
| | | * 质检状态 |
| | | */ |
| | | private Integer qualityInsStatus; |
| | | |
| | | /** |
| | | * 报工类型 |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 待返工数量 |
| | | */ |
| | | private Integer waitReworkQuantity; |
| | | |
| | | /** |
| | | * 返工班组 |
| | | */ |
| | | private String reworkTeam; |
| | | |
| | | /** |
| | | * 返工审核人 |
| | | */ |
| | | private String reviewer; |
| | | |
| | | /** |
| | | * 返工审核状态 |
| | | */ |
| | | private String reviewStatus; |
| | | |
| | | /** |
| | | * 返工时间 |
| | | */ |
| | | private LocalDateTime reworkTime; |
| | | |
| | | /** |
| | | * 返工修改时间 |
| | | */ |
| | | private LocalDateTime reworkUpdateTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.pp.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.pp.entity.BasicDataProduce; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-07-25 |
| | | */ |
| | | @DS("pp") |
| | | public interface BasicDataProduceMapper extends BaseMapper<BasicDataProduce> { |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.pp.mapper; |
| | | |
| | | import com.mes.pp.entity.ReportingWorkDetail; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-07-25 |
| | | */ |
| | | public interface ReportingWorkDetailMapper extends BaseMapper<ReportingWorkDetail> { |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.pp.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.pp.entity.BasicDataProduce; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-07-25 |
| | | */ |
| | | public interface BasicDataProduceService extends IService<BasicDataProduce> { |
| | | |
| | | Map<String, List<BasicDataProduce>> selectBasicDataProduceGroup(); |
| | | } |
New file |
| | |
| | | package com.mes.pp.service; |
| | | |
| | | import com.mes.pp.entity.DamageDetails; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-07-26 |
| | | */ |
| | | public interface DamageDetailsService extends IService<DamageDetails> { |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.pp.service; |
| | | |
| | | import com.mes.pp.entity.ReportingWorkDetail; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-07-25 |
| | | */ |
| | | public interface ReportingWorkDetailService extends IService<ReportingWorkDetail> { |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.pp.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.pp.entity.BasicDataProduce; |
| | | import com.mes.pp.mapper.BasicDataProduceMapper; |
| | | import com.mes.pp.service.BasicDataProduceService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-07-25 |
| | | */ |
| | | @Service |
| | | public class BasicDataProduceServiceImpl extends ServiceImpl<BasicDataProduceMapper, BasicDataProduce> implements BasicDataProduceService { |
| | | |
| | | @Override |
| | | public Map<String, List<BasicDataProduce>> selectBasicDataProduceGroup(){ |
| | | List<BasicDataProduce> basicDataProduceList=baseMapper.selectList(null); |
| | | Map<String, List<BasicDataProduce>> listMap = basicDataProduceList.stream().collect(Collectors.groupingBy(item -> item.getBasicType())); |
| | | return listMap; |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.pp.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.pp.entity.DamageDetails; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-07-26 |
| | | */ |
| | | public interface DamageDetailsService extends IService<DamageDetails> { |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.pp.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.pp.entity.ReportingWorkDetail; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-07-25 |
| | | */ |
| | | public interface ReportingWorkDetailService extends IService<ReportingWorkDetail> { |
| | | |
| | | } |
| | |
| | | <insert id="saveBatch"> |
| | | INSERT INTO tempering_glass_info (glass_id, flow_card_id, glass_type, width, height, thickness, filmsid, |
| | | ishorizontal, tempering_layout_id, |
| | | tempering_feed_sequence, x_coordinate, y_coordinate, angle, state, slot ) VALUES |
| | | tempering_feed_sequence, x_coordinate, y_coordinate, angle, state, slot, engineer_id) VALUES |
| | | <foreach collection="list" item="item" separator=","> |
| | | (#{item.glassId}, #{item.flowCardId}, #{item.glassType}, #{item.width}, #{item.height}, #{item.thickness}, |
| | | #{item.filmsid},#{item.ishorizontal}, |
| | | #{item.temperingLayoutId}, #{item.temperingFeedSequence}, #{item.xCoordinate}, #{item.yCoordinate}, |
| | | #{item.angle}, #{item.state}, #{item.slot}) |
| | | #{item.angle}, #{item.state}, #{item.slot}, #{item.engineerId}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | |
| | | package com.mes.bigstorage.controller; |
| | | |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.common.utils.RedisUtil; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | private BigStorageCageDetailsService bigStorageCageDetailsService; |
| | | @Autowired |
| | | private BigStorageCageService bigStorageCageService; |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | @ApiOperation("玻璃详情查询") |
| | |
| | | |
| | | @ApiOperation("指定钢化") |
| | | @PostMapping("/TemperingGlass") |
| | | public Result TemperingGlass(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | boolean result=bigStorageCageDetailsService.TemperingGlass(bigStorageCageDetails.getTemperingLayoutId().toString(),bigStorageCageDetails.getEngineerId()); |
| | | public Result temperingGlass(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | boolean result = bigStorageCageDetailsService.temperingGlass(bigStorageCageDetails.getTemperingLayoutId().toString(), bigStorageCageDetails.getEngineerId()); |
| | | if(result==true){ |
| | | return Result.build(200,"指定钢化成功",1); |
| | | }else { |
| | |
| | | public Result selectTemperingGlass() { |
| | | return Result.build(200,"查询成功",bigStorageCageDetailsService.selectTemperingGlass()); |
| | | } |
| | | |
| | | @ApiOperation("是否钢化开关") |
| | | @PostMapping("/temperingSwitch") |
| | | public Result temperingSwitch(Boolean flag) { |
| | | bigStorageCageDetailsService.temperingSwitch(flag); |
| | | return Result.build(200, "修改成功", redisUtil.getCacheObject("temperingSwitch")); |
| | | } |
| | | } |
| | | |
| | |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.entity.dto.SlotSequenceDTO; |
| | | import com.mes.bigstorage.entity.dto.TemperingLayoutDTO; |
| | | import com.mes.bigstoragetask.entity.UpdateBigStorageCageDTO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | TemperingLayoutDTO queryTemperingOccupySlot(@Param(value = "count") int count); |
| | | List<TemperingLayoutDTO> queryTemperingOccupySlot(@Param(value = "count") int count); |
| | | |
| | | |
| | | List<SlotSequenceDTO> queryGlassMaxAndMin(@Param(value = "engineerId") String engineerId, @Param(value = "temperingLayoutId") Integer temperingLayoutId); |
| | | |
| | | /** |
| | | * 按照玻璃id和目标格子更新笼内玻璃信息 |
| | | * |
| | | * @param glassList |
| | | * @param state |
| | | */ |
| | | void updateBySlot(@Param(value = "list") List<UpdateBigStorageCageDTO> glassList, @Param(value = "state") int state); |
| | | } |
| | |
| | | import com.mes.bigstorage.entity.BigStorageDTO; |
| | | import com.mes.bigstorage.entity.dto.SlotSequenceDTO; |
| | | import com.mes.bigstorage.entity.dto.TemperingLayoutDTO; |
| | | import com.mes.bigstoragetask.entity.UpdateBigStorageCageDTO; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | public interface BigStorageCageDetailsService extends IService<BigStorageCageDetails> { |
| | | |
| | | List<BigStorageCageDetails> selectTask(int taskType); |
| | | List<BigStorageCageDetails> selectFeedTask(); |
| | | |
| | | List<BigStorageCageDetails> selectOutTask(); |
| | | |
| | | double selectGetBoard(String plcFeedReqLine); |
| | | |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | TemperingLayoutDTO queryTemperingOccupySlot(); |
| | | List<TemperingLayoutDTO> queryTemperingOccupySlot(); |
| | | |
| | | /** |
| | | * 获取版图每个格子的最大最小序号 |
| | |
| | | */ |
| | | List<SlotSequenceDTO> queryGlassMaxAndMin(String engineerId, Integer temperingLayoutId); |
| | | |
| | | boolean TemperingGlass(String temperingLayoutId, String engineerId); |
| | | boolean temperingGlass(String temperingLayoutId, String engineerId); |
| | | |
| | | List<Map<String, Object>> selectTemperingGlass(); |
| | | |
| | | void updateBySlot(List<UpdateBigStorageCageDTO> glassList, int state); |
| | | |
| | | String temperingSwitch(Boolean flag); |
| | | } |
| | |
| | | import cn.hutool.core.lang.Assert; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageOutTask; |
| | | import com.mes.bigstoragetask.entity.UpdateBigStorageCageDTO; |
| | | import com.mes.bigstoragetask.mapper.BigStorageCageFeedTaskMapper; |
| | | import com.mes.bigstoragetask.mapper.BigStorageCageOutTaskMapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.common.utils.RedisUtil; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.mapper.TemperingGlassInfoMapper; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private GlassInfoMapper glassInfoMapper; |
| | | |
| | | @Resource |
| | | private GlassInfoService glassInfoService; |
| | | |
| | | @Resource |
| | | private TemperingGlassInfoService temperingGlassInfoService; |
| | | |
| | | @Resource |
| | | private DamageService damageService; |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | @Value("${mes.minCount}") |
| | | private int minCount; |
| | |
| | | @Value("${mes.glassGap}") |
| | | private Integer glassGap; |
| | | |
| | | /** |
| | | * 查询进/出片任务 |
| | | */ |
| | | @Value("${mes.sequence.order}") |
| | | private boolean sequenceOrder; |
| | | |
| | | |
| | | @Override |
| | | public List<BigStorageCageDetails> selectTask(int taskType) { |
| | | if (taskType == 1) { |
| | | public List<BigStorageCageDetails> selectFeedTask(){ |
| | | //进片任务数据 |
| | | LambdaQueryWrapper<BigStorageCageDetails> feedWrapper = new LambdaQueryWrapper<>(); |
| | | feedWrapper.eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN); |
| | | feedWrapper.eq(BigStorageCageDetails::getState, Const.GLASS_STATE_NEW); |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = baseMapper.selectList(feedWrapper); |
| | | |
| | | LambdaQueryWrapper<BigStorageCageFeedTask> feedTaskWrapper = new LambdaQueryWrapper<>(); |
| | |
| | | .lt(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_SLOT) |
| | | .isNotNull(BigStorageCageFeedTask::getTargetSlot); |
| | | List<BigStorageCageFeedTask> bigStorageCageFeedTaskList = bigStorageCageFeedTaskMapper.selectList(feedTaskWrapper); |
| | | |
| | | Map<String, BigStorageCageFeedTask> listMap = bigStorageCageFeedTaskList.stream() |
| | | .collect(Collectors.toMap(BigStorageCageFeedTask::getGlassId, task -> task)); |
| | | Iterator<BigStorageCageDetails> iterator = bigStorageCageDetailsList.iterator(); |
| | |
| | | BigStorageCageDetails bigStorageCageDetails = iterator.next(); |
| | | BigStorageCageFeedTask bigStorageCageFeedTask = listMap.get(bigStorageCageDetails.getGlassId()); |
| | | bigStorageCageDetails.setBigStorageCageFeedTask(bigStorageCageFeedTask); |
| | | if (bigStorageCageDetails.getBigStorageCageFeedTask() == null) { |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | LambdaQueryWrapper<BigStorageCageFeedTask> feedTaskNoTargetWrapper = new LambdaQueryWrapper<>(); |
| | | feedTaskNoTargetWrapper |
| | | .lt(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_SLOT) |
| | | .isNull(BigStorageCageFeedTask::getTargetSlot); |
| | | List<BigStorageCageFeedTask> bigStorageCageFeedTaskNoTargetList = bigStorageCageFeedTaskMapper.selectList(feedTaskNoTargetWrapper); |
| | | for (BigStorageCageFeedTask bigStorageCageFeedTask : bigStorageCageFeedTaskNoTargetList |
| | | ) { |
| | | BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails(); |
| | | LambdaQueryWrapper<GlassInfo> glassInfoWrapper = new LambdaQueryWrapper<>(); |
| | | glassInfoWrapper.eq(GlassInfo::getGlassId, bigStorageCageFeedTask.getGlassId()); |
| | | GlassInfo glassInfo = glassInfoMapper.selectOne(glassInfoWrapper); |
| | | BeanUtils.copyProperties(glassInfo, bigStorageCageDetails); |
| | | bigStorageCageDetails.setBigStorageCageFeedTask(bigStorageCageFeedTask); |
| | | bigStorageCageDetailsList.add(bigStorageCageDetails); |
| | | } |
| | | return bigStorageCageDetailsList; |
| | | } else { |
| | | //出片任务数据 |
| | | LambdaQueryWrapper<BigStorageCageDetails> outWrapper = new LambdaQueryWrapper<>(); |
| | | outWrapper.eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN); |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = baseMapper.selectList(outWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<BigStorageCageDetails> selectOutTask(){ |
| | | LambdaQueryWrapper<BigStorageCageDetails> outWrapper = new LambdaQueryWrapper<>(); |
| | | outWrapper.in(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT_ING,Const.GLASS_STATE_SCHEDULE_ING); |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = baseMapper.selectList(outWrapper); |
| | | LambdaQueryWrapper<BigStorageCageOutTask> outTaskWrapper = new LambdaQueryWrapper<>(); |
| | | outTaskWrapper.lt(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_SUCCESS); |
| | | List<BigStorageCageOutTask> bigStorageCageOutTaskList = bigStorageCageOutTaskMapper.selectList(outTaskWrapper); |
| | |
| | | BigStorageCageDetails bigStorageCageDetails = iterator.next(); |
| | | BigStorageCageOutTask bigStorageCageOutTask = listMap.get(bigStorageCageDetails.getGlassId()); |
| | | bigStorageCageDetails.setBigStorageCageOutTask(bigStorageCageOutTask); |
| | | if (bigStorageCageDetails.getBigStorageCageOutTask() == null) { |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | return bigStorageCageDetailsList; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 判断当前玻璃是否能上车 |
| | |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .notInSql(BigStorageCage::getSlot, "select distinct slot from big_storage_cage_details where state = 0") |
| | | .inSql(BigStorageCage::getDeviceId, |
| | | "select distinct device_id from big_storage_cage_details where tempering_layout_id = " + glassInfo.getTemperingLayoutId()) |
| | | .last("limit 1")); |
| | |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .notInSql(BigStorageCage::getSlot, "select distinct slot from big_storage_cage_details where state = 0") |
| | | .notInSql(BigStorageCage::getDeviceId, |
| | | "select distinct device_id from big_storage_cage_details where state in (100,102,103)") |
| | | .ge(BigStorageCage::getMaxThickness, glassInfo.getThickness()) |
| | |
| | | } |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .notInSql(BigStorageCage::getSlot, "select distinct slot from big_storage_cage_details where state = 0") |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .ge(BigStorageCage::getMaxThickness, glassInfo.getThickness()) |
| | | .orderByAsc(BigStorageCage::getDeviceId) |
| | |
| | | |
| | | |
| | | @Override |
| | | public TemperingLayoutDTO queryTemperingOccupySlot() { |
| | | public List<TemperingLayoutDTO> queryTemperingOccupySlot() { |
| | | return baseMapper.queryTemperingOccupySlot(minCount); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean TemperingGlass(String temperingLayoutId, String engineerId) { |
| | | public boolean temperingGlass(String temperingLayoutId, String engineerId) { |
| | | LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | temperingGlassInfoLambdaQueryWrapper |
| | | .eq(TemperingGlassInfo::getState,Const.TEMPERING_NEW); |
| | | List<TemperingGlassInfo> temperingGlassInfoList=temperingGlassInfoMapper.selectList(temperingGlassInfoLambdaQueryWrapper); |
| | | |
| | | if(temperingGlassInfoList.size()==0){ |
| | | LambdaQueryWrapper<BigStorageCageDetails> wrapper =new LambdaQueryWrapper<>(); |
| | | wrapper.eq(BigStorageCageDetails::getTemperingLayoutId,temperingLayoutId) |
| | | .eq(BigStorageCageDetails::getEngineerId,engineerId) |
| | | .in(BigStorageCageDetails::getState,Const.GLASS_STATE_IN,Const.GLASS_STATE_ARTIFICIAL); |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList=baseMapper.selectList(wrapper); |
| | | |
| | | for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList |
| | | ) { |
| | | TemperingGlassInfo temperingGlassInfo = new TemperingGlassInfo(); |
| | | LambdaQueryWrapper<GlassInfo> glassInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | glassInfoLambdaQueryWrapper.eq(GlassInfo::getGlassId, bigStorageCageDetails.getGlassId()); |
| | | GlassInfo glassInfo = glassInfoMapper.selectOne(glassInfoLambdaQueryWrapper); |
| | | |
| | | BeanUtils.copyProperties(glassInfo, temperingGlassInfo); |
| | | temperingGlassInfo.setAngle((int) glassInfo.getAngle()); |
| | | temperingGlassInfo.setState(Const.TEMPERING_NEW); |
| | | temperingGlassInfo.setSlot(bigStorageCageDetails.getSlot()); |
| | | temperingGlassInfoMapper.insert(temperingGlassInfo); |
| | | } |
| | | List<TemperingGlassInfo> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlassInfo.class, JoinWrappers.lambda(GlassInfo.class) |
| | | .selectAll(GlassInfo.class) |
| | | .select("-1 as state") |
| | | .selectAs(BigStorageCageDetails::getSlot, TemperingGlassInfo::getSlot) |
| | | .innerJoin(BigStorageCageDetails.class, BigStorageCageDetails::getGlassId, GlassInfo::getGlassId) |
| | | .eq(GlassInfo::getTemperingLayoutId, temperingLayoutId) |
| | | .eq(GlassInfo::getEngineerId, engineerId) |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .orderBy(Boolean.TRUE, sequenceOrder, GlassInfo::getTemperingFeedSequence)); |
| | | if (CollectionUtils.isNotEmpty(temperingGlassInfos)) { |
| | | temperingGlassInfoService.saveBatch(temperingGlassInfos); |
| | | return true; |
| | | } else { |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> selectTemperingGlass(){ |
| | |
| | | List<Map<String, Object>> TemperingGlass = baseMapper.selectMaps(wrapper); |
| | | return TemperingGlass; |
| | | } |
| | | |
| | | @Override |
| | | public void updateBySlot(List<UpdateBigStorageCageDTO> glassList, int state) { |
| | | baseMapper.updateBySlot(glassList, state); |
| | | } |
| | | |
| | | @Override |
| | | public String temperingSwitch(Boolean flag) { |
| | | redisUtil.setCacheObject("temperingSwitch", flag); |
| | | return "success"; |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.bigstoragetask.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/7/26 9:05 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class UpdateBigStorageCageDTO { |
| | | |
| | | private String glassId; |
| | | |
| | | private int targetSlot; |
| | | } |
| | |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.utils.RedisUtil; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | |
| | | private BigStorageCageDetailsService bigStorageCageDetailsService; |
| | | @Resource |
| | | private TemperingGlassInfoService temperingGlassInfoService; |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | private JSONObject jsonObject = new JSONObject(); |
| | | public void queryDataSource1() throws InterruptedException { |
| | |
| | | jsonObject.append("bigStorageCageInfos", bigStorageCageService.querybigStorageCageDetail()); |
| | | |
| | | //进片任务数据 |
| | | List<BigStorageCageDetails> bigStorageCageDetailsFeedTask=bigStorageCageDetailsService.selectTask(1); |
| | | List<BigStorageCageDetails> bigStorageCageDetailsFeedTask=bigStorageCageDetailsService.selectFeedTask(); |
| | | jsonObject.append("bigStorageCageDetailsFeedTask", bigStorageCageDetailsFeedTask); |
| | | |
| | | //出片任务数据 |
| | | List<BigStorageCageDetails> bigStorageCageDetailsOutTask=bigStorageCageDetailsService.selectTask(2); |
| | | List<BigStorageCageDetails> bigStorageCageDetailsOutTask=bigStorageCageDetailsService.selectOutTask(); |
| | | jsonObject.append("bigStorageCageDetailsOutTask", bigStorageCageDetailsOutTask); |
| | | |
| | | //理片笼使用情况 |
| | |
| | | //理片笼表格信息 |
| | | jsonObject.append("bigStorageCageInfo", bigStorageCageService.querybigStorageCageDetailAll()); |
| | | |
| | | //钢化开关 |
| | | boolean temperingSwitch=false; |
| | | if(redisUtil.getCacheObject("temperingSwitch")==null){ |
| | | redisUtil.setCacheObject("temperingSwitch", false); |
| | | }else{ |
| | | temperingSwitch=redisUtil.getCacheObject("temperingSwitch"); |
| | | } |
| | | jsonObject.append("temperingSwitch", temperingSwitch); |
| | | |
| | | } |
| | | |
| | | public void queryDataSource2() throws InterruptedException { |
| | |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageOutTask; |
| | | import com.mes.bigstoragetask.entity.UpdateBigStorageCageDTO; |
| | | import com.mes.bigstoragetask.service.BigStorageCageFeedTaskService; |
| | | import com.mes.bigstoragetask.service.BigStorageCageOutTaskService; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.common.utils.RedisUtil; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.device.PlcParameterObject; |
| | |
| | | private TemperingGlassInfoService temperingGlassInfoService; |
| | | @Resource |
| | | private DamageService damageService; |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | private static final String REQUEST_WORD = "1"; |
| | | |
| | |
| | | String d01Id = plcParameterObject.getPlcParameter("D01ID").getValue(); |
| | | String d04Id = plcParameterObject.getPlcParameter("D04ID").getValue(); |
| | | log.info("1、获取d01Id扫描ID为:{};获取d04Id扫描ID为:{};", d01Id, d04Id); |
| | | //两条线都有进卧转立任务,直接结束 |
| | | // if (StringUtils.isNotBlank(d01Id) && StringUtils.isNotBlank(d04Id)) { |
| | | // log.info("两条线都存在进片任务,结束任务"); |
| | | // return; |
| | | // } |
| | | //获取两条线卧转立是否有玻璃,且任务状态为1/2 |
| | | List<Integer> lineList = bigStorageCageFeedTaskService.querySitToUpGlass(); |
| | | if (CollectionUtils.isEmpty(lineList)) { |
| | |
| | | log.info("大理片笼空车进片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | @Scheduled(fixedDelay = 2000) |
| | | public void plcToHomeEdgOutTask() { |
| | | Date startDate = new Date(); |
| | | log.info("大理片笼空车进片任务开始执行时间:{}", startDate); |
| | | PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject; |
| | | String e02State = plcMesObject.getPlcParameter("E02State").getAddress(); |
| | | String e02State = plcMesObject.getPlcParameter("E02State").getValue(); |
| | | if (REQUEST_WORD.equals(e02State)) { |
| | | log.info("出片忙碌,结束出片任务"); |
| | | return; |
| | | } |
| | | String mesToPLCAddress = plcMesObject.getPlcParameter("MESToPLC").getAddress(); |
| | | List<BigStorageCageOutTask> outingList = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>().eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_NEW)); |
| | | Assert.isTrue(CollectionUtils.isEmpty(outingList), "有正在执行出片的任务,结束当前出片线程"); |
| | | |
| | | List<BigStorageCageOutTask> outingList = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>() |
| | | .eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_NEW)); |
| | | if (CollectionUtils.isNotEmpty(outingList)) { |
| | | log.info("有正在执行出片的任务,结束当前出片线程"); |
| | | return; |
| | | } |
| | | if (redisUtil.getCacheObject("temperingSwitch")) { |
| | | //是否有正在钢化的玻璃 |
| | | List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoService.selectJoinList(TemperingGlassInfo.class, new MPJLambdaWrapper<TemperingGlassInfo>() |
| | | .selectAll(TemperingGlassInfo.class) |
| | |
| | | } |
| | | } |
| | | } |
| | | //未到齐 执行内部调度任务 |
| | | TemperingLayoutDTO temperingOccupySlot = bigStorageCageDetailsService.queryTemperingOccupySlot(); |
| | | if (null != temperingOccupySlot) { |
| | | } |
| | | //执行内部调度任务 |
| | | List<TemperingLayoutDTO> temperingOccupySlotList = bigStorageCageDetailsService.queryTemperingOccupySlot(); |
| | | if (CollectionUtils.isNotEmpty(temperingOccupySlotList)) { |
| | | loop: |
| | | for (TemperingLayoutDTO temperingOccupySlot : temperingOccupySlotList) { |
| | | List<SlotSequenceDTO> slotSequenceList = bigStorageCageDetailsService.queryGlassMaxAndMin(temperingOccupySlot.getEngineerId(), temperingOccupySlot.getTemperingLayoutId()); |
| | | for (int i = 0; i < slotSequenceList.size() - 1; i++) { |
| | | SlotSequenceDTO first = slotSequenceList.get(i); |
| | | SlotSequenceDTO second = slotSequenceList.get(i + 1); |
| | | int slotWidth = carWidth - first.getRemainWidth() - glassGap; |
| | | if (first.getMinSequence() == second.getMaxSequence() + 1 |
| | | && second.getRemainWidth() > slotWidth) { |
| | | && second.getRemainWidth() > slotWidth && slotWidth >= 0) { |
| | | List<BigStorageCageDetails> list = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getSlot, first.getSlot()).eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN)); |
| | | List<BigStorageCageOutTask> outTasks = list.stream().map(e -> new BigStorageCageOutTask(e.getGlassId(), first.getSlot(), second.getSlot(), |
| | | e.getWidth() * 10, e.getHeight() * 10, 0, 0, 1)).collect(Collectors.toList()); |
| | | .eq(BigStorageCageDetails::getSlot, first.getSlot()).eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .orderBy(Boolean.TRUE, sequenceOrder, BigStorageCageDetails::getTemperingFeedSequence)); |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | List<BigStorageCageOutTask> outTasks = new ArrayList<>(); |
| | | int serialNumber = 1; |
| | | for (BigStorageCageDetails item : list) { |
| | | outTasks.add(new BigStorageCageOutTask(item.getGlassId(), first.getSlot(), second.getSlot(), |
| | | item.getWidth() * 10, item.getHeight() * 10, 1, serialNumber++, Const.BIG_STORAGE_OUT_NEW)); |
| | | } |
| | | //新增调度任务 |
| | | bigStorageCageOutTaskService.saveBatch(outTasks); |
| | | |
| | | //更新理片笼详情表调度的后的玻璃位置信息:生成任务后先将玻璃格子位置进行调整,玻璃状态改为调度中,新增调度完成任务,处理调度完成后玻璃状态改为100. |
| | | List<String> glassList = list.stream().map(BigStorageCageDetails::getGlassId).collect(Collectors.toList()); |
| | | bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>().set(BigStorageCageDetails::getState, Const.GLASS_STATE_SCHEDULE_ING) |
| | | .set(BigStorageCageBaseInfo::getSlot, second.getSlot()).in(BigStorageCageDetails::getGlassId, glassList)); |
| | | //两次更新笼子的剩余尺寸:第一次防止有玻璃继续进调度后的笼子,第二次更新:计算格子的实际尺寸 |
| | | // 仅更新调度后的格子信息:起始格子完成后更新:防止调度出片过程中有新玻璃进入, |
| | | updateSlotRemainBySlots(Arrays.asList(second.getSlot())); |
| | | break loop; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //向plc写入确认字 |
| | | int returnData = 0; |
| | | int count = 1; |
| | |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | public void updateInGlassStateTask() { |
| | |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | log.info("2、获取所有正在进片的玻璃信息id:{}", list); |
| | | List<String> glassIds = list.stream().map(String::valueOf).collect(Collectors.toList()); |
| | | List<Object> inSuccessGlassIdsObj = bigStorageCageFeedTaskService.listObjs(new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | .select(BigStorageCageFeedTask::getGlassId).in(BigStorageCageFeedTask::getGlassId, glassIds) |
| | | List<BigStorageCageFeedTask> inSuccessGlass = bigStorageCageFeedTaskService.list(new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | .in(BigStorageCageFeedTask::getGlassId, glassIds) |
| | | .in(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_SLOT)); |
| | | List<String> inSuccessGlassIds = inSuccessGlassIdsObj.stream().map(String::valueOf).collect(Collectors.toList()); |
| | | if (CollectionUtils.isNotEmpty(inSuccessGlassIds)) { |
| | | log.info("3、获取进片已完成的玻璃信息id:{}", inSuccessGlassIds); |
| | | bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>() |
| | | .set(BigStorageCageDetails::getState, Const.GLASS_STATE_IN).in(BigStorageCageDetails::getGlassId, inSuccessGlassIds)); |
| | | log.info("4、大理片笼进片状态已完成已完成的玻璃信息id:{}", inSuccessGlassIds); |
| | | if (CollectionUtils.isNotEmpty(inSuccessGlass)) { |
| | | log.info("3、获取进片已完成的玻璃信息id:{}", inSuccessGlass); |
| | | List<Integer> inSuccessGlassSlot = inSuccessGlass.stream().map(BigStorageCageFeedTask::getTargetSlot).collect(Collectors.toList()); |
| | | List<UpdateBigStorageCageDTO> storageCageDTOList = inSuccessGlass.stream().map(e -> { |
| | | UpdateBigStorageCageDTO storageCageDTO = new UpdateBigStorageCageDTO(); |
| | | BeanUtils.copyProperties(e, storageCageDTO); |
| | | return storageCageDTO; |
| | | }).collect(Collectors.toList()); |
| | | bigStorageCageDetailsService.updateBySlot(storageCageDTOList, Const.GLASS_STATE_IN); |
| | | log.info("4、大理片笼进片状态已完成已完成的玻璃信息id:{}", inSuccessGlass); |
| | | //更新理片笼玻璃尺寸 |
| | | updateSlotRemain(inSuccessGlassIds, Boolean.TRUE); |
| | | updateSlotRemainBySlots(inSuccessGlassSlot); |
| | | log.info("5、大理片笼进片目标格子尺寸更新完成"); |
| | | } |
| | | |
| | |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | log.info("2、获取所有正在出片的玻璃信息id:{}", list); |
| | | List<String> glassIds = list.stream().map(String::valueOf).collect(Collectors.toList()); |
| | | List<Object> outSuccessGlassIdsObj = bigStorageCageOutTaskService.listObjs(new LambdaQueryWrapper<BigStorageCageOutTask>() |
| | | .select(BigStorageCageOutTask::getGlassId).in(BigStorageCageOutTask::getGlassId, glassIds).in(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_ALL)); |
| | | List<String> outSuccessGlassIds = outSuccessGlassIdsObj.stream().map(String::valueOf).collect(Collectors.toList()); |
| | | if (CollectionUtils.isNotEmpty(outSuccessGlassIds)) { |
| | | log.info("3、获取出片已完成的玻璃信息id:{}", outSuccessGlassIdsObj); |
| | | bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>() |
| | | .set(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT).in(BigStorageCageDetails::getGlassId, outSuccessGlassIds)); |
| | | log.info("4、大理片笼出片状态已完成已完成的玻璃信息id:{}", outSuccessGlassIdsObj); |
| | | List<BigStorageCageOutTask> outSuccessGlass = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>() |
| | | .in(BigStorageCageOutTask::getGlassId, glassIds).in(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_ALL)); |
| | | if (CollectionUtils.isNotEmpty(outSuccessGlass)) { |
| | | log.info("3、获取出片已完成的玻璃信息id:{}", outSuccessGlass); |
| | | List<UpdateBigStorageCageDTO> storageCageDTOList = outSuccessGlass.stream().map(e -> { |
| | | UpdateBigStorageCageDTO storageCageDTO = new UpdateBigStorageCageDTO(); |
| | | storageCageDTO.setGlassId(e.getGlassId()); |
| | | storageCageDTO.setTargetSlot(e.getStartSlot()); |
| | | return storageCageDTO; |
| | | }).collect(Collectors.toList()); |
| | | bigStorageCageDetailsService.updateBySlot(storageCageDTOList, Const.GLASS_STATE_OUT); |
| | | List<Integer> outSuccessSlotList = outSuccessGlass.stream().map(BigStorageCageOutTask::getStartSlot).collect(Collectors.toList()); |
| | | log.info("4、大理片笼出片状态已完成已完成的玻璃信息id:{}", outSuccessGlass); |
| | | //更新理片笼玻璃尺寸 |
| | | updateSlotRemain(outSuccessGlassIds, Boolean.FALSE); |
| | | updateSlotRemainBySlots(outSuccessSlotList); |
| | | log.info("5、大理片笼进片目标格子尺寸更新完成"); |
| | | } |
| | | } |
| | | Date endDate = new Date(); |
| | | log.info("end:大理片笼出片完成后更新大理片笼数据任务结束时间:{},共耗时:{}ms,结束任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | public void updateScheduleGlassStateTask() { |
| | | Date startDate = new Date(); |
| | | log.info("1、大理片笼调度完成后更新大理片笼数据任务开始执行时间:{}", startDate); |
| | | //因为大理片笼和调度任务是两个库的数据,所以要分开查找 |
| | | List<Object> list = bigStorageCageDetailsService.listObjs(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .select(BigStorageCageDetails::getGlassId).eq(BigStorageCageDetails::getState, Const.GLASS_STATE_SCHEDULE_ING)); |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | log.info("2、获取所有正在出片的玻璃信息id:{}", list); |
| | | List<String> glassIds = list.stream().map(String::valueOf).collect(Collectors.toList()); |
| | | List<BigStorageCageOutTask> scheduleSuccessGlass = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>() |
| | | .in(BigStorageCageOutTask::getGlassId, glassIds).eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_SUCCESS) |
| | | .notIn(BigStorageCageOutTask::getEndSlot, Const.TEMPERING_OUT_TARGET_POSITION, Const.ARTIFICIAL_OUT_TARGET_POSITION)); |
| | | if (CollectionUtils.isNotEmpty(scheduleSuccessGlass)) { |
| | | log.info("3、获取调度已完成的玻璃信息id:{}", scheduleSuccessGlass); |
| | | List<UpdateBigStorageCageDTO> storageCageDTOList = scheduleSuccessGlass.stream().map(e -> { |
| | | UpdateBigStorageCageDTO storageCageDTO = new UpdateBigStorageCageDTO(); |
| | | storageCageDTO.setGlassId(e.getGlassId()); |
| | | storageCageDTO.setTargetSlot(e.getEndSlot()); |
| | | return storageCageDTO; |
| | | }).collect(Collectors.toList()); |
| | | bigStorageCageDetailsService.updateBySlot(storageCageDTOList, Const.GLASS_STATE_IN); |
| | | List<String> scheduleSuccessGlassIds = scheduleSuccessGlass.stream().map(BigStorageCageOutTask::getGlassId).collect(Collectors.toList()); |
| | | log.info("4、大理片笼出片状态已完成已完成的玻璃信息id:{}", scheduleSuccessGlassIds); |
| | | //更新理片笼玻璃尺寸 |
| | | List<Integer> slotList = scheduleSuccessGlass.stream().map(BigStorageCageOutTask::getStartSlot).distinct().collect(Collectors.toList()); |
| | | slotList.addAll(scheduleSuccessGlass.stream().map(BigStorageCageOutTask::getEndSlot).distinct().collect(Collectors.toList())); |
| | | updateSlotRemainBySlots(slotList); |
| | | log.info("5、大理片笼进片目标格子尺寸更新完成"); |
| | | } |
| | | } |
| | |
| | | log.info("获取进片任务表中破损的玻璃信息{}", inDamageTaskInfoList); |
| | | bigStorageCageFeedTaskService.remove(new LambdaQueryWrapper<BigStorageCageFeedTask>().eq(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_DAMAGE)); |
| | | //理片笼详情表数据状态更新 |
| | | bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>() |
| | | .set(BigStorageCageDetails::getState, Const.GLASS_STATE_DAMAGE).in(BigStorageCageDetails::getGlassId, inDamageTaskInfoList.stream().map(BigStorageCageFeedTask::getGlassId).collect(Collectors.toList()))); |
| | | bigStorageCageDetailsService.remove(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_NEW).in(BigStorageCageDetails::getGlassId, inDamageTaskInfoList.stream().map(BigStorageCageFeedTask::getGlassId).collect(Collectors.toList()))); |
| | | //将破损信息新增入破损表 |
| | | for (BigStorageCageFeedTask bigStorageCageFeedTask : inDamageTaskInfoList) { |
| | | Damage damage = new Damage(); |
| | |
| | | List<String> glassIdList = outDamageTaskInfoList.stream().map(BigStorageCageOutTask::getGlassId).collect(Collectors.toList()); |
| | | //移除钢化下片表数据 |
| | | temperingGlassInfoService.remove(new LambdaQueryWrapper<TemperingGlassInfo>().in(TemperingGlassInfo::getGlassId, glassIdList)); |
| | | //理片笼详情表数据状态更新 |
| | | bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>() |
| | | .set(BigStorageCageDetails::getState, Const.GLASS_STATE_DAMAGE).in(BigStorageCageDetails::getGlassId, glassIdList)); |
| | | //理片笼详情表数据状态删除 |
| | | bigStorageCageDetailsService.remove(new LambdaQueryWrapper<BigStorageCageDetails>().in(BigStorageCageDetails::getGlassId, glassIdList)); |
| | | |
| | | //将破损信息新增入破损表 |
| | | for (BigStorageCageOutTask bigStorageCageOutTask : outDamageTaskInfoList) { |
| | |
| | | BeanUtils.copyProperties(info, cageDetails); |
| | | //2、获取目标格子信息 |
| | | BigStorageDTO bigStorageDTO = bigStorageCageDetailsService.queryTargetSlotByTempering(info); |
| | | //3、更新大理片笼表剩余宽度(更新大理片笼剩余尺寸移到进笼完成后执行) |
| | | // bigStorageCageService.update(new LambdaUpdateWrapper<BigStorageCage>().set(BigStorageCage::getRemainWidth, bigStorageDTO.getWidth() - info.getWidth() - glassGap) |
| | | // .eq(BigStorageCage::getSlot, bigStorageDTO.getSlot())); |
| | | //3、临时更新格子的剩余尺寸:防止相邻玻璃进同一格子造成剩余尺寸不足,玻璃越界的情况,任务完成后再次更新大理片笼表剩余宽度(按照笼内玻璃数量更新大理片笼剩余尺寸) |
| | | bigStorageCageService.update(new LambdaUpdateWrapper<BigStorageCage>().set(BigStorageCage::getRemainWidth, bigStorageDTO.getWidth() - Math.max(info.getWidth(), info.getHeight()) - glassGap) |
| | | .eq(BigStorageCage::getSlot, bigStorageDTO.getSlot())); |
| | | //4、更新进片任务表,目标格子及状态(状态改为2 电气扫到自行处理) 遇到问题:无法批量更新,批量更新无法走指定从库 |
| | | e.setTargetSlot(bigStorageDTO.getSlot()); |
| | | bigStorageCageFeedTaskService.updateById(e); |
| | |
| | | cageDetails.setDeviceId(bigStorageDTO.getDeviceId()); |
| | | cageDetails.setGap(glassGap); |
| | | bigStorageCageDetailsService.save(cageDetails); |
| | | |
| | | } |
| | | sendTaskListToPLC(taskList, line); |
| | | return Boolean.TRUE; |
| | |
| | | for (int i = 1; i <= taskList.size(); i++) { |
| | | s7control.writeWord(plcMesObject.getPlcParameter("StartAddToImport" + i).getAddress(), taskList.get(i - 1).getLine()); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("TargetAddToImport" + i).getAddress(), taskList.get(i - 1).getTargetSlot()); |
| | | log.info("向plc发送第{}片玻璃已完成", i); |
| | | } |
| | | int returnData = 0; |
| | | int count = 1; |
| | |
| | | List<BigStorageCageOutTask> bigStorageCageOutTaskList = new ArrayList<>(); |
| | | //打车剩余尺寸 |
| | | Integer remainWidth = carWidth; |
| | | int trainNumber = 1; |
| | | int serialNumber = 1; |
| | | int maxX = 0; |
| | | for (T e : list) { |
| | | if (bigStorageCageOutTaskList.size() >= outCarMaxSize || e.getWidth() > remainWidth) { |
| | | break; |
| | | int maxLength = Math.max((int) e.getWidth(), (int) e.getHeight()); |
| | | if (bigStorageCageOutTaskList.size() >= outCarMaxSize || maxLength > remainWidth) { |
| | | remainWidth = carWidth; |
| | | trainNumber = trainNumber + 1; |
| | | serialNumber = 1; |
| | | maxX = 0; |
| | | continue; |
| | | } |
| | | remainWidth = remainWidth - (int) e.getWidth() - glassGap; |
| | | remainWidth = remainWidth - maxLength - glassGap; |
| | | if (isTempering) { |
| | | int minLength = Math.min((int) e.getWidth(), (int) e.getHeight()); |
| | | if (maxX + minLength <= xMaxSize) { |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION, |
| | | e.getWidth() * 10, e.getHeight() * 10, 0, 0, 1)); |
| | | e.getWidth() * 10, e.getHeight() * 10, trainNumber, serialNumber++, 1)); |
| | | maxX = Math.max(maxX, e.getXCoordinate()); |
| | | } else { |
| | | break; |
| | | remainWidth = carWidth; |
| | | trainNumber = trainNumber + 1; |
| | | serialNumber = 1; |
| | | maxX = 0; |
| | | continue; |
| | | } |
| | | |
| | | } else { |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.ARTIFICIAL_OUT_TARGET_POSITION, |
| | | e.getWidth() * 10, e.getHeight(), 0, 0, 1)); |
| | | e.getWidth() * 10, e.getHeight(), trainNumber, serialNumber++, 1)); |
| | | } |
| | | |
| | | } |
| | | Assert.isFalse(CollectionUtils.isEmpty(bigStorageCageOutTaskList), "未获取出片数据,结束出片任务"); |
| | | log.info("获取出片任务数据{}条,执行保存", bigStorageCageOutTaskList.size()); |
| | |
| | | bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>() |
| | | .set(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT_ING) |
| | | .in(BigStorageCageDetails::getGlassId, glassIds)); |
| | | //更新笼子内格子的剩余尺寸(移至出片任务完成后) |
| | | // updateSlotRemain(list, glassIds); |
| | | |
| | | int returnData = 0; |
| | | int count = 1; |
| | | while (returnData == 0) { |
| | |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | /** |
| | | * 更新笼子内格子的剩余尺寸 |
| | | * |
| | | * @param taskGlassIds 本次任务出去的玻璃ids |
| | | * @param flag 是否进出片 true 进片 false 出片 |
| | | */ |
| | | public void updateSlotRemain(List<String> taskGlassIds, Boolean flag) { |
| | | //按照玻璃id获取玻璃信息及玻璃的格子号 |
| | | List<BigStorageCageDetails> glassList = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .in(BigStorageCageDetails::getGlassId, taskGlassIds)); |
| | | //获取需要出去/进笼(包括待出去的)的所有玻璃格子号 |
| | | List<Integer> slotList = glassList.stream().map(BigStorageCageDetails::getSlot).distinct().collect(Collectors.toList()); |
| | | public void updateSlotRemainBySlots(List<Integer> slotList) { |
| | | //获取格子内所有的玻璃信息 |
| | | List<BigStorageCageDetails> inSlotGlassList = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .in(BigStorageCageDetails::getSlot, slotList).in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL)); |
| | | //获取待进片/出去的玻璃信息 |
| | | Map<Integer, Double> slotRemainMap = null; |
| | | if (flag) { |
| | | slotRemainMap = inSlotGlassList.stream().filter(e -> taskGlassIds.contains(e.getGlassId())) |
| | | .collect(Collectors.groupingBy(BigStorageCageDetails::getSlot, Collectors.summingDouble(item -> item.getWidth() + glassGap))); |
| | | } else { |
| | | slotRemainMap = inSlotGlassList.stream().filter(e -> !taskGlassIds.contains(e.getGlassId())) |
| | | .collect(Collectors.groupingBy(BigStorageCageDetails::getSlot, Collectors.summingDouble(item -> item.getWidth() + glassGap))); |
| | | } |
| | | //格子内有玻璃的,计算为: 格子的宽度 - (给子内玻璃的尺寸+间距) |
| | | if (CollectionUtils.isNotEmpty(slotRemainMap)) { |
| | | Map<Integer, Double> slotRemainMap = new HashMap<>(); |
| | | //是否存在有格子非空的玻璃 |
| | | if (CollectionUtils.isNotEmpty(inSlotGlassList)) { |
| | | //存在 将格子内的玻璃分别进行更新 |
| | | slotRemainMap = inSlotGlassList.stream() |
| | | .collect(Collectors.groupingBy(BigStorageCageDetails::getSlot, Collectors.summingDouble(item -> Math.max(item.getWidth(), item.getHeight()) + glassGap))); |
| | | slotRemainMap.forEach((e, v) -> { |
| | | bigStorageCageService.update(new LambdaUpdateWrapper<BigStorageCage>().set(BigStorageCage::getRemainWidth, slotWidth - v) |
| | | double remainWidth = slotWidth - v >= 0 ? slotWidth - v : 0; |
| | | bigStorageCageService.update(new LambdaUpdateWrapper<BigStorageCage>().set(BigStorageCage::getRemainWidth, remainWidth) |
| | | .eq(BigStorageCage::getSlot, e)); |
| | | }); |
| | | } |
| | | //只更新进笼完成的状态,如果进笼完成,格子内必定有玻璃,不存在出片后格子内没有玻璃的情况,所有格子尺寸重置,只能存在于出片任务 |
| | | if (!flag) { |
| | | //过滤不存在玻璃的格子 将宽度重置为原始宽度5000 |
| | | Set<Integer> remainSlotList = slotRemainMap.keySet(); |
| | | slotList.removeAll(remainSlotList); |
| | | if (CollectionUtils.isNotEmpty(slotList)) { |
| | | bigStorageCageService.update(new LambdaUpdateWrapper<BigStorageCage>().set(BigStorageCage::getRemainWidth, slotWidth) |
| | | .in(BigStorageCage::getSlot, slotList)); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | public Boolean computeIsRun(int line, String glassId) { |
| | |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | pp: |
| | | url: jdbc:mysql://192.168.1.199:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | pp: |
| | | url: jdbc:mysql://127.0.0.1:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | |
| | | 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: |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: cz |
| | | active: prod |
| | | application: |
| | | name: cacheVerticalGlass |
| | | mybatis-plus: |
| | |
| | | </select> |
| | | |
| | | <select id="queryTemperingOccupySlot" resultMap="temperingLayoutDTO"> |
| | | SELECT TEMPERING_LAYOUT_ID, |
| | | SELECT ENGINEER_ID, |
| | | TEMPERING_LAYOUT_ID, |
| | | COUNT(DISTINCT SLOT) as SLOT_COUNT |
| | | FROM BIG_STORAGE_CAGE_DETAILS |
| | | WHERE STATE = 100 |
| | | GROUP BY ENGINEER_ID, |
| | | TEMPERING_LAYOUT_ID |
| | | HAVING SLOT_COUNT >= #{count} LIMIT 1 |
| | | HAVING SLOT_COUNT >= #{count} |
| | | ORDER BY SLOT_COUNT DESC |
| | | </select> |
| | | <select id="queryGlassMaxAndMin" resultMap="slotSequenceDTO"> |
| | | SELECT T.*, |
| | |
| | | INNER JOIN BIG_STORAGE_CAGE T1 ON T.SLOT = T1.SLOT |
| | | ORDER BY T.MAX_SEQUENCE DESC |
| | | </select> |
| | | |
| | | <update id="updateBySlot"> |
| | | update big_storage_cage_details |
| | | <set> |
| | | state = #{state} |
| | | </set> |
| | | <where> |
| | | (glass_id,slot) in ( |
| | | <foreach collection="list" item="item" separator=","> |
| | | (#{item.glassId}, #{item.targetSlot}) |
| | | </foreach> |
| | | ) |
| | | </where> |
| | | </update> |
| | | </mapper> |