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