Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
| | |
| | | </el-select> |
| | | <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-option :label="$t('reportmanage.incise')" value="切割"></el-option> |
| | | <el-option :label="$t('reportmanage.edging')" value="磨边"></el-option> |
| | | <el-option :label="$t('reportmanage.steel')" value="钢化"></el-option> |
| | | </el-select> |
| | | <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> |
| | |
| | | const requestData = { |
| | | line: 2001 |
| | | }; |
| | | const timeRange = ref(["2022-01-01", "2025-01-01"]) |
| | | const selectValuesa = reactive({}); |
| | | // request.post("/cacheGlass/taskCache/selectEdgTask",{ |
| | | // ...requestData, |
| | | |
| | |
| | | |
| | | // } |
| | | // }); |
| | | |
| | | // 磨边任务查询 |
| | | const setEdgGlassInfoRequest = async () => { |
| | | |
| | | const response = await request.post("/cacheGlass/edgGlassTaskInfo/setEdgGlassInfoRequest", { |
| | | cellList: [selectValuesa[0]], |
| | | stateList: [selectValuesa[1]], |
| | | beginDate: timeRange.value[0], |
| | | endDate: timeRange.value[1], |
| | | }) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | |
| | | } |
| | | |
| | | // 破损 |
| | | const open = async(row) => { |
| | | try { |
| | |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | tableData.value = data.EdgTasks1[0] |
| | | tableData.value = data.edgTasks[0] |
| | | }; |
| | | onMounted(() => { |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | |
| | | <template> |
| | | <div> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading"> |
| | | <el-select v-model="selectValuesa[0]" filterable :placeholder="$t('请选择线路')" clearable> |
| | | <el-option label="磨边一线" value="2001"></el-option> |
| | | <el-option label="磨边二线" value="2002"></el-option> |
| | | </el-select> |
| | | |
| | | <el-select v-model="selectValuesa[1]" filterable :placeholder="$t('请选择状态')" clearable > |
| | | <el-option label="未磨边" value="0"></el-option> |
| | | <el-option label="磨边中" value="1"></el-option> |
| | | <el-option label="已磨边" value="2"></el-option> |
| | | </el-select> |
| | | <el-date-picker style="margin-left: 10px;" v-model="timeRange" type="daterange" format="YYYY/MM/DD" |
| | | value-format="YYYY-MM-DD" :start-placeholder="$t('reportmanage.starttime')" |
| | | :end-placeholder="$t('reportmanage.endtime')" :default-time="defaultTime" /> |
| | | <el-button type="primary" style="margin-left: 10px;" @click="setEdgGlassInfoRequest()">{{ |
| | | $t('reportmanage.inquire') |
| | | }}</el-button> |
| | | |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table height="240" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="glass_id" align="center" :label="$t('workOrder.glassID')" min-width="180" /> |
| | | <el-table-column prop="glassId" align="center" :label="$t('workOrder.glassID')" min-width="180" /> |
| | | <el-table-column prop="width" align="center" :label="$t('workOrder.width')" min-width="120" /> |
| | | <el-table-column prop="height" align="center" :label="$t('workOrder.height')" min-width="80" /> |
| | | <el-table-column prop="thickness" align="center" :label="$t('workOrder.thickness')" min-width="120" /> |
| | | <el-table-column prop="glass_type" align="center" :label="$t('workOrder.glasstype')" min-width="120" /> |
| | | <el-table-column prop="glassType" align="center" :label="$t('workOrder.glasstype')" min-width="120" /> |
| | | <el-table-column prop="line" align="center" :label="$t('workOrder.line')" min-width="120" /> |
| | | <el-table-column fixed="right" :label="$t('workOrder.operate')" align="center" width="200"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="open(scope.row)">{{ $t('workOrder.breakage') }}</el-button> |
New file |
| | |
| | | <script setup> |
| | | import { useI18n } from 'vue-i18n' |
| | | const { t } = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {useRouter} from "vue-router" |
| | | const router = useRouter() |
| | | import request from "@/utils/request" |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import { ref, onMounted , onBeforeUnmount, reactive, computed,onUnmounted } from "vue"; |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import companyInfo from "@/lang/companyInfo"; |
| | | import QRCode from "qrcode"; |
| | | |
| | | |
| | | const company = companyInfo() |
| | | const printMerge = null |
| | | let props = defineProps({ |
| | | printFlowCardId: null, |
| | | printLayer: null, |
| | | }) |
| | | let produceList = ref([]) |
| | | const handleGetQRCode = async () => { |
| | | for (let i = 0; i < produceList.value.length; i++) { |
| | | const technologyNumber = produceList.value[i].detail[0].technologyNumber.toString(); // 转换为字符串以便处理每个字符 |
| | | produceList.value[i].detail[0]["qrcodeList"] = []; // 初始化一个空数组用来存储 QR Code |
| | | |
| | | for (let j = 0; j < technologyNumber.length; j++) { |
| | | const processId = produceList.value[i].detail[0].process_id; |
| | | const url = `${processId}/${technologyNumber[j]}`; |
| | | |
| | | // 生成 QR Code 并存储到数组中 |
| | | const qrcodeData = await QRCode.toDataURL(url); |
| | | produceList.value[i].detail[0]["qrcodeList"].push({ |
| | | qrcode: qrcodeData, |
| | | technologyNumber: technologyNumber[j] |
| | | }); |
| | | |
| | | } |
| | | } |
| | | }; |
| | | |
| | | |
| | | //根据输入的数量重新汇总 |
| | | const handleSummary = () => { |
| | | for (let i = 0; i < produceList.value.length; i++) { |
| | | //数量 |
| | | let totalQuantity = 0; |
| | | //面积 |
| | | let totalArea = 0; |
| | | //重量 |
| | | let totalWeight = 0; |
| | | // 对每个集合中的 detailList 进行计算 |
| | | produceList.value[i].detailList.forEach(collection => { |
| | | totalQuantity += collection.quantity * 1; |
| | | //每个序号面积 |
| | | collection.total_area = parseFloat((collection.width * collection.height * collection.quantity / 1000000).toFixed(2)) |
| | | totalArea += collection.total_area * 1; |
| | | totalWeight += collection.width * collection.height * collection.quantity / 1000000 * collection.separation * 2.5 * 1; |
| | | //每个序号周长 |
| | | collection.perimeter = parseFloat(((collection.width * 2 + collection.height * 2) * collection.quantity / 1000).toFixed(3)) |
| | | }); |
| | | // 输出每个集合中的总数量 |
| | | produceList.value[i].detail[0].quantity = totalQuantity |
| | | produceList.value[i].detail[0].gross_area = totalArea |
| | | produceList.value[i].detail[0].weight = totalWeight |
| | | } |
| | | } |
| | | |
| | | |
| | | const printFlowCard = () => { |
| | | // 需要打印的局部区域赋予"print-wrap"的id |
| | | let el = document.getElementById("printFlowCard"); |
| | | let doc = document; |
| | | let body = doc.body || doc.getElementsByTagName("body")[0]; |
| | | let printId = "print-" + Date.now(); |
| | | |
| | | // 创建无副作用的打印容器(因不确定页面的打印元素有无其它样式) |
| | | let content = doc.createElement("div"); |
| | | content.id = printId; |
| | | |
| | | // 样式控制与打印无关的元素隐藏 |
| | | let style = doc.createElement("style"); |
| | | style.innerHTML = |
| | | "body>#" + |
| | | printId + |
| | | "{display:none}@media print{" + |
| | | "@page {" + |
| | | " size: auto; " + |
| | | " margin: 0mm 0mm 0mm 0mm; " + |
| | | " }body>:not(#" + |
| | | printId + |
| | | "){display:none !important}body>#" + |
| | | printId + |
| | | "{display:block;padding-top:1px}}"; |
| | | // |
| | | content.innerHTML = el.outerHTML; |
| | | // // console.log("el.outerHTML", el.outerHTML); |
| | | body.appendChild(style); |
| | | |
| | | // 与style元素设置的样式相配合 |
| | | // 把打印内容的元素添加到body(作为body的子元素,可用body的子选择器 '>' 控制打印样式) |
| | | body.appendChild(content); |
| | | setTimeout(() => { |
| | | window.print(); |
| | | body.removeChild(content); |
| | | body.removeChild(style); |
| | | }, 20); |
| | | } |
| | | |
| | | onMounted(async () => { |
| | | |
| | | try { |
| | | const response = await request.post('/unLoadGlass/downGlassInfo/downGlassPrint',{ |
| | | flowCardId:props.printFlowCardId, |
| | | layer:props.printLayer |
| | | }); |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | produceList.value = response.data; |
| | | console.log(produceList.value); |
| | | ElMessage.success(response.message); |
| | | for (let j = 0; j < produceList.value.length; j++) { |
| | | let sumWeight = 0 |
| | | produceList.value[j].detailList.forEach((item, index) => { |
| | | // 解析 separation 字段的 JSON 字符串 |
| | | let separationObj = JSON.parse(item.separation); |
| | | |
| | | // 获取 thickness 的原始值 |
| | | let thicknessValue = separationObj.thickness; |
| | | |
| | | // 去除 'mm' 单位 |
| | | let thicknessWithoutUnit = thicknessValue.replace('mm', ''); |
| | | |
| | | item.separation = thicknessWithoutUnit |
| | | |
| | | sumWeight += item.width * item.height * item.quantity / 1000000 * item.separation * 2.5 * 1; |
| | | |
| | | }); |
| | | produceList.value[j].detail[0].weight = sumWeight |
| | | } |
| | | handleGetQRCode() |
| | | handleSummary() |
| | | // printFlowCard(); |
| | | |
| | | |
| | | |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | }); |
| | | </script> |
| | | <template> |
| | | <div id="printFlowCard"> |
| | | <table v-for="(item,id) in produceList" id="contentTable" :key="id"> |
| | | <thead> |
| | | <tr v-for="(itemFlow,index) in item.detail" :key="index"> |
| | | <td v-if="like='1'" colspan="26"> |
| | | <div style="float: left;"><input style="border: none;font-size: 28px;width: 70px;margin: 5px "/></div> |
| | | <div id="bj" style="float: right;font-size: 28px">{{ id + 1 }}</div> |
| | | <div>{{ company.companyName }}</div> |
| | | <div>生产流程卡</div> |
| | | <div v-if="itemFlow.technologyNumber!=''" style="text-align: right;font-weight: bolder">流程卡号: {{ |
| | | itemFlow.process_id |
| | | }}/{{ itemFlow.technologyNumber }} |
| | | </div> |
| | | <div v-else style="text-align: right;font-weight: bolder">流程卡号: {{ |
| | | itemFlow.process_id |
| | | }}/{{ itemFlow.technologyNumber }} |
| | | </div> |
| | | </td> |
| | | <td v-else colspan="24"> |
| | | <div style="float: left;"><input style="border: none;font-size: 28px;width: 70px "/></div> |
| | | <div id="bj" style="float: right;font-size: 28px">{{ id + 1 }}</div> |
| | | <div>{{ company.companyName }}</div> |
| | | <div>生产流程卡</div> |
| | | <div v-if="itemFlow.technologyNumber!=''" style="text-align: right;font-weight: bolder">流程卡号: {{ |
| | | itemFlow.process_id |
| | | }}/{{ itemFlow.technologyNumber }} 共 {{ flowCardCount }} 架 |
| | | </div> |
| | | <div v-else style="text-align: right;font-weight: bolder">流程卡号: {{ |
| | | itemFlow.process_id |
| | | }}/{{ itemFlow.technologyNumber }} 共 {{ flowCardCount }} 架 |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | <tr v-for="(items,index) in item.detail" :key="index"> |
| | | <td class="tdNowrap">客户名称:</td> |
| | | <td colspan="2">{{ items.customer_name }}</td> |
| | | <td class="tdNowrap">项目名称:</td> |
| | | <td colspan="2">{{ items.project }}</td> |
| | | <td class="tdNowrap">工艺流程:</td> |
| | | <td colspan="19" v-if="like='1'" style="width: 500px">{{ items.process }}</td> |
| | | <td colspan="17" v-else style="width: 500px">{{ items.process }}</td> |
| | | </tr> |
| | | <tr v-for="(itemTr,index) in item.detail" :key="index"> |
| | | <td class="tdNowrap">磨边类型:</td> |
| | | <td colspan="2">{{ itemTr.edging_type }}</td> |
| | | <td class="tdNowrap">单片名称:</td> |
| | | <td colspan="2">{{ itemTr.glass_child }}</td> |
| | | <td class="tdNowrap">产品名称:</td> |
| | | <td v-if="like=='1'" colspan="19">{{ itemTr.product_name }}</td> |
| | | <td v-else colspan="17">{{ itemTr.product_name }}</td> |
| | | </tr> |
| | | <tr> |
| | | <td rowspan='2'>序号</td> |
| | | <td v-if="like!=null" rowspan="2">小片顺序</td> |
| | | <td v-else style="display: none;" rowspan="2">小片顺序</td> |
| | | <td rowspan='2'>宽*高</td> |
| | | <td rowspan='2'>数量</td> |
| | | <td rowspan='2'>落架数</td> |
| | | <td rowspan='2'>面积</td> |
| | | <td rowspan='2'>周长</td> |
| | | <td rowspan='2'>半径</td> |
| | | <td rowspan='2'>备注</td> |
| | | <td v-for="(itemPr,index) in item.processList" :key="index" colspan="2">{{ itemPr.process }}</td> |
| | | </tr> |
| | | <tr> |
| | | |
| | | <td>{{ company.printLabel.printFlowCard.patch }}</td> |
| | | <td>{{ company.printLabel.printFlowCard.lackOf }}</td> |
| | | <td>{{ company.printLabel.printFlowCard.patch }}</td> |
| | | <td>{{ company.printLabel.printFlowCard.lackOf }}</td> |
| | | <td>{{ company.printLabel.printFlowCard.patch }}</td> |
| | | <td>{{ company.printLabel.printFlowCard.lackOf }}</td> |
| | | <td>{{ company.printLabel.printFlowCard.patch }}</td> |
| | | <td>{{ company.printLabel.printFlowCard.lackOf }}</td> |
| | | <td>{{ company.printLabel.printFlowCard.patch }}</td> |
| | | <td>{{ company.printLabel.printFlowCard.lackOf }}</td> |
| | | <td>{{ company.printLabel.printFlowCard.patch }}</td> |
| | | <td>{{ company.printLabel.printFlowCard.lackOf }}</td> |
| | | <td>{{ company.printLabel.printFlowCard.patch }}</td> |
| | | <td>{{ company.printLabel.printFlowCard.lackOf }}</td> |
| | | <td>{{ company.printLabel.printFlowCard.patch }}</td> |
| | | <td>{{ company.printLabel.printFlowCard.lackOf }}</td> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | |
| | | <tr v-for="(itemDatile,index) in item.detailList" :key="index"> |
| | | <td>{{ itemDatile.order_number }}</td> |
| | | <!-- <td>{{ itemDatile.s01Value }}</td> --> |
| | | <td v-if="like=='1'">{{ itemDatile.technology_number }}</td> |
| | | <td v-else style="display: none"></td> |
| | | <td>{{ itemDatile.child_width }}</td> |
| | | <td class="item" style="width: 5%;height: 100%;"> |
| | | <!-- <el-input v-model="itemDatile.quantity" style="border: none" @keyup="handleSummary()"></el-input> --> |
| | | {{ itemDatile.quantity }} |
| | | </td> |
| | | <td class="item" style="width: 5%;height: 100%;"> |
| | | <!-- <el-input v-model="itemDatile.quantity" style="border: none" @keyup="handleSummary()"></el-input> --> |
| | | {{ itemDatile.quantity1 }} |
| | | </td> |
| | | <td>{{ itemDatile.total_area }}</td> |
| | | <td>{{ itemDatile.perimeter }}</td> |
| | | <td>{{ itemDatile.bend_radius }}</td> |
| | | <td>{{ itemDatile.remarks }}</td> |
| | | <td></td> |
| | | <td></td> |
| | | <td></td> |
| | | <td></td> |
| | | <td></td> |
| | | <td></td> |
| | | <td></td> |
| | | <td></td> |
| | | <td></td> |
| | | <td></td> |
| | | <td></td> |
| | | <td></td> |
| | | <td></td> |
| | | <td></td> |
| | | <td></td> |
| | | <td></td> |
| | | </tr> |
| | | </tbody> |
| | | <tfoot> |
| | | <tr style="height: 14px"> |
| | | <td v-for="(itemsum,index) in item.detail" :key="index" colspan="26"> |
| | | 数量: |
| | | <label>{{ itemsum.quantity }}</label> |
| | | 面积: |
| | | <label>{{ parseFloat(itemsum.gross_area.toFixed(2)) }}</label> |
| | | 重量: |
| | | <label>{{ parseFloat(itemsum.weight.toFixed(2)) }}</label> |
| | | </td> |
| | | </tr> |
| | | <tr v-for="(itemtextarea,index) in item.detail" :key="index"> |
| | | <td v-if="like='1'" colspan="4" rowspan="6" style="width: 480px;height: 100px "> |
| | | <div style="width: 100%;height: 100%;"><textarea style="height: 99%;width: 99%;border: none;;font-size: 11px">{{itemtextarea.otherRemarks}}</textarea> |
| | | </div> |
| | | </td> |
| | | <td v-else colspan="6" rowspan="2" style="width: 480px;height: 100px "> |
| | | <!-- <div style="width: 100%;height: 100%"><textarea style="height: 99%;width: 99%;font-size: 11px">{{ itemtextarea.processing_note }}</textarea>--> |
| | | <!-- </div>--> |
| | | <div style="width: 100%;height: 100%;"><textarea style="height: 99%;width: 99%;border: none;;font-size: 11px">{{itemtextarea.otherRemarks}}</textarea> |
| | | </div> |
| | | </td> |
| | | <td colspan="2">完工签名</td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="2">生产日期</td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="2">质检签名</td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | <td colspan="2"></td> |
| | | </tr> |
| | | <tr v-for="(qrCodeItem,index) in item.detail" :key="index"> |
| | | <td colspan="23"> |
| | | <span style="display: flex;"> |
| | | <span v-for="(qrCodeItems,index) in qrCodeItem.qrcodeList" :key="index" style="display: flex;width: 35%"> |
| | | <div class='qrCode' style="width: 80px;height: 80px;"> |
| | | <img :src=qrCodeItems.qrcode> |
| | | </div> |
| | | <span style="float: left;font-weight: bolder">{{ |
| | | qrCodeItem.process_id + "/" + qrCodeItems.technologyNumber |
| | | }}</span> |
| | | </span> |
| | | </span> |
| | | </td> |
| | | |
| | | </tr> |
| | | </tfoot> |
| | | </table> |
| | | </div> |
| | | </template> |
| | | <style scoped> |
| | | * { |
| | | margin: 0; |
| | | padding: 0; |
| | | text-align: center; |
| | | } |
| | | |
| | | |
| | | #printFlowCard { |
| | | text-align: center; |
| | | //font-weight: bolder; height: 600px; |
| | | } |
| | | |
| | | #contentTable { |
| | | border-collapse: collapse; |
| | | border: 1px solid black; |
| | | width: 100%; |
| | | } |
| | | |
| | | #contentTable thead { |
| | | font-size: 13px; |
| | | font-weight: bolder; |
| | | } |
| | | |
| | | #contentTable thead div { |
| | | font-size: 15px; |
| | | font-weight: bolder; |
| | | } |
| | | |
| | | #contentTable tr td { |
| | | border: 1px solid black; |
| | | height: 18px; |
| | | font-weight: bolder; |
| | | } |
| | | |
| | | #contentTable tbody { |
| | | white-space: nowrap; |
| | | |
| | | } |
| | | |
| | | .tdNowrap { |
| | | white-space: nowrap; |
| | | |
| | | } |
| | | |
| | | #contentTable tfoot { |
| | | font-size: 12px; |
| | | font-weight: bolder; |
| | | } |
| | | |
| | | input{ |
| | | font-weight: bolder; |
| | | } |
| | | |
| | | |
| | | @page { |
| | | size: auto; /* auto is the initial value */ |
| | | margin: 2mm 2mm 0mm 1mm /* this affects the margin in the printer settings */ |
| | | |
| | | } |
| | | |
| | | @media print { |
| | | table { |
| | | page-break-before: always; |
| | | page-break-inside: auto; |
| | | } |
| | | |
| | | #contentTable thead { |
| | | display: table-header-group; |
| | | } |
| | | |
| | | tfoot { |
| | | display: table-footer-group; |
| | | page-break-inside: avoid; |
| | | } |
| | | } |
| | | |
| | | .qrCode img { |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | |
| | | </style> |
| | |
| | | <script setup> |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {reactive, onMounted, onBeforeUnmount,onUnmounted} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | import { Search } from "@element-plus/icons-vue"; |
| | | import { reactive, onMounted, onBeforeUnmount, onUnmounted } from "vue"; |
| | | import { useRouter } from "vue-router" |
| | | const router = useRouter() |
| | | import { useI18n } from 'vue-i18n' |
| | | const { t } = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | const { t } = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | import { ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import Landingindication from "./Landingindication.vue"; |
| | | import Landingindicationtwo from "./Landingindicationtwo.vue"; |
| | | import request from "@/utils/request"; |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import { WebSocketHost, host } from '@/utils/constants' |
| | | import PrintFlow from './PrintFlow.vue' |
| | | const dialogFormVisiblea = ref(false) |
| | | const dialogFormVisiblea2 = ref(false) |
| | | const dialogFormVisibleaDownGlass = ref(false) |
| | |
| | | const flowCardId = ref(''); |
| | | const flowCardOptions = ref('[]'); |
| | | const tableData = reactive([]); |
| | | const downGlass= ref([]); |
| | | const downGlass = ref([]); |
| | | const timeRange = ref(["2022-01-01", "2025-01-01"]) |
| | | const selectValuesa = reactive({}); |
| | | const selectOptionsa = ref([]); |
| | | const dialogTableVisible = ref(false) |
| | | const printFlowCardId = ref('') |
| | | const printLayer=ref('') |
| | | |
| | | const handleInputChangea = (value, rowId) => { |
| | | // 更新对应行的 select 值 |
| | | selectValuesa[rowId] = value; |
| | | }; |
| | | // 方法 |
| | | const handleSelectionChange = () => { |
| | | // 处理表格行选择事件 |
| | | }; |
| | | const handleBindRack = (row) => { |
| | | workstationId.value = row.workstationId; // 假设rackNumber是架号字段的属性名 |
| | | console.log(row.flowCardId); |
| | | flowCardId.value = row.flowCardId; |
| | | // 发起接口请求获取流程卡号 |
| | | fetchFlowCardId(); |
| | | fetchFlowCardId(); |
| | | dialogFormVisiblea.value = true; // 打开绑定架子对话框 |
| | | }; |
| | | //获取流程卡号 |
| | |
| | | const response = await request.get('unLoadGlass/downWorkStation/getflowCardId'); |
| | | console.log(response) |
| | | if (response.code === 200) { |
| | | |
| | | flowCardOptions.value = response.data.filter(item => item !== null) |
| | | .map(item => ({ flowcard_id: item.flow_card_id })); |
| | | console.log(flowCardOptions.value); |
| | | } |
| | | else { |
| | | |
| | | flowCardOptions.value = response.data.filter(item => item !== null) |
| | | .map(item => ({ flowcard_id: item.flow_card_id })); |
| | | console.log(flowCardOptions.value); |
| | | } |
| | | else { |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } catch (error) { |
| | |
| | | const handleConfirm = async () => { |
| | | try { |
| | | const firstPart = flowCardId.value.split('|')[0].trim(); // |
| | | const twoPart = flowCardId.value.split('|')[1].trim(); // |
| | | const twoPart = flowCardId.value.split('|')[1].trim(); // |
| | | const response = await request.post('unLoadGlass/downWorkStation/updateFlowCardId', { |
| | | workstationId: workstationId.value, |
| | | flowCardId: firstPart, |
| | | layer:twoPart |
| | | }); |
| | | layer: twoPart |
| | | }); |
| | | console.log(response) |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | console.log('绑定成功'); |
| | | |
| | | |
| | | ElMessage.success(response.message); |
| | | updatePageData(); |
| | | dialogFormVisiblea.value = false; |
| | |
| | | }; |
| | | //清除内容 |
| | | const handleclear = async () => { |
| | | try { |
| | | const response = await request.post('unLoadGlass/downWorkStation/clear', { |
| | | workstationId: workstationId.value, |
| | | }); |
| | | try { |
| | | const response = await request.post('unLoadGlass/downWorkStation/clear', { |
| | | workstationId: workstationId.value, |
| | | }); |
| | | |
| | | console.log(response); |
| | | |
| | | if (response.code === 200) { |
| | | // 清除成功的逻辑 |
| | | console.log('清除成功'); |
| | | ElMessage.success(response.message); |
| | | dialogFormVisiblea2.value = false; |
| | | } else if (response.code === 500) { |
| | | // 清除失败的逻辑 |
| | | console.log('清除失败'); |
| | | console.log(response.message); // 打印服务器返回的错误信息 |
| | | ElMessage.error(response.message); |
| | | dialogFormVisiblea2.value = false; |
| | | } |
| | | } catch (error) { |
| | | // console.log(error); |
| | | ElMessage.error("清除失败"); |
| | | dialogFormVisiblea2.value = false; |
| | | if (response.code === 200) { |
| | | // 清除成功的逻辑 |
| | | console.log('清除成功'); |
| | | ElMessage.success(response.message); |
| | | dialogFormVisiblea2.value = false; |
| | | } else if (response.code === 500) { |
| | | // 清除失败的逻辑 |
| | | console.log('清除失败'); |
| | | console.log(response.message); // 打印服务器返回的错误信息 |
| | | ElMessage.error(response.message); |
| | | dialogFormVisiblea2.value = false; |
| | | } |
| | | } catch (error) { |
| | | // console.log(error); |
| | | ElMessage.error("清除失败"); |
| | | dialogFormVisiblea2.value = false; |
| | | } |
| | | }; |
| | | // 发送获取表格数据的请求 |
| | | const fetchTableData = async () => { |
| | |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | if(data.sendDownGlass!=null){ |
| | | downGlass.value=data.sendDownGlass[0][1]; |
| | | console.log(downGlass.value); |
| | | console.log(tableData.value); |
| | | if (data.downGlassInfos != null) { |
| | | downGlass.value = data.downGlassInfos[0][1]; |
| | | } |
| | | if (data.engineerIdList != null) { |
| | | selectOptionsa.value = data.engineerIdList[0] |
| | | } |
| | | |
| | | // tableData.splice(0, tableData.length, ...data.params[0]); |
| | | |
| | | // console.log("更新后数据", data.params[0]); |
| | | // console.log("更新后数据", data.params[0]); |
| | | }; |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | onMounted(() => { |
| | |
| | | fetchTableData(); // 获取数据 |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | |
| | | |
| | | const getTagType =(status) => { |
| | | return status === 1 ? 'success' : 'danger'; |
| | | // 根据状态值决定标签类型,这里假设状态为1时为成功(绿色),否则为失败(红色) |
| | | } |
| | | |
| | | const toggleStatus = (row) => { |
| | | // 切换料架状态的逻辑 |
| | | row.enableState = 1 - row.enableState; // Toggle between 0 and 1 |
| | | // 此处可以添加保存状态的逻辑,比如调用 API 更新数据 |
| | | updateRowStatus(row); |
| | | }; |
| | | |
| | | const updateRowStatus = async (row) => { |
| | | const getTagType = (status) => { |
| | | return status === 1 ? 'success' : 'danger'; |
| | | // 根据状态值决定标签类型,这里假设状态为1时为成功(绿色),否则为失败(红色) |
| | | } |
| | | |
| | | const toggleStatus = (row) => { |
| | | // 切换料架状态的逻辑 |
| | | row.enableState = 1 - row.enableState; // Toggle between 0 and 1 |
| | | // 此处可以添加保存状态的逻辑,比如调用 API 更新数据 |
| | | updateRowStatus(row); |
| | | }; |
| | | |
| | | const updateRowStatus = async (row) => { |
| | | try { |
| | | // 假设你的后端 API 接收 PUT 请求,并且需要传递 row.id 和 row.enableState 参数 |
| | | |
| | | |
| | | |
| | | |
| | | const response = await request.post('unLoadGlass/downWorkStation/updateDownWorkstation', { |
| | | enableState: row.enableState, |
| | | id: row.id |
| | | |
| | | |
| | | }); |
| | | |
| | | }); |
| | | console.log('Updated row status:', response.data); |
| | | // 可以根据后端返回的数据进行进一步处理,比如更新本地状态等 |
| | | } catch (error) { |
| | |
| | | // 处理错误情况,比如提示用户更新失败 |
| | | } |
| | | }; |
| | | |
| | | // 查询数据 |
| | | const selectDownGlassData = async () => { |
| | | |
| | | const response = await request.post("/unLoadGlass/downGlassInfo/selectDownGlassInfo", { |
| | | workStationId: selectValuesa[0], |
| | | engineerId: selectValuesa[1], |
| | | beginDate: timeRange.value[0], |
| | | endDate: timeRange.value[1], |
| | | }) |
| | | if (response.code === 200) { |
| | | sendDownGlass.value = response.data; |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | const open=async(row)=>{ |
| | | |
| | | printFlowCardId.value=row.flowCardId; |
| | | printLayer.value=row.layer |
| | | dialogTableVisible.value = true; |
| | | setTimeout(() => { |
| | | printFlowCard(); // 替换成你要执行的函数名 |
| | | }, 1000); |
| | | ; |
| | | } |
| | | |
| | | const printFlowCard = () => { |
| | | // 需要打印的局部区域赋予"print-wrap"的id |
| | | let el = document.getElementById("child"); |
| | | let doc = document; |
| | | let body = doc.body || doc.getElementsByTagName("body")[0]; |
| | | let printId = "print-" + Date.now(); |
| | | |
| | | // 创建无副作用的打印容器(因不确定页面的打印元素有无其它样式) |
| | | let content = doc.createElement("div"); |
| | | content.id = printId; |
| | | |
| | | // 样式控制与打印无关的元素隐藏 |
| | | let style = doc.createElement("style"); |
| | | style.innerHTML = |
| | | "body>#" + |
| | | printId + |
| | | "{display:none}@media print{" + |
| | | "@page {" + |
| | | " size: auto; " + |
| | | " margin: 2mm 2mm 0mm 1mm; " + |
| | | " }body>:not(#" + |
| | | printId + |
| | | "){display:none !important}body>#" + |
| | | printId + |
| | | "{display:block;padding-top:1px}}"; |
| | | // |
| | | content.innerHTML = el.outerHTML; |
| | | // // console.log("el.outerHTML", el.outerHTML); |
| | | body.appendChild(style); |
| | | |
| | | // 与style元素设置的样式相配合 |
| | | // 把打印内容的元素添加到body(作为body的子元素,可用body的子选择器 '>' 控制打印样式) |
| | | body.appendChild(content); |
| | | setTimeout(() => { |
| | | window.print(); |
| | | body.removeChild(content); |
| | | body.removeChild(style); |
| | | }, 20); |
| | | } |
| | | |
| | | |
| | | // beforeUnmount(() => { |
| | | // closeWebSocket(); |
| | | // }); |
| | |
| | | </script> |
| | | <template> |
| | | <div> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;margin-bottom: 5px;" id="searchButton" type="primary" @click="dialogFormVisibleaDownGlass = true">落架详情</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="primary" |
| | | @click="dialogFormVisibleaDownGlass = true">落架详情</el-button> |
| | | <el-card style="flex: 1;" v-loading="loading"> |
| | | <el-card style="flex: 1;margin-left: 4px;margin-top: 1px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table height="200px" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="workstationId" align="center" :label="$t('reportWork.lowerbit')" min-width="80" /> |
| | | <el-table-column prop="workstationId" align="center" :label="$t('reportWork.shelfnumber')" min-width="120" /> |
| | | <el-table-column prop="flowCardId" align="center" :label="$t('reportWork.cardnumber')" min-width="150" /> |
| | | <el-table-column prop="totalQuantity" align="center" :label="$t('reportWork.totalquantity')" min-width="120" /> |
| | | <el-table-column prop="racksNumber" align="center" :label="$t('reportWork.beendropped')" min-width="120" /> |
| | | <el-table-column prop="layer" align="center" label="层数" min-width="120" /> |
| | | <el-table-column prop="otherNumber" align="center" label="人工下片数" min-width="120" /> |
| | | <!-- <el-table-column prop="work_state" align="center" :label="$t('reportWork.state')" min-width="120" /> --> |
| | | <el-table-column prop="deviceId" align="center" :label="$t('reportWork.devicenumber')" min-width="120" /> |
| | | <el-table-column |
| | | align="center" |
| | | :label="$t('reportWork.startstatus')" |
| | | min-width="80" |
| | | prop="enableState" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag :type="getTagType(scope.row.enableState)" @click="toggleStatus(scope.row)"> |
| | | {{ scope.row.enableState === 1 ? $t('reportWork.enable') : $t('reportWork.unenable') }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" :label="$t('reportWork.operate')" align="center" width="200"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain v-show="scope.row.enableState !== '已启用' " @click="handleBindRack(scope.row)">{{ $t('reportWork.bindingshelves') }}</el-button> |
| | | <el-button size="mini" type="text" plain @click="handleBindRack2(scope.row)">{{ $t('reportWork.clear') }}</el-button> |
| | | </template> |
| | | |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisibleaDownGlass" top="8vh" width="80%" :title="$t('searchOrder.cageinformation')"> |
| | | <el-table height="200px" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="downGlass" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="workStationId" align="center" :label="$t('工位号')" min-width="80" /> |
| | | <el-table-column prop="engineerId" align="center" :label="$t('工程号')" min-width="80" /> |
| | | <el-table-column prop="flowCardId" align="center" :label="$t('流程卡号')" min-width="80" /> |
| | | <el-table-column prop="layer" align="center" :label="$t('层')" min-width="120" /> |
| | | <el-table-column prop="sequence" align="center" :label="$t('顺序')" min-width="150" /> |
| | | <el-table-column prop="width" align="center" :label="$t('宽')" min-width="120" /> |
| | | <el-table-column prop="height" align="center" :label="$t('高')" min-width="120" /> |
| | | <el-table-column prop="Filmsid" align="center" :label="$t('膜系')" min-width="120" /> |
| | | <el-table-column prop="thickness" align="center" label="厚度" min-width="120" /> |
| | | <el-table-column prop="glassId" align="center" :label="$t('玻璃id')" min-width="120" /> |
| | | |
| | | </el-table> |
| | | </el-dialog> |
| | | |
| | | </el-card> |
| | | <!-- workstationId: '1', |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table height="200px" ref="table" @selection-change="handleSelectionChange" :data="tableData" |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }"> |
| | | <el-table-column prop="workstationId" align="center" :label="$t('reportWork.lowerbit')" min-width="80" /> |
| | | <el-table-column prop="workstationId" align="center" :label="$t('reportWork.shelfnumber')" |
| | | min-width="120" /> |
| | | <el-table-column prop="flowCardId" align="center" :label="$t('reportWork.cardnumber')" min-width="150" /> |
| | | <el-table-column prop="totalQuantity" align="center" :label="$t('reportWork.totalquantity')" |
| | | min-width="120" /> |
| | | <el-table-column prop="racksNumber" align="center" :label="$t('reportWork.beendropped')" min-width="120" /> |
| | | <el-table-column prop="layer" align="center" label="层数" min-width="120" /> |
| | | <el-table-column prop="otherNumber" align="center" label="人工下片数" min-width="120" /> |
| | | <!-- <el-table-column prop="work_state" align="center" :label="$t('reportWork.state')" min-width="120" /> --> |
| | | <el-table-column prop="deviceId" align="center" :label="$t('reportWork.devicenumber')" min-width="120" /> |
| | | <el-table-column align="center" :label="$t('reportWork.startstatus')" min-width="80" prop="enableState"> |
| | | <template #default="scope"> |
| | | <el-tag :type="getTagType(scope.row.enableState)" @click="toggleStatus(scope.row)"> |
| | | {{ scope.row.enableState === 1 ? $t('reportWork.enable') : $t('reportWork.unenable') }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" :label="$t('reportWork.operate')" align="center" width="200"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain v-show="scope.row.enableState !== '已启用'" |
| | | @click="handleBindRack(scope.row)">{{ $t('reportWork.bindingshelves') }}</el-button> |
| | | <el-button size="mini" type="text" plain @click="handleBindRack2(scope.row)">{{ $t('reportWork.clear') |
| | | }}</el-button> |
| | | <el-button @click="open(scope.row)" :disabled="scope.row.flowCardId==null">打印</el-button> |
| | | </template> |
| | | |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisibleaDownGlass" top="2vh" width="97%" |
| | | :title="$t('searchOrder.cageinformation')"> |
| | | <el-select v-model="selectValuesa[0]" filterable :placeholder="$t('请选择工位')" clearable> |
| | | <el-option label="全部" value="0"></el-option> |
| | | <el-option label="1" value="1"></el-option> |
| | | <el-option label="2" value="2"></el-option> |
| | | <el-option label="3" value="3"></el-option> |
| | | <el-option label="4" value="4"></el-option> |
| | | <el-option label="5" value="5"></el-option> |
| | | <el-option label="6" value="6"></el-option> |
| | | <el-option label="7" value="7"></el-option> |
| | | <el-option label="8" value="8"></el-option> |
| | | <el-option label="9" value="9"></el-option> |
| | | <el-option label="10" value="10"></el-option> |
| | | </el-select> |
| | | |
| | | <el-select v-model="selectValuesa[1]" filterable :placeholder="$t('basicData.plselectproject')" clearable |
| | | @input="handleInputChangea($event, row.id)"> |
| | | <el-option v-for="item in selectOptionsa" :key="item" :label="item" :value="item" /> |
| | | </el-select> |
| | | <el-date-picker style="margin-left: 10px;" v-model="timeRange" type="daterange" format="YYYY/MM/DD" |
| | | value-format="YYYY-MM-DD" :start-placeholder="$t('reportmanage.starttime')" |
| | | :end-placeholder="$t('reportmanage.endtime')" :default-time="defaultTime" /> |
| | | <el-button type="primary" style="margin-left: 10px;" @click="selectDownGlassData()">{{ |
| | | $t('reportmanage.inquire') |
| | | }}</el-button> |
| | | <el-table height="200px" ref="table" @selection-change="handleSelectionChange" :data="downGlass" |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }"> |
| | | <el-table-column prop="workStationId" align="center" :label="$t('工位号')" min-width="80" /> |
| | | <el-table-column prop="engineerId" align="center" :label="$t('工程号')" min-width="80" /> |
| | | <el-table-column prop="flowCardId" align="center" :label="$t('流程卡号')" min-width="80" /> |
| | | <el-table-column prop="layer" align="center" :label="$t('层')" min-width="120" /> |
| | | <el-table-column prop="sequence" align="center" :label="$t('顺序')" min-width="150" /> |
| | | <el-table-column prop="width" align="center" :label="$t('宽')" min-width="120" /> |
| | | <el-table-column prop="height" align="center" :label="$t('高')" min-width="120" /> |
| | | <el-table-column prop="Filmsid" align="center" :label="$t('膜系')" min-width="120" /> |
| | | <el-table-column prop="thickness" align="center" label="厚度" min-width="120" /> |
| | | <el-table-column prop="glassId" align="center" :label="$t('玻璃id')" min-width="120" /> |
| | | |
| | | </el-table> |
| | | </el-dialog> |
| | | |
| | | </el-card> |
| | | <!-- workstationId: '1', |
| | | workstationId: '1005', |
| | | flowCardId: '183.6', |
| | | totalquantity: '1991', |
| | | racksnumber:"1", |
| | | work_state: '待识别', --> |
| | | <div style="display: flex;" class="awatch"> |
| | | <div id="main-body"> |
| | | <Landingindication></Landingindication> |
| | | </div> |
| | | <div id="main-bodya"> |
| | | <Landingindicationtwo></Landingindicationtwo> |
| | | </div> |
| | | </div> |
| | | <div style="display: flex;" class="awatch"> |
| | | <div id="main-body"> |
| | | <Landingindication></Landingindication> |
| | | </div> |
| | | <div id="main-bodya"> |
| | | <Landingindicationtwo></Landingindicationtwo> |
| | | </div> |
| | | </div> |
| | | </el-card> |
| | | |
| | | |
| | | </div> |
| | | |
| | | <el-dialog v-model="dialogFormVisiblea" top="21vh" width="40%" :title="$t('reportWork.bindingshelves')"> |
| | | <el-dialog v-model="dialogFormVisiblea" top="21vh" width="40%" :title="$t('reportWork.bindingshelves')"> |
| | | <div style="margin-left: 50px;margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form size="mini" label-width="100px"> |
| | | <el-form label-width="210px" label-position="right"> |
| | | <el-form size="mini" label-width="100px"> |
| | | <el-form label-width="210px" label-position="right"> |
| | | <el-form-item :label="$t('reportWork.shelfnumbera')" :required="true" style="width: 25vw"> |
| | | <el-input v-model="workstationId" autocomplete="off"/> |
| | | <el-input v-model="workstationId" autocomplete="off" /> |
| | | </el-form-item> |
| | | <el-form-item :label="$t('reportWork.cardnumbera')" :required="true" style="width: 25vw;"> |
| | | <el-select v-model="flowCardId" :placeholder="$t('reportWork.incardnumber')"> |
| | | <el-option v-for="item in flowCardOptions" :key="item.flowcard_id" :label="item.flowcard_id" :value="item.flowcard_id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-select v-model="flowCardId" :placeholder="$t('reportWork.incardnumber')"> |
| | | <el-option v-for="item in flowCardOptions" :key="item.flowcard_id" :label="item.flowcard_id" |
| | | :value="item.flowcard_id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-form> |
| | | </div> |
| | | <template #footer> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <el-dialog |
| | | id="sizePrintCalrd" |
| | | v-model="dialogTableVisible" |
| | | destroy-on-close |
| | | style="width: 75%;height:75% "> |
| | | <!-- <template #header="{ close, titleId, titleClass }"> |
| | | <el-button @click="printFlowCard" >打印</el-button> |
| | | </template> --> |
| | | <print-flow |
| | | id="child" |
| | | :printFlowCardId="printFlowCardId" |
| | | :printLayer="printLayer" |
| | | style="width: 100%;height: 100%"/> |
| | | </el-dialog> |
| | | |
| | | </template> |
| | | <style scoped> |
| | | #dt { display:block; float:left;line-height: 20px;margin-left: 100px;} |
| | | #dta { display:block; float:left;line-height: 20px;margin-left: 80%;} |
| | | #dialog-footer{ |
| | | #dt { |
| | | display: block; |
| | | float: left; |
| | | line-height: 20px; |
| | | margin-left: 100px; |
| | | } |
| | | |
| | | #dta { |
| | | display: block; |
| | | float: left; |
| | | line-height: 20px; |
| | | margin-left: 80%; |
| | | } |
| | | |
| | | #dialog-footer { |
| | | text-align: center; |
| | | margin-top: -15px; |
| | | } |
| | | #message{ |
| | | |
| | | #message { |
| | | text-align: center; |
| | | align-items: center; |
| | | color: black; |
| | | width: 200px; |
| | | height: 100px; |
| | | background-color: #337ecc; |
| | | margin-left: 28%; |
| | | width: 200px; |
| | | height: 100px; |
| | | background-color: #337ecc; |
| | | margin-left: 28%; |
| | | } |
| | | .awatch{ |
| | | |
| | | .awatch { |
| | | max-width: 100%; |
| | | } |
| | | #main-body{ |
| | | |
| | | #main-body { |
| | | margin-top: -40px; |
| | | margin-left: 150px; |
| | | } |
| | | #main-bodya{ |
| | | |
| | | #main-bodya { |
| | | margin-top: -40px; |
| | | margin-left: 100px; |
| | | } |
| | | |
| | | :deep(#sizePrintCalrd .el-dialog__body) { |
| | | height: 85%; |
| | | width: 100%; |
| | | overflow-y: auto; |
| | | } |
| | | </style> |
| | |
| | | public static final Integer GLASS_STATE_SCHEDULE_ING = 104; |
| | | public static final Integer GLASS_STATE_DAMAGE = 8; |
| | | public static final Integer GLASS_STATE_TAKE = 9; |
| | | public static final List<Integer> GLASS_STATE_DAMAGE_TAKE = Arrays.asList(8, 9); |
| | | public static final List<Integer> GLASS_STATE_IN_ALL = Arrays.asList(100, 102, 103, 104); |
| | | public static final List<Integer> GLASS_STATE_IN_ALL_ZERO = Arrays.asList(0, 100, 102, 103, 104); |
| | | |
| | |
| | | package com.mes.damage.service; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.damage.entity.Damage; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | void submitDamage(List<Damage> damageList); |
| | | |
| | | /** |
| | | * 单个破损 |
| | | * |
| | | * @param damage |
| | | */ |
| | | void insertDamage(Damage damage); |
| | | |
| | | /** |
| | | * 批量破损 |
| | | * |
| | | * @param damageList |
| | | */ |
| | | void batchInsertDamage(List<Damage> damageList); |
| | | } |
| | |
| | | package com.mes.damage.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.mapper.DamageMapper; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | 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.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | damage.setOrderNumber(glassInfo.getGlassType()); |
| | | damage.setTechnologyNumber(glassInfo.getLayer()); |
| | | damage.setDamageTime(Timestamp.valueOf(LocalDateTime.now())); |
| | | damage.setType(2); |
| | | baseMapper.insert(damage); |
| | | } |
| | | |
| | | /** |
| | | * 添加报工信息 |
| | | */ |
| | | @Override |
| | | public void batchInsertDamage(List<Damage> damageList) { |
| | | WorkAssignment workAssignment = workAssignmentMapper.selectOne(new LambdaQueryWrapper<WorkAssignment>() |
| | | .eq(WorkAssignment::getLine, damageList.get(0).getLine()) |
| | | .eq(WorkAssignment::getWorkProcesses, damageList.get(0).getWorkingProcedure())); |
| | | |
| | | List<String> glassList = damageList.stream().map(Damage::getGlassId).collect(Collectors.toList()); |
| | | List<GlassInfo> glassInfoList = glassInfoMapper.selectList(new LambdaQueryWrapper<GlassInfo>().in(GlassInfo::getGlassId, glassList)); |
| | | Map<String, List<GlassInfo>> listMap = glassInfoList.stream().collect(Collectors.groupingBy(GlassInfo::getGlassId)); |
| | | for (Damage damage : damageList) { |
| | | GlassInfo glassInfo = listMap.get(damage.getGlassId()).get(0); |
| | | BeanUtils.copyProperties(glassInfo, damage); |
| | | if (workAssignment != null) { |
| | | damage.setTeamsGroupsName(workAssignment.getTeamsGroupsName()); |
| | | damage.setDeviceName(workAssignment.getDeviceName()); |
| | | } |
| | | damage.setProcessId(glassInfo.getFlowCardId()); |
| | | damage.setOrderNumber(glassInfo.getGlassType()); |
| | | damage.setTechnologyNumber(glassInfo.getLayer()); |
| | | damage.setDamageTime(Timestamp.valueOf(LocalDateTime.now())); |
| | | } |
| | | this.saveBatch(damageList); |
| | | } |
| | | } |
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-08-07 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/flow_card/flow-card") |
| | | public class FlowCardController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.pp.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.time.LocalDateTime; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class FlowCard implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * (工程号,2024.0302天机) |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 销售单号 |
| | | */ |
| | | private String orderId; |
| | | |
| | | /** |
| | | * 生产订单号 |
| | | */ |
| | | private String productionId; |
| | | |
| | | /** |
| | | * 流程卡号 |
| | | */ |
| | | private String processId; |
| | | |
| | | /** |
| | | * 落架顺序 |
| | | */ |
| | | private String landingSequence; |
| | | |
| | | /** |
| | | * 序号 |
| | | */ |
| | | private Integer orderNumber; |
| | | |
| | | /** |
| | | * 工艺确认序号 |
| | | */ |
| | | private Integer technologyNumber; |
| | | |
| | | /** |
| | | * 分架数量 |
| | | */ |
| | | private Integer quantity; |
| | | |
| | | /** |
| | | * 以优化数量 |
| | | */ |
| | | private Integer optimizeQuantity; |
| | | |
| | | /** |
| | | * 排版状态(默认0,1允许排版2优化占用) |
| | | */ |
| | | private Integer layoutStatus; |
| | | |
| | | /** |
| | | * 补片数量 |
| | | */ |
| | | private Integer numberPatches; |
| | | |
| | | /** |
| | | * 最后工序报工 库存数量 |
| | | */ |
| | | private Integer inventoryQuantity; |
| | | |
| | | /** |
| | | * 已入数量 |
| | | */ |
| | | private Integer receivedQuantity; |
| | | |
| | | /** |
| | | * 补片编号 |
| | | */ |
| | | private String patchId; |
| | | |
| | | /** |
| | | * 工程占用状态,0为占用1占用 |
| | | */ |
| | | private Integer engineeringOccupancy; |
| | | |
| | | /** |
| | | * 工程号(2024.0302添加) |
| | | */ |
| | | private String projectNo; |
| | | |
| | | /** |
| | | * 包装前工序报工 库存数量 |
| | | */ |
| | | private Integer inventoryNumber; |
| | | |
| | | /** |
| | | * 入库时间 |
| | | */ |
| | | private LocalDateTime storageTime; |
| | | |
| | | /** |
| | | * 生产终止状态(默认0,1生产终止) |
| | | */ |
| | | private Integer terminationStatus; |
| | | |
| | | /** |
| | | * 打印状态 |
| | | */ |
| | | private Integer printStatus; |
| | | |
| | | /** |
| | | * 备用键 |
| | | */ |
| | | private Integer alternateKey; |
| | | |
| | | /** |
| | | * 分架员 |
| | | */ |
| | | private String founder; |
| | | |
| | | /** |
| | | * 分架时间 |
| | | */ |
| | | @TableField("splitFrame_time") |
| | | private LocalDateTime splitframeTime; |
| | | |
| | | /** |
| | | * 层数 |
| | | */ |
| | | private Integer layersNumber; |
| | | |
| | | /** |
| | | * 流程卡打印排序 |
| | | */ |
| | | private Integer sort; |
| | | |
| | | /** |
| | | * 建立时间 |
| | | */ |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | private LocalDateTime updateTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.pp.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.mes.pp.entity.FlowCard; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import feign.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-08-07 |
| | | */ |
| | | @DS("pp") |
| | | public interface FlowCardMapper extends BaseMapper<FlowCard> { |
| | | |
| | | List<Map<String, Object>> selectProject(@Param("processId") String processId,@Param("technologyNumber") Integer technologyNumber); |
| | | |
| | | List<Map<String, Object>> selectFlowCard(@Param("processId") String processId,@Param("technologyNumber") Integer technologyNumber); |
| | | } |
New file |
| | |
| | | package com.mes.pp.service; |
| | | |
| | | import com.mes.pp.entity.FlowCard; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-08-07 |
| | | */ |
| | | public interface FlowCardService extends IService<FlowCard> { |
| | | |
| | | List<Map<String, Object>> selectProject(String processId, Integer technologyNumber); |
| | | |
| | | List<Map<String, Object>> selectFlowCard(String processId, Integer technologyNumber); |
| | | } |
New file |
| | |
| | | package com.mes.pp.service.impl; |
| | | |
| | | import com.mes.pp.entity.FlowCard; |
| | | import com.mes.pp.mapper.FlowCardMapper; |
| | | import com.mes.pp.service.FlowCardService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Service |
| | | public class FlowCardServiceImpl extends ServiceImpl<FlowCardMapper, FlowCard> implements FlowCardService { |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> selectProject(String processId, Integer technologyNumber){ |
| | | return baseMapper.selectProject(processId,technologyNumber); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> selectFlowCard(String processId, Integer technologyNumber){ |
| | | return baseMapper.selectFlowCard(processId, technologyNumber); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.mes.base.entity.BigStorageCageBaseInfo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | */ |
| | | @ApiModelProperty(value = "工程id", position = 17) |
| | | private String engineerId; |
| | | |
| | | @TableLogic |
| | | private int deleted; |
| | | } |
| | |
| | | |
| | | // 3、数据源配置 |
| | | DataSourceConfig dsc = new DataSourceConfig(); |
| | | dsc.setUrl("jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8"); |
| | | dsc.setUrl("jdbc:mysql://localhost:3306/pp?serverTimezone=GMT%2b8"); |
| | | dsc.setDriverName("com.mysql.cj.jdbc.Driver"); |
| | | dsc.setUsername("root"); |
| | | dsc.setPassword("beibo.123/"); |
| | |
| | | // 4、包配置 |
| | | PackageConfig pc = new PackageConfig(); |
| | | pc.setParent("com.mes"); |
| | | pc.setModuleName("work_assignment"); //模块名 |
| | | pc.setModuleName("flow_card"); //模块名 |
| | | pc.setController("controller"); |
| | | pc.setService("service"); |
| | | pc.setMapper("mapper"); |
| | |
| | | // 5、策略配置 |
| | | StrategyConfig strategy = new StrategyConfig(); |
| | | |
| | | strategy.setInclude("work_assignment"); |
| | | strategy.setInclude("flow_card"); |
| | | |
| | | strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略 |
| | | |
New file |
| | |
| | | mybatis-plus-join: |
| | | sub-table-logic: true |
| | | mybatis-plus: |
| | | global-config: |
| | | db-config: |
| | | logic-delete-field: deleted |
| | | logic-delete-value: 1 |
| | | logic-not-delete-value: 0 |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.mes.pp.mapper.FlowCardMapper"> |
| | | |
| | | |
| | | <select id="selectFlowCard" resultType="java.util.Map"> |
| | | select fc.order_number, |
| | | concat(round(ogd.child_width), "*", round(ogd.child_height)) as child_width, |
| | | od.quantity, |
| | | round(ogd.total_area, 2) as total_area, |
| | | od.perimeter, |
| | | od.bend_radius, |
| | | concat(IFNULL(od.processing_note,''), IFNULL(od.remarks,'')) as remarks, |
| | | od.other_columns, |
| | | round(ogd.child_width) as width, |
| | | round(ogd.child_height) as height, |
| | | pd.separation, |
| | | fc.technology_number |
| | | from flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | | fc.technology_number = ogd.technology_number |
| | | left join sd.order_detail as od on od.order_id = fc.order_id and od.order_number = fc.order_number |
| | | left join sd.product_detail as pd |
| | | on pd.prod_id = od.product_id and pd.glass_sort = ogd.technology_number |
| | | where fc.process_id = #{processId} |
| | | and position(fc.technology_number in #{technologyNumber}) |
| | | group by fc.process_id, fc.order_number, fc.technology_number |
| | | order by IF(sort != NULL || sort != '', sort, fc.order_number) |
| | | |
| | | </select> |
| | | |
| | | <select id="selectProject" resultType="java.util.Map"> |
| | | select o.customer_name, |
| | | o.project, |
| | | (select process from sd.order_glass_detail where order_id=fc.order_id and order_number=fc.order_number and technology_number=fc.technology_number) as process , |
| | | od.edging_type, |
| | | (select glass_child from sd.order_glass_detail where order_id=fc.order_id and order_number=fc.order_number and technology_number=fc.technology_number) as glass_child , |
| | | od.product_name, |
| | | o.processing_note, |
| | | fc.process_id, |
| | | SUM(od.quantity) as quantity, |
| | | round(SUM(ogd.total_area), 2) as gross_area, |
| | | sum(od.weight) as weight, |
| | | 1 as technologyNumber, |
| | | concat(fc.process_id, '/', 1) as processIdNumber, |
| | | concat('对应我司单号',o.batch) AS otherRemarks |
| | | from flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | | fc.technology_number = ogd.technology_number |
| | | left join sd.order_detail as od on od.order_id = fc.order_id and od.order_number = fc.order_number |
| | | left join sd.`order` as o on o.order_id = fc.order_id |
| | | left join sd.product as p on p.id = od.product_id |
| | | left join (select ogd.order_id, |
| | | ogd.order_number, |
| | | ogd.technology_number, |
| | | ogd.glass_child, |
| | | GROUP_CONCAT(glass_child SEPARATOR ' ') AS concatenated_glass_child |
| | | from sd.order_glass_detail as ogd |
| | | where ogd.order_id = left(#{processId}, 10) |
| | | and position(ogd.technology_number in #{technologyNumber}) |
| | | GROUP BY order_id, order_number) as ogdc |
| | | on ogdc.order_id = ogd.order_id and ogdc.order_number = ogd.order_number and |
| | | ogdc.technology_number = ogd.technology_number |
| | | where fc.process_id = #{processId} |
| | | and position(fc.technology_number in #{technologyNumber}) |
| | | group by fc.process_id |
| | | </select> |
| | | |
| | | |
| | | |
| | | </mapper> |
| | |
| | | <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, engineer_id) VALUES |
| | | tempering_feed_sequence, x_coordinate, y_coordinate, angle, state, slot, engineer_id, deleted) 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.engineerId}) |
| | | #{item.angle}, #{item.state}, #{item.slot}, #{item.engineerId}, 0) |
| | | </foreach> |
| | | </insert> |
| | | |
| | |
| | | package com.mes.edgglasstask.controller; |
| | | |
| | | |
| | | import com.mes.edgglasstask.entity.request.EdgGlassInfoRequest; |
| | | import com.mes.edgglasstask.service.EdgGlassTaskInfoService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | |
| | | @RequestMapping("/edgGlassTaskInfo") |
| | | public class EdgGlassTaskInfoController { |
| | | |
| | | @Autowired |
| | | EdgGlassTaskInfoService edgGlassTaskInfoService; |
| | | |
| | | /** |
| | | * 设置磨边队列查询参数 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @PostMapping("/setEdgGlassInfoRequest") |
| | | @ApiOperation(value = "设置磨边队列查询参数", notes = "设置磨边队列查询参数") |
| | | public Result<String> setEdgGlassInfoRequest(@RequestBody EdgGlassInfoRequest request) { |
| | | edgGlassTaskInfoService.setEdgGlassInfoRequest(request); |
| | | return Result.build(200, "查询成功", "1"); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.edgglasstask.entity.request; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/8/7 16:16 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class EdgGlassInfoRequest { |
| | | |
| | | /** |
| | | * 磨边线 2001 2002 |
| | | */ |
| | | private List<Integer> cellList; |
| | | /** |
| | | * 状态 0 待处理 1 处理中 2 处理完成 |
| | | */ |
| | | private List<Integer> stateList; |
| | | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date beginDate; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endDate; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.edgglasstask.entity.EdgGlassTaskInfo; |
| | | import com.mes.edgglasstask.entity.request.EdgGlassInfoRequest; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface EdgGlassTaskInfoService extends IService<EdgGlassTaskInfo> { |
| | | |
| | | List<Map<String, Object>> selectEdgInfo(String line); |
| | | List<EdgGlassTaskInfo> selectEdgInfo(); |
| | | |
| | | String setEdgGlassInfoRequest(EdgGlassInfoRequest request); |
| | | } |
| | |
| | | package com.mes.edgglasstask.service.impl; |
| | | |
| | | import cn.smallbun.screw.core.util.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.common.utils.RedisUtil; |
| | | import com.mes.edgglasstask.entity.EdgGlassTaskInfo; |
| | | import com.mes.edgglasstask.entity.request.EdgGlassInfoRequest; |
| | | import com.mes.edgglasstask.mapper.EdgGlassTaskInfoMapper; |
| | | import com.mes.edgglasstask.service.EdgGlassTaskInfoService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class EdgGlassTaskInfoServiceImpl extends ServiceImpl<EdgGlassTaskInfoMapper, EdgGlassTaskInfo> implements EdgGlassTaskInfoService { |
| | | |
| | | @Autowired |
| | | RedisUtil redisUtil; |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> selectEdgInfo(String line) { |
| | | LambdaQueryWrapper<EdgGlassTaskInfo> edgGlassWrapper = new LambdaQueryWrapper<>(); |
| | | edgGlassWrapper |
| | | .eq(EdgGlassTaskInfo::getLine, line) |
| | | .eq(EdgGlassTaskInfo::getStatus, "1") |
| | | public List<EdgGlassTaskInfo> selectEdgInfo() { |
| | | EdgGlassInfoRequest request = redisUtil.getCacheObject("edgGlassRequest"); |
| | | if (null == request) { |
| | | request = new EdgGlassInfoRequest(); |
| | | } |
| | | LambdaQueryWrapper<EdgGlassTaskInfo> edgGlassWrapper = new LambdaQueryWrapper<EdgGlassTaskInfo>() |
| | | .in(CollectionUtils.isNotEmpty(request.getCellList()), EdgGlassTaskInfo::getLine, request.getCellList()) |
| | | .in(CollectionUtils.isNotEmpty(request.getStateList()), EdgGlassTaskInfo::getStatus, request.getStateList()) |
| | | .between(null != request.getBeginDate(), EdgGlassTaskInfo::getTime, request.getBeginDate(), request.getEndDate()) |
| | | .orderByDesc(EdgGlassTaskInfo::getTime); |
| | | return baseMapper.selectMaps(edgGlassWrapper); |
| | | return this.list(edgGlassWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public String setEdgGlassInfoRequest(EdgGlassInfoRequest request) { |
| | | if (request == null) { |
| | | redisUtil.deleteObject("edgGlassRequest"); |
| | | } else { |
| | | redisUtil.setCacheObject("edgGlassRequest", request); |
| | | } |
| | | return "success"; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.edgglasstask.entity.EdgGlassTaskInfo; |
| | | import com.mes.edgglasstask.service.EdgGlassTaskInfoService; |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | |
| | | |
| | | @Autowired |
| | | WebSocketServer webServerService; |
| | | @Autowired |
| | | DamageService damageService; |
| | | |
| | | @Value("${mes.threshold}") |
| | | private int threshold; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void dealDamageTask() { |
| | | Date startDate = new Date(); |
| | | log.info("卧式理片破损玻璃清除任务开始执行时间:{}", startDate); |
| | | List<TaskCache> taskCacheList = taskCacheService.list(new LambdaQueryWrapper<TaskCache>().in(TaskCache::getTaskStatus, Const.GLASS_STATE_DAMAGE_TAKE) |
| | | .in(TaskCache::getTaskType, Const.GLASS_CACHE_TYPE_OUT_ALL)); |
| | | if (CollectionUtils.isNotEmpty(taskCacheList)) { |
| | | //获取破损/拿走玻璃id |
| | | List<String> glassList = taskCacheList.stream().map(TaskCache::getGlassId).collect(Collectors.toList()); |
| | | //将磨边队列的数据删除 |
| | | edgGlassTaskInfoService.remove(new LambdaQueryWrapper<EdgGlassTaskInfo>().in(EdgGlassTaskInfo::getGlassId, glassList)); |
| | | //将任务表中的数据删除 |
| | | taskCacheService.remove(new LambdaQueryWrapper<TaskCache>().in(TaskCache::getGlassId, glassList).in(TaskCache::getTaskType, Const.GLASS_CACHE_TYPE_OUT_ALL)); |
| | | List<Damage> damageList = taskCacheList.stream().map(e -> { |
| | | Damage damage = new Damage(); |
| | | damage.setGlassId(e.getGlassId()); |
| | | damage.setLine(e.getEndCell()); |
| | | damage.setWorkingProcedure("冷加工"); |
| | | damage.setRemark("磨边前卧式理片"); |
| | | damage.setStatus(0); |
| | | damage.setType(e.getTaskStatus()); |
| | | return damage; |
| | | }).collect(Collectors.toList()); |
| | | damageService.batchInsertDamage(damageList); |
| | | } |
| | | Date endDate = new Date(); |
| | | log.info("本次任务结束时间:{},共耗时:{}ms", endDate, endDate.getTime() - startDate.getTime()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 进片任务 |
| | |
| | | jsonObject.append("currentCutTerritory", currentCutTerritorys); |
| | | //log.info("本次识别版图{},++++{}",engineerId,currentCutTerritorys); |
| | | //磨边信息 |
| | | List<Map<String, Object>> EdgTasks1 = edgGlassTaskInfoService.selectEdgInfo("2001"); |
| | | List<Map<String, Object>> EdgTasks2 = edgGlassTaskInfoService.selectEdgInfo("2002"); |
| | | jsonObject.append("EdgTasks1", EdgTasks1); |
| | | jsonObject.append("EdgTasks2", EdgTasks2); |
| | | List<EdgGlassTaskInfo> edgTasks = edgGlassTaskInfoService.selectEdgInfo(); |
| | | jsonObject.append("edgTasks", edgTasks); |
| | | |
| | | //卧室缓存笼内信息 |
| | | List<Map<String, Object>> EdgStorageCageinfos = edgStorageCageService.selectEdgStorageCages(); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void cacheGlassIsRun(){ |
| | | public void cacheGlassIsRun() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //正在进行的任务 |
| | | List<TaskCache>taskCaches=taskCacheService.selectTaskCacheIsRun(); |
| | | List<TaskCache> taskCaches = taskCacheService.selectTaskCacheIsRun(); |
| | | jsonObject.append("taskCaches", taskCaches); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cacheGlassIsRun"); |
| | | if (sendwServer != null) { |
| | |
| | | package com.mes.taskcache.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | |
| | | */ |
| | | private Date createTime; |
| | | |
| | | @TableLogic |
| | | private int deleted; |
| | | |
| | | } |
| | |
| | | FROM task_cache |
| | | <where> |
| | | end_cell = #{line} |
| | | and deleted = 0 |
| | | AND task_type in |
| | | <foreach collection="taskTypes" item="item" open='(' close=')' separator=','> |
| | | #{item} |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @ApiModelProperty(value = "创建时间", position = 8) |
| | | private Date createTime; |
| | | |
| | | @TableLogic |
| | | private int deleted; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @ApiModelProperty(value = "任务状态", position = 8) |
| | | private Integer taskState; |
| | | |
| | | @TableLogic |
| | | private int deleted; |
| | | |
| | | } |
| | |
| | | package com.mes.edgglasstask.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @ApiModelProperty(value = "时间", position = 9) |
| | | private Date time; |
| | | |
| | | @TableLogic |
| | | private int deleted; |
| | | |
| | | } |
| | |
| | | log.info("大理片笼破损玻璃清除任务开始执行时间:{}", startDate); |
| | | //获取进片任务表中状态为破损的数据 |
| | | List<BigStorageCageFeedTask> inDamageTaskInfoList = bigStorageCageFeedTaskService.list(new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | .eq(BigStorageCageFeedTask::getTaskState, Const.GLASS_STATE_DAMAGE)); |
| | | .in(BigStorageCageFeedTask::getTaskState, Const.GLASS_STATE_DAMAGE_TAKE)); |
| | | if (CollectionUtils.isNotEmpty(inDamageTaskInfoList)) { |
| | | log.info("获取进片任务表中破损的玻璃信息{}", inDamageTaskInfoList); |
| | | bigStorageCageFeedTaskService.remove(new LambdaQueryWrapper<BigStorageCageFeedTask>().eq(BigStorageCageFeedTask::getTaskState, Const.GLASS_STATE_DAMAGE)); |
| | | bigStorageCageFeedTaskService.remove(new LambdaQueryWrapper<BigStorageCageFeedTask>().in(BigStorageCageFeedTask::getTaskState, Const.GLASS_STATE_DAMAGE_TAKE)); |
| | | //理片笼详情表数据状态更新 |
| | | bigStorageCageDetailsService.remove(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_NEW).in(BigStorageCageDetails::getGlassId, inDamageTaskInfoList.stream().map(BigStorageCageFeedTask::getGlassId).collect(Collectors.toList()))); |
| | |
| | | damage.setLine(bigStorageCageFeedTask.getLine()); |
| | | damage.setWorkingProcedure("冷加工"); |
| | | damage.setRemark("进笼前卧转立"); |
| | | damage.setStatus(2); |
| | | damage.setStatus(0); |
| | | damage.setType(bigStorageCageFeedTask.getTaskState()); |
| | | damageService.insertDamage(damage); |
| | | slotList.add(bigStorageCageFeedTask.getTargetSlot()); |
| | | } |
| | |
| | | } |
| | | //获取出片任务表中状态为破损的数据 |
| | | List<BigStorageCageOutTask> outDamageTaskInfoList = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>() |
| | | .eq(BigStorageCageOutTask::getTaskState, Const.GLASS_STATE_DAMAGE)); |
| | | .eq(BigStorageCageOutTask::getTaskState, Const.GLASS_STATE_DAMAGE_TAKE)); |
| | | if (CollectionUtils.isNotEmpty(outDamageTaskInfoList)) { |
| | | log.info("获取出片任务表中破损的玻璃信息{}", outDamageTaskInfoList); |
| | | bigStorageCageOutTaskService.remove(new LambdaQueryWrapper<BigStorageCageOutTask>().eq(BigStorageCageOutTask::getTaskState, Const.GLASS_STATE_DAMAGE)); |
| | | bigStorageCageOutTaskService.remove(new LambdaQueryWrapper<BigStorageCageOutTask>().eq(BigStorageCageOutTask::getTaskState, Const.GLASS_STATE_DAMAGE_TAKE)); |
| | | List<String> glassIdList = outDamageTaskInfoList.stream().map(BigStorageCageOutTask::getGlassId).collect(Collectors.toList()); |
| | | //移除钢化下片表数据 |
| | | temperingGlassInfoService.remove(new LambdaQueryWrapper<TemperingGlassInfo>().in(TemperingGlassInfo::getGlassId, glassIdList)); |
| | | //理片笼详情表数据状态删除 |
| | | bigStorageCageDetailsService.remove(new LambdaQueryWrapper<BigStorageCageDetails>().in(BigStorageCageDetails::getGlassId, glassIdList)); |
| | | |
| | | //将破损信息新增入破损表 |
| | | List<Integer> slotList = new ArrayList<>(); |
| | | for (BigStorageCageOutTask bigStorageCageOutTask : outDamageTaskInfoList) { |
| | |
| | | damage.setLine(bigStorageCageOutTask.getEndSlot()); |
| | | damage.setWorkingProcedure("冷加工"); |
| | | damage.setRemark("出片后卧转立"); |
| | | damage.setStatus(2); |
| | | damage.setStatus(0); |
| | | damage.setType(bigStorageCageOutTask.getTaskState()); |
| | | damageService.insertDamage(damage); |
| | | slotList.add(bigStorageCageOutTask.getStartSlot()); |
| | | } |
| | |
| | | SUM(case task_state when 2 then 1 else 0 end) as real_count |
| | | from big_storage_cage_feed_task |
| | | where task_state in (1, 2) |
| | | and deleted = 0 |
| | | and (target_slot = 0 or target_slot is null) |
| | | group by line |
| | | ) t |
| | |
| | | WHERE LINE = #{line} |
| | | AND (target_slot = 0 or target_slot is null) |
| | | AND TASK_STATE IN (1, 2) |
| | | and deleted = 0 |
| | | ) T |
| | | </select> |
| | | |
| | |
| | | <mapper namespace="com.mes.bigstoragetask.mapper.BigStorageCageOutTaskMapper"> |
| | | |
| | | <insert id="saveBatch"> |
| | | INSERT INTO big_storage_cage_out_task ( glass_id, start_slot, end_slot, train_number, serial_number, task_state |
| | | ) |
| | | INSERT INTO big_storage_cage_out_task ( glass_id, start_slot, end_slot, train_number, serial_number, width, |
| | | height, task_state, |
| | | deleted ) |
| | | values |
| | | <foreach collection="list" item="item" separator=","> |
| | | (#{item.glassId}, #{item.startSlot}, #{item.endSlot}, #{item.trainNumber}, #{item.serialNumber}, |
| | | #{item.taskState}) |
| | | #{item.width}, #{item.height}, |
| | | #{item.taskState},0) |
| | | </foreach> |
| | | </insert> |
| | | </mapper> |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | |
| | | |
| | | @Autowired |
| | | private TemperingGlassInfoService temporaryGlassInfoService; |
| | | |
| | | @Autowired |
| | | private DamageService damageService; |
| | | |
| | | private static final String ALONE_STATE = "0"; |
| | | |
| | | |
| | |
| | | public void temperingGlassAfter() { |
| | | |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void dealDamageTask() { |
| | | Date startDate = new Date(); |
| | | log.info("钢化破损玻璃清除任务开始执行时间:{}", startDate); |
| | | List<TemperingGlassInfo> temperingGlassInfoList = temporaryGlassInfoService.list(new LambdaQueryWrapper<TemperingGlassInfo>().in(TemperingGlassInfo::getState, Const.GLASS_STATE_DAMAGE_TAKE)); |
| | | if (CollectionUtils.isNotEmpty(temperingGlassInfoList)) { |
| | | //获取破损/拿走玻璃id |
| | | List<String> glassList = temperingGlassInfoList.stream().map(TemperingGlassInfo::getGlassId).collect(Collectors.toList()); |
| | | //将任务表中的数据删除 |
| | | temporaryGlassInfoService.remove(new LambdaQueryWrapper<TemperingGlassInfo>().in(TemperingGlassInfo::getGlassId, glassList)); |
| | | List<Damage> damageList = temperingGlassInfoList.stream().map(e -> { |
| | | Damage damage = new Damage(); |
| | | damage.setGlassId(e.getGlassId()); |
| | | damage.setLine(Const.TEMPERING_OUT_TARGET_POSITION); |
| | | damage.setWorkingProcedure("钢化"); |
| | | damage.setRemark("钢化"); |
| | | damage.setStatus(0); |
| | | damage.setType(e.getState()); |
| | | return damage; |
| | | }).collect(Collectors.toList()); |
| | | damageService.batchInsertDamage(damageList); |
| | | } |
| | | Date endDate = new Date(); |
| | | log.info("本次任务结束时间:{},共耗时:{}ms", endDate, endDate.getTime() - startDate.getTime()); |
| | | } |
| | | } |
| | |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | # hangzhoumes: |
| | | # url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | # username: root |
| | | # password: beibo.123/ |
| | | # driver-class-name: com.mysql.cj.jdbc.Driver |
| | | # salve_hangzhoumes: |
| | | # url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes |
| | | # username: sa |
| | | # password: beibo.123/ |
| | | # driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | hangzhoumes: |
| | | url: jdbc:mysql:127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | |
| | | import com.mes.downglassinfo.entity.request.DownGlassInfoRequest; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | @Autowired |
| | | DownGlassInfoService downGlassInfoService; |
| | | |
| | | @PostMapping("/selectDownGlassInfo") |
| | | /** |
| | | * 设置查询参数 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @PostMapping("/setDownGlassInfoRequest") |
| | | @ApiOperation(value = "设置落架玻璃查询参数", notes = "设置落架玻璃查询参数") |
| | | public Result<String> setDownGlassInfoRequest(@RequestBody DownGlassInfoRequest request) { |
| | | return Result.success(downGlassInfoService.setDownGlassInfoRequest(request)); |
| | | Result.success(downGlassInfoService.setDownGlassInfoRequest(request)); |
| | | return Result.build(200, "查询成功", "1"); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | private Date gmtCreate; |
| | | |
| | | /** |
| | | * 玻璃类型 |
| | | */ |
| | | private Integer glassType; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | |
| | | * 创建时间 |
| | | */ |
| | | private Date CreateTime; |
| | | |
| | | @TableLogic |
| | | private int deleted; |
| | | } |
| | |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date beginDate; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endDate; |
| | | |
| | | |
| | |
| | | import com.mes.downworkstation.entity.dto.DownGlassInfoDTO; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface DownGlassInfoService extends IService<DownGlassInfo> { |
| | | |
| | |
| | | */ |
| | | String setDownGlassInfoRequest(DownGlassInfoRequest request); |
| | | |
| | | /** |
| | | * 查询架子上绑定流程卡的玻璃是否到齐 |
| | | */ |
| | | List<Map<String, List<Map<String, Object>>>> downGlassPrint(DownGlassInfo downGlassInfo); |
| | | |
| | | List<DownWorkstation> queryWorkStationIsFull(); |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.downglassinfo.service.impl; |
| | | |
| | | import cn.smallbun.screw.core.util.CollectionUtils; |
| | | import cn.smallbun.screw.core.util.CollectionUtils; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.job.DownLoadCacheGlassTask; |
| | | import com.mes.pp.service.FlowCardService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.HashMap;import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | |
| | | |
| | | @Autowired |
| | | RedisUtil redisUtil; |
| | | |
| | | @Autowired |
| | | FlowCardService flowCardService; |
| | | |
| | | /** |
| | | * 根据流程卡号查询最大序号 |
| | |
| | | } |
| | | return "success"; |
| | | } |
| | | |
| | | @Override |
| | | public List<DownWorkstation> queryWorkStationIsFull() { |
| | | //查询可以落架的玻璃信息且已绑定流程卡的工位信息 |
| | |
| | | //可以落架的玻璃信息且已绑定流程卡的所有的工位 - 玻璃未满流程卡及层数的工位 = 已满工位 |
| | | workstationFull = list.stream().filter(item -> !flowCardIdList.contains(item.getFlowCardId() + ":" + item.getLayer())).collect(Collectors.toList()); |
| | | //是否需要将已满的工位置为不可落架 |
| | | List<Integer> workstationIds = workstationFull.stream().map(DownWorkstation::getWorkstationId).collect(Collectors.toList()); |
| | | downWorkstationService.update(new LambdaUpdateWrapper<DownWorkstation>().set(DownWorkstation::getEnableState, Const.SLOT_OFF) |
| | | .in(DownWorkstation::getWorkstationId, workstationIds)); |
| | | |
| | | if (CollectionUtils.isNotEmpty(workstationFull)) { |
| | | List<Integer> workstationIds = workstationFull.stream().map(DownWorkstation::getWorkstationId).collect(Collectors.toList()); |
| | | downWorkstationService.update(new LambdaUpdateWrapper<DownWorkstation>().set(DownWorkstation::getEnableState, Const.SLOT_OFF) |
| | | .in(DownWorkstation::getWorkstationId, workstationIds)); |
| | | } |
| | | } |
| | | return workstationFull; |
| | | }@Override |
| | | public List<Map<String, List<Map<String, Object>>>> downGlassPrint(DownGlassInfo downGlassInfo){ |
| | | QueryWrapper<DownGlassInfo> queryWrapper = Wrappers.query(); |
| | | queryWrapper.eq("flow_card_id", "NG24080012A001") |
| | | .eq("layer", 1) |
| | | .select("flow_card_id", "layer", "width", "height", "filmsid", "thickness","glass_type","COUNT(*) AS quantity") |
| | | .groupBy("flow_card_id", "layer", "width", "height", "filmsid", "thickness"); |
| | | List<Map<String, Object>> resultList = baseMapper.selectMaps(queryWrapper); |
| | | |
| | | |
| | | List<Map<String, Object>> projectInfo=flowCardService.selectProject(downGlassInfo.getFlowCardId(),downGlassInfo.getLayer()); |
| | | List<Map<String, Object>> flowCardInfo=flowCardService.selectFlowCard(downGlassInfo.getFlowCardId(),downGlassInfo.getLayer()); |
| | | |
| | | for (Map<String, Object> row : flowCardInfo) { |
| | | int order_number = (int) row.get("order_number"); |
| | | int technology_number = (int) row.get("technology_number"); |
| | | |
| | | for (Map<String, Object> row1 : resultList) { |
| | | int glass_type = (int) row1.get("glass_type"); |
| | | int layer = (int) row1.get("layer"); |
| | | Long quantity=(Long) row1.get("quantity"); |
| | | |
| | | if(order_number==glass_type&&technology_number==layer){ |
| | | row.put("quantity1",quantity); |
| | | } |
| | | } |
| | | } |
| | | List<Map<String, List<Map<String, Object>>>> listMap=new ArrayList<>(); |
| | | Map<String, List<Map<String, Object>>> result = new HashMap<>(); |
| | | result.put("detail", projectInfo); |
| | | result.put("detailList", flowCardInfo); |
| | | for (Map<String, Object> row : projectInfo) { |
| | | String order_number = (String) row.get("process"); |
| | | String[] processes=order_number.split("->"); |
| | | List<Map<String, Object>> processList = new ArrayList<>(); |
| | | for (int i = 0; i < processes.length; i++) { |
| | | Map<String, Object> processMap = new JSONObject(); |
| | | processMap.put("process", processes[i]); |
| | | processMap.put("id", i); |
| | | processList.add(processMap); |
| | | } |
| | | result.put("processList", processList); |
| | | } |
| | | listMap.add(result); |
| | | return listMap; |
| | | } |
| | | } |
| | |
| | | @Override |
| | | public List<Map<String, Object>> getTotalGlassDimensionsByWorkstation(int start, int end) { |
| | | MPJQueryWrapper<DownWorkstation> queryWrapper = new MPJQueryWrapper<>(); |
| | | queryWrapper.select("t.workstation_id", "t.flow_card_id", "COALESCE(SUM(b.width), 0) AS totalwidth", "COALESCE(SUM(b.height), 0) AS totalheight") |
| | | queryWrapper.select("t.workstation_id", "t.flow_card_id", "COALESCE(SUM(b.width), 0) AS totalwidth", "COALESCE(SUM(b.height), 0) AS totalheight,total_quantity,racks_number,other_number") |
| | | .leftJoin("down_glass_info b on t.flow_card_id = b.flow_card_id") |
| | | .groupBy("t.workstation_id", "t.flow_card_id") |
| | | .orderByAsc("t.workstation_id").between("t.workstation_id", start, end) |
| | |
| | | item.put("width", downWorkstionAndDownGlassinfo.getTotalwidth()); |
| | | item.put("fillColor", "yellow"); |
| | | item.put("content", downWorkstionAndDownGlassinfo.getFlowCardId()); |
| | | if (downWorkstionAndDownGlassinfo.getTotalQuantity() == downWorkstionAndDownGlassinfo.getRacksNumber() + downWorkstionAndDownGlassinfo.getRacksNumber()) { |
| | | item.put("fullCardColor", "red"); |
| | | } else { |
| | | item.put("fullCardColor", "blue"); |
| | | } |
| | | |
| | | // 查询 DownGlassInfo 并添加到 item 中 |
| | | MPJQueryWrapper<DownGlassInfo> glassInfoQueryWrapper = new MPJQueryWrapper<>(); |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | |
| | | DownWorkstationService downWorkstationService; |
| | | @Autowired |
| | | DownGlassInfoService downGlassInfoService; |
| | | |
| | | @Value("${mes.threshold}") |
| | | private Integer threshold; |
| | | @Autowired |
| | | DamageService damageService; |
| | | |
| | | @Value("${mes.throughWidth}") |
| | | private Integer throughWidth; |
| | |
| | | PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject; |
| | | s7control.writeWord(plcMesObject.getPlcParameter("alarm_signal").getAddress(), 1); |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void dealDamageTask() { |
| | | Date startDate = new Date(); |
| | | log.info("下片破损玻璃清除任务开始执行时间:{}", startDate); |
| | | List<DownGlassTask> downGlassTaskList = downGlassTaskService.list(new LambdaQueryWrapper<DownGlassTask>() |
| | | .in(DownGlassTask::getTaskType, Const.GLASS_CACHE_TYPE_OUT_ALL).in(DownGlassTask::getTaskStatus, Const.GLASS_STATE_DAMAGE_TAKE)); |
| | | if (CollectionUtils.isNotEmpty(downGlassTaskList)) { |
| | | //获取破损/拿走玻璃id |
| | | List<String> glassList = downGlassTaskList.stream().map(DownGlassTask::getGlassId).collect(Collectors.toList()); |
| | | //将任务表中的数据删除 |
| | | downGlassTaskService.remove(new LambdaQueryWrapper<DownGlassTask>().in(DownGlassTask::getTaskType, Const.GLASS_CACHE_TYPE_OUT_ALL).in(DownGlassTask::getGlassId, glassList)); |
| | | List<Damage> damageList = downGlassTaskList.stream().map(e -> { |
| | | Damage damage = new Damage(); |
| | | damage.setGlassId(e.getGlassId()); |
| | | damage.setLine(Const.TEMPERING_OUT_TARGET_POSITION); |
| | | damage.setWorkingProcedure("下片"); |
| | | damage.setRemark("下片"); |
| | | damage.setStatus(0); |
| | | damage.setType(e.getTaskStatus()); |
| | | return damage; |
| | | }).collect(Collectors.toList()); |
| | | damageService.batchInsertDamage(damageList); |
| | | } |
| | | Date endDate = new Date(); |
| | | log.info("本次任务结束时间:{},共耗时:{}ms", endDate, endDate.getTime() - startDate.getTime()); |
| | | } |
| | | |
| | | public void inTo(String glassId, String requestWord, String currentSlot) { |
| | |
| | | if (CollectionUtils.isNotEmpty(downStorageCageDetails)) { |
| | | tempGlassId = downStorageCageDetails.get(0).getGlassId(); |
| | | break; |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unloadglass");
|
| | | if (sendwServer != null) {
|
| | | for (WebSocketServer webserver : sendwServer) {
|
| | | if (webserver != null&&webserver.session.isOpen()) {
|
| | | if (webserver != null && webserver.session.isOpen()) {
|
| | | log.info("已发送");
|
| | | webserver.sendMessage(jsonObject.toString());
|
| | | }
|
| | |
| | | public void sendGlassInfoData() {
|
| | | log.info("发送工位显示图信息1");
|
| | | JSONObject jsonObject2 = new JSONObject();
|
| | | List<Map<String, Object>> glassinfodata = downWorkstationService.getTotalGlassDimensionsByWorkstation(1,3);
|
| | | jsonObject2.append("glassinfo",glassinfodata);
|
| | | List<Map<String, Object>> glassinfodata = downWorkstationService.getTotalGlassDimensionsByWorkstation(1, 3);
|
| | | jsonObject2.append("glassinfo", glassinfodata);
|
| | | log.info(jsonObject2.toString());
|
| | | ArrayList<WebSocketServer> sendwServer2 = WebSocketServer.sessionMap.get("unloadglass2");
|
| | | if (sendwServer2 != null) {
|
| | | for (WebSocketServer webserver : sendwServer2) {
|
| | | if (webserver != null&&webserver.session.isOpen()) {
|
| | | if (webserver != null && webserver.session.isOpen()) {
|
| | | webserver.sendMessage(jsonObject2.toString());
|
| | | }
|
| | | }
|
| | |
| | | public void sendGlassInfoData2() {
|
| | | log.info("发送工位显示图信息2");
|
| | | JSONObject jsonObject3 = new JSONObject();
|
| | | List<Map<String, Object>> glassinfodata2 = downWorkstationService.getTotalGlassDimensionsByWorkstation(4,6);
|
| | | jsonObject3.append("glassinfo2",glassinfodata2);
|
| | | List<Map<String, Object>> glassinfodata2 = downWorkstationService.getTotalGlassDimensionsByWorkstation(4, 6);
|
| | | jsonObject3.append("glassinfo2", glassinfodata2);
|
| | | log.info(jsonObject3.toString());
|
| | | ArrayList<WebSocketServer> sendwServer3 = WebSocketServer.sessionMap.get("unloadglass3");
|
| | | if (sendwServer3 != null) {
|
| | | for (WebSocketServer webserver : sendwServer3) {
|
| | | if (webserver != null&&webserver.session.isOpen()) {
|
| | | if (webserver != null && webserver.session.isOpen()) {
|
| | | webserver.sendMessage(jsonObject3.toString());
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Scheduled(fixedDelay = 2000)
|
| | | @Scheduled(fixedDelay = 2000)
|
| | | public void sendDownStorageCages() {
|
| | | log.info("发送缓存玻璃信息");
|
| | | JSONObject jsonObject4 = new JSONObject();
|
| | | List<Map<String, Object>> list=downStorageCageService.selectDownStorageCages();
|
| | | jsonObject4.append("params2",list);
|
| | | log.info(jsonObject4.toString());
|
| | | ArrayList<WebSocketServer> sendwServer4 = WebSocketServer.sessionMap.get("downcache");
|
| | | if (sendwServer4 != null) {
|
| | | for (WebSocketServer webserver : sendwServer4) {
|
| | | if (webserver != null && webserver.session.isOpen()) {
|
| | | webserver.sendMessage(jsonObject4.toString());
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | List<Map<String, Object>> list = downStorageCageService.selectDownStorageCages();
|
| | | jsonObject4.append("params2", list);
|
| | | log.info(jsonObject4.toString());
|
| | | ArrayList<WebSocketServer> sendwServer4 = WebSocketServer.sessionMap.get("downcache");
|
| | | if (sendwServer4 != null) {
|
| | | for (WebSocketServer webserver : sendwServer4) {
|
| | | if (webserver != null && webserver.session.isOpen()) {
|
| | | webserver.sendMessage(jsonObject4.toString());
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Scheduled(fixedDelay = 2000)
|
| | | public void sendDownGlassInfo() {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Scheduled(fixedDelay = 1000)
|
| | | public void isRun() {
|
| | | JSONObject jsonObject = new JSONObject();
|
| | | //正在进行的任务
|
| | | List<DownWorkstation> downWorkstation = downWorkstationService.getoneDownWorkstations(1, 6);
|
| | | jsonObject.append("downWorkstation", downWorkstation);
|
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unLoadGlassIsRun");
|
| | | if (sendwServer != null) {
|
| | | for (WebSocketServer webserver : sendwServer) {
|
| | | if (webserver != null) {
|
| | | webserver.sendMessage(jsonObject.toString());
|
| | | } else {
|
| | | log.info("unLoadGlassIsRun is closed");
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | package mes; |
| | | |
| | | import com.mes.UnLoadGlassApplication; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.downglassinfo.service.DownGlassTaskService; |
| | | import com.mes.downglassinfo.service.impl.DownGlassInfoServiceImpl; |
| | |
| | | |
| | | }*/ |
| | | |
| | | |
| | | @Test |
| | | public void downGlassPrint() { |
| | | DownGlassInfo downGlassInfo=new DownGlassInfo(); |
| | | downGlassInfo.setFlowCardId("NG24070506A001"); |
| | | downGlassInfo.setLayer(1); |
| | | downGlassInfoService.downGlassPrint(downGlassInfo); |
| | | } |
| | | |
| | | |
| | | |