| | |
| | | |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import request from "@/utils/request" |
| | | import deepClone from "@/utils/deepClone" |
| | | import VXETable from "vxe-table"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | import {ElMessage} from "element-plus"; |
| | | |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | const userid = userStore.user.userId |
| | | let router=useRouter() |
| | | let produceList = ref([]) |
| | | let tableRef = ref([]) |
| | |
| | | const xGrid = ref(); |
| | | const storageRegion = ref(null); |
| | | const remark = ref(null); |
| | | const flowcard = ref(null); |
| | | |
| | | const gridEvents = { |
| | | toolbarButtonClick ({ code }) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'add': { |
| | | //判断输入框值不能为null |
| | | if(storageRegion.value!==null && storageRegion.value!=""){ |
| | | const $table = xGrid.value |
| | | if ($table) { |
| | | const selectRecords = $table.getCheckboxRecords() |
| | | //循环获取选中的复选框 |
| | | for (let i=0;i<selectRecords.length;i++){ |
| | | //定义后端需要的参数 |
| | | |
| | | let flowData = ref({ |
| | | finishedGoodsInventory:{ |
| | | userId:userid, |
| | | userName:username, |
| | | storageRegion:storageRegion.value, |
| | | remark:remark.value |
| | | }, |
| | | |
| | | flowcard:selectRecords[0] |
| | | remark:remark.value, |
| | | flowcard:selectRecords |
| | | }) |
| | | console.log(flowcard.value) |
| | | |
| | | console.log(flowData.value) |
| | | request.post("/FinishedGoodsInventory/addseletwarehousing",flowData.value).then((res) => { |
| | | /* request.post("/FinishedGoodsInventory/addseletwarehousing/"+storageRegion.value+"/"+remark.value,flowData.value).then((res) => {*/ |
| | | if(res.code===200){ |
| | | alert(`入库成功`) |
| | | request.post("/FinishedGoodsInventory/getseletwarehousing/1/100",filterData.value).then((res) => { |
| | | if(res.code==200){ |
| | | ElMessage.success("入库成功") |
| | | location.reload(); |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | |
| | | if(res.code===200){ |
| | | console.log(res.data) |
| | | pageTotal.value=res.data.total |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | return; |
| | | |
| | | |
| | | }else{ |
| | | alert(`请输入库位`) |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | import {ElMessage} from "element-plus"; |
| | | |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | const userid = userStore.user.userId |
| | | let router=useRouter() |
| | | let produceList = ref([]) |
| | | |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | // case 'edit' :{ |
| | | // //alert('我接收到子组件传送的编辑信息') |
| | | // router.push({path: '/main/productStock/OrderAllocation', query: { id: row.id }}) |
| | | // break |
| | | // } |
| | | // case 'back':{ |
| | | // router.push({path: '/main/productStock/FinishedProductRework', query: { id: row.id }}) |
| | | // break |
| | | // } |
| | | // case 'out' :{ |
| | | // //alert('我接收到子组件传送的编辑信息') |
| | | // router.push({path: '/main/productStock/FinishedGoodsIssue', query: { id: row.id }}) |
| | | // break |
| | | // } |
| | | |
| | | } |
| | | } |
| | | let operateType = ref(null) |
| | | let remarks = ref(null) |
| | | const xGrid = ref(); |
| | | const gridEvents = { |
| | | toolbarButtonClick({ code }) { |
| | |
| | | if($grid){ |
| | | switch (code){ |
| | | case 'verify':{ |
| | | alert('我接收到子组件传送的编辑信息') |
| | | // router.push({path: '/main/productStock/OrderAllocation'}); |
| | | // return; |
| | | break |
| | | const $table = xGrid.value |
| | | if ($table) { |
| | | const selectRecords = $table.getCheckboxRecords() |
| | | console.log(selectRecords) |
| | | |
| | | let flowData = ref({ |
| | | |
| | | userId:userid, |
| | | userName:username, |
| | | operateType:operateType, |
| | | remarks:remarks, |
| | | orderDetail:selectRecords |
| | | |
| | | }) |
| | | request.post("/FinishedGoodsInventory/updateFinishedGoodsInventoryTakeOut",flowData.value).then((res) => { |
| | | if(res.code==200){ |
| | | location.reload(); |
| | | ElMessage.success("领出成功") |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | return |
| | | } |
| | | case 'out':{ |
| | | router.push({path: '/main/productStock/TakeOutRecord'}); |
| | | return; |
| | | break; |
| | | return |
| | | } |
| | | case 'rework':{ |
| | | router.push({path: '/main/productStock/FinishedProductRework'}); |
| | | return; |
| | | break; |
| | | return |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | 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 filterData = ref({ |
| | | finishedGoodsInventory:{ |
| | | orderNumber:'', |
| | | orderId:'', |
| | | quantityAvailable:'', |
| | | actualSignalArea:'', |
| | | area:'', |
| | | storageRegion:'' |
| | | }, |
| | | order:{ |
| | | project:'', |
| | | customerId:'', |
| | | customerName:'' |
| | | |
| | | } |
| | | }) |
| | | let takeOut = ref(null) |
| | | //第一次调用 |
| | | request.post("/FinishedGoodsInventory/getSelectAllocate/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | | pageTotal.value=res.data.total |
| | | takeOut.value=res.data.type |
| | | |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | |
| | | |
| | | //定义页面总页数 |
| | | let pageTotal=ref('') |
| | | //定义当前页数 |
| | | let pageNum=$ref(1) |
| | | 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/getSelectAllocate/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | | pageTotal.value=res.data.total |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | //子组件接收参数 |
| | |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: '50'}, |
| | | { type: 'checkbox',fixed:"left", title: '选择', width: '80' }, |
| | | // { type: 'seq',fixed:"left", title: '自序', width: '80' }, |
| | | // {title: '操作', width: '220', slots: { default: 'button_slot' },fixed:"left"}, |
| | | {field: 'SalesOrderNumber', width: '150',title: '销售单号', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'ProjectName', width: '120',title: '项目名称', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'ProcessCardNumber',width: '100', title: '流程卡号', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: 'FinishedProductNumber', width: '100',title: '成品编号', sortable: true}, |
| | | {field: 'Quantity',width: '140', title: '数量', sortable: true}, |
| | | {field: 'DiaoQuantity',width: '140', title: '领出数量',editRender: { name: 'input', attrs: { placeholder: '' } }, sortable: true}, |
| | | {field: 'ProductNumber',width: '100', title: '产品编号', sortable: true}, |
| | | {field: 'CustomerNumber', width: '100',title: '客户编号', sortable: true}, |
| | | {field: 'CustomerName',width: '100', title: '客户名称', sortable: true}, |
| | | {field: 'Length', width: '100',title: '长度', sortable: true}, |
| | | {field: 'Width',width: '100', title: '宽度', sortable: true}, |
| | | {field: 'Thickness', width: '100',title: '厚度', sortable: true}, |
| | | {field: 'SingleArea',width: '140', title: '单片面积', sortable: true}, |
| | | {field: 'TotalArea',width: '100', title: '总面积', sortable: true}, |
| | | {field: 'StorageArea',width: '100', title: '库区', sortable: true}, |
| | | {field: 'Location',width: '100', title: '库位', sortable: true}, |
| | | { type: 'seq',fixed:"left", title: '自序', width: '80' }, |
| | | {field: 'finishedGoodsInventory.orderId', width: '150',title: '销售单号',showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.project', width: '150',title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'productId',width: '150', title: '产品编号', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'productName', width: '150',title: '产品名称', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'finishedGoodsInventory.quantityAvailable',width: '140', title: '数量', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'quantity',width: '140', title: '领出数量',editRender: { name: 'input', attrs: { placeholder: '' } }}, |
| | | {field: 'order.customerId', width: '100',title: '客户编号', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.customerName',width: '150', title: '客户名称', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'width', width: '100',title: '长度', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'height',width: '100', title: '宽度', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'finishedGoodsInventory.actualSignalArea',width: '140', title: '单片面积', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'finishedGoodsInventory.area',width: '150', title: '总面积', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'finishedGoodsInventory.storageRegion',width: '100', title: '库存区域', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | ],//表头按钮 |
| | | toolbarConfig: { |
| | | buttons: [{ |
| | |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | "SalesOrderNumber": "NG23072003", |
| | | "ProjectName": "钢化玻璃", |
| | | "ProcessCardNumber": "NG23072003A01", |
| | | 'FinishedProductNumber':'', |
| | | 'FinishedProductName':'', |
| | | 'BoxNumber':'', |
| | | "CustomerNumber": "KD0071", |
| | | "CustomerName": "件", |
| | | "Length": "1075.00", |
| | | "Width": "440.00", |
| | | "Thickness": "3.00", |
| | | "Quantity": "360", |
| | | "SingleArea": "0.473000", |
| | | "TotalArea": "170.28", |
| | | "StorageArea": "0.47", |
| | | "Location": "170.28", |
| | | },{ |
| | | "SalesOrderNumber": "NG23072003", |
| | | "ProjectName": "钢化玻璃", |
| | | "ProcessCardNumber": "NG23072003A01", |
| | | 'FinishedProductNumber':'', |
| | | 'FinishedProductName':'', |
| | | 'BoxNumber':'', |
| | | "CustomerNumber": "KD0071", |
| | | "CustomerName": "件", |
| | | "Length": "1075.00", |
| | | "Width": "440.00", |
| | | "Thickness": "3.00", |
| | | "Quantity": "360", |
| | | "SingleArea": "0.473000", |
| | | "TotalArea": "170.28", |
| | | "StorageArea": "0.47", |
| | | "Location": "170.28", |
| | | },{ |
| | | "SalesOrderNumber": "NG23072003", |
| | | "ProjectName": "钢化玻璃", |
| | | "ProcessCardNumber": "NG23072003A01", |
| | | 'FinishedProductNumber':'', |
| | | 'FinishedProductName':'', |
| | | 'BoxNumber':'', |
| | | "CustomerNumber": "KD0071", |
| | | "CustomerName": "件", |
| | | "Length": "1075.00", |
| | | "Width": "440.00", |
| | | "Thickness": "3.00", |
| | | "Quantity": "360", |
| | | "SingleArea": "0.473000", |
| | | "TotalArea": "170.28", |
| | | "StorageArea": "0.47", |
| | | "Location": "170.28", |
| | | }, |
| | | |
| | | ],//table body实际数据 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | | return `页数:${pageNum}/${pageTotal.value}` |
| | | } |
| | | // if (props.tableProp.footList.includes(column.field)) { |
| | | // return sumNum(data, column.field) |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div class="main-div-customer"> |
| | | <vxe-select v-model="operateType" placeholder="请选择领出类型"> |
| | | <vxe-option v-for="(item,index) in takeOut" :key="index" :value="item.operateTypeName" :label="item.operateTypeName" ></vxe-option> |
| | | </vxe-select> |
| | | |
| | | <vxe-input v-model="remarks" placeholder="备注"></vxe-input> |
| | | |
| | | <vxe-grid |
| | | max-height="100%" |
| | | @filter-change="filterChanged" |
| | |
| | | <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>{{ row[item.field] }}</span> |
| | | <span v-if="hasDecimal(item.field)">{{ hasDecimalhtml(item.field,row) }}</span> |
| | | <span v-else>{{ row[item.field] }}</span> |
| | | </li> |
| | | </ul> |
| | | </template> |
| | |
| | | |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request" |
| | | import deepClone from "@/utils/deepClone" |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | import {ElMessage} from "element-plus"; |
| | | |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | const userid = userStore.user.userId |
| | | let router=useRouter() |
| | | let produceList = ref([]) |
| | | //定义页面总页数 |
| | | let pageTotal=ref('') |
| | | //定义当前页数 |
| | | let pageNum=$ref(1) |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | |
| | | } |
| | | } |
| | | |
| | | const xGrid = ref(); |
| | | const gridEvents = { |
| | | toolbarButtonClick({ code }) { |
| | | const $grid = xGrid.value |
| | | if($grid){ |
| | | switch (code){ |
| | | case 'ver':{ |
| | | alert('我接收到子组件传送的编辑信息') |
| | | // router.push({path: '/main/productStock/OrderAllocation'}); |
| | | // return; |
| | | break |
| | | |
| | | const hasDecimal=(value)=>{ |
| | | const regex=/\./ // 定义正则表达式,查找小数点 |
| | | return regex.test(value) //返回true/false |
| | | } |
| | | case 'record':{ |
| | | router.push({path: '/main/productStock/TransferRecord'}); |
| | | return; |
| | | break; |
| | | |
| | | 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]] |
| | | } |
| | | case 'rework':{ |
| | | router.push({path: '/main/productStock/FinishedProductRework'}); |
| | | return; |
| | | break; |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | //筛选条件,有外键需要先定义明细里面的数据 |
| | | let filterData = ref({ |
| | | deliveryDetail:{ |
| | | orderNumber:'', |
| | | deliveryId:'', |
| | | deliveryNumber:'', |
| | | deliveryDetailRemakes:'', |
| | | orderId:'', |
| | | createTime:'' |
| | | }, |
| | | order:{ |
| | | project:'' |
| | | |
| | | }, |
| | | delivery:{ |
| | | creator:'', |
| | | customerName:'', |
| | | quantity:'', |
| | | area:'' |
| | | |
| | | } |
| | | }) |
| | | |
| | | |
| | | |
| | | //第一次调用 |
| | | request.post("/FinishedGoodsInventory/getseletdeliveryDetail/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | | pageTotal.value=res.data.total |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | |
| | | |
| | | |
| | | /*使用筛选,后端获取数据*/ |
| | | 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/getseletdeliveryDetail/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | | pageTotal.value=res.data.total |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: '50'}, |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: '60'}, |
| | | { type: 'checkbox',fixed:"left", title: '选择', width: '80' }, |
| | | { type: 'seq',fixed:"left", title: '自序', width: '80' }, |
| | | {title: '操作', width: '80', slots: { default: 'button_slot' },fixed:"left"}, |
| | | {field: 'DeliveryOrderNumber', width:'150', title: '送货单号', sortable: true,editRender: { name: 'input', attrs: { placeholder: '' } } }, |
| | | {field: 'SalesOrderNumber', width: '150',title: '销售单号', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'ProjectName', width: '120',title: '项目名称', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'ProductName', width: '100',title: '成品名称', sortable: true}, |
| | | {field: 'ProductNumber',width: '100', title: '成品编号', sortable: true}, |
| | | {field: 'CustomerName',width: '100', title: '客户名称', sortable: true}, |
| | | {field: 'Length', width: '100',title: '长度', sortable: true}, |
| | | {field: 'Width',width: '100', title: '宽度', sortable: true}, |
| | | {field: 'Thickness', width: '100',title: '厚度', sortable: true}, |
| | | {field: 'TotalQuantity',width: '140', title: '总数量', sortable: true}, |
| | | {field: 'TotalArea',width: '100', title: '总面积', sortable: true}, |
| | | {field: 'FloorNumber',width: '100', title: '楼层编号', sortable: true}, |
| | | {field: 'OrderNumber',width: '100', title: '订序', sortable: true}, |
| | | {field: 'Salesman',width: '100', title: '业务员', sortable: true}, |
| | | {field: 'BoxNumber',width: '100', title: '箱号', sortable: true}, |
| | | {field: 'Quantity',width: '100', title: '数量', sortable: true}, |
| | | {field: 'ReportingDate',width: '140', title: '报表日期', sortable: true}, |
| | | {field: 'OrderQuantity',width: '100', title: '订单数', sortable: true}, |
| | | {field: 'Status',width: '100', title: '状态', sortable: true}, |
| | | {field: 'remark',width: '80', title: '备注', sortable: true}, |
| | | {field: 'deliveryDetail.deliveryId', width:'150', title: '送货单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' } }, |
| | | {field: 'deliveryDetail.orderId', width: '150',title: '销售单号',showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.project', width: '120',title: '项目名称', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'productId', width: '100',title: '产品编号', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'productName',width: '200', title: '产品名称', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'delivery.customerName',width: '200', title: '客户名称', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'width', width: '100',title: '宽度', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'height',width: '100', title: '高度', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'delivery.quantity',width: '100', title: '订单总数', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'warehouseNum',width: '140', title: '数量', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'delivery.area',width: '100', title: '总面积', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'buildingNumber',width: '100', title: '楼层编号', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'deliveryDetail.orderNumber',width: '100', title: '订单序号', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'delivery.creator',width: '100', title: '业务员', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'deliveryDetail.createTime',width: '140', title: '报表日期', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | //{field: 'Status',width: '100', title: '状态', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'deliveryDetail.deliveryDetailRemakes',width: '80', title: '备注', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | ],//表头按钮 |
| | | toolbarConfig: { |
| | | buttons: [{ |
| | |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | "DeliveryOrderNumber": "1", |
| | | "SalesOrderNumber": "NG23072003", |
| | | "ProjectName": "钢化玻璃", |
| | | "CustomerName": "李二牛", |
| | | "Salesman": "小岳", |
| | | "OrderNumber": '7', |
| | | "FloorNumber": "06040000022", |
| | | "OrderQuantity": "7", |
| | | "Length": "1230.00", |
| | | "Width": "1075.00", |
| | | "Thickness": "6.700", |
| | | "TotalQuantity": "100.00", |
| | | "TotalArea": "360.80", |
| | | "BoxNumber": "06", |
| | | "ReportingDate": "2023-12-22", |
| | | "ProductNumber": "NG2312220001", |
| | | "ProductName": "超级玻璃", |
| | | "Quantity": "360", |
| | | "Status": "已调架", |
| | | "remark": "测试", |
| | | }, { |
| | | "DeliveryOrderNumber": "1", |
| | | "SalesOrderNumber": "NG23072003", |
| | | "ProjectName": "钢化玻璃", |
| | | "CustomerName": "李二牛", |
| | | "Salesman": "小岳", |
| | | "OrderNumber": '7', |
| | | "FloorNumber": "06040000022", |
| | | "OrderQuantity": "7", |
| | | "Length": "1230.00", |
| | | "Width": "1075.00", |
| | | "Thickness": "6.700", |
| | | "TotalQuantity": "100.00", |
| | | "TotalArea": "360.80", |
| | | "BoxNumber": "06", |
| | | "ReportingDate": "2023-12-22", |
| | | "ProductNumber": "NG2312220001", |
| | | "ProductName": "超级玻璃", |
| | | "Quantity": "360", |
| | | "Status": "已调架", |
| | | "remark": "测试", |
| | | }, { |
| | | "DeliveryOrderNumber": "1", |
| | | "SalesOrderNumber": "NG23072003", |
| | | "ProjectName": "钢化玻璃", |
| | | "CustomerName": "李二牛", |
| | | "Salesman": "小岳", |
| | | "OrderNumber": '7', |
| | | "FloorNumber": "06040000022", |
| | | "OrderQuantity": "7", |
| | | "Length": "1230.00", |
| | | "Width": "1075.00", |
| | | "Thickness": "6.700", |
| | | "TotalQuantity": "100.00", |
| | | "TotalArea": "360.80", |
| | | "BoxNumber": "06", |
| | | "ReportingDate": "2023-12-22", |
| | | "ProductNumber": "NG2312220001", |
| | | "ProductName": "超级玻璃", |
| | | "Quantity": "360", |
| | | "Status": "已调架", |
| | | "remark": "测试", |
| | | }, { |
| | | "DeliveryOrderNumber": "1", |
| | | "SalesOrderNumber": "NG23072003", |
| | | "ProjectName": "钢化玻璃", |
| | | "CustomerName": "李二牛", |
| | | "Salesman": "小岳", |
| | | "OrderNumber": '7', |
| | | "FloorNumber": "06040000022", |
| | | "OrderQuantity": "7", |
| | | "Length": "1230.00", |
| | | "Width": "1075.00", |
| | | "Thickness": "6.700", |
| | | "TotalQuantity": "100.00", |
| | | "TotalArea": "360.80", |
| | | "BoxNumber": "06", |
| | | "ReportingDate": "2023-12-22", |
| | | "ProductNumber": "NG2312220001", |
| | | "ProductName": "超级玻璃", |
| | | "Quantity": "360", |
| | | "Status": "已调架", |
| | | "remark": "测试", |
| | | }, { |
| | | "DeliveryOrderNumber": "1", |
| | | "SalesOrderNumber": "NG23072003", |
| | | "ProjectName": "钢化玻璃", |
| | | "CustomerName": "李二牛", |
| | | "Salesman": "小岳", |
| | | "OrderNumber": '7', |
| | | "FloorNumber": "06040000022", |
| | | "OrderQuantity": "7", |
| | | "Length": "1230.00", |
| | | "Width": "1075.00", |
| | | "Thickness": "6.700", |
| | | "TotalQuantity": "100.00", |
| | | "TotalArea": "360.80", |
| | | "BoxNumber": "06", |
| | | "ReportingDate": "2023-12-22", |
| | | "ProductNumber": "NG2312220001", |
| | | "ProductName": "超级玻璃", |
| | | "Quantity": "360", |
| | | "Status": "已调架", |
| | | "remark": "测试", |
| | | }, { |
| | | "DeliveryOrderNumber": "1", |
| | | "SalesOrderNumber": "NG23072003", |
| | | "ProjectName": "钢化玻璃", |
| | | "CustomerName": "李二牛", |
| | | "Salesman": "小岳", |
| | | "OrderNumber": '7', |
| | | "FloorNumber": "06040000022", |
| | | "OrderQuantity": "7", |
| | | "Length": "1230.00", |
| | | "Width": "1075.00", |
| | | "Thickness": "6.700", |
| | | "TotalQuantity": "100.00", |
| | | "TotalArea": "360.80", |
| | | "BoxNumber": "06", |
| | | "ReportingDate": "2023-12-22", |
| | | "ProductNumber": "NG2312220001", |
| | | "ProductName": "超级玻璃", |
| | | "Quantity": "360", |
| | | "Status": "已调架", |
| | | "remark": "测试", |
| | | }, |
| | | |
| | | ],//table body实际数据 |
| | | |
| | | //table body实际数据 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | | return `页数:${pageNum}/${pageTotal.value}` |
| | | } |
| | | // if (props.tableProp.footList.includes(column.field)) { |
| | | // return sumNum(data, column.field) |
| | | // } |
| | | |
| | | return '' |
| | | }) |
| | | ] |
| | | } |
| | | |
| | | }) |
| | | const storageRegion = ref(null); |
| | | const remark = ref(null); |
| | | const xGrid = ref(); |
| | | const gridEvents = { |
| | | toolbarButtonClick ({ code }) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'ver': { |
| | | const $table = xGrid.value |
| | | if ($table) { |
| | | const selectRecords = $table.getCheckboxRecords() |
| | | |
| | | let orderDetailData = ref({ |
| | | userId:userid, |
| | | userName:username, |
| | | orderDetail:selectRecords |
| | | }) |
| | | |
| | | console.log(orderDetailData.value) |
| | | request.post("/FinishedGoodsInventory/adddeliveryDetail",orderDetailData.value).then((res) => { |
| | | if(res.code==200){ |
| | | ElMessage.success("出库成功") |
| | | location.reload(); |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | |
| | | } |
| | | return; |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | <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>{{ row[item.field] }}</span> |
| | | <span v-if="hasDecimal(item.field)">{{ hasDecimalhtml(item.field,row) }}</span> |
| | | <span v-else>{{ row[item.field] }}</span> |
| | | </li> |
| | | </ul> |
| | | </template> |
| | |
| | | } |
| | | case 'out' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/productStock/FinishedGoodsIssue', query: { id: row.id }}) |
| | | break |
| | | router.push({path: '/main/productStock/TakeOutRecord'}); |
| | | return |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request" |
| | | import deepClone from "@/utils/deepClone" |
| | | import userInfo from '@/stores/userInfo' |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | import {ElMessage} from "element-plus"; |
| | | |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | const userid = userStore.user.userId |
| | | let router=useRouter() |
| | | let produceList = ref([]) |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | |
| | | 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 filterData = ref({ |
| | | finishedGoodsInventory:{ |
| | | orderNumber:'', |
| | | orderId:'', |
| | | quantityAvailable:'', |
| | | actualSignalArea:'', |
| | | area:'', |
| | | storageRegion:'' |
| | | }, |
| | | order:{ |
| | | project:'', |
| | | customerId:'', |
| | | customerName:'' |
| | | |
| | | } |
| | | }) |
| | | |
| | | //第一次调用 |
| | | request.post("/FinishedGoodsInventory/getSelectAllocate/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | | pageTotal.value=res.data.total |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | |
| | | |
| | | //定义页面总页数 |
| | | let pageTotal=ref('') |
| | | //定义当前页数 |
| | | let pageNum=$ref(1) |
| | | 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/getSelectAllocate/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | | pageTotal.value=res.data.total |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | |
| | | { type: 'checkbox',fixed:"left", title: '选择', width: '80' }, |
| | | // { type: 'seq',fixed:"left", title: '自序', width: '80' }, |
| | | // {title: '操作', width: '80', slots: { default: 'button_slot' },fixed:"left"}, |
| | | {field: 'SalesOrderNumber', width: '150',title: '销售单号', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'ProjectName', width: '120',title: '项目名称', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'NowNum', width: '120',title: '当前序号', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'Quantity',width: '140', title: '订单数量', sortable: true}, |
| | | {field: 'DiaoSalesOrderNumber', width: '150',title: '调拨单号',editRender: { name: 'input', attrs: { placeholder: '' } }, sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'NewNum', width:'150', title: '新订序', sortable: true,editRender: { name: 'input', attrs: { placeholder: '' } } }, |
| | | {field: 'DiaoQuantity',width: '140', title: '调拨数量',editRender: { name: 'input', attrs: { placeholder: '' } }, sortable: true}, |
| | | {field: 'ProcessCardNumber',width: '100', title: '流程卡号', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: 'FinishedProductNumber', width: '100',title: '成品编号', sortable: true}, |
| | | {field: 'ProductNumber',width: '100', title: '产品编号', sortable: true}, |
| | | {field: 'CustomerNumber', width: '100',title: '客户编号', sortable: true}, |
| | | {field: 'CustomerName',width: '100', title: '客户名称', sortable: true}, |
| | | {field: 'Length', width: '100',title: '长度', sortable: true}, |
| | | {field: 'Width',width: '100', title: '宽度', sortable: true}, |
| | | {field: 'Thickness', width: '100',title: '厚度', sortable: true}, |
| | | {field: 'SingleArea',width: '140', title: '单片面积', sortable: true}, |
| | | {field: 'TotalArea',width: '100', title: '总面积', sortable: true}, |
| | | {field: 'StorageArea',width: '100', title: '库区', sortable: true}, |
| | | {field: 'Location',width: '100', title: '库位', sortable: true}, |
| | | {field: 'finishedGoodsInventory.orderId', width: '150',title: '销售单号',showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.project', width: '120',title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'finishedGoodsInventory.orderNumber', width: '120',title: '当前序号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'finishedGoodsInventory.quantityAvailable',width: '140', title: '订单数量'}, |
| | | {field: 'orderId', width: '150',title: '调拨单号',editRender: { name: 'input', attrs: { placeholder: '' } }, showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderNumber', width:'150', title: '新订序', editRender: { name: 'input', attrs: { placeholder: '' } } }, |
| | | {field: 'quantity',width: '120', title: '调拨数量',editRender: { name: 'input', attrs: { placeholder: '' } }}, |
| | | {field: 'productId', width: '120',title: '产品编号'}, |
| | | {field: 'productName',width: '140', title: '产品名称'}, |
| | | {field: 'order.customerId', width: '100',title: '客户编号'}, |
| | | {field: 'order.customerName',width: '140', title: '客户名称'}, |
| | | {field: 'width', width: '100',title: '宽度'}, |
| | | {field: 'height',width: '100', title: '高度'}, |
| | | {field: 'finishedGoodsInventory.actualSignalArea',width: '140', title: '单片面积'}, |
| | | {field: 'finishedGoodsInventory.area',width: '100', title: '总面积'}, |
| | | {field: 'finishedGoodsInventory.storageRegion',width: '100', title: '库存区域'}, |
| | | ],//表头按钮 |
| | | toolbarConfig: { |
| | | buttons: [ |
| | |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | "SalesOrderNumber": "NG23072003", |
| | | "ProjectName": "钢化玻璃", |
| | | "ProcessCardNumber": "NG23072003A01", |
| | | 'FinishedProductNumber':'', |
| | | 'FinishedProductName':'', |
| | | 'BoxNumber':'', |
| | | "CustomerNumber": "KD0071", |
| | | "CustomerName": "件", |
| | | "Length": "1075.00", |
| | | "Width": "440.00", |
| | | "Thickness": "3.00", |
| | | "Quantity": "360", |
| | | "SingleArea": "0.473000", |
| | | "TotalArea": "170.28", |
| | | "StorageArea": "0.47", |
| | | "Location": "170.28", |
| | | "NowNum":'1' |
| | | },{ |
| | | "SalesOrderNumber": "NG23072003", |
| | | "ProjectName": "钢化玻璃", |
| | | "ProcessCardNumber": "NG23072003A01", |
| | | 'FinishedProductNumber':'', |
| | | 'FinishedProductName':'', |
| | | 'BoxNumber':'', |
| | | "CustomerNumber": "KD0071", |
| | | "CustomerName": "件", |
| | | "Length": "1075.00", |
| | | "Width": "440.00", |
| | | "Thickness": "3.00", |
| | | "Quantity": "360", |
| | | "SingleArea": "0.473000", |
| | | "TotalArea": "170.28", |
| | | "StorageArea": "0.47", |
| | | "Location": "170.28", |
| | | "NowNum":'1' |
| | | },{ |
| | | "SalesOrderNumber": "NG23072003", |
| | | "ProjectName": "钢化玻璃", |
| | | "ProcessCardNumber": "NG23072003A01", |
| | | 'FinishedProductNumber':'', |
| | | 'FinishedProductName':'', |
| | | 'BoxNumber':'', |
| | | "CustomerNumber": "KD0071", |
| | | "CustomerName": "件", |
| | | "Length": "1075.00", |
| | | "Width": "440.00", |
| | | "Thickness": "3.00", |
| | | "Quantity": "360", |
| | | "SingleArea": "0.473000", |
| | | "TotalArea": "170.28", |
| | | "StorageArea": "0.47", |
| | | "Location": "170.28", |
| | | "NowNum":'1' |
| | | }, |
| | | |
| | | ],//table body实际数据 |
| | | //table body实际数据 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | | return `页数:${pageNum}/${pageTotal.value}` |
| | | } |
| | | // if (props.tableProp.footList.includes(column.field)) { |
| | | // return sumNum(data, column.field) |
| | |
| | | if($grid){ |
| | | switch (code){ |
| | | case 'edit':{ |
| | | alert('我接收到子组件传送的编辑信息') |
| | | // router.push({path: '/main/productStock/OrderAllocation'}); |
| | | // return; |
| | | break |
| | | const $table = xGrid.value |
| | | if ($table) { |
| | | const selectRecords = $table.getCheckboxRecords() |
| | | console.log(selectRecords) |
| | | |
| | | let flowData = ref({ |
| | | |
| | | userId:userid, |
| | | userName:username, |
| | | |
| | | orderDetail:selectRecords |
| | | }) |
| | | request.post("/FinishedGoodsInventory/updateFinishedGoodsInventoryAllocate",flowData.value).then((res) => { |
| | | if(res.code==200){ |
| | | |
| | | ElMessage.success("调拨成功") |
| | | location.reload(); |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | } |
| | | return; |
| | | } |
| | | case 'record':{ |
| | | router.push({path: '/main/productStock/TransferRecord'}); |
| | |
| | | <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>{{ row[item.field] }}</span> |
| | | <span v-if="hasDecimal(item.field)">{{ hasDecimalhtml(item.field,row) }}</span> |
| | | <span v-else>{{ row[item.field] }}</span> |
| | | </li> |
| | | </ul> |
| | | </template> |
| | |
| | | <!-- 领出记录 --> |
| | | <script setup> |
| | | |
| | | import {reactive} from "vue"; |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | import {ElMessage} from "element-plus"; |
| | | |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | const userid = userStore.user.userId |
| | | let router=useRouter() |
| | | let produceList = ref([]) |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/trader/CreateTrader', query: { id: row.id }}) |
| | | case 'add' :{ |
| | | alert('我接收到子组件传送的编辑信息') |
| | | break |
| | | } |
| | | case 'delete':{ |
| | |
| | | } |
| | | } |
| | | |
| | | 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 filterData = ref({ |
| | | orderDetail:{ |
| | | width:'', |
| | | height:'', |
| | | productId:'', |
| | | productName:'' |
| | | |
| | | } |
| | | |
| | | }) |
| | | |
| | | //第一次调用 |
| | | request.post("/FinishedGoodsInventory/getSelectOperateRecord/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | | pageTotal.value=res.data.total |
| | | |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | |
| | | |
| | | //定义页面总页数 |
| | | let pageTotal=ref('') |
| | | //定义当前页数 |
| | | let pageNum=$ref(1) |
| | | 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/getSelectOperateRecord/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | | pageTotal.value=res.data.total |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | } |
| | | const a = {field:"status", title: '选择', width: '80',slots: { default: 'state' } } |
| | | |
| | | |
| | | |
| | | |
| | | //子组件接收参数 |
| | | const xGrid = ref(); |
| | | |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: '50'}, |
| | | // { type: 'checkbox',fixed:"left", title: '选择', width: '80' }, |
| | | |
| | | {type: 'checkbox',fixed:"left", title: '选择', width: '80' }, |
| | | //{field:"status", title: '选择', width: '80',slots: { default: 'state' } }, |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: '80'}, |
| | | { type: 'seq',fixed:"left", title: '自序', width: '80' }, |
| | | // {title: '操作', width: '110', slots: { default: 'button_slot' },fixed:"left"}, |
| | | {field: 'id', width:'150', title: '领出单号', sortable: true,}, |
| | | {field: 'MaterialCode', width: '150',title: '原订单号', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'Code', width: '150',title: '序号', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'MaterialName', width: '120',title: '新订单号', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'Origin', width: '100',title: '新序号', sortable: true}, |
| | | {field: 'InventoryNumber',width: '100', title: '领出类型', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: 'Thickness', width: '80',title: '调出数量', sortable: true}, |
| | | {field: 'MainUnit',width: '100', title: '产品编号', sortable: true}, |
| | | {field: 'ProductName',width: '100', title: '产品名称', sortable: true}, |
| | | {field: 'Height', width: '100',title: '长', sortable: true}, |
| | | {field: 'Width',width: '100', title: '宽', sortable: true}, |
| | | {field: 'ZhiDanRen', width: '80',title: '制单人', sortable: true}, |
| | | {field: 'status', width: '80',title: '单据状态', sortable: true}, |
| | | {field: 'SafetyStock', width: '100',title: '制单日期', sortable: true}, |
| | | {field: 'Auditor', width: '100',title: '审核人', sortable: true}, |
| | | {field: 'AuditorDate', width: '100',title: '审核日期', sortable: true}, |
| | | {field: 'status', width: '120',title: '单据状态',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'operationOrderNumber', width:'150', title: '操作单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderId', width: '150',title: '销售单号',showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'operationNumber', width: '100',title: '序号', showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'quantity', width: '140',title: '领出/返工数量',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.productId',width: '100', title: '产品编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.productName',width: '140', title: '产品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.width', width: '100',title: '宽度',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.height',width: '100', title: '高度',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'operator', width: '100',title: '制单人',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'operateTime', width:'140', title: '制单日期',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'reviewed', width: '100',title: '审核人',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'reviewedTime', width: '140',title: '审核日期',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'remarks', width: '140',title: '备注',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | ],//表头按钮 |
| | | toolbarConfig: { |
| | | // buttons: [{ |
| | | // 'name': '新增' |
| | | // }], |
| | | buttons: [{ |
| | | 'name': '审核',status: 'primary', |
| | | 'code':'add' |
| | | }], |
| | | import: false, |
| | | export: true, |
| | | print: true, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | "id": "LC23123011", |
| | | "MaterialCode": "NG23060212", |
| | | "Code": "1", |
| | | "MaterialName": "11月29退货众致", |
| | | "Origin": "补单", |
| | | "InventoryNumber": '退货废弃', |
| | | "Thickness": '876', |
| | | "MainUnit": "0604000108", |
| | | "ProductName": "4mm高性能环保镜", |
| | | "Height": "930.00", |
| | | "Width": "550.00", |
| | | "ZhiDanRen": "曲慧霞", |
| | | "status": "已审核", |
| | | "SafetyStock": "2023-12-30", |
| | | "Auditor": "曲慧霞", |
| | | "AuditorDate": "2023-12-30", |
| | | }, |
| | | { |
| | | "id": "LC23123010", |
| | | "MaterialCode": "NG23060211", |
| | | "Code": "1", |
| | | "MaterialName": "11月29退货众致", |
| | | "Origin": "补单", |
| | | "InventoryNumber": '开介领出', |
| | | "Thickness": '584', |
| | | "MainUnit": "0604000107", |
| | | "ProductName": "5mm环氧树脂镜", |
| | | "Height": "866.00", |
| | | "Width": "486.00", |
| | | "ZhiDanRen": "曲慧霞", |
| | | "status": "已审核", |
| | | "SafetyStock": "2023-12-30", |
| | | "Auditor": "曲慧霞", |
| | | "AuditorDate": "2023-12-30", |
| | | }, |
| | | { |
| | | "id": "LC23123009", |
| | | "MaterialCode": "NG23060210", |
| | | "Code": "1", |
| | | "MaterialName": "11月29退货众致", |
| | | "Origin": "补单", |
| | | "InventoryNumber": '开介领出', |
| | | "Thickness": '584', |
| | | "MainUnit": "0604000106", |
| | | "ProductName": "5mm环氧树脂镜", |
| | | "Height": "866.00", |
| | | "Width": "486.00", |
| | | "ZhiDanRen": "曲慧霞", |
| | | "status": "已审核", |
| | | "SafetyStock": "2023-12-30", |
| | | "Auditor": "曲慧霞", |
| | | "AuditorDate": "2023-12-30", |
| | | }, |
| | | ],//table body实际数据 |
| | | |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | | return `页数:${pageNum}/${pageTotal.value}` |
| | | } |
| | | // if (props.tableProp.footList.includes(column.field)) { |
| | | // return sumNum(data, column.field) |
| | |
| | | } |
| | | |
| | | }) |
| | | |
| | | const gridEvents = { |
| | | toolbarButtonClick ({ code }) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'add': { |
| | | const $table = xGrid.value |
| | | //gridOptions.columns.unshift(a) |
| | | if ($table) { |
| | | const selectRecords = $table.getCheckboxRecords() |
| | | console.log(selectRecords) |
| | | } |
| | | return; |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | } |
| | | |
| | | const checkBoxConfig = { |
| | | checkMethod: ({ row }) => { |
| | | if (row['status']==='已审核'||row['status']==='未通过'){ |
| | | return row.disable |
| | | }else{ |
| | | return !row.disable |
| | | } |
| | | |
| | | }, |
| | | reserve:true |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | :checkbox-config="checkBoxConfig" |
| | | |
| | | > |
| | | |
| | | <!-- <template #state="{ row,column}"> |
| | | <!– <p>{{row[column.field]}}</p>–> |
| | | <!– <el-checkbox v-model="row['isState']" :disabled="row[column.field]==='已审核'||row[column.field]==='未通过'"/>–> |
| | | <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>{{ row[item.field] }}</span> |
| | | <span v-if="hasDecimal(item.field)">{{ hasDecimalhtml(item.field,row) }}</span> |
| | | <span v-else>{{ row[item.field] }}</span> |
| | | </li> |
| | | </ul> |
| | | </template> |
| | |
| | | <!-- 调拨记录 --> |
| | | <script setup> |
| | | |
| | | import {reactive} from "vue"; |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request" |
| | | import deepClone from "@/utils/deepClone" |
| | | let router=useRouter() |
| | | let produceList = ref([]) |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | |
| | | 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 filterData = ref({ |
| | | orderDetail:{ |
| | | productName:'', |
| | | productId:'', |
| | | width:'', |
| | | height:'' |
| | | }, |
| | | getDate:{ |
| | | startDate:'', |
| | | stopDate:'' |
| | | } |
| | | }) |
| | | |
| | | |
| | | //第一次调用 |
| | | request.post("/FinishedGoodsInventory/getselectAllocateFinishedOperateLog/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | | pageTotal.value=res.data.total |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | |
| | | const selectedDate = ref(); |
| | | const xGrid = ref(); |
| | | //定义页面总页数 |
| | | let pageTotal=ref('') |
| | | //定义当前页数 |
| | | let pageNum=$ref(1) |
| | | 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/getselectAllocateFinishedOperateLog/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | | pageTotal.value=res.data.total |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: '50'}, |
| | | // { type: 'checkbox',fixed:"left", title: '选择', width: '80' }, |
| | | { type: 'seq',fixed:"left", title: '自序', width: '80' }, |
| | | // {title: '操作', width: '110', slots: { default: 'button_slot' },fixed:"left"}, |
| | | {field: 'id', width:'150', title: 'ID', sortable: true,}, |
| | | {field: 'MaterialCode', width: '150',title: '原订单号', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'MaterialName', width: '120',title: '新订单号', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'Origin', width: '100',title: '新序号', sortable: true}, |
| | | {field: 'InventoryNumber',width: '100', title: '库存数', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: 'Width', width: '80',title: '调用数量', sortable: true}, |
| | | {field: 'ZhiDanRen', width: '80',title: '制单人', sortable: true}, |
| | | {field: 'Height',width: '100', title: '产品编号', sortable: true}, |
| | | {field: 'Thickness', width: '100',title: '长', sortable: true}, |
| | | {field: 'MainUnit',width: '100', title: '宽', sortable: true}, |
| | | {field: 'SafetyStock', width: '100',title: '制单日期', sortable: true}, |
| | | {field: 'operationOrderNumber', width: '150',title: '新订单号',showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderId', width: '150',title: '原订单号',showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'operationNumber', width: '100',title: '原序号', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'staterOperationOrderNumber', width: '150',title: '新订单号', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'endOperationOrderNumber', width: '100',title: '新序号', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'quantity', width: '120',title: '调拨数量', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'operator', width: '120',title: '制单人', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.productId',width: '100', title: '产品编号', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.productName',width: '100', title: '产品名称', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.width', width: '100',title: '宽度', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.height',width: '100', title: '高度', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'operateTime', width: '100',title: '制单日期', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | ],//表头按钮 |
| | | toolbarConfig: { |
| | | // buttons: [{ |
| | |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | "id": "3765", |
| | | "MaterialCode": "NG23120709", |
| | | "MaterialName": "9", |
| | | "Origin": "NG23122010", |
| | | "InventoryNumber": "20", |
| | | "Width": '12.00', |
| | | "ZhiDanRen": '刘晓艳', |
| | | "Height": "0601000437", |
| | | "Thickness": "1390.00", |
| | | "MainUnit": "760.00", |
| | | "SafetyStock": "2023-12-30", |
| | | }, |
| | | { |
| | | "id": "3766", |
| | | "MaterialCode": "NG23120709", |
| | | "MaterialName": "9", |
| | | "Origin": "NG23122010", |
| | | "InventoryNumber": "20", |
| | | "Width": '12.00', |
| | | "ZhiDanRen": '刘晓艳', |
| | | "Height": "0601000437", |
| | | "Thickness": "1390.00", |
| | | "MainUnit": "760.00", |
| | | "SafetyStock": "2023-12-30", |
| | | },{ |
| | | "id": "3767", |
| | | "MaterialCode": "NG23120709", |
| | | "MaterialName": "9", |
| | | "Origin": "NG23122010", |
| | | "InventoryNumber": "20", |
| | | "Width": '12.00', |
| | | "ZhiDanRen": '刘晓艳', |
| | | "Height": "0601000437", |
| | | "Thickness": "1390.00", |
| | | "MainUnit": "760.00", |
| | | "SafetyStock": "2023-12-30", |
| | | }, |
| | | ],//table body实际数据 |
| | | |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | | return `页数:${pageNum}/${pageTotal.value}` |
| | | } |
| | | // if (props.tableProp.footList.includes(column.field)) { |
| | | // return sumNum(data, column.field) |
| | |
| | | } |
| | | |
| | | }) |
| | | let date; |
| | | const getDate = () => { |
| | | let filterData = ref({ |
| | | orderDetail:{ |
| | | productName:'', |
| | | productId:'', |
| | | width:'', |
| | | height:'' |
| | | }, |
| | | getDate:{ |
| | | startDate:date[0], |
| | | stopDate:date[1], |
| | | } |
| | | }) |
| | | |
| | | request.post("/FinishedGoodsInventory/getselectAllocateFinishedOperateLog/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | | pageTotal.value=res.data.total |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | |
| | | } |
| | | |
| | | |
| | | </script> |
| | |
| | | <el-col :span="2.5"> |
| | | <div class="label-text">制单日期范围</div> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-col :span="3"> |
| | | <el-date-picker |
| | | v-model="selectedDate" |
| | | type="daterange" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | |
| | | /> |
| | | </el-col> |
| | | <el-col span="4"> |
| | | <el-button id="searchButton" type="primary" :icon="Search">查询</el-button> |
| | | <el-button id="searchButton" type="primary" @click="getDate" :icon="Search">查询</el-button> |
| | | </el-col> |
| | | </el-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>{{ row[item.field] }}</span> |
| | | <span v-if="hasDecimal(item.field)">{{ hasDecimalhtml(item.field,row) }}</span> |
| | | <span v-else>{{ row[item.field] }}</span> |
| | | </li> |
| | | </ul> |
| | | </template> |
| | |
| | | |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.entity.mm.FinishedOperateLog; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.exception.ServiceException; |
| | | import com.example.erp.service.mm.FinishedGoodsInventoryService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import com.example.erp.entity.mm.FinishedGoodsInventory; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | |
| | | @Autowired |
| | | FinishedGoodsInventoryService finishedGoodsInventoryService; |
| | | |
| | | /*成品库存查询*/ |
| | | @PostMapping("/getselet/{pageNum}/{pageSize}") |
| | | public Result defaultDateFinishedGoodsInventory(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody FinishedGoodsInventory finishedGoodsInventory){ |
| | | System.out.println(finishedGoodsInventory); |
| | | return Result.seccess(finishedGoodsInventoryService.defaultDateFinishedGoodsInventory(pageNum,pageSize,finishedGoodsInventory)); |
| | | } |
| | | |
| | | /*查询可入库的成品数据*/ |
| | | @PostMapping("/getseletwarehousing/{pageNum}/{pageSize}") |
| | | public Result getseletwarehousing(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody FlowCard flowCard){ |
| | | System.out.println(flowCard); |
| | | return Result.seccess(finishedGoodsInventoryService.getseletwarehousing(pageNum,pageSize,flowCard)); |
| | | } |
| | | |
| | | /*成品入库*/ |
| | | @PostMapping("/addseletwarehousing") |
| | | public Result addseletwarehousing( @RequestBody Map<String,Map<String,Object>> object){ |
| | | public Result addseletwarehousing( @RequestBody Map<String,Object> object){ |
| | | if(finishedGoodsInventoryService.addseletwarehousing(object)){ |
| | | return Result.seccess(); |
| | | }else { |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | /*查询可发货的成品数据*/ |
| | | @PostMapping("/getseletdeliveryDetail/{pageNum}/{pageSize}") |
| | | public Result getseletdeliveryDetail(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody OrderDetail orderDetail){ |
| | | return Result.seccess(finishedGoodsInventoryService.getseletdeliveryDetail(pageNum,pageSize,orderDetail)); |
| | | } |
| | | |
| | | /*成品发货*/ |
| | | @PostMapping("/adddeliveryDetail") |
| | | public Result adddeliveryDetail( @RequestBody Map<String,Object> object){ |
| | | if(finishedGoodsInventoryService.adddeliveryDetail(object)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"出库失败"); |
| | | |
| | | } |
| | | } |
| | | |
| | | /* 调拨查询*/ |
| | | @PostMapping("/getSelectAllocate/{pageNum}/{pageSize}") |
| | | public Result getSelectAllocate(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody OrderDetail orderDetail){ |
| | | return Result.seccess(finishedGoodsInventoryService.getSelectAllocate(pageNum,pageSize,orderDetail)); |
| | | } |
| | | |
| | | /*订单调拨*/ |
| | | @PostMapping("/updateFinishedGoodsInventoryAllocate") |
| | | public Result updateFinishedGoodsInventoryAllocate( @RequestBody Map<String,Object> object){ |
| | | if(finishedGoodsInventoryService.updateFinishedGoodsInventoryAllocate(object)){ |
| | | |
| | | return Result.seccess(); |
| | | |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"调拨失败"); |
| | | |
| | | } |
| | | } |
| | | |
| | | /*领出查询*/ |
| | | @PostMapping("/getselectAllocateFinishedOperateLog/{pageNum}/{pageSize}") |
| | | public Result getselectAllocateFinishedOperateLog(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody FinishedOperateLog finishedOperateLog){ |
| | | return Result.seccess(finishedGoodsInventoryService.getselectAllocateFinishedOperateLog(pageNum,pageSize,finishedOperateLog)); |
| | | } |
| | | |
| | | /*订单领出*/ |
| | | @PostMapping("/updateFinishedGoodsInventoryTakeOut") |
| | | public Result updateFinishedGoodsInventoryTakeOut( @RequestBody Map<String,Object> object){ |
| | | |
| | | if(finishedGoodsInventoryService.updateFinishedGoodsInventoryTakeOut(object)){ |
| | | return Result.seccess(); |
| | | |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"领出失败"); |
| | | |
| | | } |
| | | } |
| | | |
| | | /*领出记录查询*/ |
| | | @PostMapping("/getSelectOperateRecord/{pageNum}/{pageSize}") |
| | | public Result getSelectOperateRecord(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody FinishedOperateLog finishedOperateLog){ |
| | | return Result.seccess(finishedGoodsInventoryService.getSelectOperateRecord(pageNum,pageSize,finishedOperateLog)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.example.erp.entity.mm; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | public class BasicWarehouseType { |
| | | @TableId(type = IdType.AUTO) |
| | | |
| | | private Long id; |
| | | private Integer operateTypeId; |
| | | private String operateTypeName; |
| | | private String operateType; |
| | | private LocalDate createTime; |
| | | |
| | | |
| | | } |
| | |
| | | @TableId(type = IdType.AUTO) |
| | | |
| | | private Long id; |
| | | private Order order; |
| | | private OrderDetail orderDetail; |
| | | private String orderId; |
| | | private Integer orderNumber; |
| | | private Integer inventory ; |
| | | private Double actualSignalArea; |
| | | private Double area; |
| | |
| | | private LocalDate updateTime; |
| | | private LocalDate endTime; |
| | | |
| | | private Order order; |
| | | private OrderDetail orderDetail; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | |
| | | |
| | | private Long id; |
| | | private String operationOrderNumber; |
| | | private Long productNumber; |
| | | private String orderId; |
| | | private Integer operationNumber; |
| | | private Integer quantity; |
| | | private String operateType; |
| | | private String operator; |
| | | private LocalDate operateTime; |
| | | private String staterOperationOrderNumber; |
| | | private String endOperationOrderNumber;; |
| | | private String endOperationOrderNumber; |
| | | |
| | | private String status; |
| | | private Boolean isState; |
| | | private String reviewed; |
| | | private LocalDate reviewedTime; |
| | | private String type; |
| | | private String remarks; |
| | | |
| | | private OrderDetail orderDetail; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.example.erp.mapper.mm; |
| | | |
| | | import com.example.erp.entity.mm.BasicWarehouseType; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.data.repository.CrudRepository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface BasicWarehouseTypeMapper extends CrudRepository<BasicWarehouseType,Long> { |
| | | List<BasicWarehouseType> getBasicWarehouseTypeTakeOut(); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | Integer getseletwarehousingPageTotal(Integer offset, Integer pageSize,FlowCard flowCard); |
| | | |
| | | Integer findOrderNumberdcount(Integer orderNumber); |
| | | Integer findOrderNumberdcount(@Param("orderId") String orderId, |
| | | @Param("orderNumber") Integer orderNumber); |
| | | |
| | | Boolean updateInventory(FlowCard flowCard); |
| | | Integer finishedGoodsInventorybycount(@Param("orderId") String orderId, |
| | | @Param("orderNumber") Integer orderNumber); |
| | | |
| | | Integer findOrderQuantity(String orderId); |
| | | |
| | | Integer findOrderNumberdsum(String orderId); |
| | | |
| | | Boolean updateInventory(@Param("flowCard") FlowCard flowCard, |
| | | @Param("storageRegion") String storageRegion, |
| | | @Param("remark") String remark); |
| | | |
| | | Boolean updateInventoryquantityavailable(@Param("orderDetail") OrderDetail orderDetail); |
| | | Boolean updateflowcard(FlowCard flowCard); |
| | | |
| | | Boolean updateIntOrderNumberConut( @Param("orderId") String orderId, |
| | | @Param("orderNumber") Integer orderNumber, |
| | | @Param("quantity") Integer quantity); |
| | | |
| | | Boolean updateOutOrderNumberConut( @Param("orderId") String orderId, |
| | | @Param("orderNumber") Integer orderNumber, |
| | | @Param("quantity") Integer quantity); |
| | | |
| | | |
| | | Boolean updateOrderWarehousingState(String orderId,Integer state); |
| | | |
| | | Boolean updateOrderDeliveryState(String orderId,Integer state); |
| | | |
| | | Boolean updateDeliveryDetailState(OrderDetail orderDetail,Integer state); |
| | | |
| | | Boolean insertFinishedGoodsInventory(@Param("flowCard") FlowCard flowCard, |
| | | @Param("storageRegion") String storageRegion, |
| | | @Param("remark") String remark); |
| | | |
| | | |
| | | List<OrderDetail> getseletdeliveryDetail(@Param("offset") Integer offset, |
| | | @Param("pageSize") Integer pageSize, |
| | | @Param("orderDetail") OrderDetail orderDetail); |
| | | |
| | | Integer getseletdeliveryDetailPageTotal(Integer offset, Integer pageSize,OrderDetail orderDetail); |
| | | |
| | | List<OrderDetail> getSelectAllocate(@Param("offset") Integer offset, |
| | | @Param("pageSize") Integer pageSize, |
| | | @Param("orderDetail") OrderDetail orderDetail); |
| | | |
| | | Integer getSelectAllocatePageTotal(Integer offset, Integer pageSize,OrderDetail orderDetail); |
| | | |
| | | Boolean updateInventoryquantityAllocateOut(@Param("orderId") String orderId, |
| | | @Param("orderNumber") Integer orderNumber, |
| | | @Param("quantity") Integer quantity); |
| | | Boolean updateInventoryquantityAllocateInt(@Param("orderId") String orderId, |
| | | @Param("orderNumber") Integer orderNumber, |
| | | @Param("quantity") Integer quantity); |
| | | } |
| | | |
| | | |
| | |
| | | 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.OrderDetail; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.data.repository.CrudRepository; |
| | |
| | | public interface FinishedOperateLogMapper extends CrudRepository<FinishedOperateLog,Long> { |
| | | FinishedOperateLog getselectFinishedOperateLog(); |
| | | |
| | | Boolean insertFinishedOperateLog(FlowCard flowCard); |
| | | Boolean insertIntFinishedOperateLog(@Param("flowCard") FlowCard flowCard ,@Param("userName") String userName,@Param("oddNumber") String oddNumber); |
| | | |
| | | Boolean insertOutFinishedOperateLog(@Param("orderDetail") OrderDetail orderDetail,@Param("userName") String userName,@Param("oddNumber") String oddNumber); |
| | | |
| | | Boolean insertFinishedOperateLogAllocate(@Param("orderDetail") OrderDetail orderDetail,@Param("userName") String userName,@Param("oddNumber") String oddNumber); |
| | | |
| | | List<OrderDetail> getselectAllocateFinishedOperateLog(@Param("offset") Integer offset, |
| | | @Param("pageSize") Integer pageSize, |
| | | @Param("finishedOperateLog") FinishedOperateLog finishedOperateLog); |
| | | |
| | | Integer getselectAllocateFinishedOperateLogPageTotal(@Param("offset") Integer offset, |
| | | @Param("pageSize") Integer pageSize, |
| | | @Param("finishedOperateLog") FinishedOperateLog finishedOperateLog); |
| | | |
| | | Integer getmaximum(@Param("type") String type); |
| | | |
| | | Boolean insertFinishedOperateLogTakeOut(@Param("orderDetail") OrderDetail orderDetail, |
| | | @Param("userName") String userName, |
| | | @Param("oddNumber") String oddNumber, |
| | | @Param("operateType") String operateType, |
| | | @Param("remarks") String remarks); |
| | | |
| | | List<OrderDetail> getSelectOperateRecord(@Param("offset") Integer offset, |
| | | @Param("pageSize") Integer pageSize, |
| | | @Param("finishedOperateLog") FinishedOperateLog finishedOperateLog); |
| | | |
| | | Integer getSelectOperateRecordLogPageTotal(@Param("offset") Integer offset, |
| | | @Param("pageSize") Integer pageSize, |
| | | @Param("finishedOperateLog") FinishedOperateLog finishedOperateLog); |
| | | } |
| | |
| | | package com.example.erp.service.mm; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.example.erp.entity.mm.FinishedGoodsInventory; |
| | |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.mapper.mm.BasicWarehouseTypeMapper; |
| | | import com.example.erp.mapper.mm.FinishedGoodsInventoryMapper; |
| | | import com.example.erp.mapper.mm.FinishedOperateLogMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.sql.SQLException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | | @DS("mm") |
| | |
| | | FinishedGoodsInventoryMapper finishedGoodsInventoryMapper; |
| | | @Autowired |
| | | FinishedOperateLogMapper finishedOperateLogMapper; |
| | | @Autowired |
| | | BasicWarehouseTypeMapper basicWarehouseTypeMapper; |
| | | |
| | | public Map<String,Object> defaultDateFinishedGoodsInventory(Integer pageNum, Integer pageSize,FinishedGoodsInventory finishedGoodsInventory) { |
| | | Integer offset = (pageNum-1)*pageSize; |
| | | Map<String,Object> map = new HashMap<>(); |
| | |
| | | return map; |
| | | } |
| | | |
| | | public Boolean addseletwarehousing(Map<String,Map<String,Object>> object) { |
| | | public Boolean addseletwarehousing(Map<String,Object> object) { |
| | | Boolean isinsert=false; |
| | | |
| | | Map<String,Object> maps= object.get("finishedGoodsInventory"); |
| | | String storageRegion= maps.get("storageRegion").toString(); |
| | | String remark= maps.get("remark").toString(); |
| | | JSONObject jsonObject = new JSONObject(object.get("flowcard")); |
| | | FlowCard flowCard = JSONObject.parseObject(JSONObject.toJSONString(jsonObject), FlowCard.class); |
| | | System.out.println("数据2:"+flowCard); |
| | | //定义前端传输的数据 |
| | | String storageRegion = ""; |
| | | String remark = ""; |
| | | if (object.get("remark") != null) { |
| | | remark = object.get("remark").toString(); |
| | | } |
| | | if (object.get("storageRegion") != null) { |
| | | storageRegion = object.get("storageRegion").toString(); |
| | | } |
| | | |
| | | String userName = ""; |
| | | String userId = ""; |
| | | if (object.get("userName") != null) { |
| | | userName = object.get("userName").toString(); |
| | | } |
| | | if (object.get("userId") != null) { |
| | | userId = object.get("userId").toString(); |
| | | } |
| | | |
| | | //获取对象集合循环进行新增修改 |
| | | List<FlowCard> flowCardlist = JSONArray.parseArray(JSONObject.toJSONString(object.get("flowcard")), FlowCard.class); |
| | | if (!flowCardlist.isEmpty()){ |
| | | for (FlowCard flowCard : flowCardlist) { |
| | | //获取单号 |
| | | String oddNumber= orderNumberSetting("入库"); |
| | | //添加出入库记录 |
| | | finishedOperateLogMapper.insertFinishedOperateLog(flowCard); |
| | | finishedOperateLogMapper.insertIntFinishedOperateLog(flowCard,userName,oddNumber); |
| | | System.out.println(flowCard.getOrder().getOrderId()); |
| | | Integer finishedGoodsInventorycount=finishedGoodsInventoryMapper.findOrderNumberdcount(flowCard.getOrderNumber()); |
| | | System.out.println("数量:"+finishedGoodsInventorycount); |
| | | Integer finishedGoodsInventorycount = finishedGoodsInventoryMapper.findOrderNumberdcount(flowCard.getOrder().getOrderId(),flowCard.getOrderNumber()); |
| | | Integer ordersum = finishedGoodsInventoryMapper.findOrderQuantity(flowCard.getOrder().getOrderId()); |
| | | Integer ordernumbersum = finishedGoodsInventoryMapper.findOrderNumberdsum(flowCard.getOrder().getOrderId()); |
| | | |
| | | System.out.println("订单总数:" + ordersum + "已入库数量:" + ordernumbersum + "准备入库数量" + flowCard.getInventoryQuantity()); |
| | | if(finishedGoodsInventorycount>0){ |
| | | finishedGoodsInventoryMapper.updateInventory(flowCard); |
| | | //修改库存表入库数量 |
| | | finishedGoodsInventoryMapper.updateInventory(flowCard,storageRegion, remark); |
| | | //修改流程卡表入库数量 |
| | | finishedGoodsInventoryMapper.updateflowcard(flowCard); |
| | | return true; |
| | | //修改订单明细表入库数量 |
| | | finishedGoodsInventoryMapper.updateIntOrderNumberConut(flowCard.getOrder().getOrderId(),flowCard.getOrderNumber(),flowCard.getInventoryQuantity()); |
| | | //判断订单是否全部入库 |
| | | if (ordersum == (ordernumbersum + flowCard.getInventoryQuantity())) { |
| | | //修改订单表入库状态 |
| | | finishedGoodsInventoryMapper.updateOrderWarehousingState(flowCard.getOrder().getOrderId(),2); |
| | | } |
| | | isinsert=true; |
| | | }else{ |
| | | if (finishedGoodsInventoryMapper.insertFinishedGoodsInventory(flowCard,storageRegion,remark)){ |
| | | //修改流程卡表入库数量 |
| | | finishedGoodsInventoryMapper.updateflowcard(flowCard); |
| | | return true; |
| | | //修改订单明细表入库数量 |
| | | finishedGoodsInventoryMapper.updateIntOrderNumberConut(flowCard.getOrder().getOrderId(),flowCard.getOrderNumber(),flowCard.getInventoryQuantity()); |
| | | //修改订单表入库状态 |
| | | finishedGoodsInventoryMapper.updateOrderWarehousingState(flowCard.getOrder().getOrderId(),1); |
| | | isinsert=true; |
| | | } else { |
| | | isinsert= false; |
| | | } |
| | | } |
| | | } |
| | | return isinsert; |
| | | }else{ |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | /*Order order=finishedGoodsInventoryMapper.findOrderId(flowCard.getOrder().getOrderId()); |
| | | OrderDetail orderDetail=finishedGoodsInventoryMapper.findOrderNumber(flowCard.getOrderNumber());*/ |
| | | /*finishedGoodsInventory.setOrder(order); |
| | | finishedGoodsInventory.setOrderDetail(orderDetail); |
| | | finishedGoodsInventory.setInventory(flowCard.getInventoryQuantity()); |
| | | finishedGoodsInventory.setActualSignalArea(flowCard.getOrderDetail().getHeight()*flowCard.getOrderDetail().getWidth()); |
| | | finishedGoodsInventory.setArea(flowCard.getOrderDetail().getHeight()*flowCard.getOrderDetail().getWidth()*flowCard.getInventoryQuantity()); |
| | | finishedGoodsInventory.setQuantityAvailable(flowCard.getInventoryQuantity()); |
| | | finishedGoodsInventory.setWarehouseNumber(flowCard.getOrderDetail().getBuildingNumber()); |
| | | finishedGoodsInventory.setStorageRegion(flowCard.getOrderDetail().getBuildingNumber()); |
| | | finishedGoodsInventory.setStatus(0); |
| | | finishedGoodsInventory.setEnterStorageTime(LocalDate.now()); |
| | | finishedGoodsInventory.setUpdateTime(LocalDate.now()); |
| | | finishedGoodsInventory.setEndTime(null); |
| | | finishedGoodsInventory.setRemark("");*/ |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | public Map<String, Object> getseletdeliveryDetail(Integer pageNum, Integer pageSize, OrderDetail orderDetail) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", finishedGoodsInventoryMapper.getseletdeliveryDetail(offset, pageSize, orderDetail)); |
| | | map.put("total", finishedGoodsInventoryMapper.getseletdeliveryDetailPageTotal(offset, pageSize, orderDetail)); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | public Boolean adddeliveryDetail(Map<String,Object> object) { |
| | | Boolean isinsert=false; |
| | | String userName = ""; |
| | | String userId = ""; |
| | | if (object.get("userName") != null) { |
| | | userName = object.get("userName").toString(); |
| | | } |
| | | if (object.get("userId") != null) { |
| | | userId = object.get("userId").toString(); |
| | | } |
| | | //获取对象集合循环进行新增修改 |
| | | List<OrderDetail> orderDetaillist = JSONArray.parseArray(JSONObject.toJSONString(object.get("orderDetail")), OrderDetail.class); |
| | | if (!orderDetaillist.isEmpty()){ |
| | | for (OrderDetail orderDetail : orderDetaillist) { |
| | | //获取单号 |
| | | String oddNumber= orderNumberSetting("出库"); |
| | | //添加出入库记录 |
| | | finishedOperateLogMapper.insertOutFinishedOperateLog(orderDetail,userName,oddNumber); |
| | | Integer finishedGoodsInventorycount = finishedGoodsInventoryMapper.findOrderNumberdcount(orderDetail.getDeliveryDetail().getOrderId(),orderDetail.getDeliveryDetail().getOrderNumber()); |
| | | System.out.println("数据3:"+finishedGoodsInventorycount); |
| | | Integer finishedGoodsInventorybycount=finishedGoodsInventoryMapper.finishedGoodsInventorybycount(orderDetail.getDeliveryDetail().getOrderId(),orderDetail.getDeliveryDetail().getOrderNumber()); |
| | | Integer ordersum = finishedGoodsInventoryMapper.findOrderQuantity(orderDetail.getDeliveryDetail().getOrderId()); |
| | | Integer ordernumbersum = finishedGoodsInventoryMapper.findOrderNumberdsum(orderDetail.getDeliveryDetail().getOrderId()); |
| | | |
| | | System.out.println("订单总数:" + ordersum + "订单剩余数量:" + ordernumbersum + "准备出库数量" + orderDetail.getWarehouseNum()+ "库存数量" + finishedGoodsInventorybycount); |
| | | if (finishedGoodsInventorycount > 0) { |
| | | if(Objects.equals(finishedGoodsInventorybycount, orderDetail.getWarehouseNum())){ |
| | | System.out.println(123); |
| | | //修改库存表出库数量 |
| | | finishedGoodsInventoryMapper.updateInventoryquantityavailable(orderDetail); |
| | | //修改发货明细表状态 |
| | | finishedGoodsInventoryMapper.updateDeliveryDetailState(orderDetail,0); |
| | | //修改订单明细表发货数量 |
| | | finishedGoodsInventoryMapper.updateOutOrderNumberConut(orderDetail.getDeliveryDetail().getOrderId(),orderDetail.getDeliveryDetail().getOrderNumber(),orderDetail.getWarehouseNum()); |
| | | //修改订单表发货状态 |
| | | finishedGoodsInventoryMapper.updateOrderDeliveryState(orderDetail.getDeliveryDetail().getOrderId(),1); |
| | | //判断订单是否全部发货 |
| | | if (0 == (ordernumbersum - orderDetail.getWarehouseNum())) { |
| | | //修改订单表发货状态 |
| | | finishedGoodsInventoryMapper.updateOrderDeliveryState(orderDetail.getDeliveryDetail().getOrderId(),2); |
| | | } |
| | | isinsert=true; |
| | | } |
| | | |
| | | } else { |
| | | isinsert=false; |
| | | } |
| | | } |
| | | return isinsert; |
| | | }else{ |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | public Map<String, Object> getSelectAllocate(Integer pageNum, Integer pageSize, OrderDetail orderDetail) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", finishedGoodsInventoryMapper.getSelectAllocate(offset, pageSize, orderDetail)); |
| | | map.put("total", finishedGoodsInventoryMapper.getSelectAllocatePageTotal(offset, pageSize, orderDetail)); |
| | | map.put("type", basicWarehouseTypeMapper.getBasicWarehouseTypeTakeOut()); |
| | | return map; |
| | | } |
| | | |
| | | public Boolean updateFinishedGoodsInventoryAllocate(Map<String,Object> object) { |
| | | Boolean isinsert=false; |
| | | String userName = ""; |
| | | String userId = ""; |
| | | if (object.get("userName") != null) { |
| | | userName = object.get("userName").toString(); |
| | | } |
| | | if (object.get("userId") != null) { |
| | | userId = object.get("userId").toString(); |
| | | } |
| | | //获取对象集合循环进行新增修改 |
| | | List<OrderDetail> orderDetaillist = JSONArray.parseArray(JSONObject.toJSONString(object.get("orderDetail")), OrderDetail.class); |
| | | if (!orderDetaillist.isEmpty()){ |
| | | for (OrderDetail orderDetail : orderDetaillist) { |
| | | Integer oldordersum = finishedGoodsInventoryMapper.findOrderQuantity(orderDetail.getFinishedGoodsInventory().getOrderId()); |
| | | Integer oldordernumbersum = finishedGoodsInventoryMapper.findOrderNumberdsum(orderDetail.getFinishedGoodsInventory().getOrderId()); |
| | | |
| | | Integer newordersum = finishedGoodsInventoryMapper.findOrderQuantity(orderDetail.getOrderId()); |
| | | Integer newordernumbersum = finishedGoodsInventoryMapper.findOrderNumberdsum(orderDetail.getOrderId()); |
| | | |
| | | //获取单号 |
| | | String oddNumber= orderNumberSetting("调拨"); |
| | | //添加调拨记录 |
| | | finishedOperateLogMapper.insertFinishedOperateLogAllocate(orderDetail,userName,oddNumber); |
| | | //修改原订单的库存数量 |
| | | finishedGoodsInventoryMapper.updateInventoryquantityAllocateOut(orderDetail.getFinishedGoodsInventory().getOrderId(),orderDetail.getFinishedGoodsInventory().getOrderNumber(), Math.toIntExact(orderDetail.getQuantity())); |
| | | //修改调拨后订单的库存数量 |
| | | finishedGoodsInventoryMapper.updateInventoryquantityAllocateInt(orderDetail.getOrderId(),orderDetail.getOrderNumber(), Math.toIntExact(orderDetail.getQuantity())); |
| | | //修改原订单明细表发货数量 |
| | | finishedGoodsInventoryMapper.updateOutOrderNumberConut(orderDetail.getFinishedGoodsInventory().getOrderId(),orderDetail.getFinishedGoodsInventory().getOrderNumber(), Math.toIntExact(orderDetail.getQuantity())); |
| | | //修改调拨新订单明细表发货数量 |
| | | finishedGoodsInventoryMapper.updateIntOrderNumberConut(orderDetail.getOrderId(),orderDetail.getOrderNumber(), Math.toIntExact(orderDetail.getQuantity())); |
| | | if (newordersum==newordernumbersum+orderDetail.getQuantity()){ |
| | | //修改订单表入库状态 |
| | | finishedGoodsInventoryMapper.updateOrderWarehousingState(orderDetail.getOrderId(),2); |
| | | } |
| | | if (Objects.equals(oldordersum, oldordernumbersum)){ |
| | | //修改订单表入库状态 |
| | | finishedGoodsInventoryMapper.updateOrderWarehousingState(orderDetail.getFinishedGoodsInventory().getOrderId(),1); |
| | | } |
| | | isinsert=true; |
| | | } |
| | | return isinsert; |
| | | }else{ |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | public Map<String, Object> getselectAllocateFinishedOperateLog(Integer pageNum, Integer pageSize, FinishedOperateLog finishedOperateLog) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", finishedOperateLogMapper.getselectAllocateFinishedOperateLog(offset, pageSize, finishedOperateLog)); |
| | | map.put("total", finishedOperateLogMapper.getselectAllocateFinishedOperateLogPageTotal(offset, pageSize, finishedOperateLog)); |
| | | return map; |
| | | } |
| | | |
| | | public Boolean updateFinishedGoodsInventoryTakeOut(Map<String,Object> object) { |
| | | Boolean isinsert=false; |
| | | String userName = ""; |
| | | String userId = ""; |
| | | if (object.get("userName") != null) { |
| | | userName = object.get("userName").toString(); |
| | | System.out.println(12344); |
| | | } |
| | | if (object.get("userId") != null) { |
| | | userId = object.get("userId").toString(); |
| | | } |
| | | |
| | | String operateType = ""; |
| | | String remarks = ""; |
| | | if (object.get("remarks") != null) { |
| | | remarks = object.get("remarks").toString(); |
| | | } |
| | | if (object.get("operateType") != null) { |
| | | operateType = object.get("operateType").toString(); |
| | | } |
| | | //获取对象集合循环进行新增修改 |
| | | List<OrderDetail> orderDetaillist = JSONArray.parseArray(JSONObject.toJSONString(object.get("orderDetail")), OrderDetail.class); |
| | | if (!orderDetaillist.isEmpty()){ |
| | | for (OrderDetail orderDetail : orderDetaillist) { |
| | | Integer oldordersum = finishedGoodsInventoryMapper.findOrderQuantity(orderDetail.getFinishedGoodsInventory().getOrderId()); |
| | | Integer oldordernumbersum = finishedGoodsInventoryMapper.findOrderNumberdsum(orderDetail.getFinishedGoodsInventory().getOrderId()); |
| | | |
| | | //获取单号 |
| | | String oddNumber= orderNumberSetting("领出"); |
| | | //添加领出记录 |
| | | finishedOperateLogMapper.insertFinishedOperateLogTakeOut(orderDetail,userName,oddNumber,operateType,remarks); |
| | | //修改库存数量 |
| | | finishedGoodsInventoryMapper.updateInventoryquantityAllocateOut(orderDetail.getFinishedGoodsInventory().getOrderId(),orderDetail.getFinishedGoodsInventory().getOrderNumber(), Math.toIntExact(orderDetail.getQuantity())); |
| | | //修改订单明细表数量 |
| | | finishedGoodsInventoryMapper.updateOutOrderNumberConut(orderDetail.getFinishedGoodsInventory().getOrderId(),orderDetail.getFinishedGoodsInventory().getOrderNumber(), Math.toIntExact(orderDetail.getQuantity())); |
| | | if (Objects.equals(oldordersum, oldordernumbersum)){ |
| | | //修改订单表入库状态 |
| | | finishedGoodsInventoryMapper.updateOrderWarehousingState(orderDetail.getFinishedGoodsInventory().getOrderId(),1); |
| | | } |
| | | isinsert=true; |
| | | } |
| | | return isinsert; |
| | | }else{ |
| | | return false; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | public Map<String, Object> getselectTakeOutFinishedOperateLog(Integer pageNum, Integer pageSize, FinishedOperateLog finishedOperateLog) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", finishedOperateLogMapper.getselectAllocateFinishedOperateLog(offset, pageSize, finishedOperateLog)); |
| | | map.put("total", finishedOperateLogMapper.getselectAllocateFinishedOperateLogPageTotal(offset, pageSize, finishedOperateLog)); |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> getSelectOperateRecord(Integer pageNum, Integer pageSize, FinishedOperateLog finishedOperateLog) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", finishedOperateLogMapper.getSelectOperateRecord(offset, pageSize, finishedOperateLog)); |
| | | map.put("total", finishedOperateLogMapper.getSelectOperateRecordLogPageTotal(offset, pageSize, finishedOperateLog)); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public String orderNumberSetting(String type) { |
| | | //根据类型自动生成不同的操作单号 |
| | | String alias=""; |
| | | if(Objects.equals(type, "入库")){ |
| | | alias="RK"; |
| | | }else if(Objects.equals(type, "出库")){ |
| | | alias="CK"; |
| | | }else if(Objects.equals(type, "调拨")){ |
| | | alias="DB"; |
| | | }else if(Objects.equals(type, "领出")){ |
| | | alias="LC"; |
| | | }else if(Objects.equals(type, "返工")){ |
| | | alias="FG"; |
| | | } |
| | | //查询当天的最大数量 |
| | | Integer maximum=finishedOperateLogMapper.getmaximum(type); |
| | | //设置两位不够补0 |
| | | String formattedNumber = String.format("%02d", maximum+1); |
| | | //格式化当前日期 |
| | | Date currentDate = new Date(); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMdd"); |
| | | String formattedDate = dateFormat.format(currentDate); |
| | | String oddNumbers = alias+formattedDate+formattedNumber; |
| | | return oddNumbers; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.example.erp.mapper.mm.BasicWarehouseTypeMapper"> |
| | | |
| | | <select id="getBasicWarehouseTypeTakeOut" > |
| | | select * from mm.basic_warehouse_type where operate_type='领出'; |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | </mapper> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.example.erp.mapper.mm.FinishedGoodsInventoryMapper"> |
| | | |
| | | <!--映射成品库存--> |
| | | <resultMap id="selectFinishedGoodsInventory" type="com.example.erp.entity.mm.FinishedGoodsInventory"> |
| | | <id column="fid" property="id"/> |
| | | <result column="inventory" property="inventory"/> |
| | |
| | | <result column="product_id" property="orderDetail.productId"/> |
| | | |
| | | </resultMap> |
| | | |
| | | <!--映射成品入库--> |
| | | <resultMap id="selectFlowCard" type="com.example.erp.entity.pp.FlowCard"> |
| | | <id column="id" property="id"/> |
| | | <result column="order_number" property="orderNumber"/> |
| | |
| | | |
| | | <result column="order_id" property="order.orderId"/> |
| | | <result column="project" property="order.project"/> |
| | | <result column="creater" property="order.creater"/> |
| | | <result column="creator" property="order.creator"/> |
| | | <result column="area" property="order.area"/> |
| | | <result column="batch" property="order.batch"/> |
| | | <result column="order_quantity" property="order.quantity"/> |
| | | |
| | | <result column="building_number" property="orderDetail.buildingNumber"/> |
| | | <result column="width" property="orderDetail.width"/> |
| | |
| | | <result column="quantity" property="orderDetail.quantity"/> |
| | | </resultMap> |
| | | |
| | | <!--映射成品出库--> |
| | | <resultMap id="selectDelivery" type="com.example.erp.entity.sd.OrderDetail"> |
| | | <id column="id" property="id"/> |
| | | <result column="building_number" property="buildingNumber"/> |
| | | <result column="width" property="width"/> |
| | | <result column="height" property="height"/> |
| | | <result column="product_name" property="productName"/> |
| | | <result column="product_id" property="productId"/> |
| | | <result column="warehouse_num" property="warehouseNum"/> |
| | | |
| | | <result column="order_number" property="deliveryDetail.orderNumber"/> |
| | | <result column="delivery_id" property="deliveryDetail.deliveryId"/> |
| | | <result column="delivery_number" property="deliveryDetail.deliveryNumber"/> |
| | | <result column="delivery_detail_remakes" property="deliveryDetail.deliveryDetailRemakes"/> |
| | | <result column="order_id" property="deliveryDetail.orderId"/> |
| | | <result column="create_time" property="deliveryDetail.createTime"/> |
| | | |
| | | <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="area" property="delivery.area"/> |
| | | |
| | | |
| | | </resultMap> |
| | | |
| | | <!--映射订单调拨--> |
| | | <resultMap id="selectDeliveryFinishedGoodsInventory" type="com.example.erp.entity.sd.OrderDetail"> |
| | | |
| | | <result column="width" property="width"/> |
| | | <result column="height" property="height"/> |
| | | <result column="product_name" property="productName"/> |
| | | <result column="product_id" property="productId"/> |
| | | |
| | | <result column="order_id" property="finishedGoodsInventory.orderId"/> |
| | | <result column="order_number" property="finishedGoodsInventory.orderNumber"/> |
| | | <result column="quantity_available" property="finishedGoodsInventory.quantityAvailable"/> |
| | | <result column="actual_signal_area" property="finishedGoodsInventory.actualSignalArea"/> |
| | | <result column="area" property="finishedGoodsInventory.area"/> |
| | | <result column="storage_region" property="finishedGoodsInventory.storageRegion"/> |
| | | |
| | | <result column="project" property="order.project"/> |
| | | <result column="customer_id" property="order.customerId"/> |
| | | <result column="customer_name" property="order.customerName"/> |
| | | |
| | | |
| | | </resultMap> |
| | | <update id="updateInventoryquantityAllocateInt"> |
| | | update mm.finished_goods_inventory |
| | | set inventory=inventory+#{quantity},quantity_available=quantity_available+#{quantity}, |
| | | update_time=now(),area=actual_signal_area*quantity_available |
| | | where order_number=#{orderNumber} and order_id=#{orderId} |
| | | </update> |
| | | |
| | | <update id="updateInventoryquantityAllocateOut"> |
| | | update mm.finished_goods_inventory |
| | | set inventory=inventory-#{quantity},quantity_available=quantity_available-#{quantity}, |
| | | update_time=now(),area=actual_signal_area*quantity_available |
| | | where order_number=#{orderNumber} and order_id=#{orderId} |
| | | </update> |
| | | |
| | | <select id="getSelectAllocate" resultMap="selectDeliveryFinishedGoodsInventory"> |
| | | select fgi.order_id, |
| | | o.project, |
| | | fgi.order_number, |
| | | fgi.quantity_available, |
| | | od.product_id, |
| | | od.product_name, |
| | | od.width, |
| | | od.height, |
| | | o.customer_id, |
| | | o.customer_name, |
| | | fgi.actual_signal_area, |
| | | fgi.area, |
| | | fgi.storage_region |
| | | from mm.finished_goods_inventory fgi |
| | | left join sd.order_detail od on fgi.order_id = od.order_id and fgi.order_number = od.order_number |
| | | left join sd.`order` o on fgi.order_id = o.order_id |
| | | <where> |
| | | and fgi.quantity_available>0 |
| | | <if test="orderDetail.finishedGoodsInventory.orderId != null and orderDetail.finishedGoodsInventory.orderId != ''"> |
| | | and fgi.order_id regexp #{orderDetail.finishedGoodsInventory.orderId} |
| | | </if> |
| | | <if test="orderDetail.order.project != null and orderDetail.order.project != ''"> |
| | | and o.project regexp #{orderDetail.order.project} |
| | | </if> |
| | | <if test="orderDetail.finishedGoodsInventory.orderNumber != null and orderDetail.finishedGoodsInventory.orderNumber != ''"> |
| | | and fgi.order_number regexp #{orderDetail.finishedGoodsInventory.orderNumber} |
| | | </if> |
| | | <if test="orderDetail.finishedGoodsInventory.quantityAvailable != null and orderDetail.finishedGoodsInventory.quantityAvailable != ''"> |
| | | and fgi.quantity_available regexp #{orderDetail.finishedGoodsInventory.quantityAvailable} |
| | | </if> |
| | | <if test="orderDetail.productId != null and orderDetail.productId != ''"> |
| | | and od.product_id regexp #{orderDetail.productId} |
| | | </if> |
| | | <if test="orderDetail.productName != null and orderDetail.productName != ''"> |
| | | and od.product_name regexp #{orderDetail.productName} |
| | | </if> |
| | | <if test="orderDetail.width != null and orderDetail.width != ''"> |
| | | and od.width regexp #{orderDetail.width} |
| | | </if> |
| | | <if test="orderDetail.height != null and orderDetail.height != ''"> |
| | | and od.height regexp #{orderDetail.height} |
| | | </if> |
| | | <if test="orderDetail.order.customerId != null and orderDetail.order.customerId != ''"> |
| | | and o.customer_id regexp #{orderDetail.order.customerId} |
| | | </if> |
| | | <if test="orderDetail.order.customerName != null and orderDetail.order.customerName != ''"> |
| | | and o.customer_name regexp #{orderDetail.order.customerName} |
| | | </if> |
| | | <if test="orderDetail.finishedGoodsInventory.actualSignalArea != null and orderDetail.finishedGoodsInventory.actualSignalArea != ''"> |
| | | and fgi.actual_signal_area regexp #{orderDetail.finishedGoodsInventory.actualSignalArea} |
| | | </if> |
| | | <if test="orderDetail.finishedGoodsInventory.area != null and orderDetail.finishedGoodsInventory.area != ''"> |
| | | and fgi.area regexp #{orderDetail.finishedGoodsInventory.area} |
| | | </if> |
| | | <if test="orderDetail.finishedGoodsInventory.storageRegion != null and orderDetail.finishedGoodsInventory.storageRegion != ''"> |
| | | and fgi.storage_region regexp #{orderDetail.finishedGoodsInventory.storageRegion} |
| | | </if> |
| | | </where> |
| | | group by fgi.order_id, fgi.order_number |
| | | |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getSelectAllocatePageTotal" > |
| | | select CEILING(count(zu.order_number)/#{pageSize}) from |
| | | (select fgi.order_number as order_number |
| | | from mm.finished_goods_inventory fgi |
| | | left join sd.order_detail od on fgi.order_id = od.order_id and fgi.order_number = od.order_number |
| | | left join sd.`order` o on fgi.order_id = o.order_id |
| | | group by fgi.order_id, fgi.order_number) as zu |
| | | |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <update id="updateDeliveryDetailState"> |
| | | update sd.delivery_detail |
| | | set delivery_detail_state=#{state} |
| | | where order_number=#{orderDetail.deliveryDetail.orderNumber} and order_id=#{orderDetail.deliveryDetail.orderId} |
| | | </update> |
| | | |
| | | <update id="updateInventoryquantityavailable"> |
| | | update mm.finished_goods_inventory |
| | | set inventory=0,quantity_available=0, |
| | | update_time=now(),area=0,status=1 |
| | | where order_number=#{orderDetail.deliveryDetail.orderNumber} and order_id=#{orderDetail.deliveryDetail.orderId} |
| | | </update> |
| | | |
| | | |
| | | <select id="getseletdeliveryDetailPageTotal" > |
| | | select CEILING(count(dd.id)/#{pageSize}) |
| | | from sd.delivery_detail dd |
| | | left join sd.delivery d on dd.delivery_id = d.delivery_id |
| | | left join sd.order_detail od on od.order_id = dd.order_id and dd.order_number = od.order_number |
| | | left join sd.`order` o on o.order_id = dd.order_id |
| | | <where> |
| | | <if test="orderDetail.deliveryDetail.deliveryId != null and orderDetail.deliveryDetail.deliveryId != ''"> |
| | | and dd.delivery_id regexp #{orderDetail.deliveryDetail.deliveryId} |
| | | </if> |
| | | <if test="orderDetail.deliveryDetail.orderId != null and orderDetail.deliveryDetail.orderId != ''"> |
| | | and dd.order_id regexp #{orderDetail.deliveryDetail.orderId} |
| | | </if> |
| | | <if test="orderDetail.order.project != null and orderDetail.order.project != ''"> |
| | | and o.project regexp #{orderDetail.order.project} |
| | | </if> |
| | | <if test="orderDetail.productId != null and orderDetail.productId != ''"> |
| | | and od.product_id regexp #{orderDetail.productId} |
| | | </if> |
| | | <if test="orderDetail.productName != null and orderDetail.productName != ''"> |
| | | and od.product_name regexp #{orderDetail.productName} |
| | | </if> |
| | | <if test="orderDetail.delivery.customerName != null and orderDetail.delivery.customerName != ''"> |
| | | and d.customer_name regexp #{orderDetail.delivery.customerName} |
| | | </if> |
| | | <if test="orderDetail.width != null and orderDetail.width != ''"> |
| | | and od.width regexp #{orderDetail.width} |
| | | </if> |
| | | <if test="orderDetail.height != null and orderDetail.height != ''"> |
| | | and od.height regexp #{orderDetail.height} |
| | | </if> |
| | | <if test="orderDetail.delivery.quantity != null and orderDetail.delivery.quantity != ''"> |
| | | and d.quantity regexp #{orderDetail.delivery.quantity} |
| | | </if> |
| | | <if test="orderDetail.warehouseNum != null and orderDetail.warehouseNum != ''"> |
| | | and od.warehouseNum regexp #{orderDetail.warehouseNum} |
| | | </if> |
| | | <if test="orderDetail.buildingNumber != null and orderDetail.buildingNumber != ''"> |
| | | and od.building_number regexp #{orderDetail.buildingNumber} |
| | | </if> |
| | | <if test="orderDetail.delivery.area != null and orderDetail.delivery.area != ''"> |
| | | and d.area regexp #{orderDetail.delivery.area} |
| | | </if> |
| | | <if test="orderDetail.deliveryDetail.orderNumber != null and orderDetail.deliveryDetail.orderNumber != ''"> |
| | | and dd.order_number regexp #{orderDetail.deliveryDetail.orderNumber} |
| | | </if> |
| | | <if test="orderDetail.delivery.creator != null and orderDetail.delivery.creator != ''"> |
| | | and d.creator regexp #{orderDetail.delivery.creator} |
| | | </if> |
| | | <if test="orderDetail.deliveryDetail.createTime != null and orderDetail.deliveryDetail.createTime != ''"> |
| | | and dd.create_time regexp #{orderDetail.deliveryDetail.createTime} |
| | | </if> |
| | | <if test="orderDetail.deliveryDetail.deliveryDetailRemakes != null and orderDetail.deliveryDetail.deliveryDetailRemakes != ''"> |
| | | and dd.delivery_detail_remakes regexp #{orderDetail.deliveryDetail.deliveryDetailRemakes} |
| | | </if> |
| | | </where> |
| | | order by dd.id |
| | | |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getseletdeliveryDetail" resultMap="selectDelivery"> |
| | | select dd.delivery_id, |
| | | dd.order_number, |
| | | dd.order_id, |
| | | o.project, |
| | | od.product_id, |
| | | od.product_name, |
| | | d.customer_name, |
| | | od.width, |
| | | od.height, |
| | | d.quantity, |
| | | od.warehouse_num, |
| | | d.area, |
| | | od.building_number, |
| | | d.creator, |
| | | dd.delivery_detail_remakes, |
| | | dd.create_time |
| | | from sd.delivery_detail dd |
| | | left join sd.delivery d on dd.delivery_id = d.delivery_id |
| | | left join sd.order_detail od on od.order_id = dd.order_id and dd.order_number = od.order_number |
| | | left join sd.`order` o on o.order_id = dd.order_id where dd.delivery_detail_state=1 |
| | | |
| | | <where> |
| | | <if test="orderDetail.deliveryDetail.deliveryId != null and orderDetail.deliveryDetail.deliveryId != ''"> |
| | | and dd.delivery_id regexp #{orderDetail.deliveryDetail.deliveryId} |
| | | </if> |
| | | <if test="orderDetail.deliveryDetail.orderId != null and orderDetail.deliveryDetail.orderId != ''"> |
| | | and dd.order_id regexp #{orderDetail.deliveryDetail.orderId} |
| | | </if> |
| | | <if test="orderDetail.order.project != null and orderDetail.order.project != ''"> |
| | | and o.project regexp #{orderDetail.order.project} |
| | | </if> |
| | | <if test="orderDetail.productId != null and orderDetail.productId != ''"> |
| | | and od.product_id regexp #{orderDetail.productId} |
| | | </if> |
| | | <if test="orderDetail.productName != null and orderDetail.productName != ''"> |
| | | and od.product_name regexp #{orderDetail.productName} |
| | | </if> |
| | | <if test="orderDetail.delivery.customerName != null and orderDetail.delivery.customerName != ''"> |
| | | and d.customer_name regexp #{orderDetail.delivery.customerName} |
| | | </if> |
| | | <if test="orderDetail.width != null and orderDetail.width != ''"> |
| | | and od.width regexp #{orderDetail.width} |
| | | </if> |
| | | <if test="orderDetail.height != null and orderDetail.height != ''"> |
| | | and od.height regexp #{orderDetail.height} |
| | | </if> |
| | | <if test="orderDetail.delivery.quantity != null and orderDetail.delivery.quantity != ''"> |
| | | and d.quantity regexp #{orderDetail.delivery.quantity} |
| | | </if> |
| | | <if test="orderDetail.warehouseNum != null and orderDetail.warehouseNum != ''"> |
| | | and od.warehouseNum regexp #{orderDetail.warehouseNum} |
| | | </if> |
| | | <if test="orderDetail.buildingNumber != null and orderDetail.buildingNumber != ''"> |
| | | and od.building_number regexp #{orderDetail.buildingNumber} |
| | | </if> |
| | | <if test="orderDetail.delivery.area != null and orderDetail.delivery.area != ''"> |
| | | and d.area regexp #{orderDetail.delivery.area} |
| | | </if> |
| | | <if test="orderDetail.deliveryDetail.orderNumber != null and orderDetail.deliveryDetail.orderNumber != ''"> |
| | | and dd.order_number regexp #{orderDetail.deliveryDetail.orderNumber} |
| | | </if> |
| | | <if test="orderDetail.delivery.creator != null and orderDetail.delivery.creator != ''"> |
| | | and d.creator regexp #{orderDetail.delivery.creator} |
| | | </if> |
| | | <if test="orderDetail.deliveryDetail.createTime != null and orderDetail.deliveryDetail.createTime != ''"> |
| | | and dd.create_time regexp #{orderDetail.deliveryDetail.createTime} |
| | | </if> |
| | | <if test="orderDetail.deliveryDetail.deliveryDetailRemakes != null and orderDetail.deliveryDetail.deliveryDetailRemakes != ''"> |
| | | and dd.delivery_detail_remakes regexp #{orderDetail.deliveryDetail.deliveryDetailRemakes} |
| | | </if> |
| | | </where> |
| | | |
| | | order by dd.id |
| | | |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="findOrderQuantity" > |
| | | select quantity from sd.`order` where order_id=#{orderId} |
| | | </select> |
| | | |
| | | <select id="findOrderNumberdsum" > |
| | | select sum(warehouse_num) from sd.order_detail where order_id=#{orderId} |
| | | </select> |
| | | |
| | | <update id="updateOrderWarehousingState"> |
| | | update sd.`order` |
| | | set warehousing=#{state} |
| | | where order_id=#{orderId} |
| | | </update> |
| | | |
| | | <update id="updateOrderDeliveryState"> |
| | | update sd.`order` |
| | | set delivery=#{state} |
| | | where order_id=#{orderId} |
| | | </update> |
| | | |
| | | <update id="updateIntOrderNumberConut"> |
| | | update sd.order_detail |
| | | set warehouse_num=warehouse_num+${quantity} |
| | | where order_number=#{orderNumber} and order_id=#{orderId} |
| | | </update> |
| | | |
| | | <update id="updateOutOrderNumberConut"> |
| | | update sd.order_detail |
| | | set warehouse_num=warehouse_num-${quantity} |
| | | where order_number=#{orderNumber} and order_id=#{orderId} |
| | | </update> |
| | | |
| | | <update id="updateflowcard"> |
| | | update pp.flow_card |
| | | set received_quantity=received_quantity+${inventoryQuantity} |
| | | where order_number=#{orderNumber} and process_id=#{processId} |
| | | where order_number=#{orderNumber} and process_id=#{processId} and order_id=#{order.orderId} |
| | | </update> |
| | | |
| | | <update id="updateInventory"> |
| | | update mm.finished_goods_inventory |
| | | set inventory=inventory+${inventoryQuantity},quantity_available=quantity_available+${inventoryQuantity}, |
| | | update_time=now(),area=area+actual_signal_area*${inventoryQuantity} |
| | | where order_number=#{orderNumber} |
| | | set inventory=inventory+${flowCard.inventoryQuantity},quantity_available=quantity_available+${flowCard.inventoryQuantity}, |
| | | update_time=now(),area=actual_signal_area*quantity_available |
| | | <if test="storageRegion != null and storageRegion != ''"> |
| | | , storage_region= #{storageRegion} |
| | | </if> |
| | | <if test="remark != null and remark != ''"> |
| | | , remark= #{remark} |
| | | </if> |
| | | where order_number=#{flowCard.orderNumber} and order_id=#{flowCard.order.orderId} |
| | | </update> |
| | | |
| | | <insert id="insertFinishedGoodsInventory" useGeneratedKeys="true" > |
| | |
| | | <select id="findOrderNumberdcount" > |
| | | select count(*) |
| | | from mm.`finished_goods_inventory` |
| | | where order_number = #{orderNumber} |
| | | where order_number = #{orderNumber} and order_id=#{orderId}; |
| | | |
| | | </select> |
| | | |
| | | <select id="findOrderNumberd" > |
| | | select * |
| | | from sd.finished_goods_inventory |
| | | where order_number = #{orderNumber} |
| | | <select id="finishedGoodsInventorybycount" > |
| | | select quantity_available |
| | | from mm.`finished_goods_inventory` |
| | | where order_number = #{orderNumber} and order_id=#{orderId}; |
| | | |
| | | </select> |
| | | |
| | | |
| | | <select id="getseletwarehousing" resultMap="selectFlowCard"> |
| | | select |
| | |
| | | od.product_name, |
| | | od.width, |
| | | od.height, |
| | | o.creater, |
| | | o.creator, |
| | | o.project, |
| | | fc.order_number, |
| | | od.quantity, |
| | |
| | | fc.process_id, |
| | | fc.received_quantity, |
| | | o.batch |
| | | from pp.flow_card fc left join sd.order_detail od on fc.order_number=od.order_number inner join sd.`order` o on |
| | | from pp.flow_card fc left join sd.order_detail od on fc.order_id=od.order_id and fc.order_number=od.order_number inner join sd.`order` o on |
| | | o.order_id=fc.order_id |
| | | <where> |
| | | and fc.received_quantity <![CDATA[<]]> fc.inventory_quantity |
| | |
| | | <if test="flowCard.orderDetail.height != null and flowCard.orderDetail.height != ''"> |
| | | and od.height regexp #{flowCard.orderDetail.height} |
| | | </if> |
| | | <if test="flowCard.order.creater != null and flowCard.order.creater != ''"> |
| | | and o.creater regexp #{flowCard.order.creater} |
| | | <if test="flowCard.order.creator != null and flowCard.order.creator != ''"> |
| | | and o.creator regexp #{flowCard.order.creator} |
| | | </if> |
| | | <if test="flowCard.order.project != null and flowCard.order.project != ''"> |
| | | and o.project regexp #{flowCard.order.project} |
| | |
| | | </if> |
| | | |
| | | </where> |
| | | group by 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 |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | <select id="getseletwarehousingPageTotal" > |
| | | select CEILING(count(zu.order_number)/#{pageSize}) from ( |
| | | select fc.order_number as order_number,fc.process_id from pp.flow_card fc left join sd.order_detail od on |
| | | fc.order_number=od.order_number inner join sd.`order` o on o.order_id=fc.order_id |
| | | fc.order_id=od.order_id and fc.order_number=od.order_number inner join sd.`order` o on o.order_id=fc.order_id |
| | | <where> |
| | | and fc.received_quantity <![CDATA[<]]> fc.inventory_quantity |
| | | <if test="flowCard.order.orderId != null and flowCard.order.orderId != ''"> |
| | |
| | | <if test="flowCard.orderDetail.height != null and flowCard.orderDetail.height != ''"> |
| | | and od.height regexp #{flowCard.orderDetail.height} |
| | | </if> |
| | | <if test="flowCard.order.creater != null and flowCard.order.creater != ''"> |
| | | and o.creater regexp #{flowCard.order.creater} |
| | | <if test="flowCard.order.creator != null and flowCard.order.creator != ''"> |
| | | and o.creator regexp #{flowCard.order.creator} |
| | | </if> |
| | | <if test="flowCard.order.project != null and flowCard.order.project != ''"> |
| | | and o.project regexp #{flowCard.order.project} |
| | |
| | | </if> |
| | | |
| | | </where> |
| | | group by fc.order_number,fc.process_id order by fc.create_time) as zu |
| | | group by fc.order_id,fc.order_number,fc.process_id order by fc.create_time) as zu |
| | | </select> |
| | | |
| | | |
| | |
| | | fgi.end_time, |
| | | fgi.remark |
| | | from finished_goods_inventory fgi |
| | | left join sd.order_detail od on fgi.order_number = od.order_number |
| | | inner join sd.`order` o on fgi.order_id = o.order_id |
| | | left join sd.order_detail od on fgi.order_id = od.order_id and fgi.order_number = od.order_number |
| | | left join sd.`order` o on fgi.order_id = o.order_id |
| | | <where> |
| | | and fgi.status = 0 and fgi.quantity_available>0 |
| | | <if test="finishedGoodsInventory.orderDetail.width != null and finishedGoodsInventory.orderDetail.width != ''"> |
| | | and od.width regexp #{finishedGoodsInventory.orderDetail.width} |
| | | </if> |
| | |
| | | select |
| | | CEILING(count(fgi.id)/#{pageSize}) |
| | | from finished_goods_inventory fgi |
| | | left join sd.order_detail od on fgi.order_number = od.order_number |
| | | inner join sd.`order` o on fgi.order_id = o.order_id |
| | | left join sd.order_detail od on fgi.order_id = od.order_id and fgi.order_number = od.order_number |
| | | left join sd.`order` o on fgi.order_id = o.order_id |
| | | <where> |
| | | and fgi.status = 0 and fgi.quantity_available>0 |
| | | <if test="finishedGoodsInventory.orderDetail.width != null and finishedGoodsInventory.orderDetail.width != ''"> |
| | | and od.width regexp #{finishedGoodsInventory.orderDetail.width} |
| | | </if> |
| | |
| | | <resultMap id="selectFinishedGoodsInventory" type="com.example.erp.entity.mm.FinishedOperateLog" > |
| | | <id column="id" property="id"/> |
| | | <result column="operation_order_number" property="operationOrderNumber"/> |
| | | <result column="product_number" property="productNumber"/> |
| | | <result column="order_id" property="orderId"/> |
| | | <result column="operation_number" property="operationNumber"/> |
| | | <result column="quantity" property="quantity"/> |
| | | <result column="operate_type" property="operateType"/> |
| | | <result column="operator" property="operator"/> |
| | | <result column="operate_time" property="operateTime"/> |
| | | <result column="stater_operation_order_number" property="staterOperationOrderNumber"/> |
| | | <result column="end_operation_order_number" property="endOperationOrderNumber"/> |
| | | <result column="status" property="status"/> |
| | | <result column="type" property="type"/> |
| | | <result column="reviewed" property="reviewed"/> |
| | | <result column="reviewed_time" property="reviewedTime"/> |
| | | <result column="remarks" property="remarks"/> |
| | | <result column="is_state" property="isState"/> |
| | | |
| | | <!--<result column="g_typeId" property="glassTypes.typeId"/> |
| | | <result column="g_type" property="glassTypes.type"/>--> |
| | | <result column="width" property="orderDetail.width"/> |
| | | <result column="height" property="orderDetail.height"/> |
| | | <result column="product_id" property="orderDetail.productId"/> |
| | | <result column="product_name" property="orderDetail.productName"/> |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="getSelectOperateRecord" resultMap="selectFinishedGoodsInventory"> |
| | | select fol.operation_order_number, |
| | | fol.order_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 = '领出' or aa.operate_type = '返工') fol |
| | | left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number |
| | | <where> |
| | | <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 #{finishedOperateLog.orderDetail.width} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail.height != null and finishedOperateLog.orderDetail.height != ''"> |
| | | and od.height regexp #{finishedOperateLog.orderDetail.height} |
| | | </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> |
| | | |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getSelectOperateRecordLogPageTotal" > |
| | | select CEILING(count(fol.id)/#{pageSize}) |
| | | from (select * |
| | | from mm.finished_operate_log aa where aa.operate_type = '领出' or aa.operate_type = '返工') fol |
| | | left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number |
| | | <where> |
| | | <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 #{finishedOperateLog.orderDetail.width} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail.height != null and finishedOperateLog.orderDetail.height != ''"> |
| | | and od.height regexp #{finishedOperateLog.orderDetail.height} |
| | | </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> |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getselectAllocateFinishedOperateLog" resultMap="selectFinishedGoodsInventory" > |
| | | select fol.operation_order_number, |
| | | fol.order_id, |
| | | fol.operation_number, |
| | | fol.stater_operation_order_number, |
| | | fol.end_operation_order_number, |
| | | fol.quantity, |
| | | fol.operator, |
| | | od.product_id, |
| | | od.product_name, |
| | | od.width, |
| | | od.height, |
| | | fol.operate_time |
| | | from (select * |
| | | from mm.finished_operate_log aa where aa.operate_type = '调拨') fol |
| | | left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number |
| | | <where> |
| | | <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.staterOperationOrderNumber != null and finishedOperateLog.staterOperationOrderNumber != ''"> |
| | | and fol.stater_operation_order_number regexp #{finishedOperateLog.staterOperationOrderNumber} |
| | | </if> |
| | | <if test="finishedOperateLog.endOperationOrderNumber != null and finishedOperateLog.endOperationOrderNumber != ''"> |
| | | and fol.end_operation_order_number regexp #{finishedOperateLog.endOperationOrderNumber} |
| | | </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 #{finishedOperateLog.orderDetail.width} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail.height != null and finishedOperateLog.orderDetail.height != ''"> |
| | | and od.height regexp #{finishedOperateLog.orderDetail.height} |
| | | </if> |
| | | <if test="finishedOperateLog.operateTime != null and finishedOperateLog.operateTime != ''"> |
| | | and fol.operate_time regexp #{finishedOperateLog.operateTime} |
| | | </if> |
| | | </where> |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getselectAllocateFinishedOperateLogPageTotal" > |
| | | select CEILING(count(fol.id)/#{pageSize}) |
| | | from (select * |
| | | from mm.finished_operate_log aa where aa.operate_type = '调拨') fol |
| | | left join sd.order_detail od on fol.order_id = od.order_id and fol.end_operation_order_number = od.order_number |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getselectFinishedOperateLog" > |
| | | select |
| | | * |
| | |
| | | mm.finished_operate_log limit 0,1; |
| | | </select> |
| | | |
| | | <insert id="insertFinishedOperateLog" useGeneratedKeys="true" keyProperty="id" > |
| | | |
| | | |
| | | <select id="getmaximum" > |
| | | select count(*) from mm.finished_operate_log where operate_type =#{type} and date(operate_time)=CURDATE() |
| | | </select> |
| | | |
| | | <insert id="insertIntFinishedOperateLog" useGeneratedKeys="true" > |
| | | insert into mm.finished_operate_log(operation_order_number, |
| | | product_number, |
| | | order_id, |
| | | operation_number, |
| | | operate_type, |
| | | operator, |
| | |
| | | operate_time |
| | | ) |
| | | values ( |
| | | #{processId} ,#{orderDetail.productId},#{orderNumber},"入库","王五",#{inventoryQuantity},now() |
| | | #{oddNumber} ,#{flowCard.order.orderId},#{flowCard.orderNumber},"入库",#{userName},#{flowCard.inventoryQuantity},now() |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="insertOutFinishedOperateLog" useGeneratedKeys="true" > |
| | | insert into mm.finished_operate_log(operation_order_number, |
| | | order_id, |
| | | operation_number, |
| | | operate_type, |
| | | operator, |
| | | quantity, |
| | | operate_time |
| | | ) |
| | | values ( |
| | | #{orderDetail.deliveryDetail.deliveryId} ,#{orderDetail.deliveryDetail.order_id},#{orderDetail.deliveryDetail.orderNumber} |
| | | ,"出库",#{userName},#{orderDetail.warehouseNum},now() |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="insertFinishedOperateLogTakeOut" useGeneratedKeys="true" > |
| | | insert into mm.finished_operate_log(operation_order_number, |
| | | order_id, |
| | | operation_number, |
| | | operate_type, |
| | | operator, |
| | | quantity, |
| | | operate_time, |
| | | status, |
| | | type, |
| | | remarks |
| | | ) |
| | | values ( |
| | | #{oddNumber} ,#{orderDetail.finishedGoodsInventory.orderId},#{orderDetail.finishedGoodsInventory.orderNumber} |
| | | ,"领出",#{userName},#{orderDetail.quantity},now(),"未审核",#{operateType},#{remarks} |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="insertFinishedOperateLogAllocate" useGeneratedKeys="true" > |
| | | insert into mm.finished_operate_log(operation_order_number, |
| | | order_id, |
| | | operation_number, |
| | | operate_type, |
| | | operator, |
| | | quantity, |
| | | operate_time, |
| | | stater_operation_order_number, |
| | | end_operation_order_number |
| | | ) |
| | | values ( |
| | | #{oddNumber} ,#{orderDetail.finishedGoodsInventory.orderId},#{orderDetail.finishedGoodsInventory.orderNumber} |
| | | ,"调拨",#{userName},#{orderDetail.quantity},now(),#{orderDetail.orderId},#{orderDetail.orderNumber} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.example.erp.mapper.mm.BasicWarehouseTypeMapper"> |
| | | |
| | | <select id="getBasicWarehouseTypeTakeOut" > |
| | | select * from mm.basic_warehouse_type where operate_type='领出'; |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.example.erp.mapper.mm.FinishedGoodsInventoryMapper"> |
| | | <!--映射成品库存--> |
| | | <resultMap id="selectFinishedGoodsInventory" type="com.example.erp.entity.mm.FinishedGoodsInventory"> |
| | | <id column="fid" property="id"/> |
| | | <result column="inventory" property="inventory"/> |
| | | <result column="area" property="area"/> |
| | | <result column="actual_signal_area" property="actualSignalArea"/> |
| | | <result column="quantity_available" property="quantityAvailable"/> |
| | | <result column="warehouse_number" property="warehouseNumber"/> |
| | | <result column="storage_region" property="storageRegion"/> |
| | | <result column="status" property="status"/> |
| | | <result column="enter_storage_time" property="enterStorageTime"/> |
| | | <result column="remark" property="remark"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="end_time" property="endTime"/> |
| | | |
| | | <result column="order_id" property="order.orderId"/> |
| | | <result column="project" property="order.project"/> |
| | | <result column="order_type" property="order.orderType"/> |
| | | |
| | | |
| | | <result column="order_number" property="orderDetail.orderNumber"/> |
| | | <result column="width" property="orderDetail.width"/> |
| | | <result column="height" property="orderDetail.height"/> |
| | | <result column="product_name" property="orderDetail.productName"/> |
| | | <result column="product_id" property="orderDetail.productId"/> |
| | | |
| | | </resultMap> |
| | | <!--映射成品入库--> |
| | | <resultMap id="selectFlowCard" type="com.example.erp.entity.pp.FlowCard"> |
| | | <id column="id" property="id"/> |
| | | <result column="order_number" property="orderNumber"/> |
| | | <result column="inventory_quantity" property="inventoryQuantity"/> |
| | | <result column="process_id" property="processId"/> |
| | | <result column="received_quantity" property="receivedQuantity"/> |
| | | |
| | | |
| | | <result column="order_id" property="order.orderId"/> |
| | | <result column="project" property="order.project"/> |
| | | <result column="creator" property="order.creator"/> |
| | | <result column="area" property="order.area"/> |
| | | <result column="batch" property="order.batch"/> |
| | | <result column="order_quantity" property="order.quantity"/> |
| | | |
| | | <result column="building_number" property="orderDetail.buildingNumber"/> |
| | | <result column="width" property="orderDetail.width"/> |
| | | <result column="height" property="orderDetail.height"/> |
| | | <result column="product_name" property="orderDetail.productName"/> |
| | | <result column="product_id" property="orderDetail.productId"/> |
| | | <result column="quantity" property="orderDetail.quantity"/> |
| | | </resultMap> |
| | | |
| | | <!--映射成品出库--> |
| | | <resultMap id="selectDelivery" type="com.example.erp.entity.sd.OrderDetail"> |
| | | <id column="id" property="id"/> |
| | | <result column="building_number" property="buildingNumber"/> |
| | | <result column="width" property="width"/> |
| | | <result column="height" property="height"/> |
| | | <result column="product_name" property="productName"/> |
| | | <result column="product_id" property="productId"/> |
| | | <result column="warehouse_num" property="warehouseNum"/> |
| | | |
| | | <result column="order_number" property="deliveryDetail.orderNumber"/> |
| | | <result column="delivery_id" property="deliveryDetail.deliveryId"/> |
| | | <result column="delivery_number" property="deliveryDetail.deliveryNumber"/> |
| | | <result column="delivery_detail_remakes" property="deliveryDetail.deliveryDetailRemakes"/> |
| | | <result column="order_id" property="deliveryDetail.orderId"/> |
| | | <result column="create_time" property="deliveryDetail.createTime"/> |
| | | |
| | | <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="area" property="delivery.area"/> |
| | | |
| | | |
| | | </resultMap> |
| | | |
| | | <!--映射订单调拨--> |
| | | <resultMap id="selectDeliveryFinishedGoodsInventory" type="com.example.erp.entity.sd.OrderDetail"> |
| | | |
| | | <result column="width" property="width"/> |
| | | <result column="height" property="height"/> |
| | | <result column="product_name" property="productName"/> |
| | | <result column="product_id" property="productId"/> |
| | | |
| | | <result column="order_id" property="finishedGoodsInventory.orderId"/> |
| | | <result column="order_number" property="finishedGoodsInventory.orderNumber"/> |
| | | <result column="quantity_available" property="finishedGoodsInventory.quantityAvailable"/> |
| | | <result column="actual_signal_area" property="finishedGoodsInventory.actualSignalArea"/> |
| | | <result column="area" property="finishedGoodsInventory.area"/> |
| | | <result column="storage_region" property="finishedGoodsInventory.storageRegion"/> |
| | | |
| | | <result column="project" property="order.project"/> |
| | | <result column="customer_id" property="order.customerId"/> |
| | | <result column="customer_name" property="order.customerName"/> |
| | | |
| | | |
| | | </resultMap> |
| | | <update id="updateInventoryquantityAllocateInt"> |
| | | update mm.finished_goods_inventory |
| | | set inventory=inventory+#{quantity},quantity_available=quantity_available+#{quantity}, |
| | | update_time=now(),area=actual_signal_area*quantity_available |
| | | where order_number=#{orderNumber} and order_id=#{orderId} |
| | | </update> |
| | | |
| | | <update id="updateInventoryquantityAllocateOut"> |
| | | update mm.finished_goods_inventory |
| | | set inventory=inventory-#{quantity},quantity_available=quantity_available-#{quantity}, |
| | | update_time=now(),area=actual_signal_area*quantity_available |
| | | where order_number=#{orderNumber} and order_id=#{orderId} |
| | | </update> |
| | | |
| | | <select id="getSelectAllocate" resultMap="selectDeliveryFinishedGoodsInventory"> |
| | | select fgi.order_id, |
| | | o.project, |
| | | fgi.order_number, |
| | | fgi.quantity_available, |
| | | od.product_id, |
| | | od.product_name, |
| | | od.width, |
| | | od.height, |
| | | o.customer_id, |
| | | o.customer_name, |
| | | fgi.actual_signal_area, |
| | | fgi.area, |
| | | fgi.storage_region |
| | | from mm.finished_goods_inventory fgi |
| | | left join sd.order_detail od on fgi.order_id = od.order_id and fgi.order_number = od.order_number |
| | | left join sd.`order` o on fgi.order_id = o.order_id |
| | | <where> |
| | | and fgi.quantity_available>0 |
| | | <if test="orderDetail.finishedGoodsInventory.orderId != null and orderDetail.finishedGoodsInventory.orderId != ''"> |
| | | and fgi.order_id regexp #{orderDetail.finishedGoodsInventory.orderId} |
| | | </if> |
| | | <if test="orderDetail.order.project != null and orderDetail.order.project != ''"> |
| | | and o.project regexp #{orderDetail.order.project} |
| | | </if> |
| | | <if test="orderDetail.finishedGoodsInventory.orderNumber != null and orderDetail.finishedGoodsInventory.orderNumber != ''"> |
| | | and fgi.order_number regexp #{orderDetail.finishedGoodsInventory.orderNumber} |
| | | </if> |
| | | <if test="orderDetail.finishedGoodsInventory.quantityAvailable != null and orderDetail.finishedGoodsInventory.quantityAvailable != ''"> |
| | | and fgi.quantity_available regexp #{orderDetail.finishedGoodsInventory.quantityAvailable} |
| | | </if> |
| | | <if test="orderDetail.productId != null and orderDetail.productId != ''"> |
| | | and od.product_id regexp #{orderDetail.productId} |
| | | </if> |
| | | <if test="orderDetail.productName != null and orderDetail.productName != ''"> |
| | | and od.product_name regexp #{orderDetail.productName} |
| | | </if> |
| | | <if test="orderDetail.width != null and orderDetail.width != ''"> |
| | | and od.width regexp #{orderDetail.width} |
| | | </if> |
| | | <if test="orderDetail.height != null and orderDetail.height != ''"> |
| | | and od.height regexp #{orderDetail.height} |
| | | </if> |
| | | <if test="orderDetail.order.customerId != null and orderDetail.order.customerId != ''"> |
| | | and o.customer_id regexp #{orderDetail.order.customerId} |
| | | </if> |
| | | <if test="orderDetail.order.customerName != null and orderDetail.order.customerName != ''"> |
| | | and o.customer_name regexp #{orderDetail.order.customerName} |
| | | </if> |
| | | <if test="orderDetail.finishedGoodsInventory.actualSignalArea != null and orderDetail.finishedGoodsInventory.actualSignalArea != ''"> |
| | | and fgi.actual_signal_area regexp #{orderDetail.finishedGoodsInventory.actualSignalArea} |
| | | </if> |
| | | <if test="orderDetail.finishedGoodsInventory.area != null and orderDetail.finishedGoodsInventory.area != ''"> |
| | | and fgi.area regexp #{orderDetail.finishedGoodsInventory.area} |
| | | </if> |
| | | <if test="orderDetail.finishedGoodsInventory.storageRegion != null and orderDetail.finishedGoodsInventory.storageRegion != ''"> |
| | | and fgi.storage_region regexp #{orderDetail.finishedGoodsInventory.storageRegion} |
| | | </if> |
| | | </where> |
| | | group by fgi.order_id, fgi.order_number |
| | | |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getSelectAllocatePageTotal" > |
| | | select CEILING(count(zu.order_number)/#{pageSize}) from |
| | | (select fgi.order_number as order_number |
| | | from mm.finished_goods_inventory fgi |
| | | left join sd.order_detail od on fgi.order_id = od.order_id and fgi.order_number = od.order_number |
| | | left join sd.`order` o on fgi.order_id = o.order_id |
| | | group by fgi.order_id, fgi.order_number) as zu |
| | | |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <update id="updateDeliveryDetailState"> |
| | | update sd.delivery_detail |
| | | set delivery_detail_state=#{state} |
| | | where order_number=#{orderDetail.deliveryDetail.orderNumber} and order_id=#{orderDetail.deliveryDetail.orderId} |
| | | </update> |
| | | |
| | | <update id="updateInventoryquantityavailable"> |
| | | update mm.finished_goods_inventory |
| | | set inventory=0,quantity_available=0, |
| | | update_time=now(),area=0,status=1 |
| | | where order_number=#{orderDetail.deliveryDetail.orderNumber} and order_id=#{orderDetail.deliveryDetail.orderId} |
| | | </update> |
| | | |
| | | |
| | | <select id="getseletdeliveryDetailPageTotal" > |
| | | select CEILING(count(dd.id)/#{pageSize}) |
| | | from sd.delivery_detail dd |
| | | left join sd.delivery d on dd.delivery_id = d.delivery_id |
| | | left join sd.order_detail od on od.order_id = dd.order_id and dd.order_number = od.order_number |
| | | left join sd.`order` o on o.order_id = dd.order_id |
| | | <where> |
| | | <if test="orderDetail.deliveryDetail.deliveryId != null and orderDetail.deliveryDetail.deliveryId != ''"> |
| | | and dd.delivery_id regexp #{orderDetail.deliveryDetail.deliveryId} |
| | | </if> |
| | | <if test="orderDetail.deliveryDetail.orderId != null and orderDetail.deliveryDetail.orderId != ''"> |
| | | and dd.order_id regexp #{orderDetail.deliveryDetail.orderId} |
| | | </if> |
| | | <if test="orderDetail.order.project != null and orderDetail.order.project != ''"> |
| | | and o.project regexp #{orderDetail.order.project} |
| | | </if> |
| | | <if test="orderDetail.productId != null and orderDetail.productId != ''"> |
| | | and od.product_id regexp #{orderDetail.productId} |
| | | </if> |
| | | <if test="orderDetail.productName != null and orderDetail.productName != ''"> |
| | | and od.product_name regexp #{orderDetail.productName} |
| | | </if> |
| | | <if test="orderDetail.delivery.customerName != null and orderDetail.delivery.customerName != ''"> |
| | | and d.customer_name regexp #{orderDetail.delivery.customerName} |
| | | </if> |
| | | <if test="orderDetail.width != null and orderDetail.width != ''"> |
| | | and od.width regexp #{orderDetail.width} |
| | | </if> |
| | | <if test="orderDetail.height != null and orderDetail.height != ''"> |
| | | and od.height regexp #{orderDetail.height} |
| | | </if> |
| | | <if test="orderDetail.delivery.quantity != null and orderDetail.delivery.quantity != ''"> |
| | | and d.quantity regexp #{orderDetail.delivery.quantity} |
| | | </if> |
| | | <if test="orderDetail.warehouseNum != null and orderDetail.warehouseNum != ''"> |
| | | and od.warehouseNum regexp #{orderDetail.warehouseNum} |
| | | </if> |
| | | <if test="orderDetail.buildingNumber != null and orderDetail.buildingNumber != ''"> |
| | | and od.building_number regexp #{orderDetail.buildingNumber} |
| | | </if> |
| | | <if test="orderDetail.delivery.area != null and orderDetail.delivery.area != ''"> |
| | | and d.area regexp #{orderDetail.delivery.area} |
| | | </if> |
| | | <if test="orderDetail.deliveryDetail.orderNumber != null and orderDetail.deliveryDetail.orderNumber != ''"> |
| | | and dd.order_number regexp #{orderDetail.deliveryDetail.orderNumber} |
| | | </if> |
| | | <if test="orderDetail.delivery.creator != null and orderDetail.delivery.creator != ''"> |
| | | and d.creator regexp #{orderDetail.delivery.creator} |
| | | </if> |
| | | <if test="orderDetail.deliveryDetail.createTime != null and orderDetail.deliveryDetail.createTime != ''"> |
| | | and dd.create_time regexp #{orderDetail.deliveryDetail.createTime} |
| | | </if> |
| | | <if test="orderDetail.deliveryDetail.deliveryDetailRemakes != null and orderDetail.deliveryDetail.deliveryDetailRemakes != ''"> |
| | | and dd.delivery_detail_remakes regexp #{orderDetail.deliveryDetail.deliveryDetailRemakes} |
| | | </if> |
| | | </where> |
| | | order by dd.id |
| | | |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getseletdeliveryDetail" resultMap="selectDelivery"> |
| | | select dd.delivery_id, |
| | | dd.order_number, |
| | | dd.order_id, |
| | | o.project, |
| | | od.product_id, |
| | | od.product_name, |
| | | d.customer_name, |
| | | od.width, |
| | | od.height, |
| | | d.quantity, |
| | | od.warehouse_num, |
| | | d.area, |
| | | od.building_number, |
| | | d.creator, |
| | | dd.delivery_detail_remakes, |
| | | dd.create_time |
| | | from sd.delivery_detail dd |
| | | left join sd.delivery d on dd.delivery_id = d.delivery_id |
| | | left join sd.order_detail od on od.order_id = dd.order_id and dd.order_number = od.order_number |
| | | left join sd.`order` o on o.order_id = dd.order_id where dd.delivery_detail_state=1 |
| | | |
| | | <where> |
| | | <if test="orderDetail.deliveryDetail.deliveryId != null and orderDetail.deliveryDetail.deliveryId != ''"> |
| | | and dd.delivery_id regexp #{orderDetail.deliveryDetail.deliveryId} |
| | | </if> |
| | | <if test="orderDetail.deliveryDetail.orderId != null and orderDetail.deliveryDetail.orderId != ''"> |
| | | and dd.order_id regexp #{orderDetail.deliveryDetail.orderId} |
| | | </if> |
| | | <if test="orderDetail.order.project != null and orderDetail.order.project != ''"> |
| | | and o.project regexp #{orderDetail.order.project} |
| | | </if> |
| | | <if test="orderDetail.productId != null and orderDetail.productId != ''"> |
| | | and od.product_id regexp #{orderDetail.productId} |
| | | </if> |
| | | <if test="orderDetail.productName != null and orderDetail.productName != ''"> |
| | | and od.product_name regexp #{orderDetail.productName} |
| | | </if> |
| | | <if test="orderDetail.delivery.customerName != null and orderDetail.delivery.customerName != ''"> |
| | | and d.customer_name regexp #{orderDetail.delivery.customerName} |
| | | </if> |
| | | <if test="orderDetail.width != null and orderDetail.width != ''"> |
| | | and od.width regexp #{orderDetail.width} |
| | | </if> |
| | | <if test="orderDetail.height != null and orderDetail.height != ''"> |
| | | and od.height regexp #{orderDetail.height} |
| | | </if> |
| | | <if test="orderDetail.delivery.quantity != null and orderDetail.delivery.quantity != ''"> |
| | | and d.quantity regexp #{orderDetail.delivery.quantity} |
| | | </if> |
| | | <if test="orderDetail.warehouseNum != null and orderDetail.warehouseNum != ''"> |
| | | and od.warehouseNum regexp #{orderDetail.warehouseNum} |
| | | </if> |
| | | <if test="orderDetail.buildingNumber != null and orderDetail.buildingNumber != ''"> |
| | | and od.building_number regexp #{orderDetail.buildingNumber} |
| | | </if> |
| | | <if test="orderDetail.delivery.area != null and orderDetail.delivery.area != ''"> |
| | | and d.area regexp #{orderDetail.delivery.area} |
| | | </if> |
| | | <if test="orderDetail.deliveryDetail.orderNumber != null and orderDetail.deliveryDetail.orderNumber != ''"> |
| | | and dd.order_number regexp #{orderDetail.deliveryDetail.orderNumber} |
| | | </if> |
| | | <if test="orderDetail.delivery.creator != null and orderDetail.delivery.creator != ''"> |
| | | and d.creator regexp #{orderDetail.delivery.creator} |
| | | </if> |
| | | <if test="orderDetail.deliveryDetail.createTime != null and orderDetail.deliveryDetail.createTime != ''"> |
| | | and dd.create_time regexp #{orderDetail.deliveryDetail.createTime} |
| | | </if> |
| | | <if test="orderDetail.deliveryDetail.deliveryDetailRemakes != null and orderDetail.deliveryDetail.deliveryDetailRemakes != ''"> |
| | | and dd.delivery_detail_remakes regexp #{orderDetail.deliveryDetail.deliveryDetailRemakes} |
| | | </if> |
| | | </where> |
| | | |
| | | order by dd.id |
| | | |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="findOrderQuantity" > |
| | | select quantity from sd.`order` where order_id=#{orderId} |
| | | </select> |
| | | |
| | | <select id="findOrderNumberdsum" > |
| | | select sum(warehouse_num) from sd.order_detail where order_id=#{orderId} |
| | | </select> |
| | | |
| | | <update id="updateOrderWarehousingState"> |
| | | update sd.`order` |
| | | set warehousing=#{state} |
| | | where order_id=#{orderId} |
| | | </update> |
| | | |
| | | <update id="updateOrderDeliveryState"> |
| | | update sd.`order` |
| | | set delivery=#{state} |
| | | where order_id=#{orderId} |
| | | </update> |
| | | |
| | | <update id="updateIntOrderNumberConut"> |
| | | update sd.order_detail |
| | | set warehouse_num=warehouse_num+${quantity} |
| | | where order_number=#{orderNumber} and order_id=#{orderId} |
| | | </update> |
| | | |
| | | <update id="updateOutOrderNumberConut"> |
| | | update sd.order_detail |
| | | set warehouse_num=warehouse_num-${quantity} |
| | | where order_number=#{orderNumber} and order_id=#{orderId} |
| | | </update> |
| | | |
| | | <update id="updateflowcard"> |
| | | update pp.flow_card |
| | | set received_quantity=received_quantity+${inventoryQuantity} |
| | | where order_number=#{orderNumber} and process_id=#{processId} and order_id=#{order.orderId} |
| | | </update> |
| | | |
| | | <update id="updateInventory"> |
| | | update mm.finished_goods_inventory |
| | | set inventory=inventory+${flowCard.inventoryQuantity},quantity_available=quantity_available+${flowCard.inventoryQuantity}, |
| | | update_time=now(),area=actual_signal_area*quantity_available |
| | | <if test="storageRegion != null and storageRegion != ''"> |
| | | , storage_region= #{storageRegion} |
| | | </if> |
| | | <if test="remark != null and remark != ''"> |
| | | , remark= #{remark} |
| | | </if> |
| | | where order_number=#{flowCard.orderNumber} and order_id=#{flowCard.order.orderId} |
| | | </update> |
| | | |
| | | <insert id="insertFinishedGoodsInventory" useGeneratedKeys="true" > |
| | | insert into mm.finished_goods_inventory (order_id, |
| | | order_number, |
| | | inventory, |
| | | actual_signal_area, |
| | | area, |
| | | quantity_available, |
| | | warehouse_number, |
| | | storage_region, |
| | | `status`, |
| | | enter_storage_time, |
| | | update_time, |
| | | end_time, |
| | | remark |
| | | ) |
| | | values ( |
| | | #{flowCard.order.orderId} ,#{flowCard.orderNumber},#{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} |
| | | ) |
| | | </insert> |
| | | |
| | | <select id="findOrderNumberdcount" > |
| | | select count(*) |
| | | from mm.`finished_goods_inventory` |
| | | where order_number = #{orderNumber} and order_id=#{orderId}; |
| | | |
| | | </select> |
| | | |
| | | <select id="finishedGoodsInventorybycount" > |
| | | select quantity_available |
| | | from mm.`finished_goods_inventory` |
| | | where order_number = #{orderNumber} and order_id=#{orderId}; |
| | | |
| | | </select> |
| | | |
| | | |
| | | <select id="getseletwarehousing" resultMap="selectFlowCard"> |
| | | select |
| | | fc.id, |
| | | o.order_id, |
| | | od.building_number, |
| | | od.product_id, |
| | | od.product_name, |
| | | od.width, |
| | | od.height, |
| | | o.creator, |
| | | o.project, |
| | | fc.order_number, |
| | | od.quantity, |
| | | fc.inventory_quantity, |
| | | o.area, |
| | | fc.process_id, |
| | | fc.received_quantity, |
| | | o.batch |
| | | from pp.flow_card fc left join sd.order_detail od on fc.order_id=od.order_id and fc.order_number=od.order_number inner join sd.`order` o on |
| | | o.order_id=fc.order_id |
| | | <where> |
| | | and fc.received_quantity <![CDATA[<]]> fc.inventory_quantity |
| | | <if test="flowCard.order.orderId != null and flowCard.order.orderId != ''"> |
| | | and o.order_id regexp #{flowCard.order.orderId} |
| | | </if> |
| | | <if test="flowCard.orderDetail.buildingNumber != null and flowCard.orderDetail.buildingNumber != ''"> |
| | | and od.building_number regexp #{flowCard.orderDetail.buildingNumber} |
| | | </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> |
| | | <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.order.creator != null and flowCard.order.creator != ''"> |
| | | and o.creator regexp #{flowCard.order.creator} |
| | | </if> |
| | | <if test="flowCard.order.project != null and flowCard.order.project != ''"> |
| | | and o.project regexp #{flowCard.order.project} |
| | | </if> |
| | | <if test="flowCard.orderNumber != null and flowCard.orderNumber != ''"> |
| | | and fc.order_number regexp #{flowCard.orderNumber} |
| | | </if> |
| | | <if test="flowCard.orderDetail.quantity != null and flowCard.orderDetail.quantity != ''"> |
| | | and od.quantity regexp #{flowCard.orderDetail.quantity} |
| | | </if> |
| | | <if test="flowCard.inventoryQuantity != null and flowCard.inventoryQuantity != ''"> |
| | | and fc.inventory_quantity regexp #{flowCard.inventoryQuantity} |
| | | </if> |
| | | <if test="flowCard.order.area != null and flowCard.order.area != ''"> |
| | | and o.area regexp #{flowCard.order.area} |
| | | </if> |
| | | <if test="flowCard.order.batch != null and flowCard.order.batch != ''"> |
| | | and o.batch regexp #{flowCard.order.batch} |
| | | </if> |
| | | <if test="flowCard.processId != null and flowCard.processId != ''"> |
| | | and fc.process_id regexp #{flowCard.processId} |
| | | </if> |
| | | <if test="flowCard.receivedQuantity != null and flowCard.receivedQuantity != ''"> |
| | | and fc.received_quantity regexp #{flowCard.receivedQuantity} |
| | | </if> |
| | | |
| | | </where> |
| | | group by fc.order_id,fc.order_number,fc.process_id order by fc.create_time |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | <select id="getseletwarehousingPageTotal" > |
| | | select CEILING(count(zu.order_number)/#{pageSize}) from ( |
| | | select fc.order_number as order_number,fc.process_id from pp.flow_card fc left join sd.order_detail od on |
| | | fc.order_id=od.order_id and fc.order_number=od.order_number inner join sd.`order` o on o.order_id=fc.order_id |
| | | <where> |
| | | and fc.received_quantity <![CDATA[<]]> fc.inventory_quantity |
| | | <if test="flowCard.order.orderId != null and flowCard.order.orderId != ''"> |
| | | and o.order_id regexp #{flowCard.order.orderId} |
| | | </if> |
| | | <if test="flowCard.orderDetail.buildingNumber != null and flowCard.orderDetail.buildingNumber != ''"> |
| | | and od.building_number regexp #{flowCard.orderDetail.buildingNumber} |
| | | </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> |
| | | <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.order.creator != null and flowCard.order.creator != ''"> |
| | | and o.creator regexp #{flowCard.order.creator} |
| | | </if> |
| | | <if test="flowCard.order.project != null and flowCard.order.project != ''"> |
| | | and o.project regexp #{flowCard.order.project} |
| | | </if> |
| | | <if test="flowCard.orderNumber != null and flowCard.orderNumber != ''"> |
| | | and fc.order_number regexp #{flowCard.orderNumber} |
| | | </if> |
| | | <if test="flowCard.orderDetail.quantity != null and flowCard.orderDetail.quantity != ''"> |
| | | and od.quantity regexp #{flowCard.orderDetail.quantity} |
| | | </if> |
| | | <if test="flowCard.inventoryQuantity != null and flowCard.inventoryQuantity != ''"> |
| | | and fc.inventory_quantity regexp #{flowCard.inventoryQuantity} |
| | | </if> |
| | | <if test="flowCard.order.area != null and flowCard.order.area != ''"> |
| | | and o.area regexp #{flowCard.order.area} |
| | | </if> |
| | | <if test="flowCard.order.batch != null and flowCard.order.batch != ''"> |
| | | and o.batch regexp #{flowCard.order.batch} |
| | | </if> |
| | | <if test="flowCard.processId != null and flowCard.processId != ''"> |
| | | and fc.process_id regexp #{flowCard.processId} |
| | | </if> |
| | | <if test="flowCard.receivedQuantity != null and flowCard.receivedQuantity != ''"> |
| | | and fc.received_quantity regexp #{flowCard.receivedQuantity} |
| | | </if> |
| | | |
| | | </where> |
| | | group by fc.order_id,fc.order_number,fc.process_id order by fc.create_time) as zu |
| | | </select> |
| | | |
| | | |
| | | <select id="defaultfinishedGoods" resultMap="selectFinishedGoodsInventory"> |
| | | select od.order_number, |
| | | o.order_id, |
| | | o.project, |
| | | o.order_type, |
| | | od.product_name, |
| | | od.product_id, |
| | | od.width, |
| | | od.height, |
| | | fgi.inventory, |
| | | fgi.quantity_available, |
| | | fgi.actual_signal_area, |
| | | fgi.area, |
| | | fgi.warehouse_number, |
| | | fgi.storage_region, |
| | | fgi.`status`, |
| | | fgi.update_time, |
| | | fgi.enter_storage_time, |
| | | fgi.end_time, |
| | | fgi.remark |
| | | from finished_goods_inventory fgi |
| | | left join sd.order_detail od on fgi.order_id = od.order_id and fgi.order_number = od.order_number |
| | | left join sd.`order` o on fgi.order_id = o.order_id |
| | | <where> |
| | | and fgi.status = 0 and fgi.quantity_available>0 |
| | | <if test="finishedGoodsInventory.orderDetail.width != null and finishedGoodsInventory.orderDetail.width != ''"> |
| | | and od.width regexp #{finishedGoodsInventory.orderDetail.width} |
| | | </if> |
| | | <if test="finishedGoodsInventory.orderDetail.orderNumber != null and finishedGoodsInventory.orderDetail.orderNumber != ''"> |
| | | and od.order_number regexp #{finishedGoodsInventory.orderDetail.orderNumber} |
| | | </if> |
| | | <if test="finishedGoodsInventory.orderDetail.productName != null and finishedGoodsInventory.orderDetail.productName != ''"> |
| | | and od.product_name regexp #{finishedGoodsInventory.orderDetail.productName} |
| | | </if> |
| | | <if test="finishedGoodsInventory.orderDetail.productId != null and finishedGoodsInventory.orderDetail.productId != ''"> |
| | | and od.product_id regexp #{finishedGoodsInventory.orderDetail.productId} |
| | | </if> |
| | | <if test="finishedGoodsInventory.order.orderId != null and finishedGoodsInventory.order.orderId != ''"> |
| | | and o.order_id regexp #{finishedGoodsInventory.order.orderId} |
| | | </if> |
| | | <if test="finishedGoodsInventory.order.project != null and finishedGoodsInventory.order.project != ''"> |
| | | and o.project regexp #{finishedGoodsInventory.order.project} |
| | | </if> |
| | | <if test="finishedGoodsInventory.order.orderType != null and finishedGoodsInventory.order.orderType != ''"> |
| | | and o.order_type regexp #{finishedGoodsInventory.order.orderType} |
| | | </if> |
| | | <if test="finishedGoodsInventory.orderDetail.height != null and finishedGoodsInventory.orderDetail.height != ''"> |
| | | and od.height regexp #{finishedGoodsInventory.orderDetail.height} |
| | | </if> |
| | | <if test="finishedGoodsInventory.inventory != null and finishedGoodsInventory.inventory != ''"> |
| | | and fgi.inventory regexp #{finishedGoodsInventory.inventory} |
| | | </if> |
| | | <if test="finishedGoodsInventory.quantityAvailable != null and finishedGoodsInventory.quantityAvailable != ''"> |
| | | and fgi.quantity_available regexp #{finishedGoodsInventory.quantityAvailable} |
| | | </if> |
| | | <if test="finishedGoodsInventory.actualSignalArea != null and finishedGoodsInventory.actualSignalArea != ''"> |
| | | and fgi.actual_signal_area regexp #{finishedGoodsInventory.actualSignalArea} |
| | | </if> |
| | | <if test="finishedGoodsInventory.area != null and finishedGoodsInventory.area != ''"> |
| | | and fgi.area regexp #{finishedGoodsInventory.area} |
| | | </if> |
| | | <if test="finishedGoodsInventory.warehouseNumber != null and finishedGoodsInventory.warehouseNumber != ''"> |
| | | and fgi.warehouse_number regexp #{finishedGoodsInventory.warehouseNumber} |
| | | </if> |
| | | <if test="finishedGoodsInventory.storageRegion != null and finishedGoodsInventory.storageRegion != ''"> |
| | | and fgi.storage_region regexp #{finishedGoodsInventory.storageRegion} |
| | | </if> |
| | | <if test="finishedGoodsInventory.status != null and finishedGoodsInventory.status != ''"> |
| | | and fgi.`status` regexp #{finishedGoodsInventory.status} |
| | | </if> |
| | | <if test="finishedGoodsInventory.enterStorageTime != null and finishedGoodsInventory.enterStorageTime != ''"> |
| | | and fgi.enter_storage_time regexp #{finishedGoodsInventory.enterStorageTime} |
| | | </if> |
| | | <if test="finishedGoodsInventory.updateTime != null and finishedGoodsInventory.updateTime != ''"> |
| | | and fgi.update_time regexp #{finishedGoodsInventory.updateTime} |
| | | </if> |
| | | <if test="finishedGoodsInventory.endTime != null and finishedGoodsInventory.endTime != ''"> |
| | | and fgi.end_time regexp #{finishedGoodsInventory.endTime} |
| | | </if> |
| | | <if test="finishedGoodsInventory.remark != null and finishedGoodsInventory.remark != ''"> |
| | | and fgi.remark regexp #{finishedGoodsInventory.remark} |
| | | </if> |
| | | |
| | | </where> |
| | | order by fgi.id |
| | | |
| | | limit #{offset},#{pageSize} |
| | | ; |
| | | </select> |
| | | |
| | | |
| | | <select id="getPageTotal"> |
| | | select |
| | | CEILING(count(fgi.id)/#{pageSize}) |
| | | from finished_goods_inventory fgi |
| | | left join sd.order_detail od on fgi.order_id = od.order_id and fgi.order_number = od.order_number |
| | | left join sd.`order` o on fgi.order_id = o.order_id |
| | | <where> |
| | | and fgi.status = 0 and fgi.quantity_available>0 |
| | | <if test="finishedGoodsInventory.orderDetail.width != null and finishedGoodsInventory.orderDetail.width != ''"> |
| | | and od.width regexp #{finishedGoodsInventory.orderDetail.width} |
| | | </if> |
| | | <if test="finishedGoodsInventory.orderDetail.orderNumber != null and finishedGoodsInventory.orderDetail.orderNumber != ''"> |
| | | and od.order_number regexp #{finishedGoodsInventory.orderDetail.orderNumber} |
| | | </if> |
| | | <if test="finishedGoodsInventory.orderDetail.productName != null and finishedGoodsInventory.orderDetail.productName != ''"> |
| | | and od.product_name regexp #{finishedGoodsInventory.orderDetail.productName} |
| | | </if> |
| | | <if test="finishedGoodsInventory.orderDetail.productId != null and finishedGoodsInventory.orderDetail.productId != ''"> |
| | | and od.product_id regexp #{finishedGoodsInventory.orderDetail.productId} |
| | | </if> |
| | | <if test="finishedGoodsInventory.order.orderId != null and finishedGoodsInventory.order.orderId != ''"> |
| | | and o.order_id regexp #{finishedGoodsInventory.order.orderId} |
| | | </if> |
| | | <if test="finishedGoodsInventory.order.project != null and finishedGoodsInventory.order.project != ''"> |
| | | and o.project regexp #{finishedGoodsInventory.order.project} |
| | | </if> |
| | | <if test="finishedGoodsInventory.order.orderType != null and finishedGoodsInventory.order.orderType != ''"> |
| | | and o.order_type regexp #{finishedGoodsInventory.order.orderType} |
| | | </if> |
| | | <if test="finishedGoodsInventory.orderDetail.height != null and finishedGoodsInventory.orderDetail.height != ''"> |
| | | and od.height regexp #{finishedGoodsInventory.orderDetail.height} |
| | | </if> |
| | | <if test="finishedGoodsInventory.inventory != null and finishedGoodsInventory.inventory != ''"> |
| | | and fgi.inventory regexp #{finishedGoodsInventory.inventory} |
| | | </if> |
| | | <if test="finishedGoodsInventory.quantityAvailable != null and finishedGoodsInventory.quantityAvailable != ''"> |
| | | and fgi.quantity_available regexp #{finishedGoodsInventory.quantityAvailable} |
| | | </if> |
| | | <if test="finishedGoodsInventory.actualSignalArea != null and finishedGoodsInventory.actualSignalArea != ''"> |
| | | and fgi.actual_signal_area regexp #{finishedGoodsInventory.actualSignalArea} |
| | | </if> |
| | | <if test="finishedGoodsInventory.area != null and finishedGoodsInventory.area != ''"> |
| | | and fgi.area regexp #{finishedGoodsInventory.area} |
| | | </if> |
| | | <if test="finishedGoodsInventory.warehouseNumber != null and finishedGoodsInventory.warehouseNumber != ''"> |
| | | and fgi.warehouse_number regexp #{finishedGoodsInventory.warehouseNumber} |
| | | </if> |
| | | <if test="finishedGoodsInventory.storageRegion != null and finishedGoodsInventory.storageRegion != ''"> |
| | | and fgi.storage_region regexp #{finishedGoodsInventory.storageRegion} |
| | | </if> |
| | | <if test="finishedGoodsInventory.status != null and finishedGoodsInventory.status != ''"> |
| | | and fgi.`status` regexp #{finishedGoodsInventory.status} |
| | | </if> |
| | | <if test="finishedGoodsInventory.enterStorageTime != null and finishedGoodsInventory.enterStorageTime != ''"> |
| | | and fgi.enter_storage_time regexp #{finishedGoodsInventory.enterStorageTime} |
| | | </if> |
| | | <if test="finishedGoodsInventory.updateTime != null and finishedGoodsInventory.updateTime != ''"> |
| | | and fgi.update_time regexp #{finishedGoodsInventory.updateTime} |
| | | </if> |
| | | <if test="finishedGoodsInventory.endTime != null and finishedGoodsInventory.endTime != ''"> |
| | | and fgi.end_time regexp #{finishedGoodsInventory.endTime} |
| | | </if> |
| | | <if test="finishedGoodsInventory.remark != null and finishedGoodsInventory.remark != ''"> |
| | | and fgi.remark regexp #{finishedGoodsInventory.remark} |
| | | </if> |
| | | |
| | | </where> |
| | | |
| | | order by fgi.id desc |
| | | limit #{offset},#{pageSize} |
| | | ; |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <resultMap id="selectFinishedGoodsInventory" type="com.example.erp.entity.mm.FinishedOperateLog" > |
| | | <id column="id" property="id"/> |
| | | <result column="operation_order_number" property="operationOrderNumber"/> |
| | | <result column="product_number" property="productNumber"/> |
| | | <result column="order_id" property="orderId"/> |
| | | <result column="operation_number" property="operationNumber"/> |
| | | <result column="quantity" property="quantity"/> |
| | | <result column="operate_type" property="operateType"/> |
| | | <result column="operator" property="operator"/> |
| | | <result column="operate_time" property="operateTime"/> |
| | | <result column="stater_operation_order_number" property="staterOperationOrderNumber"/> |
| | | <result column="end_operation_order_number" property="endOperationOrderNumber"/> |
| | | <result column="status" property="status"/> |
| | | <result column="type" property="type"/> |
| | | <result column="reviewed" property="reviewed"/> |
| | | <result column="reviewed_time" property="reviewedTime"/> |
| | | <result column="remarks" property="remarks"/> |
| | | <result column="is_state" property="isState"/> |
| | | |
| | | <!--<result column="g_typeId" property="glassTypes.typeId"/> |
| | | <result column="g_type" property="glassTypes.type"/>--> |
| | | <result column="width" property="orderDetail.width"/> |
| | | <result column="height" property="orderDetail.height"/> |
| | | <result column="product_id" property="orderDetail.productId"/> |
| | | <result column="product_name" property="orderDetail.productName"/> |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="getSelectOperateRecord" resultMap="selectFinishedGoodsInventory"> |
| | | select fol.operation_order_number, |
| | | fol.order_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 = '领出' or aa.operate_type = '返工') fol |
| | | left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number |
| | | <where> |
| | | <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 #{finishedOperateLog.orderDetail.width} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail.height != null and finishedOperateLog.orderDetail.height != ''"> |
| | | and od.height regexp #{finishedOperateLog.orderDetail.height} |
| | | </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> |
| | | |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getSelectOperateRecordLogPageTotal" > |
| | | select CEILING(count(fol.id)/#{pageSize}) |
| | | from (select * |
| | | from mm.finished_operate_log aa where aa.operate_type = '领出' or aa.operate_type = '返工') fol |
| | | left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number |
| | | <where> |
| | | <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 #{finishedOperateLog.orderDetail.width} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail.height != null and finishedOperateLog.orderDetail.height != ''"> |
| | | and od.height regexp #{finishedOperateLog.orderDetail.height} |
| | | </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> |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getselectAllocateFinishedOperateLog" resultMap="selectFinishedGoodsInventory" > |
| | | select fol.operation_order_number, |
| | | fol.order_id, |
| | | fol.operation_number, |
| | | fol.stater_operation_order_number, |
| | | fol.end_operation_order_number, |
| | | fol.quantity, |
| | | fol.operator, |
| | | od.product_id, |
| | | od.product_name, |
| | | od.width, |
| | | od.height, |
| | | fol.operate_time |
| | | from (select * |
| | | from mm.finished_operate_log aa where aa.operate_type = '调拨') fol |
| | | left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number |
| | | <where> |
| | | <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.staterOperationOrderNumber != null and finishedOperateLog.staterOperationOrderNumber != ''"> |
| | | and fol.stater_operation_order_number regexp #{finishedOperateLog.staterOperationOrderNumber} |
| | | </if> |
| | | <if test="finishedOperateLog.endOperationOrderNumber != null and finishedOperateLog.endOperationOrderNumber != ''"> |
| | | and fol.end_operation_order_number regexp #{finishedOperateLog.endOperationOrderNumber} |
| | | </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 #{finishedOperateLog.orderDetail.width} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail.height != null and finishedOperateLog.orderDetail.height != ''"> |
| | | and od.height regexp #{finishedOperateLog.orderDetail.height} |
| | | </if> |
| | | <if test="finishedOperateLog.operateTime != null and finishedOperateLog.operateTime != ''"> |
| | | and fol.operate_time regexp #{finishedOperateLog.operateTime} |
| | | </if> |
| | | </where> |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getselectAllocateFinishedOperateLogPageTotal" > |
| | | select CEILING(count(fol.id)/#{pageSize}) |
| | | from (select * |
| | | from mm.finished_operate_log aa where aa.operate_type = '调拨') fol |
| | | left join sd.order_detail od on fol.order_id = od.order_id and fol.end_operation_order_number = od.order_number |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getselectFinishedOperateLog" > |
| | | select |
| | | * |
| | |
| | | mm.finished_operate_log limit 0,1; |
| | | </select> |
| | | |
| | | <insert id="insertFinishedOperateLog" useGeneratedKeys="true" keyProperty="id" > |
| | | |
| | | |
| | | <select id="getmaximum" > |
| | | select count(*) from mm.finished_operate_log where operate_type =#{type} and date(operate_time)=CURDATE() |
| | | </select> |
| | | |
| | | <insert id="insertIntFinishedOperateLog" useGeneratedKeys="true" > |
| | | insert into mm.finished_operate_log(operation_order_number, |
| | | product_number, |
| | | order_id, |
| | | operation_number, |
| | | operate_type, |
| | | operator, |
| | |
| | | operate_time |
| | | ) |
| | | values ( |
| | | #{processId} ,#{orderDetail.productId},#{orderNumber},"入库","王五",#{inventoryQuantity},now() |
| | | #{oddNumber} ,#{flowCard.order.orderId},#{flowCard.orderNumber},"入库",#{userName},#{flowCard.inventoryQuantity},now() |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="insertOutFinishedOperateLog" useGeneratedKeys="true" > |
| | | insert into mm.finished_operate_log(operation_order_number, |
| | | order_id, |
| | | operation_number, |
| | | operate_type, |
| | | operator, |
| | | quantity, |
| | | operate_time |
| | | ) |
| | | values ( |
| | | #{orderDetail.deliveryDetail.deliveryId} ,#{orderDetail.deliveryDetail.order_id},#{orderDetail.deliveryDetail.orderNumber} |
| | | ,"出库",#{userName},#{orderDetail.warehouseNum},now() |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="insertFinishedOperateLogTakeOut" useGeneratedKeys="true" > |
| | | insert into mm.finished_operate_log(operation_order_number, |
| | | order_id, |
| | | operation_number, |
| | | operate_type, |
| | | operator, |
| | | quantity, |
| | | operate_time, |
| | | status, |
| | | type, |
| | | remarks |
| | | ) |
| | | values ( |
| | | #{oddNumber} ,#{orderDetail.finishedGoodsInventory.orderId},#{orderDetail.finishedGoodsInventory.orderNumber} |
| | | ,"领出",#{userName},#{orderDetail.quantity},now(),"未审核",#{operateType},#{remarks} |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="insertFinishedOperateLogAllocate" useGeneratedKeys="true" > |
| | | insert into mm.finished_operate_log(operation_order_number, |
| | | order_id, |
| | | operation_number, |
| | | operate_type, |
| | | operator, |
| | | quantity, |
| | | operate_time, |
| | | stater_operation_order_number, |
| | | end_operation_order_number |
| | | ) |
| | | values ( |
| | | #{oddNumber} ,#{orderDetail.finishedGoodsInventory.orderId},#{orderDetail.finishedGoodsInventory.orderNumber} |
| | | ,"调拨",#{userName},#{orderDetail.quantity},now(),#{orderDetail.orderId},#{orderDetail.orderNumber} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | </mapper> |