| | |
| | | import * as XLSX from "xlsx"; |
| | | import {useI18n} from "vue-i18n"; |
| | | import useOrderInfoStore from "@/stores/sd/order/orderInfo"; |
| | | |
| | | import companyInfo from "@/stores/sd/companyInfo"; |
| | | const { t } = useI18n() |
| | | const xGrid = ref() |
| | | const company = companyInfo() |
| | | let filterData = ref({}) |
| | | const reportTime=company.reportTime |
| | | const orderInfo = useOrderInfoStore() |
| | | const gridOptions = reactive({ |
| | | loading:true, |
| | |
| | | }) |
| | | return |
| | | } |
| | | request.post(`${props.childrenData.url}/${basicProp.value.pageNum}/${basicProp.value.pageSize}/${orderInfo.brokenDate}`,filterData.value).then(res => { |
| | | request.post(`${props.childrenData.url}/${basicProp.value.pageNum}/${basicProp.value.pageSize}/${orderInfo.brokenDate}/${reportTime}`,filterData.value).then(res => { |
| | | if(res.code === '200'){ |
| | | props.childrenData.data = res.data.data |
| | | basicProp.value.pageTotal = res.data.total.pageTotal |
| | |
| | | |
| | | <tr v-for="(itemtextareas,index) in item.detail" :key="index"> |
| | | <td colspan="31" style="width: 480px;height: 150px "> |
| | | <div style="width: 100%;height: 100%;text-align: left"><textarea style="height: 99%;width: 99%;border: none;;font-size: 16px;font-weight: bold;overflow: hidden;text-align: left;vertical-align: middle">{{itemtextareas.processing_note}}</textarea> |
| | | <div style="width: 100%;height: 100%;text-align: left"> |
| | | <textarea v-if="!company.processFontSize" style="height: 99%;width: 99%;border: none;;font-size: 14px;font-weight: bold;overflow: hidden;text-align: left;vertical-align: middle">{{itemtextareas.processing_note}}</textarea> |
| | | <textarea v-else style="height: 99%;width: 99%;border: none;;font-size: 36px;font-weight: bold;overflow: hidden;text-align: left;vertical-align: middle">{{itemtextareas.processing_note}}</textarea> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | |
| | | finishedProductReport :'ØªÙØ±Ùر اÙÙ
ÙØªØ¬Ø§Øª اÙÙÙØ§Ø¦ÙØ©', |
| | | workProcessName:'å¨å¶ååç§°', |
| | | StorageArea:'å
¥åºé¢ç§¯', |
| | | shippedArea:'åè´§é¢ç§¯' |
| | | shippedArea:'åè´§é¢ç§¯', |
| | | thicknessArea:'å¹³æ¹æ¯«ç±³' |
| | | |
| | | }, |
| | | productionBasicData:{ |
| | |
| | | finishedProductReport :'Finished product report', |
| | | workProcessName:'å¨å¶ååç§°', |
| | | StorageArea:'å
¥åºé¢ç§¯', |
| | | shippedArea:'åè´§é¢ç§¯' |
| | | shippedArea:'åè´§é¢ç§¯', |
| | | thicknessArea:'å¹³æ¹æ¯«ç±³' |
| | | |
| | | }, |
| | | productionBasicData:{ |
| | |
| | | finishedProductReport :'ìì í ë³´ê³ ì', |
| | | workProcessName:'å¨å¶ååç§°', |
| | | StorageArea:'å
¥åºé¢ç§¯', |
| | | shippedArea:'åè´§é¢ç§¯' |
| | | shippedArea:'åè´§é¢ç§¯', |
| | | thicknessArea:'å¹³æ¹æ¯«ç±³' |
| | | |
| | | }, |
| | | productionBasicData:{ |
| | |
| | | finishedProductReport :'ÐÑÑÐµÑ Ð¾ гоÑовой пÑодÑкÑии', |
| | | workProcessName:'å¨å¶ååç§°', |
| | | StorageArea:'å
¥åºé¢ç§¯', |
| | | shippedArea:'åè´§é¢ç§¯' |
| | | shippedArea:'åè´§é¢ç§¯', |
| | | thicknessArea:'å¹³æ¹æ¯«ç±³' |
| | | |
| | | }, |
| | | productionBasicData:{ |
| | |
| | | finishedProductReport :'æåæ¥è¡¨', |
| | | workProcessName:'å¨å¶ååç§°', |
| | | StorageArea:'å
¥åºé¢ç§¯', |
| | | shippedArea:'åè´§é¢ç§¯' |
| | | shippedArea:'åè´§é¢ç§¯', |
| | | thicknessArea:'å¹³æ¹æ¯«ç±³' |
| | | |
| | | }, |
| | | productionBasicData:{ |
| | |
| | | alienFunction:false,//æ¯å¦å¼å¯å¼å½¢åè½ï¼ææ¶é½æ¯false |
| | | replenishQRCode:1,//æ¯å¦è¡¥çäºç»´ç æ¯å¦æåå±,1æåï¼2䏿 |
| | | soleQRCode:false,//æµç¨å¡åå¹¶äºç»´ç æ¾ç¤ºåå±ï¼ä¹ä¹true.å
¶å®false |
| | | reportTime:"08:00",//æ¬¡ç ´ãäº§éæ¥è¡¨é»è®¤æ¶é´ |
| | | processFontSize:false,//æµç¨å¡å å·¥è¦æ±åä½å 大 |
| | | //天津 |
| | | printLabel: { |
| | | custom: (item1) => { |
| | |
| | | alienFunction:false,//æ¯å¦å¼å¯å¼å½¢åè½ï¼ææ¶é½æ¯false |
| | | replenishQRCode:2,//æ¯å¦è¡¥çäºç»´ç æ¯å¦æåå±,1æåï¼2䏿 |
| | | soleQRCode:false,//æµç¨å¡åå¹¶äºç»´ç æ¾ç¤ºåå±ï¼ä¹ä¹true.å
¶å®false |
| | | reportTime:"08:00",//æ¬¡ç ´ãäº§éæ¥è¡¨é»è®¤æ¶é´ |
| | | processFontSize:false,//æµç¨å¡å å·¥è¦æ±åä½å 大 |
| | | //天津 |
| | | printLabel: { |
| | | custom: (item1) => { |
| | |
| | | alienFunction:false,//æ¯å¦å¼å¯å¼å½¢åè½ï¼ææ¶é½æ¯false |
| | | replenishQRCode:1,//æ¯å¦è¡¥çäºç»´ç æ¯å¦æåå±,1æåï¼2䏿 |
| | | soleQRCode:false,//æµç¨å¡åå¹¶äºç»´ç æ¾ç¤ºåå±ï¼ä¹ä¹true.å
¶å®false |
| | | reportTime:"08:00",//æ¬¡ç ´ãäº§éæ¥è¡¨é»è®¤æ¶é´ |
| | | processFontSize:false,//æµç¨å¡å å·¥è¦æ±åä½å 大 |
| | | //天津 |
| | | printLabel: { |
| | | custom: (item1) => { |
| | |
| | | alienFunction:false,//æ¯å¦å¼å¯å¼å½¢åè½ï¼ææ¶é½æ¯false |
| | | replenishQRCode:1,//æ¯å¦è¡¥çäºç»´ç æ¯å¦æåå±,1æåï¼2䏿 |
| | | soleQRCode:false,//æµç¨å¡åå¹¶äºç»´ç æ¾ç¤ºåå±ï¼ä¹ä¹true.å
¶å®false |
| | | reportTime:"08:00",//æ¬¡ç ´ãäº§éæ¥è¡¨é»è®¤æ¶é´ |
| | | processFontSize:false,//æµç¨å¡å å·¥è¦æ±åä½å 大 |
| | | //天津 |
| | | printLabel: { |
| | | custom: (item1) => { |
| | |
| | | alienFunction:false,//æ¯å¦å¼å¯å¼å½¢åè½ï¼ææ¶é½æ¯false |
| | | replenishQRCode:1,//æ¯å¦è¡¥çäºç»´ç æ¯å¦æåå±,1æåï¼2䏿 |
| | | soleQRCode:false,//æµç¨å¡åå¹¶äºç»´ç æ¾ç¤ºåå±ï¼ä¹ä¹true.å
¶å®false |
| | | reportTime:"08:00",//æ¬¡ç ´ãäº§éæ¥è¡¨é»è®¤æ¶é´ |
| | | processFontSize:false,//æµç¨å¡å å·¥è¦æ±åä½å 大 |
| | | //天津 |
| | | printLabel: { |
| | | custom: (item1) => { |
| | |
| | | alienFunction:true,//æ¯å¦å¼å¯å¼å½¢åè½ï¼ææ¶é½æ¯false |
| | | replenishQRCode:1,//æ¯å¦è¡¥çäºç»´ç æ¯å¦æåå±,1æåï¼2䏿 |
| | | soleQRCode:false,//æµç¨å¡åå¹¶äºç»´ç æ¾ç¤ºåå±ï¼ä¹ä¹true.å
¶å®false |
| | | reportTime:"07:30",//æ¬¡ç ´ãäº§éæ¥è¡¨é»è®¤æ¶é´ |
| | | processFontSize:true,//æµç¨å¡å å·¥è¦æ±åä½å 大 |
| | | //天津 |
| | | printLabel: { |
| | | custom: (item1) => { |
| | |
| | | alienFunction:false,//æ¯å¦å¼å¯å¼å½¢åè½ï¼ææ¶é½æ¯false |
| | | replenishQRCode:1,//æ¯å¦è¡¥çäºç»´ç æ¯å¦æåå±,1æåï¼2䏿 |
| | | soleQRCode:true,//æµç¨å¡åå¹¶äºç»´ç æ¾ç¤ºåå±ï¼ä¹ä¹true.å
¶å®false |
| | | reportTime:"08:00",//æ¬¡ç ´ãäº§éæ¥è¡¨é»è®¤æ¶é´ |
| | | processFontSize:false,//æµç¨å¡å å·¥è¦æ±åä½å 大 |
| | | //天津 |
| | | printLabel: { |
| | | custom: (item1) => { |
| | |
| | | ElMessage.error(t('order.msg.pleaseCancelTheFilteringFirst')) |
| | | return |
| | | } |
| | | if (selectRecords.length == 0) { |
| | | ElMessage.warning(t('reportingWorks.selectProcessCardData')) |
| | | return; |
| | | } |
| | | // if (selectRecords.length == 0) { |
| | | // ElMessage.warning(t('reportingWorks.selectProcessCardData')) |
| | | // return; |
| | | // } |
| | | |
| | | let projectData = ref({ |
| | | projectdetail: selectRecords, |
| | |
| | | optimizeData.value.glassDetails = []; |
| | | // ä»è¡¨æ ¼ä¸è·å glassDetail æ°æ®ï¼è䏿¯ä»å端æ¥å£è¯»å |
| | | const tableData = xGrid.value.getTableData().fullData; |
| | | let totalQuantity = 0; |
| | | let totalArea = 0; |
| | | |
| | | tableData.forEach(item => { |
| | | const width = parseFloat(item.width) || 0; |
| | | const height = parseFloat(item.height) || 0; |
| | | const quantity = parseInt(item.quantity) || 0; |
| | | |
| | | // 使ç¨é¿Ãå®½Ãæ°éæ¥è®¡ç®æ»é¢ç§¯ |
| | | totalArea += (width * height * quantity) / 1000000; // 转æ¢ä¸ºå¹³æ¹ç±³ |
| | | totalQuantity += quantity; |
| | | }); |
| | | |
| | | quantitys.value = totalQuantity; |
| | | areas.value = totalArea; |
| | | const glassDetailData = tableData.map(item => { |
| | | let rackNoValue = 0; |
| | | if (item.rackNo !== undefined && item.rackNo !== null && item.rackNo !== '') { |
| | |
| | | |
| | | xGrid.value.loadData(data); |
| | | gridOptions.data = data; |
| | | projectName.value = data[0].project_name; |
| | | projectName.value = res.data.project.project_name; |
| | | quantitys.value=res.data.project.glass_total |
| | | areas.value=res.data.project.glass_total_area |
| | | |
| | |
| | | import footSum from "@/hook/footSum" |
| | | import {addListener, toolbarButtonClickEvent} from "@/hook/mouseMove" |
| | | import {VxeUI} from "vxe-pc-ui"; |
| | | import companyInfo from "@/stores/sd/companyInfo"; |
| | | //è¯è¨è·å |
| | | const {t} = useI18n() |
| | | let router = useRouter() |
| | | let filterData = ref({}) |
| | | const company = companyInfo() |
| | | //æäº¤ç表å |
| | | const form = reactive({ |
| | | date1: '', |
| | |
| | | return includeEnd ? diffDays + 1 : diffDays |
| | | } |
| | | |
| | | const times=company.reportTime |
| | | //è·åä¸å¤©åå°å½åæ¶é´ |
| | | function getNowTime() { |
| | | const pad = (n) => n.toString().padStart(2, '0'); |
| | |
| | | const year = date.getFullYear(); |
| | | const month = pad(date.getMonth() + 1); |
| | | const day = pad(date.getDate()); |
| | | return `${year}-${month}-${day} 08:00:00`; |
| | | return `${year}-${month}-${day} ${times}`; |
| | | }; |
| | | |
| | | const now = new Date(); |
| | |
| | | let year = date.getFullYear(); |
| | | let month = pad(date.getMonth() + 1); |
| | | let day = pad(date.getDate()); |
| | | let newEndTime = `${year}-${month}-${day} 08:00:00`; |
| | | let newEndTime = `${year}-${month}-${day} ${times}`; |
| | | //ç¬¬ä¸æ¬¡å è½½æ°æ® |
| | | request.post(`/report/teamOutput/1/${total.pageSize}/${startTime}/${newEndTime}/${selectProcesses}`, filterData.value).then((res) => { |
| | | |
| | |
| | | //页è翻页æ¥è¯¢ |
| | | const selectPageList = () => { |
| | | gridOptions.loading = true |
| | | // è§£æ company.reportTime |
| | | const [reportHourStr, reportMinuteStr] = company.reportTime.split(":"); |
| | | const reportHour = parseInt(reportHourStr); |
| | | const reportMinute = parseInt(reportMinuteStr); |
| | | |
| | | // åå§ form.date1 æ¯æ¥æå¯¹è±¡æ°ç» |
| | | const rawStart = new Date(form.date1[0]); |
| | | const rawEnd = new Date(form.date1[1]); |
| | | // 妿æ¶é´é¨åæ¯ 00:00ï¼å设置为 08:00 |
| | | if (rawStart.getHours() === 8 || rawStart.getHours() === 0) { |
| | | rawStart.setHours(8, 0, 0, 0); |
| | | |
| | | // 夿æ¶é´é¨åæ¯å¦éè¦ä¿®æ£ä¸º company.reportTime |
| | | const isZeroOrReport = (dateObj) => { |
| | | const h = dateObj.getHours(); |
| | | const m = dateObj.getMinutes(); |
| | | // 夿æ¡ä»¶ï¼æ¯ 00:00 æè
æ¯ reportTime 对åºçæ¶é´ |
| | | return (h === 0 && m === 0) || (h === reportHour && m === reportMinute); |
| | | }; |
| | | |
| | | if (isZeroOrReport(rawStart)) { |
| | | rawStart.setHours(reportHour, reportMinute, 0, 0); |
| | | } |
| | | if (rawEnd.getHours() === 8 || rawEnd.getHours() === 0) { |
| | | rawEnd.setHours(8, 0, 0, 0); |
| | | if (isZeroOrReport(rawEnd)) { |
| | | rawEnd.setHours(reportHour, reportMinute, 0, 0); |
| | | } |
| | | const startTime = formatDateTime(rawStart); |
| | | const endPlusOne = new Date(rawEnd); |
| | |
| | | |
| | | //ç¹å»æ¥è¯¢ |
| | | const getWorkOrder = () => { |
| | | gridOptions.loading = true |
| | | gridOptions.loading = true; |
| | | |
| | | // è§£æ company.reportTime |
| | | const [reportHourStr, reportMinuteStr] = company.reportTime.split(":"); |
| | | const reportHour = parseInt(reportHourStr); |
| | | const reportMinute = parseInt(reportMinuteStr); |
| | | |
| | | // åå§ form.date1 æ¯æ¥æå¯¹è±¡æ°ç» |
| | | const rawStart = new Date(form.date1[0]); |
| | | const rawEnd = new Date(form.date1[1]); |
| | | // 妿æ¶é´é¨åæ¯ 00:00ï¼å设置为 08:00 |
| | | if (rawStart.getHours() === 8 || rawStart.getHours() === 0) { |
| | | rawStart.setHours(8, 0, 0, 0); |
| | | |
| | | // 夿æ¶é´é¨åæ¯å¦éè¦ä¿®æ£ä¸º company.reportTime |
| | | const isZeroOrReport = (dateObj) => { |
| | | const h = dateObj.getHours(); |
| | | const m = dateObj.getMinutes(); |
| | | // 夿æ¡ä»¶ï¼æ¯ 00:00 æè
æ¯ reportTime 对åºçæ¶é´ |
| | | return (h === 0 && m === 0) || (h === reportHour && m === reportMinute); |
| | | }; |
| | | |
| | | if (isZeroOrReport(rawStart)) { |
| | | rawStart.setHours(reportHour, reportMinute, 0, 0); |
| | | } |
| | | if (rawEnd.getHours() === 8 || rawEnd.getHours() === 0) { |
| | | rawEnd.setHours(8, 0, 0, 0); |
| | | if (isZeroOrReport(rawEnd)) { |
| | | rawEnd.setHours(reportHour, reportMinute, 0, 0); |
| | | } |
| | | |
| | | // æ ¼å¼å |
| | | const startTime = formatDateTime(rawStart); |
| | | |
| | | const endPlusOne = new Date(rawEnd); |
| | | endPlusOne.setDate(endPlusOne.getDate()); |
| | | const newEndTime = formatDateTime(endPlusOne); |
| | | const selectProcesses = procseeValue.value; |
| | | const timeDifference = getDaysBetween(startTime, newEndTime) |
| | | if (timeDifference>180){ |
| | | ElMessage.warning(t('report.theTimeLimitCannotExceed180Days')) |
| | | gridOptions.loading = false |
| | | return |
| | | } |
| | | form.date1 = [startTime, newEndTime]; |
| | | request.post(`/report/teamOutput/${pageNum.value}/${total.pageSize}/${startTime}/${newEndTime}/${selectProcesses}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | total.value = res.data.footSum |
| | | total.dataTotal = res.data.total.total * 1 |
| | | total.pageTotal = res.data.total.pageTotal |
| | | pageTotal.value = res.data.total |
| | | produceList = res.data.data |
| | | produceList.forEach(item => { |
| | | item.mmTotal = sumMmValues(item.workProcessName); |
| | | const selectProcesses = procseeValue.value; |
| | | |
| | | const timeDifference = getDaysBetween(startTime, newEndTime); |
| | | if (timeDifference > 180) { |
| | | ElMessage.warning(t('report.theTimeLimitCannotExceed180Days')); |
| | | gridOptions.loading = false; |
| | | return; |
| | | } |
| | | |
| | | form.date1 = [startTime, newEndTime]; |
| | | |
| | | request.post(`/report/teamOutput/${pageNum.value}/${total.pageSize}/${startTime}/${newEndTime}/${selectProcesses}`, filterData.value) |
| | | .then((res) => { |
| | | if (res.code == 200) { |
| | | total.value = res.data.footSum; |
| | | total.dataTotal = res.data.total.total * 1; |
| | | total.pageTotal = res.data.total.pageTotal; |
| | | pageTotal.value = res.data.total; |
| | | |
| | | produceList = res.data.data; |
| | | produceList.forEach(item => { |
| | | item.mmTotal = sumMmValues(item.workProcessName); |
| | | }); |
| | | |
| | | xGrid.value.loadData(produceList); |
| | | gridOptions.loading = false; |
| | | } else { |
| | | ElMessage.warning(res.msg); |
| | | } |
| | | }); |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const sumMmValues = (workProcessName) => { |
| | | if (!workProcessName) return 0; |
| | | |
| | |
| | | filterData.value[column.property] = value |
| | | } |
| | | |
| | | // è§£æ company.reportTime |
| | | const [reportHourStr, reportMinuteStr] = company.reportTime.split(":"); |
| | | const reportHour = parseInt(reportHourStr); |
| | | const reportMinute = parseInt(reportMinuteStr); |
| | | |
| | | // åå§ form.date1 æ¯æ¥æå¯¹è±¡æ°ç» |
| | | const rawStart = new Date(form.date1[0]); |
| | | const rawEnd = new Date(form.date1[1]); |
| | | // 妿æ¶é´é¨åæ¯ 00:00ï¼å设置为 08:00 |
| | | if (rawStart.getHours() === 8 || rawStart.getHours() === 0) { |
| | | rawStart.setHours(8, 0, 0, 0); |
| | | |
| | | // 夿æ¶é´é¨åæ¯å¦éè¦ä¿®æ£ä¸º company.reportTime |
| | | const isZeroOrReport = (dateObj) => { |
| | | const h = dateObj.getHours(); |
| | | const m = dateObj.getMinutes(); |
| | | // 夿æ¡ä»¶ï¼æ¯ 00:00 æè
æ¯ reportTime 对åºçæ¶é´ |
| | | return (h === 0 && m === 0) || (h === reportHour && m === reportMinute); |
| | | }; |
| | | |
| | | if (isZeroOrReport(rawStart)) { |
| | | rawStart.setHours(reportHour, reportMinute, 0, 0); |
| | | } |
| | | if (rawEnd.getHours() === 8 || rawEnd.getHours() === 0) { |
| | | rawEnd.setHours(8, 0, 0, 0); |
| | | if (isZeroOrReport(rawEnd)) { |
| | | rawEnd.setHours(reportHour, reportMinute, 0, 0); |
| | | } |
| | | const startTime = formatDateTime(rawStart); |
| | | const endPlusOne = new Date(rawEnd); |
| | |
| | | {field: 'code', width: 100, title: t('reportingWorks.glassNumber')}, |
| | | {field: 'width', width: 90, title: t('order.width')}, |
| | | {field: 'height', width: 90, title: t('order.height')}, |
| | | {field: 'mmTotal', width: 90, title: t('order.totalThickness')}, |
| | | {field: 'thicknessSum',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, width: 90, title: t('order.totalThickness')}, |
| | | {field: 'thicknessArea', width: 90, title: t('report.thicknessArea')}, |
| | | { |
| | | field: 'deviceName', width: 140, title: t('machine.basicName'),filters:[{ data: '' }],slots: { filter: 'num1_filter' } |
| | | }, |
| | |
| | | if (columnIndex === 0) { |
| | | return t('basicData.total') |
| | | } |
| | | const List = ["completedQuantity",'area',] |
| | | const List = ["completedQuantity",'area','thicknessArea'] |
| | | if (List.includes(column.field)) { |
| | | //return footSum(data, column.field) |
| | | return total.value?.[column.field] ?? 0 |
| | |
| | | import DxfParser from 'dxf-parser'; |
| | | import { Leafer, Polygon,Ellipse,Line,Path } from 'leafer-ui' |
| | | import {round} from "xe-utils"; |
| | | import {add} from '@/utils/decimal' |
| | | const { t } = useI18n() |
| | | |
| | | const router = useRouter() |
| | |
| | | const value1 = value*1 |
| | | $grid.getTableData().visibleData.forEach((item,index) =>{ |
| | | if(index>=result.start && index<=result.end){ |
| | | |
| | | item[result.cell] = item[result.cell]*1+value1 |
| | | item[result.cell] =add(item[result.cell]*1,value1) |
| | | } |
| | | |
| | | }) |
| | |
| | | } |
| | | |
| | | @ApiOperation("è·¨å·¥åºæ¬¡ç ´") |
| | | @PostMapping("/crossProcessBreaking/{pageNum}/{pageSize}/{selectDate}") |
| | | @PostMapping("/crossProcessBreaking/{pageNum}/{pageSize}/{selectDate}/{reportTime}") |
| | | public Result getOrderReport(@PathVariable Integer pageNum, |
| | | @PathVariable Integer pageSize, |
| | | @PathVariable List<String> selectDate, |
| | | @PathVariable String reportTime, |
| | | @RequestBody CrossProcessBreakingDTO crossProcessBreakingDTO) { |
| | | return Result.success(reportService.crossProcessBreakingSv(pageNum, pageSize, selectDate, crossProcessBreakingDTO)); |
| | | return Result.success(reportService.crossProcessBreakingSv(pageNum, pageSize, selectDate,reportTime, crossProcessBreakingDTO)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("éè·¨å·¥åºæ¬¡ç ´") |
| | | @PostMapping("/notCrossProcessBreaking/{pageNum}/{pageSize}/{selectDate}") |
| | | @PostMapping("/notCrossProcessBreaking/{pageNum}/{pageSize}/{selectDate}/{reportTime}") |
| | | public Result notCrossProcessBreaking(@PathVariable Integer pageNum, |
| | | @PathVariable Integer pageSize, |
| | | @PathVariable List<String> selectDate, |
| | | @PathVariable String reportTime, |
| | | @RequestBody CrossProcessBreakingDTO crossProcessBreakingDTO) { |
| | | return Result.success(reportService.notCrossProcessBreakingSv(pageNum, pageSize, selectDate, crossProcessBreakingDTO)); |
| | | return Result.success(reportService.notCrossProcessBreakingSv(pageNum, pageSize, selectDate,reportTime, crossProcessBreakingDTO)); |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @ApiOperation("æ¬¡ç ´æç»æ¥è¡¨") |
| | | @PostMapping("/damageReport/{pageNum}/{pageSize}/{selectDate}") |
| | | @PostMapping("/damageReport/{pageNum}/{pageSize}/{selectDate}/{reportTime}") |
| | | public Result damageReport( |
| | | @PathVariable Integer pageNum, |
| | | @PathVariable Integer pageSize, |
| | | @PathVariable List<String> selectDate, |
| | | @PathVariable String reportTime, |
| | | @RequestBody DamageReportDTO damageReportDTO) { |
| | | return Result.success(reportService.selectDamageReportSv(pageNum, pageSize, selectDate, damageReportDTO)); |
| | | return Result.success(reportService.selectDamageReportSv(pageNum, pageSize, selectDate,reportTime, damageReportDTO)); |
| | | |
| | | } |
| | | |
| | |
| | | private String batch; |
| | | @ExcelProperty("订åç±»å") |
| | | private String orderType; |
| | | @ExcelProperty("å¨å¶åå度") |
| | | private String thicknessSum; |
| | | @ExcelProperty("å¹³æ¹æ¯«ç±³") |
| | | private String thicknessArea; |
| | | } |
| | |
| | | void updateProjectTemperingId(String projectNumber); |
| | | |
| | | List<Map<String, Object>> optimizeTemp(String projectNo); |
| | | |
| | | List<Map<String, Object>> selectTempProject(String processId); |
| | | } |
| | |
| | | int state2 = 0; |
| | | StringBuilder processId= new StringBuilder(); |
| | | List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("projectdetail")), FlowCard.class); |
| | | if (!flowCardList.isEmpty()) { |
| | | if(projectType.equals("2")){ |
| | | deleteProject(projectId,2); |
| | | if(projectType.equals("2")){ |
| | | deleteProject(projectId,2); |
| | | } |
| | | |
| | | // å建ä¸ä¸ªæ å°æ¥åå¨ (processId-technologyNumber) ç»åå° rack ç¼å·çæ å° |
| | | Map<String, Integer> rackMap = new HashMap<>(); |
| | | int rackCounter = 1; |
| | | |
| | | // å¦æä¸ºç©ºæµç¨å¡ï¼åå° type 设置为 1 |
| | | if (flowCardList == null || flowCardList.isEmpty()) { |
| | | type = 1; |
| | | } |
| | | for (FlowCard flowCard : flowCardList) { |
| | | // 为æ¯ä¸ªå¯ä¸ç processId-technologyNumber ç»ååé
rack ç¼å· |
| | | String key = flowCard.getProcessId() + "-" + flowCard.getTechnologyNumber(); |
| | | if (!rackMap.containsKey(key)) { |
| | | rackMap.put(key, rackCounter++); |
| | | } |
| | | int rackValue = rackMap.get(key); |
| | | |
| | | if(flowCard.getPatchState().equals(0)){ |
| | | state1=1; |
| | | //ç»æµç¨å¡è¡¨æ·»å 对åºçå·¥ç¨å· |
| | | Boolean a = glassOptimizeMapper.updateFlowCardProject(flowCard.getProcessId(),flowCard.getTechnologyNumber(),projectId); |
| | | // æ´æ°æµç¨å¡çrackåæ®µ |
| | | glassOptimizeMapper.updateFlowCardRack(flowCard.getProcessId(), flowCard.getTechnologyNumber(), rackValue); |
| | | area = glassOptimizeMapper.getSelectArea(flowCard.getProcessId(),flowCard.getTechnologyNumber()).doubleValue(); |
| | | sumArea = sumArea.add(BigDecimal.valueOf(area)); |
| | | sumQuantity +=flowCard.getQuantity(); |
| | | processId.append(flowCard.getProcessId()).append("-").append(flowCard.getTechnologyNumber()).append(";"); |
| | | }else{ |
| | | state2=1; |
| | | Boolean a=glassOptimizeMapper.updatePatchLogProject(flowCard.getProcessId(),flowCard.getTechnologyNumber(),projectId); |
| | | area = glassOptimizeMapper.getSelectAreaPatchLog(flowCard.getProcessId(),flowCard.getTechnologyNumber()).doubleValue(); |
| | | sumArea = sumArea.add(BigDecimal.valueOf(area)); |
| | | sumQuantity +=flowCard.getQuantity(); |
| | | processId.append(flowCard.getProcessId()).append("-").append(flowCard.getTechnologyNumber()).append(";"); |
| | | } |
| | | |
| | | // å建ä¸ä¸ªæ å°æ¥åå¨ (processId-technologyNumber) ç»åå° rack ç¼å·çæ å° |
| | | Map<String, Integer> rackMap = new HashMap<>(); |
| | | int rackCounter = 1; |
| | | } |
| | | if(state1==1&&state2==0){ |
| | | type=1; |
| | | }else if(state1==1&&state2==1){ |
| | | type=2; |
| | | } |
| | | |
| | | for (FlowCard flowCard : flowCardList) { |
| | | // 为æ¯ä¸ªå¯ä¸ç processId-technologyNumber ç»ååé
rack ç¼å· |
| | | String key = flowCard.getProcessId() + "-" + flowCard.getTechnologyNumber(); |
| | | if (!rackMap.containsKey(key)) { |
| | | rackMap.put(key, rackCounter++); |
| | | } |
| | | int rackValue = rackMap.get(key); |
| | | |
| | | if(flowCard.getPatchState().equals(0)){ |
| | | state1=1; |
| | | //ç»æµç¨å¡è¡¨æ·»å 对åºçå·¥ç¨å· |
| | | Boolean a = glassOptimizeMapper.updateFlowCardProject(flowCard.getProcessId(),flowCard.getTechnologyNumber(),projectId); |
| | | // æ´æ°æµç¨å¡çrackåæ®µ |
| | | glassOptimizeMapper.updateFlowCardRack(flowCard.getProcessId(), flowCard.getTechnologyNumber(), rackValue); |
| | | area = glassOptimizeMapper.getSelectArea(flowCard.getProcessId(),flowCard.getTechnologyNumber()).doubleValue(); |
| | | sumArea = sumArea.add(BigDecimal.valueOf(area)); |
| | | sumQuantity +=flowCard.getQuantity(); |
| | | processId.append(flowCard.getProcessId()).append("-").append(flowCard.getTechnologyNumber()).append(";"); |
| | | }else{ |
| | | state2=1; |
| | | Boolean a=glassOptimizeMapper.updatePatchLogProject(flowCard.getProcessId(),flowCard.getTechnologyNumber(),projectId); |
| | | area = glassOptimizeMapper.getSelectAreaPatchLog(flowCard.getProcessId(),flowCard.getTechnologyNumber()).doubleValue(); |
| | | sumArea = sumArea.add(BigDecimal.valueOf(area)); |
| | | sumQuantity +=flowCard.getQuantity(); |
| | | processId.append(flowCard.getProcessId()).append("-").append(flowCard.getTechnologyNumber()).append(";"); |
| | | } |
| | | |
| | | } |
| | | if(state1==1&&state2==0){ |
| | | type=1; |
| | | }else if(state1==1&&state2==1){ |
| | | type=2; |
| | | } |
| | | int index = optionVal.indexOf("mm"); |
| | | // è·å "mm" åé¢çé¨å |
| | | String glass_thickness = optionVal.substring(0, index); |
| | | // è·å "mm" åé¢çé¨å |
| | | String glass_type = optionVal.substring(index + 2); |
| | | if(projectType.equals("2")){ |
| | | glassOptimizeMapper.updateProjectMp(projectId,projectNmae,glass_thickness,glass_type,sumQuantity,sumArea.doubleValue(),userName, |
| | | int index = optionVal.indexOf("mm"); |
| | | // è·å "mm" åé¢çé¨å |
| | | String glass_thickness = optionVal.substring(0, index); |
| | | // è·å "mm" åé¢çé¨å |
| | | String glass_type = optionVal.substring(index + 2); |
| | | if(projectType.equals("2")){ |
| | | glassOptimizeMapper.updateProjectMp(projectId,projectNmae,glass_thickness,glass_type,sumQuantity,sumArea.doubleValue(),userName, |
| | | flowCardList.size(), String.valueOf(processId),type); |
| | | }else{ |
| | | if(glassOptimizeMapper.selectProjectCount(projectId)==null){ |
| | | glassOptimizeMapper.addProjectMp(projectId,projectNmae,glass_thickness,glass_type,sumQuantity,sumArea.doubleValue(),userName, |
| | | flowCardList.size(), String.valueOf(processId),type); |
| | | }else{ |
| | | if(glassOptimizeMapper.selectProjectCount(projectId)==null){ |
| | | glassOptimizeMapper.addProjectMp(projectId,projectNmae,glass_thickness,glass_type,sumQuantity,sumArea.doubleValue(),userName, |
| | | flowCardList.size(), String.valueOf(processId),type); |
| | | }else{ |
| | | TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint); |
| | | return "false1"; |
| | | } |
| | | TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint); |
| | | return "false1"; |
| | | } |
| | | }else { |
| | | return "false2"; |
| | | |
| | | } |
| | | } catch (Exception e) { |
| | | TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint); |
| | |
| | | public Map<String, Object> getProductListSv(String processId) { |
| | | Map<String, Object> productMap = new HashMap<>(); |
| | | List<Map<String, Object>> productInfo = glassOptimizeMapper.selectProjectList(processId); |
| | | List<Map<String, Object>> tempProductInfo = glassOptimizeMapper.selectTempProject(processId); |
| | | productInfo.addAll(tempProductInfo); |
| | | productMap.put("productInfo", productInfo); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | |
| | |
| | | // æç
§ processCard åç» |
| | | Map<String, List<Map<String, Object>>> groupedByProcessCard = new HashMap<>(); |
| | | for (Map<String, Object> item : productInfo) { |
| | | String processCard = (String) item.get("processCard"); |
| | | String processCard = String.valueOf(item.get("processCard")); |
| | | if (processCard != null) { |
| | | groupedByProcessCard.computeIfAbsent(processCard, k -> new ArrayList<>()).add(item); |
| | | } |
| | |
| | | import java.sql.Date; |
| | | import java.sql.SQLOutput; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.concurrent.*; |
| | | import java.util.function.Function; |
| | |
| | | // return map; |
| | | // } |
| | | |
| | | private static String to080000(String s) { |
| | | if (s == null || s.isEmpty()) return null; |
| | | String v = s.trim(); |
| | | // åªä¿çæ¥æé¨åï¼å10ä½ yyyy-MM-ddï¼ |
| | | String datePart = v.length() >= 10 ? v.substring(0, 10) : v; |
| | | return datePart + " 08:00:00"; |
| | | |
| | | private static final DateTimeFormatter DATE_TIME_FMT = |
| | | DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | private String toReportTime(String dateStr, String reportTime) { |
| | | if (dateStr == null || dateStr.isEmpty()) { |
| | | return null; |
| | | } |
| | | |
| | | // åªä¿ç yyyy-MM-ddï¼é²æ¢åç«¯ä¼ å®æ´æ¶é´å¯¼è´ parse å¼å¸¸ |
| | | String onlyDate = dateStr.length() > 10 ? dateStr.substring(0, 10) : dateStr; |
| | | |
| | | |
| | | String[] parts = reportTime.split(":"); |
| | | int hour = Integer.parseInt(parts[0]); |
| | | int minute = parts.length > 1 ? Integer.parseInt(parts[1]) : 0; |
| | | int second = parts.length > 2 ? Integer.parseInt(parts[2]) : 0; |
| | | |
| | | LocalDate date = LocalDate.parse(onlyDate); |
| | | LocalTime time = LocalTime.of(hour, minute, second); |
| | | |
| | | return LocalDateTime.of(date, time).format(DATE_TIME_FMT); |
| | | } |
| | | //è·¨å·¥åºæ¬¡ç ´ |
| | | public Map<String, Object> crossProcessBreakingSv(Integer pageNum, Integer pageSize, |
| | | List<String> selectDate, |
| | | String reportTime, |
| | | CrossProcessBreakingDTO crossProcessBreakingDTO) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | |
| | | // é»è®¤æ¶é´èå´ï¼è¿å» 15 天 |
| | | String startDate = to080000(LocalDate.now().minusDays(15).toString()); |
| | | String endDate = to080000(LocalDate.now().toString()); |
| | | // é»è®¤æ¶é´èå´ï¼è¿å» 15 å¤©ï¼æ¥æ + reportTimeï¼ |
| | | String startDate = toReportTime(LocalDate.now().minusDays(15).toString(), reportTime); |
| | | String endDate = toReportTime(LocalDate.now().toString(), reportTime); |
| | | |
| | | // 妿åç«¯ä¼ äºæ¶é´ï¼å°±ç¨åç«¯æ¥æ + reportTime |
| | | if (selectDate != null && selectDate.size() == 2) { |
| | | if (selectDate.get(0) != null && !selectDate.get(0).isEmpty()) { |
| | | startDate = to080000(selectDate.get(0)); |
| | | startDate = toReportTime(selectDate.get(0), reportTime); |
| | | } |
| | | if (selectDate.get(1) != null && !selectDate.get(1).isEmpty()) { |
| | | endDate = to080000(selectDate.get(1)); |
| | | endDate = toReportTime(selectDate.get(1), reportTime); |
| | | } |
| | | } |
| | | |
| | |
| | | // 使ç¨å¼æ¥çº¿ç¨æ± |
| | | String finalEndDate = endDate; |
| | | String finalStartDate = startDate; |
| | | System.out.println(finalEndDate+"==="+finalStartDate); |
| | | CompletableFuture<List<CrossProcessBreakingDTO>> dataFuture = asyncExecutor.runAsync(() -> |
| | | reportMapper.getProcessBreaking(offset, pageSize, finalStartDate, finalEndDate, crossProcessBreakingDTO)); |
| | | |
| | |
| | | //éè·¨å·¥åºæ¬¡ç ´ |
| | | public Map<String, Object> notCrossProcessBreakingSv(Integer pageNum, Integer pageSize, |
| | | List<String> selectDate, |
| | | String reportTime, |
| | | CrossProcessBreakingDTO crossProcessBreakingDTO) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | |
| | | // é»è®¤æ¶é´èå´ï¼è¿å» 15 天 |
| | | String startDate = to080000(LocalDate.now().minusDays(15).toString()); |
| | | String endDate = to080000(LocalDate.now().toString()); |
| | | // é»è®¤æ¶é´èå´ï¼è¿å» 15 å¤©ï¼æ¥æ + reportTimeï¼ |
| | | String startDate = toReportTime(LocalDate.now().minusDays(15).toString(), reportTime); |
| | | String endDate = toReportTime(LocalDate.now().toString(), reportTime); |
| | | |
| | | // 妿åç«¯ä¼ äºæ¶é´ï¼å°±ç¨åç«¯æ¥æ + reportTime |
| | | if (selectDate != null && selectDate.size() == 2) { |
| | | if (selectDate.get(0) != null && !selectDate.get(0).isEmpty()) { |
| | | startDate = to080000(selectDate.get(0)); |
| | | startDate = toReportTime(selectDate.get(0), reportTime); |
| | | } |
| | | if (selectDate.get(1) != null && !selectDate.get(1).isEmpty()) { |
| | | endDate = to080000(selectDate.get(1)); |
| | | endDate = toReportTime(selectDate.get(1), reportTime); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | public Map<String, Object> selectDamageReportSv(Integer pageNum, Integer pageSize, |
| | | List<String> selectDate, |
| | | String reportTime, |
| | | DamageReportDTO damageReportDTO) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | // é»è®¤æ¶é´èå´ï¼è¿å» 15 天 |
| | | String startDate = to080000(LocalDate.now().minusDays(15).toString()); |
| | | String endDate = to080000(LocalDate.now().toString()); |
| | | |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | |
| | | |
| | | // é»è®¤æ¶é´èå´ï¼è¿å» 15 å¤©ï¼æ¥æ + reportTimeï¼ |
| | | String startDate = toReportTime(LocalDate.now().minusDays(15).toString(), reportTime); |
| | | String endDate = toReportTime(LocalDate.now().toString(), reportTime); |
| | | |
| | | // 妿åç«¯ä¼ äºæ¶é´ï¼å°±ç¨åç«¯æ¥æ + reportTime |
| | | if (selectDate != null && selectDate.size() == 2) { |
| | | if (selectDate.get(0) != null && !selectDate.get(0).isEmpty()) { |
| | | startDate = to080000(selectDate.get(0)); |
| | | startDate = toReportTime(selectDate.get(0), reportTime); |
| | | } |
| | | if (selectDate.get(1) != null && !selectDate.get(1).isEmpty()) { |
| | | endDate = to080000(selectDate.get(1)); |
| | | endDate = toReportTime(selectDate.get(1), reportTime); |
| | | } |
| | | } |
| | | Map<String, Object> result = new HashMap<>(); |
| | | String finalEndDate = endDate; |
| | | String finalStartDate = startDate; |
| | | // 弿¥ä»»å¡å®ä¹ |
| | | |
| | | Map<String, Object> result = new HashMap<>(); |
| | | String finalStartDate = startDate; |
| | | String finalEndDate = endDate; |
| | | |
| | | // 弿¥ä»»å¡å®ä¹ |
| | | CompletableFuture<List<DamageReportDTO>> dataFuture = asyncExecutor.runAsync(() -> |
| | | reportMapper.selectDamageReportMp(offset, pageSize, finalStartDate, finalEndDate, damageReportDTO)); |
| | | |
| | |
| | | CompletableFuture<Map<String, Float>> footSumFuture = asyncExecutor.runAsync(() -> |
| | | reportMapper.damageReportFootSum(finalStartDate, finalEndDate, damageReportDTO)); |
| | | |
| | | //çå¾
å
¨é¨ä»»å¡å®æ |
| | | // çå¾
å
¨é¨ä»»å¡å®æ |
| | | CompletableFuture.allOf(dataFuture, totalFuture, footSumFuture).join(); |
| | | |
| | | try { |
| | |
| | | e.printStackTrace(); |
| | | throw new RuntimeException("å¹¶è¡æ¥è¯¢å¼å¸¸ï¼" + e.getMessage(), e); |
| | | } |
| | | |
| | | // åä¼ åç«¯çæ¶é´ï¼ç°å¨æ¯å¸¦æ¶åç§çï¼ |
| | | List<String> list = new ArrayList<>(); |
| | | list.add(startDate); |
| | | list.add(endDate); |
| | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | public Map<String, Object> splittingDetailsOutsideSv(String orderId, Report report) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | } |
| | | String inputVal= (String) dates.get("inputVal"); |
| | | String project= (String) dates.get("project"); |
| | | String terminationVals= (String) dates.get("terminationVals"); |
| | | if ("null".equals(inputVal)) { |
| | | String terminationVals= dates.get("terminationVals").toString();; |
| | | if (inputVal==null) { |
| | | inputVal = ""; |
| | | } |
| | | if ("null".equals(project)) { |
| | | if (project==null) { |
| | | project = ""; |
| | | } |
| | | if ("null".equals(terminationVals)) { |
| | | if (terminationVals==null) { |
| | | terminationVals = ""; |
| | | } |
| | | List<WorkInProgressDTO> dataList1 =reportMapper.exportWorkInProgressMp(process,inputVal,project,terminationVals); |
| | |
| | | } |
| | | String inputVal= (String) dates.get("inputVal"); |
| | | String project= (String) dates.get("project"); |
| | | String terminationVals= (String) dates.get("terminationVals"); |
| | | if ("null".equals(inputVal)) { |
| | | String terminationVals= dates.get("terminationVals").toString();; |
| | | if (inputVal==null) { |
| | | inputVal = ""; |
| | | } |
| | | if ("null".equals(project)) { |
| | | if (project==null) { |
| | | project = ""; |
| | | } |
| | | if ("null".equals(terminationVals)) { |
| | | if (terminationVals==null) { |
| | | terminationVals = ""; |
| | | } |
| | | |
| | |
| | | // 设置宽度 |
| | | rasterizationOptions.setPageWidth(1000); |
| | | // 设置é«åº¦ |
| | | rasterizationOptions.setPageHeight(1000); |
| | | rasterizationOptions.setPageHeight(700); |
| | | // è°ç¨è¿ä¸ªsetEmbedBackgroundæ¹æ³æ¥è®¾ç½®èæ¯è²æ¯å¦ä¸çäºè¾åºæ ¼å¼çé»è®¤èæ¯è² |
| | | //rasterizationOptions.setEmbedBackground(true); |
| | | // 为çæçå¾åå建ä¸ä¸ªPngOptionsçå®ä¾ï¼å¹¶å°å
¶åé
ç»ImageOptionsBaseç±»çå®ä¾ã |
| | |
| | | o_width, |
| | | o_height |
| | | </select> |
| | | <select id="selectTempProject" resultType="java.util.Map" parameterType="java.lang.String"> |
| | | SELECT |
| | | project_no, |
| | | o_width as width, |
| | | o_height as height, |
| | | rack_no as order_number, |
| | | layer as processCard, |
| | | COUNT(*) as quantity, |
| | | ROUND(o_width * o_height * COUNT(*) / 1000000, 4) as Area |
| | | FROM |
| | | pp.`optimize_detail` |
| | | WHERE |
| | | project_no = #{processId} |
| | | AND process_id = '' |
| | | GROUP BY |
| | | project_no, |
| | | layer, |
| | | o_width, |
| | | o_height, |
| | | rack_no |
| | | ORDER BY |
| | | o_width, |
| | | o_height |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | <result column="workProcessName" property="workProcessName"/> |
| | | <result column="device_name" property="deviceName"/> |
| | | <result column="order_type" property="orderType"/> |
| | | <result column="thicknessSum" property="thicknessSum"/> |
| | | <result column="thicknessArea" property="thicknessArea"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="scheduleProductionScheduleMap" type="com.example.erp.dto.pp.ScheduleProductionScheduleDTO"> |
| | |
| | | |
| | | <select id="teamOutputMp" resultMap="teamOutputMap"> |
| | | SELECT |
| | | * |
| | | t.*, |
| | | -- ç»çæ»å度ï¼mmï¼ |
| | | ( |
| | | SELECT SUM(CAST(REGEXP_SUBSTR(seg, '^[0-9]+') AS UNSIGNED)) |
| | | FROM JSON_TABLE( |
| | | CONCAT('["', REPLACE(t.workProcessName, '+', '","'), '"]'), |
| | | '$[*]' COLUMNS (seg VARCHAR(100) PATH '$') |
| | | ) jt |
| | | ) AS thicknessSum, |
| | | ROUND( |
| | | ( |
| | | SELECT SUM(CAST(REGEXP_SUBSTR(seg, '^[0-9]+') AS UNSIGNED)) |
| | | FROM JSON_TABLE( |
| | | CONCAT('["', REPLACE(t.workProcessName, '+', '","'), '"]'), |
| | | '$[*]' COLUMNS (seg VARCHAR(100) PATH '$') |
| | | ) jt2 |
| | | ) * t.area, |
| | | 2 |
| | | ) AS thicknessArea |
| | | FROM |
| | | ( |
| | | SELECT |
| | |
| | | <if test="teamOutputDTO.workProcessName != null and teamOutputDTO.workProcessName != ''"> |
| | | AND t.workProcessName REGEXP #{teamOutputDTO.workProcessName} |
| | | </if> |
| | | HAVING 1 = 1 |
| | | <if test="teamOutputDTO.thicknessSum != null and teamOutputDTO.thicknessSum != ''"> |
| | | AND thicknessSum REGEXP #{teamOutputDTO.thicknessSum} |
| | | </if> |
| | | ORDER BY |
| | | t.this_process, |
| | | t.process_id, |
| | |
| | | |
| | | <select id="teamOutputPageTotal"> |
| | | SELECT |
| | | CEILING(count(*)/#{pageSize}) as 'pageTotal', |
| | | count(*) as 'total' |
| | | FROM |
| | | CEILING(COUNT(*) / #{pageSize}) AS pageTotal, |
| | | COUNT(*) AS total |
| | | FROM ( |
| | | |
| | | SELECT |
| | | t.*, |
| | | |
| | | CASE |
| | | WHEN t.workProcessName IS NULL OR t.workProcessName = '' THEN 0 |
| | | ELSE ( |
| | | SELECT SUM(CAST(REGEXP_SUBSTR(seg, '^[0-9]+') AS UNSIGNED)) |
| | | FROM JSON_TABLE( |
| | | CONCAT('["', REPLACE(t.workProcessName, '+', '","'), '"]'), |
| | | '$[*]' COLUMNS (seg VARCHAR(100) PATH '$') |
| | | ) jt |
| | | ) |
| | | END AS thicknessSum, |
| | | CASE |
| | | WHEN t.workProcessName IS NULL OR t.workProcessName = '' THEN 0 |
| | | ELSE ROUND( |
| | | ( |
| | | SELECT SUM(CAST(REGEXP_SUBSTR(seg2, '^[0-9]+') AS UNSIGNED)) |
| | | FROM JSON_TABLE( |
| | | CONCAT('["', REPLACE(t.workProcessName, '+', '","'), '"]'), |
| | | '$[*]' COLUMNS (seg2 VARCHAR(100) PATH '$') |
| | | ) jt2 |
| | | ) * t.area, |
| | | 2 |
| | | ) |
| | | END AS thicknessArea |
| | | FROM ( |
| | | SELECT |
| | | rw.reporting_work_time, |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | o.project, |
| | | o.order_id, |
| | | rw.process_id, |
| | | fc.order_number, |
| | | MAX( ogd.child_width ) as width, |
| | | MAX( ogd.child_height ) as height, |
| | | MAX(ogd.child_width) AS width, |
| | | MAX(ogd.child_height) AS height, |
| | | od.edging_type, |
| | | rwd.completed_quantity as completed_quantity, |
| | | ROUND(MAX( ogd.child_width )*MAX( ogd.child_height )*rwd.completed_quantity/1000000,2) as area, |
| | | rwd.completed_quantity AS completed_quantity, |
| | | ROUND(MAX(ogd.child_width) * MAX(ogd.child_height) * rwd.completed_quantity / 1000000, 2) AS area, |
| | | od.product_name, |
| | | JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) AS code |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')) AS code, |
| | | rw.reviewed, |
| | | rw.examine_time, |
| | | rw.device_name, |
| | | o.order_type, |
| | | CASE |
| | | WHEN LOCATE('step', #{laminating}) > 0 THEN GROUP_CONCAT(ogd.glass_child SEPARATOR '+') |
| | | ELSE MAX(ogd.glass_child) |
| | | END AS workProcessName, |
| | | o.batch |
| | | FROM |
| | | pp.reporting_work as rw left join pp.reporting_work_detail as rwd on rwd.reporting_work_id=rw.reporting_work_id |
| | | left join pp.flow_card as fc on fc.order_id=rw.order_id and fc.process_id=rw.process_id and fc.order_number=rwd.order_number and fc.technology_number=rwd.technology_number |
| | | left join sd.order_glass_detail as ogd on ogd.order_id=fc.order_id and ogd.order_number=fc.order_number and ogd.technology_number=fc.technology_number |
| | | left join sd.order_detail as od on od.order_id=ogd.order_id and od.order_number=ogd.order_number |
| | | left join sd.`order` as o on o.order_id=od.order_id |
| | | where o.create_order>0 and rw.reviewed_state>=0 and rwd.completed_quantity>0 and |
| | | rw.reporting_work_time >= #{selectTime1} |
| | | pp.reporting_work AS rw |
| | | LEFT JOIN pp.reporting_work_detail AS rwd |
| | | ON rwd.reporting_work_id = rw.reporting_work_id |
| | | LEFT JOIN pp.flow_card AS fc |
| | | ON fc.order_id = rw.order_id |
| | | AND fc.process_id = rw.process_id |
| | | AND fc.order_number = rwd.order_number |
| | | AND fc.technology_number = rwd.technology_number |
| | | LEFT JOIN sd.order_glass_detail AS ogd |
| | | ON ogd.order_id = fc.order_id |
| | | AND ogd.order_number = fc.order_number |
| | | AND ogd.technology_number = fc.technology_number |
| | | LEFT JOIN sd.order_detail AS od |
| | | ON od.order_id = ogd.order_id |
| | | AND od.order_number = ogd.order_number |
| | | LEFT JOIN sd.`order` AS o |
| | | ON o.order_id = od.order_id |
| | | WHERE |
| | | o.create_order > 0 |
| | | AND rw.reviewed_state >= 0 |
| | | AND rwd.completed_quantity > 0 |
| | | AND rw.reporting_work_time >= #{selectTime1} |
| | | AND rw.reporting_work_time < #{selectTime2} |
| | | and position(#{selectProcesses} in rw.this_process) |
| | | <choose> |
| | | <!-- æä¼ å·¥åºï¼ç²¾ç¡®å¹é
--> |
| | | <when test="selectProcesses != null and selectProcesses != ''"> |
| | | AND rw.this_process = #{selectProcesses} |
| | | </when> |
| | | <!-- æªä¼ å·¥åºï¼ä¸å éå¶ --> |
| | | <otherwise> |
| | | </otherwise> |
| | | </choose> |
| | | <if test="teamOutputDTO.thisProcess != null and teamOutputDTO.thisProcess != ''"> |
| | | and rw.this_process regexp #{teamOutputDTO.thisProcess} |
| | | AND rw.this_process REGEXP #{teamOutputDTO.thisProcess} |
| | | </if> |
| | | <if test="teamOutputDTO.teamsGroupsName != null and teamOutputDTO.teamsGroupsName != ''"> |
| | | and rw.teams_groups_name like concat('%', #{teamOutputDTO.teamsGroupsName}, '%') |
| | | AND rw.teams_groups_name LIKE CONCAT('%', #{teamOutputDTO.teamsGroupsName}, '%') |
| | | </if> |
| | | <if test="teamOutputDTO.project != null and teamOutputDTO.project != ''"> |
| | | and o.project regexp #{teamOutputDTO.project} |
| | | AND o.project REGEXP #{teamOutputDTO.project} |
| | | </if> |
| | | <if test="teamOutputDTO.processId != null and teamOutputDTO.processId != ''"> |
| | | and rw.process_id regexp #{teamOutputDTO.processId} |
| | | AND rw.process_id REGEXP #{teamOutputDTO.processId} |
| | | </if> |
| | | <if test="teamOutputDTO.edgingType != null and teamOutputDTO.edgingType != ''"> |
| | | and od.edging_type regexp #{teamOutputDTO.edgingType} |
| | | AND od.edging_type REGEXP #{teamOutputDTO.edgingType} |
| | | </if> |
| | | <if test="teamOutputDTO.deviceName != null and teamOutputDTO.deviceName != ''"> |
| | | AND rw.device_name REGEXP #{teamOutputDTO.deviceName} |
| | | </if> |
| | | <if test="teamOutputDTO.batch != null and teamOutputDTO.batch != ''"> |
| | | AND o.batch REGEXP #{teamOutputDTO.batch} |
| | | </if> |
| | | |
| | | <choose> |
| | | <when test="laminating == ''"> |
| | | GROUP BY |
| | |
| | | rwd.order_number |
| | | </otherwise> |
| | | </choose> |
| | | ORDER BY |
| | | rw.this_process, |
| | | rw.process_id, |
| | | rwd.order_number, |
| | | rw.reporting_work_time, |
| | | rw.teams_groups_name |
| | | ) as page_toal |
| | | ) t |
| | | WHERE 1 = 1 |
| | | <if test="teamOutputDTO.workProcessName != null and teamOutputDTO.workProcessName != ''"> |
| | | AND t.workProcessName REGEXP #{teamOutputDTO.workProcessName} |
| | | </if> |
| | | ) x |
| | | WHERE 1 = 1 |
| | | <if test="teamOutputDTO.thicknessSum != null and teamOutputDTO.thicknessSum != ''"> |
| | | AND x.thicknessSum REGEXP #{teamOutputDTO.thicknessSum} |
| | | </if> |
| | | <if test="teamOutputDTO.thicknessArea != null and teamOutputDTO.thicknessArea != ''"> |
| | | AND x.thicknessArea REGEXP #{teamOutputDTO.thicknessArea} |
| | | </if> |
| | | limit #{offset},#{pageSize} |
| | | </select> |
| | | |
| | |
| | | |
| | | <select id="teamOutputFootSum"> |
| | | SELECT |
| | | SUM(completed_quantity) as completedQuantity, |
| | | ifnull(SUM(ROUND(width * height * completed_quantity / 1000000, 2)),0) AS area |
| | | FROM |
| | | -- æ°éå计 |
| | | SUM(x.completed_quantity) AS completedQuantity, |
| | | -- é¢ç§¯å计 |
| | | IFNULL(SUM(x.area), 0) AS area, |
| | | -- å度Ãé¢ç§¯å计 |
| | | IFNULL(SUM(x.thicknessArea), 0) AS thicknessArea |
| | | FROM ( |
| | | /* 第 2 å±ï¼å¨è¿éæ ¹æ® workProcessName è®¡ç® thicknessSum / thicknessArea */ |
| | | SELECT |
| | | t.*, |
| | | /* ç»çæ»å度ï¼åªåæ¯æ®µåé¢çæ°åç¸å */ |
| | | CASE |
| | | WHEN t.workProcessName IS NULL OR t.workProcessName = '' THEN 0 |
| | | ELSE ( |
| | | SELECT SUM(CAST(REGEXP_SUBSTR(seg, '^[0-9]+') AS UNSIGNED)) |
| | | FROM JSON_TABLE( |
| | | CAST(CONCAT('["', REPLACE(t.workProcessName, '+', '","'), '"]') AS JSON), |
| | | '$[*]' COLUMNS (seg VARCHAR(100) PATH '$') |
| | | ) jt |
| | | ) |
| | | END AS thicknessSum, |
| | | /* å度 à é¢ç§¯ */ |
| | | CASE |
| | | WHEN t.workProcessName IS NULL OR t.workProcessName = '' THEN 0 |
| | | ELSE ROUND( |
| | | ( |
| | | SELECT SUM(CAST(REGEXP_SUBSTR(seg2, '^[0-9]+') AS UNSIGNED)) |
| | | FROM JSON_TABLE( |
| | | CAST(CONCAT('["', REPLACE(t.workProcessName, '+', '","'), '"]') AS JSON), |
| | | '$[*]' COLUMNS (seg2 VARCHAR(100) PATH '$') |
| | | ) jt2 |
| | | ) * t.area, |
| | | 2 |
| | | ) |
| | | END AS thicknessArea |
| | | FROM ( |
| | | /* 第 1 å±ï¼åªè´è´£ç®å¥½ workProcessNameãarea çåºç¡å段 */ |
| | | SELECT |
| | | rw.reporting_work_time, |
| | | rw.this_process, |
| | |
| | | AND rw.this_process REGEXP #{teamOutputDTO.thisProcess} |
| | | </if> |
| | | <if test="teamOutputDTO.teamsGroupsName != null and teamOutputDTO.teamsGroupsName != ''"> |
| | | and rw.teams_groups_name like concat('%', #{teamOutputDTO.teamsGroupsName}, '%') |
| | | AND rw.teams_groups_name LIKE CONCAT('%', #{teamOutputDTO.teamsGroupsName}, '%') |
| | | </if> |
| | | <if test="teamOutputDTO.project != null and teamOutputDTO.project != ''"> |
| | | AND o.project REGEXP #{teamOutputDTO.project} |
| | |
| | | <if test="teamOutputDTO.workProcessName != null and teamOutputDTO.workProcessName != ''"> |
| | | AND t.workProcessName REGEXP #{teamOutputDTO.workProcessName} |
| | | </if> |
| | | ORDER BY |
| | | t.this_process, |
| | | t.process_id, |
| | | t.order_number, |
| | | t.reporting_work_time, |
| | | t.teams_groups_name |
| | | ) x |
| | | WHERE 1 = 1 |
| | | <if test="teamOutputDTO.thicknessSum != null and teamOutputDTO.thicknessSum != ''"> |
| | | AND x.thicknessSum REGEXP #{teamOutputDTO.thicknessSum} |
| | | </if> |
| | | <if test="teamOutputDTO.thicknessArea != null and teamOutputDTO.thicknessArea != ''"> |
| | | AND x.thicknessArea REGEXP #{teamOutputDTO.thicknessArea} |
| | | </if> |
| | | ; |
| | | |
| | | |
| | | </select> |
| | | |
| | | <select id="getLaminating"> |
| | |
| | | when 'stepD' then 4 |
| | | when 'stepB' then 4 |
| | | else 1 |
| | | end as sort, |
| | | end as sortByprocess, |
| | | b.sort as 'sort2' |
| | | |
| | | |
| | |
| | | group by opd.id) as a |
| | | GROUP BY process) as sort1 |
| | | on sort1.process = a.process |
| | | order by sort,sort2,sort1.count,id |
| | | order by sortByprocess,sort1.count,sort2,id |
| | | |
| | | </select> |
| | | |