chenlu
2024-03-12 855f1ab0148cbfc26bc365a8c46ab8b7d427c01e
更新提交
16个文件已修改
1个文件已添加
1419 ■■■■ 已修改文件
north-glass-erp/northglass-erp/src/router/index.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue 226 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectDetailProcessCard.vue 337 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProductionSchedulingController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ProductionSchedulingMapper.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ProductionSchedulingService.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml 254 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/ProductionScheduling.xml 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/pp/FolwCard.xml 254 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/pp/ProductionScheduling.xml 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/sd/Delivery.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/sd/DeliveryDetail.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/router/index.js
@@ -266,6 +266,11 @@
              component: () => import('../views/pp/processCard/ProductionScheduling.vue'),
            },
            {
              path: 'selectDetailProcessCard',
              name: 'selectDetailProcessCard',
              component: () => import('../views/pp/processCard/SelectDetailProcessCard.vue'),
            },
            {
              path: '',
              redirect:'/main/processCard/SelectProcessCard'
            }
north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue
@@ -326,6 +326,8 @@
  }
})
//定义输入数量
let checkedNum = ref('')
//创建流程卡
const createProcessCard = () => {
  const $grid = xGrid.value
@@ -344,23 +346,61 @@
    //index = index.toString().padStart(2, '0')
  }
  const processId = productionId + index.toString().padStart(2, '0')
  checkedList.forEach((item) => {
    item.processId = processId
    item.landingSequence = index
    item.quantity = item.baiscQuantity
  })
  checkedList.forEach((item) => {
    delete item._X_ROW_KEY
  })
  $gridLeft.insertAt(checkedList)
  $grid.remove(checkedList)
  if ($gridLeft || $grid) {
  const regex = /^(\d+|)$/;
  if (!regex.test(checkedNum.value)) {
    ElMessage.warning("请输入正整数")
    return
  }
  //判断正整数
  if (/^[1-9]\d*$/.test(checkedNum.value)) {
    checkedList.forEach((item) => {
      //定义key值保持
      //判断可用数量是否大于等于输入的数量,不满足则抛出异常
      if (item.baiscQuantity * 1 < checkedNum.value * 1) throw new Error("请输入小于等于可用数量的数字");
      item.quantity =  checkedNum.value
      item.processId = processId
      item.landingSequence = index
      item.baiscQuantity=item.baiscQuantity - checkedNum.value
    })
    //删除key
    checkedList.forEach((item) => {
      let key = item._X_ROW_KEY
      delete item._X_ROW_KEY
      if (item.baiscQuantity===0){
        $grid.remove(checkedList)
      }
      $gridLeft.insertAt(checkedList)
      item._X_ROW_KEY = key
    })
//清除两边复选框
    $gridLeft.clearCheckboxRow()
    $grid.clearCheckboxRow()
  }
  else if (checkedNum.value === '') {//判断数量输入框无输入数字
    checkedList.forEach((item) => {
      item.processId = processId
      item.landingSequence = index
      item.quantity = item.baiscQuantity
    })
    //删除key
    checkedList.forEach((item) => {
      delete item._X_ROW_KEY
    })
    $gridLeft.insertAt(checkedList)
    $grid.remove(checkedList)
    //清除两边复选框
    $gridLeft.clearCheckboxRow()
    $grid.clearCheckboxRow()
  }
}
let checkedNum = ref('')
//向右边表格添加数据
const addRight = () => {
@@ -409,7 +449,7 @@
          $grid.insert(item)
        }
      })
    } else if (checkedNum.value === '') {//判断数量输入框有无输入数字
    } else if (checkedNum.value === '') {//判断数量输入框无输入数字
      checkedList.forEach((item) => {
        let rightData = $grid.getTableData().fullData
@@ -427,6 +467,7 @@
    }
    //清除两边复选框
    $gridLeft.clearCheckboxRow()
    $grid.clearCheckboxRow()
  } catch (e) {
@@ -491,9 +532,6 @@
          }
        } else {
          // if (){
          //
          // }
          //如果勾选两个值不同则插入同流程卡
          item.quantity = checkedNum.value
          item.processId = checkedListLeft[0].processId
@@ -521,18 +559,6 @@
              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{
          //
          //   }
          //
          // })
        }
      })
@@ -546,6 +572,7 @@
      $gridLeft.insertAt(checkedList)
      $grid.remove(checkedList)
    }
    //清除两边复选框
    if ($gridLeft || $grid) {
      $gridLeft.clearCheckboxRow()
      $grid.clearCheckboxRow()
@@ -568,12 +595,14 @@
          const $tableRight = xGrid.value
          if ($table) {
            const selectRecords = $table.getCheckboxRecords()
            const selectRight = $tableRight.getCheckboxRecords()
          //  const selectRight = $tableRight.getCheckboxRecords()
            let leftData = $tableRight.getTableData().fullData
            if (selectRecords.length === 0) {
              ElMessage.warning("请先选择保存的数据")
              return
            }
            if (selectRight.length > 0) {
            if (leftData.length > 0) {
              ElMessage.warning("请先将右侧数据全部建立流程卡后保存")
              return;
            }
north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue
@@ -12,7 +12,9 @@
import BasicTable from '@/components/basic/BasicTable.vue'
import {VXETable} from "vxe-table";
import useUserInfoStore from "@/stores/userInfo";
import {changeFilterEvent,filterChanged} from "@/hook"
import {changeFilterEvent, filterChanged} from "@/hook"
import {addListener,toolbarButtonClickEvent} from "@/hook/mouseMove";
let router = useRouter()
const userStore = useUserInfoStore()
@@ -32,8 +34,9 @@
  }
}
//工序
const value = ref('')
const value = ref('切割')
//排产状态
@@ -119,21 +122,32 @@
  return [start, end]
}
onMounted(()=>{
  //启用表格拖动选中
  addListener(xGrid.value,gridOptions)
})
//第一次加载获取近七天时间和默认状态
form.date1 = getNowTime()
let startTime = form.date1[0]
let endTime = form.date1[1]
let selectProcesses = value.value
let inputVal = form.orderId
if (inputVal == '') {
  inputVal = null
}
if (selectProcesses == '') {
  selectProcesses = null
}
//第一次加载数据
request.post(`/productionScheduling/selectLastScheduling/${startTime}/${endTime}`, filterData.value).then((res) => {
request.post(`/productionScheduling/selectLastScheduling/${startTime}/${endTime}/${selectProcesses}/${inputVal}`, filterData.value).then((res) => {
  if (res.code == 200) {
    pageTotal.value = res.data.total
    produceList = produceList.value.concat(deepClone(res.data.data))
    titleSelectJson.value.processType=res.data.process
    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
@@ -157,13 +171,13 @@
  }
  if (inputVal == null && selectState == 1) {
    //根据时间查询未排产数据
    request.post(`/productionScheduling/selectLastScheduling/${startTime}/${endTime}`, filterData.value).then((res) => {
    request.post(`/productionScheduling/selectLastScheduling/${startTime}/${endTime}/${selectProcesses}/${inputVal}`, filterData.value).then((res) => {
      if (res.code == 200) {
        pageTotal.value = res.data.total
        xGrid.value.loadData(res.data.data)
        gridOptions.loading = false
        //禁用删除、保存按钮
        //禁用删除、审核按钮
        gridOptions.toolbarConfig.buttons[0].disabled = true
        gridOptions.toolbarConfig.buttons[1].disabled = true
        //启用保存
@@ -172,16 +186,14 @@
        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) => {
      if (res.code == 200) {
        pageTotal.value = res.data.total
        xGrid.value.loadData(res.data.data)
        gridOptions.loading = false
        //禁用删除、保存按钮
        //禁用删除、审核按钮
        gridOptions.toolbarConfig.buttons[0].disabled = true
        gridOptions.toolbarConfig.buttons[1].disabled = true
        //启用保存
@@ -192,13 +204,12 @@
    })
  } else if (inputVal == null && selectState == 2) {
    //根据时间查询已排产数据
    console.log(startTime, endTime, selectProcesses, selectState)
    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
        //启用删除、保存按钮
        //启用删除、审核按钮
        gridOptions.toolbarConfig.buttons[0].disabled = false
        gridOptions.toolbarConfig.buttons[1].disabled = false
        //禁用保存
@@ -214,7 +225,7 @@
        pageTotal.value = res.data.total
        xGrid.value.loadData(res.data.data)
        gridOptions.loading = false
        //启用删除、保存按钮
        //启用删除、审核按钮
        gridOptions.toolbarConfig.buttons[0].disabled = false
        gridOptions.toolbarConfig.buttons[1].disabled = false
        //禁用保存
@@ -228,6 +239,12 @@
}
/*后端返回结果多层嵌套展示*/
const hasDecimal = (value) => {
  const regex = /\./; // 定义正则表达式,查找小数点
  return regex.test(value); // 返回true/false
}
//子组件接收参数
const xGrid = ref()
@@ -236,7 +253,7 @@
  keepSource: true,//保持源数据
  align: 'center',//文字居中
  stripe: true,//斑马纹
  rowConfig: {isCurrent: true, isHover: true, height: 50},//鼠标移动或选择高亮
  rowConfig: {isCurrent: true, isHover: true, height: 30},//鼠标移动或选择高亮
  id: 'CustomerList',
  showFooter: true,//显示脚
  printConfig: {},
@@ -249,16 +266,29 @@
    useKey: true
  },
  filterConfig: {   //筛选配置项
    // remote: true
                    // remote: true
  },
  customConfig: {
    storage: true
  },
  editConfig: {
    editConfig: {
    trigger: 'click',
    mode: 'row',
    showStatus: true
  },//表头参数
  },
  menuConfig: {
    body: {
      options: [
        [
          { code: 'copyChecked', name: '选中相同', prefixIcon: 'vxe-icon-copy', visible: true, disabled: false },
          { code: 'copyAll', name: '之后相同', prefixIcon: 'vxe-icon-feedback', visible: true, disabled: false },
          { code: 'clearChecked', name: '清除选中', prefixIcon: 'vxe-icon-indicator', visible: true, disabled: false },
        ]
      ]
    }
  },
  //表头参数
  columns: [
    {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50},
    {type: 'checkbox', fixed: "left", title: '选择', width: 80},
@@ -276,13 +306,62 @@
      title: '计划结束时间'
    },
    // {field: '排产编号', title: '排产编号',  width: 120 },
    {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,filters: [{data: ''}],slots: {filter: 'num1_filter'},filterMethod:filterChanged},
    {field: 'height', title: '高', width: 60,filters: [{data: ''}],slots: {filter: 'num1_filter'},filterMethod:filterChanged},
    {
      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: 'technology_number',
      title: '小片顺序',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      width: 70,
      filterMethod: filterChanged
    },
    {
      field: 'child_width',
      title: '宽',
      width: 60,
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
    },
    {
      field: 'child_height',
      title: '高',
      width: 60,
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
    },
    {field: 'quantity', title: '订单数量', width: 70},
    {field: 'area', title: '订单面积', width: 90},
    {
@@ -298,10 +377,10 @@
    {field: 'productionScheduledArea', title: '已排产面积', width: 120},
    {field: 'review_status', title: '审核状态', width: 140},
    {field: 'reviewer', title: '审核人', width: 140},
    {field: 'product_name', title: '产品名称', width: 140},
    {field: 'glass_child', title: '产品名称', width: 140},
    {field: 'shape', title: '形状', width: 80},
    {field: 'notes', title: '备注', editRender: {name: 'input', attrs: {placeholder: ''}}, width: 120},
    {field: 'scheduling_id', title: '排产编号',width: 120},
    {field: 'scheduling_id', title: '排产编号', width: 120},
  ],//表头按钮
  toolbarConfig: {
@@ -335,9 +414,7 @@
})
//删除
//表格按钮
const gridEvents = {
  async toolbarButtonClick({code}) {
    const $grid = xGrid.value
@@ -372,12 +449,21 @@
              processes: selectProcesses,//工序
              userName: username//审核人
            })
            //禁用保存
            gridOptions.toolbarConfig.buttons[2].disabled = true
            //保存排产数据
            request.post("/productionScheduling/addScheduling", schedulingData.value).then((res) => {
              if (res.code == 200) {
                ElMessage.success("保存成功")
                location.reload();
                // 启用保存
                gridOptions.toolbarConfig.buttons[2].disabled = false
                router.push({
                  path: '/main/processCard/ProductionScheduling',
                  query: { random: Math.random()}
                })
              } else {
                // 启用保存
                gridOptions.toolbarConfig.buttons[2].disabled = false
                ElMessage.warning(res.msg)
              }
@@ -402,7 +488,7 @@
                scheduling: selectRecords,
              })
              request.post("/productionScheduling/deleteScheduling",schedulingData.value).then((res) => {
              request.post("/productionScheduling/deleteScheduling", schedulingData.value).then((res) => {
                if (res.code == 200) {
                  ElMessage.success("删除成功")
                  location.reload();
@@ -427,7 +513,7 @@
              scheduling: selectRecords,
              userName: username//审核人
            })
            request.post("/productionScheduling/examineScheduling",schedulingData.value).then((res) => {
            request.post("/productionScheduling/examineScheduling", schedulingData.value).then((res) => {
              if (res.code == 200) {
                ElMessage.success("审核成功")
                location.reload();
@@ -443,15 +529,63 @@
      }
    }
  },
  menuClick ({ menu, row, column }) {
    const $grid = xGrid.value
    if ($grid) {
      switch (menu.code) {
        case 'copyChecked' :{
          let result = toolbarButtonClickEvent()
          if(result){
            const dataList = xGrid.value.getTableData().visibleData
            const val = dataList[result.start][result.cell]
            dataList.forEach((item,index) =>{
              if(index>=result.start && index<=result.end){
                item[result.cell] = val
              }
            })
          }
          gridOptions.menuConfig.body.options[0][5].disabled=false
          break
        }
        case 'copyAll' :{
          let result = toolbarButtonClickEvent()
          if(result){
            const dataList = xGrid.value.getTableData().visibleData
            const val = dataList[result.start][result.cell]
            dataList.forEach((item,index) =>{
              if(index>=result.start ){
                item[result.cell] = val
              }
            })
          }
          gridOptions.menuConfig.body.options[0][5].disabled=false
          break
        }
        case 'clearChecked' :{
          let result = toolbarButtonClickEvent()
          if(result){
            const dataList = xGrid.value.getTableData().visibleData
            dataList.forEach((item,index) =>{
              if(index>=result.start && index<=result.end){
                item[result.cell] = ''
              }
            })
          }
          gridOptions.menuConfig.body.options[0][5].disabled=false
          break
        }
      }
    }
  },
}
const determineNum = () => {
  const $grid = xGrid.value
  const table = $grid.getTableData().fullData
  const selectRecords = $grid.getCheckboxRecords()
  let selectState = stateValue.value
  table.forEach((selectRecords) => {
    if (selectRecords.scheduling_quantity > selectRecords.pendingProductionQuantity) {
    if (selectRecords.scheduling_quantity > selectRecords.pendingProductionQuantity && selectState==1) {
      ElMessage.warning("排产数量不能大于待排产数量")
      //禁用保存按钮
      //gridOptions.toolbarConfig.buttons[2].disabled = true
@@ -460,8 +594,6 @@
  })
}
</script>
@@ -481,9 +613,9 @@
        />
        &nbsp;&nbsp;
        <el-input v-model="form.orderId" placeholder="销售单号" clearable style="width: 110px"></el-input>
        <el-input v-model="form.orderId" clearable placeholder="销售单号" style="width: 110px"></el-input>
        &nbsp;
        <el-select v-model="value" clearable placeholder="请选择工序" style="width: 120px">
        <el-select v-model="value" clearable default-value="default_city" style="width: 120px">
          <el-option
              v-for="item in titleSelectJson['processType']"
              :key="item.id"
@@ -512,8 +644,8 @@
    <vxe-grid
        ref="xGrid"
        class="mytable-scrollbar"
        max-height="100%"
        height="100%"
        max-height="100%"
        v-bind="gridOptions"
        v-on="gridEvents"
        @filter-change="filterChanged"
@@ -542,6 +674,11 @@
    </vxe-grid>
  </div>
  <div class="vxe-table--cell-area" ref="cellArea" >
    <span  class="vxe-table--cell-main-area"  ></span>
    <span class="vxe-table--cell-active-area"  ></span>
  </div>
</template>
<style scoped>
@@ -555,4 +692,11 @@
  height: 6%;
  text-align: center;
}
.vxe-grid {
  /* 禁用浏览器默认选中 */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
</style>
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectDetailProcessCard.vue
New file
@@ -0,0 +1,337 @@
<script setup>
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 productGlassTypeStore = useProductGlassTypeStore()
let router = useRouter()
let props = defineProps({
  rowIndex:{}
})
//表尾求和
const sumNum = (list, field) => {
  let count = 0
  list.forEach(item => {
    count += Number(item[field])
  })
  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
//第一次加载
const {currentRoute} = useRouter()
const route = currentRoute.value
let processId = route.query.processId
//第一次加载数据
request.post(`/processCard/flowCardDetail/${processId}`, filterData.value).then((res) => {
  if (res.code == 200) {
    produceList = produceList.value.concat(deepClone(res.data.data))
    xGrid.value.reloadData(produceList)
    gridOptions.loading = false
  } else {
    ElMessage.warning(res.msg)
  }
})
//页脚翻页查询
const selectPageList = ()=>{
  let startTime = form.date1[0]
  let endTime = form.date1[1]
  request.post(`/processCard/flowCard/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}`,filterData.value).then((res) => {
    if(res.code==200){
      produceList = deepClone(res.data.data)
      xGrid.value.reloadData(produceList)
    }else{
      ElMessage.warning(res.msg)
    }
  })
}
//点击查询
const getWorkOrder = () => {
  let startTime = form.date1[0]
  let endTime = form.date1[1]
  request.post(`/processCard/flowCard/${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)
    }
  })
}
//页脚跳转
const handlePageChange = ({ currentPage, pageSize }) => {
  pageNum.value=currentPage
  total.pageTotal    = pageSize
  selectPageList()
}
/*使用筛选,后端获取数据*/
const changeFilterEvent = (event, option, $panel,) => {
  // 手动触发筛选
  $panel.changeOption(event, !!option.data, option)
}
function filterChanged(column) {
  gridOptions.loading = true
  //筛选条件发生变化条件发生变化
  let value = column.datas[0] != undefined ? column.datas[0] : ''
  value = value.trim()
  //判断是否存在外键
  if (column.property.indexOf('.') > -1) {
    const columnArr = column.property.split('.')
    filterData.value[columnArr[0]] = {
      [columnArr[1]]: value
    }
  } else {
    filterData.value[column.property] = value
  }
//获取选中时间
  let startTime = form.date1[0]
  let endTime = form.date1[1]
  request.post(`/processCard/detailFlowCard/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
    }else{
      ElMessage.warning(res.msg)
    }
  })
}
/*后端返回结果多层嵌套展示*/
const hasDecimal = (value) => {
  const regex = /\./; // 定义正则表达式,查找小数点
  return regex.test(value); // 返回true/false
}
//子组件接收参数
const xGrid = ref()
const gridOptions = reactive({
  border:  "full",//表格加边框
  keepSource: true,//保持源数据
  align: 'center',//文字居中
  stripe:true,//斑马纹
  rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮
  id: 'CustomerList',
  showFooter: true,//显示脚
  printConfig: {},
  importConfig: {},
  exportConfig: {},
  scrollY:{ enabled: true },//开启虚拟滚动
  showOverflow:true,
  columnConfig: {
    resizable: true,
    useKey: true
  },
  filterConfig: {   //筛选配置项
    //remote: true
  },
  customConfig: {
    storage: true
  },
  editConfig: {
    trigger: 'click',
    mode: 'row',
    showStatus: true
  },//表头参数
  columns:[
    {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
    { type: 'seq',fixed:"left", title: '自序', width: 50 },
    {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' }, width: 180},
    {field: 'order.project', title: '项目名称' ,showOverflow:"ellipsis"},
    {field: 'quantity', title: '数量', },
    {field: 'orderDetail.computeGrossArea', title: '面积', },
    {field: 'founder', title: '分架员', },
    {field: 'orderDetail.processingNote', title: '加工要求', },
    {field: 'layoutStatus', title: '排版状态', }
  ],//表头按钮
  toolbarConfig: {
    // buttons: [{
    //
    // }],
    import: false,
    // export: true,
    // print: true,
    zoom: true,
    custom: true
  },
  data:  [
  ],//table body实际数据
  //脚部求和
  footerMethod ({ columns, data }) {//页脚函数
    return[
      columns.map((column, columnIndex) => {
        if (columnIndex === 0) {
          return '合计:'
        }
        // if (props.tableProp.footList.includes(column.field)) {
        //   return sumNum(data, column.field)
        // }
        return ''
      })
    ]
  }
})
</script>
<template>
  <div class="main-div-customer">
    <div id="selectForm">
      <el-row :gutter="0">
        <el-date-picker
            v-model="form.date1"
            type="daterange"
            format="YYYY/MM/DD"
            value-format="YYYY-MM-DD"
            start-placeholder="开始时间"
            end-placeholder="结束时间"
            :default-time="defaultTime"
        />
        &nbsp;&nbsp;
        <el-button
            @click="getWorkOrder"
            id="select"
            type="primary" :icon="Search">查询
        </el-button>
      </el-row>
    </div>
    <vxe-grid
        max-height="100%"
        @filter-change="filterChanged"
        class="mytable-scrollbar"
        ref="xGrid"
        v-bind="gridOptions"
    >
      <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
      <!--      下拉显示所有信息插槽-->
      <template #content="{ row }">
        <ul class="expand-wrapper">
          <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined ">
            <span style="font-weight: bold">{{ item.title + ':  ' }}</span>
            <span 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 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>
      <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)"/>
          </div>
        </div>
      </template>
      <template #pager>
        <!--使用 pager 插槽-->
        <!--        'PrevJump','NextJump', -->
        <vxe-pager
            @page-change="handlePageChange"
            :layouts="[  'PrevPage', 'Jump','PageCount', 'NextPage',  'Total']"
            v-model:current-page="pageNum"
            v-model:page-size="total.pageSize"
            v-model:pager-count="total.pageTotal"
            :total="total.dataTotal"
        >
        </vxe-pager>
      </template>
    </vxe-grid>
  </div>
</template>
<style scoped>
.main-div-customer{
  width: 99%;
  height: 100%;
}
#selectForm {
  width: 40%;
  text-align: center;
}
</style>
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue
@@ -21,9 +21,9 @@
  let startTime = form.date1[0]
  let endTime = form.date1[1]
  switch (type) {
    case 'edit' : {
      // console.log(row)
      // router.push({path: '/main/processCard/PrintFlowCard', query: {id: row.id}})
    case 'select' : {
      console.log(row.processId)
      router.push({path: '/main/processCard/SelectDetailProcessCard', query: { processId: row.processId }})
      break
    }
    case 'setType': {
@@ -374,7 +374,7 @@
      <!--左边固定显示的插槽-->
      <template #button_slot="{ row }" >
        <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">打印</el-button>
        <el-button @click="getTableRow(row,'select')" 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>
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java
@@ -135,5 +135,13 @@
        return Result.seccess(flowCardService.selectSchedulingSv(selectTime1,selectTime2,orderId,processes,state,flowCard));
    }
    //查询排产数据
    @ApiOperation("流程卡明细查询接口")
    @PostMapping  ("/flowCardDetail/{processId}")
    public Result flowCardDetail(
            @PathVariable String processId,
            @RequestBody FlowCard flowCard){
        return Result.seccess(flowCardService.flowCardDetailSv(processId,flowCard));
    }
}
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProductionSchedulingController.java
@@ -22,12 +22,14 @@
    //查询第一次排版数据
    @ApiOperation("加载时查询排版数据接口")
    @PostMapping  ("/selectLastScheduling/{selectTime1}/{selectTime2}")
    @PostMapping  ("/selectLastScheduling/{selectTime1}/{selectTime2}/{processes}/{orderId}")
    public Result selectLastScheduling(
            @PathVariable String selectTime1,
            @PathVariable String selectTime2,
            @PathVariable String processes,
            @PathVariable String orderId,
            @RequestBody ProductionScheduling productionScheduling){
        return Result.seccess(productionSchedulingService.selectLastScheduling(selectTime1,selectTime2,productionScheduling));
        return Result.seccess(productionSchedulingService.selectLastScheduling(selectTime1,selectTime2,processes,orderId,productionScheduling));
    }
    //点击查询排版数据
north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java
@@ -60,4 +60,6 @@
    Integer selectFlowCardCount(String orderId);
    List<Map<String, String>> flowCardDetailMp(String processId, FlowCard flowCard);
}
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ProductionSchedulingMapper.java
@@ -19,13 +19,13 @@
    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>> selectLastSchedulingMp(String selectTime1, String selectTime2,String processes,String orderId, ProductionScheduling productionScheduling);
    List<Map<String,String>> selectSchedulingNotMp(String selectTime1, String selectTime2, String orderId, String processes, ProductionScheduling productionScheduling);
    Integer selectMaxId();
    Boolean insertSelective(String schedulingId, String orderId, String orderNumber, String processes, Integer schedulingQuantity, LocalDate scheduledStartTime, LocalDate planEndTime, String notes);
    Boolean insertSelective(String schedulingId, String orderId, String orderNumber,String technologyNumber, String processes, Integer schedulingQuantity, LocalDate scheduledStartTime, LocalDate planEndTime, String notes);
    Boolean examineSchedulingMp(String schedulingId, String userName);
@@ -33,5 +33,5 @@
    List<Map<String,String>> selectProcess();
    Integer selectNumberMp(String orderId, String orderNumber, String processes);
//    Integer selectNumberMp(String orderId, String orderNumber, String processes);
}
north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
@@ -187,4 +187,10 @@
        map.put("data", flowCardMapper.selectLastSchedulingMp(selectTime1, selectTime2, flowCard));
        return map;
    }
    public Object flowCardDetailSv(String processId, FlowCard flowCard) {
        Map<String, Object> map = new HashMap<>();
        map.put("data", flowCardMapper.flowCardDetailMp(processId, flowCard));
        return map;
    }
}
north-glass-erp/src/main/java/com/example/erp/service/pp/ProductionSchedulingService.java
@@ -47,9 +47,16 @@
    //首次查询排产数据
    public Map<String, Object> selectLastScheduling(String selectTime1, String selectTime2,ProductionScheduling productionScheduling ) {
    public Map<String, Object> selectLastScheduling(String selectTime1, String selectTime2,String processes,String orderId,ProductionScheduling productionScheduling ) {
        Map<String, Object> map = new HashMap<>();
        map.put("data", productionSchedulingMapper.selectLastSchedulingMp(selectTime1, selectTime2, productionScheduling));
        if(orderId.equals("null")){
            orderId="";
        }
        if (processes.equals("null")){
            processes="";
        }
        map.put("data", productionSchedulingMapper.selectLastSchedulingMp(selectTime1, selectTime2,processes,orderId, productionScheduling));
        map.put("process", productionSchedulingMapper.selectProcess());
        return map;
    }
@@ -84,10 +91,10 @@
        if (!schedulinglist.isEmpty()) {
            for (ProductionScheduling productionScheduling : schedulinglist) {
                //查询已排产工序数量
              Integer num =  productionSchedulingMapper.selectNumberMp(productionScheduling.getOrderId(),productionScheduling.getOrderNumber(),processes);
             // 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());
             productionSchedulingMapper.insertSelective(schedulingId,productionScheduling.getOrderId(),productionScheduling.getOrderNumber(),productionScheduling.getTechnologyNumber(),processes,productionScheduling.getSchedulingQuantity(),productionScheduling.getScheduledStartTime(),productionScheduling.getPlanEndTime(),productionScheduling.getNotes());
                //System.out.println(productionScheduling.getOrderNumber()+"***"+productionScheduling.getTechnologyNumber());
            }
            return true;
        }
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -65,22 +65,22 @@
        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.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}
                    </if>
                    <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''">
                        and c.product_name regexp #{flowCard.orderDetail.productName}
                    </if>
        <if test="flowCard.orderId != null and flowCard.orderId != ''">
            and a.order_id regexp #{flowCard.orderId}
        </if>
        <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}
        </if>
        <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''">
            and c.product_name regexp #{flowCard.orderDetail.productName}
        </if>
                    <if test="flowCard.order.project != null and flowCard.order.project!= ''">
                        and b.project regexp #{flowCard.order.project}
                    </if>
        <if test="flowCard.order.project != null and flowCard.order.project!= ''">
            and b.project regexp #{flowCard.order.project}
        </if>
        group by a.process_Id
@@ -131,7 +131,8 @@
        o.delivery_address
        from sd.`order` as o
        left join sd.order_glass_detail ogd on o.order_id = ogd.order_id
        where o.production_order=2 and ogd.splitting_status=0 and o.create_time between #{selectTime1} and #{selectTime2}
        where o.production_order=2 and ogd.splitting_status=0 and o.create_time between #{selectTime1} and
        #{selectTime2}
        <if test="flowCard.order.orderId != null and flowCard.order.orderId != ''">
            and o.order_id regexp #{flowCard.order.orderId}
@@ -165,7 +166,7 @@
        ;
    </select>
<!--    分架明细查询-->
    <!--    分架明细查询-->
    <select id="detailsSelectMp" resultMap="flowCardMap">
        select od.order_id,
        ogd.production_id,
@@ -174,7 +175,7 @@
        SUM( od.quantity) as quantity,
        SUM(od.compute_gross_area) as compute_gross_area,
        od.perimeter
        from  sd.order_detail as od left join
        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
@@ -199,43 +200,47 @@
    <update id="updateDeleteState">
        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
                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}
        where ogd.order_id = #{orderId}
          and fc.process_id = #{processId}
    </update>
    <!--    删除流程卡-->
    <update id="deleteFlowCardMp">
        delete from flow_card as fc where fc.process_id=#{processId}
        delete
        from flow_card as fc
        where fc.process_id = #{processId}
    </update>
    <!--    分架新增明细查询-->
    <!--resultMap="flowCardMap"-->
    <select id="selectNoCardMp" >
    <select id="selectNoCardMp">
        select
        od.order_number,
        od.order_number AS 'orderNumber',
        od.width,
        od.height,
        od.shape,
        od.quantity,
        od.compute_gross_area,
        p.total_thickness,
        od.quantity as baiscQuantity,
        od.compute_gross_area as 'computeGrossArea',
        p.total_thickness AS 'totalThickness',
        p.thickness,
        od.weight
        from
        sd.order_detail as od
        left join sd.order_glass_detail as ogd on od.order_id=ogd.order_id and od.order_number=ogd.order_number
        left join 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
        select od.order_number,
               od.order_number       AS 'orderNumber',
               od.width,
               od.height,
               od.shape,
               od.quantity,
               od.compute_gross_area,
               p.total_thickness,
               od.quantity           as baiscQuantity,
               od.compute_gross_area as 'computeGrossArea',
               p.total_thickness     AS 'totalThickness',
               p.thickness,
               od.weight
        from sd.order_detail as od
                 left join sd.order_glass_detail as ogd
                           on od.order_id = ogd.order_id and od.order_number = ogd.order_number
                 left join 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
        order by od.id desc
        order by od.id
    </select>
@@ -246,7 +251,7 @@
        where fc.process_id = #{processId}
    </update>
<!--    查询对应流程卡号排版状态-->
    <!--    查询对应流程卡号排版状态-->
    <select id="selectLayoutStatus">
        select fc.layout_status
        from flow_card as fc
@@ -254,109 +259,148 @@
        LIMIT 1
    </select>
<!--    查询报工表内是否有对应流程卡-->
    <!--    查询报工表内是否有对应流程卡-->
    <select id="reportingWorkCount">
        select COUNT(rw.process_id)
        from reporting_work as rw
        where rw.process_id = #{processId}
    </select>
<!--    插入Flow_card表-->
    <!--    插入Flow_card表-->
    <insert id="addFlowCardMp">
        insert into
            flow_card (
            order_id,
            production_id,
            process_id,
            landing_sequence,
            order_number,
            technology_number,
            quantity,
            founder,
            layers_number,
            splitFrame_time,
            create_time
        )
        select
            ogd.order_id,
            ogd.production_id,
            #{processId},
            #{landingSequence},
            ogd.order_number,
            ogd.technology_number,
            #{quantity},
            #{userName},
            #{layer},
            NOW(),
            NOW()
        insert into flow_card (order_id,
                               production_id,
                               process_id,
                               landing_sequence,
                               order_number,
                               technology_number,
                               quantity,
                               founder,
                               layers_number,
                               splitFrame_time,
                               create_time)
        select ogd.order_id,
               ogd.production_id,
               #{processId},
               #{landingSequence},
               ogd.order_number,
               ogd.technology_number,
               #{quantity},
               #{userName},
               #{layer},
               NOW(),
               NOW()
        from sd.order_glass_detail as ogd
        where ogd.production_id=#{productionId} and ogd.order_number=#{orderNumber}
        where ogd.production_id = #{productionId}
          and ogd.order_number = #{orderNumber}
        GROUP BY ogd.technology_number
    </insert>
<!--    更新分架状态-->
    <!--    更新分架状态-->
    <update id="updateFlowState">
        update sd.order_glass_detail as ogd
        set ogd.splitting_status=1
        where ogd.production_id=#{productionId} and ogd.order_number=#{orderNumber}
        where ogd.production_id = #{productionId}
          and ogd.order_number = #{orderNumber}
    </update>
<!--    查询未分架的条数-->
    <!--    查询未分架的条数-->
    <select id="selectFlowCount">
        select COUNT(*)
        from sd.order_glass_detail as ogd
        where ogd.order_id = left(#{productionId},10)
        where ogd.order_id = left(#{productionId}, 10)
          and ogd.splitting_status = 0
    </select>
<!--   修改订单表分架状态-->
    <!--   修改订单表分架状态-->
    <update id="updateProcessingCard">
        update sd.`order` as o
        set o.processing_card=#{state}
        where o.order_id=left(#{productionId},10)
        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 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
        order by ps.id desc
    </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
        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}
          and ogd.order_number = #{orderNumber}
    </select>
<!--  查询该订单流程卡条数  -->
    <!--  查询该订单流程卡条数  -->
    <select id="selectFlowCardCount">
        select COUNT(*) from flow_card where order_id=#{orderId}
        select COUNT(*)
        from flow_card
        where order_id = #{orderId}
    </select>
    <select id="flowCardDetailMp">
        select fc.order_id,
               fc.process_id,
               fc.order_number,
               fc.quantity,
               round(ogd.child_width * ogd.child_height * fc.quantity / 1000000, 2) as area,
               od.product_name,
               fc.founder,
               fc.splitFrame_time
        from flow_card as fc
                 left join sd.order_glass_detail as ogd
                           on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and
                              fc.technology_number = ogd.technology_number
                 left join sd.order_detail as od on od.order_id = ogd.order_id and od.order_number = ogd.order_number
        where fc.process_id = #{processId}
        GROUP BY fc.order_id, fc.process_id, fc.order_number
    </select>
</mapper>
north-glass-erp/src/main/resources/mapper/pp/ProductionScheduling.xml
@@ -91,7 +91,7 @@
               od.quantity,
               round(od.width * od.height * od.quantity / 1000000, 2) as area,
               ps.scheduling_quantity,
               (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) as pendingProductionQuantity,
               (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) as scheduling_quantity,
               round(od.width * od.height * (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000, 2)
                                                                      as pendingProductionArea,
               IFNULL(ps.scheduling_quantity, 0)                      as productionScheduledQuantity,
@@ -115,62 +115,77 @@
    </select>
    <!--    查询未排产数据-->
    <select id="selectNoSchedulingMp">
        select od.order_id,
        select ogd.order_id,
               o.customer_name,
               o.project,
               od.order_number,
               od.width,
               od.height,
               ogd.order_number,
               ogd.technology_number,
               ogd.child_width,
               ogd.child_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,
               IFNULL(ps.scheduling_quantity, 0)                      as productionScheduledQuantity,
               round(od.width * od.height * (IFNULL(ps.scheduling_quantity, 0)) / 1000000,
               round(ogd.child_width * ogd.child_height * od.quantity / 1000000, 2) as area,
               (od.quantity - IFNULL((ps.schedulingQuantity), 0)) as scheduling_quantity,
               (od.quantity - IFNULL((ps.schedulingQuantity), 0)) as pendingProductionQuantity,
               round(ogd.child_width * ogd.child_height * (od.quantity - IFNULL((ps.schedulingQuantity), 0)) / 1000000, 2)
                                                                                    as pendingProductionArea,
               IFNULL(ps.schedulingQuantity, 0)                      as productionScheduledQuantity,
               round(ogd.child_width * ogd.child_height * (IFNULL(ps.schedulingQuantity, 0)) / 1000000,
                     2)                                               as productionScheduledArea,
               od.product_name,
               ogd.glass_child,
               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}
        from sd.order_glass_detail as ogd
          and position(#{orderId} in ps.order_id)
          and position(#{processes} in ps.processes)
                 left join sd.order as o on ogd.order_id = o.order_id
                 left join sd.order_detail as od on od.order_id=ogd.order_id and od.order_number=ogd.order_number
                 left join sd.order_process_detail as opd on opd.order_id=ogd.order_id and opd.order_number=ogd.order_number and opd.technology_number=ogd.technology_number
                 left join
             (select order_id,order_number,technology_number,SUM(scheduling_quantity) as schedulingQuantity from production_scheduling where processes=#{processes} group by order_id,order_number,technology_number) as ps on ps.order_id = ogd.order_id and ps.order_number = ogd.order_number and ps.technology_number=ogd.technology_number
        group by od.order_id, od.order_number
        order by ps.id desc
        where (od.quantity - IFNULL((ps.schedulingQuantity), 0)) > 0
          and od.create_time between #{selectTime1} and #{selectTime2} and opd.reporting_work_num_count=0
          and position(#{orderId} in ogd.order_id)
--           and position("切割" in ps.processes)
        group by ogd.order_id, ogd.order_number,ogd.technology_number
        order by ogd.order_id desc
    </select>
    <!--    首次查询排产数据-->
    <select id="selectLastSchedulingMp">
        select od.order_id,
        select ogd.order_id,
               o.customer_name,
               o.project,
               od.order_number,
               od.width,
               od.height,
               ogd.order_number,
               ogd.technology_number,
               ogd.child_width,
               ogd.child_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,
               IFNULL(sum(ps.scheduling_quantity), 0)                 as productionScheduledQuantity,
               round(od.width * od.height * (IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000,
               round(ogd.child_width * ogd.child_height * od.quantity / 1000000, 2) as area,
               (od.quantity - IFNULL((ps.schedulingQuantity), 0)) as scheduling_quantity,
               (od.quantity - IFNULL((ps.schedulingQuantity), 0)) as pendingProductionQuantity,
               round(ogd.child_width * ogd.child_height * (od.quantity - IFNULL((ps.schedulingQuantity), 0)) / 1000000, 2)
                                                                                    as pendingProductionArea,
               IFNULL(ps.schedulingQuantity, 0)                      as productionScheduledQuantity,
               round(ogd.child_width * ogd.child_height * (IFNULL(ps.schedulingQuantity, 0)) / 1000000,
                     2)                                               as productionScheduledArea,
               od.product_name,
               ogd.glass_child,
               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
        from sd.order_glass_detail as ogd
        group by od.order_id, od.order_number
        order by ps.id desc
                 left join sd.order as o on ogd.order_id = o.order_id
                 left join sd.order_detail as od on od.order_id=ogd.order_id and od.order_number=ogd.order_number
                 left join sd.order_process_detail as opd on opd.order_id=ogd.order_id and opd.order_number=ogd.order_number and opd.technology_number=ogd.technology_number
                 left join
             (select order_id,order_number,technology_number,SUM(scheduling_quantity) as schedulingQuantity from production_scheduling where processes=#{processes} group by order_id,order_number,technology_number) as ps on ps.order_id = ogd.order_id and ps.order_number = ogd.order_number and ps.technology_number=ogd.technology_number
        where (od.quantity - IFNULL((ps.schedulingQuantity), 0)) > 0
          and od.create_time between #{selectTime1} and #{selectTime2} and opd.reporting_work_num_count=0
          and position(#{orderId} in ogd.order_id)
--           and position("切割" in ps.processes)
        group by ogd.order_id, ogd.order_number,ogd.technology_number
        order by ogd.order_id desc
    </select>
    <select id="selectMaxId">
@@ -183,6 +198,7 @@
        insert into production_scheduling(scheduling_id,
                                          order_id,
                                          order_number,
                                          technology_number,
                                          processes,
                                          scheduling_quantity,
                                          scheduled_start_time,
@@ -192,6 +208,7 @@
        VALUES (#{schedulingId},
                #{orderId},
                #{orderNumber},
                #{technologyNumber},
                #{processes},
                #{schedulingQuantity},
                #{scheduledStartTime},
north-glass-erp/target/classes/mapper/pp/FolwCard.xml
@@ -65,22 +65,22 @@
        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.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}
                    </if>
                    <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''">
                        and c.product_name regexp #{flowCard.orderDetail.productName}
                    </if>
        <if test="flowCard.orderId != null and flowCard.orderId != ''">
            and a.order_id regexp #{flowCard.orderId}
        </if>
        <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}
        </if>
        <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''">
            and c.product_name regexp #{flowCard.orderDetail.productName}
        </if>
                    <if test="flowCard.order.project != null and flowCard.order.project!= ''">
                        and b.project regexp #{flowCard.order.project}
                    </if>
        <if test="flowCard.order.project != null and flowCard.order.project!= ''">
            and b.project regexp #{flowCard.order.project}
        </if>
        group by a.process_Id
@@ -131,7 +131,8 @@
        o.delivery_address
        from sd.`order` as o
        left join sd.order_glass_detail ogd on o.order_id = ogd.order_id
        where o.production_order=2 and ogd.splitting_status=0 and o.create_time between #{selectTime1} and #{selectTime2}
        where o.production_order=2 and ogd.splitting_status=0 and o.create_time between #{selectTime1} and
        #{selectTime2}
        <if test="flowCard.order.orderId != null and flowCard.order.orderId != ''">
            and o.order_id regexp #{flowCard.order.orderId}
@@ -165,7 +166,7 @@
        ;
    </select>
<!--    分架明细查询-->
    <!--    分架明细查询-->
    <select id="detailsSelectMp" resultMap="flowCardMap">
        select od.order_id,
        ogd.production_id,
@@ -174,7 +175,7 @@
        SUM( od.quantity) as quantity,
        SUM(od.compute_gross_area) as compute_gross_area,
        od.perimeter
        from  sd.order_detail as od left join
        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
@@ -199,43 +200,47 @@
    <update id="updateDeleteState">
        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
                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}
        where ogd.order_id = #{orderId}
          and fc.process_id = #{processId}
    </update>
    <!--    删除流程卡-->
    <update id="deleteFlowCardMp">
        delete from flow_card as fc where fc.process_id=#{processId}
        delete
        from flow_card as fc
        where fc.process_id = #{processId}
    </update>
    <!--    分架新增明细查询-->
    <!--resultMap="flowCardMap"-->
    <select id="selectNoCardMp" >
    <select id="selectNoCardMp">
        select
        od.order_number,
        od.order_number AS 'orderNumber',
        od.width,
        od.height,
        od.shape,
        od.quantity,
        od.compute_gross_area,
        p.total_thickness,
        od.quantity as baiscQuantity,
        od.compute_gross_area as 'computeGrossArea',
        p.total_thickness AS 'totalThickness',
        p.thickness,
        od.weight
        from
        sd.order_detail as od
        left join sd.order_glass_detail as ogd on od.order_id=ogd.order_id and od.order_number=ogd.order_number
        left join 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
        select od.order_number,
               od.order_number       AS 'orderNumber',
               od.width,
               od.height,
               od.shape,
               od.quantity,
               od.compute_gross_area,
               p.total_thickness,
               od.quantity           as baiscQuantity,
               od.compute_gross_area as 'computeGrossArea',
               p.total_thickness     AS 'totalThickness',
               p.thickness,
               od.weight
        from sd.order_detail as od
                 left join sd.order_glass_detail as ogd
                           on od.order_id = ogd.order_id and od.order_number = ogd.order_number
                 left join 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
        order by od.id desc
        order by od.id
    </select>
@@ -246,7 +251,7 @@
        where fc.process_id = #{processId}
    </update>
<!--    查询对应流程卡号排版状态-->
    <!--    查询对应流程卡号排版状态-->
    <select id="selectLayoutStatus">
        select fc.layout_status
        from flow_card as fc
@@ -254,109 +259,148 @@
        LIMIT 1
    </select>
<!--    查询报工表内是否有对应流程卡-->
    <!--    查询报工表内是否有对应流程卡-->
    <select id="reportingWorkCount">
        select COUNT(rw.process_id)
        from reporting_work as rw
        where rw.process_id = #{processId}
    </select>
<!--    插入Flow_card表-->
    <!--    插入Flow_card表-->
    <insert id="addFlowCardMp">
        insert into
            flow_card (
            order_id,
            production_id,
            process_id,
            landing_sequence,
            order_number,
            technology_number,
            quantity,
            founder,
            layers_number,
            splitFrame_time,
            create_time
        )
        select
            ogd.order_id,
            ogd.production_id,
            #{processId},
            #{landingSequence},
            ogd.order_number,
            ogd.technology_number,
            #{quantity},
            #{userName},
            #{layer},
            NOW(),
            NOW()
        insert into flow_card (order_id,
                               production_id,
                               process_id,
                               landing_sequence,
                               order_number,
                               technology_number,
                               quantity,
                               founder,
                               layers_number,
                               splitFrame_time,
                               create_time)
        select ogd.order_id,
               ogd.production_id,
               #{processId},
               #{landingSequence},
               ogd.order_number,
               ogd.technology_number,
               #{quantity},
               #{userName},
               #{layer},
               NOW(),
               NOW()
        from sd.order_glass_detail as ogd
        where ogd.production_id=#{productionId} and ogd.order_number=#{orderNumber}
        where ogd.production_id = #{productionId}
          and ogd.order_number = #{orderNumber}
        GROUP BY ogd.technology_number
    </insert>
<!--    更新分架状态-->
    <!--    更新分架状态-->
    <update id="updateFlowState">
        update sd.order_glass_detail as ogd
        set ogd.splitting_status=1
        where ogd.production_id=#{productionId} and ogd.order_number=#{orderNumber}
        where ogd.production_id = #{productionId}
          and ogd.order_number = #{orderNumber}
    </update>
<!--    查询未分架的条数-->
    <!--    查询未分架的条数-->
    <select id="selectFlowCount">
        select COUNT(*)
        from sd.order_glass_detail as ogd
        where ogd.order_id = left(#{productionId},10)
        where ogd.order_id = left(#{productionId}, 10)
          and ogd.splitting_status = 0
    </select>
<!--   修改订单表分架状态-->
    <!--   修改订单表分架状态-->
    <update id="updateProcessingCard">
        update sd.`order` as o
        set o.processing_card=#{state}
        where o.order_id=left(#{productionId},10)
        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 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
        order by ps.id desc
    </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
        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}
          and ogd.order_number = #{orderNumber}
    </select>
<!--  查询该订单流程卡条数  -->
    <!--  查询该订单流程卡条数  -->
    <select id="selectFlowCardCount">
        select COUNT(*) from flow_card where order_id=#{orderId}
        select COUNT(*)
        from flow_card
        where order_id = #{orderId}
    </select>
    <select id="flowCardDetailMp">
        select fc.order_id,
               fc.process_id,
               fc.order_number,
               fc.quantity,
               round(ogd.child_width * ogd.child_height * fc.quantity / 1000000, 2) as area,
               od.product_name,
               fc.founder,
               fc.splitFrame_time
        from flow_card as fc
                 left join sd.order_glass_detail as ogd
                           on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and
                              fc.technology_number = ogd.technology_number
                 left join sd.order_detail as od on od.order_id = ogd.order_id and od.order_number = ogd.order_number
        where fc.process_id = #{processId}
        GROUP BY fc.order_id, fc.process_id, fc.order_number
    </select>
</mapper>
north-glass-erp/target/classes/mapper/pp/ProductionScheduling.xml
@@ -91,7 +91,7 @@
               od.quantity,
               round(od.width * od.height * od.quantity / 1000000, 2) as area,
               ps.scheduling_quantity,
               (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) as pendingProductionQuantity,
               (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) as scheduling_quantity,
               round(od.width * od.height * (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000, 2)
                                                                      as pendingProductionArea,
               IFNULL(ps.scheduling_quantity, 0)                      as productionScheduledQuantity,
@@ -115,62 +115,77 @@
    </select>
    <!--    查询未排产数据-->
    <select id="selectNoSchedulingMp">
        select od.order_id,
        select ogd.order_id,
               o.customer_name,
               o.project,
               od.order_number,
               od.width,
               od.height,
               ogd.order_number,
               ogd.technology_number,
               ogd.child_width,
               ogd.child_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,
               IFNULL(ps.scheduling_quantity, 0)                      as productionScheduledQuantity,
               round(od.width * od.height * (IFNULL(ps.scheduling_quantity, 0)) / 1000000,
               round(ogd.child_width * ogd.child_height * od.quantity / 1000000, 2) as area,
               (od.quantity - IFNULL((ps.schedulingQuantity), 0)) as scheduling_quantity,
               (od.quantity - IFNULL((ps.schedulingQuantity), 0)) as pendingProductionQuantity,
               round(ogd.child_width * ogd.child_height * (od.quantity - IFNULL((ps.schedulingQuantity), 0)) / 1000000, 2)
                                                                                    as pendingProductionArea,
               IFNULL(ps.schedulingQuantity, 0)                      as productionScheduledQuantity,
               round(ogd.child_width * ogd.child_height * (IFNULL(ps.schedulingQuantity, 0)) / 1000000,
                     2)                                               as productionScheduledArea,
               od.product_name,
               ogd.glass_child,
               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}
        from sd.order_glass_detail as ogd
          and position(#{orderId} in ps.order_id)
          and position(#{processes} in ps.processes)
                 left join sd.order as o on ogd.order_id = o.order_id
                 left join sd.order_detail as od on od.order_id=ogd.order_id and od.order_number=ogd.order_number
                 left join sd.order_process_detail as opd on opd.order_id=ogd.order_id and opd.order_number=ogd.order_number and opd.technology_number=ogd.technology_number
                 left join
             (select order_id,order_number,technology_number,SUM(scheduling_quantity) as schedulingQuantity from production_scheduling where processes=#{processes} group by order_id,order_number,technology_number) as ps on ps.order_id = ogd.order_id and ps.order_number = ogd.order_number and ps.technology_number=ogd.technology_number
        group by od.order_id, od.order_number
        order by ps.id desc
        where (od.quantity - IFNULL((ps.schedulingQuantity), 0)) > 0
          and od.create_time between #{selectTime1} and #{selectTime2} and opd.reporting_work_num_count=0
          and position(#{orderId} in ogd.order_id)
--           and position("切割" in ps.processes)
        group by ogd.order_id, ogd.order_number,ogd.technology_number
        order by ogd.order_id desc
    </select>
    <!--    首次查询排产数据-->
    <select id="selectLastSchedulingMp">
        select od.order_id,
        select ogd.order_id,
               o.customer_name,
               o.project,
               od.order_number,
               od.width,
               od.height,
               ogd.order_number,
               ogd.technology_number,
               ogd.child_width,
               ogd.child_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,
               IFNULL(sum(ps.scheduling_quantity), 0)                 as productionScheduledQuantity,
               round(od.width * od.height * (IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000,
               round(ogd.child_width * ogd.child_height * od.quantity / 1000000, 2) as area,
               (od.quantity - IFNULL((ps.schedulingQuantity), 0)) as scheduling_quantity,
               (od.quantity - IFNULL((ps.schedulingQuantity), 0)) as pendingProductionQuantity,
               round(ogd.child_width * ogd.child_height * (od.quantity - IFNULL((ps.schedulingQuantity), 0)) / 1000000, 2)
                                                                                    as pendingProductionArea,
               IFNULL(ps.schedulingQuantity, 0)                      as productionScheduledQuantity,
               round(ogd.child_width * ogd.child_height * (IFNULL(ps.schedulingQuantity, 0)) / 1000000,
                     2)                                               as productionScheduledArea,
               od.product_name,
               ogd.glass_child,
               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
        from sd.order_glass_detail as ogd
        group by od.order_id, od.order_number
        order by ps.id desc
                 left join sd.order as o on ogd.order_id = o.order_id
                 left join sd.order_detail as od on od.order_id=ogd.order_id and od.order_number=ogd.order_number
                 left join sd.order_process_detail as opd on opd.order_id=ogd.order_id and opd.order_number=ogd.order_number and opd.technology_number=ogd.technology_number
                 left join
             (select order_id,order_number,technology_number,SUM(scheduling_quantity) as schedulingQuantity from production_scheduling where processes=#{processes} group by order_id,order_number,technology_number) as ps on ps.order_id = ogd.order_id and ps.order_number = ogd.order_number and ps.technology_number=ogd.technology_number
        where (od.quantity - IFNULL((ps.schedulingQuantity), 0)) > 0
          and od.create_time between #{selectTime1} and #{selectTime2} and opd.reporting_work_num_count=0
          and position(#{orderId} in ogd.order_id)
--           and position("切割" in ps.processes)
        group by ogd.order_id, ogd.order_number,ogd.technology_number
        order by ogd.order_id desc
    </select>
    <select id="selectMaxId">
@@ -183,6 +198,7 @@
        insert into production_scheduling(scheduling_id,
                                          order_id,
                                          order_number,
                                          technology_number,
                                          processes,
                                          scheduling_quantity,
                                          scheduled_start_time,
@@ -192,6 +208,7 @@
        VALUES (#{schedulingId},
                #{orderId},
                #{orderNumber},
                #{technologyNumber},
                #{processes},
                #{schedulingQuantity},
                #{scheduledStartTime},
north-glass-erp/target/classes/mapper/sd/Delivery.xml
@@ -122,7 +122,7 @@
                and fgi.quantity_available REGEXP #{order.finishedGoodsInventory.quantityAvailable}
            </if>
        </where>
        group by o.order_id
        group by o.order_id order by o.id desc
        limit #{offset},#{pageSize};
    </select>
north-glass-erp/target/classes/mapper/sd/DeliveryDetail.xml
@@ -192,6 +192,7 @@
            </if>
        </where>
        order by dd.id desc
        limit #{offset},#{pageSize};
    </select>