廖井涛
2024-03-15 8a6e6f50fb68655f10d27933fdcb622976991330
添加出入库返库界面
23个文件已修改
1个文件已添加
992 ■■■■■ 已修改文件
north-glass-erp/northglass-erp/src/lang/en.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/lang/zh.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/router/index.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/mm/mainProductStock/CreateProductStock.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/mm/mainProductStock/FinishedProductOut.vue 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/mm/mainProductStock/OrderAllocation.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/mm/mainProductStock/StorageRecord.vue 388 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/mm/mainProductStock/TakeOutRecord.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/mm/FinishedGoodsInventoryController.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/entity/mm/FinishedGoodsInventory.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/entity/mm/FinishedOperateLog.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedGoodsInventoryMapper.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedOperateLogMapper.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/mm/FinishedGoodsInventoryService.java 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/mm/FinishedGoodsInventory.xml 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/mm/FinishedOperateLog.xml 145 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/ReworkMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/sd/DeliveryDetail.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/mm/FinishedGoodsInventory.xml 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/mm/FinishedOperateLog.xml 145 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/pp/PatchLogMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/pp/ReworkMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/sd/DeliveryDetail.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/lang/en.js
@@ -302,6 +302,7 @@
        finishedProductInventory:"Finished Product Stock ",
        confirmOutbound:'Delivery Confirmation',
        confirmReceiptOfGoods:'Warehousing Confirmation',
        quantityToBeStockedIn:'Quantity To Be Stocked In',
        receivedSuccessfully:'Successfully entered the warehouse',
        deliverySuccessful:"Successfully transferred out of warehouse ",
@@ -318,6 +319,8 @@
        transferRecords:'Mutual Exchange Records',
        reworkConfirmation:'Rework Confirmation',
        reworkRecords:'Rework Records',
        warehousingRecords:'Warehousing Records',
        outboundRecords:'Outbound Records',
        pleaseSelectTheTypeOfWithdrawal:'Please select the type of withdrawal',
north-glass-erp/northglass-erp/src/lang/zh.js
@@ -307,6 +307,7 @@
        finishedProductInventory:"成品库存 ",
        confirmOutbound:'确认出库',
        confirmReceiptOfGoods:'确认入库',
        quantityToBeStockedIn:'待入库数量',
@@ -325,6 +326,8 @@
        transferRecords:'调拨记录',
        reworkConfirmation:'返工确认',
        reworkRecords:'返工记录',
        warehousingRecords:'入库记录',
        outboundRecords:'出库记录',
        pleaseSelectTheTypeOfWithdrawal:'请选择领出类型',
@@ -371,7 +374,7 @@
        totalArea:'总面积',
        singlePieceArea:'单片面积',
        perimeter:'周长',
        returnToWarehouse:'返库',
        returnToWarehouse:'退回',
    },
north-glass-erp/northglass-erp/src/router/index.js
@@ -601,6 +601,12 @@
              name: 'reworkRecord',
              component:()=>import('../views/mm/mainProductStock/ReworkRecord.vue'),
            },
            {
              // 出入库记录
              path: 'storageRecord',
              name: 'storageRecord',
              component:()=>import('../views/mm/mainProductStock/StorageRecord.vue'),
            },
            {
              path: '',
north-glass-erp/northglass-erp/src/views/mm/mainProductStock/CreateProductStock.vue
@@ -212,7 +212,7 @@
    {field: 'order.project', width: '100',title: t('order.project'), filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'orderNumber',width: '140', title: t('order.OrderNum'), filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'orderDetail.quantity',width: '140', title: t('productStock.totalNumberOfOrders'), filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'inventoryQuantity',width: '100', title: t('productStock.completedQuantity'), filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'inventoryQuantity',width: '100', title: t('productStock.quantityToBeStockedIn'), filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'order.area',width: '140', title: t('order.area'), filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'processId',width: '100', title: t('processCard.processId'), filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'receivedQuantity',width: '100', title: t('productStock.quantityAlreadyInStock'), filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
@@ -222,6 +222,10 @@
    buttons: [{
      'name': t('productStock.confirmReceiptOfGoods'),status: 'primary',
      'code':'add'
      },
      {
        'name': t('productStock.warehousingRecords'),status: 'primary',
        'code':'jump'
    }
      ],
    /*import: false,
@@ -280,6 +284,11 @@
          return;
        }
        case 'jump': {
          router.push({path: '/main/productStock/storageRecord', query: { storageType: '入库' }})
          return;
        }
      }
    }
north-glass-erp/northglass-erp/src/views/mm/mainProductStock/FinishedProductOut.vue
@@ -202,7 +202,6 @@
    {type:'expand',fixed:"left",slots: { content:'content' },width: '60'},
    { type: 'checkbox',fixed:"left", title: t('basicData.check'), width: '80' },
    { type: 'seq',fixed:"left", title: t('basicData.Number'), width: '80' },
    {title: t('basicData.operate'), width: '80', slots: { default: 'button_slot' },fixed:"left"},
    {field: 'deliveryDetail.deliveryId', width:'150', title:  t('delivery.deliveryNoteId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' } },
    {field: 'deliveryDetail.orderNumber', width:'150', title:  t('delivery.deliveryNoteNumber'),filters:[{ data: '' }],slots: { filter: 'num1_filter' } },
    {field: 'deliveryDetail.orderId', width: '150',title:  t('order.orderId'),showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
@@ -210,7 +209,7 @@
    {field: 'order.project', width: '120',title: t('order.project'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'productId', width: '100',title: t('order.productId'), filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'productName',width: '200', title: t('order.product'), filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'deliveryNum',width: '100', title: t('delivery.deliveryQuantity'), filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'deliveryDetail.quantity',width: '100', title: t('delivery.deliveryQuantity'), filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'warehouseNum',width: '140', title: t('productStock.inventoryQuantity'), filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'delivery.customerName',width: '200', title: t('customer.customerName'), filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'width', width: '100',title: t('order.width'), filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
@@ -223,9 +222,11 @@
  ],//表头按钮
  toolbarConfig: {
    buttons: [{
      'name': t('productStock.confirmOutbound'),
      status: 'primary',
      'name': t('productStock.confirmOutbound'), status: 'primary',
      'code':'ver'
      },{
      'name': t('productStock.outboundRecords'),status: 'primary',
      'code':'jump'
    }],
    /*import: false,
   export: true,
@@ -253,7 +254,7 @@
const remark = ref(null);
const  xGrid = ref();
const gridEvents = {
  toolbarButtonClick ({ code }) {
  async toolbarButtonClick({code}) {
    const $grid = xGrid.value
    if ($grid) {
      switch (code) {
@@ -266,13 +267,18 @@
              ElMessage.warning(t('productStock.unselectedData'))
              return
            }
            const errMap = await $grid.validate(selectRecords)
            if (errMap) {
              ElMessage.warning(t('delivery.theShipmentQuantityCannotBeGreaterThanTheInventoryQuantity'))
              return
            }
            let orderDetailData = ref({
              userId:userid,
              userName:username,
              orderDetail:selectRecords
            })
            console.log(orderDetailData)
            request.post("/FinishedGoodsInventory/addDeliveryDetail",orderDetailData.value).then((res) => {
              if(res.code==200){
                ElMessage.success(t('productStock.deliverySuccessful'))
@@ -288,12 +294,30 @@
        }
        case 'jump': {
          router.push({path: '/main/productStock/storageRecord', query: {storageType: '出库'}})
          return;
        }
      }
    }
  },
}
/*数据校验*/
const validRules = ref({
  "deliveryDetail.quantity": [{
    validator (e) {
      if (e.row.deliveryDetail.quantity > e.row.warehouseNum) {
        return new Error("")
      }
    }
  }]
})
@@ -308,6 +332,7 @@
        ref="xGrid"
        v-bind="gridOptions"
        v-on="gridEvents"
        :edit-rules="validRules"
    >
      <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
      <!--      下拉显示所有信息插槽-->
north-glass-erp/northglass-erp/src/views/mm/mainProductStock/OrderAllocation.vue
@@ -292,7 +292,6 @@
        case 'record': {
          router.push({path: '/main/productStock/TransferRecord'});
          return;
          break;
        }
        case 'rework': {
          router.push({path: '/main/productStock/FinishedProductRework'});
north-glass-erp/northglass-erp/src/views/mm/mainProductStock/StorageRecord.vue
New file
@@ -0,0 +1,388 @@
<!-- 领出记录  -->
<script setup>
import {onMounted, reactive, ref} from "vue";
import {useRoute, useRouter} from "vue-router"
import request from "@/utils/request";
import deepClone from "@/utils/deepClone";
import useUserInfoStore from "@/stores/userInfo";
import {ElMessage} from "element-plus";
import {Search} from "@element-plus/icons-vue";
import { useI18n } from 'vue-i18n'
//语言获取
const { t } = useI18n()
const router = useRouter()
const route = useRoute()
const userStore = useUserInfoStore()
const username = userStore.user.userName
const userid = userStore.user.userId
let produceList = ref([])
const getTableRow = (row,type) =>{
  switch (type) {
    case 'add' :{
      alert('我接收到子组件传送的编辑信息')
      break
    }
    case 'delete':{
      alert('我接收到子组件传送的删除信息')
      break
    }
  }
}
const hasDecimal=(value)=>{
  const regex=/\./ // 定义正则表达式,查找小数点
  return regex.test(value) //返回true/false
}
const hasDecimalhtml=(item,row)=>{
  let aa=item.split('.').length
  if (aa===2){
    return row[item.split('.')[0]][item.split('.')[1]]
  }else if(aa===3){
    return row[item.split('.')[0]][item.split('.')[1]][item.split('.')[2]]
  }
}
let selectDate = ref(["",""])
let type = ref("")
//筛选条件,有外键需要先定义明细里面的数据
let filterData = ref({
  orderDetail:{
    width:'',
    height:'',
    productId:'',
    productName:''
  }
})
let pageNum=ref(1)
let total = reactive({
  pageTotal : 0,
  dataTotal : 0,
  pageSize : 10
})
onMounted(()=>{
  const storageType = route.query.storageType
  if (typeof storageType !== 'undefined' && storageType !== null && storageType !== '' && storageType !== '\n' && storageType !== '\r'){
    type.value=storageType
    //第一次调用
    request.post(`/FinishedGoodsInventory/getSelectStorageRecord/1/${total.pageSize}/${selectDate.value}/${type.value}`,filterData.value).then((res) => {
      if(res.code==200){
        console.log(res.data)
        total.dataTotal = res.data.total.total*1
        total.pageTotal= res.data.total.pageTotal
        selectDate.value = res.data.selectDate
        produceList = deepClone(res.data.data)
        xGrid.value.loadData(produceList)
        gridOptions.loading=false
      }else{
        ElMessage.warning(res.msg)
        router.push("/login")
      }
    })
  }
})
let pageState = null
/*使用筛选,后端获取数据*/
const changeFilterEvent = (event, option, $panel,) => {
  // 手动触发筛选
  $panel.changeOption(event, !!option.data, option)
}
function filterChanged(column){
  gridOptions.loading=true
  //筛选条件发生变化条件发生变化
  let value = column.datas[0]!=undefined?column.datas[0]:''
  value = value.trim()
  //判断是否存在外键
  if (column.property.indexOf('.')>-1){
    const  columnArr = column.property.split('.')
    filterData.value[columnArr[0]] = {
      [columnArr[1]]:value
    }
  }else{
    filterData.value[column.property] = value
  }
  request.post(`/FinishedGoodsInventory/getSelectStorageRecord/1/${total.pageSize}/${selectDate.value}/${type.value}`,filterData.value).then((res) => {
    if(res.code==200){
      total.dataTotal = res.data.total.total*1
      total.pageTotal= res.data.total.pageTotal
      selectDate.value = res.data.selectDate
      pageNum.value=1
      produceList = deepClone(res.data.data)
      xGrid.value.loadData(produceList)
      gridOptions.loading=false
    }else{
      ElMessage.warning(res.msg)
      router.push("/login")
    }
  })
}
const selectOrderList = ()=>{
  request.post(`/FinishedGoodsInventory/getSelectStorageRecord/${pageNum.value}/${total.pageSize}/${selectDate.value}/${type.value}`,filterData.value).then((res) => {
    if(res.code==200){
      selectDate.value = res.data.selectDate
      pageNum.value=1
      produceList = deepClone(res.data.data)
      xGrid.value.loadData(produceList)
      gridOptions.loading=false
    }else{
      ElMessage.warning(res.msg)
      router.push("/login")
    }
  })
}
const changeDate =  ()=>{
  selectOrderList()
}
//页脚跳转
const handlePageChange = ({ currentPage, pageSize }) => {
  total.pageTotal = pageSize
  pageNum.value=currentPage
  selectOrderList()
}
//子组件接收参数
const  xGrid = ref();
const gridOptions = reactive({
  border:  "full",//表格加边框
  keepSource: true,//保持源数据
  align: 'center',//文字居中
  stripe:true,//斑马纹
  rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮
  id: 'CustomerList',
  showFooter: true,//显示脚
  printConfig: {},
  importConfig: {},
  exportConfig: {},
  scrollY:{ enabled: true },//开启虚拟滚动
  showOverflow:true,
  columnConfig: {
    resizable: true,
    useKey: true
  },
  filterConfig: {   //筛选配置项
    remote: true
  },
  customConfig: {
    storage: true
  },
  editConfig: {
    trigger: 'click',
    mode: 'row',
    showStatus: true
  },//表头参数
  columns:[
    {type: 'checkbox',fixed:"left", title: t('basicData.check'), width: '80' },
    {type:'expand',fixed:"left",slots: { content:'content' },width: '80'},
    {type: 'seq',fixed:"left", title: t('basicData.Number'), width: '80' },
    //{field: 'status', width: '120',title: t('productStock.documentStatus'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'operationOrderNumber', width:'150', title: t('productStock.operationOrderNumber'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'orderId', width: '150',title: t('order.orderId'),showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'operationNumber', width: '100',title: t('order.OrderNum'), showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'quantity', width: '140',title: t('order.quantity'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'orderDetail.productId',width: '100', title: t('order.productId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'orderDetail.productName',width: '140', title: t('order.product'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'orderDetail.width', width: '100',title: t('order.width'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'orderDetail.height',width: '100', title: t('order.height'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'operator', width: '100',title: t('productStock.creator'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'operateTime', width:'140', title: t('productStock.productionDate'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'reviewed', width: '100',title: t('productStock.reviewed'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'reviewedTime', width: '140',title: t('productStock.approvedDate'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'remarks', width: '140',title: t('productStock.remarks'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
  ],//表头按钮
  toolbarConfig: {
    buttons: [
      {
        'name': t('productStock.returnToWarehouse'),status: 'primary',
        'code':'cancel'
      }],
    /*import: false,
   export: true,
   print: true,*/
    zoom: true,
    custom: true
  },
  footerMethod ({ columns, data }) {//页脚函数
    return[
      columns.map((column, columnIndex) => {
        if (columnIndex === 0) {
          return t('basicData.total')
        }
        // if (props.tableProp.footList.includes(column.field)) {
        //   return sumNum(data, column.field)
        // }
        return ''
      })
    ]
  }
})
const gridEvents = {
  toolbarButtonClick ({ code }) {
    const $grid = xGrid.value
    if ($grid) {
      switch (code) {
        case 'cancel': {
          const $table = xGrid.value
          //gridOptions.columns.unshift(a)
          if ($table) {
            const selectRecords = $table.getCheckboxRecords()
            let flowData = ref({
              userId:userid,
              userName:username,
              orderDetail:selectRecords
            })
            console.log(flowData)
            request.post("/FinishedGoodsInventory/cancelFinishedGoodsInventoryStorage",flowData.value).then((res) => {
              if(res.code==200){
                ElMessage.success(t('productStock.invalidSuccessfully'))
                router.push({path:'/main/productStock/storageRecord',query:{random:Math.random(),storageType: type.value}})
              }else{
                ElMessage.warning(res.msg)
                router.push("/login")
              }
            })
          }
          return;
        }
      }
    }
  },
}
const checkBoxConfig = {
  checkMethod: ({ row }) => {
    if (row['status']==='已审核'||row['status']==='未通过'){
      return row.disable
    }else{
      return !row.disable
    }
  },
  reserve:true
}
</script>
<template>
  <div class="main-div-customer">
    <el-date-picker
        v-model="selectDate"
        type="daterange"
        start-placeholder="开始时间"
        end-placeholder="结束时间"
        format="YYYY-MM-DD"
        value-format="YYYY-MM-DD"
    />
    <el-button @click="changeDate" style="margin-top: -5px"  id="searchButton" type="primary" :icon="Search">{{$t('basicData.search')}}</el-button>
    <vxe-grid
        max-height="100%"
        @filter-change="filterChanged"
        class="mytable-scrollbar"
        ref="xGrid"
        v-bind="gridOptions"
        v-on="gridEvents"
        :checkbox-config="checkBoxConfig"
    >
<!--      <template #state="{ row,column}">
&lt;!&ndash;                <p>{{row[column.field]}}</p>&ndash;&gt;
&lt;!&ndash;        <el-checkbox v-model="row['isState']" :disabled="row[column.field]==='已审核'||row[column.field]==='未通过'"/>&ndash;&gt;
        <vxe-checkbox v-model="row['isState']" :disabled="row[column.field]==='已审核'||row[column.field]==='未通过'"></vxe-checkbox>
      </template>-->
      <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
      <!--      下拉显示所有信息插槽-->
      <template #content="{ row }">
        <ul class="expand-wrapper">
          <li  v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined ">
            <span style="font-weight: bold">{{item.title+':  '}}</span>
            <span v-if="hasDecimal(item.field)">{{ hasDecimalhtml(item.field,row) }}</span>
            <span v-else>{{ row[item.field] }}</span>
          </li>
        </ul>
      </template>
      <!--左边固定显示的插槽-->
      <template #button_slot="{ row }">
        <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{$t('basicData.edit')}}</el-button>
        <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">{{$t('basicData.delete')}}</el-button>
      </template>
      <template #num1_filter="{ column, $panel }">
        <div>
          <div v-for="(option, index) in column.filters" :key="index">
            <input type="type" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/>
          </div>
        </div>
      </template>
      <template #pager>
        <!--使用 pager 插槽-->
        <vxe-pager
            @page-change="handlePageChange"
            :layouts="[  'PrevPage', 'Jump','PageCount', 'NextPage',  'Total']"
            v-model:current-page="pageNum"
            v-model:page-size="total.pageSize"
            v-model:pager-count="total.pageTotal"
            :total="total.dataTotal"
        >
        </vxe-pager>
      </template>
    </vxe-grid>
  </div>
</template>
<style scoped>
.main-div-customer{
  width: 99%;
  height: 100%;
}
</style>
north-glass-erp/northglass-erp/src/views/mm/mainProductStock/TakeOutRecord.vue
@@ -71,7 +71,8 @@
request.post(`/FinishedGoodsInventory/getSelectOperateRecord/1/${total.pageSize}/${selectDate.value}`,filterData.value).then((res) => {
  if(res.code==200){
    total.dataTotal = res.data.total.total*1
    total.pageTotal= res.data.total.pageTotal
    selectDate.value = res.data.selectDate
    produceList = deepClone(res.data.data)
    xGrid.value.loadData(produceList)
@@ -126,8 +127,6 @@
const selectOrderList = ()=>{
  request.post(`/FinishedGoodsInventory/getSelectOperateRecord/${pageNum.value}/${total.pageSize}/${selectDate.value}`,filterData.value).then((res) => {
    if(res.code==200){
      total.dataTotal = res.data.total.total*1
      total.pageTotal= res.data.total.pageTotal
      selectDate.value = res.data.selectDate
      pageNum.value=1
north-glass-erp/src/main/java/com/example/erp/controller/mm/FinishedGoodsInventoryController.java
@@ -176,4 +176,25 @@
        }
    }
    /*出入库记录查询*/
    @ApiOperation("出入库记录查询接口")
    @PostMapping("/getSelectStorageRecord/{pageNum}/{pageSize}/{selectDate}/{type}")
    public Result getSelectStorageRecord(@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate,@PathVariable String type, @RequestBody FinishedOperateLog finishedOperateLog){
        return Result.seccess(finishedGoodsInventoryService.getSelectStorageRecord(pageNum,pageSize,selectDate,type,finishedOperateLog));
    }
    /*出入库返回*/
    @ApiOperation("出入库返回接口")
    @PostMapping("/cancelFinishedGoodsInventoryStorage")
    public Result cancelFinishedGoodsInventoryStorage( @RequestBody Map<String,Object>  object){
        if(finishedGoodsInventoryService.cancelFinishedGoodsInventoryStorage(object)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"返回失败");
        }
    }
}
north-glass-erp/src/main/java/com/example/erp/entity/mm/FinishedGoodsInventory.java
@@ -25,6 +25,7 @@
    private String remark;
    private LocalDate updateTime;
    private LocalDate endTime;
    private String processId;
    private Order order;
    private OrderDetail orderDetail;
north-glass-erp/src/main/java/com/example/erp/entity/mm/FinishedOperateLog.java
@@ -28,6 +28,7 @@
    private LocalDate reviewedTime;
    private String type;
    private String remarks;
    private String processId;
    private OrderDetail orderDetail;
north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedGoodsInventoryMapper.java
@@ -1,6 +1,7 @@
package com.example.erp.mapper.mm;
import com.example.erp.entity.mm.FinishedGoodsInventory;
import com.example.erp.entity.mm.FinishedOperateLog;
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.entity.sd.Order;
import com.example.erp.entity.sd.OrderDetail;
@@ -48,8 +49,12 @@
                            @Param("storageRegion") String storageRegion,
                            @Param("remark") String remark);
    Boolean updateInventoryOut(@Param("finishedOperateLog") FinishedOperateLog finishedOperateLog);
    Boolean updateInventoryquantityavailable(@Param("orderDetail") OrderDetail orderDetail);
    Boolean updateflowcard(FlowCard flowCard);
    Boolean updateflowcardOut(@Param("finishedOperateLog") FinishedOperateLog finishedOperateLog);
    Boolean updateIntOrderNumberConut( @Param("orderId") String orderId,
                                       @Param("orderNumber") Integer orderNumber,
@@ -66,7 +71,8 @@
    Boolean updateDeliveryDeliveryState(String deliveryId,Integer state);
    Boolean updateDeliveryDetailState(OrderDetail orderDetail,Integer state);
    Boolean updateDeliveryDetailState(@Param("orderId") String orderId,
                                      @Param("orderNumber") Integer orderNumber,@Param("deliveryId") String deliveryId,Integer state);
    Boolean insertFinishedGoodsInventory(@Param("flowCard") FlowCard flowCard,
                                         @Param("storageRegion") String storageRegion,
north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedOperateLogMapper.java
@@ -56,4 +56,13 @@
                                            @Param("type") String type);
    Boolean updateFinishedOperateLogState(@Param("finishedOperateLog") FinishedOperateLog finishedOperateLog,@Param("type") String type);
    List<OrderDetail> getSelectStorageRecord(@Param("offset") Integer offset,
                                             @Param("pageSize") Integer pageSize,String startDate, String endDate,String type,
                                             @Param("finishedOperateLog") FinishedOperateLog finishedOperateLog);
    Map<String,Integer> getSelectStorageRecordLogPageTotal(@Param("offset") Integer offset,
                                                           @Param("pageSize") Integer pageSize,String startDate, String endDate,String type,
                                                           @Param("finishedOperateLog") FinishedOperateLog finishedOperateLog);
}
north-glass-erp/src/main/java/com/example/erp/service/mm/FinishedGoodsInventoryService.java
@@ -94,6 +94,8 @@
                        finishedGoodsInventoryMapper.updateInventory(flowCard,storageRegion, remark);
                        //修改流程卡表入库数量
                        finishedGoodsInventoryMapper.updateflowcard(flowCard);
                        //修改订单表入库状态
                        finishedGoodsInventoryMapper.updateOrderWarehousingState(flowCard.getOrder().getOrderId(),1);
                        //修改订单明细表入库数量
                        finishedGoodsInventoryMapper.updateIntOrderNumberConut(flowCard.getOrder().getOrderId(),flowCard.getOrderNumber(),flowCard.getInventoryQuantity());
                        //判断订单是否全部入库
@@ -175,19 +177,19 @@
                        deliverydetailsum=0;
                    }
                    /*System.out.println("订单总数:" + ordersum + "订单剩余数量:" + ordernumbersum + "准备出库数量" +
                            orderDetail.getWarehouseNum()+ "发货数量" + orderDetail.getDeliveryNum()+ "发货总数" +
                            deliverysum+ "已发数量" + deliverydetailsum);*/
                    System.out.println("订单总数:" + ordersum + "订单剩余数量:" + ordernumbersum + "准备出库数量" +
                            orderDetail.getWarehouseNum()+ "发货数量" + orderDetail.getDeliveryDetail().getQuantity()+ "发货总数" +
                            deliverysum+ "已发数量" + deliverydetailsum);
                    if (finishedGoodsInventorycount > 0) {
                        if(orderDetail.getWarehouseNum()>=orderDetail.getDeliveryNum()){
                        if(orderDetail.getWarehouseNum()>=orderDetail.getDeliveryDetail().getQuantity()){
                            //修改库存表库存数量
                            finishedGoodsInventoryMapper.updateInventoryInventoryOut(orderDetail.getDeliveryDetail().getOrderId(),orderDetail.getDeliveryDetail().getOrderNumber(),orderDetail.getDeliveryNum());
                            finishedGoodsInventoryMapper.updateInventoryInventoryOut(orderDetail.getDeliveryDetail().getOrderId(),orderDetail.getDeliveryDetail().getOrderNumber(),orderDetail.getDeliveryDetail().getQuantity());
                            //修改发货明细表状态
                            finishedGoodsInventoryMapper.updateDeliveryDetailState(orderDetail,0);
                            finishedGoodsInventoryMapper.updateDeliveryDetailState(orderDetail.getDeliveryDetail().getOrderId(),orderDetail.getDeliveryDetail().getOrderNumber(),orderDetail.getDeliveryDetail().getDeliveryId(),0);
                            //修改发货表状态
                            finishedGoodsInventoryMapper.updateDeliveryDeliveryState(orderDetail.getDeliveryDetail().getDeliveryId(),1);
                            //修改订单明细表发货数量
                            finishedGoodsInventoryMapper.updateOutOrderNumberConut(orderDetail.getDeliveryDetail().getOrderId(),orderDetail.getDeliveryDetail().getOrderNumber(),orderDetail.getDeliveryNum());
                            finishedGoodsInventoryMapper.updateOutOrderNumberConut(orderDetail.getDeliveryDetail().getOrderId(),orderDetail.getDeliveryDetail().getOrderNumber(),orderDetail.getDeliveryDetail().getQuantity());
                            //修改订单表发货状态
                            finishedGoodsInventoryMapper.updateOrderDeliveryState(orderDetail.getDeliveryDetail().getOrderId(),1);
                            //判断订单是否全部发货
@@ -195,7 +197,7 @@
                                //修改订单表发货状态
                                finishedGoodsInventoryMapper.updateOrderDeliveryState(orderDetail.getDeliveryDetail().getOrderId(),2);
                            }
                            if (deliverysum==deliverydetailsum+orderDetail.getDeliveryNum()) {
                            if (deliverysum==deliverydetailsum+orderDetail.getDeliveryDetail().getQuantity()) {
                                //修改发货表状态
                                finishedGoodsInventoryMapper.updateDeliveryDeliveryState(orderDetail.getDeliveryDetail().getDeliveryId(),2);
                            }
@@ -540,6 +542,106 @@
    }
    public Map<String, Object> getSelectStorageRecord(Integer pageNum, Integer pageSize, List<String> selectDate,String type, FinishedOperateLog finishedOperateLog) {
        Integer offset = (pageNum-1)*pageSize;
        String endDate = LocalDate.now().toString();
        String startDate = LocalDate.now().minusDays(15).toString();
        if(selectDate !=null && selectDate.size()==2){
            if(!selectDate.get(0).isEmpty()){
                startDate = selectDate.get(0);
            }
            if(!selectDate.get(1).isEmpty()){
                endDate = selectDate.get(1);
            }
        }
        Map<String, Object> map = new HashMap<>();
        map.put("data", finishedOperateLogMapper.getSelectStorageRecord(offset, pageSize,startDate, endDate,type, finishedOperateLog));
        map.put("total", finishedOperateLogMapper.getSelectStorageRecordLogPageTotal(offset, pageSize,startDate, endDate,type, finishedOperateLog));
        List<String> list = new ArrayList<>();
        list.add(startDate);
        list.add(endDate);
        map.put("selectDate",list);
        return map;
    }
    public Boolean cancelFinishedGoodsInventoryStorage(Map<String,Object> object) {
        boolean saveState = true;
        //设置回滚点
        Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint();
        try {
            //获取对象集合循环进行新增修改
            List<FinishedOperateLog> finishedOperateLogslist = JSONArray.parseArray(JSONObject.toJSONString(object.get("orderDetail")), FinishedOperateLog.class);
            if (!finishedOperateLogslist.isEmpty()){
                for (FinishedOperateLog finishedOperateLog : finishedOperateLogslist) {
                    Integer ordersum = finishedGoodsInventoryMapper.findOrderQuantity(finishedOperateLog.getOrderId());
                    Integer ordernumbersum = finishedGoodsInventoryMapper.findOrderNumberdsum(finishedOperateLog.getOrderId());
                    System.out.println(finishedOperateLog.getOperateType());
                    if(Objects.equals(finishedOperateLog.getOperateType(), "入库")){
                        //修改记录表
                        finishedOperateLogMapper.updateFinishedOperateLogState(finishedOperateLog,"已作废");
                        //修改库存表入库数量
                        finishedGoodsInventoryMapper.updateInventoryOut(finishedOperateLog);
                        //修改流程卡表入库数量
                        finishedGoodsInventoryMapper.updateflowcardOut(finishedOperateLog);
                        //修改订单明细表入库数量
                        finishedGoodsInventoryMapper.updateOutOrderNumberConut(finishedOperateLog.getOrderId(),finishedOperateLog.getOperationNumber(),finishedOperateLog.getQuantity());
                        //判断订单是否全部入库
                        if (Objects.equals(ordersum, ordernumbersum)) {
                            //修改订单表入库状态
                            finishedGoodsInventoryMapper.updateOrderWarehousingState(finishedOperateLog.getOrderId(),1);
                        }
                        if (ordernumbersum-finishedOperateLog.getQuantity()==0) {
                            //修改订单表入库状态
                            finishedGoodsInventoryMapper.updateOrderWarehousingState(finishedOperateLog.getOrderId(),0);
                        }
                    }else if(Objects.equals(finishedOperateLog.getOperateType(), "出库")){
                        //修改记录表
                        finishedOperateLogMapper.updateFinishedOperateLogState(finishedOperateLog,"已作废");
                        //修改库存表库存数量
                        finishedGoodsInventoryMapper.updateInventoryInventoryInt(finishedOperateLog.getOrderId(),finishedOperateLog.getOperationNumber(),finishedOperateLog.getQuantity());
                        //修改发货明细表状态
                        finishedGoodsInventoryMapper.updateDeliveryDetailState(finishedOperateLog.getOrderId(),finishedOperateLog.getOperationNumber(),finishedOperateLog.getOperationOrderNumber(),1);
                        //修改发货表状态
                        finishedGoodsInventoryMapper.updateDeliveryDeliveryState(finishedOperateLog.getOperationOrderNumber(),0);
                        //修改订单明细表库内数量
                        finishedGoodsInventoryMapper.updateIntOrderNumberConut(finishedOperateLog.getOrderId(),finishedOperateLog.getOperationNumber(),finishedOperateLog.getQuantity());
                        //修改订单表发货状态
                        finishedGoodsInventoryMapper.updateDeliveryDeliveryState(finishedOperateLog.getOrderId(),1);
                        //判断订单是否全部发货
                        if (ordernumbersum-finishedOperateLog.getQuantity()==0) {
                            //修改订单表发货状态
                            finishedGoodsInventoryMapper.updateOrderDeliveryState(finishedOperateLog.getOrderId(),1);
                        }
                        if (ordersum==finishedOperateLog.getQuantity()+ordernumbersum) {
                            //修改订单表发货状态
                            finishedGoodsInventoryMapper.updateOrderDeliveryState(finishedOperateLog.getOrderId(),0);
                        }
                    }
                }
            }
        } catch (Exception e) {
            TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint);
            //将异常传入数据库
            SysError sysError = new SysError();
            sysError.setError(e.toString());
            sysError.setFunc("saveOrder");
            sysErrorService.insert(sysError);
            saveState = false;
        }
        return saveState;
    }
north-glass-erp/src/main/resources/mapper/mm/FinishedGoodsInventory.xml
@@ -72,12 +72,13 @@
        <result column="delivery_detail_remakes" property="deliveryDetail.deliveryDetailRemakes"/>
        <result column="order_id" property="deliveryDetail.orderId"/>
        <result column="create_time" property="deliveryDetail.createTime"/>
        <result column="dd_quantity" property="deliveryDetail.quantity"/>
        <result column="project" property="order.project"/>
        <result column="creator" property="delivery.creator"/>
        <result column="customer_name" property="delivery.customerName"/>
        <result column="quantity" property="delivery.quantity"/>
        <result column="d_quantity" property="delivery.quantity"/>
        <result column="area" property="delivery.area"/>
@@ -265,7 +266,7 @@
    <update id="updateDeliveryDetailState">
        update sd.delivery_detail
        set delivery_detail_state=#{state}
        where order_number=#{orderDetail.deliveryDetail.orderNumber}  and order_id=#{orderDetail.deliveryDetail.orderId} and delivery_id=#{orderDetail.deliveryDetail.deliveryId}
        where order_number=#{orderNumber}  and order_id=#{orderId} and delivery_id=#{deliveryId}
    </update>
    <update id="updateInventoryquantityavailable">
@@ -334,7 +335,7 @@
                and dd.delivery_detail_remakes regexp #{orderDetail.deliveryDetail.deliveryDetailRemakes}
            </if>
        </where>
        order by dd.id
        order by dd.id desc
        limit #{offset},#{pageSize};
    </select>
@@ -349,7 +350,7 @@
               d.customer_name,
               od.width,
               od.height,
               d.quantity,
               dd.quantity as dd_quantity,
               od.warehouse_num,
               od.delivery_num,
               d.area,
@@ -363,7 +364,7 @@
                 left join sd.`order` o on o.order_id = dd.order_id
        <where>
                and dd.delivery_detail_state=1
                and dd.delivery_detail_state=1 and d.delivery_state=2
            <if test="orderDetail.deliveryDetail.deliveryId != null and orderDetail.deliveryDetail.deliveryId != ''">
                and dd.delivery_id regexp #{orderDetail.deliveryDetail.deliveryId}
            </if>
@@ -414,7 +415,7 @@
            </if>
        </where>
        order by dd.id
        order by dd.id desc
        limit #{offset},#{pageSize};
    </select>
@@ -453,6 +454,7 @@
        where delivery_id=#{deliveryId}
    </update>
    <update id="updateIntOrderNumberConut">
        update sd.order_detail
        set warehouse_num=warehouse_num+${quantity}
@@ -471,6 +473,12 @@
        where order_number=#{orderNumber} and process_id=#{processId} and order_id=#{order.orderId}
    </update>
    <update id="updateflowcardOut">
        update pp.flow_card
        set received_quantity=received_quantity-${finishedOperateLog.quantity},storage_time=now()
        where order_number=#{finishedOperateLog.operationNumber} and process_id=#{finishedOperateLog.processId} and order_id=#{finishedOperateLog.orderId}
    </update>
    <update id="updateInventory">
        update mm.finished_goods_inventory
        set inventory=inventory+${flowCard.inventoryQuantity},quantity_available=quantity_available+${flowCard.inventoryQuantity},
@@ -484,9 +492,17 @@
        where order_number=#{flowCard.orderNumber}  and order_id=#{flowCard.order.orderId}
    </update>
    <update id="updateInventoryOut">
        update mm.finished_goods_inventory
        set inventory=inventory-${finishedOperateLog.quantity},quantity_available=quantity_available-${finishedOperateLog.quantity},
        update_time=now(),area=actual_signal_area*quantity_available
        where order_number=#{finishedOperateLog.operationNumber}  and order_id=#{finishedOperateLog.orderId}
    </update>
    <insert id="insertFinishedGoodsInventory"  useGeneratedKeys="true"  >
        insert into mm.finished_goods_inventory (order_id,
                                                 order_number,
                                                 process_id,
                                                 inventory,
                                                 actual_signal_area,
                                                 area,
@@ -500,7 +516,7 @@
                                                 remark
        )
        values (
                   #{flowCard.order.orderId} ,#{flowCard.orderNumber},#{flowCard.inventoryQuantity},ROUND(#{flowCard.orderDetail.width}*#{flowCard.orderDetail.height}/1000000,2),
                   #{flowCard.order.orderId} ,#{flowCard.orderNumber},#{flowCard.processId},#{flowCard.inventoryQuantity},ROUND(#{flowCard.orderDetail.width}*#{flowCard.orderDetail.height}/1000000,2),
                   ROUND(#{flowCard.orderDetail.width}*#{flowCard.orderDetail.height}*#{flowCard.inventoryQuantity}/1000000,2),
                #{flowCard.inventoryQuantity},null,#{storageRegion},
                0,now(),now(),null,#{remark}
@@ -535,7 +551,7 @@
        o.project,
        fc.order_number,
        od.quantity,
        fc.inventory_quantity,
        fc.inventory_quantity-fc.received_quantity as inventory_quantity,
        o.area,
        fc.process_id,
        fc.received_quantity,
@@ -591,7 +607,7 @@
            </if>
        </where>
        group by fc.order_id,fc.order_number,fc.process_id order by fc.create_time
        group by fc.order_id,fc.order_number,fc.process_id order by fc.create_time desc
        limit #{offset},#{pageSize};
    </select>
    <select id="getSelectWarehousingPageTotal" >
@@ -737,7 +753,7 @@
            </if>
        </where>
        order by fgi.id
        order by fgi.id desc
        limit #{offset},#{pageSize};
    </select>
north-glass-erp/src/main/resources/mapper/mm/FinishedOperateLog.xml
@@ -20,6 +20,7 @@
        <result column="reviewed_time" property="reviewedTime"/>
        <result column="remarks" property="remarks"/>
        <result column="is_state" property="isState"/>
        <result column="process_id" property="processId"/>
        <result column="width" property="orderDetail.width"/>
        <result column="height" property="orderDetail.height"/>
@@ -27,6 +28,139 @@
        <result column="product_name" property="orderDetail.productName"/>
    </resultMap>
    <select id="getSelectStorageRecord" resultMap="selectFinishedGoodsInventory">
        select fol.id,
        fol.operation_order_number,
        fol.order_id,
        fol.operate_type,
        fol.process_id,
        fol.operation_number,
        fol.quantity,
        fol.operator,
        od.product_id,
        od.product_name,
        od.width,
        od.height,
        fol.operate_time,
        fol.`status`,
        fol.is_state,
        fol.reviewed,
        fol.reviewed_time,
        fol.type,
        fol.remarks
        from (select *
        from mm.finished_operate_log aa where aa.operate_type = #{type}  and aa.status!='已作废') fol
        left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number
        <where>
            date(fol.operate_time)>=#{startDate} and date(fol.operate_time) &lt;= #{endDate}
            <if test="finishedOperateLog.operationOrderNumber != null and finishedOperateLog.operationOrderNumber != ''">
                and fol.operation_order_number regexp #{finishedOperateLog.operationOrderNumber}
            </if>
            <if test="finishedOperateLog.orderId != null and finishedOperateLog.orderId != ''">
                and fol.order_id regexp #{finishedOperateLog.orderId}
            </if>
            <if test="finishedOperateLog.operationNumber != null and finishedOperateLog.operationNumber != ''">
                and fol.operation_number regexp #{finishedOperateLog.operationNumber}
            </if>
            <if test="finishedOperateLog.quantity != null and finishedOperateLog.quantity != ''">
                and fol.quantity regexp #{finishedOperateLog.quantity}
            </if>
            <if test="finishedOperateLog.operator != null and finishedOperateLog.operator != ''">
                and fol.operator regexp #{finishedOperateLog.operator}
            </if>
            <if test="finishedOperateLog.orderDetail.productId != null and finishedOperateLog.orderDetail.productId != ''">
                and  od.product_id regexp #{finishedOperateLog.orderDetail.productId}
            </if>
            <if test="finishedOperateLog.orderDetail.productName != null and finishedOperateLog.orderDetail.productName != ''">
                and  od.product_name regexp #{finishedOperateLog.orderDetail.productName}
            </if>
            <if test="finishedOperateLog.orderDetail.width != null and finishedOperateLog.orderDetail.width != ''">
                and  od.width regexp  REGEXP_REPLACE(#{finishedOperateLog.orderDetail.width},'\\.0+$','')
            </if>
            <if test="finishedOperateLog.orderDetail.height != null and finishedOperateLog.orderDetail.height != ''">
                and  od.height regexp REGEXP_REPLACE(#{finishedOperateLog.orderDetail.height},'\\.0+$','')
            </if>
            <if test="finishedOperateLog.operateTime != null and finishedOperateLog.operateTime != ''">
                and fol.operate_time regexp #{finishedOperateLog.operateTime}
            </if>
            <if test="finishedOperateLog.status != null and finishedOperateLog.status != ''">
                and fol.`status` regexp #{finishedOperateLog.status}
            </if>
            <if test="finishedOperateLog.reviewed != null and finishedOperateLog.reviewed != ''">
                and fol.reviewed regexp #{finishedOperateLog.reviewed}
            </if>
            <if test="finishedOperateLog.reviewedTime != null and finishedOperateLog.reviewedTime != ''">
                and fol.reviewed_time regexp #{finishedOperateLog.reviewedTime}
            </if>
            <if test="finishedOperateLog.type != null and finishedOperateLog.type != ''">
                and fol.type regexp #{finishedOperateLog.type}
            </if>
            <if test="finishedOperateLog.remarks != null and finishedOperateLog.remarks != ''">
                and fol.remarks regexp #{finishedOperateLog.remarksr}
            </if>
        </where>
        order by fol.`status` desc
        limit #{offset},#{pageSize};
    </select>
    <select id="getSelectStorageRecordLogPageTotal">
        select CEILING(count(fol.id)/#{pageSize}) as 'pageTotal',
        count(fol.id) as 'total'
        from (select *
        from mm.finished_operate_log aa where aa.operate_type = #{type}  and aa.status!='已作废') fol
        left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number
        <where>
            date(fol.operate_time)>=#{startDate} and date(fol.operate_time) &lt;= #{endDate}
            <if test="finishedOperateLog.operationOrderNumber != null and finishedOperateLog.operationOrderNumber != ''">
                and fol.operation_order_number regexp #{finishedOperateLog.operationOrderNumber}
            </if>
            <if test="finishedOperateLog.orderId != null and finishedOperateLog.orderId != ''">
                and fol.order_id regexp #{finishedOperateLog.orderId}
            </if>
            <if test="finishedOperateLog.operationNumber != null and finishedOperateLog.operationNumber != ''">
                and fol.operation_number regexp #{finishedOperateLog.operationNumber}
            </if>
            <if test="finishedOperateLog.quantity != null and finishedOperateLog.quantity != ''">
                and fol.quantity regexp #{finishedOperateLog.quantity}
            </if>
            <if test="finishedOperateLog.operator != null and finishedOperateLog.operator != ''">
                and fol.operator regexp #{finishedOperateLog.operator}
            </if>
            <if test="finishedOperateLog.orderDetail.productId != null and finishedOperateLog.orderDetail.productId != ''">
                and  od.product_id regexp #{finishedOperateLog.orderDetail.productId}
            </if>
            <if test="finishedOperateLog.orderDetail.productName != null and finishedOperateLog.orderDetail.productName != ''">
                and  od.product_name regexp #{finishedOperateLog.orderDetail.productName}
            </if>
            <if test="finishedOperateLog.orderDetail.width != null and finishedOperateLog.orderDetail.width != ''">
                and  od.width regexp  REGEXP_REPLACE(#{finishedOperateLog.orderDetail.width},'\\.0+$','')
            </if>
            <if test="finishedOperateLog.orderDetail.height != null and finishedOperateLog.orderDetail.height != ''">
                and  od.height regexp REGEXP_REPLACE(#{finishedOperateLog.orderDetail.height},'\\.0+$','')
            </if>
            <if test="finishedOperateLog.operateTime != null and finishedOperateLog.operateTime != ''">
                and fol.operate_time regexp #{finishedOperateLog.operateTime}
            </if>
            <if test="finishedOperateLog.status != null and finishedOperateLog.status != ''">
                and fol.`status` regexp #{finishedOperateLog.status}
            </if>
            <if test="finishedOperateLog.reviewed != null and finishedOperateLog.reviewed != ''">
                and fol.reviewed regexp #{finishedOperateLog.reviewed}
            </if>
            <if test="finishedOperateLog.reviewedTime != null and finishedOperateLog.reviewedTime != ''">
                and fol.reviewed_time regexp #{finishedOperateLog.reviewedTime}
            </if>
            <if test="finishedOperateLog.type != null and finishedOperateLog.type != ''">
                and fol.type regexp #{finishedOperateLog.type}
            </if>
            <if test="finishedOperateLog.remarks != null and finishedOperateLog.remarks != ''">
                and fol.remarks regexp #{finishedOperateLog.remarksr}
            </if>
        </where>
        order by fol.`status` desc
        limit #{offset},#{pageSize};
    </select>
    <update id="updateToExamine">
        update mm.finished_operate_log set reviewed=#{userName},reviewed_time=now(),status=#{type} where operation_order_number=#{finishedOperateLog.operationOrderNumber};
@@ -289,14 +423,16 @@
    <insert id="insertIntFinishedOperateLog"  useGeneratedKeys="true" >
        insert into mm.finished_operate_log(operation_order_number,
                                            order_id,
                                            process_id,
                                            operation_number,
                                            operate_type,
                                            operator,
                                            quantity,
                                            operate_time
                                            operate_time,
                                            status
        )
        values (
                   #{oddNumber} ,#{flowCard.order.orderId},#{flowCard.orderNumber},"入库",#{userName},#{flowCard.inventoryQuantity},now()
                   #{oddNumber} ,#{flowCard.order.orderId},#{flowCard.processId},#{flowCard.orderNumber},"入库",#{userName},#{flowCard.inventoryQuantity},now(),"未审核"
               )
    </insert>
@@ -307,11 +443,12 @@
                                            operate_type,
                                            operator,
                                            quantity,
                                            operate_time
                                            operate_time,
                                            status
        )
        values (
                   #{orderDetail.deliveryDetail.deliveryId} ,#{orderDetail.deliveryDetail.orderId},#{orderDetail.deliveryDetail.orderNumber}
                   ,"出库",#{userName},#{orderDetail.warehouseNum},now()
                   ,"出库",#{userName},#{orderDetail.deliveryDetail.quantity},now(),"未审核"
               )
    </insert>
north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml
@@ -147,7 +147,7 @@
                 left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd
                           on rw.order_id = ogd.order_id and dd.order_number = ogd.order_number
        where  dd.breakage_quantity-dd.quantity>0 and dd.available=0 and (dd.responsible_process=rw.this_process or (dd.responsible_process!=rw.this_process and dd.qualityIns_status=1))
        where  dd.breakage_quantity-dd.quantity>0 and dd.available=0 and (dd.responsible_process=rw.this_process or (dd.responsible_process!=rw.this_process and dd.quality_ins_status=1))
        order by dd.id desc
    </select>
north-glass-erp/src/main/resources/mapper/pp/ReworkMapper.xml
@@ -90,14 +90,14 @@
               rw.quality_inspector as qualityInspector
        from pp.damage_details dd
                 left join    pp.reporting_work_detail rwd on dd.reporting_work_id = rwd.reporting_work_id and dd.order_number=rwd.order_number  and dd.technology_number=rwd.technology_number
                 left join pp.reporting_work rw on dd.reporting_work_id = rw.reporting_work_id
                 left join pp.reporting_work rw on dd.reporting_work_id = rw.reporting_work_id and rw.reviewed_state>0
                 left join sd.`order` o on rw.order_id = o.order_id
                 left join sd.order_detail od on rw.order_id = od.order_id and dd.order_number = od.order_number
                 left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd
                           on rw.order_id = ogd.order_id and dd.order_number = ogd.order_number
        where  dd.breakage_quantity-dd.quantity>0 and dd.available=1 and dd.qualityIns_status=1 order by dd.id
        where  dd.breakage_quantity-dd.quantity>0 and dd.available=1 and dd.quality_ins_status=1 order by dd.id
    </select>
north-glass-erp/src/main/resources/mapper/sd/DeliveryDetail.xml
@@ -61,7 +61,7 @@
    </delete>
    <update id="updateOrderDetailDeliveryNum">
        update sd.order_detail set delivery_num=#{deliveryDetail.quantity} where order_id=#{orderId} and order_number=#{orderNumber}
        update sd.order_detail set delivery_num=delivery_num+#{deliveryDetail.quantity} where order_id=#{orderId} and order_number=#{orderNumber}
    </update>
    <update id="updateIsNotOrderDetailDeliveryNum">
north-glass-erp/target/classes/mapper/mm/FinishedGoodsInventory.xml
@@ -72,12 +72,13 @@
        <result column="delivery_detail_remakes" property="deliveryDetail.deliveryDetailRemakes"/>
        <result column="order_id" property="deliveryDetail.orderId"/>
        <result column="create_time" property="deliveryDetail.createTime"/>
        <result column="dd_quantity" property="deliveryDetail.quantity"/>
        <result column="project" property="order.project"/>
        <result column="creator" property="delivery.creator"/>
        <result column="customer_name" property="delivery.customerName"/>
        <result column="quantity" property="delivery.quantity"/>
        <result column="d_quantity" property="delivery.quantity"/>
        <result column="area" property="delivery.area"/>
@@ -265,7 +266,7 @@
    <update id="updateDeliveryDetailState">
        update sd.delivery_detail
        set delivery_detail_state=#{state}
        where order_number=#{orderDetail.deliveryDetail.orderNumber}  and order_id=#{orderDetail.deliveryDetail.orderId} and delivery_id=#{orderDetail.deliveryDetail.deliveryId}
        where order_number=#{orderNumber}  and order_id=#{orderId} and delivery_id=#{deliveryId}
    </update>
    <update id="updateInventoryquantityavailable">
@@ -334,7 +335,7 @@
                and dd.delivery_detail_remakes regexp #{orderDetail.deliveryDetail.deliveryDetailRemakes}
            </if>
        </where>
        order by dd.id
        order by dd.id desc
        limit #{offset},#{pageSize};
    </select>
@@ -349,7 +350,7 @@
               d.customer_name,
               od.width,
               od.height,
               d.quantity,
               dd.quantity as dd_quantity,
               od.warehouse_num,
               od.delivery_num,
               d.area,
@@ -363,7 +364,7 @@
                 left join sd.`order` o on o.order_id = dd.order_id
        <where>
                and dd.delivery_detail_state=1
                and dd.delivery_detail_state=1 and d.delivery_state=2
            <if test="orderDetail.deliveryDetail.deliveryId != null and orderDetail.deliveryDetail.deliveryId != ''">
                and dd.delivery_id regexp #{orderDetail.deliveryDetail.deliveryId}
            </if>
@@ -414,7 +415,7 @@
            </if>
        </where>
        order by dd.id
        order by dd.id desc
        limit #{offset},#{pageSize};
    </select>
@@ -453,6 +454,7 @@
        where delivery_id=#{deliveryId}
    </update>
    <update id="updateIntOrderNumberConut">
        update sd.order_detail
        set warehouse_num=warehouse_num+${quantity}
@@ -471,6 +473,12 @@
        where order_number=#{orderNumber} and process_id=#{processId} and order_id=#{order.orderId}
    </update>
    <update id="updateflowcardOut">
        update pp.flow_card
        set received_quantity=received_quantity-${finishedOperateLog.quantity},storage_time=now()
        where order_number=#{finishedOperateLog.operationNumber} and process_id=#{finishedOperateLog.processId} and order_id=#{finishedOperateLog.orderId}
    </update>
    <update id="updateInventory">
        update mm.finished_goods_inventory
        set inventory=inventory+${flowCard.inventoryQuantity},quantity_available=quantity_available+${flowCard.inventoryQuantity},
@@ -484,9 +492,17 @@
        where order_number=#{flowCard.orderNumber}  and order_id=#{flowCard.order.orderId}
    </update>
    <update id="updateInventoryOut">
        update mm.finished_goods_inventory
        set inventory=inventory-${finishedOperateLog.quantity},quantity_available=quantity_available-${finishedOperateLog.quantity},
        update_time=now(),area=actual_signal_area*quantity_available
        where order_number=#{finishedOperateLog.operationNumber}  and order_id=#{finishedOperateLog.orderId}
    </update>
    <insert id="insertFinishedGoodsInventory"  useGeneratedKeys="true"  >
        insert into mm.finished_goods_inventory (order_id,
                                                 order_number,
                                                 process_id,
                                                 inventory,
                                                 actual_signal_area,
                                                 area,
@@ -500,7 +516,7 @@
                                                 remark
        )
        values (
                   #{flowCard.order.orderId} ,#{flowCard.orderNumber},#{flowCard.inventoryQuantity},ROUND(#{flowCard.orderDetail.width}*#{flowCard.orderDetail.height}/1000000,2),
                   #{flowCard.order.orderId} ,#{flowCard.orderNumber},#{flowCard.processId},#{flowCard.inventoryQuantity},ROUND(#{flowCard.orderDetail.width}*#{flowCard.orderDetail.height}/1000000,2),
                   ROUND(#{flowCard.orderDetail.width}*#{flowCard.orderDetail.height}*#{flowCard.inventoryQuantity}/1000000,2),
                #{flowCard.inventoryQuantity},null,#{storageRegion},
                0,now(),now(),null,#{remark}
@@ -535,7 +551,7 @@
        o.project,
        fc.order_number,
        od.quantity,
        fc.inventory_quantity,
        fc.inventory_quantity-fc.received_quantity as inventory_quantity,
        o.area,
        fc.process_id,
        fc.received_quantity,
@@ -591,7 +607,7 @@
            </if>
        </where>
        group by fc.order_id,fc.order_number,fc.process_id order by fc.create_time
        group by fc.order_id,fc.order_number,fc.process_id order by fc.create_time desc
        limit #{offset},#{pageSize};
    </select>
    <select id="getSelectWarehousingPageTotal" >
@@ -737,7 +753,7 @@
            </if>
        </where>
        order by fgi.id
        order by fgi.id desc
        limit #{offset},#{pageSize};
    </select>
north-glass-erp/target/classes/mapper/mm/FinishedOperateLog.xml
@@ -20,6 +20,7 @@
        <result column="reviewed_time" property="reviewedTime"/>
        <result column="remarks" property="remarks"/>
        <result column="is_state" property="isState"/>
        <result column="process_id" property="processId"/>
        <result column="width" property="orderDetail.width"/>
        <result column="height" property="orderDetail.height"/>
@@ -27,6 +28,139 @@
        <result column="product_name" property="orderDetail.productName"/>
    </resultMap>
    <select id="getSelectStorageRecord" resultMap="selectFinishedGoodsInventory">
        select fol.id,
        fol.operation_order_number,
        fol.order_id,
        fol.operate_type,
        fol.process_id,
        fol.operation_number,
        fol.quantity,
        fol.operator,
        od.product_id,
        od.product_name,
        od.width,
        od.height,
        fol.operate_time,
        fol.`status`,
        fol.is_state,
        fol.reviewed,
        fol.reviewed_time,
        fol.type,
        fol.remarks
        from (select *
        from mm.finished_operate_log aa where aa.operate_type = #{type}  and aa.status!='已作废') fol
        left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number
        <where>
            date(fol.operate_time)>=#{startDate} and date(fol.operate_time) &lt;= #{endDate}
            <if test="finishedOperateLog.operationOrderNumber != null and finishedOperateLog.operationOrderNumber != ''">
                and fol.operation_order_number regexp #{finishedOperateLog.operationOrderNumber}
            </if>
            <if test="finishedOperateLog.orderId != null and finishedOperateLog.orderId != ''">
                and fol.order_id regexp #{finishedOperateLog.orderId}
            </if>
            <if test="finishedOperateLog.operationNumber != null and finishedOperateLog.operationNumber != ''">
                and fol.operation_number regexp #{finishedOperateLog.operationNumber}
            </if>
            <if test="finishedOperateLog.quantity != null and finishedOperateLog.quantity != ''">
                and fol.quantity regexp #{finishedOperateLog.quantity}
            </if>
            <if test="finishedOperateLog.operator != null and finishedOperateLog.operator != ''">
                and fol.operator regexp #{finishedOperateLog.operator}
            </if>
            <if test="finishedOperateLog.orderDetail.productId != null and finishedOperateLog.orderDetail.productId != ''">
                and  od.product_id regexp #{finishedOperateLog.orderDetail.productId}
            </if>
            <if test="finishedOperateLog.orderDetail.productName != null and finishedOperateLog.orderDetail.productName != ''">
                and  od.product_name regexp #{finishedOperateLog.orderDetail.productName}
            </if>
            <if test="finishedOperateLog.orderDetail.width != null and finishedOperateLog.orderDetail.width != ''">
                and  od.width regexp  REGEXP_REPLACE(#{finishedOperateLog.orderDetail.width},'\\.0+$','')
            </if>
            <if test="finishedOperateLog.orderDetail.height != null and finishedOperateLog.orderDetail.height != ''">
                and  od.height regexp REGEXP_REPLACE(#{finishedOperateLog.orderDetail.height},'\\.0+$','')
            </if>
            <if test="finishedOperateLog.operateTime != null and finishedOperateLog.operateTime != ''">
                and fol.operate_time regexp #{finishedOperateLog.operateTime}
            </if>
            <if test="finishedOperateLog.status != null and finishedOperateLog.status != ''">
                and fol.`status` regexp #{finishedOperateLog.status}
            </if>
            <if test="finishedOperateLog.reviewed != null and finishedOperateLog.reviewed != ''">
                and fol.reviewed regexp #{finishedOperateLog.reviewed}
            </if>
            <if test="finishedOperateLog.reviewedTime != null and finishedOperateLog.reviewedTime != ''">
                and fol.reviewed_time regexp #{finishedOperateLog.reviewedTime}
            </if>
            <if test="finishedOperateLog.type != null and finishedOperateLog.type != ''">
                and fol.type regexp #{finishedOperateLog.type}
            </if>
            <if test="finishedOperateLog.remarks != null and finishedOperateLog.remarks != ''">
                and fol.remarks regexp #{finishedOperateLog.remarksr}
            </if>
        </where>
        order by fol.`status` desc
        limit #{offset},#{pageSize};
    </select>
    <select id="getSelectStorageRecordLogPageTotal">
        select CEILING(count(fol.id)/#{pageSize}) as 'pageTotal',
        count(fol.id) as 'total'
        from (select *
        from mm.finished_operate_log aa where aa.operate_type = #{type}  and aa.status!='已作废') fol
        left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number
        <where>
            date(fol.operate_time)>=#{startDate} and date(fol.operate_time) &lt;= #{endDate}
            <if test="finishedOperateLog.operationOrderNumber != null and finishedOperateLog.operationOrderNumber != ''">
                and fol.operation_order_number regexp #{finishedOperateLog.operationOrderNumber}
            </if>
            <if test="finishedOperateLog.orderId != null and finishedOperateLog.orderId != ''">
                and fol.order_id regexp #{finishedOperateLog.orderId}
            </if>
            <if test="finishedOperateLog.operationNumber != null and finishedOperateLog.operationNumber != ''">
                and fol.operation_number regexp #{finishedOperateLog.operationNumber}
            </if>
            <if test="finishedOperateLog.quantity != null and finishedOperateLog.quantity != ''">
                and fol.quantity regexp #{finishedOperateLog.quantity}
            </if>
            <if test="finishedOperateLog.operator != null and finishedOperateLog.operator != ''">
                and fol.operator regexp #{finishedOperateLog.operator}
            </if>
            <if test="finishedOperateLog.orderDetail.productId != null and finishedOperateLog.orderDetail.productId != ''">
                and  od.product_id regexp #{finishedOperateLog.orderDetail.productId}
            </if>
            <if test="finishedOperateLog.orderDetail.productName != null and finishedOperateLog.orderDetail.productName != ''">
                and  od.product_name regexp #{finishedOperateLog.orderDetail.productName}
            </if>
            <if test="finishedOperateLog.orderDetail.width != null and finishedOperateLog.orderDetail.width != ''">
                and  od.width regexp  REGEXP_REPLACE(#{finishedOperateLog.orderDetail.width},'\\.0+$','')
            </if>
            <if test="finishedOperateLog.orderDetail.height != null and finishedOperateLog.orderDetail.height != ''">
                and  od.height regexp REGEXP_REPLACE(#{finishedOperateLog.orderDetail.height},'\\.0+$','')
            </if>
            <if test="finishedOperateLog.operateTime != null and finishedOperateLog.operateTime != ''">
                and fol.operate_time regexp #{finishedOperateLog.operateTime}
            </if>
            <if test="finishedOperateLog.status != null and finishedOperateLog.status != ''">
                and fol.`status` regexp #{finishedOperateLog.status}
            </if>
            <if test="finishedOperateLog.reviewed != null and finishedOperateLog.reviewed != ''">
                and fol.reviewed regexp #{finishedOperateLog.reviewed}
            </if>
            <if test="finishedOperateLog.reviewedTime != null and finishedOperateLog.reviewedTime != ''">
                and fol.reviewed_time regexp #{finishedOperateLog.reviewedTime}
            </if>
            <if test="finishedOperateLog.type != null and finishedOperateLog.type != ''">
                and fol.type regexp #{finishedOperateLog.type}
            </if>
            <if test="finishedOperateLog.remarks != null and finishedOperateLog.remarks != ''">
                and fol.remarks regexp #{finishedOperateLog.remarksr}
            </if>
        </where>
        order by fol.`status` desc
        limit #{offset},#{pageSize};
    </select>
    <update id="updateToExamine">
        update mm.finished_operate_log set reviewed=#{userName},reviewed_time=now(),status=#{type} where operation_order_number=#{finishedOperateLog.operationOrderNumber};
@@ -289,14 +423,16 @@
    <insert id="insertIntFinishedOperateLog"  useGeneratedKeys="true" >
        insert into mm.finished_operate_log(operation_order_number,
                                            order_id,
                                            process_id,
                                            operation_number,
                                            operate_type,
                                            operator,
                                            quantity,
                                            operate_time
                                            operate_time,
                                            status
        )
        values (
                   #{oddNumber} ,#{flowCard.order.orderId},#{flowCard.orderNumber},"入库",#{userName},#{flowCard.inventoryQuantity},now()
                   #{oddNumber} ,#{flowCard.order.orderId},#{flowCard.processId},#{flowCard.orderNumber},"入库",#{userName},#{flowCard.inventoryQuantity},now(),"未审核"
               )
    </insert>
@@ -307,11 +443,12 @@
                                            operate_type,
                                            operator,
                                            quantity,
                                            operate_time
                                            operate_time,
                                            status
        )
        values (
                   #{orderDetail.deliveryDetail.deliveryId} ,#{orderDetail.deliveryDetail.orderId},#{orderDetail.deliveryDetail.orderNumber}
                   ,"出库",#{userName},#{orderDetail.warehouseNum},now()
                   ,"出库",#{userName},#{orderDetail.deliveryDetail.quantity},now(),"未审核"
               )
    </insert>
north-glass-erp/target/classes/mapper/pp/PatchLogMapper.xml
@@ -147,7 +147,7 @@
                 left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd
                           on rw.order_id = ogd.order_id and dd.order_number = ogd.order_number
        where  dd.breakage_quantity-dd.quantity>0 and dd.available=0 and (dd.responsible_process=rw.this_process or (dd.responsible_process!=rw.this_process and dd.qualityIns_status=1))
        where  dd.breakage_quantity-dd.quantity>0 and dd.available=0 and (dd.responsible_process=rw.this_process or (dd.responsible_process!=rw.this_process and dd.quality_ins_status=1))
        order by dd.id desc
    </select>
north-glass-erp/target/classes/mapper/pp/ReworkMapper.xml
@@ -90,14 +90,14 @@
               rw.quality_inspector as qualityInspector
        from pp.damage_details dd
                 left join    pp.reporting_work_detail rwd on dd.reporting_work_id = rwd.reporting_work_id and dd.order_number=rwd.order_number  and dd.technology_number=rwd.technology_number
                 left join pp.reporting_work rw on dd.reporting_work_id = rw.reporting_work_id
                 left join pp.reporting_work rw on dd.reporting_work_id = rw.reporting_work_id and rw.reviewed_state>0
                 left join sd.`order` o on rw.order_id = o.order_id
                 left join sd.order_detail od on rw.order_id = od.order_id and dd.order_number = od.order_number
                 left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd
                           on rw.order_id = ogd.order_id and dd.order_number = ogd.order_number
        where  dd.breakage_quantity-dd.quantity>0 and dd.available=1 and dd.qualityIns_status=1 order by dd.id
        where  dd.breakage_quantity-dd.quantity>0 and dd.available=1 and dd.quality_ins_status=1 order by dd.id
    </select>
north-glass-erp/target/classes/mapper/sd/DeliveryDetail.xml
@@ -61,7 +61,7 @@
    </delete>
    <update id="updateOrderDetailDeliveryNum">
        update sd.order_detail set delivery_num=#{deliveryDetail.quantity} where order_id=#{orderId} and order_number=#{orderNumber}
        update sd.order_detail set delivery_num=delivery_num+#{deliveryDetail.quantity} where order_id=#{orderId} and order_number=#{orderNumber}
    </update>
    <update id="updateIsNotOrderDetailDeliveryNum">