Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
| | |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/productStock/OrderAllocation', query: { id: row.id }}) |
| | | router.push({path: '/main/delivery/createDelivery', query: { deliveryID: row.deliveryDetail.deliveryId }}) |
| | | break |
| | | } |
| | | case 'back':{ |
| | |
| | | { type: 'seq',fixed:"left", title: '自序', width: '80' }, |
| | | {title: '操作', width: '80', slots: { default: 'button_slot' },fixed:"left"}, |
| | | {field: 'deliveryDetail.deliveryId', width:'150', title: '送货单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' } }, |
| | | {field: 'deliveryDetail.orderNumber', width:'150', title: '送货序号 ',filters:[{ data: '' }],slots: { filter: 'num1_filter' } }, |
| | | {field: 'deliveryDetail.orderId', width: '150',title: '销售单号',showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.project', width: '120',title: '项目名称', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'deliveryDetail.orderNumber',width: '100', title: '订单序号', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.project', width: '120',title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'productId', width: '100',title: '产品编号', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'productName',width: '200', title: '产品名称', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'deliveryNum',width: '100', title: '发货数量', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'warehouseNum',width: '140', title: '库存数量', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'delivery.customerName',width: '200', title: '客户名称', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'width', width: '100',title: '宽度', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'height',width: '100', title: '高度', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'delivery.quantity',width: '100', title: '订单总数', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'warehouseNum',width: '140', title: '数量', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'delivery.area',width: '100', title: '总面积', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'buildingNumber',width: '100', title: '楼层编号', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'deliveryDetail.orderNumber',width: '100', title: '订单序号', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'delivery.creator',width: '100', title: '业务员', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'deliveryDetail.createTime',width: '140', title: '报表日期', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | //{field: 'Status',width: '100', title: '状态', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | |
| | | |
| | | }) |
| | | //页面第一次加载 |
| | | request.get(`/basicData/deliveryBasicData`).then((res) => { |
| | | request.get(`/basicData/BasicDataByType/delivery`).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | titleSelectJson.value=deepClone(res.data) |
| | |
| | | case 'toExamine': { |
| | | let flowData = ref({ |
| | | deliveryId: route.query.deliveryID, |
| | | type: 1 |
| | | type: 2 |
| | | |
| | | }) |
| | | console.log(flowData) |
| | |
| | | console.log(flowData) |
| | | request.post("/Delivery/updateDeliveryToExamine", flowData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | ElMessage.success("审核成功") |
| | | ElMessage.success("反审成功") |
| | | router.push({path: '/main/delivery/selectDelivery', query: {id: 1}}) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | |
| | | </template> |
| | | |
| | | <template #state="{ row,column}"> |
| | | <el-checkbox @click.native.prevent :checked="row[column.field]===1"/> |
| | | <el-checkbox @click.native.prevent :indeterminate="row[column.field]===1" :checked="row[column.field]===2"/> |
| | | </template> |
| | | |
| | | |
| | |
| | | switch (code) { |
| | | case 'add': { |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | console.log(selectRecords) |
| | | |
| | | |
| | | if (selectRecords.length === 0) { |
| | | ElMessage.warning("未选中数据") |
| | | return |
| | | } |
| | | let order_id="" |
| | | const array=[]; |
| | | for (let i=0;i<selectRecords.length;i++){ |
| | | array.push(selectRecords[i].customerId) |
| | | if(i+1===selectRecords.length){ |
| | | order_id+=selectRecords[i].orderId |
| | | }else{ |
| | | order_id+=selectRecords[i].orderId+"|" |
| | | } |
| | | } |
| | | //判断所选客户是否相同 |
| | | if(!isAllEqual(array)){ |
| | | ElMessage.warning("请选择相同的客户订单") |
| | | return |
| | | } |
| | | |
| | | router.push({path: '/main/delivery/createDelivery', query: { orderId: order_id }}) |
| | |
| | | } |
| | | } |
| | | |
| | | //数组数据验重 |
| | | function isAllEqual(array){ |
| | | if(array.length>0){ |
| | | return !array.some(function(value,index){ |
| | | return value !== array[0]; |
| | | }); |
| | | }else{ |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | <script setup> |
| | | import request from "@/utils/request" |
| | | import deepClone from "@/utils/deepClone"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {ref} from "vue"; |
| | | import deepClone from "@/utils/deepClone" |
| | | import {ElMessage} from "element-plus" |
| | | import {computed, ref} from "vue" |
| | | import useUserInfo from "@/stores/userInfo" |
| | | let userInfo = useUserInfo() |
| | | const disposeList = $ref([ |
| | | '彩釉', |
| | | '蒙砂', |
| | |
| | | '贴膜', |
| | | '喷砂', |
| | | '磨边' |
| | | ]) |
| | | let processList = $ref([ |
| | | '磨边', |
| | | '镀膜', |
| | | '倒角', |
| | | '清洗', |
| | | '打孔', |
| | | '挖缺', |
| | | '挖槽', |
| | | '水切割', |
| | | '丝印', |
| | | '半钢化', |
| | | '钢化', |
| | | '夹层', |
| | | '中空', |
| | | '包装' |
| | | ]) |
| | | let BasicData = ref({ |
| | | stuffColor:null, |
| | |
| | | lowE:'' |
| | | }) |
| | | let processChecked = ref([]) |
| | | |
| | | let hollowBasic = ref({ |
| | | thickness:"", |
| | | gasType:"", |
| | | Type:"", |
| | | GlueDepth:"" |
| | | }) |
| | | let InterlayerBasic = ref({ |
| | | thickness:"", |
| | | color:"", |
| | | type:"" |
| | | }) |
| | | let productDetailList = ref([]) |
| | | let productTotal = ref({ |
| | | productName:'', |
| | | creator:userInfo.user.userName |
| | | }) |
| | | //页面加载请求 |
| | | request.get(`/basicData/BasicDataByType/product`).then((res) => { |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | | BasicData.value = res.data |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | |
| | | const saveProduct = () => { |
| | | if(productDetailList.value.length===0){ |
| | | ElMessage.warning("请添加产品详情") |
| | | return |
| | | }else if(productDetailList.value[productDetailList.value.length-1].detailType!=='glass'){ |
| | | ElMessage.warning("产品详情最后一条不是玻璃,请完善") |
| | | return |
| | | } |
| | | let productName = "" |
| | | productDetailList.value.forEach(item =>{ |
| | | switch(item.detailType){ |
| | | case 'glass' :{ |
| | | productName+=item.detail |
| | | break |
| | | } |
| | | case 'Interlayer' :{ |
| | | productName+='+'+item.detail |
| | | } |
| | | case 'hollow' :{ |
| | | productName+='*'+item.detail |
| | | } |
| | | } |
| | | }) |
| | | productTotal.value.productName=productName |
| | | let product = { |
| | | title: productTotal.value, |
| | | detail:productDetailList.value |
| | | } |
| | | request.post(`/product/saveProduct`,product).then((res) =>{ |
| | | if(res.code==200){ |
| | | ElMessage.success(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | const reset = () => { |
| | | processChecked.value=[] |
| | |
| | | stuff.value[item]='' |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | const glassSure = () => { |
| | | let childName = '' |
| | | Object.keys(stuff.value).forEach((item,index)=>{ |
| | | childName+=stuff.value[item] |
| | | }) |
| | | let rege = /^\s*$/ |
| | | if(rege.test(childName) || processChecked.value.length===0){ |
| | | ElMessage.warning('请输入产品材料属性与工艺属性') |
| | | return |
| | | } |
| | | let productDetail = { |
| | | detailType:'glass', |
| | | detail:childName, |
| | | process:processChecked.value.join('->'), |
| | | separation:Object.assign({}, stuff.value) |
| | | } |
| | | if(glassFlag.value.flag){ |
| | | if(productDetailList.value.length ===0 ){ |
| | | productDetailList.value.push(productDetail) |
| | | }else{ |
| | | if (productDetailList.value[productDetailList.value.length-1].detailType === 'glass') { |
| | | ElMessage.warning('请先选择间隔物') |
| | | return |
| | | } |
| | | productDetailList.value.push(productDetail) |
| | | } |
| | | }else{ |
| | | productDetailList.value[glassFlag.value.index] = productDetail |
| | | } |
| | | reset() |
| | | |
| | | |
| | | } |
| | | |
| | | //添加中空间隔物 |
| | | const addHollow = () => { |
| | | let childName = '' |
| | | try { |
| | | Object.keys(hollowBasic.value).forEach((item, index) => { |
| | | if (hollowBasic.value[item] === '') { |
| | | throw new Error("请选择全部中空间隔物下拉框") |
| | | } |
| | | childName += hollowBasic.value[item] |
| | | }) |
| | | }catch (e){ |
| | | ElMessage.warning(e.message) |
| | | return |
| | | } |
| | | |
| | | let hollowDetail = { |
| | | detailType:'hollow', |
| | | detail:childName, |
| | | separation:Object.assign({}, hollowBasic.value) |
| | | } |
| | | if(hollowFlag.value.flag){ |
| | | if (productDetailList.value.length ===0) { |
| | | ElMessage.warning('请先选择产品') |
| | | return |
| | | }else if(productDetailList.value[productDetailList.value.length-1].detailType !== 'glass'){ |
| | | ElMessage.warning('请先选择产品') |
| | | return |
| | | } |
| | | productDetailList.value.push(Object.assign({},hollowDetail)) |
| | | }else { |
| | | productDetailList.value[hollowFlag.value.index] = hollowDetail |
| | | } |
| | | Object.keys(hollowBasic.value).forEach((item,index)=>{ |
| | | hollowBasic.value[item]='' |
| | | }) |
| | | |
| | | } |
| | | //添加夹层间隔物 |
| | | const addInterlayer = () => { |
| | | let childName = '' |
| | | try { |
| | | Object.keys(InterlayerBasic.value).forEach((item, index) => { |
| | | if (InterlayerBasic.value[item] === '') { |
| | | throw new Error("请选择全部中空间隔物下拉框") |
| | | } |
| | | childName += InterlayerBasic.value[item] |
| | | }) |
| | | }catch (e){ |
| | | ElMessage.warning(e.message) |
| | | return |
| | | } |
| | | let InterlayerDetail = { |
| | | detailType:'Interlayer', |
| | | detail:childName, |
| | | separation:Object.assign({}, InterlayerBasic.value) |
| | | } |
| | | if(InterlayerFlag.value.flag){ |
| | | if (productDetailList.value.length ===0) { |
| | | ElMessage.warning('请先选择产品') |
| | | return |
| | | }else if(productDetailList.value[productDetailList.value.length-1].detailType !== 'glass'){ |
| | | ElMessage.warning('请先选择产品') |
| | | return |
| | | } |
| | | productDetailList.value.push(Object.assign({},InterlayerDetail)) |
| | | }else{ |
| | | productDetailList.value[InterlayerFlag.value.index] = InterlayerDetail |
| | | } |
| | | Object.keys(InterlayerBasic.value).forEach((item,index)=>{ |
| | | InterlayerBasic.value[item]='' |
| | | }) |
| | | } |
| | | |
| | | |
| | | const deleteProductDetail = (index) => { |
| | | const detailType = productDetailList.value[index].detailType |
| | | switch (detailType) { |
| | | case 'glass':{ |
| | | glassFlag.value = { |
| | | flag:true, |
| | | index:null |
| | | } |
| | | break |
| | | } |
| | | case 'Interlayer':{ |
| | | InterlayerFlag.value = { |
| | | flag:true, |
| | | index:null |
| | | } |
| | | break |
| | | } |
| | | case 'hollow':{ |
| | | hollowFlag.value = { |
| | | flag:true, |
| | | index:null |
| | | } |
| | | } |
| | | } |
| | | productDetailList.value.splice(index,1) |
| | | } |
| | | |
| | | let glassFlag = ref({ |
| | | flag:true, |
| | | index:null |
| | | }) |
| | | const updateGlass = (index) => { |
| | | stuff.value = productDetailList.value[index].separation |
| | | processChecked.value = productDetailList.value[index].process.split("->") |
| | | glassFlag.value.flag=false |
| | | glassFlag.value.index=index |
| | | } |
| | | const updateGlassSure = ()=> { |
| | | glassSure() |
| | | glassFlag.value.flag=true |
| | | glassFlag.value.index=null |
| | | } |
| | | |
| | | |
| | | let InterlayerFlag = ref({ |
| | | flag:true, |
| | | index:null |
| | | }) |
| | | const updateInterlayer = (index) => { |
| | | InterlayerBasic.value = productDetailList.value[index].separation |
| | | InterlayerFlag.value.flag=false |
| | | InterlayerFlag.value.index=index |
| | | } |
| | | |
| | | const updateInterlayerSure = () => { |
| | | addInterlayer() |
| | | InterlayerFlag.value.flag=true |
| | | InterlayerFlag.value.index=null |
| | | } |
| | | |
| | | let hollowFlag = ref({ |
| | | flag:true, |
| | | index:null |
| | | }) |
| | | const updateHollow = (index) => { |
| | | hollowBasic.value = productDetailList.value[index].separation |
| | | hollowFlag.value.flag=false |
| | | hollowFlag.value.index=index |
| | | } |
| | | |
| | | const updateHollowSure = () => { |
| | | addHollow() |
| | | hollowFlag.value.flag=true |
| | | hollowFlag.value.index=null |
| | | } |
| | | const productName = computed(() =>{ |
| | | let productName = "" |
| | | productDetailList.value.forEach(item =>{ |
| | | switch(item.detailType){ |
| | | case 'glass' :{ |
| | | productName+=item.detail |
| | | break |
| | | } |
| | | case 'Interlayer' :{ |
| | | productName+='+'+item.detail |
| | | } |
| | | case 'hollow' :{ |
| | | productName+='*'+item.detail |
| | | } |
| | | } |
| | | }) |
| | | return productName |
| | | }) |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | <div class="glass-spacer"> |
| | | <div class="glass-spacer-jc"> |
| | | <el-select |
| | | v-model="hollowBasic.thickness" |
| | | size="small" |
| | | style="width: 100px" |
| | | clearable placeholder="*中空厚度:" > |
| | |
| | | /> |
| | | </el-select> |
| | | <el-select |
| | | v-model="hollowBasic.gasType" |
| | | size="small" |
| | | style="width: 100px" |
| | | clearable placeholder="*充气方式:" > |
| | |
| | | /> |
| | | </el-select> |
| | | <el-select |
| | | v-model="hollowBasic.Type" |
| | | size="small" |
| | | style="width: 100px" |
| | | clearable placeholder="*封胶:" > |
| | |
| | | /> |
| | | </el-select> |
| | | <el-select |
| | | v-model="hollowBasic.GlueDepth" |
| | | size="small" |
| | | style="width: 100px" |
| | | clearable placeholder="*默认胶深:" > |
| | |
| | | /> |
| | | </el-select> |
| | | <el-button |
| | | v-if="hollowFlag.flag" |
| | | @click="addHollow" |
| | | size="small" |
| | | type="primary" |
| | | round>中空间隔物</el-button> |
| | | |
| | | <el-button |
| | | v-else |
| | | @click="updateHollowSure" |
| | | size="small" |
| | | type="primary" |
| | | round>夹层间隔物修改</el-button> |
| | | </div> |
| | | <div class="glass-spacer-zk"> |
| | | <el-select |
| | | v-model="InterlayerBasic.thickness" |
| | | size="small" |
| | | style="width: 100px" |
| | | clearable placeholder="*夹层厚度:" > |
| | |
| | | /> |
| | | </el-select> |
| | | <el-select |
| | | v-model="InterlayerBasic.type" |
| | | size="small" |
| | | style="width: 100px" |
| | | clearable placeholder="*类型:" > |
| | |
| | | /> |
| | | </el-select> |
| | | <el-select |
| | | v-model="InterlayerBasic.color" |
| | | size="small" |
| | | style="width: 100px" |
| | | clearable placeholder="*颜色:" > |
| | |
| | | /> |
| | | </el-select> |
| | | <el-button |
| | | v-if="InterlayerFlag.flag" |
| | | @click="addInterlayer" |
| | | size="small" |
| | | type="primary" |
| | | style="margin-left: 100px" |
| | | round>夹层间隔物</el-button> |
| | | <el-button |
| | | v-else |
| | | @click="updateInterlayerSure" |
| | | size="small" |
| | | type="primary" |
| | | style="margin-left: 100px" |
| | | round>夹层间隔物修改</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="line"/> |
| | |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <div class="grid-content ep-bg-purple" > |
| | | <el-button |
| | | <el-button v-if="glassFlag.flag" |
| | | @click="glassSure" |
| | | size="small" |
| | | type="primary" |
| | | round>确认</el-button> |
| | | <el-button v-else |
| | | @click="updateGlassSure" |
| | | size="small" |
| | | type="primary" |
| | | round>修改</el-button> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-col> |
| | | <el-col :span="20"> |
| | | <div class="grid-content ep-bg-purple" > |
| | | <el-input size="large" disabled /> |
| | | <el-input :value="productName" size="large" disabled /> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | |
| | | <div class="glass-part-detail"> |
| | | <el-row style="width: 90%" > |
| | | <el-col :span="4"> |
| | | <el-row style="width: 90%" v-for="(item,index) in productDetailList"> |
| | | <el-col :span="4" v-show="item.detailType === 'glass'"> |
| | | <el-button |
| | | @click = "updateGlass(index)" |
| | | size="small" |
| | | type="primary" |
| | | round>修改玻璃</el-button> |
| | | type="primary">修改玻璃</el-button> |
| | | </el-col> |
| | | <el-col :span="4" v-show="item.detailType === 'Interlayer'"> |
| | | <el-button |
| | | @click = "updateInterlayer(index)" |
| | | size="small" |
| | | type="primary">修改夹层</el-button> |
| | | </el-col> |
| | | <el-col :span="4" v-show="item.detailType === 'hollow'"> |
| | | <el-button |
| | | @click = "updateHollow(index)" |
| | | size="small" |
| | | type="primary">修改中空</el-button> |
| | | </el-col> |
| | | <el-col :span="16"> |
| | | <el-input |
| | | :value="item.detail" |
| | | value="5mm白玻" |
| | | size="small" |
| | | disabled /> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="width: 90%" > |
| | | <el-col :span="4"> |
| | | <el-col |
| | | v-show="index+1 === productDetailList.length" |
| | | :span="4"> |
| | | <el-button |
| | | @click="deleteProductDetail(index)" |
| | | size="small" |
| | | type="primary" |
| | | round>修改夹层</el-button> |
| | | </el-col> |
| | | <el-col :span="16"> |
| | | <el-input |
| | | value="5mmPVB透明" |
| | | size="small" |
| | | disabled /> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="width: 90%" > |
| | | <el-col :span="4"> |
| | | <el-button |
| | | size="small" |
| | | type="primary" |
| | | round>修改玻璃</el-button> |
| | | </el-col> |
| | | <el-col :span="16"> |
| | | <el-input |
| | | value="5mm白玻" |
| | | size="small" |
| | | disabled /> |
| | | type="primary">删除</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | </div> |
| | | <el-button |
| | | @click="saveProduct" |
| | | style="float: right; |
| | | margin-right: 0.5rem;" |
| | | |
| | | size="large" |
| | | type="primary" |
| | | round>重置</el-button> |
| | | round>创建</el-button> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | /*发货订单明细查询*/ |
| | | @PostMapping("/getseletShippingOrderDetail/{pageNum}/{pageSize}") |
| | | public Result getseletShippingOrderDetail(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody OrderDetail orderDetail){ |
| | | System.out.println(orderDetail.getDeliveryDetail().getDeliveryId()); |
| | | return Result.seccess(deliveryService.getseletShippingOrderDetail(pageNum,pageSize,orderDetail)); |
| | | } |
| | | |
| | |
| | | /*发货订单明细查询*/ |
| | | @PostMapping("/getseletShippingOrderDetails/{pageNum}/{pageSize}") |
| | | public Result getseletShippingOrderDetails(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody OrderDetail orderDetail){ |
| | | System.out.println(orderDetail); |
| | | return Result.seccess(deliveryService.getseletShippingOrderDetails(pageNum,pageSize,orderDetail)); |
| | | } |
| | | |
| | |
| | | } |
| | | @PostMapping("/updateDeliveryToExamine") |
| | | public Result updateDeliveryToExamine( @RequestBody Map<String,Object> object){ |
| | | System.out.println(object); |
| | | if(deliveryService.updateDeliveryToExamine(object)){ |
| | | return Result.seccess(); |
| | | |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @RequestMapping("/product") |
| | |
| | | public Result defaultDateProduct(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @PathVariable List<String> glassType, @RequestBody Product product){ |
| | | return Result.seccess(productService.defaultDateProduct(pageNum,pageSize,glassType,product)); |
| | | } |
| | | |
| | | @PostMapping("/saveProduct") |
| | | public Result saveProduct(@RequestBody Map<String,Object> product){ |
| | | return Result.seccess(productService.saveProduct(product)); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.Map; |
| | | |
| | | |
| | | @Data |
| | | public class ProductDetail { |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | private String prodId; |
| | | private String sortNum; |
| | | private String glassSort; |
| | | private Long prodId; |
| | | private Integer sortNum; |
| | | private Integer glassSort; |
| | | private String detailType; |
| | | private String detail; |
| | | private Integer glassGroup; |
| | |
| | | |
| | | Integer findOrderNumberdsum(String orderId); |
| | | |
| | | Integer findDeliveryQuantity(String deliveryId); |
| | | |
| | | Integer findDeliverydetailsum(String deliveryId,Integer deliveryDetailState); |
| | | |
| | | Boolean updateInventory(@Param("flowCard") FlowCard flowCard, |
| | | @Param("storageRegion") String storageRegion, |
| | | @Param("remark") String remark); |
| | |
| | | |
| | | Boolean updateOrderDeliveryState(String orderId,Integer state); |
| | | |
| | | Boolean updateDeliveryDeliveryState(String deliveryId,Integer state); |
| | | |
| | | Boolean updateDeliveryDetailState(OrderDetail orderDetail,Integer state); |
| | | |
| | | Boolean insertFinishedGoodsInventory(@Param("flowCard") FlowCard flowCard, |
| | |
| | | public interface ProductDetailMapper { |
| | | List<ProductDetail> getGlassDetailList(); |
| | | |
| | | boolean insertList(List<ProductDetail> getProductDetails); |
| | | } |
| | |
| | | package com.example.erp.mapper.sd; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.erp.entity.sd.Product; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface ProductMapper { |
| | | public interface ProductMapper extends BaseMapper<Product> { |
| | | List<Product> defaultProduct(@Param("offset") Integer offset, |
| | | @Param("pageSize") Integer pageSiz, |
| | | @Param("glassTypeId") String glassTypeId, |
| | |
| | | String oddNumber= orderNumberSetting("入库"); |
| | | //添加出入库记录 |
| | | finishedOperateLogMapper.insertIntFinishedOperateLog(flowCard,userName,oddNumber); |
| | | System.out.println(flowCard.getOrder().getOrderId()); |
| | | Integer finishedGoodsInventorycount = finishedGoodsInventoryMapper.findOrderNumberdcount(flowCard.getOrder().getOrderId(),flowCard.getOrderNumber()); |
| | | Integer ordersum = finishedGoodsInventoryMapper.findOrderQuantity(flowCard.getOrder().getOrderId()); |
| | | Integer ordernumbersum = finishedGoodsInventoryMapper.findOrderNumberdsum(flowCard.getOrder().getOrderId()); |
| | |
| | | //添加出入库记录 |
| | | finishedOperateLogMapper.insertOutFinishedOperateLog(orderDetail,userName,oddNumber); |
| | | Integer finishedGoodsInventorycount = finishedGoodsInventoryMapper.findOrderNumberdcount(orderDetail.getDeliveryDetail().getOrderId(),orderDetail.getDeliveryDetail().getOrderNumber()); |
| | | System.out.println("数据3:"+finishedGoodsInventorycount); |
| | | |
| | | Integer finishedGoodsInventorybycount=finishedGoodsInventoryMapper.finishedGoodsInventorybycount(orderDetail.getDeliveryDetail().getOrderId(),orderDetail.getDeliveryDetail().getOrderNumber()); |
| | | Integer ordersum = finishedGoodsInventoryMapper.findOrderQuantity(orderDetail.getDeliveryDetail().getOrderId()); |
| | | Integer ordernumbersum = finishedGoodsInventoryMapper.findOrderNumberdsum(orderDetail.getDeliveryDetail().getOrderId()); |
| | | |
| | | System.out.println("订单总数:" + ordersum + "订单剩余数量:" + ordernumbersum + "准备出库数量" + orderDetail.getWarehouseNum()+ "库存数量" + finishedGoodsInventorybycount); |
| | | Integer deliverysum = finishedGoodsInventoryMapper.findDeliveryQuantity(orderDetail.getDeliveryDetail().getDeliveryId()); |
| | | Integer deliverydetailsum = finishedGoodsInventoryMapper.findDeliverydetailsum(orderDetail.getDeliveryDetail().getDeliveryId(),0); |
| | | if(deliverydetailsum==null){ |
| | | deliverydetailsum=0; |
| | | } |
| | | |
| | | System.out.println("订单总数:" + ordersum + "订单剩余数量:" + ordernumbersum + "准备出库数量" + |
| | | orderDetail.getWarehouseNum()+ "发货数量" + orderDetail.getDeliveryNum()+ "发货总数" + |
| | | deliverysum+ "已发数量" + deliverydetailsum); |
| | | if (finishedGoodsInventorycount > 0) { |
| | | if(Objects.equals(finishedGoodsInventorybycount, orderDetail.getWarehouseNum())){ |
| | | System.out.println(123); |
| | | if(orderDetail.getWarehouseNum()>=orderDetail.getDeliveryNum()){ |
| | | //修改库存表出库数量 |
| | | //finishedGoodsInventoryMapper.updateInventoryquantityavailable(orderDetail); |
| | | //修改发货明细表状态 |
| | | finishedGoodsInventoryMapper.updateDeliveryDetailState(orderDetail,0); |
| | | //修改发货表状态 |
| | | finishedGoodsInventoryMapper.updateDeliveryDeliveryState(orderDetail.getDeliveryDetail().getDeliveryId(),1); |
| | | //修改订单明细表发货数量 |
| | | finishedGoodsInventoryMapper.updateOutOrderNumberConut(orderDetail.getDeliveryDetail().getOrderId(),orderDetail.getDeliveryDetail().getOrderNumber(),orderDetail.getWarehouseNum()); |
| | | finishedGoodsInventoryMapper.updateOutOrderNumberConut(orderDetail.getDeliveryDetail().getOrderId(),orderDetail.getDeliveryDetail().getOrderNumber(),orderDetail.getDeliveryNum()); |
| | | //修改订单表发货状态 |
| | | finishedGoodsInventoryMapper.updateOrderDeliveryState(orderDetail.getDeliveryDetail().getOrderId(),1); |
| | | //判断订单是否全部发货 |
| | |
| | | //修改订单表发货状态 |
| | | finishedGoodsInventoryMapper.updateOrderDeliveryState(orderDetail.getDeliveryDetail().getOrderId(),2); |
| | | } |
| | | if (deliverysum==deliverydetailsum+orderDetail.getDeliveryNum()) { |
| | | //修改发货表状态 |
| | | finishedGoodsInventoryMapper.updateDeliveryDeliveryState(orderDetail.getDeliveryDetail().getDeliveryId(),2); |
| | | } |
| | | isinsert=true; |
| | | } |
| | | |
| | |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | System.out.println(orderDetail.getDeliveryDetail().getMoney()); |
| | | map.put("data", deliveryDetailMapper.getseletShippingOrderDetail(offset, pageSize, orderDetail)); |
| | | map.put("delivery", deliveryMapper.getseletShippingOrderDetaildelivery(offset, pageSize, orderDetail)); |
| | | map.put("total", deliveryDetailMapper.getseletShippingOrderDetailPageTotal(offset, pageSize, orderDetail)); |
| | |
| | | List<OrderDetail> orderDetaillist = JSONArray.parseArray(JSONObject.toJSONString(object.get("delivery")), OrderDetail.class); |
| | | //获取单号 |
| | | String oddNumber= orderNumberSetting("发货"); |
| | | System.out.println(delivery); |
| | | deliveryMapper.insertDelivery(delivery,oddNumber,orderDetaillist.get(0).getOrderId()); |
| | | Double area=0.0; |
| | | Integer quantity=0; |
| | |
| | | area+=orderDetail.getFinishedGoodsInventory().getActualSignalArea()*orderDetail.getDeliveryDetail().getQuantity(); |
| | | money+=orderDetail.getPrice()*orderDetail.getDeliveryDetail().getQuantity(); |
| | | Integer deliveryDetailmaximum=deliveryDetailMapper.getdeliveryDetailmaximum(oddNumber); |
| | | System.out.println(deliveryDetailmaximum); |
| | | deliveryDetailMapper.insertDeliveryDetail(orderDetail,oddNumber,deliveryDetailmaximum); |
| | | deliveryDetailMapper.insertDeliveryDetail(orderDetail,oddNumber,deliveryDetailmaximum+1); |
| | | deliveryDetailMapper.updateOrderDetailDeliveryNum(orderDetail); |
| | | //修改库存表出库数量 |
| | | finishedGoodsInventoryMapper.updateInventoryquantityOut(orderDetail.getOrderId(),orderDetail.getOrderNumber(),orderDetail.getDeliveryDetail().getQuantity()); |
| | | isinsert=true; |
| | | } |
| | | System.out.println("面积"+area+"数量"+quantity+"金额"+money); |
| | | deliveryMapper.updatedelivery(area,quantity,money,oddNumber); |
| | | |
| | | deliveryMapper.updatedelivery(Double.valueOf(String.format("%.2f", area)),quantity,Double.valueOf(String.format("%.2f", money)),oddNumber); |
| | | return isinsert; |
| | | }else{ |
| | | return false; |
| | |
| | | type = Integer.parseInt(object.get("type").toString()); |
| | | } |
| | | |
| | | System.out.println(deliveryId); |
| | | deliveryMapper.updateDeliveryToExamine(deliveryId,type); |
| | | |
| | | return true; |
| | |
| | | package com.example.erp.service.sd; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.example.erp.entity.sd.Product; |
| | | import com.example.erp.entity.sd.ProductDetail; |
| | | import com.example.erp.mapper.sd.ProductDetailMapper; |
| | | import com.example.erp.mapper.sd.ProductMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | @DS("sd") |
| | | @Transactional |
| | | public class ProductService { |
| | | @Autowired |
| | | private final |
| | | ProductMapper productMapper; |
| | | private final |
| | | ProductDetailMapper productDetailMapper; |
| | | |
| | | public ProductService(ProductMapper productMapper, ProductDetailMapper productDetailMapper) { |
| | | this.productMapper = productMapper; |
| | | this.productDetailMapper = productDetailMapper; |
| | | } |
| | | //产品查询方法 |
| | | public Map<String,Object> defaultDateProduct(Integer pageNum, Integer pageSize, List<String> glassType, Product product) { |
| | | Integer offset = (pageNum-1)*pageSize; |
| | | String glassTypeId = null; |
| | |
| | | return map; |
| | | } |
| | | |
| | | //产品保存方法 |
| | | public boolean saveProduct(Map<String,Object> productObject) { |
| | | //把传入主附表的object类型转换成实体类类型 |
| | | JSONObject productJson = new JSONObject(productObject); |
| | | Product product = JSONObject.parseObject(JSONObject.toJSONString(productJson.get("title")), Product.class); |
| | | List<ProductDetail> productDetails = JSONArray.parseArray(JSONObject.toJSONString(productJson.get("detail")), ProductDetail.class); |
| | | |
| | | //完善主附表信息并返回 |
| | | Map<String,Object> getProductJson = updateProduct(productDetails,product); |
| | | Product getProduct = JSONObject.parseObject(JSONObject.toJSONString(getProductJson.get("title")), Product.class); |
| | | List<ProductDetail> getProductDetails = JSONArray.parseArray(JSONObject.toJSONString(getProductJson.get("detail")), ProductDetail.class); |
| | | |
| | | //插入主表数据 |
| | | productMapper.insert(getProduct); |
| | | //给副表添加产品id |
| | | for (ProductDetail getProductDetail : getProductDetails) { |
| | | getProductDetail.setProdId(getProduct.getId()); |
| | | } |
| | | //插入副表 |
| | | productDetailMapper.insertList(getProductDetails); |
| | | |
| | | return false; |
| | | |
| | | } |
| | | |
| | | private Map<String,Object> updateProduct(List<ProductDetail> productDetailList,Product product) { |
| | | Map<String,Object> map = new HashMap<>(); |
| | | //定义产品玻璃厚度累加 |
| | | double thickness1 = 0; |
| | | //定义产品总厚度累加 |
| | | double totalThickness = 0; |
| | | //定义快速查询 |
| | | StringBuilder query = new StringBuilder(); |
| | | |
| | | //定义副表玻璃与间隔物排序 |
| | | int sortNum = 0; |
| | | //定义副表玻璃排序 |
| | | int glassSort = 0; |
| | | //定义副表中空分组 |
| | | int glassGroup = 1; |
| | | |
| | | for (ProductDetail productDetail : productDetailList) { |
| | | sortNum+=1; |
| | | productDetail.setSortNum(sortNum); |
| | | |
| | | JSONObject separation = JSONObject.parseObject( productDetail.getSeparation()); |
| | | String getThickness = (String) separation.get("thickness"); |
| | | double thicknessDetail = Double.parseDouble(getThickness.replace("mm","")); |
| | | totalThickness += thicknessDetail; |
| | | |
| | | if(Objects.equals(productDetail.getDetailType(), "glass")){ |
| | | glassSort+=1; |
| | | productDetail.setGlassSort(glassSort); |
| | | productDetail.setGlassGroup(glassGroup); |
| | | thickness1 += thicknessDetail; |
| | | DecimalFormat decimalFormat = new DecimalFormat("###"); |
| | | query.append(decimalFormat.format(thicknessDetail)); |
| | | } |
| | | else if (Objects.equals(productDetail.getDetailType(), "Interlayer")) { |
| | | query.append("+"); |
| | | }else if(Objects.equals(productDetail.getDetailType(), "hollow")){ |
| | | glassGroup+=1; |
| | | query.append("*"); |
| | | } |
| | | } |
| | | product.setThickness(thickness1); |
| | | product.setTotalThickness(totalThickness); |
| | | product.setQuery(String.valueOf(query)); |
| | | map.put("title",product); |
| | | map.put("detail",productDetailList); |
| | | return map; |
| | | } |
| | | } |
| | |
| | | <result column="product_name" property="productName"/> |
| | | <result column="product_id" property="productId"/> |
| | | <result column="warehouse_num" property="warehouseNum"/> |
| | | <result column="delivery_num" property="deliveryNum"/> |
| | | |
| | | <result column="order_number" property="deliveryDetail.orderNumber"/> |
| | | <result column="delivery_id" property="deliveryDetail.deliveryId"/> |
| | |
| | | <update id="updateDeliveryDetailState"> |
| | | update sd.delivery_detail |
| | | set delivery_detail_state=#{state} |
| | | where order_number=#{orderDetail.deliveryDetail.orderNumber} and order_id=#{orderDetail.deliveryDetail.orderId} |
| | | where order_number=#{orderDetail.deliveryDetail.orderNumber} and order_id=#{orderDetail.deliveryDetail.orderId} and delivery_id=#{orderDetail.deliveryDetail.deliveryId} |
| | | </update> |
| | | |
| | | <update id="updateInventoryquantityavailable"> |
| | |
| | | od.height, |
| | | d.quantity, |
| | | od.warehouse_num, |
| | | od.delivery_num, |
| | | d.area, |
| | | od.building_number, |
| | | d.creator, |
| | |
| | | select sum(warehouse_num) from sd.order_detail where order_id=#{orderId} |
| | | </select> |
| | | |
| | | <select id="findDeliveryQuantity" > |
| | | select quantity from sd.`delivery` where delivery_id=#{deliveryId} |
| | | </select> |
| | | |
| | | <select id="findDeliverydetailsum" > |
| | | select sum(quantity) from sd.`delivery_detail` where delivery_id=#{deliveryId} and delivery_detail_state=#{deliveryDetailState} |
| | | </select> |
| | | |
| | | <update id="updateOrderWarehousingState"> |
| | | update sd.`order` |
| | | set warehousing=#{state} |
| | |
| | | where order_id=#{orderId} |
| | | </update> |
| | | |
| | | <update id="updateDeliveryDeliveryState"> |
| | | update sd.`delivery` |
| | | set stock_state=#{state} |
| | | where delivery_id=#{deliveryId} |
| | | </update> |
| | | |
| | | <update id="updateIntOrderNumberConut"> |
| | | update sd.order_detail |
| | | set warehouse_num=warehouse_num+${quantity} |
| | |
| | | operate_time |
| | | ) |
| | | values ( |
| | | #{orderDetail.deliveryDetail.deliveryId} ,#{orderDetail.deliveryDetail.order_id},#{orderDetail.deliveryDetail.orderNumber} |
| | | #{orderDetail.deliveryDetail.deliveryId} ,#{orderDetail.deliveryDetail.orderId},#{orderDetail.deliveryDetail.orderNumber} |
| | | ,"出库",#{userName},#{orderDetail.warehouseNum},now() |
| | | ) |
| | | </insert> |
| | |
| | | <if test="delivery.area != null and delivery.area != ''"> |
| | | and d.area regexp REGEXP_REPLACE(#{delivery.area},'\\.0+$','') |
| | | </if> |
| | | </where> |
| | | |
| | | </where> |
| | | order by d.id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | |
| | | <select id="getGlassDetailList"> |
| | | select * from product_detail where prod_id = #{productId} and detail_type = 'glass' |
| | | </select> |
| | | |
| | | <insert id="insertList"> |
| | | insert into product_detail ( |
| | | prod_id, sort_num, glass_sort, detail_type, detail, glass_group, process,separation |
| | | ) |
| | | values |
| | | <foreach collection ="getProductDetails" item="ProductDetail" separator =","> |
| | | ( |
| | | #{ProductDetail.prodId}, |
| | | #{ProductDetail.sortNum}, |
| | | #{ProductDetail.glassSort}, |
| | | #{ProductDetail.detailType}, |
| | | #{ProductDetail.detail}, |
| | | #{ProductDetail.glassGroup}, |
| | | #{ProductDetail.process}, |
| | | #{ProductDetail.separation} |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | | </mapper> |
| | |
| | | <result column="product_name" property="productName"/> |
| | | <result column="product_id" property="productId"/> |
| | | <result column="warehouse_num" property="warehouseNum"/> |
| | | <result column="delivery_num" property="deliveryNum"/> |
| | | |
| | | <result column="order_number" property="deliveryDetail.orderNumber"/> |
| | | <result column="delivery_id" property="deliveryDetail.deliveryId"/> |
| | |
| | | <update id="updateDeliveryDetailState"> |
| | | update sd.delivery_detail |
| | | set delivery_detail_state=#{state} |
| | | where order_number=#{orderDetail.deliveryDetail.orderNumber} and order_id=#{orderDetail.deliveryDetail.orderId} |
| | | where order_number=#{orderDetail.deliveryDetail.orderNumber} and order_id=#{orderDetail.deliveryDetail.orderId} and delivery_id=#{orderDetail.deliveryDetail.deliveryId} |
| | | </update> |
| | | |
| | | <update id="updateInventoryquantityavailable"> |
| | |
| | | od.height, |
| | | d.quantity, |
| | | od.warehouse_num, |
| | | od.delivery_num, |
| | | d.area, |
| | | od.building_number, |
| | | d.creator, |
| | |
| | | select sum(warehouse_num) from sd.order_detail where order_id=#{orderId} |
| | | </select> |
| | | |
| | | <select id="findDeliveryQuantity" > |
| | | select quantity from sd.`delivery` where delivery_id=#{deliveryId} |
| | | </select> |
| | | |
| | | <select id="findDeliverydetailsum" > |
| | | select sum(quantity) from sd.`delivery_detail` where delivery_id=#{deliveryId} and delivery_detail_state=#{deliveryDetailState} |
| | | </select> |
| | | |
| | | <update id="updateOrderWarehousingState"> |
| | | update sd.`order` |
| | | set warehousing=#{state} |
| | |
| | | where order_id=#{orderId} |
| | | </update> |
| | | |
| | | <update id="updateDeliveryDeliveryState"> |
| | | update sd.`delivery` |
| | | set stock_state=#{state} |
| | | where delivery_id=#{deliveryId} |
| | | </update> |
| | | |
| | | <update id="updateIntOrderNumberConut"> |
| | | update sd.order_detail |
| | | set warehouse_num=warehouse_num+${quantity} |
| | |
| | | operate_time |
| | | ) |
| | | values ( |
| | | #{orderDetail.deliveryDetail.deliveryId} ,#{orderDetail.deliveryDetail.order_id},#{orderDetail.deliveryDetail.orderNumber} |
| | | #{orderDetail.deliveryDetail.deliveryId} ,#{orderDetail.deliveryDetail.orderId},#{orderDetail.deliveryDetail.orderNumber} |
| | | ,"出库",#{userName},#{orderDetail.warehouseNum},now() |
| | | ) |
| | | </insert> |
| | |
| | | <if test="delivery.area != null and delivery.area != ''"> |
| | | and d.area regexp REGEXP_REPLACE(#{delivery.area},'\\.0+$','') |
| | | </if> |
| | | </where> |
| | | |
| | | </where> |
| | | order by d.id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | |
| | | <select id="getGlassDetailList"> |
| | | select * from product_detail where prod_id = #{productId} and detail_type = 'glass' |
| | | </select> |
| | | |
| | | <insert id="insertList"> |
| | | insert into product_detail ( |
| | | prod_id, sort_num, glass_sort, detail_type, detail, glass_group, process,separation |
| | | ) |
| | | values |
| | | <foreach collection ="getProductDetails" item="ProductDetail" separator =","> |
| | | ( |
| | | #{ProductDetail.prodId}, |
| | | #{ProductDetail.sortNum}, |
| | | #{ProductDetail.glassSort}, |
| | | #{ProductDetail.detailType}, |
| | | #{ProductDetail.detail}, |
| | | #{ProductDetail.glassGroup}, |
| | | #{ProductDetail.process}, |
| | | #{ProductDetail.separation} |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | | </mapper> |