| | |
| | | } |
| | | |
| | | let flag = $ref(true) |
| | | |
| | | function intoCreateProduct(){ |
| | | if(flag){ |
| | | router.push(`/main/processCard/SplittingDetails?orderId=${orderId}`) |
| | |
| | | |
| | | let orderId = route.query.orderId |
| | | let productionId = route.query.productionId |
| | | |
| | | |
| | | //第一次加载数据 |
| | | |
| | | request.post(`/processCard/selectNoCard/${orderId}/${productionId}`, filterData.value).then((res) => { |
| | |
| | | function padLeftZero(str) { |
| | | return ('00' + str).substr(str.length) |
| | | } |
| | | |
| | | |
| | | |
| | | /*后端返回结果多层嵌套展示*/ |
| | |
| | | },//表头参数 |
| | | columns: [ |
| | | {type: 'checkbox', fixed: "left", title: '选择'}, |
| | | {field: 'orderNumber', title: '订序', filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged}, |
| | | {field: 'shape', title: '形状', showOverflow: "ellipsis", filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged}, |
| | | {field: 'width', title: '宽', sortable: true, filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged,width:'60px'}, |
| | | {field: 'height', title: '高', sortable: true, filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged,width:'60px'}, |
| | | { |
| | | field: 'orderNumber', |
| | | title: '订序', |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'shape', |
| | | title: '形状', |
| | | showOverflow: "ellipsis", |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'width', |
| | | title: '宽', |
| | | sortable: true, |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged, |
| | | width: '60px' |
| | | }, |
| | | { |
| | | field: 'height', |
| | | title: '高', |
| | | sortable: true, |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged, |
| | | width: '60px' |
| | | }, |
| | | {field: 'baiscQuantity', title: '待分数量', showOverflow: "ellipsis",width:'60px'}, |
| | | {field: 'computeGrossArea', title: '待分面积',width:'60px'}, |
| | | {field: 'totalThickness', title: '总厚度',width:'80px'}, |
| | |
| | | data: [],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod({columns, data}) {//页脚函数 |
| | | let footList = ['baiscQuantity', 'computeGrossArea', 'totalThickness','thickness', 'weight'] |
| | | let footList = ['', '', '', '', ''] |
| | | return [ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | |
| | | } |
| | | |
| | | }) |
| | | |
| | | |
| | | //左侧子组件接收参数 |
| | | const xGridLeft = ref() |
| | |
| | | },//表头参数 |
| | | columns: [ |
| | | {type: 'checkbox', fixed: "left", title: '选择'}, |
| | | {field: 'processId', title: '流程卡号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 130,filterMethod:filterChanged}, |
| | | { |
| | | field: 'processId', |
| | | title: '流程卡号', |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | width: 130, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'orderNumber', |
| | | title: '订序', |
| | |
| | | slots: {filter: 'num1_filter'} |
| | | ,filterMethod:filterChanged |
| | | }, |
| | | {field: 'landingSequence', title: '小片顺序', filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged}, |
| | | { |
| | | field: 'landingSequence', |
| | | title: '小片顺序', |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | {field: 'shape', title: '形状', filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged}, |
| | | {field: 'width', title: '宽', showOverflow: "ellipsis"}, |
| | | {field: 'height', title: '高'}, |
| | |
| | | data: [],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod({columns, data}) {//页脚函数 |
| | | let footList = ['总数量', '总面积', '分箱数'] |
| | | let footList = [''] |
| | | return [ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | |
| | | const createProcessCard = () => { |
| | | const $grid = xGrid.value |
| | | const checkedList = $grid.getCheckboxRecords() |
| | | |
| | | if (checkedList.length === 0) { |
| | | ElMessage.warning("请先选择右侧数据") |
| | | return |
| | |
| | | checkedList.forEach((item)=>{ |
| | | delete item._X_ROW_KEY |
| | | }) |
| | | |
| | | $gridLeft.insertAt(checkedList) |
| | | $grid.remove(checkedList) |
| | | if ($gridLeft || $grid) { |
| | | $gridLeft.clearCheckboxRow() |
| | | $grid.clearCheckboxRow() |
| | | } |
| | | } |
| | | |
| | | let checkedNum = ref('') |
| | |
| | | } else { |
| | | //右边表格没有此条数据则往右边表格插入数据 |
| | | item.baiscQuantity = checkedNum.value |
| | | if (item.quantity === 0) { |
| | | $gridLeft.remove(item) |
| | | } |
| | | $grid.insert(item) |
| | | } |
| | | }) |
| | |
| | | |
| | | $gridLeft.remove(item) |
| | | }) |
| | | } |
| | | |
| | | |
| | | } |
| | | $gridLeft.clearCheckboxRow() |
| | | $grid.clearCheckboxRow() |
| | | } catch (e) { |
| | | ElMessage.warning(e.message) |
| | | } |
| | |
| | | //获取左边表格checkbox选中的数据 |
| | | const checkedListLeft = $gridLeft.getCheckboxRecords() |
| | | //判断右边表格是否有选中的数据 |
| | | if (checkedList.length === 0) { |
| | | if (checkedList.length * 1 === 0) { |
| | | ElMessage.warning("请先选择右侧数据") |
| | | return |
| | | } |
| | |
| | | if (/^[1-9]\d*$/.test(checkedNum.value)) { |
| | | checkedList.forEach((item) => { |
| | | //判断可用数量是否大于等于输入的数量,不满足则抛出异常 |
| | | if (item.baiscQuantity < checkedNum.value) throw new Error("请输入小于等于可用数量的数字"); |
| | | if (item.baiscQuantity * 1 < checkedNum.value * 1) throw new Error("请输入小于等于可用数量的数字"); |
| | | item.baiscQuantity = item.baiscQuantity - checkedNum.value |
| | | //定义key值保持 |
| | | let key = item._X_ROW_KEY |
| | | //左边表格数据 |
| | | let leftData = $gridLeft.getTableData().fullData |
| | | //左边表格数据中查找当前数据下标 |
| | | let filterIndex = leftData.findIndex(item1 => item1.orderNumber === item.orderNumber) |
| | | //判断右侧勾选值与左侧是否相同 |
| | | if (checkedListLeft[0].orderNumber === item.orderNumber) { |
| | | |
| | | //如果右边表格数据中存在当前数据则数量相加 |
| | | if (filterIndex >= 0) { |
| | | leftData[filterIndex].quantity = leftData[filterIndex].quantity * 1 + checkedNum.value * 1 |
| | |
| | | if (item.baiscQuantity === 0) { |
| | | $grid.remove(checkedList) |
| | | } |
| | | //delete item._X_ROW_KEY |
| | | } else { |
| | | item.quantity = checkedNum.value |
| | | item.processId = checkedListLeft[0].processId |
| | | item.landingSequence = checkedListLeft[0].landingSequence |
| | | delete item._X_ROW_KEY |
| | | $gridLeft.insert(item) |
| | | item._X_ROW_KEY = key |
| | | } |
| | | } else { |
| | | |
| | | // if (){ |
| | | // |
| | | // } |
| | | //如果勾选两个值不同则插入同流程卡 |
| | | item.quantity = checkedNum.value |
| | | item.processId = checkedListLeft[0].processId |
| | | item.landingSequence = checkedListLeft[0].landingSequence |
| | | if (item.baiscQuantity === 0) { |
| | | $grid.remove(checkedList) |
| | | |
| | | } |
| | | for (let i = 0; i < leftData.length; i++) { |
| | | if (leftData[i].orderNumber === item.orderNumber && leftData[i].processId === item.processId) { |
| | | leftData[i].quantity = leftData[i].quantity * 1 + checkedNum.value * 1 |
| | | break |
| | | } else if (leftData[i].orderNumber === item.orderNumber && leftData[i].processId !== item.processId) { |
| | | |
| | | delete item._X_ROW_KEY |
| | | $gridLeft.insert(item) |
| | | item._X_ROW_KEY = key |
| | | break |
| | | } |
| | | else if (leftData[i].orderNumber !== item.orderNumber && leftData[i].processId !== item.processId) { |
| | | |
| | | delete item._X_ROW_KEY |
| | | $gridLeft.insert(item) |
| | | item._X_ROW_KEY = key |
| | | break |
| | | } |
| | | } |
| | | // leftData.forEach((items) => { |
| | | // console.log(items.processId, item.processId,"——————",items.orderNumber, item.orderNumber) |
| | | // if (items.orderNumber === item.orderNumber && items.processId===item.processId) { |
| | | // console.log("测试333") |
| | | // |
| | | // } |
| | | // else{ |
| | | // |
| | | // } |
| | | // |
| | | // }) |
| | | |
| | | } |
| | | |
| | | }) |
| | | } else if (checkedNum.value === '') {//判断数量输入框有无输入数字 |
| | | } else if (checkedNum.value === '') {//判断数量输入框无输入数字 |
| | | checkedList.forEach((item) => { |
| | | item.processId = checkedListLeft[0].processId |
| | | item.landingSequence = checkedListLeft[0].landingSequence |
| | | item.quantity = checkedListLeft[0].baiscQuantity |
| | | delete item._X_ROW_KEY |
| | | }) |
| | | $gridLeft.insertAt(checkedList) |
| | | $grid.remove(checkedList) |
| | | } |
| | | if ($gridLeft || $grid) { |
| | | $gridLeft.clearCheckboxRow() |
| | | $grid.clearCheckboxRow() |
| | | } |
| | | |
| | | } catch (e) { |
| | | ElMessage.warning(e.message) |
| | | } |
| | | } |
| | | |
| | | |
| | | //保存流程卡数据 |
| | | const gridEvents = { |
| | |
| | | if (res.code == 200) { |
| | | ElMessage.success("保存成功") |
| | | //router.push('/main/processCard/SplittingDetails?orderId=${orderId}') |
| | | router.push({path: '/main/processCard/AddProcessCard', query: {orderId: orderId,productionId:productionId,random:Math.random()}}) |
| | | router.push({ |
| | | path: '/main/processCard/AddProcessCard', |
| | | query: {orderId: orderId, productionId: productionId, random: Math.random()} |
| | | }) |
| | | |
| | | //location.reload(); |
| | | } else { |
| | |
| | | <div class="header" style="height: 5%;width: 100%"> |
| | | |
| | | <el-button |
| | | style="float: left" |
| | | @click="intoCreateProduct" |
| | | id="searchButton1" |
| | | type="primary" |
| | | :icon="ArrowLeftBold" |
| | | round> |
| | | round |
| | | style="float: left" |
| | | type="primary" |
| | | @click="intoCreateProduct"> |
| | | {{ flag ? '返回' : '返回' }} |
| | | </el-button> |
| | | <!-- <el-button type="primary">保存分架</el-button>--> |
| | |
| | | <el-container style="height: 100%;width: 100%"> |
| | | <el-aside style="width: 44%;height: 100%" > |
| | | <vxe-grid |
| | | max-height="100%" |
| | | class="mytable-scrollbar" |
| | | ref="xGridLeft" |
| | | class="mytable-scrollbar" |
| | | max-height="100%" |
| | | v-bind="gridLeftOptions" |
| | | v-on="gridEvents" |
| | | > |
| | |
| | | </template> |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">打印</el-button> |
| | | <el-button @click="getTableRow(row,'setType')" link type="primary" size="small">排版</el-button> |
| | | <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">删除</el-button> |
| | | <el-button link size="small" type="primary" @click="getTableRow(row,'edit')">打印</el-button> |
| | | <el-button link size="small" type="primary" @click="getTableRow(row,'setType')">排版</el-button> |
| | | <el-button link size="small" type="primary" @click="getTableRow(row,'delete')">删除</el-button> |
| | | </template> |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input type="text" |
| | | v-model="option.data" |
| | | <input v-model="option.data" |
| | | type="text" |
| | | @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | <div width="12%"> |
| | | <el-main style=""> |
| | | <span>选中数量:<el-input type="number" v-model="checkedNum"></el-input></span><br> |
| | | <span>选中数量:<el-input v-model="checkedNum" clearable type="number"></el-input></span><br> |
| | | <el-button type="primary" @click="addRight"> →</el-button> |
| | | <br> |
| | | <br> |
| | | <el-button type="primary" @click="addLeft"> ←</el-button> |
| | | <br> |
| | | <br> |
| | | <el-button @click="createProcessCard" type="primary">建立流程卡</el-button> |
| | | <el-button type="primary" @click="createProcessCard">建立流程卡</el-button> |
| | | </el-main> |
| | | </div> |
| | | |
| | |
| | | <el-aside style="width: 100%;height: 100%"> |
| | | <vxe-grid |
| | | |
| | | max-height="100%" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | class="mytable-scrollbar" |
| | | max-height="100%" |
| | | v-bind="gridOptions" |
| | | > |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |
| | |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input type="text" |
| | | v-model="option.data" |
| | | <input v-model="option.data" |
| | | type="text" |
| | | @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | |
| | | import BasicTable from '@/components/basic/BasicTable.vue' |
| | | import {VXETable} from "vxe-table"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | import {changeFilterEvent,filterChanged} from "@/hook" |
| | | |
| | | let router = useRouter() |
| | | const userStore = useUserInfoStore() |
| | |
| | | |
| | | //工序 |
| | | const value = ref('') |
| | | const options = [ |
| | | { |
| | | value: '切割', |
| | | label: '切割', |
| | | }, |
| | | { |
| | | value: '磨边', |
| | | label: '磨边', |
| | | }, |
| | | { |
| | | value: '钢化', |
| | | label: '钢化', |
| | | }, |
| | | ] |
| | | |
| | | |
| | | //排产状态 |
| | | const stateValue = ref('1') |
| | |
| | | const form = reactive({ |
| | | date1: '', |
| | | orderId: '' |
| | | }) |
| | | |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | processType: [], |
| | | }) |
| | | |
| | | |
| | |
| | | if (res.code == 200) { |
| | | pageTotal.value = res.data.total |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | titleSelectJson.value.processType=res.data.process |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | | console.log(res.data) |
| | | //禁用删除、保存按钮 |
| | | gridOptions.toolbarConfig.buttons[0].disabled = true |
| | | gridOptions.toolbarConfig.buttons[1].disabled = true |
| | |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } else if (inputVal != null && selectState == 1) { |
| | | } else |
| | | if (inputVal != null && selectState == 1) { |
| | | |
| | | //根据工序查询未排产数据 |
| | | request.post(`/productionScheduling/selectScheduling/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => { |
| | |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | // remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | |
| | | title: '计划结束时间' |
| | | }, |
| | | // {field: '排产编号', title: '排产编号', width: 120 }, |
| | | {field: 'order_id', title: '销售单号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 100}, |
| | | {field: 'customer_name', title: '客户名称', width: 110, filters: [{data: ''}], slots: {filter: 'num1_filter'}}, |
| | | {field: 'project', title: '项目名称', width: 100, filters: [{data: ''}], slots: {filter: 'num1_filter'}}, |
| | | {field: 'order_number', title: '序号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 70}, |
| | | {field: 'order_id', title: '销售单号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 100,filterMethod:filterChanged}, |
| | | {field: 'customer_name', title: '客户名称', width: 110, filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged}, |
| | | {field: 'project', title: '项目名称', width: 100, filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged}, |
| | | {field: 'order_number', title: '序号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 70,filterMethod:filterChanged}, |
| | | |
| | | {field: 'width', title: '宽', width: 60}, |
| | | {field: 'height', title: '高', width: 60}, |
| | | {field: 'width', title: '宽', width: 60,filters: [{data: ''}],slots: {filter: 'num1_filter'},filterMethod:filterChanged}, |
| | | {field: 'height', title: '高', width: 60,filters: [{data: ''}],slots: {filter: 'num1_filter'},filterMethod:filterChanged}, |
| | | {field: 'quantity', title: '订单数量', width: 70}, |
| | | {field: 'area', title: '订单面积', width: 90}, |
| | | { |
| | |
| | | |
| | | <el-input v-model="form.orderId" placeholder="销售单号" clearable style="width: 110px"></el-input> |
| | | |
| | | <el-select v-model="value" class="m-2" placeholder="工序" clearable style="width: 90px;"> |
| | | <el-select v-model="value" clearable placeholder="请选择工序" style="width: 120px"> |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | v-for="item in titleSelectJson['processType']" |
| | | :key="item.id" |
| | | :label="item.basic_name" |
| | | :value="item.basic_name" |
| | | /> |
| | | </el-select> |
| | | |
| | |
| | | |
| | | let productGlassTypeStore = useProductGlassTypeStore() |
| | | let router = useRouter() |
| | | let props = defineProps({ |
| | | rowIndex:{} |
| | | }) |
| | | const getTableRow = (row, type) => { |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | switch (type) { |
| | | case 'edit' : { |
| | | router.push({path: '/main/processCard/PrintFlowCard', query: {id: row.id}}) |
| | | // console.log(row) |
| | | // router.push({path: '/main/processCard/PrintFlowCard', query: {id: row.id}}) |
| | | break |
| | | } |
| | | case 'setType': { |
| | | request.post(`/processCard/updateLayoutStatus/${row.processId}`).then((res) => { |
| | | let state=row.layoutStatus |
| | | |
| | | if (state=='可排版'){ |
| | | request.post(`/processCard/updateLayoutStatus/${row.processId}/2`).then((res) => { |
| | | if (res.code == 200) { |
| | | ElMessage.success("排版成功") |
| | | location.reload(); |
| | | router.push({path: '/main/processCard/SelectProcessCard', query: {random:Math.random()}}) |
| | | } else { |
| | | |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | else if(state=='不可排版'){ |
| | | request.post(`/processCard/updateLayoutStatus/${row.processId}/1`).then((res) => { |
| | | if (res.code == 200) { |
| | | ElMessage.success("修改成功") |
| | | router.push({path: '/main/processCard/SelectProcessCard', query: {random:Math.random()}}) |
| | | } else { |
| | | |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | break |
| | | } |
| | | case 'delete': { |
| | | request.post(`/processCard/deleteFlowCard/${row.orderId}/${row.processId}`).then((res) => { |
| | | if (res.code == 200) { |
| | | ElMessage.success("删除成功") |
| | | location.reload(); |
| | | router.push({path: '/main/processCard/SelectProcessCard', query: {random:Math.random()}}) |
| | | } else { |
| | | |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | |
| | | } |
| | | }) |
| | | break |
| | |
| | | let total = reactive({ |
| | | pageTotal : 0, |
| | | dataTotal : 0, |
| | | pageSize : 5 |
| | | pageSize : 100 |
| | | }) |
| | | //第一次加载数据 |
| | | |
| | |
| | | |
| | | //页脚跳转 |
| | | const handlePageChange = ({ currentPage, pageSize }) => { |
| | | console.log('页码改变:', currentPage, pageSize) |
| | | pageNum.value=currentPage |
| | | total.pageTotal = pageSize |
| | | selectPageList() |
| | |
| | | filterData.value[column.property] = value |
| | | } |
| | | |
| | | //获取选中时间和是否转单状态 |
| | | //获取选中时间 |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | |
| | | request.post(`/processCard/flowCard/${startTime}/${endTime}`, filterData.value).then((res) => { |
| | | request.post(`/processCard/flowCard/1/${total.pageSize}/${startTime}/${endTime}`, filterData.value).then((res) => { |
| | | if(res.code==200){ |
| | | pageTotal.value=res.data.total |
| | | |
| | | total.pageTotal=parseInt(res.data.total) |
| | | pageNum.value=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | {title: '操作', width: 140, slots: { default: 'button_slot' },fixed:"left"}, |
| | | {title: '操作', width: 160, slots: { default: 'button_slot' },fixed:"left"}, |
| | | { type: 'seq',fixed:"left", title: '自序', width: 50 }, |
| | | {field: 'orderId', title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, }, |
| | | {field: 'orderId', title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' },width: 80 }, |
| | | {field: 'processId', width: 130, title: '流程卡号' ,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.productId', title: '产品编号' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.productName', title: '产品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, }, |
| | | {field: 'orderDetail.productId', title: '产品编号' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },}, |
| | | {field: 'orderDetail.productName', title: '产品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, width: 180}, |
| | | {field: 'order.project', title: '项目名称' ,showOverflow:"ellipsis"}, |
| | | {field: 'binningQuantity', title: '数量', }, |
| | | {field: 'quantity', title: '数量', }, |
| | | {field: 'orderDetail.computeGrossArea', title: '面积', }, |
| | | {field: 'founder', title: '分架员', }, |
| | | {field: 'orderDetail.processingNote', title: '加工要求', } |
| | | {field: 'orderDetail.processingNote', title: '加工要求', }, |
| | | {field: 'layoutStatus', title: '排版状态', } |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | |
| | | </template> |
| | | |
| | | <!--左边固定显示的插槽--> |
| | | |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">打印</el-button> |
| | | <el-button @click="getTableRow(row,'setType')" link type="primary" size="small">排版</el-button> |
| | | <el-button v-if="row.layoutStatus=='可排版'" @click="getTableRow(row,'setType')" link type="primary" size="small">排版</el-button> |
| | | <el-button v-else-if="row.layoutStatus=='不可排版'" @click="getTableRow(row,'setType')" link type="primary" size="small">可排版</el-button> |
| | | <el-button v-else-if="row.layoutStatus=='已排版'" disabled @click="getTableRow(row,'setType')" link type="primary" size="small">排版</el-button> |
| | | <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">删除</el-button> |
| | | </template> |
| | | |
| | |
| | | request.post(`/processCard/detailsSelect/${id}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | console.log(res.data) |
| | | pageTotal.value = res.data.total |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | xGrid.value.reloadData(produceList) |
| | |
| | | |
| | | let productGlassTypeStore = useProductGlassTypeStore() |
| | | let router = useRouter() |
| | | let isButtonDisabled=false |
| | | |
| | | const getTableRow = (row, type) => { |
| | | switch (type) { |
| | | case 'edit' : { |
| | |
| | | |
| | | //获取七天前到当前时间 |
| | | function getNowTime() { |
| | | const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 7) |
| | | const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 3) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0, 10) //默认开始时间7天前 |
| | |
| | | }) |
| | | |
| | | //点击查询 |
| | | const getWorkOrder = () => { |
| | | const getWorkOrder = (isButtonDisabled) => { |
| | | |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let selectState = optionVal.value |
| | | request.post(`/workOrder/orderGlassDetail/${startTime}/${endTime}/${selectState}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | //isButtonDisabled=false |
| | | pageTotal.value = res.data.total |
| | | xGrid.value.loadData(res.data.data) |
| | | gridOptions.loading = false |
| | |
| | | </el-select> |
| | | |
| | | <el-button |
| | | @click="getWorkOrder" |
| | | @click="getWorkOrder(isButtonDisabled)" |
| | | :disabled="isButtonDisabled" |
| | | id="select" |
| | | type="primary" :icon="Search">查询 |
| | | </el-button> |
| | |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {useRouter} from "vue-router"; |
| | | import {useRoute, useRouter} from "vue-router"; |
| | | import GlassType from '@/components/basic/product/GlassType.vue' |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | let indexFlag=$ref(1) |
| | | function changeRouter(index){ |
| | | indexFlag=index |
| | |
| | | </el-breadcrumb> |
| | | </div> |
| | | <div id="main-body"> |
| | | <router-view /> |
| | | <router-view :key="route.fullPath" /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | if(flowCardService.deleteFlowCardSv(orderId,processId)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"删除失败"); |
| | | throw new ServiceException(Constants.Code_500,"删除失败,请检查是否已报工"); |
| | | |
| | | } |
| | | } |
| | | |
| | | //修改排版状态 |
| | | @ApiOperation("修改排版状态接口") |
| | | @PostMapping("/updateLayoutStatus/{processId}") |
| | | @PostMapping("/updateLayoutStatus/{processId}/{state}") |
| | | public Result updateLayoutStatus( |
| | | @PathVariable String processId |
| | | @PathVariable String processId, |
| | | @PathVariable Integer state |
| | | ){ |
| | | if(flowCardService.updateLayoutStatusSv(processId)){ |
| | | if(flowCardService.updateLayoutStatusSv(processId,state)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"修改失败"); |
| | |
| | | import com.example.erp.entity.pp.ProductionScheduling; |
| | | import com.example.erp.exception.ServiceException; |
| | | import com.example.erp.service.pp.ProductionSchedulingService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @Api(value="排产controller",tags={"排产相关操作接口"}) |
| | | @RequestMapping("/productionScheduling") |
| | | public class ProductionSchedulingController { |
| | | @Autowired |
| | | ProductionSchedulingService productionSchedulingService; |
| | | |
| | | //查询第一次排版数据 |
| | | @ApiOperation("加载时查询排版数据接口") |
| | | @PostMapping ("/selectLastScheduling/{selectTime1}/{selectTime2}") |
| | | public Result selectLastScheduling( |
| | | @PathVariable String selectTime1, |
| | |
| | | |
| | | } |
| | | //点击查询排版数据 |
| | | @ApiOperation("点击查询排版数据接口") |
| | | @PostMapping ("/selectScheduling/{selectTime1}/{selectTime2}/{orderId}/{processes}/{state}") |
| | | public Result SelectScheduling( |
| | | public Result selectScheduling( |
| | | @PathVariable String selectTime1, |
| | | @PathVariable String selectTime2, |
| | | @PathVariable String orderId, |
| | | @PathVariable String processes, |
| | | @PathVariable Integer state, |
| | | @RequestBody ProductionScheduling productionScheduling){ |
| | | return Result.seccess(productionSchedulingService.SelectSchedulingSv(selectTime1,selectTime2,orderId,processes,state,productionScheduling)); |
| | | return Result.seccess(productionSchedulingService.selectSchedulingSv(selectTime1,selectTime2,orderId,processes,state,productionScheduling)); |
| | | |
| | | } |
| | | |
| | | //点击查询排版数据(带订单号查询) |
| | | @ApiOperation("根据条件查询排版数据接口") |
| | | @PostMapping ("/selectSchedulingNot/{selectTime1}/{selectTime2}/{orderId}/{processes}/{state}") |
| | | public Result selectSchedulingNot( |
| | | @PathVariable String selectTime1, |
| | |
| | | } |
| | | |
| | | //添加排产数据 |
| | | @ApiOperation("添加排产数据接口") |
| | | @PostMapping("/addScheduling") |
| | | public Result AddScheduling( @RequestBody Map<String,Object> object){ |
| | | public Result addScheduling( @RequestBody Map<String,Object> object){ |
| | | |
| | | if(productionSchedulingService.AddSchedulingSv(object)){ |
| | | if(productionSchedulingService.addSchedulingSv(object)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"保存失败"); |
| | |
| | | } |
| | | |
| | | //删除排产数据 |
| | | @ApiOperation("删除排产数据接口") |
| | | @PostMapping("/deleteScheduling") |
| | | public Result deleteScheduling( @RequestBody Map<String,Object> object) throws Exception{ |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("排版审核接口") |
| | | @PostMapping("/examineScheduling") |
| | | public Result ExamineScheduling( @RequestBody Map<String,Object> object){ |
| | | public Result examineScheduling( @RequestBody Map<String,Object> object){ |
| | | |
| | | if(productionSchedulingService.ExamineSchedulingSv(object)){ |
| | | if(productionSchedulingService.examineSchedulingSv(object)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"审核失败"); |
| | |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.exception.ServiceException; |
| | | import com.example.erp.service.pp.WorkOrderService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @Api(value="工单管理controller",tags={"工单管理操作接口"}) |
| | | @RequestMapping("/workOrder") |
| | | public class WorkOrderController { |
| | | @Autowired |
| | | WorkOrderService workOrderService; |
| | | |
| | | //查询工单 |
| | | @ApiOperation("查询工单接口") |
| | | @PostMapping ("/orderGlassDetail/{selectTime1}/{selectTime2}/{state}") |
| | | public Result dateWork( |
| | | @PathVariable Date selectTime1, |
| | |
| | | } |
| | | |
| | | //转生产订单查询 |
| | | @ApiOperation("转生产订单查询接口") |
| | | @PostMapping ("/addWork/{orderId}") |
| | | |
| | | public Result addWork( |
| | | @PathVariable String orderId, |
| | | @RequestBody OrderDetail orderDetail){ |
| | |
| | | |
| | | |
| | | //添加工单 |
| | | @ApiOperation("添加工单接口") |
| | | @PostMapping("/addOrderWork") |
| | | public Result addOrderWork( @RequestBody Map<String,Object> object){ |
| | | |
| | |
| | | } |
| | | |
| | | //删除工单 |
| | | @ApiOperation("删除工单接口") |
| | | @PostMapping("/deleteOrderWork/{orderId}/{productName}") |
| | | public Result deleteOrderWork( |
| | | @PathVariable String orderId, |
| | |
| | | //已优化数量 |
| | | private Integer optimizeQuantity; |
| | | //排版状态 |
| | | private Integer layoutStatus; |
| | | private String layoutStatus; |
| | | //补片数量 |
| | | private Integer numberPatches; |
| | | //库存数量 |
| | |
| | | private String orderId; |
| | | //订单序号 |
| | | private String orderNumber; |
| | | //小片顺序 |
| | | private String technologyNumber; |
| | | //排产工序 |
| | | private String processes; |
| | | //排产数量 |
| | |
| | | List<Map<String, String>> selectNoCardMp(String orderId, String productionId, FlowCard flowCard); |
| | | |
| | | //修改排版状态 |
| | | Boolean updateLayoutStatusMp(String processId); |
| | | Boolean updateLayoutStatusMp(String processId,Integer state); |
| | | |
| | | Integer selectLayoutStatus(String processId); |
| | | |
| | |
| | | Integer selectLayer(String productionId, Integer orderNumber); |
| | | |
| | | |
| | | Integer selectFlowCardCount(String orderId); |
| | | } |
| | |
| | | package com.example.erp.mapper.pp; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.erp.entity.pp.BasicDataProduce; |
| | | import com.example.erp.entity.pp.ProductionScheduling; |
| | | import com.example.erp.entity.sd.BasicData; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.sql.Date; |
| | |
| | | public interface ProductionSchedulingMapper extends BaseMapper<ProductionScheduling> { |
| | | |
| | | |
| | | List<Map<String,String>> SelectOkSchedulingMp(String selectTime1, String selectTime2,String orderId,String processes, ProductionScheduling productionScheduling); |
| | | List<Map<String,String>> selectOkSchedulingMp(String selectTime1, String selectTime2,String orderId,String processes, ProductionScheduling productionScheduling); |
| | | |
| | | List<Map<String,String>> SelectNoSchedulingMp(String selectTime1, String selectTime2,String orderId,String processes, ProductionScheduling productionScheduling); |
| | | List<Map<String,String>> selectNoSchedulingMp(String selectTime1, String selectTime2,String orderId,String processes, ProductionScheduling productionScheduling); |
| | | |
| | | List<Map<String,String>> selectLastSchedulingMp(String selectTime1, String selectTime2, ProductionScheduling productionScheduling); |
| | | |
| | |
| | | |
| | | Boolean insertSelective(String schedulingId, String orderId, String orderNumber, String processes, Integer schedulingQuantity, LocalDate scheduledStartTime, LocalDate planEndTime, String notes); |
| | | |
| | | Boolean ExamineSchedulingMp(String schedulingId, String userName); |
| | | Boolean examineSchedulingMp(String schedulingId, String userName); |
| | | |
| | | Boolean deleteSchedulingMp(String schedulingId); |
| | | |
| | | List<Map<String,String>> selectProcess(); |
| | | |
| | | Integer selectNumberMp(String orderId, String orderNumber, String processes); |
| | | } |
| | |
| | | //删除流程卡 |
| | | public Boolean deleteFlowCardSv(String orderId, String processId) { |
| | | if (!orderId.isEmpty() && !processId.isEmpty()) { |
| | | //判断该流程卡是否报工 |
| | | Integer count = flowCardMapper.reportingWorkCount(processId); |
| | | if (count == 0) { |
| | | //修改订单表分架状态为1,未全部分架完成 |
| | | flowCardMapper.updateProcessingCard(orderId, 1); |
| | | |
| | | //修改分架状态 |
| | | flowCardMapper.updateDeleteState(orderId, processId); |
| | | //删除分架明细 |
| | | flowCardMapper.deleteFlowCardMp(orderId, processId); |
| | | //判断该订单流程卡是否全部删除 |
| | | Integer flowNumber = flowCardMapper.selectFlowCardCount(orderId); |
| | | if (flowNumber == 0) { |
| | | //修改订单表分架状态为0,全部删除 |
| | | flowCardMapper.updateProcessingCard(orderId, 0); |
| | | } else { |
| | | //修改订单表分架状态为1,删除部分 |
| | | flowCardMapper.updateProcessingCard(orderId, 1); |
| | | } |
| | | return true; |
| | | } else { |
| | | return false; |
| | |
| | | |
| | | |
| | | //修改排版状态 |
| | | public Boolean updateLayoutStatusSv(String processId) { |
| | | public Boolean updateLayoutStatusSv(String processId, Integer state) { |
| | | |
| | | if (!processId.isEmpty()) { |
| | | Integer Status = flowCardMapper.selectLayoutStatus(processId); |
| | | if (Status == 1) { |
| | | flowCardMapper.updateLayoutStatusMp(processId); |
| | | } else { |
| | | return false; |
| | | } |
| | | // Integer Status = flowCardMapper.selectLayoutStatus(processId); |
| | | |
| | | flowCardMapper.updateLayoutStatusMp(processId, state); |
| | | |
| | | |
| | | return true; |
| | | } else { |
| | |
| | | @Autowired |
| | | ProductionSchedulingMapper productionSchedulingMapper; |
| | | |
| | | //带时间查询 |
| | | public Map<String, Object> SelectSchedulingSv(String selectTime1, String selectTime2, String orderId,String processes, Integer state, ProductionScheduling productionScheduling ) { |
| | | //未排产查询 |
| | | public Map<String, Object> selectSchedulingSv(String selectTime1, String selectTime2, String orderId,String processes, Integer state, ProductionScheduling productionScheduling ) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(orderId.equals("null")){ |
| | | orderId=""; |
| | |
| | | } |
| | | |
| | | if (state==2){//已排产 |
| | | map.put("data", productionSchedulingMapper.SelectOkSchedulingMp(selectTime1, selectTime2,orderId,processes, productionScheduling)); |
| | | map.put("data", productionSchedulingMapper.selectOkSchedulingMp(selectTime1, selectTime2,orderId,processes, productionScheduling)); |
| | | |
| | | }else if (state==1){//未排产 |
| | | map.put("data", productionSchedulingMapper.SelectNoSchedulingMp(selectTime1, selectTime2,orderId,processes, productionScheduling)); |
| | | map.put("data", productionSchedulingMapper.selectNoSchedulingMp(selectTime1, selectTime2,orderId,processes, productionScheduling)); |
| | | |
| | | } |
| | | |
| | |
| | | public Map<String, Object> selectLastScheduling(String selectTime1, String selectTime2,ProductionScheduling productionScheduling ) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", productionSchedulingMapper.selectLastSchedulingMp(selectTime1, selectTime2, productionScheduling)); |
| | | map.put("process", productionSchedulingMapper.selectProcess()); |
| | | return map; |
| | | } |
| | | |
| | |
| | | return map; |
| | | } |
| | | |
| | | public Boolean AddSchedulingSv(Map<String, Object> object) { |
| | | public Boolean addSchedulingSv(Map<String, Object> object) { |
| | | String userName = ""; |
| | | if (object.get("userName") != null) { |
| | | userName = object.get("userName").toString(); |
| | |
| | | List<ProductionScheduling> schedulinglist = JSONArray.parseArray(JSONObject.toJSONString(object.get("scheduling")), ProductionScheduling.class); |
| | | if (!schedulinglist.isEmpty()) { |
| | | for (ProductionScheduling productionScheduling : schedulinglist) { |
| | | //查询已排产工序数量 |
| | | Integer num = productionSchedulingMapper.selectNumberMp(productionScheduling.getOrderId(),productionScheduling.getOrderNumber(),processes); |
| | | |
| | | productionSchedulingMapper.insertSelective(schedulingId,productionScheduling.getOrderId(),productionScheduling.getOrderNumber(),processes,productionScheduling.getSchedulingQuantity(),productionScheduling.getScheduledStartTime(),productionScheduling.getPlanEndTime(),productionScheduling.getNotes()); |
| | | // System.out.println(productionScheduling.getOrderNumber()+"***"+productionScheduling.getOrderId()); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | public boolean ExamineSchedulingSv(Map<String, Object> object) { |
| | | public boolean examineSchedulingSv(Map<String, Object> object) { |
| | | String userName = ""; |
| | | if (object.get("userName") != null) { |
| | | userName = object.get("userName").toString(); |
| | |
| | | |
| | | if (!schedulinglist.isEmpty()) { |
| | | for (ProductionScheduling productionScheduling : schedulinglist) { |
| | | productionSchedulingMapper.ExamineSchedulingMp(productionScheduling.getSchedulingId(),userName); |
| | | productionSchedulingMapper.examineSchedulingMp(productionScheduling.getSchedulingId(),userName); |
| | | // System.out.println(productionScheduling.getOrderNumber()+"***"+productionScheduling.getOrderId()); |
| | | } |
| | | return true; |
| | |
| | | <result column="quantity" property="quantity"/> |
| | | <result column="founder" property="founder"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="layout_status" property="layoutStatus"/> |
| | | <!--接收其他外键实体类数据--> |
| | | <association property="order" javaType="com.example.erp.entity.sd.Order"> |
| | | <result column="project" property="project"/> |
| | |
| | | c.product_id, |
| | | c.product_name, |
| | | b.project, |
| | | a.quantity, |
| | | c.compute_gross_area, |
| | | sum(a.quantity) as quantity, |
| | | sum(c.compute_gross_area) as compute_gross_area, |
| | | a.founder, |
| | | c.processing_note |
| | | c.processing_note, |
| | | if(a.layout_status=0,"不可排版",if(a.layout_status=1,"可排版","已排版")) as layout_status |
| | | from flow_card as a left join sd.`order` as b on a.order_Id=b.order_id |
| | | left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number |
| | | where a.create_time between #{selectTime1} and #{selectTime2} |
| | | <if test="flowCard.orderId != null and flowCard.orderId != ''"> |
| | | and a.order_id regexp #{flowCard.orderId} |
| | | </if> |
| | | <if test="flowCard.productionId != null and flowCard.productionId != ''"> |
| | | and a.process_Id regexp #{flowCard.productionId} |
| | | <if test="flowCard.processId != null and flowCard.processId != ''"> |
| | | and a.process_Id regexp #{flowCard.processId} |
| | | </if> |
| | | <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''"> |
| | | and c.product_id regexp #{flowCard.orderDetail.productId} |
| | |
| | | and o.salesman regexp #{flowCard.order.salesman} |
| | | </if> |
| | | group by o.order_id |
| | | order by o.id desc |
| | | |
| | | ; |
| | | </select> |
| | |
| | | SUM( od.quantity) as quantity, |
| | | SUM(od.compute_gross_area) as compute_gross_area, |
| | | od.perimeter |
| | | 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 |
| | | from sd.order_detail as od left join |
| | | (select order_id,order_number,production_id,splitting_status from sd.order_glass_detail |
| | | GROUP BY order_id,order_number |
| | | ) as ogd on od.order_id=ogd.order_id and od.order_number=ogd.order_number |
| | | where od.order_id = #{orderId} and ogd.splitting_status=0 |
| | | <if test="flowCard.orderDetail.orderId != null and flowCard.orderDetail.orderId != ''"> |
| | | and od.order_id regexp #{flowCard.orderDetail.orderId} |
| | | <if test="flowCard.orderId != null and flowCard.orderId != ''"> |
| | | and od.order_id regexp #{flowCard.orderId} |
| | | </if> |
| | | <if test="flowCard.orderGlassDetail.productionId != null and flowCard.orderGlassDetail.productionId != ''"> |
| | | and ogd.production_id regexp #{flowCard.orderGlassDetail.productionId} |
| | |
| | | and od.product_name regexp #{flowCard.orderDetail.productName} |
| | | </if> |
| | | group by od.order_id, ogd.production_id |
| | | order by od.id desc |
| | | </select> |
| | | |
| | | <!-- 更新分架状态--> |
| | |
| | | left join sd.order_glass_detail as ogd on od.order_id=ogd.order_id and od.order_number=ogd.order_number |
| | | left join sd.product as p on od.product_name=p.product_name |
| | | where od.order_id=#{orderId} and ogd.production_id=#{productionId} and ogd.splitting_status=0 |
| | | GROUP BY od.order_number; |
| | | |
| | | GROUP BY od.order_number |
| | | order by od.id desc |
| | | |
| | | </select> |
| | | |
| | | <!--修改排版状态--> |
| | | <update id="updateLayoutStatusMp"> |
| | | update flow_card as fc |
| | | set fc.layout_status=2 |
| | | set fc.layout_status=#{state} |
| | | where fc.process_id = #{processId} |
| | | </update> |
| | | |
| | |
| | | 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 on ps.order_id=od.order_id and ps.order_number=od.order_number |
| | | where od.order_id=#{orderId} and ps.processes=#{processes} and ps.scheduling_id IS NOT NULL |
| | | |
| | | order by ps.id desc |
| | | </select> |
| | | <!-- 查询未排版数据--> |
| | | <select id="selectNoSchedulingMp"> |
| | |
| | | where ogd.production_id = #{productionId} |
| | | and ogd.order_number=#{orderNumber} |
| | | </select> |
| | | <!-- 查询该订单流程卡条数 --> |
| | | <select id="selectFlowCardCount"> |
| | | select COUNT(*) from flow_card where order_id=#{orderId} |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | |
| | | <!-- 查询已排版数据--> |
| | | <select id="SelectOkSchedulingMp"> |
| | | <select id="selectOkSchedulingMp"> |
| | | select date(ps.scheduled_start_time) as scheduled_start_time, |
| | | date(ps.plan_end_time) as plan_end_time, |
| | | od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity, |
| | | od.order_id, |
| | | o.customer_name, |
| | | o.project, |
| | | od.order_number, |
| | | od.width, |
| | | od.height, |
| | | od.quantity, |
| | | round(od.width*od.height*od.quantity/1000000,2) as area, |
| | | ps.scheduling_quantity, |
| | | # (od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity, |
| | | # round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2) as pendingProductionArea, |
| | | (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) as pendingProductionQuantity, |
| | | round(od.width * od.height * (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000, |
| | | 2) as pendingProductionArea, |
| | | IFNULL(ps.scheduling_quantity,0) as productionScheduledQuantity, |
| | | round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2) as productionScheduledArea, |
| | | round(od.width * od.height * (IFNULL(ps.scheduling_quantity, 0)) / 1000000, |
| | | 2) as productionScheduledArea, |
| | | IF(ps.review_status=0,"未审核","已审核") as review_status, |
| | | ps.reviewer, |
| | | od.product_name,od.shape,ps.scheduling_id |
| | | od.product_name, |
| | | od.shape, |
| | | ps.scheduling_id |
| | | 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 on ps.order_id=od.order_id and ps.order_number=od.order_number |
| | | left join production_scheduling as ps |
| | | on ps.order_id = od.order_id and ps.order_number = od.order_number |
| | | where ps.scheduling_id IS NOT NULL |
| | | and od.create_time between #{selectTime1} and #{selectTime2} |
| | | and position(#{processes} in ps.processes) |
| | | and position(#{orderId} in ps.order_id) |
| | | |
| | | group by od.order_id, od.order_number |
| | | order by ps.id desc |
| | | </select> |
| | | |
| | | <!-- 查询已排产带订单编号的数据--> |
| | | <!-- 查询已排产的数据--> |
| | | <select id="selectSchedulingNotMp"> |
| | | select date(ps.scheduled_start_time) as scheduled_start_time, |
| | | date(ps.plan_end_time) as plan_end_time, |
| | | od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity, |
| | | od.order_id, |
| | | o.customer_name, |
| | | o.project, |
| | | od.order_number, |
| | | od.width, |
| | | od.height, |
| | | od.quantity, |
| | | round(od.width*od.height*od.quantity/1000000,2) as area, |
| | | ps.scheduling_quantity, |
| | | # (od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity, |
| | | # round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2) as pendingProductionArea, |
| | | (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) as pendingProductionQuantity, |
| | | round(od.width * od.height * (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000, 2) |
| | | as pendingProductionArea, |
| | | IFNULL(ps.scheduling_quantity,0) as productionScheduledQuantity, |
| | | round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2) as productionScheduledArea, |
| | | IF(ps.review_status=0,"未审核","已审核") as review_status, |
| | | round(od.width * od.height * (IFNULL(ps.scheduling_quantity, 0)) / 1000000, 2) |
| | | as productionScheduledArea, |
| | | IF(ps.review_status = 0, "未审核", "已审核") |
| | | as review_status, |
| | | ps.reviewer, |
| | | od.product_name,od.shape,ps.scheduling_id |
| | | od.product_name, |
| | | od.shape, |
| | | ps.scheduling_id |
| | | 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 on ps.order_id=od.order_id and ps.order_number=od.order_number |
| | | left join production_scheduling as ps |
| | | on ps.order_id = od.order_id and ps.order_number = od.order_number |
| | | where (ps.scheduling_id IS NOT NULL ) |
| | | and position(#{processes} in ps.processes) |
| | | and position(#{orderId} in ps.order_id) |
| | | |
| | | group by od.order_id, od.order_number |
| | | order by ps.id desc |
| | | </select> |
| | | <!-- 查询未排产数据--> |
| | | <select id="SelectNoSchedulingMp" > |
| | | select od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity, |
| | | <select id="selectNoSchedulingMp"> |
| | | select od.order_id, |
| | | o.customer_name, |
| | | o.project, |
| | | od.order_number, |
| | | od.width, |
| | | od.height, |
| | | od.quantity, |
| | | round(od.width*od.height*od.quantity/1000000,2) as area, |
| | | (od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity, |
| | | round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2) as pendingProductionArea, |
| | | (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) as pendingProductionQuantity, |
| | | round(od.width * od.height * (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000, 2) |
| | | as pendingProductionArea, |
| | | IFNULL(ps.scheduling_quantity,0) as productionScheduledQuantity, |
| | | round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2) as productionScheduledArea, |
| | | od.product_name,od.shape |
| | | 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 on ps.order_id=od.order_id and ps.order_number=od.order_number |
| | | where od.quantity-IFNULL(ps.scheduling_quantity,0)>0 and od.create_time between #{selectTime1} and #{selectTime2} |
| | | round(od.width * od.height * (IFNULL(ps.scheduling_quantity, 0)) / 1000000, |
| | | 2) as productionScheduledArea, |
| | | od.product_name, |
| | | od.shape |
| | | 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 |
| | | on ps.order_id = od.order_id and ps.order_number = od.order_number |
| | | where (od.quantity - IFNULL((ps.scheduling_quantity), 0)) > 0 |
| | | and od.create_time between #{selectTime1} and #{selectTime2} |
| | | |
| | | and position(#{orderId} in ps.order_id) |
| | | and position(#{processes} in ps.processes) |
| | | |
| | | group by od.order_id,od.order_number |
| | | order by ps.id desc |
| | | </select> |
| | | <!-- 首次查询排产数据--> |
| | | <select id="selectLastSchedulingMp"> |
| | | select od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity, |
| | | select od.order_id, |
| | | o.customer_name, |
| | | o.project, |
| | | od.order_number, |
| | | od.width, |
| | | od.height, |
| | | od.quantity, |
| | | round(od.width*od.height*od.quantity/1000000,2) as area, |
| | | (od.quantity-IFNULL(sum(ps.scheduling_quantity),0)) as pendingProductionQuantity, |
| | | round(od.width*od.height*(od.quantity-IFNULL(sum(ps.scheduling_quantity),0))/1000000,2) as pendingProductionArea, |
| | | round(od.width * od.height * (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000, |
| | | 2) as pendingProductionArea, |
| | | IFNULL(sum(ps.scheduling_quantity),0) as productionScheduledQuantity, |
| | | round(od.width*od.height*(IFNULL(sum(ps.scheduling_quantity),0))/1000000,2) as productionScheduledArea, |
| | | od.product_name,od.shape |
| | | 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 on ps.order_id=od.order_id and ps.order_number=od.order_number |
| | | where od.create_time between #{selectTime1} and #{selectTime2} and od.quantity-IFNULL(ps.scheduling_quantity,0)>0 |
| | | round(od.width * od.height * (IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000, |
| | | 2) as productionScheduledArea, |
| | | od.product_name, |
| | | od.shape |
| | | 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 |
| | | on ps.order_id = od.order_id and ps.order_number = od.order_number |
| | | where od.create_time between #{selectTime1} and #{selectTime2} |
| | | and (od.quantity - IFNULL((ps.scheduling_quantity), 0)) > 0 |
| | | |
| | | group by od.order_id,od.order_number |
| | | order by ps.id desc |
| | | </select> |
| | | |
| | | <select id="selectMaxId"> |
| | | select |
| | | COUNT(ps.scheduling_id) |
| | | from |
| | | `production_scheduling` as ps |
| | | where |
| | | date(ps.create_time) = curdate() |
| | | select COUNT(ps.scheduling_id) |
| | | from `production_scheduling` as ps |
| | | where date(ps.create_time) = curdate() |
| | | </select> |
| | | |
| | | <insert id="insertSelective"> |
| | | insert into production_scheduling( |
| | | scheduling_id, |
| | | insert into production_scheduling(scheduling_id, |
| | | order_id, |
| | | order_number, |
| | | processes, |
| | |
| | | scheduled_start_time, |
| | | plan_end_time, |
| | | notes, |
| | | create_time |
| | | ) |
| | | VALUES( |
| | | #{schedulingId}, |
| | | create_time) |
| | | VALUES (#{schedulingId}, |
| | | #{orderId}, |
| | | #{orderNumber}, |
| | | #{processes}, |
| | |
| | | #{scheduledStartTime}, |
| | | #{planEndTime}, |
| | | #{notes}, |
| | | now() |
| | | ) |
| | | now()) |
| | | </insert> |
| | | |
| | | <update id="ExamineSchedulingMp"> |
| | | update production_scheduling set review_status=1,reviewer=#{userName} where |
| | | scheduling_id=#{schedulingId} |
| | | <update id="examineSchedulingMp"> |
| | | update production_scheduling |
| | | set review_status=1, |
| | | reviewer=#{userName} |
| | | where scheduling_id = #{schedulingId} |
| | | </update> |
| | | |
| | | <delete id="deleteSchedulingMp"> |
| | | delete from production_scheduling where scheduling_id=#{schedulingId} |
| | | delete |
| | | from production_scheduling |
| | | where scheduling_id = #{schedulingId} |
| | | </delete> |
| | | |
| | | <select id="selectProcess"> |
| | | SELECT * |
| | | FROM sd.basic_data as bd |
| | | where bd.basic_category = 'process' |
| | | and bd.basic_type = 'product' |
| | | </select> |
| | | |
| | | <select id="selectNumberMp"> |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="quantity" property="quantity"/> |
| | | <result column="founder" property="founder"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="layout_status" property="layoutStatus"/> |
| | | <!--接收其他外键实体类数据--> |
| | | <association property="order" javaType="com.example.erp.entity.sd.Order"> |
| | | <result column="project" property="project"/> |
| | |
| | | c.product_id, |
| | | c.product_name, |
| | | b.project, |
| | | a.quantity, |
| | | c.compute_gross_area, |
| | | sum(a.quantity) as quantity, |
| | | sum(c.compute_gross_area) as compute_gross_area, |
| | | a.founder, |
| | | c.processing_note |
| | | c.processing_note, |
| | | if(a.layout_status=0,"不可排版",if(a.layout_status=1,"可排版","已排版")) as layout_status |
| | | from flow_card as a left join sd.`order` as b on a.order_Id=b.order_id |
| | | left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number |
| | | where a.create_time between #{selectTime1} and #{selectTime2} |
| | | <if test="flowCard.orderId != null and flowCard.orderId != ''"> |
| | | and a.order_id regexp #{flowCard.orderId} |
| | | </if> |
| | | <if test="flowCard.productionId != null and flowCard.productionId != ''"> |
| | | and a.process_Id regexp #{flowCard.productionId} |
| | | <if test="flowCard.processId != null and flowCard.processId != ''"> |
| | | and a.process_Id regexp #{flowCard.processId} |
| | | </if> |
| | | <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''"> |
| | | and c.product_id regexp #{flowCard.orderDetail.productId} |
| | |
| | | and o.salesman regexp #{flowCard.order.salesman} |
| | | </if> |
| | | group by o.order_id |
| | | order by o.id desc |
| | | |
| | | ; |
| | | </select> |
| | |
| | | SUM( od.quantity) as quantity, |
| | | SUM(od.compute_gross_area) as compute_gross_area, |
| | | od.perimeter |
| | | 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 |
| | | from sd.order_detail as od left join |
| | | (select order_id,order_number,production_id,splitting_status from sd.order_glass_detail |
| | | GROUP BY order_id,order_number |
| | | ) as ogd on od.order_id=ogd.order_id and od.order_number=ogd.order_number |
| | | where od.order_id = #{orderId} and ogd.splitting_status=0 |
| | | <if test="flowCard.orderDetail.orderId != null and flowCard.orderDetail.orderId != ''"> |
| | | and od.order_id regexp #{flowCard.orderDetail.orderId} |
| | | <if test="flowCard.orderId != null and flowCard.orderId != ''"> |
| | | and od.order_id regexp #{flowCard.orderId} |
| | | </if> |
| | | <if test="flowCard.orderGlassDetail.productionId != null and flowCard.orderGlassDetail.productionId != ''"> |
| | | and ogd.production_id regexp #{flowCard.orderGlassDetail.productionId} |
| | |
| | | and od.product_name regexp #{flowCard.orderDetail.productName} |
| | | </if> |
| | | group by od.order_id, ogd.production_id |
| | | order by od.id desc |
| | | </select> |
| | | |
| | | <!-- 更新分架状态--> |
| | |
| | | left join sd.order_glass_detail as ogd on od.order_id=ogd.order_id and od.order_number=ogd.order_number |
| | | left join sd.product as p on od.product_name=p.product_name |
| | | where od.order_id=#{orderId} and ogd.production_id=#{productionId} and ogd.splitting_status=0 |
| | | GROUP BY od.order_number; |
| | | |
| | | GROUP BY od.order_number |
| | | order by od.id desc |
| | | |
| | | </select> |
| | | |
| | | <!--修改排版状态--> |
| | | <update id="updateLayoutStatusMp"> |
| | | update flow_card as fc |
| | | set fc.layout_status=2 |
| | | set fc.layout_status=#{state} |
| | | where fc.process_id = #{processId} |
| | | </update> |
| | | |
| | |
| | | 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 on ps.order_id=od.order_id and ps.order_number=od.order_number |
| | | where od.order_id=#{orderId} and ps.processes=#{processes} and ps.scheduling_id IS NOT NULL |
| | | |
| | | order by ps.id desc |
| | | </select> |
| | | <!-- 查询未排版数据--> |
| | | <select id="selectNoSchedulingMp"> |
| | |
| | | where ogd.production_id = #{productionId} |
| | | and ogd.order_number=#{orderNumber} |
| | | </select> |
| | | <!-- 查询该订单流程卡条数 --> |
| | | <select id="selectFlowCardCount"> |
| | | select COUNT(*) from flow_card where order_id=#{orderId} |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | |
| | | <!-- 查询已排版数据--> |
| | | <select id="SelectOkSchedulingMp"> |
| | | <select id="selectOkSchedulingMp"> |
| | | select date(ps.scheduled_start_time) as scheduled_start_time, |
| | | date(ps.plan_end_time) as plan_end_time, |
| | | od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity, |
| | | od.order_id, |
| | | o.customer_name, |
| | | o.project, |
| | | od.order_number, |
| | | od.width, |
| | | od.height, |
| | | od.quantity, |
| | | round(od.width*od.height*od.quantity/1000000,2) as area, |
| | | ps.scheduling_quantity, |
| | | # (od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity, |
| | | # round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2) as pendingProductionArea, |
| | | (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) as pendingProductionQuantity, |
| | | round(od.width * od.height * (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000, |
| | | 2) as pendingProductionArea, |
| | | IFNULL(ps.scheduling_quantity,0) as productionScheduledQuantity, |
| | | round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2) as productionScheduledArea, |
| | | round(od.width * od.height * (IFNULL(ps.scheduling_quantity, 0)) / 1000000, |
| | | 2) as productionScheduledArea, |
| | | IF(ps.review_status=0,"未审核","已审核") as review_status, |
| | | ps.reviewer, |
| | | od.product_name,od.shape,ps.scheduling_id |
| | | od.product_name, |
| | | od.shape, |
| | | ps.scheduling_id |
| | | 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 on ps.order_id=od.order_id and ps.order_number=od.order_number |
| | | left join production_scheduling as ps |
| | | on ps.order_id = od.order_id and ps.order_number = od.order_number |
| | | where ps.scheduling_id IS NOT NULL |
| | | and od.create_time between #{selectTime1} and #{selectTime2} |
| | | and position(#{processes} in ps.processes) |
| | | and position(#{orderId} in ps.order_id) |
| | | |
| | | group by od.order_id, od.order_number |
| | | order by ps.id desc |
| | | </select> |
| | | |
| | | <!-- 查询已排产带订单编号的数据--> |
| | | <!-- 查询已排产的数据--> |
| | | <select id="selectSchedulingNotMp"> |
| | | select date(ps.scheduled_start_time) as scheduled_start_time, |
| | | date(ps.plan_end_time) as plan_end_time, |
| | | od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity, |
| | | od.order_id, |
| | | o.customer_name, |
| | | o.project, |
| | | od.order_number, |
| | | od.width, |
| | | od.height, |
| | | od.quantity, |
| | | round(od.width*od.height*od.quantity/1000000,2) as area, |
| | | ps.scheduling_quantity, |
| | | # (od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity, |
| | | # round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2) as pendingProductionArea, |
| | | (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) as pendingProductionQuantity, |
| | | round(od.width * od.height * (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000, 2) |
| | | as pendingProductionArea, |
| | | IFNULL(ps.scheduling_quantity,0) as productionScheduledQuantity, |
| | | round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2) as productionScheduledArea, |
| | | IF(ps.review_status=0,"未审核","已审核") as review_status, |
| | | round(od.width * od.height * (IFNULL(ps.scheduling_quantity, 0)) / 1000000, 2) |
| | | as productionScheduledArea, |
| | | IF(ps.review_status = 0, "未审核", "已审核") |
| | | as review_status, |
| | | ps.reviewer, |
| | | od.product_name,od.shape,ps.scheduling_id |
| | | od.product_name, |
| | | od.shape, |
| | | ps.scheduling_id |
| | | 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 on ps.order_id=od.order_id and ps.order_number=od.order_number |
| | | left join production_scheduling as ps |
| | | on ps.order_id = od.order_id and ps.order_number = od.order_number |
| | | where (ps.scheduling_id IS NOT NULL ) |
| | | and position(#{processes} in ps.processes) |
| | | and position(#{orderId} in ps.order_id) |
| | | |
| | | group by od.order_id, od.order_number |
| | | order by ps.id desc |
| | | </select> |
| | | <!-- 查询未排产数据--> |
| | | <select id="SelectNoSchedulingMp" > |
| | | select od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity, |
| | | <select id="selectNoSchedulingMp"> |
| | | select od.order_id, |
| | | o.customer_name, |
| | | o.project, |
| | | od.order_number, |
| | | od.width, |
| | | od.height, |
| | | od.quantity, |
| | | round(od.width*od.height*od.quantity/1000000,2) as area, |
| | | (od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity, |
| | | round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2) as pendingProductionArea, |
| | | (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) as pendingProductionQuantity, |
| | | round(od.width * od.height * (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000, 2) |
| | | as pendingProductionArea, |
| | | IFNULL(ps.scheduling_quantity,0) as productionScheduledQuantity, |
| | | round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2) as productionScheduledArea, |
| | | od.product_name,od.shape |
| | | 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 on ps.order_id=od.order_id and ps.order_number=od.order_number |
| | | where od.quantity-IFNULL(ps.scheduling_quantity,0)>0 and od.create_time between #{selectTime1} and #{selectTime2} |
| | | round(od.width * od.height * (IFNULL(ps.scheduling_quantity, 0)) / 1000000, |
| | | 2) as productionScheduledArea, |
| | | od.product_name, |
| | | od.shape |
| | | 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 |
| | | on ps.order_id = od.order_id and ps.order_number = od.order_number |
| | | where (od.quantity - IFNULL((ps.scheduling_quantity), 0)) > 0 |
| | | and od.create_time between #{selectTime1} and #{selectTime2} |
| | | |
| | | and position(#{orderId} in ps.order_id) |
| | | and position(#{processes} in ps.processes) |
| | | |
| | | group by od.order_id,od.order_number |
| | | order by ps.id desc |
| | | </select> |
| | | <!-- 首次查询排产数据--> |
| | | <select id="selectLastSchedulingMp"> |
| | | select od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity, |
| | | select od.order_id, |
| | | o.customer_name, |
| | | o.project, |
| | | od.order_number, |
| | | od.width, |
| | | od.height, |
| | | od.quantity, |
| | | round(od.width*od.height*od.quantity/1000000,2) as area, |
| | | (od.quantity-IFNULL(sum(ps.scheduling_quantity),0)) as pendingProductionQuantity, |
| | | round(od.width*od.height*(od.quantity-IFNULL(sum(ps.scheduling_quantity),0))/1000000,2) as pendingProductionArea, |
| | | round(od.width * od.height * (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000, |
| | | 2) as pendingProductionArea, |
| | | IFNULL(sum(ps.scheduling_quantity),0) as productionScheduledQuantity, |
| | | round(od.width*od.height*(IFNULL(sum(ps.scheduling_quantity),0))/1000000,2) as productionScheduledArea, |
| | | od.product_name,od.shape |
| | | 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 on ps.order_id=od.order_id and ps.order_number=od.order_number |
| | | where od.create_time between #{selectTime1} and #{selectTime2} and od.quantity-IFNULL(ps.scheduling_quantity,0)>0 |
| | | round(od.width * od.height * (IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000, |
| | | 2) as productionScheduledArea, |
| | | od.product_name, |
| | | od.shape |
| | | 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 |
| | | on ps.order_id = od.order_id and ps.order_number = od.order_number |
| | | where od.create_time between #{selectTime1} and #{selectTime2} |
| | | and (od.quantity - IFNULL((ps.scheduling_quantity), 0)) > 0 |
| | | |
| | | group by od.order_id,od.order_number |
| | | order by ps.id desc |
| | | </select> |
| | | |
| | | <select id="selectMaxId"> |
| | | select |
| | | COUNT(ps.scheduling_id) |
| | | from |
| | | `production_scheduling` as ps |
| | | where |
| | | date(ps.create_time) = curdate() |
| | | select COUNT(ps.scheduling_id) |
| | | from `production_scheduling` as ps |
| | | where date(ps.create_time) = curdate() |
| | | </select> |
| | | |
| | | <insert id="insertSelective"> |
| | | insert into production_scheduling( |
| | | scheduling_id, |
| | | insert into production_scheduling(scheduling_id, |
| | | order_id, |
| | | order_number, |
| | | processes, |
| | |
| | | scheduled_start_time, |
| | | plan_end_time, |
| | | notes, |
| | | create_time |
| | | ) |
| | | VALUES( |
| | | #{schedulingId}, |
| | | create_time) |
| | | VALUES (#{schedulingId}, |
| | | #{orderId}, |
| | | #{orderNumber}, |
| | | #{processes}, |
| | |
| | | #{scheduledStartTime}, |
| | | #{planEndTime}, |
| | | #{notes}, |
| | | now() |
| | | ) |
| | | now()) |
| | | </insert> |
| | | |
| | | <update id="ExamineSchedulingMp"> |
| | | update production_scheduling set review_status=1,reviewer=#{userName} where |
| | | scheduling_id=#{schedulingId} |
| | | <update id="examineSchedulingMp"> |
| | | update production_scheduling |
| | | set review_status=1, |
| | | reviewer=#{userName} |
| | | where scheduling_id = #{schedulingId} |
| | | </update> |
| | | |
| | | <delete id="deleteSchedulingMp"> |
| | | delete from production_scheduling where scheduling_id=#{schedulingId} |
| | | delete |
| | | from production_scheduling |
| | | where scheduling_id = #{schedulingId} |
| | | </delete> |
| | | |
| | | <select id="selectProcess"> |
| | | SELECT * |
| | | FROM sd.basic_data as bd |
| | | where bd.basic_category = 'process' |
| | | and bd.basic_type = 'product' |
| | | </select> |
| | | |
| | | <select id="selectNumberMp"> |
| | | |
| | | </select> |
| | | </mapper> |