| | |
| | | TaskCompletionStatus:'Task completion report', |
| | | rawMaterialRequisition:'Raw material requisition report', |
| | | qualityReport:'Quality statement', |
| | | productionScheduling:'Production scheduling report', |
| | | yieldReport:'Yield report', |
| | | workingProcedure:'Process', |
| | | inventoryArea:'Stock area', |
| | |
| | | TaskCompletionStatus:'任务完成情况报表', |
| | | rawMaterialRequisition:'原片领料报表', |
| | | qualityReport:'品质报表', |
| | | productionScheduling:'排产计划报表', |
| | | yieldReport:'成品率报表', |
| | | workingProcedure:'工序', |
| | | inventoryArea:'库存面积', |
| | |
| | | component: () => import('../views/pp/report/DamageReport.vue'), |
| | | }, |
| | | { |
| | | //跨工序次破报表 |
| | | //订单排产计划 |
| | | path: 'scheduleProductionSchedule', |
| | | name: 'scheduleProductionSchedule', |
| | | component: () => import('../views/pp/report/ScheduleProductionSchedule.vue'), |
| | | }, |
| | | { |
| | | //排产计划 |
| | | path: 'crossProcessBreaking', |
| | | name: 'crossProcessBreaking', |
| | | component: () => import('../views/pp/report/crossProcessBreaking.vue'), |
| | |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 50},//鼠标移动或选择高亮 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 30},//鼠标移动或选择高亮 |
| | | id: 'productionScheduling', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | |
| | | storage: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | trigger: 'dblclick', |
| | | mode: 'row', |
| | | showStatus: true |
| | | }, |
| | |
| | | editRender: {name: 'input', attrs: {placeholder: '', type: 'date'}}, |
| | | title: t('processCard.planEndTime') |
| | | }, |
| | | { |
| | | field: 'schedulingQuantity', |
| | | width: 120, |
| | | editRender: {name: 'input', attrs: {placeholder: ''}}, |
| | | title: t('processCard.productionSchedulingQuantity'), |
| | | sortable: true |
| | | }, |
| | | {field: 'notes', title: t('processCard.notes'), editRender: {name: 'input', attrs: {placeholder: ''}}, width: 120}, |
| | | |
| | | // {field: '排产编号', title: '排产编号', width: 120 }, |
| | | { |
| | | field: 'orderGlassDetail.orderId', |
| | |
| | | }, |
| | | {field: 'orderDetail.quantity', title: t('processCard.orderQuantity'), width: 90}, |
| | | {field: 'orderGlassDetail.area', title: t('processCard.orderArea'), width: 90}, |
| | | { |
| | | field: 'schedulingQuantity', |
| | | width: 120, |
| | | editRender: {name: 'input', attrs: {placeholder: ''}}, |
| | | title: t('processCard.productionSchedulingQuantity'), |
| | | sortable: true |
| | | }, |
| | | |
| | | {field: 'pendingProductionQuantity', title: t('processCard.quantityToScheduled'), width: 100}, |
| | | {field: 'pendingProductionArea', title: t('processCard.areaToScheduled'), width: 100}, |
| | | {field: 'productionScheduledQuantity', title: t('processCard.plannedProductionQuantity'), width: 100}, |
| | |
| | | {field: 'reviewer', title: t('processCard.reviewed'), width: 80}, |
| | | {field: 'orderDetail.productName', title: t('order.product'), width: 140}, |
| | | {field: 'orderDetail.shape', title: t('order.shape'), width: 80}, |
| | | {field: 'notes', title: t('processCard.notes'), editRender: {name: 'input', attrs: {placeholder: ''}}, width: 120}, |
| | | {field: 'schedulingId', title: t('processCard.schedulingId'), width: 120}, |
| | | ],//表头按钮 |
| | | |
| | |
| | | ElMessage.warning("请勾选排产数据") |
| | | return; |
| | | } |
| | | const type = await VXETable.modal.confirm('您确定要删除该数据?') |
| | | if (type === 'confirm') { |
| | | let schedulingData = ref({ |
| | | scheduling: selectRecords, |
| | | }) |
| | | |
| | | request.post("/productionScheduling/deleteScheduling", schedulingData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | ElMessage.success("删除成功") |
| | | location.reload(); |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | |
| | | } |
| | | }) |
| | | } |
| | | selectRecords.forEach(item => { |
| | | if(item.reviewStatus=="已审核"){ |
| | | ElMessage.warning("不能删除已审核数据") |
| | | return; |
| | | } |
| | | }); |
| | | alert(1111) |
| | | // const type = await VXETable.modal.confirm('您确定要删除该数据?') |
| | | // if (type === 'confirm') { |
| | | // let schedulingData = ref({ |
| | | // scheduling: selectRecords, |
| | | // }) |
| | | // |
| | | // request.post("/productionScheduling/deleteScheduling", schedulingData.value).then((res) => { |
| | | // if (res.code == 200) { |
| | | // ElMessage.success("删除成功") |
| | | // location.reload(); |
| | | // } else { |
| | | // ElMessage.warning(res.msg) |
| | | // |
| | | // } |
| | | // }) |
| | | // } |
| | | } |
| | | return; |
| | | } |
| | |
| | | const table = $grid.getTableData().fullData |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | let selectState = stateValue.value |
| | | table.forEach((selectRecords) => { |
| | | if (selectRecords.scheduling_quantity > selectRecords.pendingProductionQuantity && selectState == 1) { |
| | | selectRecords.forEach((selectRecords) => { |
| | | console.log(selectRecords) |
| | | if (selectRecords.schedulingQuantity > selectRecords.pendingProductionQuantity) { |
| | | ElMessage.warning("排产数量不能大于待排产数量") |
| | | //禁用保存按钮 |
| | | //gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | } |
| | | |
| | | |
| | | }) |
| | | } |
| | | const checkBoxConfig = { |
| | | checkMethod: ({ row }) => { |
| | | console.log(row) |
| | | if (row['reviewStatus']==="已审核"){ |
| | | return row.disable |
| | | }else{ |
| | | return !row.disable |
| | | } |
| | | |
| | | }, |
| | | reserve:true |
| | | |
| | | } |
| | | |
| | | </script> |
| | | |
| | |
| | | v-on="gridEvents" |
| | | @filter-change="filterChanged" |
| | | @checkbox-change="determineNum" |
| | | :checkbox-config="checkBoxConfig" |
| | | > |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |
| | | <!-- 下拉显示所有信息插槽--> |
| | |
| | | |
| | | //获取七天前到当前时间 |
| | | function getNowTime() { |
| | | const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 7) |
| | | const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 15) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0, 10) //默认开始时间7天前 |
| | |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 50},//鼠标移动或选择高亮 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 30},//鼠标移动或选择高亮 |
| | | id: 'DamageReport', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | id: 'EquipmentOutput', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | id: 'OrderBOMOutside', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 50},//鼠标移动或选择高亮 |
| | | rowConfig: {isCurrent: true, isHover: true, height:30},//鼠标移动或选择高亮 |
| | | id: 'OrderPlanDecomposition', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 50},//鼠标移动或选择高亮 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 30},//鼠标移动或选择高亮 |
| | | id: 'ProcessToBeCompleted', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 50},//鼠标移动或选择高亮 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 30},//鼠标移动或选择高亮 |
| | | id: 'QualityReport', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 50},//鼠标移动或选择高亮 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 30},//鼠标移动或选择高亮 |
| | | id: 'RawMaterialRequisition', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | |
| | | <el-menu-item index="/main/report/RawMaterialRequisition">{{$t('report.rawMaterialRequisition')}}</el-menu-item> |
| | | <el-menu-item index="/main/report/QualityReport">{{$t('report.qualityReport')}}</el-menu-item> |
| | | <el-menu-item index="/main/report/Yield">{{$t('report.yieldReport')}}</el-menu-item> |
| | | <el-menu-item index="/main/report/ScheduleProductionSchedule">{{$t('report.productionScheduling')}}</el-menu-item> |
| | | <!-- <el-menu-item index="/main/report/OrderBOMOutside">BOM报表</el-menu-item>--> |
| | | </el-menu> |
| | | </div> |
New file |
| | |
| | | <script setup> |
| | | |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import {ElDatePicker, ElMessage} from "element-plus"; |
| | | import {useI18n} from 'vue-i18n' |
| | | import exportExcel from "@/hook/exportExcel"; |
| | | import footSum from "@/hook/footSum" |
| | | //语言获取 |
| | | const {t} = useI18n() |
| | | let router = useRouter() |
| | | let filterData = ref({}) |
| | | //提交的表单 |
| | | const form = reactive({ |
| | | date1: '', |
| | | orderId: '', |
| | | project: '', |
| | | processes:'' |
| | | |
| | | }) |
| | | |
| | | //工序 |
| | | const value = ref(t('machine.cutting')) |
| | | |
| | | //表尾求和 |
| | | const sumNum = (list, field) => { |
| | | let count = 0 |
| | | list.forEach(item => { |
| | | count += Number(item[field]) |
| | | }) |
| | | return count.toFixed(2) |
| | | } |
| | | |
| | | |
| | | //定义页面总页数 |
| | | let pageTotal = ref('') |
| | | //定义数据返回结果 |
| | | let produceList = ref([]) |
| | | //定义当前页数 |
| | | let pageNum = ref(1) |
| | | let pageState = null |
| | | |
| | | //获取七天前到当前时间 |
| | | function getNowTime() { |
| | | const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 3) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0, 10) //默认开始时间7天前 |
| | | const end = new Date(new Date().getTime() + 3600 * 1000 * 24) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0, 10)//默认结束时间当前时间 |
| | | return [start, end] |
| | | } |
| | | |
| | | |
| | | //第一次加载获取近七天时间和默认状态 |
| | | form.date1 = getNowTime() |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let processes = value.value |
| | | let total = reactive({ |
| | | pageTotal: 0, |
| | | dataTotal: 0, |
| | | pageSize: 100 |
| | | }) |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | processType: [], |
| | | }) |
| | | //第一次加载数据 |
| | | request.post(`/report/scheduleProductionSchedule/1/${total.pageSize}/${startTime}/${endTime}/${processes}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | total.dataTotal = res.data.total.total * 1 |
| | | total.pageTotal = res.data.total.pageTotal |
| | | pageTotal.value = res.data.total |
| | | titleSelectJson.value.processType = res.data.process |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | |
| | | //页脚翻页查询 |
| | | const selectPageList = () => { |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let processes = value.value |
| | | request.post(`/report/scheduleProductionSchedule/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${processes}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //点击查询 |
| | | const getWorkOrder = () => { |
| | | |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let processes = value.value |
| | | request.post(`/report/scheduleProductionSchedule/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${processes}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | total.dataTotal = res.data.total.total * 1 |
| | | total.pageTotal = res.data.total.pageTotal |
| | | pageTotal.value = res.data.total |
| | | |
| | | xGrid.value.loadData(res.data.data) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //页脚跳转 |
| | | const handlePageChange = ({currentPage, pageSize}) => { |
| | | pageNum.value = currentPage |
| | | total.pageTotal = pageSize |
| | | selectPageList() |
| | | } |
| | | |
| | | /*使用筛选,后端获取数据*/ |
| | | const changeFilterEvent = (event, option, $panel,) => { |
| | | // 手动触发筛选 |
| | | $panel.changeOption(event, !!option.data, option) |
| | | } |
| | | |
| | | function filterChanged(column) { |
| | | //gridOptions.loading=true |
| | | //筛选条件发生变化条件发生变化 |
| | | let value = column.datas[0] != undefined ? column.datas[0] : '' |
| | | value = value.trim() |
| | | //判断是否存在外键 |
| | | if (column.property.indexOf('.') > -1) { |
| | | const columnArr = column.property.split('.') |
| | | filterData.value[columnArr[0]] = { |
| | | [columnArr[1]]: value |
| | | } |
| | | } else { |
| | | filterData.value[column.property] = value |
| | | } |
| | | |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | request.post(`/report/scheduleProductionSchedule/1/${total.pageSize}/${startTime}/${endTime}/${processes}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | total.dataTotal = res.data.total.total * 1 |
| | | total.pageTotal = parseInt(res.data.total) |
| | | pageNum.value = 1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | |
| | | } |
| | | |
| | | /*后端返回结果多层嵌套展示*/ |
| | | const hasDecimal = (value) => { |
| | | const regex = /\./; // 定义正则表达式,查找小数点 |
| | | return regex.test(value); // 返回true/false |
| | | } |
| | | |
| | | //子组件接收参数 |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 30},//鼠标移动或选择高亮 |
| | | id: 'DamageReport', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY: {enabled: true},//开启虚拟滚动 |
| | | showOverflow: true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns: [ |
| | | {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50}, |
| | | {type: 'seq', fixed: "left", title: t('basicData.Number'), width: 50}, |
| | | { |
| | | field: 'orderId', width: 120, title: t('order.orderId'), filters: [{data: ''}], slots: {filter: 'num1_filter'} |
| | | }, |
| | | { |
| | | field: 'project', |
| | | width: 120, |
| | | title: t('order.project'), |
| | | showOverflow: "ellipsis", |
| | | filters: [{data: ''}], slots: {filter: 'num1_filter'} |
| | | }, |
| | | { |
| | | field: 'processes', |
| | | title: t('report.workingProcedure'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'} |
| | | }, |
| | | { |
| | | field: 'schedulingQuantity', |
| | | title: t('order.quantity'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'} |
| | | }, |
| | | { |
| | | field: 'notes', |
| | | title: t('basicData.remarks'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'} |
| | | }, |
| | | { |
| | | field: 'scheduledStartTime', |
| | | title: t('processCard.scheduledStartTime'), |
| | | type: 'date', |
| | | attrs: {placeholder: '', type: 'date'}, |
| | | }, |
| | | { |
| | | field: 'planEndTime', |
| | | title: t('processCard.planEndTime'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | showOverflow: "ellipsis" |
| | | }, |
| | | |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | | slots: { |
| | | tools: 'toolbar_buttons' |
| | | }, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod({columns, data}) {//页脚函数 |
| | | return [ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return t('basicData.total') |
| | | } |
| | | const List = ["schedulingQuantity", ] |
| | | if (List.includes(column.field)) { |
| | | return footSum(data, column.field) |
| | | } |
| | | return '' |
| | | }) |
| | | ] |
| | | } |
| | | |
| | | }) |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div class="main-div-customer"> |
| | | <div id="selectForm"> |
| | | <el-row :gutter="0"> |
| | | <el-date-picker |
| | | v-model="form.date1" |
| | | :end-placeholder="$t('basicData.endDate')" |
| | | :start-placeholder="$t('basicData.startDate')" |
| | | format="YYYY/MM/DD" |
| | | style="width: 100px" |
| | | type="daterange" |
| | | value-format="YYYY-MM-DD" |
| | | /> |
| | | |
| | | <el-select v-model="value" clearable default-value="default_city" style="width: 120px"> |
| | | <el-option |
| | | v-for="item in titleSelectJson['processType']" |
| | | :key="item.id" |
| | | :label="item.basic_name" |
| | | :value="item.basic_name" |
| | | /> |
| | | </el-select> |
| | | |
| | | <el-button type="primary" @click="getWorkOrder">{{ $t('basicData.search') }}</el-button> |
| | | </el-row> |
| | | |
| | | </div> |
| | | <vxe-grid |
| | | ref="xGrid" |
| | | class="mytable-scrollbar" |
| | | max-height="100%" |
| | | v-bind="gridOptions" |
| | | @filter-change="filterChanged" |
| | | |
| | | > |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |
| | | <!-- 下拉显示所有信息插槽--> |
| | | <template #content="{ row }"> |
| | | <ul class="expand-wrapper"> |
| | | <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined "> |
| | | <span style="font-weight: bold">{{ item.title + ': ' }}</span> |
| | | <span>{{ row[item.field] }}</span> |
| | | </li> |
| | | </ul> |
| | | </template> |
| | | |
| | | <template #toolbar_buttons> |
| | | <vxe-button style="margin-right: 0.5rem" |
| | | @click="exportExcel('/report/exportScheduleReport', |
| | | t('report.productionScheduling'), |
| | | form.date1)"> |
| | | {{ t('basicData.export') }} |
| | | </vxe-button> |
| | | </template> |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input v-model="option.data" type="text" @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <template #pager> |
| | | <!--使用 pager 插槽--> |
| | | <!-- 'PrevJump','NextJump', --> |
| | | <vxe-pager |
| | | v-model:current-page="pageNum" |
| | | v-model:page-size="total.pageSize" |
| | | v-model:pager-count="total.pageTotal" |
| | | :layouts="[ 'PrevPage', 'Jump','PageCount', 'NextPage', 'Total']" |
| | | :total="total.dataTotal" |
| | | @page-change="handlePageChange" |
| | | > |
| | | </vxe-pager> |
| | | </template> |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | .main-div-customer { |
| | | width: 99%; |
| | | height: 100%; |
| | | } |
| | | |
| | | #selectForm { |
| | | width: 60%; |
| | | text-align: center; |
| | | } |
| | | </style> |
| | |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 50},//鼠标移动或选择高亮 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 30},//鼠标移动或选择高亮 |
| | | id: 'SplittingDetailsOutside', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 50},//鼠标移动或选择高亮 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 30},//鼠标移动或选择高亮 |
| | | id: 'TeamOutput', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 50},//鼠标移动或选择高亮 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 30},//鼠标移动或选择高亮 |
| | | id: 'WorkInProgress', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 50},//鼠标移动或选择高亮 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 30},//鼠标移动或选择高亮 |
| | | id: 'Yield', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | |
| | | |
| | | //获取3天前到当前时间 |
| | | function getNowTime() { |
| | | const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 3) |
| | | const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 15) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0, 10) //默认开始时间7天前 |
| | |
| | | DownExcel.download(response, YieldDTO.class, reportService.exportYieldSv(dates), "Yield"); |
| | | } |
| | | |
| | | @ApiOperation("排产订单信息报表") |
| | | @PostMapping("/scheduleProductionSchedule/{pageNum}/{pageSize}/{selectTime1}/{selectTime2}/{processes}") |
| | | public Result scheduleProductionSchedule( |
| | | @PathVariable Integer pageNum, |
| | | @PathVariable Integer pageSize, |
| | | @PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @PathVariable String processes, |
| | | @RequestBody ScheduleProductionScheduleDTO scheduleProductionScheduleDTO) { |
| | | return Result.seccess(reportService.scheduleProductionScheduleSv(pageNum, pageSize, selectTime1, selectTime2,processes, scheduleProductionScheduleDTO)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("订单排产计划") |
| | | @PostMapping("/exportScheduleReport") |
| | | public void exportScheduleReport(HttpServletResponse response, |
| | | @RequestBody Map<String, Object> dates |
| | | ) throws IOException, IllegalAccessException, InstantiationException { |
| | | //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字 |
| | | System.out.println(dates); |
| | | DownExcel.download(response, ScheduleProductionScheduleDTO.class, reportService.exportScheduleReportSv(dates), "ScheduleProduction"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.example.erp.dto.pp; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class ScheduleProductionScheduleDTO { |
| | | @ExcelProperty("销售单号") |
| | | private String orderId; |
| | | @ExcelProperty("项目名称") |
| | | private String project; |
| | | @ExcelProperty("工序") |
| | | private String processes; |
| | | @ExcelProperty("排产数量") |
| | | private String schedulingQuantity; |
| | | @ExcelProperty("备注") |
| | | private String notes; |
| | | @ExcelProperty("开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private LocalDateTime scheduledStartTime; |
| | | @ExcelProperty("结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private LocalDateTime planEndTime; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | Boolean insertSelective(String schedulingId, String orderId, String orderNumber,String technologyNumber, String processes, Integer schedulingQuantity, LocalDate scheduledStartTime, LocalDate planEndTime, String notes); |
| | | |
| | | Boolean examineSchedulingMp(String schedulingId, String userName); |
| | | Boolean examineSchedulingMp(String schedulingId, String userName, Integer schedulingQuantity, String notes); |
| | | |
| | | Boolean deleteSchedulingMp(String schedulingId); |
| | | |
| | |
| | | |
| | | List<Map<String, String>> workInProgressProcessMp(Date selectTime1, Date selectTime2, String orderId, String inputProject, String selectProcesses, Report report); |
| | | |
| | | List<ScheduleProductionScheduleDTO> scheduleProductionScheduleMp(Integer offset, Integer pageSize, Date selectTime1, Date selectTime2, String processes, ScheduleProductionScheduleDTO scheduleProductionScheduleDTO); |
| | | |
| | | Map<String, Integer> getScheduleProductionScheduleTotal(Integer offset, Integer pageSize, Date selectTime1, Date selectTime2, String processes, ScheduleProductionScheduleDTO scheduleProductionScheduleDTO); |
| | | |
| | | List<ScheduleProductionScheduleDTO> exportScheduleReportMp(List<LocalDate> date, String process); |
| | | |
| | | |
| | | // Map<String, Integer> getWorkInProgressTotal( |
| | | // @Param("selectTime1") Date selectTime1, @Param("selectTime2") Date selectTime2, |
| | |
| | | |
| | | if (!schedulinglist.isEmpty()) { |
| | | for (ProductionScheduling productionScheduling : schedulinglist) { |
| | | productionSchedulingMapper.examineSchedulingMp(productionScheduling.getSchedulingId(),userName); |
| | | productionSchedulingMapper.examineSchedulingMp(productionScheduling.getSchedulingId(),userName,productionScheduling.getSchedulingQuantity(),productionScheduling.getNotes()); |
| | | // System.out.println(productionScheduling.getOrderNumber()+"***"+productionScheduling.getOrderId()); |
| | | } |
| | | return true; |
| | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | |
| | | import com.example.erp.dto.pp.DamageReportDTO; |
| | | import com.example.erp.dto.pp.ScheduleProductionScheduleDTO; |
| | | import com.example.erp.dto.pp.TeamOutputDTO; |
| | | import com.example.erp.entity.pp.DamageDetails; |
| | | import com.example.erp.entity.pp.Report; |
| | |
| | | map.put("total", reportMapper.teamOutputPageTotal(offset, pageSize, selectTime1, selectTime2,selectProcesses, teamOutputDTO)); |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> scheduleProductionScheduleSv(Integer pageNum, Integer pageSize, Date selectTime1, Date selectTime2, String processes, ScheduleProductionScheduleDTO scheduleProductionScheduleDTO) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", reportMapper.scheduleProductionScheduleMp(offset, pageSize, selectTime1, selectTime2,processes, scheduleProductionScheduleDTO)); |
| | | map.put("total", reportMapper.getScheduleProductionScheduleTotal(offset, pageSize, selectTime1, selectTime2,processes, scheduleProductionScheduleDTO)); |
| | | map.put("process", productionSchedulingMapper.selectProcess()); |
| | | return map; |
| | | } |
| | | |
| | | public List exportScheduleReportSv(Map<String, Object> dates) { |
| | | List<LocalDate> date= (List<LocalDate>) dates.get("date"); |
| | | String process= (String) dates.get("processes"); |
| | | return reportMapper.exportScheduleReportMp(date,process); |
| | | } |
| | | } |
| | |
| | | on ogd.order_id = fc.order_id and ogd.order_number = fc.order_number |
| | | set ogd.splitting_status=0 |
| | | where ogd.order_id = #{orderId} |
| | | and ogd.production_id = left(#{processId}, 11) |
| | | |
| | | </update> |
| | | |
| | |
| | | <update id="deleteFlowCardMp"> |
| | | delete |
| | | from flow_card as fc |
| | | where fc.production_id = left(#{processId}, 11) |
| | | where fc.order_id = left(#{processId}, 10) |
| | | </update> |
| | | |
| | | <!-- 分架新增明细查询--> |
| | |
| | | <delete id="deleteReportingWork"> |
| | | delete |
| | | from sd.order_process_detail |
| | | where left(process_id, 11) = left(#{processId}, 11) |
| | | where order_id = left(#{processId}, 10) |
| | | </delete> |
| | | |
| | | <select id="selectPrintFlowCardMp"> |
| | |
| | | ps.reviewer, |
| | | od.product_name, |
| | | if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape, |
| | | ps.scheduling_id |
| | | ps.scheduling_id, |
| | | ps.notes |
| | | from sd.order_detail as od |
| | | left join sd.order as o on od.order_id = o.order_id |
| | | left join production_scheduling as ps |
| | |
| | | <update id="examineSchedulingMp"> |
| | | update production_scheduling |
| | | set review_status=1, |
| | | reviewer=#{userName} |
| | | reviewer=#{userName}, |
| | | scheduling_quantity=#{schedulingQuantity}, |
| | | notes=#{notes} |
| | | where scheduling_id = #{schedulingId} |
| | | </update> |
| | | |
| | |
| | | <result column="breakage_reason" property="breakageReason"/> |
| | | <result column="breakage_quantity" property="breakageQuantity"/> |
| | | <result column="area" property="area"/> |
| | | <result column="reporting_work_id" property="reportingWork.reportingWorkId"/> |
| | | <result column="reporting_work_time" property="reportingWork.reportingWorkTime"/> |
| | | <result column="this_process" property="reportingWork.thisProcess"/> |
| | | <result column="project" property="order.project"/> |
| | | <result column="order_id" property="order.orderId"/> |
| | | <result column="glass_child" property="orderGlassDetail.glassChild"/> |
| | | <result column="reporting_work_id" property="reportingWork.reportingWorkId"/> |
| | | <result column="reporting_work_time" property="reportingWork.reportingWorkTime"/> |
| | | <result column="this_process" property="reportingWork.thisProcess"/> |
| | | <result column="project" property="order.project"/> |
| | | <result column="order_id" property="order.orderId"/> |
| | | <result column="glass_child" property="orderGlassDetail.glassChild"/> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | <result column="product_name" property="productName"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="scheduleProductionScheduleMap" type="com.example.erp.dto.pp.ScheduleProductionScheduleDTO"> |
| | | <result column="order_id" property="orderId"/> |
| | | <result column="project" property="project"/> |
| | | <result column="processes" property="processes"/> |
| | | <result column="scheduling_quantity" property="schedulingQuantity"/> |
| | | <result column="notes" property="notes"/> |
| | | <result column="scheduled_start_time" property="scheduledStartTime"/> |
| | | <result column="plan_end_time" property="planEndTime"/> |
| | | </resultMap> |
| | | |
| | | <!-- 流程卡进度--> |
| | | |
| | | <!-- 流程卡进度--> |
| | | <select id="processCardProgressMp"> |
| | | select a.product_name, |
| | | b.glass_child, |
| | |
| | | FROM sd.order_process_detail as a |
| | | where a.order_id = #{orderId} |
| | | GROUP BY process_id, a.order_number, a.technology_number) as e |
| | | on e.process_id = c.process_id |
| | | on e.process_id = c.process_id |
| | | and e.technology_number = c.technology_number |
| | | and e.order_number = c.order_number |
| | | where a.order_id = #{orderId} |
| | |
| | | </select> |
| | | |
| | | <select id="getProcessBreaking" resultMap="damageDetailsTableMap"> |
| | | select rw.reporting_work_id,rw.reporting_work_time,dd.responsible_process,dd.responsible_team, |
| | | dd.breakage_type,dd.breakage_reason,ROUND((dd.breakage_quantity)) as breakage_quantity, |
| | | round(ogd.child_width*ogd.child_height*(dd.breakage_quantity)/1000000,2) as area,rw.this_process, |
| | | o.project,o.order_id,ogd.glass_child,rw.this_process |
| | | from |
| | | damage_details as dd |
| | | left join reporting_work as rw |
| | | on rw.reporting_work_id=dd.reporting_work_id |
| | | left join sd.order as o |
| | | on rw.order_id=o.order_id |
| | | left join sd.order_glass_detail as ogd |
| | | on ogd.order_id=o.order_id and ogd.order_number=dd.order_number |
| | | and ogd.technology_number and dd.technology_number |
| | | where date(rw.reporting_work_time)>=#{startDate} and date(rw.reporting_work_time) <= #{endDate} |
| | | and rw.this_worn_quantity>0 and dd.available=0 |
| | | and reviewed_state!=2 |
| | | and rw.this_process!=dd.responsible_process |
| | | select rw.reporting_work_id, |
| | | rw.reporting_work_time, |
| | | dd.responsible_process, |
| | | dd.responsible_team, |
| | | dd.breakage_type, |
| | | dd.breakage_reason, |
| | | ROUND((dd.breakage_quantity)) as breakage_quantity, |
| | | round(ogd.child_width * ogd.child_height * (dd.breakage_quantity) / 1000000, 2) as area, |
| | | rw.this_process, |
| | | o.project, |
| | | o.order_id, |
| | | ogd.glass_child, |
| | | rw.this_process |
| | | from damage_details as dd |
| | | left join reporting_work as rw |
| | | on rw.reporting_work_id = dd.reporting_work_id |
| | | left join sd.order as o |
| | | on rw.order_id = o.order_id |
| | | left join sd.order_glass_detail as ogd |
| | | on ogd.order_id = o.order_id and ogd.order_number = dd.order_number |
| | | and ogd.technology_number and dd.technology_number |
| | | where date(rw.reporting_work_time) >= #{startDate} |
| | | and date(rw.reporting_work_time) <= #{endDate} |
| | | and rw.this_worn_quantity > 0 |
| | | and dd.available = 0 |
| | | and reviewed_state != 2 |
| | | and rw.this_process != dd.responsible_process |
| | | GROUP BY dd.id |
| | | order by dd.id desc |
| | | limit #{offset},#{pageSize} |
| | | </select> |
| | | |
| | | <select id="getProcessBreakingTotal"> |
| | | select |
| | | CEILING(count(dd.id)/#{pageSize}) as 'pageTotal', |
| | | count(distinct dd.id) as 'total' |
| | | from |
| | | damage_details as dd |
| | | left join reporting_work as rw |
| | | on rw.reporting_work_id=dd.reporting_work_id |
| | | left join sd.order as o |
| | | on rw.order_id=o.order_id |
| | | left join sd.order_glass_detail as ogd |
| | | on ogd.order_id=o.order_id and ogd.order_number=dd.order_number |
| | | and ogd.technology_number and dd.technology_number |
| | | where date(rw.reporting_work_time)>=#{startDate} and date(rw.reporting_work_time) <= #{endDate} |
| | | and rw.this_worn_quantity>0 and dd.available=0 |
| | | and reviewed_state!=2 |
| | | and rw.this_process!=dd.responsible_process |
| | | select CEILING(count(dd.id) / #{pageSize}) as 'pageTotal', |
| | | count(distinct dd.id) as 'total' |
| | | from damage_details as dd |
| | | left join reporting_work as rw |
| | | on rw.reporting_work_id = dd.reporting_work_id |
| | | left join sd.order as o |
| | | on rw.order_id = o.order_id |
| | | left join sd.order_glass_detail as ogd |
| | | on ogd.order_id = o.order_id and ogd.order_number = dd.order_number |
| | | and ogd.technology_number and dd.technology_number |
| | | where date(rw.reporting_work_time) >= #{startDate} |
| | | and date(rw.reporting_work_time) <= #{endDate} |
| | | and rw.this_worn_quantity > 0 |
| | | and dd.available = 0 |
| | | and reviewed_state != 2 |
| | | and rw.this_process != dd.responsible_process |
| | | order by dd.id desc |
| | | </select> |
| | | |
| | | <select id="workInProgressMp"> |
| | | select #{selectProcesses} as thisProcess, |
| | | select #{selectProcesses} as thisProcess, |
| | | fc.process_id, |
| | | o.customer_name, |
| | | o.project, |
| | | o.order_id, |
| | | o.batch, |
| | | if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape, |
| | | if(od.shape = 1, '普形', if(od.shape = 2, '异形', '')) as shape, |
| | | ogd.order_number, |
| | | ogd.technology_number, |
| | | ogd.process, |
| | |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num as stockNum, |
| | | odpd.broken_num as stockNum, |
| | | ROUND(ogd.child_width * ogd.child_height * |
| | | (odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num) / 1000000, 2) as stockArea, |
| | | odpd.broken_num) / 1000000, 2) as stockArea, |
| | | od.product_name, |
| | | od.bend_radius |
| | | |
| | |
| | | where LENGTH(fc.process_id) = 14 |
| | | and odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num != 0 |
| | | and odpd.process = #{selectProcesses} and o.create_time between #{selectTime1} and #{selectTime2} |
| | | and position(#{orderId} in od.order_id) and position(#{inputProject} in o.project) |
| | | and odpd.process = #{selectProcesses} |
| | | and o.create_time between #{selectTime1} and #{selectTime2} |
| | | and position(#{orderId} in od.order_id) |
| | | and position(#{inputProject} in o.project) |
| | | |
| | | group by fc.process_id, fc.order_number, fc.technology_number |
| | | order by fc.process_id, fc.order_number, fc.technology_number |
| | |
| | | </if> |
| | | --> |
| | | |
| | | <!-- <select id="getWorkInProgressTotal">--> |
| | | <!-- select CEILING(count(fc.id) / #{pageSize}) as 'pageTotal',--> |
| | | <!-- count(distinct fc.id) as 'total'--> |
| | | <!-- <select id="getWorkInProgressTotal">--> |
| | | <!-- select CEILING(count(fc.id) / #{pageSize}) as 'pageTotal',--> |
| | | <!-- count(distinct fc.id) as 'total'--> |
| | | |
| | | <!-- from sd.order_detail AS od--> |
| | | <!-- LEFT JOIN sd.order_glass_detail AS ogd--> |
| | | <!-- ON od.order_id = ogd.order_id--> |
| | | <!-- AND od.order_number = ogd.order_number--> |
| | | <!-- LEFT JOIN flow_card AS fc--> |
| | | <!-- ON fc.order_id = ogd.order_id--> |
| | | <!-- and fc.production_id = ogd.production_id--> |
| | | <!-- AND fc.order_number = ogd.order_number--> |
| | | <!-- AND fc.technology_number = ogd.technology_number--> |
| | | <!-- left join sd.order_process_detail as odpd--> |
| | | <!-- ON odpd.order_id = fc.order_id--> |
| | | <!-- AND odpd.order_number = fc.order_number--> |
| | | <!-- AND odpd.technology_number = fc.technology_number--> |
| | | <!-- and odpd.process_id = fc.process_id--> |
| | | <!-- left join sd.order_process_detail as odpds--> |
| | | <!-- ON odpds.id = odpd.id - 1--> |
| | | <!-- left join--> |
| | | <!-- (SELECT sum(rw.rework_num) as 'patchNumSum',--> |
| | | <!-- rw.process_id,--> |
| | | <!-- rw.order_sort,--> |
| | | <!-- rw.technology_number,--> |
| | | <!-- rwk.this_process--> |
| | | <!-- from rework as rw--> |
| | | <!-- LEFT JOIN--> |
| | | <!-- reporting_work as rwk--> |
| | | <!-- on rw.reporting_work_id = rwk.reporting_work_id--> |
| | | <!-- where rwk.this_process = #{selectProcesses}--> |
| | | <!-- and rw.review_status = 1--> |
| | | <!-- GROUP BY rw.process_id, rw.order_sort, rw.technology_number) as c--> |
| | | <!-- on c.process_id = fc.process_id--> |
| | | <!-- and c.order_sort = fc.order_number--> |
| | | <!-- and c.technology_number = fc.technology_number--> |
| | | <!-- left join sd.`order` as o--> |
| | | <!-- on o.order_id = od.order_id--> |
| | | <!-- where LENGTH(fc.process_id) = 14--> |
| | | <!-- and odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - --> |
| | | <!-- odpd.broken_num != 0--> |
| | | <!-- and odpd.process = #{selectProcesses}--> |
| | | <!-- and o.create_time between #{selectTime1} and #{selectTime2}--> |
| | | <!-- and position(#{orderId} in od.order_id)--> |
| | | <!-- and position(#{inputProject} in o.project)--> |
| | | <!-- group by fc.process_id, fc.order_number, fc.technology_number--> |
| | | <!-- order by fc.process_id, fc.order_number, fc.technology_number--> |
| | | <!-- limit #{offset},#{pageSize};--> |
| | | <!-- </select>--> |
| | | <!-- from sd.order_detail AS od--> |
| | | <!-- LEFT JOIN sd.order_glass_detail AS ogd--> |
| | | <!-- ON od.order_id = ogd.order_id--> |
| | | <!-- AND od.order_number = ogd.order_number--> |
| | | <!-- LEFT JOIN flow_card AS fc--> |
| | | <!-- ON fc.order_id = ogd.order_id--> |
| | | <!-- and fc.production_id = ogd.production_id--> |
| | | <!-- AND fc.order_number = ogd.order_number--> |
| | | <!-- AND fc.technology_number = ogd.technology_number--> |
| | | <!-- left join sd.order_process_detail as odpd--> |
| | | <!-- ON odpd.order_id = fc.order_id--> |
| | | <!-- AND odpd.order_number = fc.order_number--> |
| | | <!-- AND odpd.technology_number = fc.technology_number--> |
| | | <!-- and odpd.process_id = fc.process_id--> |
| | | <!-- left join sd.order_process_detail as odpds--> |
| | | <!-- ON odpds.id = odpd.id - 1--> |
| | | <!-- left join--> |
| | | <!-- (SELECT sum(rw.rework_num) as 'patchNumSum',--> |
| | | <!-- rw.process_id,--> |
| | | <!-- rw.order_sort,--> |
| | | <!-- rw.technology_number,--> |
| | | <!-- rwk.this_process--> |
| | | <!-- from rework as rw--> |
| | | <!-- LEFT JOIN--> |
| | | <!-- reporting_work as rwk--> |
| | | <!-- on rw.reporting_work_id = rwk.reporting_work_id--> |
| | | <!-- where rwk.this_process = #{selectProcesses}--> |
| | | <!-- and rw.review_status = 1--> |
| | | <!-- GROUP BY rw.process_id, rw.order_sort, rw.technology_number) as c--> |
| | | <!-- on c.process_id = fc.process_id--> |
| | | <!-- and c.order_sort = fc.order_number--> |
| | | <!-- and c.technology_number = fc.technology_number--> |
| | | <!-- left join sd.`order` as o--> |
| | | <!-- on o.order_id = od.order_id--> |
| | | <!-- where LENGTH(fc.process_id) = 14--> |
| | | <!-- and odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - --> |
| | | <!-- odpd.broken_num != 0--> |
| | | <!-- and odpd.process = #{selectProcesses}--> |
| | | <!-- and o.create_time between #{selectTime1} and #{selectTime2}--> |
| | | <!-- and position(#{orderId} in od.order_id)--> |
| | | <!-- and position(#{inputProject} in o.project)--> |
| | | <!-- group by fc.process_id, fc.order_number, fc.technology_number--> |
| | | <!-- order by fc.process_id, fc.order_number, fc.technology_number--> |
| | | <!-- limit #{offset},#{pageSize};--> |
| | | <!-- </select>--> |
| | | |
| | | <select id="processToBeCompletedMp"> |
| | | select DATE(o.create_time) as create_time, |
| | | DATE(o.delivery_date) as delivery_date, |
| | | select DATE(o.create_time) as create_time, |
| | | DATE(o.delivery_date) as delivery_date, |
| | | o.order_id, |
| | | fc.process_id, |
| | | o.customer_name, |
| | |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | od.quantity, |
| | | ROUND(ogd.child_width * ogd.child_height / 1000000, 2) as childArea, |
| | | ROUND(ogd.child_width * ogd.child_height * od.quantity / 1000000, 2) as actualArea, |
| | | odpd.reporting_work_num as completeNum, |
| | | ROUND(ogd.child_width * ogd.child_height / 1000000, 2) as childArea, |
| | | ROUND(ogd.child_width * ogd.child_height * od.quantity / 1000000, 2) as actualArea, |
| | | odpd.reporting_work_num as completeNum, |
| | | ROUND(ogd.child_width * ogd.child_height * odpd.reporting_work_num / 1000000, |
| | | 2) as completeArea, |
| | | od.quantity - odpd.reporting_work_num as incompleteNum, |
| | | 2) as completeArea, |
| | | od.quantity - odpd.reporting_work_num as incompleteNum, |
| | | ROUND(ogd.child_width * ogd.child_height * (od.quantity - odpd.reporting_work_num) / 1000000, |
| | | 2) as incompleteArea, |
| | | 2) as incompleteArea, |
| | | od.product_name |
| | | |
| | | from sd.order_detail AS od |
| | |
| | | order by fc.process_id, fc.order_number, fc.technology_number |
| | | </select> |
| | | |
| | | <select id="selectDamageReportMp" resultMap="damageReportMap"> |
| | | <select id="selectDamageReportMp" resultMap="damageReportMap"> |
| | | SELECT |
| | | o.order_id, |
| | | o.project, |
| | | rw.process_id, |
| | | dd.order_number, |
| | | dd.technology_number, |
| | | date(rw.reporting_work_time) as reporting_work_time, |
| | | dd.responsible_process, |
| | | dd.responsible_team, |
| | | dd.responsible_equipment, |
| | | dd.breakage_type, |
| | | dd.breakage_reason, |
| | | dd.breakage_quantity, |
| | | round( ogd.child_width * ogd.child_height * dd.breakage_quantity / 1000000, 2 ) as area, |
| | | IFNULL(dd.responsible_personnel,'') as personnel, |
| | | ogd.glass_child |
| | | o.order_id, |
| | | o.project, |
| | | rw.process_id, |
| | | dd.order_number, |
| | | dd.technology_number, |
| | | date(rw.reporting_work_time) as reporting_work_time, |
| | | dd.responsible_process, |
| | | dd.responsible_team, |
| | | dd.responsible_equipment, |
| | | dd.breakage_type, |
| | | dd.breakage_reason, |
| | | dd.breakage_quantity, |
| | | round( ogd.child_width * ogd.child_height * dd.breakage_quantity / 1000000, 2 ) as area, |
| | | IFNULL(dd.responsible_personnel,'') as personnel, |
| | | ogd.glass_child |
| | | FROM |
| | | sd.ORDER AS o |
| | | LEFT JOIN sd.order_glass_detail AS ogd ON ogd.order_id = o.order_id |
| | | LEFT JOIN reporting_work AS rw ON rw.order_id = o.order_id |
| | | LEFT JOIN damage_details AS dd ON dd.reporting_work_id = rw.reporting_work_id |
| | | AND dd.order_number = ogd.order_number |
| | | AND dd.technology_number = ogd.technology_number |
| | | sd.ORDER AS o |
| | | LEFT JOIN sd.order_glass_detail AS ogd ON ogd.order_id = o.order_id |
| | | LEFT JOIN reporting_work AS rw ON rw.order_id = o.order_id |
| | | LEFT JOIN damage_details AS dd ON dd.reporting_work_id = rw.reporting_work_id |
| | | AND dd.order_number = ogd.order_number |
| | | AND dd.technology_number = ogd.technology_number |
| | | WHERE |
| | | rw.reporting_work_time between #{selectTime1} and #{selectTime2} |
| | | AND dd.available = 0 |
| | | AND LENGTH( rw.process_id )= 14 |
| | | rw.reporting_work_time between #{selectTime1} and #{selectTime2} |
| | | AND dd.available = 0 |
| | | AND LENGTH( rw.process_id )= 14 |
| | | <if test="damageReportDTO.orderId != null and damageReportDTO.orderId != ''"> |
| | | and o.order_id regexp #{damageReportDTO.orderId} |
| | | </if> |
| | |
| | | and dd.breakage_reason regexp #{damageReportDTO.breakageReason} |
| | | </if> |
| | | GROUP BY |
| | | dd.id |
| | | dd.id |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | |
| | | </select> |
| | | |
| | | <select id="splittingDetailsOutsideMp"> |
| | | SELECT |
| | | fc.process_id processId, |
| | | fc.order_number orderNumber, |
| | | fc.technology_number as technologyNumber, |
| | | o.project, |
| | | o.batch, |
| | | ogd.child_width as childWidth, |
| | | ogd.child_height as childHeight, |
| | | fc.quantity, |
| | | round( ogd.child_width * ogd.child_height * fc.quantity / 1000000, 2 ) as area, |
| | | if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape, |
| | | od.remarks |
| | | FROM |
| | | sd.ORDER AS o |
| | | LEFT JOIN sd.order_detail AS od ON od.order_id = od.order_id |
| | | LEFT JOIN sd.order_glass_detail AS ogd ON o.order_id = ogd.order_id |
| | | AND ogd.order_number = od.order_number |
| | | LEFT JOIN flow_card AS fc ON fc.order_id = ogd.order_id |
| | | AND fc.order_number |
| | | AND fc.technology_number = ogd.technology_number |
| | | WHERE |
| | | fc.order_id = #{orderId} |
| | | GROUP BY |
| | | fc.id |
| | | SELECT fc.process_id processId, |
| | | fc.order_number orderNumber, |
| | | fc.technology_number as technologyNumber, |
| | | o.project, |
| | | o.batch, |
| | | ogd.child_width as childWidth, |
| | | ogd.child_height as childHeight, |
| | | fc.quantity, |
| | | round(ogd.child_width * ogd.child_height * fc.quantity / 1000000, 2) as area, |
| | | if(od.shape = 1, '普形', if(od.shape = 2, '异形', '')) as shape, |
| | | od.remarks |
| | | FROM sd.ORDER AS o |
| | | LEFT JOIN sd.order_detail AS od ON od.order_id = od.order_id |
| | | LEFT JOIN sd.order_glass_detail AS ogd ON o.order_id = ogd.order_id |
| | | AND ogd.order_number = od.order_number |
| | | LEFT JOIN flow_card AS fc ON fc.order_id = ogd.order_id |
| | | AND fc.order_number |
| | | AND fc.technology_number = ogd.technology_number |
| | | WHERE fc.order_id = #{orderId} |
| | | GROUP BY fc.id |
| | | </select> |
| | | |
| | | <select id="qualityReportMp"> |
| | |
| | | fc.technology_number, |
| | | od.product_name, |
| | | od.quantity, |
| | | ifnull(MAX(opd.reporting_work_num_count),0) as quantityMax, |
| | | ifnull(MAX(opd.reporting_work_num_count), 0) as quantityMax, |
| | | IFNULL(SUM(distinct dd.breakage_quantity), 0) as breakage_quantity, |
| | | IFNULL(sum(distinct pl.patch_num), 0) as patch_num, |
| | | ifnull(fc.received_quantity,0) as received_quantity, |
| | | ifnull(fc.received_quantity, 0) as received_quantity, |
| | | CONCAT(ROUND(ROUND(od.quantity / MAX(opd.reporting_work_num_count), 2) * 100), '%') as finished |
| | | FROM sd.`order` AS o |
| | | LEFT JOIN sd.order_detail AS od ON od.order_id = o.order_id |
| | |
| | | </select> |
| | | |
| | | <select id="productionScheduleMp"> |
| | | select |
| | | a.order_number, |
| | | if(a.shape=1,'普形',if(a.shape=2,'异形','')) as shape, |
| | | a.product_name, |
| | | b.child_width, |
| | | b.child_height, |
| | | c.quantity, |
| | | c.technology_number, |
| | | b.glass_child, |
| | | ifnull(e.reportWorkQuantity,0) as reportWorkQuantity, |
| | | ifnull(e.reportWorkQuantityCount,0) as reportWorkQuantityCount, |
| | | ifnull(f.inventory,0) as inventoryNum, |
| | | round(ifnull(f.inventory,0)*a.area,2) as inventoryArea, |
| | | ifnull(dd.quantity,0) as shippedQuantity, |
| | | ifnull(dd.area,0) as area |
| | | select a.order_number, |
| | | if(a.shape = 1, '普形', if(a.shape = 2, '异形', '')) as shape, |
| | | a.product_name, |
| | | b.child_width, |
| | | b.child_height, |
| | | c.quantity, |
| | | c.technology_number, |
| | | b.glass_child, |
| | | ifnull(e.reportWorkQuantity, 0) as reportWorkQuantity, |
| | | ifnull(e.reportWorkQuantityCount, 0) as reportWorkQuantityCount, |
| | | ifnull(f.inventory, 0) as inventoryNum, |
| | | round(ifnull(f.inventory, 0) * a.area, 2) as inventoryArea, |
| | | ifnull(dd.quantity, 0) as shippedQuantity, |
| | | ifnull(dd.area, 0) as area |
| | | |
| | | from |
| | | flow_card as c |
| | | left join |
| | | sd.order_detail as a |
| | | on c.order_id = a.order_id |
| | | and c.order_number = a.order_number |
| | | left join sd.order_glass_detail as b |
| | | on c.order_id = b.order_id |
| | | and b.order_number = c.order_number |
| | | and c.technology_number = b.technology_number |
| | | left join sd.`order` as d |
| | | on c.order_id = d.order_id |
| | | left join mm.finished_goods_inventory as f |
| | | on c.order_id = f.order_id and f.order_number = c.order_number |
| | | left join ( |
| | | SELECT process_id, |
| | | technology_number, |
| | | sum(a.broken_num) as broken_num, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"",process,"\":\"",reporting_work_num,"\"")), |
| | | '}' |
| | | ) as reportWorkQuantity, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"",process,"\":\"",reporting_work_num,"\"")), |
| | | '}' |
| | | ) as reportWorkQuantityCount |
| | | FROM sd.order_process_detail as a |
| | | where a.order_id=#{orderId} |
| | | GROUP BY process_id,a.technology_number |
| | | ) as e |
| | | on e.process_id = c.process_id |
| | | and e.technology_number = c.technology_number |
| | | left join sd.delivery_detail as dd on dd.order_id=a.order_id and dd.order_number=a.order_number |
| | | from flow_card as c |
| | | left join |
| | | sd.order_detail as a |
| | | on c.order_id = a.order_id |
| | | and c.order_number = a.order_number |
| | | left join sd.order_glass_detail as b |
| | | on c.order_id = b.order_id |
| | | and b.order_number = c.order_number |
| | | and c.technology_number = b.technology_number |
| | | left join sd.`order` as d |
| | | on c.order_id = d.order_id |
| | | left join mm.finished_goods_inventory as f |
| | | on c.order_id = f.order_id and f.order_number = c.order_number |
| | | left join (SELECT process_id, |
| | | technology_number, |
| | | sum(a.broken_num) as broken_num, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", reporting_work_num, "\"")), |
| | | '}' |
| | | ) as reportWorkQuantity, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", reporting_work_num, "\"")), |
| | | '}' |
| | | ) as reportWorkQuantityCount |
| | | FROM sd.order_process_detail as a |
| | | where a.order_id = #{orderId} |
| | | GROUP BY process_id, a.technology_number) as e |
| | | on e.process_id = c.process_id |
| | | and e.technology_number = c.technology_number |
| | | left join sd.delivery_detail as dd on dd.order_id = a.order_id and dd.order_number = a.order_number |
| | | where a.order_id = #{orderId} |
| | | ORDER BY a.order_number |
| | | </select> |
| | |
| | | select d.customer_name as customerName, |
| | | d.project, |
| | | d.batch, |
| | | c.order_id as orderId, |
| | | c.order_id as orderId, |
| | | d.quantity, |
| | | d.area, |
| | | dd.quantity as shippedQuantity, |
| | | dd.area as shippedArea, |
| | | dd.quantity as shippedQuantity, |
| | | dd.area as shippedArea, |
| | | e.reportWorkQuantity, |
| | | e.reportWorkQuantityCount |
| | | |
| | |
| | | technology_number, |
| | | sum(a.broken_num) as broken_num, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", ifnull(reporting_work_num,0), "\"")), |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", ifnull(reporting_work_num, 0), "\"")), |
| | | '}' |
| | | ) as reportWorkQuantity, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", ifnull(reporting_work_num,0), "\"")), |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", ifnull(reporting_work_num, 0), "\"")), |
| | | '}' |
| | | ) as reportWorkQuantityCount |
| | | FROM sd.order_process_detail as a |
| | | left join sd.`order` as o on o.order_id = a.order_id |
| | | where o.create_time BETWEEN #{selectTime1} and #{selectTime2} |
| | | GROUP BY process_id,a.technology_number |
| | | ) as e |
| | | GROUP BY process_id, a.technology_number) as e |
| | | on e.process_id = c.process_id |
| | | and e.technology_number = c.technology_number |
| | | left join sd.delivery_detail as dd on dd.order_id = a.order_id and dd.order_number = a.order_number |
| | | where d.create_time BETWEEN #{selectTime1} and #{selectTime2} and reportWorkQuantity is not null |
| | | where d.create_time BETWEEN #{selectTime1} and #{selectTime2} |
| | | and reportWorkQuantity is not null |
| | | GROUP BY a.order_id |
| | | ORDER BY a.order_id |
| | | </select> |
| | | |
| | | <select id="orderPlanDecompositionMp"> |
| | | SELECT |
| | | o.order_id, |
| | | o.customer_name, |
| | | o.project, |
| | | o.batch, |
| | | o.quantity, |
| | | o.area, |
| | | date(fc.create_time) as create_time, |
| | | date(orw.startTime) as startTime, |
| | | ifnull(oopd.completionsNum,0) as completionsNum, |
| | | sum( DISTINCT fc.received_quantity ) AS received_quantity, |
| | | o.quantity-sum( DISTINCT fc.received_quantity ) AS receivedNo, |
| | | IF(fc.quantity=fc.received_quantity,'已清单','') as accomplish, |
| | | DATEDIFF( |
| | | MAX( rw.reporting_work_time ), |
| | | min( rw.reporting_work_time ))+1 AS daysDifference |
| | | FROM |
| | | sd.`order` AS o |
| | | LEFT JOIN flow_card AS fc ON fc.order_id = o.order_id |
| | | LEFT JOIN ( |
| | | SELECT |
| | | a.order_id, |
| | | MIN( b.reporting_work_time ) AS startTime |
| | | FROM |
| | | sd.`order` AS a |
| | | LEFT JOIN reporting_work AS b ON a.order_id = b.order_id |
| | | WHERE |
| | | b.this_process = '切割' |
| | | AND a.create_time BETWEEN #{selectTime1} and #{selectTime2} |
| | | GROUP BY |
| | | a.order_id |
| | | ) AS orw ON orw.order_id = o.order_id |
| | | LEFT JOIN ( |
| | | SELECT |
| | | a.order_id, |
| | | SUM( b.reporting_work_num ) AS completionsNum |
| | | FROM |
| | | sd.`order` AS a |
| | | LEFT JOIN sd.order_process_detail AS b ON a.order_id = b.order_id |
| | | WHERE |
| | | b.process = '包装' |
| | | AND a.create_time BETWEEN #{selectTime1} and #{selectTime2} |
| | | GROUP BY |
| | | a.order_id |
| | | ) AS oopd ON oopd.order_id = o.order_id |
| | | LEFT JOIN reporting_work AS rw ON rw.order_id = fc.order_id |
| | | AND rw.process_id = fc.process_id |
| | | WHERE |
| | | o.create_time BETWEEN #{selectTime1} and #{selectTime2} |
| | | SELECT o.order_id, |
| | | o.customer_name, |
| | | o.project, |
| | | o.batch, |
| | | o.quantity, |
| | | o.area, |
| | | date(fc.create_time) as create_time, |
| | | date(orw.startTime) as startTime, |
| | | ifnull(oopd.completionsNum, 0) as completionsNum, |
| | | sum(DISTINCT fc.received_quantity) AS received_quantity, |
| | | o.quantity - sum(DISTINCT fc.received_quantity) AS receivedNo, |
| | | IF(fc.quantity = fc.received_quantity, '已清单', '') as accomplish, |
| | | DATEDIFF( |
| | | MAX(rw.reporting_work_time), |
| | | min(rw.reporting_work_time)) + 1 AS daysDifference |
| | | FROM sd.`order` AS o |
| | | LEFT JOIN flow_card AS fc ON fc.order_id = o.order_id |
| | | LEFT JOIN (SELECT a.order_id, |
| | | MIN(b.reporting_work_time) AS startTime |
| | | FROM sd.`order` AS a |
| | | LEFT JOIN reporting_work AS b ON a.order_id = b.order_id |
| | | WHERE b.this_process = '切割' |
| | | AND a.create_time BETWEEN #{selectTime1} and #{selectTime2} |
| | | GROUP BY a.order_id) AS orw ON orw.order_id = o.order_id |
| | | LEFT JOIN (SELECT a.order_id, |
| | | SUM(b.reporting_work_num) AS completionsNum |
| | | FROM sd.`order` AS a |
| | | LEFT JOIN sd.order_process_detail AS b ON a.order_id = b.order_id |
| | | WHERE b.process = '包装' |
| | | AND a.create_time BETWEEN #{selectTime1} and #{selectTime2} |
| | | GROUP BY a.order_id) AS oopd ON oopd.order_id = o.order_id |
| | | LEFT JOIN reporting_work AS rw ON rw.order_id = fc.order_id |
| | | AND rw.process_id = fc.process_id |
| | | WHERE o.create_time BETWEEN #{selectTime1} and #{selectTime2} |
| | | AND fc.create_time IS NOT NULL |
| | | GROUP BY |
| | | o.order_id |
| | | GROUP BY o.order_id |
| | | </select> |
| | | |
| | | <select id="rawMaterialRequisitionMp"> |
| | | SELECT |
| | | fc.project_no, |
| | | modl.material_name, |
| | | modl.producer, |
| | | ou.width, |
| | | ou.height, |
| | | modl.date_of_manufacture, |
| | | SUM(distinct modl.outbound_quantity) as quantity, |
| | | ROUND(SUM(modl.outbound_quantity)*SUM(modl.single_piece_area),2) as area, |
| | | date(mo.material_requisition_date) as date |
| | | FROM |
| | | mm.material_outbound_detail AS modl |
| | | left join mm.material_outbound as mo on mo.material_outbound_id=modl.material_outbound_id |
| | | LEFT JOIN optimize_use AS ou ON modl.use_id = ou.id and ou.raw_stock_code=modl.inventory_id |
| | | LEFT JOIN flow_card AS fc ON ou.project_no = fc.project_no |
| | | where modl.use_id IS NOT NULL and mo.material_requisition_date BETWEEN #{selectTime1} and #{selectTime2} |
| | | GROUP BY |
| | | ou.width,ou.height,material_code |
| | | SELECT fc.project_no, |
| | | modl.material_name, |
| | | modl.producer, |
| | | ou.width, |
| | | ou.height, |
| | | modl.date_of_manufacture, |
| | | SUM(distinct modl.outbound_quantity) as quantity, |
| | | ROUND(SUM(modl.outbound_quantity) * SUM(modl.single_piece_area), 2) as area, |
| | | date(mo.material_requisition_date) as date |
| | | FROM mm.material_outbound_detail AS modl |
| | | left join mm.material_outbound as mo on mo.material_outbound_id = modl.material_outbound_id |
| | | LEFT JOIN optimize_use AS ou ON modl.use_id = ou.id and ou.raw_stock_code = modl.inventory_id |
| | | LEFT JOIN flow_card AS fc ON ou.project_no = fc.project_no |
| | | where modl.use_id IS NOT NULL |
| | | and mo.material_requisition_date BETWEEN #{selectTime1} and #{selectTime2} |
| | | GROUP BY ou.width, ou.height, material_code |
| | | </select> |
| | | |
| | | <select id="exportCrossProcessBreakingMp"> |
| | |
| | | </select> |
| | | |
| | | <select id="exportOrderPlanDecompositionMp"> |
| | | SELECT |
| | | o.order_id, |
| | | o.customer_name, |
| | | o.project, |
| | | o.batch, |
| | | o.quantity, |
| | | o.area, |
| | | date(fc.create_time) as create_time, |
| | | date(orw.startTime) as startTime, |
| | | oopd.completionsNum, |
| | | sum( DISTINCT fc.received_quantity ) AS received_quantity, |
| | | sum( DISTINCT fc.quantity - fc.received_quantity ) AS receivedNo, |
| | | IF(fc.quantity=fc.received_quantity,'已清单','') as accomplish, |
| | | DATEDIFF( |
| | | MAX( rw.reporting_work_time ), |
| | | min( rw.reporting_work_time ))+1 AS daysDifference |
| | | FROM |
| | | sd.`order` AS o |
| | | LEFT JOIN flow_card AS fc ON fc.order_id = o.order_id |
| | | LEFT JOIN ( |
| | | SELECT |
| | | a.order_id, |
| | | MIN( b.reporting_work_time ) AS startTime |
| | | FROM |
| | | sd.`order` AS a |
| | | LEFT JOIN reporting_work AS b ON a.order_id = b.order_id |
| | | WHERE |
| | | b.this_process = '切割' |
| | | AND date(a.create_time) >= #{dates[0]} |
| | | and date(a.create_time) <= #{dates[1]} |
| | | SELECT o.order_id, |
| | | o.customer_name, |
| | | o.project, |
| | | o.batch, |
| | | o.quantity, |
| | | o.area, |
| | | date(fc.create_time) as create_time, |
| | | date(orw.startTime) as startTime, |
| | | oopd.completionsNum, |
| | | sum(DISTINCT fc.received_quantity) AS received_quantity, |
| | | sum(DISTINCT fc.quantity - fc.received_quantity) AS receivedNo, |
| | | IF(fc.quantity = fc.received_quantity, '已清单', '') as accomplish, |
| | | DATEDIFF( |
| | | MAX(rw.reporting_work_time), |
| | | min(rw.reporting_work_time)) + 1 AS daysDifference |
| | | FROM sd.`order` AS o |
| | | LEFT JOIN flow_card AS fc ON fc.order_id = o.order_id |
| | | LEFT JOIN (SELECT a.order_id, |
| | | MIN(b.reporting_work_time) AS startTime |
| | | FROM sd.`order` AS a |
| | | LEFT JOIN reporting_work AS b ON a.order_id = b.order_id |
| | | WHERE b.this_process = '切割' |
| | | AND date(a.create_time) >= #{dates[0]} |
| | | and date(a.create_time) <= #{dates[1]} |
| | | |
| | | GROUP BY |
| | | a.order_id |
| | | ) AS orw ON orw.order_id = o.order_id |
| | | LEFT JOIN ( |
| | | SELECT |
| | | a.order_id, |
| | | SUM( b.reporting_work_num ) AS completionsNum |
| | | FROM |
| | | sd.`order` AS a |
| | | LEFT JOIN sd.order_process_detail AS b ON a.order_id = b.order_id |
| | | WHERE |
| | | b.process = '包装' |
| | | AND date(a.create_time) >= #{dates[0]} |
| | | and date(a.create_time) <= #{dates[1]} |
| | | GROUP BY |
| | | a.order_id |
| | | ) AS oopd ON oopd.order_id = o.order_id |
| | | LEFT JOIN reporting_work AS rw ON rw.order_id = fc.order_id |
| | | AND rw.process_id = fc.process_id |
| | | WHERE |
| | | date(o.create_time) >= #{dates[0]} |
| | | and date(o.create_time) <= #{dates[1]} |
| | | GROUP BY a.order_id) AS orw ON orw.order_id = o.order_id |
| | | LEFT JOIN (SELECT a.order_id, |
| | | SUM(b.reporting_work_num) AS completionsNum |
| | | FROM sd.`order` AS a |
| | | LEFT JOIN sd.order_process_detail AS b ON a.order_id = b.order_id |
| | | WHERE b.process = '包装' |
| | | AND date(a.create_time) >= #{dates[0]} |
| | | and date(a.create_time) <= #{dates[1]} |
| | | GROUP BY a.order_id) AS oopd ON oopd.order_id = o.order_id |
| | | LEFT JOIN reporting_work AS rw ON rw.order_id = fc.order_id |
| | | AND rw.process_id = fc.process_id |
| | | WHERE date(o.create_time) >= #{dates[0]} |
| | | and date(o.create_time) <= #{dates[1]} |
| | | AND fc.create_time IS NOT NULL |
| | | GROUP BY |
| | | o.order_id |
| | | GROUP BY o.order_id |
| | | </select> |
| | | |
| | | <select id="exportProcessToBeCompletedMp"> |
| | |
| | | and odpd.process = #{process} |
| | | and date(o.create_time) >= #{date[0]} |
| | | and date(o.create_time) <= #{date[1]} |
| | | and position(ifnull(#{inputVal},'') in od.order_id) |
| | | and position(ifnull(#{project},'') in o.project) |
| | | and position(ifnull(#{inputVal}, '') in od.order_id) |
| | | and position(ifnull(#{project}, '') in o.project) |
| | | and od.quantity > odpd.reporting_work_num |
| | | |
| | | group by fc.process_id, fc.order_number, fc.technology_number |
| | |
| | | </select> |
| | | |
| | | <select id="exportWorkInProgressMp"> |
| | | select #{process} as thisProcess, |
| | | select #{process} as thisProcess, |
| | | fc.process_id, |
| | | o.customer_name, |
| | | o.project, |
| | | o.order_id, |
| | | o.batch, |
| | | if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape, |
| | | if(od.shape = 1, '普形', if(od.shape = 2, '异形', '')) as shape, |
| | | ogd.order_number, |
| | | ogd.technology_number, |
| | | ogd.process, |
| | |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num as stockNum, |
| | | odpd.broken_num as stockNum, |
| | | ROUND(ogd.child_width * ogd.child_height * |
| | | (odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num) / 1000000, 2) as stockArea, |
| | | odpd.broken_num) / 1000000, 2) as stockArea, |
| | | od.product_name, |
| | | od.bend_radius |
| | | |
| | |
| | | where LENGTH(fc.process_id) = 14 |
| | | and odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num != 0 |
| | | and odpd.process = #{process} and date(o.create_time) >= #{date[0]} |
| | | and odpd.process = #{process} |
| | | and date(o.create_time) >= #{date[0]} |
| | | and date(o.create_time) <= #{date[1]} |
| | | and position(ifnull(#{inputVal},'') in od.order_id) |
| | | and position(ifnull(#{project},'') in o.project) |
| | | and position(ifnull(#{inputVal}, '') in od.order_id) |
| | | and position(ifnull(#{project}, '') in o.project) |
| | | |
| | | group by fc.process_id, fc.order_number, fc.technology_number |
| | | order by fc.process_id, fc.order_number, fc.technology_number |
| | |
| | | select d.customer_name as customerName, |
| | | d.project, |
| | | d.batch, |
| | | c.order_id as orderId, |
| | | c.order_id as orderId, |
| | | d.quantity, |
| | | d.area, |
| | | dd.quantity as shippedQuantity, |
| | | dd.area as shippedArea, |
| | | dd.quantity as shippedQuantity, |
| | | dd.area as shippedArea, |
| | | e.reportWorkQuantity, |
| | | e.reportWorkQuantityCount |
| | | |
| | |
| | | technology_number, |
| | | sum(a.broken_num) as broken_num, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", ifnull(reporting_work_num,0), "\"")), |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", ifnull(reporting_work_num, 0), "\"")), |
| | | '}' |
| | | ) as reportWorkQuantity, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", ifnull(reporting_work_num,0), "\"")), |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", ifnull(reporting_work_num, 0), "\"")), |
| | | '}' |
| | | ) as reportWorkQuantityCount |
| | | FROM sd.order_process_detail as a |
| | | left join sd.`order` as o on o.order_id = a.order_id |
| | | where date(o.create_time) >= #{date[0]} |
| | | and date(o.create_time) <= #{date[1]} |
| | | GROUP BY process_id,a.technology_number |
| | | ) as e |
| | | GROUP BY process_id, a.technology_number) as e |
| | | on e.process_id = c.process_id |
| | | and e.technology_number = c.technology_number |
| | | left join sd.delivery_detail as dd on dd.order_id = a.order_id and dd.order_number = a.order_number |
| | | where d.create_time and date(o.create_time) >= #{dates[0]} |
| | | and date(o.create_time) <= #{dates[1]} and reportWorkQuantity is not null |
| | | where d.create_time |
| | | and date(o.create_time) >= #{dates[0]} |
| | | and date(o.create_time) <= #{dates[1]} |
| | | and reportWorkQuantity is not null |
| | | GROUP BY a.order_id |
| | | ORDER BY a.order_id |
| | | </select> |
| | |
| | | LEFT JOIN optimize_use AS ou ON modl.use_id = ou.id and ou.raw_stock_code = modl.inventory_id |
| | | LEFT JOIN flow_card AS fc ON ou.project_no = fc.project_no |
| | | where modl.use_id IS NOT NULL |
| | | and |
| | | date(mo.material_requisition_date) >= #{dates[0]} |
| | | and date(mo.material_requisition_date) <= #{dates[1]} |
| | | and date(mo.material_requisition_date) >= #{dates[0]} |
| | | and date(mo.material_requisition_date) <= #{dates[1]} |
| | | GROUP BY ou.width, ou.height, material_code |
| | | </select> |
| | | |
| | |
| | | AND opd.order_number = fc.order_number |
| | | AND opd.technology_number = fc.technology_number |
| | | |
| | | WHERE |
| | | date(o.create_time) >= #{dates[0]} |
| | | and date(o.create_time) <= #{dates[1]} |
| | | WHERE date(o.create_time) >= #{dates[0]} |
| | | and date(o.create_time) <= #{dates[1]} |
| | | GROUP BY o.order_id, |
| | | fc.order_number, |
| | | fc.technology_number |
| | |
| | | |
| | | <select id="teamOutputMp" resultMap="teamOutputMap"> |
| | | SELECT |
| | | rw.reporting_work_time, |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | o.project, |
| | | rw.process_id, |
| | | rwd.order_number, |
| | | MAX( ogd.child_width ) as width, |
| | | MAX( ogd.child_height ) as height, |
| | | rw.reporting_work_time, |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | o.project, |
| | | rw.process_id, |
| | | rwd.order_number, |
| | | MAX( ogd.child_width ) as width, |
| | | MAX( ogd.child_height ) as height, |
| | | if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape, |
| | | sum( pd.thickness ) as thickness, |
| | | od.edging_type, |
| | | rwd.completed_quantity, |
| | | ROUND(MAX( ogd.child_width )*MAX( ogd.child_height )*rwd.completed_quantity/1000000,2) as area, |
| | | od.product_name |
| | | sum( pd.thickness ) as thickness, |
| | | od.edging_type, |
| | | rwd.completed_quantity, |
| | | ROUND(MAX( ogd.child_width )*MAX( ogd.child_height )*rwd.completed_quantity/1000000,2) as area, |
| | | od.product_name |
| | | FROM |
| | | reporting_work AS rw |
| | | LEFT JOIN reporting_work_detail AS rwd ON rw.reporting_work_id = rwd.reporting_work_id |
| | | LEFT JOIN sd.`order` AS o ON o.order_id = rw.order_id |
| | | LEFT JOIN sd.order_detail AS od ON od.order_id = o.order_id |
| | | AND od.order_number = rwd.order_number |
| | | LEFT JOIN sd.order_glass_detail AS ogd ON ogd.order_id = o.order_id |
| | | AND ogd.order_number = rwd.order_number |
| | | AND ogd.technology_number = rwd.technology_number |
| | | AND ogd.order_number = od.order_number |
| | | LEFT JOIN ( |
| | | SELECT |
| | | prod_id, |
| | | glass_sort, |
| | | REPLACE ( JSON_UNQUOTE( JSON_EXTRACT( separation, '$.thickness' )), 'mm', '' ) AS thickness |
| | | FROM |
| | | sd.product_detail |
| | | WHERE |
| | | detail_type = "glass" |
| | | ) AS pd ON pd.prod_id = od.product_id |
| | | AND pd.glass_sort = rwd.technology_number |
| | | reporting_work AS rw |
| | | LEFT JOIN reporting_work_detail AS rwd ON rw.reporting_work_id = rwd.reporting_work_id |
| | | LEFT JOIN sd.`order` AS o ON o.order_id = rw.order_id |
| | | LEFT JOIN sd.order_detail AS od ON od.order_id = o.order_id |
| | | AND od.order_number = rwd.order_number |
| | | LEFT JOIN sd.order_glass_detail AS ogd ON ogd.order_id = o.order_id |
| | | AND ogd.order_number = rwd.order_number |
| | | AND ogd.technology_number = rwd.technology_number |
| | | AND ogd.order_number = od.order_number |
| | | LEFT JOIN ( |
| | | SELECT |
| | | prod_id, |
| | | glass_sort, |
| | | REPLACE ( JSON_UNQUOTE( JSON_EXTRACT( separation, '$.thickness' )), 'mm', '' ) AS thickness |
| | | FROM |
| | | sd.product_detail |
| | | WHERE |
| | | detail_type = "glass" |
| | | ) AS pd ON pd.prod_id = od.product_id |
| | | AND pd.glass_sort = rwd.technology_number |
| | | where rw.reviewed_state=1 and rw.reporting_work_time between #{selectTime1} and #{selectTime2} |
| | | and rw.this_process=#{selectProcesses} |
| | | and rw.this_process=#{selectProcesses} |
| | | <if test="teamOutputDTO.thisProcess != null and teamOutputDTO.thisProcess != ''"> |
| | | and rw.this_process regexp #{teamOutputDTO.thisProcess} |
| | | </if> |
| | |
| | | </if> |
| | | |
| | | GROUP BY |
| | | rwd.order_number, |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | rw.process_id, |
| | | rw.reporting_work_id |
| | | rwd.order_number, |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | rw.process_id, |
| | | rw.reporting_work_id |
| | | ORDER BY |
| | | rw.this_process, |
| | | rw.reporting_work_time, |
| | | rw.teams_groups_name, |
| | | rw.process_id |
| | | rw.this_process, |
| | | rw.reporting_work_time, |
| | | rw.teams_groups_name, |
| | | rw.process_id |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | |
| | | </select> |
| | | |
| | | <select id="workInProgressOrderMp"> |
| | | select #{selectProcesses} as thisProcess, |
| | | select #{selectProcesses} as thisProcess, |
| | | o.customer_name, |
| | | o.project, |
| | | o.order_id, |
| | | o.batch, |
| | | if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape, |
| | | sum(od.quantity) as quantity, |
| | | if(od.shape = 1, '普形', if(od.shape = 2, '异形', '')) as shape, |
| | | sum(od.quantity) as quantity, |
| | | sum(odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num )as stockNum, |
| | | odpd.broken_num) as stockNum, |
| | | sum(ROUND(ogd.child_width * ogd.child_height * |
| | | (odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num) / 1000000, 2)) as stockArea, |
| | | odpd.broken_num) / 1000000, 2)) as stockArea, |
| | | od.product_name |
| | | |
| | | from sd.order_detail AS od |
| | |
| | | where LENGTH(fc.process_id) = 14 |
| | | and odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num != 0 |
| | | and odpd.process = #{selectProcesses} and o.create_time between #{selectTime1} and #{selectTime2} |
| | | and position(#{orderId} in od.order_id) and position(#{inputProject} in o.project) |
| | | and odpd.process = #{selectProcesses} |
| | | and o.create_time between #{selectTime1} and #{selectTime2} |
| | | and position(#{orderId} in od.order_id) |
| | | and position(#{inputProject} in o.project) |
| | | |
| | | group by o.order_id |
| | | order by o.order_id |
| | | </select> |
| | | |
| | | |
| | | <select id="workInProgressProcessMp"> |
| | | select #{selectProcesses} as thisProcess, |
| | | select #{selectProcesses} as thisProcess, |
| | | o.customer_name, |
| | | o.project, |
| | | o.order_id, |
| | | fc.process_id, |
| | | o.batch, |
| | | if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape, |
| | | sum(od.quantity) as quantity, |
| | | if(od.shape = 1, '普形', if(od.shape = 2, '异形', '')) as shape, |
| | | sum(od.quantity) as quantity, |
| | | sum(odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num )as stockNum, |
| | | odpd.broken_num) as stockNum, |
| | | sum(ROUND(ogd.child_width * ogd.child_height * |
| | | (odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num) / 1000000, 2)) as stockArea, |
| | | odpd.broken_num) / 1000000, 2)) as stockArea, |
| | | od.product_name |
| | | |
| | | from sd.order_detail AS od |
| | |
| | | where LENGTH(fc.process_id) = 14 |
| | | and odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count - |
| | | odpd.broken_num != 0 |
| | | and odpd.process = #{selectProcesses} and o.create_time between #{selectTime1} and #{selectTime2} |
| | | and position(#{orderId} in od.order_id) and position(#{inputProject} in o.project) |
| | | and odpd.process = #{selectProcesses} |
| | | and o.create_time between #{selectTime1} and #{selectTime2} |
| | | and position(#{orderId} in od.order_id) |
| | | and position(#{inputProject} in o.project) |
| | | |
| | | group by o.order_id,fc.process_id |
| | | order by o.order_id,fc.process_id |
| | | group by o.order_id, fc.process_id |
| | | order by o.order_id, fc.process_id |
| | | </select> |
| | | |
| | | <select id="scheduleProductionScheduleMp" resultMap="scheduleProductionScheduleMap"> |
| | | select ps.order_id, |
| | | o.project, |
| | | ps.processes, |
| | | sum(ps.scheduling_quantity) as scheduling_quantity, |
| | | notes, |
| | | date(ps.scheduled_start_time) as scheduled_start_time, |
| | | date(ps.plan_end_time) as plan_end_time |
| | | from (select order_id, order_number, processes, scheduling_quantity, scheduled_start_time, plan_end_time, notes |
| | | from production_scheduling |
| | | where processes = #{processes} |
| | | GROUP BY order_id, order_number) as ps |
| | | left join sd.`order` as o on o.order_id = ps.order_id |
| | | where ps.processes = #{processes} |
| | | and ps.scheduled_start_time between #{selectTime1} and #{selectTime2} |
| | | <if test="scheduleProductionScheduleDTO.orderId != null and scheduleProductionScheduleDTO.orderId != ''"> |
| | | and ps.order_id regexp #{scheduleProductionScheduleDTO.orderId} |
| | | </if> |
| | | <if test="scheduleProductionScheduleDTO.project != null and scheduleProductionScheduleDTO.project != ''"> |
| | | and o.project regexp #{scheduleProductionScheduleDTO.project} |
| | | </if> |
| | | <if test="scheduleProductionScheduleDTO.processes != null and scheduleProductionScheduleDTO.processes != ''"> |
| | | and ps.processes regexp #{scheduleProductionScheduleDTO.processes} |
| | | </if> |
| | | <if test="scheduleProductionScheduleDTO.notes != null and scheduleProductionScheduleDTO.notes != ''"> |
| | | and ps.notes regexp #{scheduleProductionScheduleDTO.notes} |
| | | </if> |
| | | GROUP BY ps.order_id, ps.processes |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getScheduleProductionScheduleTotal"> |
| | | select CEILING(count(ps.order_id)/#{pageSize}) as 'pageTotal', |
| | | count(distinct ps.order_id) as 'total' |
| | | from (select order_id, order_number, processes, scheduling_quantity, scheduled_start_time, plan_end_time, notes |
| | | from production_scheduling |
| | | where processes = #{processes} |
| | | GROUP BY order_id, order_number) as ps |
| | | left join sd.`order` as o on o.order_id = ps.order_id |
| | | where ps.processes = #{processes} |
| | | and ps.scheduled_start_time between #{selectTime1} and #{selectTime2} |
| | | <if test="scheduleProductionScheduleDTO.orderId != null and scheduleProductionScheduleDTO.orderId != ''"> |
| | | and ps.order_id regexp #{scheduleProductionScheduleDTO.orderId} |
| | | </if> |
| | | <if test="scheduleProductionScheduleDTO.project != null and scheduleProductionScheduleDTO.project != ''"> |
| | | and o.project regexp #{scheduleProductionScheduleDTO.project} |
| | | </if> |
| | | <if test="scheduleProductionScheduleDTO.processes != null and scheduleProductionScheduleDTO.processes != ''"> |
| | | and ps.processes regexp #{scheduleProductionScheduleDTO.processes} |
| | | </if> |
| | | <if test="scheduleProductionScheduleDTO.notes != null and scheduleProductionScheduleDTO.notes != ''"> |
| | | and ps.notes regexp #{scheduleProductionScheduleDTO.notes} |
| | | </if> |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="exportScheduleReportMp"> |
| | | select ps.order_id, |
| | | o.project, |
| | | ps.processes, |
| | | sum(ps.scheduling_quantity) as scheduling_quantity, |
| | | notes, |
| | | date(ps.scheduled_start_time) as scheduled_start_time, |
| | | date(ps.plan_end_time) as plan_end_time |
| | | from (select order_id, order_number, processes, scheduling_quantity, scheduled_start_time, plan_end_time, notes |
| | | from production_scheduling |
| | | where processes = #{process} |
| | | GROUP BY order_id, order_number) as ps |
| | | left join sd.`order` as o on o.order_id = ps.order_id |
| | | where ps.processes = #{process} |
| | | and date(scheduled_start_time) >= #{date[0]} |
| | | and date(scheduled_start_time) <= #{date[1]} |
| | | GROUP BY ps.order_id, ps.processes |
| | | </select> |
| | | </mapper> |