廖井涛
2024-02-27 926a1e8b90381c7aa085d5462d78de9d2cc6034d
Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
21个文件已修改
1430 ■■■■ 已修改文件
north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue 195 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectAddProcess.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/SplittingDetails.vue 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/product/CreateProduct.vue 374 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/sd/ProductController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/entity/pp/FlowCard.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/entity/sd/ProductDetail.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/sd/ProductDetailMapper.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/sd/ProductMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/WorkOrderService.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/sd/ProductService.java 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml 223 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/sd/ProductDetail.xml 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/pp/FolwCard.xml 222 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/pp/WordOrder.xml 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/sd/ProductDetail.xml 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue
@@ -11,9 +11,12 @@
import Sortable from 'sortablejs'
import BasicTable from '@/components/basic/BasicTable.vue'
import {VXETable} from "vxe-table";
import useUserInfoStore from "@/stores/userInfo";
let productGlassTypeStore = useProductGlassTypeStore()
let router = useRouter()
const userStore = useUserInfoStore()
const username = userStore.user.userName
const getTableRow = (row, type) => {
  switch (type) {
    case 'edit' : {
@@ -39,6 +42,15 @@
  }
}
let flag = $ref(true)
function intoCreateProduct(){
  if(flag){
    router.push(`/main/processCard/SplittingDetails?orderId=${orderId}`)
  }else {
    router.push('/main/processCard/SplittingDetails?orderId=${orderId}')
  }
  flag=!flag
}
//定义时间
const form = reactive({
@@ -74,7 +86,7 @@
    orderNumber: '',
    height: '',
    computeGrossArea: '',
    quantity: '',
    binningQuantity: '',
    shape:'',
    width:'',
    weight:''
@@ -99,7 +111,7 @@
request.post(`/processCard/selectNoCard/${orderId}/${productionId}`, filterData.value).then((res) => {
  if (res.code == 200) {
    //console.log(res.data)
    console.log(res.data)
    pageTotal.value = res.data.total
    produceList = produceList.value.concat(deepClone(res.data.data))
    xGrid.value.reloadData(produceList)
@@ -114,9 +126,11 @@
  // 手动触发筛选
  $panel.changeOption(event, !!option.data, option)
}
function padLeftZero(str) {
  return ('00' + str).substr(str.length)
}
function filterChanged(column) {
  gridOptions.loading = true
  //筛选条件发生变化条件发生变化
@@ -135,6 +149,7 @@
  request.post(`/processCard/selectNoCard/${orderId}/${productionId}`, filterData.value).then((res) => {
    if(res.code==200){
      pageTotal.value=res.data.total
      produceList = deepClone(res.data.data)
      xGrid.value.loadData(produceList)
@@ -187,8 +202,8 @@
    {field: 'shape',  title: '形状', showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'width', title: '宽', filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'height', title: '高',filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'baiscQuantity', title: '数量', showOverflow:"ellipsis"},
    {field: 'computeGrossArea', title: '面积'},
    {field: 'baiscQuantity', title: '待分数量', showOverflow: "ellipsis"},
    {field: 'computeGrossArea', title: '待分面积'},
    {field: 'totalThickness', title: '总厚度'},
    {field: 'thickness', title: '玻璃厚度'},
    {field: 'weight', title: '重量'}
@@ -204,12 +219,10 @@
    zoom: true,
    custom: true
  },
  data:  [
  ],//table body实际数据
  data: [],//table body实际数据
  //脚部求和
  footerMethod ({ columns, data }) {//页脚函数
    let footList=['总数量','总面积','分箱数']
    let footList = ['baiscQuantity', 'computeGrossArea', 'totalThickness','thickness', 'weight']
    return[
      columns.map((column, columnIndex) => {
        if (columnIndex === 0) {
@@ -259,7 +272,13 @@
  columns:[
    {type: 'checkbox', fixed: "left", title: '选择'},
    {field: 'processId', title: '流程卡号',filters:[{ data: '' }],slots: { filter: 'num1_filter' },width:130 },
    {field: 'orderNumber',  title: '订序', showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {
      field: 'orderNumber',
      title: '订序',
      showOverflow: "ellipsis",
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'}
    },
    {field: 'landingSequence', title: '落架顺序', filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'shape', title: '形状',filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'width', title: '宽', showOverflow:"ellipsis"},
@@ -269,18 +288,16 @@
  ],//表头按钮
  toolbarConfig: {
    // buttons: [{
    //
    // }],
    buttons: [
      {code: 'saveFlowCard', name: '保存', status: 'primary', icon: 'vxe-icon-save'},
    ],
    import: false,
    export: true,
    print: true,
    zoom: true,
    custom: true
  },
  data:  [
  ],//table body实际数据
  data: [],//table body实际数据
  //脚部求和
  footerMethod ({ columns, data }) {//页脚函数
    let footList=['总数量','总面积','分箱数']
@@ -385,21 +402,127 @@
      })
    }
  }
  catch (e){
  } catch (e) {
    ElMessage.warning(e.message)
  }
}
//向左边表格添加数据
const addLeft =   () => {
  try {
    //左边表格定义
    const $gridLeft = xGridLeft.value
    //右边表格定义
    const $grid = xGrid.value
    //获取右边表格checkbox选中的数据
    const checkedList = $grid.getCheckboxRecords()
    //获取左边表格checkbox选中的数据
    const checkedListLeft = $gridLeft.getCheckboxRecords()
    //判断右边表格是否有选中的数据
    if (checkedList.length === 0) {
      ElMessage.warning("请先选择右侧数据")
      return
    }
    if (checkedListLeft.length !== 1) {
      ElMessage.warning("请先选择左侧一条数据")
      return
    }
    const regex = /^(\d+|)$/;
    if (!regex.test(checkedNum.value)) {
      ElMessage.warning("请输入正整数")
      return
    }
    //判断正整数
    if (/^[1-9]\d*$/.test(checkedNum.value)) {
      checkedList.forEach((item) => {
        //判断可用数量是否大于等于输入的数量,不满足则抛出异常
        if (item.baiscQuantity < checkedNum.value) throw new Error("请输入小于等于可用数量的数字");
        item.baiscQuantity = item.baiscQuantity - checkedNum.value
        //左边表格数据
        let leftData = $gridLeft.getTableData().fullData
        //左边表格数据中查找当前数据下标
        let filterIndex = leftData.findIndex(item1 => item1.orderNumber === item.orderNumber)
        //如果右边表格数据中存在当前数据则数量相加
        if (filterIndex >= 0) {
          leftData[filterIndex].quantity = leftData[filterIndex].quantity * 1 + checkedNum.value * 1
          if (item.baiscQuantity === 0) {
            $grid.remove(checkedList)
          }
        } else {
          item.quantity = checkedNum.value
          item.processId = checkedListLeft[0].processId
          item.landingSequence = checkedListLeft[0].landingSequence
          $gridLeft.insert(item)
        }
      })
    } else if (checkedNum.value === '') {//判断数量输入框有无输入数字
      checkedList.forEach((item) => {
        item.processId = checkedListLeft[0].processId
        item.landingSequence = checkedListLeft[0].landingSequence
      })
      $gridLeft.insertAt(checkedList)
      $grid.remove(checkedList)
    }
  } catch (e) {
    ElMessage.warning(e.message)
  }
}
//保存流程卡数据
const gridEvents = {
  toolbarButtonClick({code}) {
    const $grid = xGridLeft.value
    if ($grid) {
      switch (code) {
        case 'saveFlowCard': {
          const $table = xGridLeft.value
          const $tableRight = xGrid.value
          if ($table) {
            const selectRecords = $table.getCheckboxRecords()
            const selectRight = $tableRight.getCheckboxRecords()
            if (selectRecords.length === 0){
              ElMessage.warning("请先选择保存的数据")
              return
            }
            if (selectRight.length > 0){
              ElMessage.warning("请先将右侧数据全部建立流程卡后保存")
              return;
            }
            //console.log(selectRecords[0].quantity)
            let flowCardData = ref({
              flowCard: selectRecords,
              userName:username,
              productionId:productionId
            })
           console.log(flowCardData.value)
            request.post("/processCard/addFlowCard", flowCardData.value).then((res) => {
              if (res.code == 200) {
                ElMessage.success("保存成功")
                location.reload();
              } else {
                ElMessage.warning(res.msg)
                router.push("/login")
              }
            })
          }
          return;
}
      }
    }
  },
}
</script>
<template>
  <div>
    <div class="common-layout" style="height: 100%">
    <div class="header">
      <el-button
@@ -411,20 +534,21 @@
          round >
        {{flag?'返回':'返回'}}
      </el-button>
      <el-button type="primary">保存分架</el-button>
      <el-button type="primary">分架汇总</el-button>
      <el-button type="primary">左侧全选</el-button>
      <el-button type="primary">右侧全选</el-button>
        <!--      <el-button  type="primary">保存分架</el-button>-->
<!--              <el-button type="primary" :hidden="true">分架汇总</el-button>-->
        <div style="width: 100px;">
    </div>
    <div class="common-layout">
      <el-container height="100%">
        <el-aside width="44%" style="">
      </div>
      <el-container height="600px">
        <el-aside width="44%" >
          <vxe-grid
              max-height="100%"
              @filter-change="filterChanged"
              class="mytable-scrollbar"
              ref="xGridLeft"
              v-bind="gridLeftOptions"
              v-on="gridEvents"
          >
            <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
            <!--      下拉显示所有信息插槽-->
@@ -432,7 +556,9 @@
              <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-if="hasDecimal(item.field)">{{
                      row[item.field.split('.')[0]][item.field.split('.')[1]]
                    }}</span>
                  <span v-else>{{ row[item.field] }}</span>
                </li>
              </ul>
@@ -457,8 +583,6 @@
        </el-aside>
        <el-main width="12%" style="">
          <span>未分数量:45</span><br>
          <span>未分重量:333</span><br>
          <span>选中数量:<el-input type="number" v-model="checkedNum"></el-input></span><br>
          <el-button type="primary" @click="addRight"> → </el-button>
          <br>
@@ -469,10 +593,10 @@
          <el-button @click="createProcessCard" type="primary">建立流程卡</el-button>
        </el-main>
        <el-aside width="44%" style="">
        <el-aside width="45%" height="500px" style="">
          <vxe-grid
              max-height="100%"
              max-height="97%"
              @filter-change="filterChanged"
              class="mytable-scrollbar"
              ref="xGrid"
@@ -484,7 +608,9 @@
              <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-if="hasDecimal(item.field)">{{
                      row[item.field.split('.')[0]][item.field.split('.')[1]]
                    }}</span>
                  <span v-else>{{ row[item.field] }}</span>
                </li>
              </ul>
@@ -516,6 +642,12 @@
  height: 100%;
}
.header{
  width: 100%;
  height: 35px;
  margin-top: -20px;
}
.el-aside{
  height: 100%;
}
@@ -524,7 +656,6 @@
  height: 100%;
  text-align: center;
}
</style>
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectAddProcess.vue
@@ -205,16 +205,16 @@
    {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
    {title: '操作', width: 80, slots: { default: 'button_slot' },fixed:"left"},
    { type: 'seq',fixed:"left", title: '自序', width: 50 },
    {field: 'order.orderId',  title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, },
    {field: 'order.customerName', title: '客户名称', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'order.project', title: '项目名称', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'order.batch', title: '批次',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'order.otherRemarks', title: '原片要求', sortable: true,showOverflow:"ellipsis"},
    {field: 'order.icon', title: '商标选项', sortable: true},
    {field: 'order.orderType', title: '订单类型', sortable: true},
    {field: 'order.salesman', title: '业务员', sortable: true},
    {field: 'order.processingNote', title: '加工要求', sortable: true,showOverflow:"ellipsis"},
    {field: 'order.deliveryAddress', title: '送货地址', sortable: true},
    {field: 'order.orderId',  title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' } , },
    {field: 'order.customerName', title: '客户名称',showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'order.project', title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'order.batch', title: '批次',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, },
    {field: 'order.otherRemarks', title: '原片要求' ,showOverflow:"ellipsis",filters:[{ data: '' },],slots: { filter: 'num1_filter' }},
    {field: 'order.icon', title: '商标选项',filters:[{ data: '' }],slots: { filter: 'num1_filter' } },
    {field: 'order.orderType', title: '订单类型',filters:[{ data: '' }],slots: { filter: 'num1_filter' } },
    {field: 'order.salesman', title: '业务员',filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'order.processingNote', title: '加工要求',showOverflow:"ellipsis"},
    {field: 'order.deliveryAddress', title: '送货地址',},
  ],//表头按钮
  toolbarConfig: {
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue
@@ -21,7 +21,15 @@
      break
    }
    case 'setType': {
      alert('我接收到子组件传送的删除信息')
      request.post(`/processCard/updateLayoutStatus/${row.processId}`).then((res) => {
        if (res.code == 200) {
          ElMessage.success("排版成功")
          location.reload();
        } else {
          ElMessage.warning(res.msg)
        }
      })
      break
    }
    case 'delete': {
@@ -222,15 +230,15 @@
    {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
    {title: '操作', width: 140, slots: { default: 'button_slot' },fixed:"left"},
    { type: 'seq',fixed:"left", title: '自序', width: 50 },
    {field: 'orderId', title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, },
    {field: 'processId', width: 130, title: '流程卡号', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'orderDetail.productId', title: '产品编号', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'orderDetail.productName', title: '产品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'order.project', title: '项目名称', sortable: true,showOverflow:"ellipsis"},
    {field: 'binningQuantity', title: '数量', sortable: true},
    {field: 'orderDetail.computeGrossArea', title: '面积', sortable: true},
    {field: 'founder', title: '分架员', sortable: true},
    {field: 'orderDetail.processingNote', title: '加工要求', sortable: true}
    {field: 'orderId', title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, },
    {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: 'order.project', title: '项目名称' ,showOverflow:"ellipsis"},
    {field: 'binningQuantity', title: '数量', },
    {field: 'orderDetail.computeGrossArea', title: '面积', },
    {field: 'founder', title: '分架员', },
    {field: 'orderDetail.processingNote', title: '加工要求', }
  ],//表头按钮
  toolbarConfig: {
@@ -238,8 +246,8 @@
    //
    // }],
    import: false,
    export: true,
    print: true,
    // export: true,
    // print: true,
    zoom: true,
    custom: true
  },
@@ -283,7 +291,11 @@
        />
        &nbsp;&nbsp;
        <el-button type="primary">查询</el-button>
        <el-button
            @click="getWorkOrder"
            id="select"
            type="primary" :icon="Search">查询
        </el-button>
      </el-row>
    </div>
north-glass-erp/northglass-erp/src/views/pp/processCard/SplittingDetails.vue
@@ -45,17 +45,14 @@
let filterData = ref({
  orderGlassDetail: {
    productName: '',
    computeArea: '',
    quantity: '',
    computeGrossArea: '',
    perimeter: '',
    bendRadius: '',
    processingNote: ''
    productionId: '',
  },
  orderDetail:{
    orderDetail:''
    orderId:'',
    productId:'',
    productName:'',
  }
})
//定义页面总页数
@@ -115,11 +112,9 @@
    filterData.value[column.property] = value
  }
//获取选中时间
  let startTime = form.date1[0]
  let endTime = form.date1[1]
  request.post(`/processCard/selectAddProcess/${startTime}/${endTime}`, filterData.value).then((res) => {
console.log(filterData.value)
  request.post(`/processCard/detailsSelect/${id}`, filterData.value).then((res) => {
    if (res.code == 200) {
      pageTotal.value = res.data.total
@@ -172,29 +167,30 @@
    {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
    {title: '操作', width: 80, slots: { default: 'button_slot' },fixed:"left"},
    { type: 'seq',fixed:"left", title: '自序', width: 50 },
    {field: 'orderId',  title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, },
    {field: 'orderGlassDetail.productionId', title: '生产订单号', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'orderDetail.productId', title: '产品编号', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'orderDetail.productName', title: '产品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'orderDetail.quantity', title: '总数量', sortable: true,showOverflow:"ellipsis"},
    {field: 'orderDetail.computeGrossArea', title: '总面积', sortable: true},
    {field: 'orderDetail.perimeter', title: '周长', sortable: true},
    {field: 'orderId',  title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' },  },
    {field: 'orderGlassDetail.productionId', 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.quantity', title: '总数量',showOverflow:"ellipsis"},
    {field: 'orderDetail.computeGrossArea', title: '总面积', },
    {field: 'orderDetail.perimeter', title: '周长',},
  ],//表头按钮
  toolbarConfig: {
    // buttons: [{
    //
    // }],
    import: false,
    export: true,
    print: true,
    // import: false,
    // export: true,
    // print: true,
    zoom: true,
    custom: true
  },
  data: null,//表格数据
  //脚部求和
  footerMethod ({ columns, data }) {//页脚函数
    let footList=['总数量','总面积']
    console.log(columns,data)
    let footList=['data.orderDetail.quantity','data.orderDetail.computeGrossArea']
    return[
      columns.map((column, columnIndex) => {
        if (columnIndex === 0) {
north-glass-erp/northglass-erp/src/views/sd/product/CreateProduct.vue
@@ -1,8 +1,10 @@
<script setup>
import request from "@/utils/request"
import deepClone from "@/utils/deepClone";
import {ElMessage} from "element-plus";
import {ref} from "vue";
import deepClone from "@/utils/deepClone"
import {ElMessage} from "element-plus"
import {computed, ref} from "vue"
import  useUserInfo from "@/stores/userInfo"
let  userInfo = useUserInfo()
const disposeList = $ref([
  '彩釉',
  '蒙砂',
@@ -10,22 +12,6 @@
  '贴膜',
  '喷砂',
  '磨边'
])
let processList = $ref([
    '磨边',
    '镀膜',
    '倒角',
    '清洗',
    '打孔',
    '挖缺',
    '挖槽',
    '水切割',
    '丝印',
    '半钢化',
    '钢化',
    '夹层',
    '中空',
    '包装'
])
let BasicData = ref({
  stuffColor:null,
@@ -56,15 +42,66 @@
  lowE:''
})
let processChecked = ref([])
let hollowBasic = ref({
  thickness:"",
  gasType:"",
  Type:"",
  GlueDepth:""
})
let InterlayerBasic = ref({
  thickness:"",
  color:"",
  type:""
})
let productDetailList = ref([])
let productTotal = ref({
  productName:'',
  creator:userInfo.user.userName
})
//页面加载请求
request.get(`/basicData/BasicDataByType/product`).then((res) => {
  if(res.code==200){
    console.log(res.data)
    BasicData.value = res.data
  }else{
    ElMessage.warning(res.msg)
  }
})
const saveProduct = () => {
  if(productDetailList.value.length===0){
    ElMessage.warning("请添加产品详情")
    return
  }else if(productDetailList.value[productDetailList.value.length-1].detailType!=='glass'){
    ElMessage.warning("产品详情最后一条不是玻璃,请完善")
    return
  }
  let productName = ""
  productDetailList.value.forEach(item =>{
    switch(item.detailType){
      case 'glass' :{
        productName+=item.detail
        break
      }
      case 'Interlayer' :{
        productName+='+'+item.detail
      }
      case 'hollow' :{
        productName+='*'+item.detail
      }
    }
  })
  productTotal.value.productName=productName
  let product = {
    title: productTotal.value,
    detail:productDetailList.value
  }
  request.post(`/product/saveProduct`,product).then((res) =>{
    if(res.code==200){
      ElMessage.success(res.msg)
    }
  })
}
const reset = () => {
  processChecked.value=[]
@@ -72,6 +109,211 @@
    stuff.value[item]=''
  })
}
const glassSure =  () => {
  let childName = ''
  Object.keys(stuff.value).forEach((item,index)=>{
    childName+=stuff.value[item]
  })
  let rege = /^\s*$/
  if(rege.test(childName) || processChecked.value.length===0){
    ElMessage.warning('请输入产品材料属性与工艺属性')
    return
  }
  let productDetail = {
    detailType:'glass',
    detail:childName,
    process:processChecked.value.join('->'),
    separation:Object.assign({}, stuff.value)
  }
  if(glassFlag.value.flag){
    if(productDetailList.value.length ===0 ){
      productDetailList.value.push(productDetail)
    }else{
      if (productDetailList.value[productDetailList.value.length-1].detailType === 'glass') {
        ElMessage.warning('请先选择间隔物')
        return
      }
      productDetailList.value.push(productDetail)
    }
  }else{
    productDetailList.value[glassFlag.value.index] = productDetail
  }
  reset()
}
//添加中空间隔物
const addHollow = () => {
  let childName = ''
  try {
    Object.keys(hollowBasic.value).forEach((item, index) => {
      if (hollowBasic.value[item] === '') {
        throw new Error("请选择全部中空间隔物下拉框")
      }
      childName += hollowBasic.value[item]
    })
  }catch (e){
    ElMessage.warning(e.message)
    return
  }
  let hollowDetail = {
    detailType:'hollow',
    detail:childName,
    separation:Object.assign({}, hollowBasic.value)
  }
  if(hollowFlag.value.flag){
    if (productDetailList.value.length ===0) {
      ElMessage.warning('请先选择产品')
      return
    }else if(productDetailList.value[productDetailList.value.length-1].detailType !== 'glass'){
      ElMessage.warning('请先选择产品')
      return
    }
    productDetailList.value.push(Object.assign({},hollowDetail))
  }else {
    productDetailList.value[hollowFlag.value.index] = hollowDetail
  }
  Object.keys(hollowBasic.value).forEach((item,index)=>{
    hollowBasic.value[item]=''
  })
}
//添加夹层间隔物
const addInterlayer = () => {
  let childName = ''
  try {
    Object.keys(InterlayerBasic.value).forEach((item, index) => {
      if (InterlayerBasic.value[item] === '') {
        throw new Error("请选择全部中空间隔物下拉框")
      }
      childName += InterlayerBasic.value[item]
    })
  }catch (e){
    ElMessage.warning(e.message)
    return
  }
  let InterlayerDetail = {
    detailType:'Interlayer',
    detail:childName,
    separation:Object.assign({}, InterlayerBasic.value)
  }
  if(InterlayerFlag.value.flag){
    if (productDetailList.value.length ===0) {
      ElMessage.warning('请先选择产品')
      return
    }else if(productDetailList.value[productDetailList.value.length-1].detailType !== 'glass'){
      ElMessage.warning('请先选择产品')
      return
    }
    productDetailList.value.push(Object.assign({},InterlayerDetail))
  }else{
    productDetailList.value[InterlayerFlag.value.index] = InterlayerDetail
  }
  Object.keys(InterlayerBasic.value).forEach((item,index)=>{
    InterlayerBasic.value[item]=''
  })
}
const deleteProductDetail =  (index) => {
  const detailType = productDetailList.value[index].detailType
  switch (detailType) {
    case 'glass':{
      glassFlag.value = {
        flag:true,
        index:null
      }
      break
    }
    case 'Interlayer':{
      InterlayerFlag.value = {
        flag:true,
        index:null
      }
      break
    }
    case 'hollow':{
      hollowFlag.value = {
        flag:true,
        index:null
      }
    }
  }
  productDetailList.value.splice(index,1)
}
let glassFlag = ref({
  flag:true,
  index:null
})
const updateGlass = (index) => {
  stuff.value = productDetailList.value[index].separation
  processChecked.value = productDetailList.value[index].process.split("->")
  glassFlag.value.flag=false
  glassFlag.value.index=index
}
const updateGlassSure = ()=> {
  glassSure()
  glassFlag.value.flag=true
  glassFlag.value.index=null
}
let InterlayerFlag = ref({
  flag:true,
  index:null
})
const updateInterlayer  = (index) => {
  InterlayerBasic.value = productDetailList.value[index].separation
  InterlayerFlag.value.flag=false
  InterlayerFlag.value.index=index
}
const updateInterlayerSure = () => {
  addInterlayer()
  InterlayerFlag.value.flag=true
  InterlayerFlag.value.index=null
}
let  hollowFlag = ref({
  flag:true,
  index:null
})
const updateHollow = (index) => {
  hollowBasic.value = productDetailList.value[index].separation
  hollowFlag.value.flag=false
  hollowFlag.value.index=index
}
const updateHollowSure = () => {
  addHollow()
  hollowFlag.value.flag=true
  hollowFlag.value.index=null
}
const productName = computed(() =>{
  let productName = ""
  productDetailList.value.forEach(item =>{
    switch(item.detailType){
      case 'glass' :{
        productName+=item.detail
        break
      }
      case 'Interlayer' :{
        productName+='+'+item.detail
      }
      case 'hollow' :{
        productName+='*'+item.detail
      }
    }
  })
  return productName
})
</script>
<template>
@@ -180,6 +422,7 @@
      <div class="glass-spacer">
        <div class="glass-spacer-jc">
          <el-select
              v-model="hollowBasic.thickness"
              size="small"
              style="width: 100px"
              clearable placeholder="*中空厚度:" >
@@ -190,6 +433,7 @@
            />
          </el-select>
          <el-select
              v-model="hollowBasic.gasType"
              size="small"
              style="width: 100px"
              clearable placeholder="*充气方式:" >
@@ -200,6 +444,7 @@
            />
          </el-select>
          <el-select
              v-model="hollowBasic.Type"
              size="small"
              style="width: 100px"
              clearable placeholder="*封胶:" >
@@ -210,6 +455,7 @@
            />
          </el-select>
          <el-select
              v-model="hollowBasic.GlueDepth"
              size="small"
              style="width: 100px"
              clearable placeholder="*默认胶深:" >
@@ -220,13 +466,21 @@
            />
          </el-select>
          <el-button
              v-if="hollowFlag.flag"
              @click="addHollow"
              size="small"
              type="primary"
              round>中空间隔物</el-button>
          <el-button
              v-else
              @click="updateHollowSure"
              size="small"
              type="primary"
              round>夹层间隔物修改</el-button>
        </div>
        <div class="glass-spacer-zk">
          <el-select
              v-model="InterlayerBasic.thickness"
              size="small"
              style="width: 100px"
              clearable placeholder="*夹层厚度:" >
@@ -237,6 +491,7 @@
            />
          </el-select>
          <el-select
              v-model="InterlayerBasic.type"
              size="small"
              style="width: 100px"
              clearable placeholder="*类型:" >
@@ -247,6 +502,7 @@
            />
          </el-select>
          <el-select
              v-model="InterlayerBasic.color"
              size="small"
              style="width: 100px"
              clearable placeholder="*颜色:" >
@@ -257,10 +513,19 @@
            />
          </el-select>
          <el-button
              v-if="InterlayerFlag.flag"
              @click="addInterlayer"
              size="small"
              type="primary"
              style="margin-left: 100px"
              round>夹层间隔物</el-button>
          <el-button
              v-else
              @click="updateInterlayerSure"
              size="small"
              type="primary"
              style="margin-left: 100px"
              round>夹层间隔物修改</el-button>
        </div>
      </div>
      <div class="line"/>
@@ -302,10 +567,16 @@
            </el-col>
            <el-col :span="3">
              <div class="grid-content ep-bg-purple" >
                <el-button
                <el-button v-if="glassFlag.flag"
                    @click="glassSure"
                    size="small"
                    type="primary"
                    round>确认</el-button>
                <el-button v-else
                           @click="updateGlassSure"
                           size="small"
                           type="primary"
                           round>修改</el-button>
              </div>
            </el-col>
          </el-row>
@@ -368,64 +639,57 @@
          </el-col>
          <el-col :span="20">
            <div class="grid-content ep-bg-purple" >
              <el-input size="large" disabled  />
              <el-input :value="productName" size="large" disabled  />
            </div>
          </el-col>
        </el-row>
      </div>
      <div class="glass-part-detail">
        <el-row style="width: 90%" >
          <el-col :span="4">
        <el-row style="width: 90%"  v-for="(item,index) in productDetailList">
          <el-col :span="4" v-show="item.detailType === 'glass'">
            <el-button
                @click = "updateGlass(index)"
                size="small"
                type="primary"
                round>修改玻璃</el-button>
                type="primary">修改玻璃</el-button>
          </el-col>
          <el-col :span="4" v-show="item.detailType === 'Interlayer'">
            <el-button
                @click = "updateInterlayer(index)"
                size="small"
                type="primary">修改夹层</el-button>
          </el-col>
          <el-col :span="4" v-show="item.detailType === 'hollow'">
            <el-button
                @click = "updateHollow(index)"
                size="small"
                type="primary">修改中空</el-button>
          </el-col>
          <el-col :span="16">
            <el-input
                :value="item.detail"
                value="5mm白玻"
                size="small"
                disabled  />
          </el-col>
        </el-row>
        <el-row style="width: 90%" >
          <el-col :span="4">
          <el-col
              v-show="index+1 === productDetailList.length"
              :span="4">
            <el-button
                @click="deleteProductDetail(index)"
                size="small"
                type="primary"
                round>修改夹层</el-button>
          </el-col>
          <el-col :span="16">
            <el-input
                value="5mmPVB透明"
                size="small"
                disabled  />
          </el-col>
        </el-row>
        <el-row style="width: 90%" >
          <el-col :span="4">
            <el-button
                size="small"
                type="primary"
                round>修改玻璃</el-button>
          </el-col>
          <el-col :span="16">
            <el-input
                value="5mm白玻"
                size="small"
                disabled  />
                type="primary">删除</el-button>
          </el-col>
        </el-row>
      </div>
      <el-button
          @click="saveProduct"
          style="float: right;
          margin-right: 0.5rem;"
          size="large"
          type="primary"
          round>重置</el-button>
          round>创建</el-button>
    </div>
  </div>
</template>
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java
@@ -12,6 +12,7 @@
import org.springframework.web.bind.annotation.*;
import java.sql.Date;
import java.util.Map;
@RestController
@RequestMapping("/processCard")
@@ -65,7 +66,21 @@
        }
    }
    //分架明细查询
    //修改排版状态
    @PostMapping("/updateLayoutStatus/{processId}")
    public Result updateLayoutStatus(
            @PathVariable String processId
    ){
        System.out.println(flowCardService.UpdateLayoutStatusSv(processId));
        if(flowCardService.UpdateLayoutStatusSv(processId)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"修改失败");
        }
    }
    //分架新增明细查询
    @PostMapping  ("/selectNoCard/{orderId}/{productionId}")
    public Result SelectNoCard(
@@ -76,4 +91,16 @@
    }
    //添加流程卡
    @PostMapping("/addFlowCard")
    public Result AddOrderWork( @RequestBody Map<String,Object> object){
        System.out.println("obj:"+object);
        if(flowCardService.AddFlowCardSv(object)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"保存失败");
        }
    }
}
north-glass-erp/src/main/java/com/example/erp/controller/sd/ProductController.java
@@ -8,6 +8,7 @@
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/product")
@@ -19,4 +20,9 @@
    public Result defaultDateProduct(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @PathVariable List<String> glassType, @RequestBody Product product){
        return Result.seccess(productService.defaultDateProduct(pageNum,pageSize,glassType,product));
    }
    @PostMapping("/saveProduct")
    public Result saveProduct(@RequestBody Map<String,Object> product){
        return Result.seccess(productService.saveProduct(product));
    }
}
north-glass-erp/src/main/java/com/example/erp/entity/pp/FlowCard.java
@@ -20,12 +20,14 @@
    private String productionId;
    //流程卡号
    private String processId;
    //落架顺序
    private Integer landingSequence;
    //序号
    private Integer orderNumber;
    //工艺确认序号
    private Integer technologyNumber;
    //分架数量
    private Integer binningQuantity;
    private Integer quantity;
    //已优化数量
    private Integer optimizeQuantity;
    //排版状态
north-glass-erp/src/main/java/com/example/erp/entity/sd/ProductDetail.java
@@ -6,15 +6,16 @@
import java.time.LocalDate;
import java.util.Map;
@Data
public class ProductDetail    {
    @TableId(type = IdType.AUTO)
    private Long id;
    private String prodId;
    private String sortNum;
    private String glassSort;
    private Long prodId;
    private Integer sortNum;
    private Integer glassSort;
    private String detailType;
    private String detail;
    private Integer glassGroup;
north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java
@@ -21,8 +21,27 @@
    //分架明细查询
    List<FlowCard> DetailsSelectMp(String orderId, FlowCard flowCard);
    //删除工单
    Boolean DeleteFlowCardMp(String orderId, String processId);
    //分架新增明细查询
    List<Map<String,String>> SelectNoCardMp(String orderId, String productionId, FlowCard flowCard);
    //修改排版状态
    Boolean UpdateLayoutStatusMp(String processId);
    Integer SelectLayoutStatus(String processId);
    Integer ReportingWorkCount(String processId);
    Boolean AddFlowCardMp(String processId, Integer orderNumber, Integer landingSequence, Integer quantity, String productionId, String userName);
    Boolean UpdateFlowState(String productionId, Integer orderNumber);
    Integer SelectFlowCount(String productionId);
    Boolean UpdateProcessingCard(String productionId, int state);
    Boolean UpdateDeleteState(String orderId, String processId);
}
north-glass-erp/src/main/java/com/example/erp/mapper/sd/ProductDetailMapper.java
@@ -9,4 +9,5 @@
public interface ProductDetailMapper {
    List<ProductDetail> getGlassDetailList();
    boolean insertList(List<ProductDetail> getProductDetails);
}
north-glass-erp/src/main/java/com/example/erp/mapper/sd/ProductMapper.java
@@ -1,5 +1,6 @@
package com.example.erp.mapper.sd;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.erp.entity.sd.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -7,7 +8,7 @@
import java.util.List;
@Mapper
public interface ProductMapper {
public interface ProductMapper extends BaseMapper<Product> {
    List<Product> defaultProduct(@Param("offset") Integer offset,
                                 @Param("pageSize") Integer pageSiz,
                                 @Param("glassTypeId") String glassTypeId,
north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
@@ -1,6 +1,8 @@
package com.example.erp.service.pp;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.entity.sd.Order;
@@ -12,6 +14,7 @@
import java.sql.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
@@ -20,6 +23,7 @@
    @Autowired
     FlowCardMapper flowCardMapper;
    //流程卡管理查询
    public Map<String, Object>  selectProcessCard(Date selectTime1, Date selectTime2, FlowCard flowCard) {
        Map<String, Object> map = new HashMap<>();
        //System.out.println(flowCardMapper.selectFlowCard( selectTime1,selectTime2, flowCard));
@@ -27,32 +31,100 @@
        return map;
    }
    //分架查询
    public Map<String, Object> selectAddProcess(Date selectTime1, Date selectTime2, FlowCard flowCard) {
        Map<String, Object> map = new HashMap<>();
        map.put("data", flowCardMapper.selectFlowCardMp( selectTime1,selectTime2, flowCard));
        return map;
    }
    //分架明细查询
    public Map<String, Object> DetailsSelectSv(String orderId, FlowCard flowCard) {
        Map<String, Object> map = new HashMap<>();
        map.put("data", flowCardMapper.DetailsSelectMp( orderId, flowCard));
        return map;
    }
    //删除工单
    public Boolean DeleteFlowCardSv(String orderId, String processId) {
        if (!orderId.isEmpty()&&!processId.isEmpty()){
            Integer count=flowCardMapper.ReportingWorkCount(processId);
            if (count==0){
                //修改分架状态
                flowCardMapper.UpdateDeleteState(orderId, processId);
                //删除分架明细
            flowCardMapper.DeleteFlowCardMp(orderId, processId);
            return true;
        }
        else {
            return false;
        }
        } else {
            return false;
        }
    }
    //分架新增明细查询
    public Map<String, Object> SelectNoCardSv(String orderId, String productionId, FlowCard flowCard) {
        Map<String, Object> map = new HashMap<>();
        map.put("data", flowCardMapper.SelectNoCardMp( orderId,productionId, flowCard));
        return map;
    }
    //修改排版状态
    public Boolean UpdateLayoutStatusSv(String processId) {
        if (!processId.isEmpty()) {
            Integer Status = flowCardMapper.SelectLayoutStatus(processId);
            if (Status == 1) {
                flowCardMapper.UpdateLayoutStatusMp(processId);
            } else {
                return false;
            }
            return true;
        } else {
            return false;
        }
    }
    public Boolean AddFlowCardSv(Map<String, Object> object) {
        String userName = "";
        if (object.get("userName") != null) {
            userName = object.get("userName").toString();
        }
        String productionId = "";
        if (object.get("productionId") != null) {
            productionId = object.get("productionId").toString();
        }
        List<FlowCard> FlowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("flowCard")), FlowCard.class);
        if (!FlowCardList.isEmpty()) {
            for (FlowCard flowCard : FlowCardList) {
                //添加流程卡数据
                flowCardMapper.AddFlowCardMp(flowCard.getProcessId(),flowCard.getOrderNumber(),flowCard.getLandingSequence(),flowCard.getQuantity(),productionId,userName);
                //修改分架状态,将状态改为1
                flowCardMapper.UpdateFlowState(productionId,flowCard.getOrderNumber());
                //查询该订单未分架数量
               Integer FlowCount= flowCardMapper.SelectFlowCount(productionId);
               if (FlowCount==0){
                   //修改订单表分架状态为2
                   System.out.println("我来试试1");
                   flowCardMapper.UpdateProcessingCard(productionId,2);
               }
               else{
                   //修改订单表分架状态为1,未全部分架完成
                   System.out.println("我来试试2");
                   flowCardMapper.UpdateProcessingCard(productionId,1);
               }
            }
            return  true;
        } else {
            return  false;
        }
    }
}
north-glass-erp/src/main/java/com/example/erp/service/pp/WorkOrderService.java
@@ -36,6 +36,7 @@
    public Map<String, Object> AddDateWork(String orderId, OrderDetail orderDetail) {
        Map<String, Object> map = new HashMap<>();
        map.put("data", workOrderMapper.addWordOrder(orderId, orderDetail));
        return map;
    }
@@ -57,22 +58,29 @@
        if (!orderDetaillist.isEmpty()) {
            for (OrderDetail orderDetail : orderDetaillist) {
                //生成生产订单号
                for (int i = 0; i < count; i++) {
                    letters = lettr++;
                    productIdVl = orderID + letters;
                    //查询生成的生产订单号是否存在
                    Integer workCount = workOrderMapper.SelectOrderNumber(productIdVl);
                    System.out.println("生产订单号:" + productIdVl + " 查询结果:" + workCount);
                    if (workCount < 1) {
                        break;
                    }
                }
                System.out.println(productIdVl);
                //添加生产订单
                workOrderMapper.AddOrderWorkMp(productIdVl, orderDetail.getOrderId(), orderDetail.getProductId(), orderDetail.getProductName(), userName);
                Integer State = 2;
                Integer States = 1;
                //查询该订单未转生产订单的条数
                Integer NoWorkCount = workOrderMapper.SelectWorkCount(orderDetail.getOrderId());
                System.out.println(NoWorkCount);
                if (NoWorkCount == 0) {
                    //条数为0修改转生产订单状态为2,否则为1
                    workOrderMapper.UpdateWorkType(orderDetail.getOrderId(), State);
                } else {
                    workOrderMapper.UpdateWorkType(orderDetail.getOrderId(), States);
north-glass-erp/src/main/java/com/example/erp/service/sd/ProductService.java
@@ -1,20 +1,36 @@
package com.example.erp.service.sd;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.example.erp.entity.sd.Product;
import com.example.erp.entity.sd.ProductDetail;
import com.example.erp.mapper.sd.ProductDetailMapper;
import com.example.erp.mapper.sd.ProductMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.DecimalFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@Service
@DS("sd")
@Transactional
public class ProductService {
    @Autowired
    private final
    ProductMapper productMapper;
    private final
    ProductDetailMapper productDetailMapper;
    public ProductService(ProductMapper productMapper, ProductDetailMapper productDetailMapper) {
        this.productMapper = productMapper;
        this.productDetailMapper = productDetailMapper;
    }
//产品查询方法
    public Map<String,Object> defaultDateProduct(Integer pageNum, Integer pageSize, List<String> glassType, Product product) {
        Integer offset = (pageNum-1)*pageSize;
        String glassTypeId = null;
@@ -27,5 +43,76 @@
        return map;
    }
//产品保存方法
    public boolean saveProduct(Map<String,Object>  productObject) {
        //把传入主附表的object类型转换成实体类类型
        JSONObject productJson = new JSONObject(productObject);
        Product product = JSONObject.parseObject(JSONObject.toJSONString(productJson.get("title")), Product.class);
        List<ProductDetail> productDetails = JSONArray.parseArray(JSONObject.toJSONString(productJson.get("detail")), ProductDetail.class);
        //完善主附表信息并返回
        Map<String,Object> getProductJson = updateProduct(productDetails,product);
        Product getProduct = JSONObject.parseObject(JSONObject.toJSONString(getProductJson.get("title")), Product.class);
        List<ProductDetail> getProductDetails = JSONArray.parseArray(JSONObject.toJSONString(getProductJson.get("detail")), ProductDetail.class);
        //插入主表数据
        productMapper.insert(getProduct);
        //给副表添加产品id
        for (ProductDetail getProductDetail : getProductDetails) {
            getProductDetail.setProdId(getProduct.getId());
        }
        //插入副表
        productDetailMapper.insertList(getProductDetails);
        return false;
    }
    private Map<String,Object> updateProduct(List<ProductDetail> productDetailList,Product product) {
        Map<String,Object> map = new HashMap<>();
        //定义产品玻璃厚度累加
        double thickness1 = 0;
        //定义产品总厚度累加
        double totalThickness = 0;
        //定义快速查询
        StringBuilder query = new StringBuilder();
        //定义副表玻璃与间隔物排序
        int sortNum = 0;
        //定义副表玻璃排序
        int glassSort = 0;
        //定义副表中空分组
        int glassGroup = 1;
        for (ProductDetail productDetail : productDetailList) {
            sortNum+=1;
            productDetail.setSortNum(sortNum);
            JSONObject separation = JSONObject.parseObject( productDetail.getSeparation());
            String  getThickness = (String) separation.get("thickness");
            double thicknessDetail = Double.parseDouble(getThickness.replace("mm",""));
            totalThickness += thicknessDetail;
            if(Objects.equals(productDetail.getDetailType(), "glass")){
                glassSort+=1;
                productDetail.setGlassSort(glassSort);
                productDetail.setGlassGroup(glassGroup);
                thickness1 += thicknessDetail;
                DecimalFormat decimalFormat = new DecimalFormat("###");
                query.append(decimalFormat.format(thicknessDetail));
            }
            else if (Objects.equals(productDetail.getDetailType(), "Interlayer")) {
                query.append("+");
            }else if(Objects.equals(productDetail.getDetailType(), "hollow")){
                glassGroup+=1;
                query.append("*");
            }
        }
        product.setThickness(thickness1);
        product.setTotalThickness(totalThickness);
        product.setQuery(String.valueOf(query));
        map.put("title",product);
        map.put("detail",productDetailList);
        return map;
    }
}
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -6,7 +6,7 @@
    <resultMap id="flowCardMap" type="com.example.erp.entity.pp.FlowCard">
        <result column="order_id" property="orderId"/>
        <result column="process_Id" property="processId"/>
        <result column="binning_quantity" property="binningQuantity"/>
        <result column="quantity" property="quantity"/>
        <result column="founder" property="founder"/>
        <result column="create_time" property="createTime"/>
        <!--接收其他外键实体类数据-->
@@ -48,6 +48,7 @@
        <result column="g_type" property="glassTypes.type"/>-->
    </resultMap>
    <!--    流程卡管理查询-->
    <select id="selectFlowCard" resultMap="flowCardMap">
        select
        a.order_Id,
@@ -55,41 +56,35 @@
        c.product_id,
        c.product_name,
        b.project,
        a.binning_quantity,
        a.quantity,
        c.compute_gross_area,
        a.founder,
        c.processing_note
        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}
        <!--        <where>-->
        <!--            <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>-->
        <!--            <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.productionId != null and flowCard.productionId != ''">
                        and a.process_Id regexp #{flowCard.productionId}
                    </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>
        <!--            <if test="flowCard.createTime != null and flowCard.createTime != ''">-->
        <!--                and DATE_FORMAT((a.create_time),'%Y-%m-%d') BETWEEN #{ selectTime1 } AND #{ selectTime2 }-->
        <!--            </if>-->
        <!--        </where>-->
        group by a.process_Id;
    </select>
    <!--分架查询-->
    <select id="selectFlowCardMp" resultMap="flowCardMap">
        select o.order_id,
        o.customer_name,
@@ -102,46 +97,77 @@
        o.processing_note,
        o.delivery_address
        from sd.`order` as o
        where o.production_order=2 and o.create_time between #{selectTime1} and #{selectTime2}
        <!--        <where>-->
        <!--            <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>-->
        <!--            <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>-->
        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}
        <!--            <if test="flowCard.order.project != null and flowCard.order.project!= ''">-->
        <!--                and b.project regexp #{flowCard.order.project}-->
        <!--            </if>-->
        <if test="flowCard.order.orderId != null and flowCard.order.orderId != ''">
            and o.order_id, regexp #{flowCard.order.orderId}
        </if>
        <if test="flowCard.order.customerName != null and flowCard.order.customerName != ''">
            and o.customer_name regexp #{flowCard.order.customerName}
        </if>
        <if test="flowCard.order.project != null and flowCard.order.project != ''">
            and o.project regexp #{flowCard.order.project}
        </if>
        <if test="flowCard.order.batch != null and flowCard.order.batch!= ''">
            and o.batch regexp #{flowCard.order.batch}
        </if>
        <if test="flowCard.order.otherRemarks != null and flowCard.order.otherRemarks!= ''">
            and o.other_remarks regexp #{flowCard.order.otherRemarks}
        </if>
        <!--        </where>-->
        <if test="flowCard.order.icon != null and flowCard.order.icon!= ''">
            and o.icon regexp #{flowCard.order.icon}
        </if>
        <if test="flowCard.order.orderType != null and flowCard.order.orderType!= ''">
            and o.order_type regexp #{flowCard.order.orderType}
        </if>
        <if test="flowCard.order.salesman != null and flowCard.order.salesman!= ''">
            and o.salesman regexp #{flowCard.order.salesman}
        </if>
        group by o.order_id
        ;
    </select>
<!--    分架明细查询-->
    <select id="DetailsSelectMp" resultMap="flowCardMap">
        select od.order_id,
               ogd.production_id,
               od.product_id,
               od.product_name,
               od.quantity,
               od.compute_gross_area,
        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
        where od.order_id = #{orderId}
        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
        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>
        <if test="flowCard.orderGlassDetail.productionId != null and flowCard.orderGlassDetail.productionId != ''">
            and ogd.production_id regexp #{flowCard.orderGlassDetail.productionId}
        </if>
        <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">
            and od.product_id regexp #{flowCard.orderDetail.productId}
        </if>
        <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName != ''">
            and od.product_name regexp #{flowCard.orderDetail.productName}
        </if>
        group by od.order_id, ogd.production_id
    </select>
    <update id="UpdateDeleteState">
        update sd.order_glass_detail as ogd
        set ogd.production_id=null,
            ogd.production_time=null,
            ogd.founder=null
        where ogd.production_id = #{processId}
    </update>
    <!--    删除流程卡-->
    <update id="DeleteFlowCardMp">
        update sd.order_detail as od left join sd.order_glass_detail as ogd
            on od.order_id = ogd.order_id and od.order_number = ogd.order_number
@@ -149,43 +175,110 @@
            ogd.production_time=null,
            ogd.founder=null
        where od.order_id = #{orderId}
          and od.product_name = #{productName}
          and ogd.production_id = #{processId}
    </update>
    <!--    分架新增明细查询-->
<!--resultMap="flowCardMap"-->
    <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
        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}
        <if test="flowCard.orderDetail.orderNumber != null and flowCard.orderDetail.orderNumber != ''">
            and od.order_number regexp #{flowCard.orderDetail.orderNumber}
        </if>
        <if test="flowCard.orderDetail.width != null and flowCard.orderDetail.width != ''">
            and od.width regexp #{flowCard.orderDetail.width}
        </if>
        <if test="flowCard.orderDetail.height != null and flowCard.orderDetail.height != ''">
            and od.height regexp #{flowCard.orderDetail.height}
        </if>
        <if test="flowCard.orderDetail.shape != null and flowCard.orderDetail.shape != ''">
            and od.shape regexp #{flowCard.orderDetail.shape}
        </if>
        where od.order_id=#{orderId} and ogd.production_id=#{productionId} and ogd.splitting_status=0
        GROUP BY od.order_number;
    </select>
    <!--修改排版状态-->
    <update id="UpdateLayoutStatusMp">
        update flow_card as fc
        set fc.layout_status=2
        where fc.process_id = #{processId}
    </update>
<!--    查询对应流程卡号排版状态-->
    <select id="SelectLayoutStatus">
        select fc.layout_status
        from flow_card as fc
        where fc.process_id = #{processId}
        LIMIT 1
    </select>
<!--    查询报工表内是否有对应流程卡-->
    <select id="ReportingWorkCount">
        select COUNT(rw.process_id)
        from reporting_work as rw
        where rw.process_id = #{processId}
    </select>
<!--    插入Flow_card表-->
    <insert id="AddFlowCardMp">
        insert into
            flow_card (
            order_id,
            production_id,
            process_id,
            landing_sequence,
            order_number,
            technology_number,
            quantity,
            founder,
            splitFrame_time,
            create_time
        )
        select
            ogd.order_id,
            ogd.production_id,
            #{processId},
            #{landingSequence},
            ogd.order_number,
            ogd.technology_number,
            #{quantity},
            #{userName},
            NOW(),
            NOW()
        from sd.order_glass_detail as ogd
        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}
    </update>
<!--    查询未分架的条数-->
    <select id="SelectFlowCount">
        select COUNT(*)
        from sd.order_glass_detail as ogd
        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)
    </update>
</mapper>
north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml
@@ -112,13 +112,13 @@
        select od.order_id,
               od.product_id,
               od.product_name,
               od.quantity,
        sum( od.quantity) as quantity,
               od.compute_gross_area,
               od.perimeter
        from order_detail as od
                 left join sd.order_glass_detail as ogd
                           on od.order_id = ogd.order_id
        where od.order_id = #{orderId}  and ISNULL(ogd.production_id)
        from sd.order_detail as od
        left join sd.order as o
        on od.order_id =o.order_id
        where od.order_id = #{orderId}  and  o.production_order!=2
        <if test="orderDetail.orderId != null and orderDetail.orderId != ''">
            and od.order_id regexp #{orderDetail.orderId}
        </if>
@@ -132,8 +132,8 @@
        ;
    </select>
    <select id="SelectOrderNumber" resultMap="wordOrderMap">
        select count(ogd.production_id)
    <select id="SelectOrderNumber" >
        select ifnull(count(ogd.production_id),0)
        from sd.order_glass_detail as ogd
        where ogd.production_id = #{productIdVl}
    </select>
@@ -151,6 +151,7 @@
          and od.product_name = #{productName}
    </update>
<!--    删除工单-->
    <update id="DeleteOrderWorkMp">
        update sd.order_detail as od left join sd.order_glass_detail as ogd
            on od.order_id = ogd.order_id and od.order_number = ogd.order_number
north-glass-erp/src/main/resources/mapper/sd/ProductDetail.xml
@@ -6,4 +6,23 @@
    <select id="getGlassDetailList">
        select * from product_detail where prod_id = #{productId} and detail_type = 'glass'
    </select>
    <insert id="insertList">
        insert into product_detail (
            prod_id, sort_num, glass_sort, detail_type, detail, glass_group, process,separation
        )
        values
        <foreach collection ="getProductDetails" item="ProductDetail" separator =",">
            (
                #{ProductDetail.prodId},
                #{ProductDetail.sortNum},
                #{ProductDetail.glassSort},
                #{ProductDetail.detailType},
                #{ProductDetail.detail},
                #{ProductDetail.glassGroup},
                #{ProductDetail.process},
               #{ProductDetail.separation}
                )
        </foreach>
    </insert>
</mapper>
north-glass-erp/target/classes/mapper/pp/FolwCard.xml
@@ -6,7 +6,7 @@
    <resultMap id="flowCardMap" type="com.example.erp.entity.pp.FlowCard">
        <result column="order_id" property="orderId"/>
        <result column="process_Id" property="processId"/>
        <result column="binning_quantity" property="binningQuantity"/>
        <result column="quantity" property="quantity"/>
        <result column="founder" property="founder"/>
        <result column="create_time" property="createTime"/>
        <!--接收其他外键实体类数据-->
@@ -48,6 +48,7 @@
        <result column="g_type" property="glassTypes.type"/>-->
    </resultMap>
    <!--    流程卡管理查询-->
    <select id="selectFlowCard" resultMap="flowCardMap">
        select
        a.order_Id,
@@ -55,41 +56,35 @@
        c.product_id,
        c.product_name,
        b.project,
        a.binning_quantity,
        a.quantity,
        c.compute_gross_area,
        a.founder,
        c.processing_note
        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}
        <!--        <where>-->
        <!--            <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>-->
        <!--            <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.productionId != null and flowCard.productionId != ''">
                        and a.process_Id regexp #{flowCard.productionId}
                    </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>
        <!--            <if test="flowCard.createTime != null and flowCard.createTime != ''">-->
        <!--                and DATE_FORMAT((a.create_time),'%Y-%m-%d') BETWEEN #{ selectTime1 } AND #{ selectTime2 }-->
        <!--            </if>-->
        <!--        </where>-->
        group by a.process_Id;
    </select>
    <!--分架查询-->
    <select id="selectFlowCardMp" resultMap="flowCardMap">
        select o.order_id,
        o.customer_name,
@@ -102,46 +97,77 @@
        o.processing_note,
        o.delivery_address
        from sd.`order` as o
        where o.production_order=2 and o.create_time between #{selectTime1} and #{selectTime2}
        <!--        <where>-->
        <!--            <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>-->
        <!--            <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>-->
        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}
        <!--            <if test="flowCard.order.project != null and flowCard.order.project!= ''">-->
        <!--                and b.project regexp #{flowCard.order.project}-->
        <!--            </if>-->
        <if test="flowCard.order.orderId != null and flowCard.order.orderId != ''">
            and o.order_id, regexp #{flowCard.order.orderId}
        </if>
        <if test="flowCard.order.customerName != null and flowCard.order.customerName != ''">
            and o.customer_name regexp #{flowCard.order.customerName}
        </if>
        <if test="flowCard.order.project != null and flowCard.order.project != ''">
            and o.project regexp #{flowCard.order.project}
        </if>
        <if test="flowCard.order.batch != null and flowCard.order.batch!= ''">
            and o.batch regexp #{flowCard.order.batch}
        </if>
        <if test="flowCard.order.otherRemarks != null and flowCard.order.otherRemarks!= ''">
            and o.other_remarks regexp #{flowCard.order.otherRemarks}
        </if>
        <!--        </where>-->
        <if test="flowCard.order.icon != null and flowCard.order.icon!= ''">
            and o.icon regexp #{flowCard.order.icon}
        </if>
        <if test="flowCard.order.orderType != null and flowCard.order.orderType!= ''">
            and o.order_type regexp #{flowCard.order.orderType}
        </if>
        <if test="flowCard.order.salesman != null and flowCard.order.salesman!= ''">
            and o.salesman regexp #{flowCard.order.salesman}
        </if>
        group by o.order_id
        ;
    </select>
<!--    分架明细查询-->
    <select id="DetailsSelectMp" resultMap="flowCardMap">
        select od.order_id,
               ogd.production_id,
               od.product_id,
               od.product_name,
               od.quantity,
               od.compute_gross_area,
        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
        where od.order_id = #{orderId}
        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
        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>
        <if test="flowCard.orderGlassDetail.productionId != null and flowCard.orderGlassDetail.productionId != ''">
            and ogd.production_id regexp #{flowCard.orderGlassDetail.productionId}
        </if>
        <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">
            and od.product_id regexp #{flowCard.orderDetail.productId}
        </if>
        <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName != ''">
            and od.product_name regexp #{flowCard.orderDetail.productName}
        </if>
        group by od.order_id, ogd.production_id
    </select>
    <update id="UpdateDeleteState">
        update sd.order_glass_detail as ogd
        set ogd.production_id=null,
            ogd.production_time=null,
            ogd.founder=null
        where ogd.production_id = #{processId}
    </update>
    <!--    删除流程卡-->
    <update id="DeleteFlowCardMp">
        update sd.order_detail as od left join sd.order_glass_detail as ogd
            on od.order_id = ogd.order_id and od.order_number = ogd.order_number
@@ -149,16 +175,23 @@
            ogd.production_time=null,
            ogd.founder=null
        where od.order_id = #{orderId}
          and od.product_name = #{productName}
          and ogd.production_id = #{processId}
    </update>
    <!--    分架新增明细查询-->
<!--resultMap="flowCardMap"-->
    <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',
@@ -167,25 +200,86 @@
        from
        sd.order_detail as od
        left join sd.order_glass_detail as ogd on od.order_id=ogd.order_id
        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}
        <if test="flowCard.orderDetail.orderNumber != null and flowCard.orderDetail.orderNumber != ''">
            and od.order_number regexp #{flowCard.orderDetail.orderNumber}
        </if>
        <if test="flowCard.orderDetail.width != null and flowCard.orderDetail.width != ''">
            and od.width regexp #{flowCard.orderDetail.width}
        </if>
        <if test="flowCard.orderDetail.height != null and flowCard.orderDetail.height != ''">
            and od.height regexp #{flowCard.orderDetail.height}
        </if>
        <if test="flowCard.orderDetail.shape != null and flowCard.orderDetail.shape != ''">
            and od.shape regexp #{flowCard.orderDetail.shape}
        </if>
        where od.order_id=#{orderId} and ogd.production_id=#{productionId} and ogd.splitting_status=0
        GROUP BY od.order_number;
    </select>
    <!--修改排版状态-->
    <update id="UpdateLayoutStatusMp">
        update flow_card as fc
        set fc.layout_status=2
        where fc.process_id = #{processId}
    </update>
<!--    查询对应流程卡号排版状态-->
    <select id="SelectLayoutStatus">
        select fc.layout_status
        from flow_card as fc
        where fc.process_id = #{processId}
        LIMIT 1
    </select>
<!--    查询报工表内是否有对应流程卡-->
    <select id="ReportingWorkCount">
        select COUNT(rw.process_id)
        from reporting_work as rw
        where rw.process_id = #{processId}
    </select>
<!--    插入Flow_card表-->
    <insert id="AddFlowCardMp">
        insert into
            flow_card (
            order_id,
            production_id,
            process_id,
            landing_sequence,
            order_number,
            technology_number,
            quantity,
            founder,
            splitFrame_time,
            create_time
        )
        select
            ogd.order_id,
            ogd.production_id,
            #{processId},
            #{landingSequence},
            ogd.order_number,
            ogd.technology_number,
            #{quantity},
            #{userName},
            NOW(),
            NOW()
        from sd.order_glass_detail as ogd
        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}
    </update>
<!--    查询未分架的条数-->
    <select id="SelectFlowCount">
        select COUNT(*)
        from sd.order_glass_detail as ogd
        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)
    </update>
</mapper>
north-glass-erp/target/classes/mapper/pp/WordOrder.xml
@@ -112,13 +112,13 @@
        select od.order_id,
               od.product_id,
               od.product_name,
               od.quantity,
        sum( od.quantity) as quantity,
               od.compute_gross_area,
               od.perimeter
        from order_detail as od
                 left join sd.order_glass_detail as ogd
                           on od.order_id = ogd.order_id
        where od.order_id = #{orderId}  and ISNULL(ogd.production_id)
        from sd.order_detail as od
        left join sd.order as o
        on od.order_id =o.order_id
        where od.order_id = #{orderId}  and  o.production_order!=2
        <if test="orderDetail.orderId != null and orderDetail.orderId != ''">
            and od.order_id regexp #{orderDetail.orderId}
        </if>
@@ -132,8 +132,8 @@
        ;
    </select>
    <select id="SelectOrderNumber" resultMap="wordOrderMap">
        select count(ogd.production_id)
    <select id="SelectOrderNumber" >
        select ifnull(count(ogd.production_id),0)
        from sd.order_glass_detail as ogd
        where ogd.production_id = #{productIdVl}
    </select>
@@ -151,6 +151,7 @@
          and od.product_name = #{productName}
    </update>
<!--    删除工单-->
    <update id="DeleteOrderWorkMp">
        update sd.order_detail as od left join sd.order_glass_detail as ogd
            on od.order_id = ogd.order_id and od.order_number = ogd.order_number
north-glass-erp/target/classes/mapper/sd/ProductDetail.xml
@@ -6,4 +6,23 @@
    <select id="getGlassDetailList">
        select * from product_detail where prod_id = #{productId} and detail_type = 'glass'
    </select>
    <insert id="insertList">
        insert into product_detail (
            prod_id, sort_num, glass_sort, detail_type, detail, glass_group, process,separation
        )
        values
        <foreach collection ="getProductDetails" item="ProductDetail" separator =",">
            (
                #{ProductDetail.prodId},
                #{ProductDetail.sortNum},
                #{ProductDetail.glassSort},
                #{ProductDetail.detailType},
                #{ProductDetail.detail},
                #{ProductDetail.glassGroup},
                #{ProductDetail.process},
               #{ProductDetail.separation}
                )
        </foreach>
    </insert>
</mapper>