Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
# Conflicts:
# .gitignore
19个文件已添加
16个文件已修改
3 文件已重命名
| | |
| | | hs_err_pid* |
| | | |
| | | # Ignore .idea files |
| | | **/.idea/ |
| | | **/.idea/ |
| | |
| | | |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import VXETable from "vxe-table"; |
| | | let router=useRouter() |
| | | let produceList = ref([]) |
| | | let tableRef = ref([]) |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | 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:{ |
| | | orderNumber:'', |
| | | productName:'', |
| | | productId:'', |
| | | width:'', |
| | | height:'', |
| | | quantity:'' |
| | | }, |
| | | order:{ |
| | | orderId:'', |
| | | creater:'', |
| | | project:'', |
| | | area:'', |
| | | batch:'' |
| | | |
| | | } |
| | | }) |
| | | |
| | | |
| | | //第一次调用 |
| | | request.post("/FinishedGoodsInventory/getseletwarehousing/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/getseletwarehousing/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: '220', slots: { default: 'button_slot' },fixed:"left"}, |
| | | {field: 'SalesOrderNumber', width: '150',title: '销售单号', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'floorNumber', width: '120',title: '楼层编号', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'finishedProductNumber',width: '100', title: '成品编号', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: 'finishedProductName', width: '100',title: ' 成品名称', sortable: true}, |
| | | {field: 'productName',width: '100', title: '产品名称', sortable: true}, |
| | | {field: 'length', width: '100',title: '长度', sortable: true}, |
| | | {field: 'width',width: '100', title: '宽度', sortable: true}, |
| | | {field: 'salesperson', width: '100',title: '业务员', sortable: true}, |
| | | {field: 'customerName',width: '100', title: '客户名称', sortable: true}, |
| | | {field: 'projectName', width: '100',title: '项目名称', sortable: true}, |
| | | {field: 'orderNumber',width: '140', title: '订序', sortable: true}, |
| | | {field: 'totalOrders',width: '140', title: '订单总数', sortable: true}, |
| | | {field: 'quantity',width: '100', title: '数量', sortable: true}, |
| | | {field: 'completion',width: '140', title: '完工', sortable: true}, |
| | | {field: 'area',width: '140', title: '面积', sortable: true}, |
| | | {field: 'processCardNumber',width: '100', title: '流程卡号', sortable: true}, |
| | | {field: 'quantityEntered',width: '100', title: '已入数量', sortable: true}, |
| | | {field: 'nextProcess',width: '100', title: ' 下工序', sortable: true}, |
| | | {field: 'Batch',width: '100', title: '批次', sortable: true}, |
| | | {field: 'order.orderId', width: '150',title: '销售单号', showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.buildingNumber', width: '120',title: '楼号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.productId',width: '100', title: '产品编号', filters:[{ data: '' }],showOverflow:"ellipsis",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: 'order.creater', width: '100',title: '业务员', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.project', width: '100',title: '项目名称', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderNumber',width: '140', title: '订序', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.quantity',width: '140', title: '订单总数', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'inventoryQuantity',width: '100', title: '完工数量', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.area',width: '140', title: '面积', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'processId',width: '100', title: '流程卡号', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'receivedQuantity',width: '100', title: '已入数量', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.batch',width: '100', title: '批次', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | ],//表头按钮 |
| | | toolbarConfig: { |
| | | buttons: [{ |
| | | 'name': '确认入库',status: 'primary', |
| | | |
| | | 'code':'add' |
| | | } |
| | | ], |
| | |
| | | print: true, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | "SalesOrderNumber": "NG23072003", |
| | | "floorNumber": "10059419", |
| | | "finishedProductNumber": "0604000027", |
| | | "finishedProductName": "NG23072003A01", |
| | | "productName": '钢化玻璃', |
| | | "length": "1075.00", |
| | | "width": "440.00", |
| | | "salesperson": "小岳", |
| | | "customerName": "大头", |
| | | "projectName": "Tempered Glass", |
| | | "orderNumber": "1", |
| | | "totalOrders": "3800", |
| | | "quantity": "1140", |
| | | "completion":'1140', |
| | | "area": "505.270000", |
| | | "processCardNumber": "NG23112311A01", |
| | | "quantityEntered": "0", |
| | | "nextProcess": "Finished Product", |
| | | "Batch": "一", |
| | | }, |
| | | { |
| | | "SalesOrderNumber": "NG23072003", |
| | | "floorNumber": "10059419", |
| | | "finishedProductNumber": "0604000027", |
| | | "finishedProductName": "NG23072003A01", |
| | | "productName": '钢化玻璃', |
| | | "length": "1075.00", |
| | | "width": "440.00", |
| | | "salesperson": "小岳", |
| | | "customerName": "大头", |
| | | "projectName": "Tempered Glass", |
| | | "orderNumber": "1", |
| | | "totalOrders": "3800", |
| | | "quantity": "1140", |
| | | "completion":'1140', |
| | | "area": "505.270000", |
| | | "processCardNumber": "NG23112311A01", |
| | | "quantityEntered": "0", |
| | | "nextProcess": "Finished Product", |
| | | "Batch": "一", |
| | | }, |
| | | { |
| | | "SalesOrderNumber": "NG23072003", |
| | | "floorNumber": "10059419", |
| | | "finishedProductNumber": "0604000027", |
| | | "finishedProductName": "NG23072003A01", |
| | | "productName": '钢化玻璃', |
| | | "length": "1075.00", |
| | | "width": "440.00", |
| | | "salesperson": "小岳", |
| | | "customerName": "大头", |
| | | "projectName": "Tempered Glass", |
| | | "orderNumber": "1", |
| | | "totalOrders": "3800", |
| | | "quantity": "1140", |
| | | "completion":'1140', |
| | | "area": "505.270000", |
| | | "processCardNumber": "NG23112311A01", |
| | | "quantityEntered": "0", |
| | | "nextProcess": "Finished Product", |
| | | "Batch": "一", |
| | | }, |
| | | { |
| | | "SalesOrderNumber": "NG23072003", |
| | | "floorNumber": "10059419", |
| | | "finishedProductNumber": "0604000027", |
| | | "finishedProductName": "NG23072003A01", |
| | | "productName": '钢化玻璃', |
| | | "length": "1075.00", |
| | | "width": "440.00", |
| | | "salesperson": "小岳", |
| | | "customerName": "大头", |
| | | "projectName": "Tempered Glass", |
| | | "orderNumber": "1", |
| | | "totalOrders": "3800", |
| | | "quantity": "1140", |
| | | "completion":'1140', |
| | | "area": "505.270000", |
| | | "processCardNumber": "NG23112311A01", |
| | | "quantityEntered": "0", |
| | | "nextProcess": "Finished Product", |
| | | "Batch": "一", |
| | | }, |
| | | |
| | | ],//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 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': { |
| | | alert('我接收到子组件传送的编辑信息') |
| | | return; |
| | | //判断输入框值不能为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:{ |
| | | storageRegion:storageRegion.value, |
| | | remark:remark.value |
| | | }, |
| | | |
| | | flowcard:selectRecords[0] |
| | | }) |
| | | console.log(flowcard.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){ |
| | | 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(`请输入库位`) |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | <template> |
| | | <div class="main-div-customer"> |
| | | <div id="selectForm"> |
| | | <el-input style="width: 200px" v-model="storageRegion" class="m-2" placeholder="请输入库位"> |
| | | </el-input> |
| | | <el-input style="width: 200px" v-model="remark" class="m-2" placeholder="请输入备注"> |
| | | </el-input> |
| | | |
| | | |
| | | |
| | | </div> |
| | | |
| | | |
| | | <vxe-grid |
| | | max-height="100%" |
| | | @filter-change="filterChanged" |
| | |
| | | <!-- 下拉显示所有信息插槽--> |
| | | <template #content="{ row}"> |
| | | <ul class="expand-wrapper"> |
| | | <li v-for="(item,key,index) in row"> |
| | | <span style="font-weight: bold">{{key+': '}}</span> |
| | | <span>{{ item }}</span> |
| | | <li v-for="(item,key,index) in gridOptions.columns" v-show="item.field!=undefined "> |
| | | <span style="font-weight: bold">{{item.title+': '}}</span> |
| | | <span v-if="hasDecimal(item.field)">{{ hasDecimalhtml(item.field,row) }}</span> |
| | | <span v-else>{{ row[item.field] }}</span> |
| | | </li> |
| | | </ul> |
| | | </template> |
| | |
| | | |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import {ElMessage} from "element-plus"; |
| | | 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:{ |
| | | orderNumber:'', |
| | | productName:'', |
| | | productId:'', |
| | | width:'', |
| | | height:'' |
| | | }, |
| | | order:{ |
| | | orderId:'', |
| | | orderType:'', |
| | | project:'' |
| | | } |
| | | }) |
| | | |
| | | |
| | | |
| | | //第一次调用 |
| | | request.post("/FinishedGoodsInventory/getselet/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/getselet/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data.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) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | |
| | | 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: '220', slots: { default: 'button_slot' },fixed:"left"}, |
| | | {field: 'OrderNumber', 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: 'OrderType', width: '100',title: '订单类型', sortable: true}, |
| | | {field: 'ProcessCardNumber',width: '100', title: '流程卡号', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: 'ProductName', 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: 'InventoryCount',width: '140', title: '库存数', sortable: true}, |
| | | {field: 'ActualSingleArea',width: '140', title: '实际单片面积', sortable: true}, |
| | | {field: 'Area',width: '100', title: '面积', sortable: true}, |
| | | {field: 'SettlementSingleArea',width: '140', title: '结算单片面积', sortable: true}, |
| | | {field: 'SettlementTotalArea',width: '140', title: '结算总面积', sortable: true}, |
| | | {field: 'AvailableQuantity',width: '100', title: '可用数量', sortable: true}, |
| | | {field: 'FloorNumber',width: '100', title: '楼层编号', sortable: true}, |
| | | {field: 'DeliveryAddress',width: '100', title: '送货地址', sortable: true}, |
| | | {field: 'Batch',width: '100', title: '批次', sortable: true}, |
| | | {field: 'Salesman',width: '100', title: '业务员', sortable: true}, |
| | | {field: 'OrdinaryMillimeter',width: '100', title: '平凡毫米', sortable: true}, |
| | | {field: 'Weight',width: '100', title: '重量', sortable: true}, |
| | | {field: 'LastWarehousingDate',width: '140', title: '最后入库日期', sortable: true}, |
| | | {field: 'LocationNumber',width: '100', title: '库位编号', sortable: true}, |
| | | {field: 'StorageArea',width: '100', title: '存储区域', sortable: true}, |
| | | {field: 'Location',width: '100', title: '库位', sortable: true}, |
| | | {field: 'DocumentStatus',width: '100', title: '单据状态', sortable: true}, |
| | | {field: 'remark',width: '80', title: '备注', sortable: true}, |
| | | {field: 'orderDetail.orderNumber', width:'150', title: '订单序号', filters:[{ data: '' }],editRender: { name: 'input', attrs: { placeholder: '' } } }, |
| | | {field: 'order.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: 'order.orderType', width: '100',title: '订单类型', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.productName', width: '100',title: '产品名称', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.productId',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: 'inventory',width: '140', title: '库存数量', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'quantityAvailable',width: '140', title: '可用数量', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | |
| | | {field: 'actualSignalArea',width: '140', title: '实际单片面积', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'area',width: '100', title: '总面积', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | |
| | | /*{field: 'warehouseNumber',width: '100', title: '仓库编号', filters:[{ data: '' }],slots: { filter: 'num1_filter' }},*/ |
| | | {field: 'storageRegion',width: '100', title: '库存区域', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'status',width: '100', title: '状态', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | |
| | | {field: 'enterStorageTime',width: '140', title: '入库时间', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'updateTime',width: '140', title: '修改时间', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'endTime',width: '100', title: '出库时间', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'remark',width: '80', title: '备注', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | ],//表头按钮 |
| | | toolbarConfig: { |
| | | buttons: [ |
| | |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | "OrderNumber": "1", |
| | | "SalesOrderNumber": "NG23072003", |
| | | "ProjectName": "钢化玻璃", |
| | | "OrderType": "普通订单", |
| | | "ProcessCardNumber": "NG23072003A01", |
| | | "ProductName": '', |
| | | "ProductNumber": "06040000022", |
| | | "CustomerNumber": "KD0071", |
| | | "CustomerName": "件", |
| | | "Length": "1075.00", |
| | | "Width": "440.00", |
| | | "Thickness": "3.00", |
| | | "InventoryCount": "360", |
| | | "ActualSingleArea": "0.473000", |
| | | "Area": "170.28", |
| | | "SettlementSingleArea": "0.47", |
| | | "SettlementTotalArea": "170.28", |
| | | "AvailableQuantity": "360", |
| | | "FloorNumber": "10927769", |
| | | "DeliveryAddress": "上海", |
| | | "Batch": "测试", |
| | | "OrdinaryMillimeter": "陈宗凯", |
| | | "Weight": "1915.6500", |
| | | "LastWarehousingDate": "2023-09-22 08:31:17", |
| | | "LocationNumber": "成品库", |
| | | "StorageArea": "测试", |
| | | "Location": "2", |
| | | "DocumentStatus": "1", |
| | | "Remarks": "测试", |
| | | }, |
| | | { |
| | | "OrderNumber": "1", |
| | | "SalesOrderNumber": "NG23072003", |
| | | "ProjectName": "钢化玻璃", |
| | | "OrderType": "普通订单", |
| | | "ProcessCardNumber": "NG23072003A01", |
| | | "ProductName": '', |
| | | "ProductNumber": "06040000022", |
| | | "CustomerNumber": "KD0071", |
| | | "CustomerName": "件", |
| | | "Length": "1075.00", |
| | | "Width": "440.00", |
| | | "Thickness": "3.00", |
| | | "InventoryCount": "360", |
| | | "ActualSingleArea": "0.473000", |
| | | "Area": "170.28", |
| | | "SettlementSingleArea": "0.47", |
| | | "SettlementTotalArea": "170.28", |
| | | "AvailableQuantity": "360", |
| | | "FloorNumber": "10927769", |
| | | "DeliveryAddress": "上海", |
| | | "Batch": "测试", |
| | | "OrdinaryMillimeter": "陈宗凯", |
| | | "Weight": "1915.6500", |
| | | "LastWarehousingDate": "2023-09-22 08:31:17", |
| | | "LocationNumber": "成品库", |
| | | "StorageArea": "测试", |
| | | "Location": "2", |
| | | "DocumentStatus": "1", |
| | | "Remarks": "测试", |
| | | },{ |
| | | "OrderNumber": "1", |
| | | "SalesOrderNumber": "NG23072003", |
| | | "ProjectName": "钢化玻璃", |
| | | "OrderType": "普通订单", |
| | | "ProcessCardNumber": "NG23072003A01", |
| | | "ProductName": '', |
| | | "ProductNumber": "06040000022", |
| | | "CustomerNumber": "KD0071", |
| | | "CustomerName": "件", |
| | | "Length": "1075.00", |
| | | "Width": "440.00", |
| | | "Thickness": "3.00", |
| | | "InventoryCount": "360", |
| | | "ActualSingleArea": "0.473000", |
| | | "Area": "170.28", |
| | | "SettlementSingleArea": "0.47", |
| | | "SettlementTotalArea": "170.28", |
| | | "AvailableQuantity": "360", |
| | | "FloorNumber": "10927769", |
| | | "DeliveryAddress": "上海", |
| | | "Batch": "测试", |
| | | "OrdinaryMillimeter": "陈宗凯", |
| | | "Weight": "1915.6500", |
| | | "LastWarehousingDate": "2023-09-22 08:31:17", |
| | | "LocationNumber": "成品库", |
| | | "StorageArea": "测试", |
| | | "Location": "2", |
| | | "DocumentStatus": "1", |
| | | "Remarks": "测试", |
| | | }, |
| | | ],//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 '' |
| | | }) |
| | | ] |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | <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> |
| | | <script lang="ts" setup> |
| | | import {reactive, ref} from "vue" |
| | | import {VXETable} from "vxe-table" |
| | | import {useRouter} from "vue-router" |
| | | const router = useRouter() |
| | | import * as XLXS from "xlsx" |
| | | import {ElMessage} from "element-plus" |
| | | import request from "@/utils/request" |
| | | import deepClone from "@/utils/deepClone" |
| | | |
| | | const router = useRouter() |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | menuConfig: { |
| | | body: { |
| | | options: [ |
| | | [ |
| | | { code: 'addRow', name: '添加', prefixIcon: 'vxe-icon-square-plus', visible: true, disabled: false } |
| | | ] |
| | | ] |
| | | } |
| | | }, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | mode: 'cell', |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | // {title: '操作', width: 110,fixed:"left",slots: { default: 'openProductList' }}, |
| | | {type: 'seq',fixed:"left", title: '自序', width: 80 }, |
| | | {field: 'orderID',width:120, title: '楼号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'orderID',width:120, title: '产品',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'orderID',width:120, title: '宽',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'orderID',width:120, title: '高',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'orderID',width:120, title: '数量',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'orderID',width:120, title: '单价',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'orderID',width:120, title: '形状',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'orderID',width:120, title: '总面积',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'orderID',width:120, title: '单片面积',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'orderID',width:120, title: '结算单片面积',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'orderID',width:120, title: '结算总面积',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'orderID',width:120, title: '磨边类型',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'orderID',width:120, title: '加工要求',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'orderID',width:120, title: '备注',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'orderID',width:120, title: '外购',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true} |
| | | {field: 'buildingNumber',width:120, title: '楼号',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'productId',width:140, title: '产品ID',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'productName',width:120, title: '产品',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'price',width:140, title: '单价',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'quantity',width:120, title: '数量',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'grossAmount',width:120, title: '总金额',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'width',width:120, title: '宽',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'height',width:120, title: '高',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'area',width:150, title: '实际单片面积',filters:[{ data: '' }],slots: { filter: 'num1_filter'}, sortable: true}, |
| | | {field: 'grossArea',width:140, title: '实际总面积',filters:[{ data: '' }],slots: { filter: 'num1_filter'}, sortable: true}, |
| | | {field: 'computeArea',width:180, title: '结算单片面积',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'computeGrossArea',width:140, title: '结算总面积',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'shape',width:120, title: '形状',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'bendRadius',width:140, title: '弯钢弧度',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'edgingType',width:140, title: '磨边类型',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'processingNote',width:140, title: '加工要求',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'remarks',width:120, title: '备注',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true} |
| | | |
| | | |
| | | |
| | | ],//表头按钮 |
| | | ], |
| | | //表单验证 |
| | | editRules: { |
| | | buildingNumber: [ |
| | | { required: false}, |
| | | { min: 0, max: 255, message: '名称长度在 0 到 255 个字符' } |
| | | ], |
| | | productId: [ |
| | | { required: true, message: '请选择产品' } |
| | | ], |
| | | price: [ |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^(0|[1-9][0-9]{0,4}([.][0-9]{1,2})?)$/ |
| | | if (cellValue && !regex.test(cellValue)) { |
| | | return new Error('输入0.00~99999.99的数字') |
| | | } |
| | | } |
| | | } |
| | | ], |
| | | computeArea: [ |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^(0|[1-9][0-9]{0,4}([.][0-9]{1,2})?)$/ |
| | | if (cellValue && !regex.test(cellValue)) { |
| | | return new Error('输入0.00~99999.99的数字') |
| | | } |
| | | } |
| | | } |
| | | ], |
| | | quantity: [ |
| | | { type: 'number', min: 0, message: '请输入大于等于0的数值' } |
| | | ], |
| | | width:[ |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^(0|[1-9][0-9]{0,4}([.][0-9]{1,2})?)$/ |
| | | if (cellValue && !regex.test(cellValue)) { |
| | | return new Error('输入0.00~99999.99的数字') |
| | | } |
| | | } |
| | | } |
| | | ], |
| | | height:[ |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^(0|[1-9][0-9]{0,4}([.][0-9]{1,2})?)$/ |
| | | if (cellValue && !regex.test(cellValue)) { |
| | | return new Error('输入0.00~99999.99的数字') |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }, |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | {'code': 'remarks', 'name': '加工要求'}, |
| | | {'code': 'Craft', 'name': '工艺',status: 'primary'}, |
| | | {'code': 'add', 'name': '审核',status: 'primary',disabled: true}, |
| | | {'code': 'add', 'name': '保存',status: 'primary',icon: 'vxe-icon-save'} |
| | | {'code': 'saveOrder', 'name': '保存',status: 'primary',icon: 'vxe-icon-save'} |
| | | ], |
| | | import: false, |
| | | export: true, |
| | | print: true, |
| | | slots: { |
| | | tools: 'toolbar_buttons' |
| | | }, |
| | | // import: false, |
| | | // export: true, |
| | | // print: true, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | ],//table body实际数据 |
| | | } |
| | | , |
| | | //table body实际数据 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | |
| | | } |
| | | |
| | | }) |
| | | |
| | | const gridEvents = { |
| | | toolbarButtonClick ({ code }) { |
| | | async toolbarButtonClick({code}) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'Craft': { |
| | | router.push({path: '/main/order/updateOrderCraft', query: { orderID: 12123 }}) |
| | | await router.push({path: '/main/order/updateOrderCraft', query: {orderID: 12123}}) |
| | | break |
| | | } |
| | | case 'saveOrder': { |
| | | if ($grid.getTableData().tableData.length === 0){ |
| | | ElMessage.error('没有表格数据!') |
| | | return |
| | | } |
| | | console.log($grid.getTableData().tableData) |
| | | if ($grid) { |
| | | const errMap = await $grid.validate(true) |
| | | if (errMap) { |
| | | ElMessage.error(`校验不通过!`) |
| | | return |
| | | } |
| | | let order ={ |
| | | title:titleUploadData.value, |
| | | detail:$grid.getTableData().tableData |
| | | } |
| | | saveOrder(order) |
| | | } |
| | | break |
| | | } |
| | | } |
| | | } |
| | | },//头部按钮事件 |
| | | menuClick ({ menu, row, column }) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (menu.code) { |
| | | case 'deleteList': { |
| | | $grid.removeCheckboxRow() |
| | | break |
| | | } |
| | | case 'addRow': { |
| | | if ($grid.getTableData().tableData.length >=240){ |
| | | ElMessage.error('表格数据已达到最大值!') |
| | | return |
| | | } |
| | | $grid.insert({}) |
| | | //console.log($grid.getRecordset().insertRecords) |
| | | break |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | cellDblclick (params) {//表格内容双击打开产品界面 |
| | | const { row } = params |
| | | //alert("我打开了产品界面") |
| | | } |
| | | } |
| | | |
| | | // 定义表头上传数据 |
| | | const titleUploadData = ref({ |
| | | orderType:'', |
| | | alType:'', |
| | | icon:'', |
| | | orderClassify:'', |
| | | packType:'', |
| | | deliveryDate:'' |
| | | }) |
| | | |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | orderType:[], |
| | | alType:[], |
| | | icon:[], |
| | | orderClassify:[], |
| | | packType:[], |
| | | }) |
| | | //页面第一次加载执行 |
| | | request.get(`/basicData/orderBasicData`).then((res) => { |
| | | if(res.code==200){ |
| | | titleSelectJson.value=deepClone(res.data) |
| | | titleUploadData.value.orderType = titleSelectJson.value.orderType[0].id |
| | | titleUploadData.value.orderClassify = titleSelectJson.value.orderClassify[0].id |
| | | titleUploadData.value.icon = titleSelectJson.value.icon[0].id |
| | | titleUploadData.value.packType = titleSelectJson.value.packType[0].id |
| | | titleUploadData.value.alType = titleSelectJson.value.alType[0].id |
| | | const today = new Date |
| | | today.setTime(today.getTime() + (15 * 24 * 60 * 60 * 1000)) |
| | | titleUploadData.value.deliveryDate = today.getFullYear() + |
| | | '-' + ("0" + (today.getMonth() + 1)).slice(-2) |
| | | + '-' + ("0" + today.getDate()).slice(-2) |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | |
| | | const saveOrder = (order) => { |
| | | request.post(`/order/saveOrder`,order).then((res) => { |
| | | if(res.code==200){ |
| | | ElMessage.success('保存成功') |
| | | }else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | const countAmount = (row) => { |
| | | return |
| | | } |
| | | const area = (row) => { |
| | | return parseFloat((row.width * row.height/1000000).toFixed(2)) |
| | | } |
| | | const countArea = (row) => { |
| | | return parseFloat((row.width * row.height/1000000).toFixed(2))*row.quantity |
| | | } |
| | | |
| | | |
| | | //导入功能 |
| | | const impotEvent = async () => { |
| | | const $grid = xGrid.value |
| | | const { files } = await $grid.readFile({ |
| | | types: ['xls', 'xlsx'] |
| | | }) |
| | | const fileReader = new FileReader() |
| | | fileReader.onload = (event) => { |
| | | const data = event.target ? event.target.result : '' |
| | | const workbook = XLXS.read(data, { type: 'binary' }) |
| | | let jsonData = XLXS.utils.sheet_to_json(workbook.Sheets.Sheet1).slice(1) |
| | | if(jsonData.length>240){ |
| | | ElMessage.error('导入数据不能超过240条,请分订单导入') |
| | | return |
| | | } |
| | | jsonData.forEach((item,index) => { |
| | | //item.computeArea |
| | | //console.log() |
| | | if(item.computeArea === undefined){ |
| | | item.computeArea = area(item) |
| | | } |
| | | item.computeGrossArea = parseFloat((item.computeArea*item.quantity).toString()) |
| | | }) |
| | | |
| | | xGrid.value.loadData(jsonData) |
| | | } |
| | | fileReader.readAsBinaryString(files[0]) |
| | | } |
| | | |
| | | //行单元格修改修改触发此事件 |
| | | const editClosedEvent = ({ row, column }) => { |
| | | //判断修改相应的数值修改面积与金额 |
| | | if (['width', 'height', 'quantity', 'price'].includes(column.property)) { |
| | | row.area = area(row) |
| | | row.grossArea = countArea(row) |
| | | row.computeArea = row.area |
| | | row.computeGrossArea = row.grossArea |
| | | row.grossAmount=row.price * row.computeGrossArea |
| | | }else if(column.property === 'computeArea'){ |
| | | row.computeGrossArea=parseFloat((row.computeArea*row.quantity).toString()) |
| | | row.grossAmount=row.price * row.computeGrossArea |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <div class="main-div"> |
| | | |
| | | <div class="order-primary" style="background-color: white"> |
| | | <el-row> |
| | | <el-col :span="2"><el-text>*项目名称:</el-text></el-col> |
| | |
| | | </el-col> |
| | | <el-col :span="2"><el-text>*订单类型:</el-text></el-col> |
| | | <el-col :span="2"> |
| | | <el-select clearable placeholder=" " > |
| | | <el-option /> |
| | | <el-select v-model="titleUploadData.orderType" clearable placeholder="" > |
| | | <el-option |
| | | v-for="item in titleSelectJson['orderType']" |
| | | :key="item.id" |
| | | :label="item.basicName" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-col> |
| | | <el-col :span="2"><el-text>订单分类:</el-text></el-col> |
| | | <el-col :span="2"> |
| | | <el-select clearable placeholder=" " > |
| | | <el-option/> |
| | | <el-select v-model="titleUploadData.orderClassify" clearable placeholder=" " > |
| | | <el-option |
| | | v-for="item in titleSelectJson['orderClassify']" |
| | | :key="item.id" |
| | | :label="item.basicName" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-col> |
| | | <el-col :span="2"><el-text>商标选项:</el-text></el-col> |
| | | <el-col :span="2"> |
| | | <el-select clearable placeholder=" " > |
| | | <el-option/> |
| | | <el-select v-model="titleUploadData.icon" clearable placeholder=" " > |
| | | <el-option v-for="item in titleSelectJson['icon']" |
| | | :key="item.id" |
| | | :label="item.basicName" |
| | | :value="item.id"/> |
| | | </el-select> |
| | | </el-col> |
| | | <el-col :span="2"><el-text>包装方式:</el-text></el-col> |
| | | <el-col :span="2"> |
| | | <el-select clearable placeholder=" " > |
| | | <el-option/> |
| | | <el-select v-model="titleUploadData.packType" clearable placeholder=" " > |
| | | <el-option v-for="item in titleSelectJson['packType']" |
| | | :key="item.id" |
| | | :label="item.basicName" |
| | | :value="item.id"/> |
| | | </el-select> |
| | | </el-col> |
| | | <!-- <el-col :span="2"><el-text /></el-col>--> |
| | |
| | | <el-col :span="2"><el-text>交货日期:</el-text></el-col> |
| | | <el-col :span="2"> |
| | | <el-date-picker |
| | | type="week" |
| | | format="[Week] ww" |
| | | placeholder="选择日期"/> |
| | | v-model="titleUploadData.deliveryDate" |
| | | type="date" |
| | | placeholder="Pick a day" |
| | | /> |
| | | </el-col> |
| | | <el-col :span="2"><el-text>批次:</el-text></el-col> |
| | | <el-col :span="2"><el-input/></el-col> |
| | |
| | | </el-col> |
| | | <el-col :span="2"><el-text>铝条方式:</el-text></el-col> |
| | | <el-col :span="2"> |
| | | <el-select clearable placeholder=" " > |
| | | <el-option/> |
| | | <el-select v-model="titleUploadData.alType" clearable placeholder=" " > |
| | | <el-option v-for="item in titleSelectJson['alType']" |
| | | :key="item.id" |
| | | :label="item.basicName" |
| | | :value="item.id"/> |
| | | </el-select> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | @edit-closed="editClosedEvent" |
| | | > |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <template #toolbar_buttons> |
| | | <vxe-button @click="impotEvent">导入</vxe-button> |
| | | </template> |
| | | |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | |
| | | //第一次加载数据 |
| | | request.post("/product/1/100/"+productGlassTypeStore.GlassType,filterData.value).then((res) => { |
| | | request.post(`/product/1/100/${productGlassTypeStore.GlassType}`,filterData.value).then((res) => { |
| | | if(res.code==200){ |
| | | console.log(res.data.data) |
| | | pageTotal.value=res.data.total |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | xGrid.value.reloadData(produceList) |
| | |
| | | <version>3.5.1</version> |
| | | </dependency> |
| | | |
| | | <!-- SwaggerUi--> |
| | | <!-- SwaggerUi--> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-swagger2</artifactId> |
| | |
| | | <artifactId>spring-boot-starter-cache</artifactId> |
| | | </dependency> |
| | | |
| | | <!--websocket--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.springframework.boot</groupId>--> |
| | | <!-- <artifactId>spring-boot-starter-websocket</artifactId>--> |
| | | <!-- </dependency>--> |
| | | <!--websocket--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.springframework.boot</groupId>--> |
| | | <!-- <artifactId>spring-boot-starter-websocket</artifactId>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <dependency> |
| | | <groupId>io.netty</groupId> |
| | |
| | | <artifactId>fastjson</artifactId> |
| | | <version>1.2.24</version> |
| | | <scope>import</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.data</groupId> |
| | | <artifactId>spring-data-commons</artifactId> |
| | | <version>2.5.8</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | |
| | | </snapshots> |
| | | </pluginRepository> |
| | | </pluginRepositories>--> |
| | | </project> |
| | | </project> |
| File was renamed from north-glass-erp/src/main/java/com/example/erp/controller/OrderController.java |
| | |
| | | package com.example.erp.controller; |
| | | |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.mapper.OrderMapper; |
| | | import com.example.erp.entity.Order; |
| | | import com.example.erp.mapper.OrderTestMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | //@CrossOrigin //解决单个controller 跨域问题 |
| | | @RestController |
| | | @RequestMapping("/order") |
| | | @RequestMapping("/order11111111") |
| | | |
| | | public class OrderController { |
| | | public class OrderTestController { |
| | | @Autowired |
| | | private OrderMapper orderMapper; |
| | | private OrderTestMapper orderMapper; |
| | | |
| | | // @GetMapping //查询order表结果集 |
| | | // public Result index(){ |
| New file |
| | |
| | | package com.example.erp.controller.mm; |
| | | |
| | | |
| | | |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.exception.ServiceException; |
| | | import com.example.erp.service.mm.FinishedGoodsInventoryService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.example.erp.entity.mm.FinishedGoodsInventory; |
| | | |
| | | |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @RequestMapping("/FinishedGoodsInventory") |
| | | public class FinishedGoodsInventoryController { |
| | | @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){ |
| | | if(finishedGoodsInventoryService.addseletwarehousing(object)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"入库失败"); |
| | | |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.example.erp.controller.sd; |
| | | |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.service.sd.BasicDateService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @RequestMapping("/basicData") |
| | | public class BasicDataController { |
| | | @Autowired |
| | | BasicDateService basicDateService; |
| | | @GetMapping("/orderBasicData") |
| | | public Result getOrderBasicData(){ |
| | | return Result.seccess(basicDateService.getOrderBasicData()); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.example.erp.controller.sd; |
| | | |
| | | import cn.hutool.json.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.service.sd.OrderService; |
| | | import org.apache.tomcat.Jar; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @RequestMapping("/order") |
| | | public class OrderController { |
| | | @Autowired |
| | | private OrderService orderService; |
| | | |
| | | @PostMapping("/saveOrder") |
| | | public Result saveOrder(@RequestBody Map<String, Object> orderMap) { |
| | | return Result.seccess(orderService.saveOrder(orderMap)); |
| | | } |
| | | } |
| File was renamed from north-glass-erp/src/main/java/com/example/erp/entity/Order.java |
| | |
| | | |
| | | @Data //lombok 简写java代码 实体类的get与set |
| | | @TableName("`order`") |
| | | public class Order { |
| | | public class OrderTest { |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | private String orderId; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.example.erp.entity.sd.Customer; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.entity.sd.*; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | |
| | | @TableId(type = IdType.AUTO) |
| | | |
| | | private Long id; |
| | | private String orderId; |
| | | private Integer orderNumber; |
| | | private Order order; |
| | | private OrderDetail orderDetail; |
| | | private Integer inventory ; |
| | | private Double actualSignalArea; |
| | | private Double area; |
| | | private Integer quantityAvailable; |
| | | private String warehouseNumber; |
| | | private LocalDate storageRegion; |
| | | private String storageRegion; |
| | | private Integer status; |
| | | private LocalDate enterStorageTime; |
| | | private String remark; |
| | |
| | | private Long id; |
| | | private String operationOrderNumber; |
| | | private Long productNumber; |
| | | private Integer operationNumber ; |
| | | private Integer operationNumber; |
| | | private Integer quantity; |
| | | private String operateType; |
| | | private String operator; |
| | | private LocalDate operateTime; |
| | | private String staterOperationOrderNumber; |
| | | private String endOperationOrderNumber;; |
| | | |
| | | |
| | | } |
| | |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | private String basicType; |
| | | private String name; |
| | | private String type; |
| | | private String basicName; |
| | | private String basicCategory; |
| | | private LocalDate createTime; |
| | | private LocalDate updateTime; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | @TableName("`order`") |
| | | public class Order { |
| | | @TableId(type = IdType.AUTO) |
| | | |
| | |
| | | private Double otherMoney; |
| | | private String otherMoneyRemarks; |
| | | private String processingNote; |
| | | private String otherRemaks; |
| | | private String otherRemarks; |
| | | private Double area; |
| | | private Long quantity; |
| | | private String verifierId; |
| | | private String verifier; |
| | | private String createrId; |
| | | private String creater; |
| | | private String creatorId; |
| | | private String creator; |
| | | private Integer createOrder; |
| | | private Integer processReview; |
| | | private Integer orderReview; |
| | |
| | | |
| | | private Integer orderNumber; |
| | | private String buildingNumber; |
| | | private Integer productId; |
| | | private String productName; |
| | | private Double price; |
| | | private Long quantity; |
| | |
| | | private LocalDate updateTime; |
| | | |
| | | private Order order; |
| | | private Product product; |
| | | //private Product product; |
| | | |
| | | } |
| File was renamed from north-glass-erp/src/main/java/com/example/erp/mapper/OrderMapper.java |
| | |
| | | package com.example.erp.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.erp.entity.Order; |
| | | import com.example.erp.entity.OrderTest; |
| | | import org.apache.ibatis.annotations.*; |
| | | |
| | | import java.util.List; |
| | | @Mapper |
| | | public interface OrderMapper extends BaseMapper<Order> { |
| | | public interface OrderTestMapper extends BaseMapper<OrderTest> { |
| | | |
| | | // @Select("select * from `order`") |
| | | // List<Order> findAll(); |
| | |
| | | package com.example.erp.mapper.mm; |
| | | |
| | | 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.entity.sd.Product; |
| | | import com.example.erp.entity.userInfo.User; |
| | | 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 FinishedGoodsInventoryMapper { |
| | | List<FinishedGoodsInventory> defaultProduct(@Param("offset") Integer offset, @Param("pageSize") Integer pageSize); |
| | | public interface FinishedGoodsInventoryMapper extends CrudRepository<FinishedGoodsInventory,Long> { |
| | | |
| | | |
| | | |
| | | List<FinishedGoodsInventory> defaultfinishedGoods(@Param("offset") Integer offset, |
| | | @Param("pageSize") Integer pageSize, |
| | | @Param("finishedGoodsInventory") FinishedGoodsInventory finishedGoodsInventory); |
| | | |
| | | Integer getPageTotal(Integer offset, Integer pageSize,FinishedGoodsInventory finishedGoodsInventory); |
| | | |
| | | List<FlowCard> getseletwarehousing(@Param("offset") Integer offset, |
| | | @Param("pageSize") Integer pageSize, |
| | | @Param("flowCard") FlowCard flowCard); |
| | | |
| | | Integer getseletwarehousingPageTotal(Integer offset, Integer pageSize,FlowCard flowCard); |
| | | |
| | | Integer findOrderNumberdcount(Integer orderNumber); |
| | | |
| | | Boolean updateInventory(FlowCard flowCard); |
| | | Boolean updateflowcard(FlowCard flowCard); |
| | | |
| | | Boolean insertFinishedGoodsInventory(@Param("flowCard") FlowCard flowCard, |
| | | @Param("storageRegion") String storageRegion, |
| | | @Param("remark") String remark); |
| | | } |
| | | |
| | | |
| | |
| | | package com.example.erp.mapper.mm; |
| | | |
| | | import com.example.erp.entity.mm.FinishedGoodsInventory; |
| | | import com.example.erp.entity.mm.FinishedOperateLog; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.data.repository.CrudRepository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface FinishedOperateLogMapper { |
| | | List<FinishedOperateLog> defaultProduct(@Param("offset") Integer offset, @Param("pageSize") Integer pageSize); |
| | | public interface FinishedOperateLogMapper extends CrudRepository<FinishedOperateLog,Long> { |
| | | FinishedOperateLog getselectFinishedOperateLog(); |
| | | |
| | | Boolean insertFinishedOperateLog(FlowCard flowCard); |
| | | } |
| New file |
| | |
| | | package com.example.erp.mapper.sd; |
| | | |
| | | import com.example.erp.entity.sd.BasicData; |
| | | import com.example.erp.service.sd.BasicDateService; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | public interface BasicDateMapper { |
| | | |
| | | List<BasicData> getOrderBasicData(); |
| | | List<String> getOrderBasicDataType(); |
| | | } |
| New file |
| | |
| | | package com.example.erp.mapper.sd; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface OrderDetailMapper extends BaseMapper<OrderDetail> { |
| | | |
| | | boolean insertBatch(List<OrderDetail> orderDetails); |
| | | } |
| New file |
| | |
| | | package com.example.erp.mapper.sd; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.erp.entity.sd.Order; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface OrderMapper extends BaseMapper<Order> { |
| | | Integer selectMaxOrderId(); |
| | | } |
| | |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.example.erp.entity.Order; |
| | | import com.example.erp.mapper.OrderMapper; |
| | | import com.example.erp.entity.OrderTest; |
| | | import com.example.erp.mapper.OrderTestMapper; |
| | | import com.example.erp.service.IOrderService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | @DS("erp_sd") |
| | | public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements IOrderService { |
| | | public class OrderServiceImpl extends ServiceImpl<OrderTestMapper, OrderTest> implements IOrderService { |
| | | } |
| New file |
| | |
| | | package com.example.erp.service.mm; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.example.erp.entity.mm.FinishedGoodsInventory; |
| | | import com.example.erp.entity.mm.FinishedOperateLog; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | 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.time.LocalDate; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | @DS("mm") |
| | | public class FinishedGoodsInventoryService { |
| | | @Autowired |
| | | FinishedGoodsInventoryMapper finishedGoodsInventoryMapper; |
| | | @Autowired |
| | | FinishedOperateLogMapper finishedOperateLogMapper; |
| | | public Map<String,Object> defaultDateFinishedGoodsInventory(Integer pageNum, Integer pageSize,FinishedGoodsInventory finishedGoodsInventory) { |
| | | Integer offset = (pageNum-1)*pageSize; |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("data",finishedGoodsInventoryMapper.defaultfinishedGoods(offset,pageSize,finishedGoodsInventory)); |
| | | map.put("total",finishedGoodsInventoryMapper.getPageTotal(offset,pageSize,finishedGoodsInventory)); |
| | | return map; |
| | | } |
| | | |
| | | public Map<String,Object> getseletwarehousing(Integer pageNum, Integer pageSize, FlowCard flowCard) { |
| | | Integer offset = (pageNum-1)*pageSize; |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("data",finishedGoodsInventoryMapper.getseletwarehousing(offset,pageSize,flowCard)); |
| | | map.put("total",finishedGoodsInventoryMapper.getseletwarehousingPageTotal(offset,pageSize,flowCard)); |
| | | |
| | | return map; |
| | | } |
| | | |
| | | public Boolean addseletwarehousing(Map<String,Map<String,Object>> object) { |
| | | |
| | | 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); |
| | | //添加出入库记录 |
| | | finishedOperateLogMapper.insertFinishedOperateLog(flowCard); |
| | | System.out.println(flowCard.getOrder().getOrderId()); |
| | | Integer finishedGoodsInventorycount=finishedGoodsInventoryMapper.findOrderNumberdcount(flowCard.getOrderNumber()); |
| | | System.out.println("数量:"+finishedGoodsInventorycount); |
| | | if(finishedGoodsInventorycount>0){ |
| | | finishedGoodsInventoryMapper.updateInventory(flowCard); |
| | | finishedGoodsInventoryMapper.updateflowcard(flowCard); |
| | | return true; |
| | | }else{ |
| | | if (finishedGoodsInventoryMapper.insertFinishedGoodsInventory(flowCard,storageRegion,remark)){ |
| | | finishedGoodsInventoryMapper.updateflowcard(flowCard); |
| | | return true; |
| | | }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("");*/ |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | package com.example.erp.service.sd; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.example.erp.mapper.sd.BasicDateMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.example.erp.entity.sd.BasicData; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | @DS("sd") |
| | | public class BasicDateService { |
| | | @Autowired |
| | | BasicDateMapper basicDateMapper; |
| | | //获取订单基本数据 |
| | | public Map<String, List<Object>> getOrderBasicData() { |
| | | //获取订单基本数据类型 |
| | | List<String> orderBasicDataType = basicDateMapper.getOrderBasicDataType(); |
| | | //获取订单基本数据 |
| | | List<BasicData> orderBasicData = basicDateMapper.getOrderBasicData(); |
| | | //创建Map对象 |
| | | Map<String, List<Object>> orderBasicDataMap = new HashMap<>(); ; |
| | | //创建List对象 |
| | | |
| | | //遍历订单基本数据类型 |
| | | for(String item :orderBasicDataType){ |
| | | List<Object> orderBasicDataList = new ArrayList<>(); |
| | | //将类型和List对象放入Map中 |
| | | orderBasicDataMap.put(item,orderBasicDataList); |
| | | } |
| | | //遍历订单基本数据 |
| | | for (BasicData item : orderBasicData){ |
| | | //将数据放入List中 |
| | | orderBasicDataMap.get(item.getBasicCategory()).add(item); |
| | | } |
| | | //返回Map对象 |
| | | return orderBasicDataMap; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.example.erp.service.sd; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.mapper.sd.OrderDetailMapper; |
| | | import com.example.erp.mapper.sd.OrderMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | @DS("sd") |
| | | public class OrderService { |
| | | @Autowired |
| | | private OrderMapper orderMapper; |
| | | @Autowired |
| | | private OrderDetailMapper orderDetailMapper; |
| | | |
| | | public boolean saveOrder(Map<String,Object> orderMap) { |
| | | JSONObject orderJson = new JSONObject(orderMap); |
| | | Order order = JSONObject.parseObject(JSONObject.toJSONString(orderJson.get("title")), Order.class); |
| | | List<OrderDetail> OrderDetails = JSONArray.parseArray(JSONObject.toJSONString(orderJson.get("detail")), OrderDetail.class); |
| | | boolean saveState = true; |
| | | //判断传入id参数是否为空,未传入id为空插入订单表,传入更新表 |
| | | if(order.getOrderId() == null){ |
| | | saveState = insertOrder(order,OrderDetails); |
| | | }else { |
| | | saveState = updateOrder(order,OrderDetails); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | return false; |
| | | } |
| | | @Transactional |
| | | public boolean insertOrder(Order order,List<OrderDetail> OrderDetails) { |
| | | Integer maxOrderId = orderMapper.selectMaxOrderId(); |
| | | //查询订单id,并且自增 |
| | | String formattedNumber = String.format("%02d", maxOrderId+1); |
| | | //格式化当前日期 |
| | | Date currentDate = new Date(); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMdd"); |
| | | String formattedDate = dateFormat.format(currentDate); |
| | | //往主表插数据 |
| | | orderMapper.insert(order); |
| | | //循环给订单明细表字段添加序号和周长 |
| | | for (int i = 0; i < OrderDetails.size(); i++) { |
| | | OrderDetails.get(i).setOrderNumber(i+1); |
| | | order.setOrderId(formattedDate); |
| | | OrderDetails.get(i).setPerimeter(OrderDetails.get(i).getWidth()*OrderDetails.get(i).getHeight()*2); |
| | | } |
| | | //往明细表插数据 |
| | | orderDetailMapper.insertBatch(OrderDetails); |
| | | return false; |
| | | } |
| | | |
| | | public boolean updateOrder(Order order,List<OrderDetail> OrderDetails) { |
| | | return false; |
| | | } |
| | | } |
| | |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | # mm: |
| | | # url: jdbc:mysql://localhost:3306/mm?serverTimezone=GMT%2b8 |
| | | # username: root |
| | | # password: beibo.123/ |
| | | # driver-class-name: com.mysql.cj.jdbc.Driver |
| | | # pp: |
| | | # url: jdbc:mysql://localhost:3306/pp?serverTimezone=GMT%2b8 |
| | | # username: root |
| | | # password: beibo.123/ |
| | | # driver-class-name: com.mysql.cj.jdbc.Driver |
| | | mm: |
| | | url: jdbc:mysql://10.153.19.150:3306/mm?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | pp: |
| | | url: jdbc:mysql://10.153.19.150:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| 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="creater" property="order.creater"/> |
| | | <result column="area" property="order.area"/> |
| | | <result column="batch" property="order.batch"/> |
| | | |
| | | <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> |
| | | |
| | | <update id="updateflowcard"> |
| | | update pp.flow_card |
| | | set received_quantity=received_quantity+${inventoryQuantity} |
| | | where order_number=#{orderNumber} and process_id=#{processId} |
| | | </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} |
| | | </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} |
| | | |
| | | </select> |
| | | |
| | | <select id="findOrderNumberd" > |
| | | select * |
| | | from sd.finished_goods_inventory |
| | | where order_number = #{orderNumber} |
| | | |
| | | </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.creater, |
| | | 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_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.creater != null and flowCard.order.creater != ''"> |
| | | and o.creater regexp #{flowCard.order.creater} |
| | | </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_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 |
| | | <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.creater != null and flowCard.order.creater != ''"> |
| | | and o.creater regexp #{flowCard.order.creater} |
| | | </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_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_number = od.order_number |
| | | inner join sd.`order` o on fgi.order_id = o.order_id |
| | | <where> |
| | | <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_number = od.order_number |
| | | inner join sd.`order` o on fgi.order_id = o.order_id |
| | | <where> |
| | | <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> |
| 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.FinishedOperateLogMapper"> |
| | | <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="operation_number" property="operationNumber"/> |
| | | <result column="operate_type" property="operateType"/> |
| | | <result column="operator" property="operator"/> |
| | | <result column="operate_time" property="operateTime"/> |
| | | |
| | | <!--<result column="g_typeId" property="glassTypes.typeId"/> |
| | | <result column="g_type" property="glassTypes.type"/>--> |
| | | |
| | | </resultMap> |
| | | <select id="getselectFinishedOperateLog" > |
| | | select |
| | | * |
| | | from |
| | | mm.finished_operate_log limit 0,1; |
| | | </select> |
| | | |
| | | <insert id="insertFinishedOperateLog" useGeneratedKeys="true" keyProperty="id" > |
| | | insert into mm.finished_operate_log(operation_order_number, |
| | | product_number, |
| | | operation_number, |
| | | operate_type, |
| | | operator, |
| | | quantity, |
| | | operate_time |
| | | ) |
| | | values ( |
| | | #{processId} ,#{orderDetail.productId},#{orderNumber},"入库","王五",#{inventoryQuantity},now() |
| | | ) |
| | | </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.sd.BasicDateMapper"> |
| | | <select id="getOrderBasicData"> |
| | | select |
| | | * |
| | | from |
| | | basic_data as a |
| | | where a.basic_type='order' |
| | | </select> |
| | | <select id="getOrderBasicDataType"> |
| | | select |
| | | a.basic_category |
| | | from |
| | | basic_data as a |
| | | where a.basic_type='order' |
| | | group by a.basic_category |
| | | |
| | | </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.sd.OrderDetailMapper"> |
| | | <insert id="insertBatch" parameterType="java.util.List"> |
| | | INSERT INTO |
| | | order_detail (order_id, |
| | | order_number, |
| | | building_number, |
| | | product_id, |
| | | product_name, |
| | | price, |
| | | quantity, |
| | | gross_amount, |
| | | width, |
| | | height, |
| | | shape, |
| | | area, |
| | | gross_area, |
| | | compute_area, |
| | | compute_gross_area, |
| | | processing_note, |
| | | remarks, |
| | | bend_radius, |
| | | edging_type, |
| | | weight, |
| | | perimeter |
| | | ) |
| | | values |
| | | <foreach collection ="orderDetails" item="orderDetail" separator =","> |
| | | (#{orderDetail.orderId}, |
| | | #{orderDetail.orderNumber}, |
| | | #{orderDetail.buildingNumber}, |
| | | #{orderDetail.productId}, |
| | | #{orderDetail.productName}, |
| | | #{orderDetail.price}, |
| | | #{orderDetail.quantity}, |
| | | #{orderDetail.grossAmount}, |
| | | #{orderDetail.width}, |
| | | #{orderDetail.height}, |
| | | #{orderDetail.shape}, |
| | | #{orderDetail.area}, |
| | | #{orderDetail.grossArea}, |
| | | #{orderDetail.computeArea}, |
| | | #{orderDetail.computeGrossArea}, |
| | | #{orderDetail.processingNote}, |
| | | #{orderDetail.remarks}, |
| | | #{orderDetail.bendRadius}, |
| | | #{orderDetail.edgingType}, |
| | | #{orderDetail.weight}, |
| | | #{orderDetail.perimeter} |
| | | ) |
| | | </foreach> |
| | | </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.sd.OrderMapper"> |
| | | <select id="selectMaxOrderId"> |
| | | select |
| | | COUNT(a.order_id) |
| | | from |
| | | `order` as a |
| | | where |
| | | a.create_time = curdate() |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package com.example.erp.service.sd; |
| | | |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import static org.junit.jupiter.api.Assertions.*; |
| | | @SpringBootTest |
| | | class BasicDateServiceTest { |
| | | @Autowired |
| | | private BasicDateService basicDateService; |
| | | @Test |
| | | void getOrderBasicData() { |
| | | basicDateService.getOrderBasicData(); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.example.erp.service.sd; |
| | | |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | import static org.junit.jupiter.api.Assertions.*; |
| | | @SpringBootTest |
| | | class OrderServiceTest { |
| | | @Autowired |
| | | OrderService orderService; |
| | | |
| | | @Test |
| | | void testCreateOrder() { |
| | | Map<String, Object> order =new HashMap<>(); |
| | | |
| | | //orderService.saveOrder(); |
| | | } |
| | | |
| | | } |
| | |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | # mm: |
| | | # url: jdbc:mysql://localhost:3306/mm?serverTimezone=GMT%2b8 |
| | | # username: root |
| | | # password: beibo.123/ |
| | | # driver-class-name: com.mysql.cj.jdbc.Driver |
| | | # pp: |
| | | # url: jdbc:mysql://localhost:3306/pp?serverTimezone=GMT%2b8 |
| | | # username: root |
| | | # password: beibo.123/ |
| | | # driver-class-name: com.mysql.cj.jdbc.Driver |
| | | mm: |
| | | url: jdbc:mysql://10.153.19.150:3306/mm?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | pp: |
| | | url: jdbc:mysql://10.153.19.150:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| 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.FinishedOperateLogMapper"> |
| | | <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="operation_number" property="operationNumber"/> |
| | | <result column="operate_type" property="operateType"/> |
| | | <result column="operator" property="operator"/> |
| | | <result column="operate_time" property="operateTime"/> |
| | | |
| | | <!--<result column="g_typeId" property="glassTypes.typeId"/> |
| | | <result column="g_type" property="glassTypes.type"/>--> |
| | | |
| | | </resultMap> |
| | | <select id="getselectFinishedOperateLog" > |
| | | select |
| | | * |
| | | from |
| | | mm.finished_operate_log limit 0,1; |
| | | </select> |
| | | |
| | | <insert id="insertFinishedOperateLog" useGeneratedKeys="true" keyProperty="id" > |
| | | insert into mm.finished_operate_log(operation_order_number, |
| | | product_number, |
| | | operation_number, |
| | | operate_type, |
| | | operator, |
| | | quantity, |
| | | operate_time |
| | | ) |
| | | values ( |
| | | #{processId} ,#{orderDetail.productId},#{orderNumber},"入库","王五",#{inventoryQuantity},now() |
| | | ) |
| | | </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.sd.BasicDateMapper"> |
| | | <select id="getOrderBasicData"> |
| | | select |
| | | * |
| | | from |
| | | basic_data as a |
| | | where a.basic_type='order' |
| | | </select> |
| | | <select id="getOrderBasicDataType"> |
| | | select |
| | | a.basic_category |
| | | from |
| | | basic_data as a |
| | | where a.basic_type='order' |
| | | group by a.basic_category |
| | | |
| | | </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.sd.OrderMapper"> |
| | | <select id="selectMaxOrderId"> |
| | | select |
| | | COUNT(a.order_id) |
| | | from |
| | | `order` as a |
| | | where |
| | | a.create_time = curdate() |
| | | </select> |
| | | |
| | | </mapper> |