chenlu
2024-02-27 b09e0423b15d6402b44d4ef338bfb85f027daf3c
更新程序,流程卡删除,修改排版状态
13个文件已修改
6个文件已添加
1150 ■■■■ 已修改文件
north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue 405 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectAddProcess.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/SplittingDetails.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/workOrder/AddWorkOrder.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/workOrder/SelectWorkOrder.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProductionSchedulingController.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/entity/pp/ProductionScheduling.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ProductionSchedulingMapper.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ProductionSchedulingService.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/WorkOrderService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml 61 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/ProductionScheduling.xml 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/pp/FolwCard.xml 61 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/pp/ProductionScheduling.xml 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue
@@ -77,22 +77,7 @@
  clientHeight.value = row.$event.target.clientHeight
}
//筛选条件,有外键需要先定义明细里面的数据
let filterData = ref({
  product: {
    thickness: '',
    totalThickness: ''
  },
  orderDetail: {
    orderNumber: '',
    height: '',
    computeGrossArea: '',
    binningQuantity: '',
    shape: '',
    width: '',
    weight: ''
  }
})
let filterData = ref({})
//定义页面总页数
let pageTotal = ref('')
//定义数据返回结果
@@ -111,7 +96,7 @@
request.post(`/processCard/selectNoCard/${orderId}/${productionId}`, filterData.value).then((res) => {
  if (res.code == 200) {
    console.log(res.data)
    //console.log(res.data)
    pageTotal.value = res.data.total
    produceList = produceList.value.concat(deepClone(res.data.data))
    xGrid.value.reloadData(produceList)
@@ -131,39 +116,22 @@
  return ('00' + str).substr(str.length)
}
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
  }
  request.post(`/processCard/selectNoCard/${orderId}/${productionId}`, filterData.value).then((res) => {
    if (res.code == 200) {
      pageTotal.value = res.data.total
      produceList = deepClone(res.data.data)
      xGrid.value.loadData(produceList)
      gridOptions.loading = false
    } else {
      ElMessage.warning(res.msg)
    }
  })
}
/*后端返回结果多层嵌套展示*/
const hasDecimal = (value) => {
  const regex = /\./; // 定义正则表达式,查找小数点
  return regex.test(value); // 返回true/false
}
//筛选方法
const filterChanged = ({ option, row, column }) => {
  if (option.data) {
    return row[column.field].toString().toLowerCase().indexOf(option.data) > -1
  }
  return true
  //@filter-change="filterChanged"
}
//右侧子组件接收参数
@@ -186,7 +154,7 @@
    useKey: true
  },
  filterConfig: {   //筛选配置项
    remote: true
    //remote: true
  },
  customConfig: {
    storage: true
@@ -198,10 +166,10 @@
  },//表头参数
  columns: [
    {type: 'checkbox', fixed: "left", title: '选择'},
    {field: 'orderNumber', title: '订序', filters: [{data: ''}], slots: {filter: 'num1_filter'}},
    {field: 'shape', title: '形状', showOverflow: "ellipsis", filters: [{data: ''}], slots: {filter: 'num1_filter'}},
    {field: 'width', title: '宽', filters: [{data: ''}], slots: {filter: 'num1_filter'}},
    {field: 'height', title: '高', filters: [{data: ''}], slots: {filter: 'num1_filter'}},
    {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},
    {field: 'height', title: '高', sortable: true, filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged},
    {field: 'baiscQuantity', title: '待分数量', showOverflow: "ellipsis"},
    {field: 'computeGrossArea', title: '待分面积'},
    {field: 'totalThickness', title: '总厚度'},
@@ -259,7 +227,7 @@
    useKey: true
  },
  filterConfig: {   //筛选配置项
    remote: true
    //remote: true
  },
  customConfig: {
    storage: true
@@ -271,16 +239,17 @@
  },//表头参数
  columns: [
    {type: 'checkbox', fixed: "left", title: '选择'},
    {field: 'processId', title: '流程卡号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 130},
    {field: 'processId', title: '流程卡号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 130,filterMethod:filterChanged},
    {
      field: 'orderNumber',
      title: '订序',
      showOverflow: "ellipsis",
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'}
      ,filterMethod:filterChanged
    },
    {field: 'landingSequence', title: '落架顺序', filters: [{data: ''}], slots: {filter: 'num1_filter'}},
    {field: 'shape', title: '形状', filters: [{data: ''}], slots: {filter: 'num1_filter'}},
    {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: '高'},
    {field: 'quantity', title: '总数量'},
@@ -496,11 +465,14 @@
              productionId:productionId
            })
           console.log(flowCardData.value)
           //console.log(flowCardData.value)
            request.post("/processCard/addFlowCard", flowCardData.value).then((res) => {
              if (res.code == 200) {
                ElMessage.success("保存成功")
                location.reload();
                //router.push('/main/processCard/SplittingDetails?orderId=${orderId}')
                router.push({path: '/main/processCard/SplittingDetails', query: {orderId: orderId}})
                //location.reload();
              } else {
                ElMessage.warning(res.msg)
                router.push("/login")
@@ -544,7 +516,6 @@
        <el-aside width="44%" >
          <vxe-grid
              max-height="100%"
              @filter-change="filterChanged"
              class="mytable-scrollbar"
              ref="xGridLeft"
              v-bind="gridLeftOptions"
@@ -572,7 +543,9 @@
            <template #num1_filter="{ column, $panel }">
              <div>
                <div v-for="(option, index) in column.filters" :key="index">
                  <input type="type" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/>
                  <input type="text"
                         v-model="option.data"
                         @input="changeFilterEvent($event, option, $panel)"/>
                </div>
              </div>
            </template>
@@ -593,11 +566,11 @@
          <el-button @click="createProcessCard" type="primary">建立流程卡</el-button>
        </el-main>
<!--        右侧-->
        <el-aside width="45%" height="500px" style="">
          <vxe-grid
              max-height="97%"
              @filter-change="filterChanged"
              class="mytable-scrollbar"
              ref="xGrid"
              v-bind="gridOptions"
@@ -616,17 +589,12 @@
              </ul>
            </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>
            </template>
            <template #num1_filter="{ column, $panel }">
              <div>
                <div v-for="(option, index) in column.filters" :key="index">
                  <input type="type" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/>
                  <input type="text"
                         v-model="option.data"
                         @input="changeFilterEvent($event, option, $panel)"/>
                </div>
              </div>
            </template>
north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue
@@ -1,7 +1,16 @@
<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 useProductGlassTypeStore from "@/stores/sd/product/productGlassType"
import {nextTick, onMounted, onUnmounted, reactive, ref, watch} from "vue"
import {Search} from "@element-plus/icons-vue"
import GlassType from "@/components/sd/product/GlassType.vue"
import {useRouter} from 'vue-router'
import Sortable from 'sortablejs'
import BasicTable from '@/components/basic/BasicTable.vue'
import {VXETable} from "vxe-table";
let router=useRouter()
const getTableRow = (row,type) =>{
  switch (type) {
@@ -21,6 +30,46 @@
  }
}
//工序
const value = ref('')
const options = [
  {
    value: '切割',
    label: '切割',
  },
  {
    value: '磨边',
    label: '磨边',
  },
  {
    value: '钢化',
    label: '钢化',
  },
]
//排产状态
const stateValue = ref('1')
const stateOptions = [
  {
    value: '2',
    label: '已排产',
  },
  {
    value: '1',
    label: '未排产',
  },
]
function padLeftZero(str) {
  return ('00' + str).substr(str.length)
}
//定义表单值
const form = reactive({
  date1: '',
  orderId:''
})
//表尾求和
@@ -32,8 +81,139 @@
  return count.toFixed(2)
}
//子组件接收参数
//定义滚动条高度
let scrollTop = ref(null)
let scrollHeight = ref(null)
let clientHeight = ref(null)
const scrollEvnt = (row) => {
  // 内容高度
  scrollTop.value = row.$event.target.scrollTop
  scrollHeight.value = row.$event.target.scrollHeight
  clientHeight.value = row.$event.target.clientHeight
}
//筛选条件,有外键需要先定义明细里面的数据
let filterData = ref({
  order: {
    project: ''
  },
  orderDetail: {
    productId: '',
    productName: '',
    computeGrossArea: '',
    processingNote: '',
  }
})
//定义页面总页数
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 * 7)
      .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]
//第一次加载数据
request.post(`/productionScheduling/selectLastScheduling/${startTime}/${endTime}`, filterData.value).then((res) => {
  if (res.code == 200) {
    pageTotal.value = res.data.total
    produceList = produceList.value.concat(deepClone(res.data.data))
    xGrid.value.reloadData(produceList)
    gridOptions.loading = false
  } else {
    ElMessage.warning(res.msg)
  }
})
//点击时查询
const getWorkOrder = () => {
  let selectProcesses=value.value
  let selectState = stateValue.value
  let inputVal=form.orderId
  if (inputVal== ''){
    inputVal=null
  }
  if (selectProcesses== ''){
    selectProcesses=null
  }
  if (inputVal== null && selectState==1){
    //根据时间查询未排产数据
    request.post(`/productionScheduling/selectLastScheduling/${startTime}/${endTime}`, filterData.value).then((res) => {
      if (res.code == 200) {
        pageTotal.value = res.data.total
        xGrid.value.loadData(res.data.data)
        gridOptions.loading = false
      } else {
        ElMessage.warning(res.msg)
      }
    })
  }
  else if(inputVal!=null && selectState==1){
    //根据订单号查询未排产数据
    request.post(`/productionScheduling/selectScheduling/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => {
      if (res.code == 200) {
        pageTotal.value = res.data.total
        xGrid.value.loadData(res.data.data)
        gridOptions.loading = false
      } else {
        ElMessage.warning(res.msg)
      }
    })
  }
  else  if(inputVal== null && selectState==2){
    //根据时间查询已排产数据
    request.post(`/productionScheduling/selectScheduling/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => {
      if (res.code == 200) {
        pageTotal.value = res.data.total
        xGrid.value.loadData(res.data.data)
        gridOptions.loading = false
      } else {
        ElMessage.warning(res.msg)
      }
    })
  }
  else  if(inputVal!= null && selectState==2){
    //根据订单号查询已排产数据
    request.post(`/productionScheduling/selectSchedulingNot/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => {
      if (res.code == 200) {
        pageTotal.value = res.data.total
        xGrid.value.loadData(res.data.data)
        gridOptions.loading = false
      } else {
        ElMessage.warning(res.msg)
      }
    })
  }
}
//子组件接收参数
const xGrid = ref()
const gridOptions = reactive({
  border:  "full",//表格加边框
  keepSource: true,//保持源数据
@@ -66,94 +246,44 @@
    {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
    { type: 'checkbox',fixed:"left", title: '选择', width: 80 },
    { type: 'seq',fixed:"left", title: '自序', width: 50 },
    {field: '排产编号', title: '排产编号', sortable: true, width: 120 },
    {field: '销售单号', title: '销售单号',slots: { filter: 'num1_filter' }, sortable: true, width: 100 },
    {field: '客户名称', title: '客户名称', sortable: true, width: 110},
    {field: '项目名称', title: '项目名称', sortable: true , width: 100},
    {field: '序号', title: '序号', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }, width: 90},
    {field: '产品名称', title: '产品名称', sortable: true, width: 140},
    {field: '宽', title: '宽', sortable: true , width: 70},
    {field: '高', title: '高', sortable: true , width: 70},
    {field: '数量', title: '数量', sortable: true , width: 70},
    {field: '面积', title: '面积', sortable: true , width: 90},
    {field: '排产数量' , width: 120,editRender: { name: 'input', attrs: { placeholder: '' } }, title: '排产数量', sortable: true},
    {field: '已排产数量', title: '已排产数量', sortable: true , width: 120},
    {field: '已排产面积', title: '已排产面积', sortable: true , width: 120},
    {field: '未排产数量', title: '未排产数量', sortable: true , width: 120},
    {field: '未排产面积', title: '未排产面积', sortable: true , width: 120},
    {field: '形状', title: '形状', sortable: true , width: 80},
    {field: '备注', title: '备注', sortable: true , width: 120},
    {field: 'scheduled_start_time' , width: 120,editRender: { name: 'input', attrs: { placeholder: '',type:'date' } }, title: '计划开始时间'},
    {field: 'plan_end_time' , width: 120,editRender: { name: 'input', attrs: { placeholder: '',type:'date' } }, 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: 'width', title: '宽',  width: 60},
    {field: 'height', title: '高',  width: 60},
    {field: 'quantity', title: '订单数量',  width: 70},
    {field: 'area', title: '订单面积',  width: 90},
    {field: 'scheduling_quantity' , width: 120,editRender: { name: 'input', attrs: { placeholder: '' } }, title: '排产数量', sortable: true},
    {field: 'pendingProductionQuantity', title: '待排产数量',  width: 120},
    {field: 'pendingProductionArea', title: '待排产面积',  width: 120},
    {field: 'productionScheduledQuantity', title: '已排产数量',  width: 120},
    {field: 'productionScheduledArea', title: '已排产面积',  width: 120},
    {field: 'review_status', title: '审核状态',  width: 140},
    {field: 'reviewer', title: '审核人',  width: 140},
    {field: 'product_name', title: '产品名称',  width: 140},
    {field: 'shape', title: '形状',  width: 80},
    {field: 'notes', title: '备注', editRender: { name: 'input', attrs: { placeholder: '' } }, width: 120},
  ],//表头按钮
  toolbarConfig: {
    buttons: [
      {code: 'print_lck', name: '删除',status:'primary' },
      {code: 'print_lck', name: '排产',status:'primary' ,icon:'vxe-icon-save'},
      {code: 'delete', name: '删除',status:'primary' },
      {code: 'review', name: '审核',status:'primary' },
      {code: 'save', name: '排产',status:'primary' ,icon:'vxe-icon-save'},
    ],
    import: false,
    export: true,
    print: true,
    // export: true,
    // print: true,
    zoom: true,
    custom: true
  },
  data:  [
    {
      排产编号:"PC20230100001",
      销售单号: 'NG231207',
      客户名称:'XXX公司',
      项目名称:"XXXX公园",
      序号: '1',
      产品名称: '6mm超白Low-E(外)+A12+6mm超白平钢(内)',
      宽: '2000',
      高: '1000',
      数量: '10',
      面积: '20000',
      排产数量: '',
      已排产数量: '10000',
      已排产面积: '10000',
      未排产数量: '',
      未排产面积: '',
      形状: '矩形',
      备注: '备注'
    },
    {
      排产编号:"PC20230100001",
      销售单号: 'NG231207',
      客户名称:'XXX公司',
      项目名称:"XXXX公园",
      序号: '1',
      产品名称: '6mm超白Low-E(外)+A12+6mm超白平钢(内)',
      宽: '2000',
      高: '1000',
      数量: '10',
      面积: '20000',
      排产数量: '',
      已排产数量: '10000',
      已排产面积: '10000',
      未排产数量: '',
      未排产面积: '',
      形状: '矩形',
      备注: '备注'
    },
    {
      排产编号:"PC20230100001",
      销售单号: 'NG231207',
      客户名称:'XXX公司',
      项目名称:"XXXX公园",
      序号: '1',
      产品名称: '6mm超白Low-E(外)+A12+6mm超白平钢(内)',
      宽: '2000',
      高: '1000',
      数量: '10',
      面积: '20000',
      排产数量: '',
      已排产数量: '10000',
      已排产面积: '10000',
      未排产数量: '',
      未排产面积: '',
      形状: '矩形',
      备注: '备注'
    },
  ],//table body实际数据
  //脚部求和
  footerMethod ({ columns, data }) {//页脚函数
@@ -173,31 +303,58 @@
})
const form = reactive({
  name: '',
  region: '',
  date1: '',
  date2: '',
  delivery: false,
  type: [],
  resource: '',
  desc: '',
})
const value = ref('')
const options = [
  {
    value: 'Option1',
    label: 'Option1',
const gridEvents = {
  toolbarButtonClick({code}) {
    const $grid = xGrid.value
    if ($grid) {
      switch (code) {
        case 'save': {
          const $table = xGrid.value
          if ($table) {
            const selectRecords = $table.getCheckboxRecords()
            let selectProcesses=value.value
            let schedulingData = ref({
              scheduling: selectRecords,
              Processes:selectProcesses
            })
            if (selectRecords.length==0){
              ElMessage.success("请勾选排产数据")
              return;
            }
            for (let i = 0; i < selectRecords.length; i++){
             let start= selectRecords[i].scheduled_start_time
             let end= selectRecords[i].plan_end_time
             let number=selectRecords[i].scheduling_quantity
              if (start==null || end==null || number==null){
                ElMessage.success("请填入对应的值再进行保存")
                return;
              }
            }
           console.log(schedulingData.value)
            // request.post("/workOrder/addOrderWork", schedulingData.value).then((res) => {
            //   if (res.code == 200) {
            //     ElMessage.success("保存成功")
            //     location.reload();
            //   } else {
            //     ElMessage.warning(res.msg)
            //     router.push("/login")
            //   }
            // })
          }
          return;
        }
      }
    }
  },
  {
    value: 'Option2',
    label: 'Option2',
  },
  {
    value: 'Option3',
    label: 'Option3',
  },
]
}
</script>
<template>
@@ -207,12 +364,17 @@
        <el-date-picker
            v-model="form.date1"
            type="daterange"
            format="YYYY/MM/DD"
            value-format="YYYY-MM-DD"
            start-placeholder="开始时间"
            end-placeholder="结束时间"
            :default-time="defaultTime"
        />
        &nbsp;&nbsp;
        <el-select v-model="value" class="m-2" placeholder="工序">
        <el-input placeholder="销售单号" v-model="form.orderId" style="width: 110px"></el-input>
        &nbsp;
        <el-select v-model="value" class="m-2" placeholder="工序" style="width: 90px;">
          <el-option
              v-for="item in options"
              :key="item.value"
@@ -220,16 +382,21 @@
              :value="item.value"
          />
        </el-select>
        <el-select v-model="value" class="m-2" placeholder="是否排产">
        &nbsp;
        <el-select v-model="stateValue" class="m-2" placeholder="是否排产" style="width: 120px">
          <el-option
              v-for="item in options"
              v-for="item in stateOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
          />
        </el-select>
        &nbsp;&nbsp;
        <el-button type="primary">查询</el-button>
        <el-button
            @click="getWorkOrder"
            id="select"
            type="primary" :icon="Search">查询
        </el-button>
      </el-row>
    </div>
@@ -239,26 +406,20 @@
        class="mytable-scrollbar"
        ref="xGrid"
        v-bind="gridOptions"
        v-on="gridEvents"
    >
      <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
      <!--      下拉显示所有信息插槽-->
      <template #content="{ row}">
      <template #content="{ row }">
        <ul class="expand-wrapper">
          <li  v-for="(item,key,index) in row">
            <span style="font-weight: bold">{{key+':  '}}</span>
            <span>{{ item }}</span>
          <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined ">
            <span style="font-weight: bold">{{ item.title + ':  ' }}</span>
            <span v-if="hasDecimal(item.field)">{{ row[item.field.split('.')[0]][item.field.split('.')[1]] }}</span>
            <span v-else>{{ row[item.field] }}</span>
          </li>
        </ul>
      </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>
      </template>
      <template #num1_filter="{ column, $panel }">
        <div>
          <div v-for="(option, index) in column.filters" :key="index">
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectAddProcess.vue
@@ -97,7 +97,6 @@
request.post(`/processCard/selectAddProcess/${startTime}/${endTime}`, filterData.value).then((res) => {
  if (res.code == 200) {
    console.log(res.data.data)
    pageTotal.value = res.data.total
    produceList = produceList.value.concat(deepClone(res.data.data))
    xGrid.value.reloadData(produceList)
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue
@@ -125,7 +125,6 @@
request.post(`/processCard/flowCard/${startTime}/${endTime}`, filterData.value).then((res) => {
  if (res.code == 200) {
    console.log(res.data.data)
    pageTotal.value = res.data.total
    produceList = produceList.value.concat(deepClone(res.data.data))
    xGrid.value.reloadData(produceList)
north-glass-erp/northglass-erp/src/views/pp/processCard/SplittingDetails.vue
@@ -71,7 +71,6 @@
request.post(`/processCard/detailsSelect/${id}`, filterData.value).then((res) => {
  if (res.code == 200) {
    console.log(res.data.data)
    pageTotal.value = res.data.total
    produceList = produceList.value.concat(deepClone(res.data.data))
    xGrid.value.reloadData(produceList)
@@ -112,8 +111,6 @@
    filterData.value[column.property] = value
  }
console.log(filterData.value)
  request.post(`/processCard/detailsSelect/${id}`, filterData.value).then((res) => {
    if (res.code == 200) {
      pageTotal.value = res.data.total
@@ -189,7 +186,6 @@
  data: null,//表格数据
  //脚部求和
  footerMethod ({ columns, data }) {//页脚函数
    console.log(columns,data)
    let footList=['data.orderDetail.quantity','data.orderDetail.computeGrossArea']
    return[
      columns.map((column, columnIndex) => {
north-glass-erp/northglass-erp/src/views/pp/workOrder/AddWorkOrder.vue
@@ -73,7 +73,6 @@
request.post(`/workOrder/addWork/${id}`, filterData.value).then((res) => {
  if (res.code == 200) {
    console.log(res.data.data)
    pageTotal.value = res.data.total
    produceList = produceList.value.concat(deepClone(res.data.data))
    xGrid.value.reloadData(produceList)
@@ -220,7 +219,6 @@
              userName:username
            })
            console.log(workOrderData.value)
            request.post("/workOrder/addOrderWork", workOrderData.value).then((res) => {
              if (res.code == 200) {
                ElMessage.success("保存成功")
north-glass-erp/northglass-erp/src/views/pp/workOrder/SelectWorkOrder.vue
@@ -129,7 +129,6 @@
request.post(`/workOrder/orderGlassDetail/${startTime}/${endTime}/${state}`, filterData.value).then((res) => {
  if (res.code == 200) {
    console.log(res.data.data)
    pageTotal.value = res.data.total
    produceList = produceList.value.concat(deepClone(res.data.data))
    xGrid.value.reloadData(produceList)
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java
@@ -82,7 +82,6 @@
    //分架新增明细查询
    @PostMapping  ("/selectNoCard/{orderId}/{productionId}")
    public Result SelectNoCard(
            @PathVariable String orderId,
            @PathVariable String productionId,
@@ -103,4 +102,26 @@
        }
    }
    //查询第一次排版数据
    @PostMapping  ("/selectLastScheduling/{selectTime1}/{selectTime2}")
    public Result selectLastScheduling(
            @PathVariable String selectTime1,
            @PathVariable String selectTime2,
            @RequestBody FlowCard flowCard){
        return Result.seccess(flowCardService.selectLastScheduling(selectTime1,selectTime2,flowCard));
    }
    //查询排版数据
    @PostMapping  ("/selectScheduling/{selectTime1}/{selectTime2}/{orderId}/{processes}/{state}")
    public Result selectScheduling(
            @PathVariable String selectTime1,
            @PathVariable String selectTime2,
            @PathVariable String orderId,
            @PathVariable String processes,
            @PathVariable Integer state,
            @RequestBody FlowCard flowCard){
        return Result.seccess(flowCardService.SelectSchedulingSv(selectTime1,selectTime2,orderId,processes,state,flowCard));
    }
}
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProductionSchedulingController.java
New file
@@ -0,0 +1,55 @@
package com.example.erp.controller.pp;
import com.example.erp.common.Constants;
import com.example.erp.common.Result;
import com.example.erp.entity.pp.ProductionScheduling;
import com.example.erp.exception.ServiceException;
import com.example.erp.service.pp.ProductionSchedulingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.sql.Date;
import java.util.Map;
@RestController
@RequestMapping("/productionScheduling")
public class ProductionSchedulingController {
    @Autowired
    ProductionSchedulingService productionSchedulingService;
    //查询第一次排版数据
    @PostMapping  ("/selectLastScheduling/{selectTime1}/{selectTime2}")
    public Result selectLastScheduling(
            @PathVariable String selectTime1,
            @PathVariable String selectTime2,
            @RequestBody ProductionScheduling productionScheduling){
        return Result.seccess(productionSchedulingService.selectLastScheduling(selectTime1,selectTime2,productionScheduling));
    }
    //点击查询排版数据
    @PostMapping  ("/selectScheduling/{selectTime1}/{selectTime2}/{orderId}/{processes}/{state}")
    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));
    }
    //点击查询排版数据
    @PostMapping  ("/selectSchedulingNot/{selectTime1}/{selectTime2}/{orderId}/{processes}/{state}")
    public Result SelectSchedulingNot(
            @PathVariable String selectTime1,
            @PathVariable String selectTime2,
            @PathVariable String orderId,
            @PathVariable String processes,
            @PathVariable Integer state,
            @RequestBody ProductionScheduling productionScheduling){
        return Result.seccess(productionSchedulingService.SelectSchedulingNotSv(selectTime1,selectTime2,orderId,processes,state,productionScheduling));
    }
}
north-glass-erp/src/main/java/com/example/erp/entity/pp/ProductionScheduling.java
New file
@@ -0,0 +1,36 @@
package com.example.erp.entity.pp;
import com.example.erp.entity.sd.Order;
import com.example.erp.entity.sd.OrderDetail;
import lombok.Data;
@Data
public class ProductionScheduling {
    //自增id
    private Integer id;
    //排产编号
    private String schedulingId;
    //订单号
    private String orderId;
    //订单序号
    private String orderNumber;
    //排产工序
    private String processes;
    //排产数量
    private Integer schedulingQuantity;
    //计划开始时间
    private Integer scheduledStartTime;
    //计划结束时间
    private Integer planEndTime;
    //审核状态
    private String reviewStatus;
    //备注
    private String notes;
    //创建时间
    private String createTime;
    //外键订单表
    private Order order;
    //外键订单明细表
    private OrderDetail orderDetail;
}
north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java
@@ -21,7 +21,7 @@
    //分架明细查询
    List<FlowCard> DetailsSelectMp(String orderId, FlowCard flowCard);
    //删除工单
    //删除流程卡
    Boolean DeleteFlowCardMp(String orderId, String processId);
    //分架新增明细查询
@@ -32,9 +32,11 @@
    Integer SelectLayoutStatus(String processId);
    //查询报工表内是否存在对应流程卡的数据
    Integer ReportingWorkCount(String processId);
    Boolean AddFlowCardMp(String processId, Integer orderNumber, Integer landingSequence, Integer quantity, String productionId, String userName);
    //插入Flow_card表
    Boolean AddFlowCardMp(String processId, Integer orderNumber, Integer landingSequence, Integer quantity, String productionId, String userName,Integer layer);
    Boolean UpdateFlowState(String productionId, Integer orderNumber);
@@ -44,4 +46,12 @@
    Boolean UpdateProcessingCard(String productionId, int state);
    Boolean UpdateDeleteState(String orderId, String processId);
    List<FlowCard> SelectOkSchedulingMp(String selectTime1, String selectTime2, String orderId,String processes, FlowCard flowCard);
    List<FlowCard> SelectNoSchedulingMp(String selectTime1, String selectTime2, String orderId,String processes, FlowCard flowCard);
    List<Map<String,String>> selectLastSchedulingMp(String selectTime1, String selectTime2, FlowCard flowCard);
    Integer SelectLayer(String productionId, Integer orderNumber);
}
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ProductionSchedulingMapper.java
New file
@@ -0,0 +1,21 @@
package com.example.erp.mapper.pp;
import com.example.erp.entity.pp.ProductionScheduling;
import org.apache.ibatis.annotations.Mapper;
import java.sql.Date;
import java.util.List;
import java.util.Map;
@Mapper
public interface ProductionSchedulingMapper {
    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>> selectLastSchedulingMp(String selectTime1, String selectTime2, ProductionScheduling productionScheduling);
    List<Map<String,String>> SelectSchedulingNotMp(String selectTime1, String selectTime2, String orderId, String processes, ProductionScheduling productionScheduling);
}
north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
@@ -45,18 +45,19 @@
        return map;
    }
    //删除工单
    //删除流程卡
    public Boolean DeleteFlowCardSv(String orderId, String processId) {
        if (!orderId.isEmpty() && !processId.isEmpty()) {
            Integer count=flowCardMapper.ReportingWorkCount(processId);
            if (count==0){
            Integer count = flowCardMapper.ReportingWorkCount(processId);
            if (count == 0) {
                //修改订单表分架状态为1,未全部分架完成
                flowCardMapper.UpdateProcessingCard(orderId, 1);
                //修改分架状态
                flowCardMapper.UpdateDeleteState(orderId, processId);
                //删除分架明细
                flowCardMapper.DeleteFlowCardMp(orderId, processId);
                return true;
            }
            else {
            } else {
                return false;
            }
@@ -90,6 +91,7 @@
        }
    }
    //保存流程卡数据
    public Boolean AddFlowCardSv(Map<String, Object> object) {
        String userName = "";
        if (object.get("userName") != null) {
@@ -104,27 +106,46 @@
        List<FlowCard> FlowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("flowCard")), FlowCard.class);
        if (!FlowCardList.isEmpty()) {
            for (FlowCard flowCard : FlowCardList) {
                //查询每个序号的层数
                Integer layer = flowCardMapper.SelectLayer(productionId, flowCard.getOrderNumber());
                //添加流程卡数据
                flowCardMapper.AddFlowCardMp(flowCard.getProcessId(),flowCard.getOrderNumber(),flowCard.getLandingSequence(),flowCard.getQuantity(),productionId,userName);
                flowCardMapper.AddFlowCardMp(flowCard.getProcessId(), flowCard.getOrderNumber(), flowCard.getLandingSequence(), flowCard.getQuantity(), productionId, userName,layer);
                //修改分架状态,将状态改为1
                flowCardMapper.UpdateFlowState(productionId,flowCard.getOrderNumber());
                flowCardMapper.UpdateFlowState(productionId, flowCard.getOrderNumber());
                //查询该订单未分架数量
               Integer FlowCount= flowCardMapper.SelectFlowCount(productionId);
               if (FlowCount==0){
                   //修改订单表分架状态为2
                   System.out.println("我来试试1");
                   flowCardMapper.UpdateProcessingCard(productionId,2);
               }
               else{
                   //修改订单表分架状态为1,未全部分架完成
                   System.out.println("我来试试2");
                   flowCardMapper.UpdateProcessingCard(productionId,1);
               }
                Integer FlowCount = flowCardMapper.SelectFlowCount(productionId);
                if (FlowCount == 0) {
                    //修改订单表分架状态为2
                    flowCardMapper.UpdateProcessingCard(productionId, 2);
                } else {
                    //修改订单表分架状态为1,未全部分架完成
                    flowCardMapper.UpdateProcessingCard(productionId, 1);
                }
            }
            return  true;
            return true;
        } else {
            return  false;
            return false;
        }
    }
    public Map<String, Object> SelectSchedulingSv(String selectTime1, String selectTime2, String orderId,String processes, Integer state, FlowCard flowCard) {
        Map<String, Object> map = new HashMap<>();
        if (state==2){//已排产
            map.put("data", flowCardMapper.SelectOkSchedulingMp(selectTime1, selectTime2,orderId,processes, flowCard));
        }else if (state==1){//未排产
            map.put("data", flowCardMapper.SelectNoSchedulingMp(selectTime1, selectTime2,orderId,processes, flowCard));
        }
        return map;
    }
    //首次查询排版数据
    public Map<String, Object> selectLastScheduling(String selectTime1, String selectTime2, FlowCard flowCard) {
        Map<String, Object> map = new HashMap<>();
        map.put("data", flowCardMapper.selectLastSchedulingMp(selectTime1, selectTime2, flowCard));
        return map;
    }
}
north-glass-erp/src/main/java/com/example/erp/service/pp/ProductionSchedulingService.java
New file
@@ -0,0 +1,52 @@
package com.example.erp.service.pp;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.example.erp.entity.pp.ProductionScheduling;
import com.example.erp.mapper.pp.ProductionSchedulingMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.sql.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
@DS("pp")
public class ProductionSchedulingService {
    @Autowired
    ProductionSchedulingMapper productionSchedulingMapper;
    //带时间查询
    public Map<String, Object> SelectSchedulingSv(String selectTime1, String selectTime2, String orderId,String processes, Integer state, ProductionScheduling productionScheduling ) {
        Map<String, Object> map = new HashMap<>();
        if (state==2){//已排产
            map.put("data", productionSchedulingMapper.SelectOkSchedulingMp(selectTime1, selectTime2,orderId,processes, productionScheduling));
        }else if (state==1){//未排产
            map.put("data", productionSchedulingMapper.SelectNoSchedulingMp(selectTime1, selectTime2,orderId,processes, productionScheduling));
        }
        return map;
    }
    //首次查询排产数据
    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));
        return map;
    }
    //带订单号查询
    public Map<String, Object> SelectSchedulingNotSv(String selectTime1, String selectTime2, String orderId, String processes, Integer state, ProductionScheduling productionScheduling) {
        Map<String, Object> map = new HashMap<>();
        map.put("data", productionSchedulingMapper.SelectSchedulingNotMp(selectTime1, selectTime2,orderId,processes, productionScheduling));
        return map;
    }
}
north-glass-erp/src/main/java/com/example/erp/service/pp/WorkOrderService.java
@@ -66,7 +66,6 @@
                    //查询生成的生产订单号是否存在
                    Integer workCount = workOrderMapper.SelectOrderNumber(productIdVl);
                    System.out.println("生产订单号:" + productIdVl + " 查询结果:" + workCount);
                    if (workCount < 1 ) {
                        break;
                    }
@@ -101,7 +100,6 @@
            Integer States = 1;
            Integer NoWorkCount = workOrderMapper.SelectWorkCount(orderId);
            Integer YesWorkCount = workOrderMapper.SelectYesWorkCount(orderId);
            System.out.println(NoWorkCount);
            if (NoWorkCount ==YesWorkCount) {
                workOrderMapper.UpdateWorkType(orderId, State);
            } else {
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -158,24 +158,19 @@
        group by od.order_id, ogd.production_id
    </select>
    <!--    更新分架状态-->
    <update id="UpdateDeleteState">
        update sd.order_glass_detail as ogd
        set ogd.production_id=null,
            ogd.production_time=null,
            ogd.founder=null
        where ogd.production_id = #{processId}
        update
            sd.order_glass_detail as ogd left join flow_card as fc
                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 fc.process_id=#{processId}
    </update>
    <!--    删除流程卡-->
    <update id="DeleteFlowCardMp">
        update 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
        set ogd.production_id=null,
            ogd.production_time=null,
            ogd.founder=null
        where od.order_id = #{orderId}
          and ogd.production_id = #{processId}
        delete from flow_card as fc where fc.process_id=#{processId}
    </update>
    <!--    分架新增明细查询-->
@@ -240,6 +235,7 @@
            technology_number,
            quantity,
            founder,
            layers_number,
            splitFrame_time,
            create_time
        )
@@ -252,6 +248,7 @@
            ogd.technology_number,
            #{quantity},
            #{userName},
            #{layer},
            NOW(),
            NOW()
@@ -281,4 +278,44 @@
        set o.processing_card=#{state}
        where o.order_id=left(#{productionId},10)
    </update>
<!--    查询已排版数据-->
    <select id="SelectOkSchedulingMp">
        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),
               (od.quantity-IFNULL(ps.scheduling_quantity,0)),
               round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2),
               IFNULL(ps.scheduling_quantity,0),
               round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2),
               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.order_id=#{orderId} and ps.processes=#{processes} and ps.scheduling_id IS NOT NULL
    </select>
<!--    查询未排版数据-->
    <select id="SelectNoSchedulingMp">
    </select>
<!--    首次查询排版数据-->
    <select id="selectLastSchedulingMp">
        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,
               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.create_time between #{selectTime1} and #{selectTime2}
    </select>
<!--   查询对应序号的层数-->
    <select id="SelectLayer">
        select COUNT(ogd.order_number)
        from sd.order_glass_detail as ogd
        where ogd.production_id = #{productionId}
          and ogd.order_number=#{orderNumber}
    </select>
</mapper>
north-glass-erp/src/main/resources/mapper/pp/ProductionScheduling.xml
New file
@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.erp.mapper.pp.ProductionSchedulingMapper">
    <resultMap id="ProductionSchedulingMap" type="com.example.erp.entity.pp.ProductionScheduling">
        <result column="processes" property="processes"/>
        <result column="scheduling_quantity" property="schedulingQuantity"/>
        <result column="order_number" property="orderNumber"/>
        <!--接收其他外键实体类数据-->
        <association property="order" javaType="com.example.erp.entity.sd.Order">
            <result column="project" property="project"/>
            <result column="order_id" property="orderId"/>
            <result column="customer_name" property="customerName"/>
            <result column="batch" property="batch"/>
            <result column="other_remarks" property="otherRemarks"/>
            <result column="icon" property="icon"/>
            <result column="order_type" property="orderType"/>
            <result column="salesman" property="salesman"/>
            <result column="processing_note" property="processingNote"/>
            <result column="delivery_address" property="deliveryAddress"/>
        </association>
        <association property="orderDetail" javaType="com.example.erp.entity.sd.OrderDetail">
            <result column="order_id" property="orderId"/>
            <result column="product_id" property="productId"/>
            <result column="product_name" property="productName"/>
            <result column="compute_gross_area" property="computeGrossArea"/>
            <result column="processing_note" property="processingNote"/>
            <result column="quantity" property="quantity"/>
            <result column="compute_gross_area" property="computeGrossArea"/>
            <result column="perimeter" property="perimeter"/>
            <result column="order_number" property="orderNumber"/>
            <result column="width" property="width"/>
            <result column="height" property="height"/>
            <result column="shape" property="shape"/>
            <result column="weight" property="weight"/>
        </association>
    </resultMap>
<!--    查询已排版数据-->
    <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,
        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,
        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,
        ps.reviewer,
        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  ps.scheduling_id IS NOT NULL
           and od.create_time between #{selectTime1} and #{selectTime2}
        <if test="processes!=null and processes!=''">
            and ps.processes regexp #{processes}
        </if>
    </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,
        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,
        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,
        ps.reviewer,
        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  ps.scheduling_id IS NOT NULL
        and od.order_id regexp #{orderId}
        <if test="processes!=null and processes!=''">
            and ps.processes regexp #{processes}
        </if>
    </select>
<!--    查询未排产数据-->
    <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,
        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  isnull(ps.scheduling_id) and od.create_time between #{selectTime1} and #{selectTime2}
        <if test="orderId!=null and orderId!=''">
            and od.order_id regexp #{orderId}
        </if>
    group by od.order_id,od.order_number
    </select>
<!--    首次查询排产数据-->
    <select id="selectLastSchedulingMp">
        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,
               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.create_time between #{selectTime1} and #{selectTime2}
    </select>
</mapper>
north-glass-erp/target/classes/mapper/pp/FolwCard.xml
@@ -158,24 +158,19 @@
        group by od.order_id, ogd.production_id
    </select>
    <!--    更新分架状态-->
    <update id="UpdateDeleteState">
        update sd.order_glass_detail as ogd
        set ogd.production_id=null,
            ogd.production_time=null,
            ogd.founder=null
        where ogd.production_id = #{processId}
        update
            sd.order_glass_detail as ogd left join flow_card as fc
                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 fc.process_id=#{processId}
    </update>
    <!--    删除流程卡-->
    <update id="DeleteFlowCardMp">
        update 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
        set ogd.production_id=null,
            ogd.production_time=null,
            ogd.founder=null
        where od.order_id = #{orderId}
          and ogd.production_id = #{processId}
        delete from flow_card as fc where fc.process_id=#{processId}
    </update>
    <!--    分架新增明细查询-->
@@ -240,6 +235,7 @@
            technology_number,
            quantity,
            founder,
            layers_number,
            splitFrame_time,
            create_time
        )
@@ -252,6 +248,7 @@
            ogd.technology_number,
            #{quantity},
            #{userName},
            #{layer},
            NOW(),
            NOW()
@@ -281,4 +278,44 @@
        set o.processing_card=#{state}
        where o.order_id=left(#{productionId},10)
    </update>
<!--    查询已排版数据-->
    <select id="SelectOkSchedulingMp">
        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),
               (od.quantity-IFNULL(ps.scheduling_quantity,0)),
               round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2),
               IFNULL(ps.scheduling_quantity,0),
               round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2),
               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.order_id=#{orderId} and ps.processes=#{processes} and ps.scheduling_id IS NOT NULL
    </select>
<!--    查询未排版数据-->
    <select id="SelectNoSchedulingMp">
    </select>
<!--    首次查询排版数据-->
    <select id="selectLastSchedulingMp">
        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,
               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.create_time between #{selectTime1} and #{selectTime2}
    </select>
<!--   查询对应序号的层数-->
    <select id="SelectLayer">
        select COUNT(ogd.order_number)
        from sd.order_glass_detail as ogd
        where ogd.production_id = #{productionId}
          and ogd.order_number=#{orderNumber}
    </select>
</mapper>
north-glass-erp/target/classes/mapper/pp/ProductionScheduling.xml
New file
@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.erp.mapper.pp.ProductionSchedulingMapper">
    <resultMap id="ProductionSchedulingMap" type="com.example.erp.entity.pp.ProductionScheduling">
        <result column="processes" property="processes"/>
        <result column="scheduling_quantity" property="schedulingQuantity"/>
        <result column="order_number" property="orderNumber"/>
        <!--接收其他外键实体类数据-->
        <association property="order" javaType="com.example.erp.entity.sd.Order">
            <result column="project" property="project"/>
            <result column="order_id" property="orderId"/>
            <result column="customer_name" property="customerName"/>
            <result column="batch" property="batch"/>
            <result column="other_remarks" property="otherRemarks"/>
            <result column="icon" property="icon"/>
            <result column="order_type" property="orderType"/>
            <result column="salesman" property="salesman"/>
            <result column="processing_note" property="processingNote"/>
            <result column="delivery_address" property="deliveryAddress"/>
        </association>
        <association property="orderDetail" javaType="com.example.erp.entity.sd.OrderDetail">
            <result column="order_id" property="orderId"/>
            <result column="product_id" property="productId"/>
            <result column="product_name" property="productName"/>
            <result column="compute_gross_area" property="computeGrossArea"/>
            <result column="processing_note" property="processingNote"/>
            <result column="quantity" property="quantity"/>
            <result column="compute_gross_area" property="computeGrossArea"/>
            <result column="perimeter" property="perimeter"/>
            <result column="order_number" property="orderNumber"/>
            <result column="width" property="width"/>
            <result column="height" property="height"/>
            <result column="shape" property="shape"/>
            <result column="weight" property="weight"/>
        </association>
    </resultMap>
<!--    查询已排版数据-->
    <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,
        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,
        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,
        ps.reviewer,
        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  ps.scheduling_id IS NOT NULL
           and od.create_time between #{selectTime1} and #{selectTime2}
        <if test="processes!=null and processes!=''">
            and ps.processes regexp #{processes}
        </if>
    </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,
        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,
        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,
        ps.reviewer,
        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  ps.scheduling_id IS NOT NULL
        and od.order_id regexp #{orderId}
        <if test="processes!=null and processes!=''">
            and ps.processes regexp #{processes}
        </if>
    </select>
<!--    查询未排产数据-->
    <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,
        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  isnull(ps.scheduling_id) and od.create_time between #{selectTime1} and #{selectTime2}
        <if test="orderId!=null and orderId!=''">
            and od.order_id regexp #{orderId}
        </if>
    group by od.order_id,od.order_number
    </select>
<!--    首次查询排产数据-->
    <select id="selectLastSchedulingMp">
        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,
               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.create_time between #{selectTime1} and #{selectTime2}
    </select>
</mapper>