Merge branch 'master' of https://gitee.com/a1536384743/erp_-override
| New file |
| | |
| | | <script setup> |
| | | import {onMounted, reactive, ref, watch} from "vue" |
| | | import {filterChanged} from "@/hook" |
| | | import {useI18n} from "vue-i18n" |
| | | import {ElMessage} from "element-plus"; |
| | | const { t } = useI18n() |
| | | let rowClickIndex = ref(null) |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | id: 'OrderList', |
| | | showFooter: true,//显示脚 |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | |
| | | columnConfig: { |
| | | // resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | //remote: true //远端筛选 |
| | | }, |
| | | // customConfig: { |
| | | // storage: true |
| | | // }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'cell', |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | // {field: 'buildingNumber',width:120, title: '楼号',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter'}, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'alias', title:'其他加工',editRender: { name: 'input'},minWith:'130'}, |
| | | {field: 'price', title:'单价',editRender: { name: 'input'}}, |
| | | {field: 'quantity', title:'数量',editRender: { name: 'input'} }, |
| | | {field: 'money', slots:{default:'default'}, title:'金额'} |
| | | ], |
| | | //表单验证 |
| | | editRules: { |
| | | price: [ |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^(0(\.\d{1,2})?|([1-9]\d{0,4})(\.\d{1,2})?|99999(\.9{1,2})?)$/ |
| | | if (cellValue && !regex.test(cellValue) ) { |
| | | return new Error(t('basicData.msg.range99999Dec2') ) |
| | | } |
| | | } |
| | | } |
| | | ], |
| | | quantity: [ |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^[1-9]\d*$|^0$/ |
| | | if (cellValue && !regex.test(cellValue) ) { |
| | | return new Error('请输入大于等于0的整数') |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | |
| | | }, |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | {'code': 'add', 'name': '新增',status: 'primary'}, |
| | | {'code': 'delete', 'name': '删除',status: 'primary'} |
| | | ], |
| | | |
| | | |
| | | // import: false, |
| | | // export: true, |
| | | // print: true, |
| | | // zoom: true, |
| | | // custom: true |
| | | } |
| | | , |
| | | //table body实际数据 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return t('basicData.total')+':' |
| | | } |
| | | const footList = ['quantity'] |
| | | if (footList.includes(column.field)) { |
| | | return sumNum(data, column.field) |
| | | } |
| | | if(column.field==='money'){ |
| | | let count = 0 |
| | | data.forEach(item => { |
| | | count+=countAmount(item) |
| | | }) |
| | | return parseFloat(count.toFixed(2)) |
| | | } |
| | | return '' |
| | | }) |
| | | ] |
| | | } |
| | | |
| | | }) |
| | | const gridEvents = { |
| | | async toolbarButtonClick({code}) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'add': { |
| | | if ($grid.getTableData().tableData.length >=240){ |
| | | ElMessage.error(t('order.msg.tableLengthMax')) |
| | | return |
| | | } |
| | | $grid.insert({}) |
| | | break |
| | | } |
| | | case 'delete': { |
| | | if(rowClickIndex.value === null){ |
| | | ElMessage.warning('请先单击选择行') |
| | | return |
| | | } |
| | | $grid.remove(rowClickIndex.value) |
| | | rowClickIndex.value = null |
| | | break |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | cellClick({ row }){ |
| | | rowClickIndex.value = row |
| | | } |
| | | } |
| | | |
| | | const sumNum = (list, field) => { |
| | | let count = 0 |
| | | list.forEach(item => { |
| | | count += Number(item[field]) |
| | | }) |
| | | return count.toFixed(2)==='NaN' ? null : parseFloat(count.toFixed(2)) |
| | | } |
| | | |
| | | let prop = defineProps({ |
| | | otherMoney:{} |
| | | }) |
| | | onMounted(()=>{ |
| | | xGrid.value.reloadData(prop.otherMoney) |
| | | }) |
| | | watch(prop,(newVal)=>{ |
| | | xGrid.value.reloadData(prop.otherMoney) |
| | | }) |
| | | |
| | | const countAmount = (row)=>{ |
| | | return parseFloat((row.price * row.quantity).toFixed(2)) |
| | | } |
| | | |
| | | const validate = async () => { |
| | | const errMap = await xGrid.value.validate(true) |
| | | if (errMap) { |
| | | ElMessage.error(`校验不通过!`) |
| | | return false |
| | | } |
| | | return true |
| | | } |
| | | defineExpose({ |
| | | validate |
| | | }) |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div style="height: 100%;width: 100%"> |
| | | <vxe-grid |
| | | @filter-change="filterChanged" |
| | | ref="xGrid" |
| | | max-height="350px" |
| | | :width="'100%'" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | > |
| | | <template #default="{ row }"> |
| | | <span>{{ countAmount(row) }} </span> |
| | | </template> |
| | | </vxe-grid> |
| | | </div> |
| | | |
| | | |
| | | </template> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | |
| | | width:'宽', |
| | | height:'高', |
| | | area:'面积', |
| | | trueArea:'实际单片金额', |
| | | trueArea:'实际单片面积', |
| | | trueGrossArea:'实际总面积', |
| | | computeArea:'结算单片面积', |
| | | computeGrossArea:'计算总面积', |
| | |
| | | <img id="img-pic" src="@/assets/img.png" alt=""> |
| | | </div> |
| | | <div id="div-login"> |
| | | <el-select |
| | | @change="changeLanguage" |
| | | v-model="language" |
| | | placeholder=" " |
| | | style="float: right;width: 6rem"> |
| | | <el-option value="zh" label="中文" /> |
| | | <el-option value="en" label="English" /> |
| | | </el-select> |
| | | <!-- <el-select--> |
| | | <!-- @change="changeLanguage"--> |
| | | <!-- v-model="language"--> |
| | | <!-- placeholder=" "--> |
| | | <!-- style="float: right;width: 6rem">--> |
| | | <!-- <el-option value="zh" label="中文" />--> |
| | | <!-- <el-option value="en" label="English" />--> |
| | | <!-- </el-select>--> |
| | | <h2>{{$t('login.SysName')}}</h2> |
| | | <el-form |
| | | @submit.native.prevent |
| | |
| | | <script setup> |
| | | |
| | | |
| | | import request from "@/utils/request" |
| | | import {ElDatePicker, ElMessage} from "element-plus" |
| | | import {nextTick, onMounted, onUnmounted, reactive, ref, watch} from "vue" |
| | | import {Search} from "@element-plus/icons-vue" |
| | | import {useRouter} from 'vue-router' |
| | | import {useRoute, useRouter} from "vue-router" |
| | | import {changeFilterEvent, filterChanged} from "@/hook" |
| | | |
| | | import { useI18n } from 'vue-i18n' |
| | |
| | | //语言获取 |
| | | const { t } = useI18n() |
| | | let router=useRouter() |
| | | const route = useRoute() |
| | | let produceList = ref([]) |
| | | let delivery = ref([]) |
| | | let money = ref("") |
| | | let takeCare = "注意:请妥善保管好我司的玻璃架,如有丢失或损坏,按1500元只赔偿。谢谢配合!" |
| | | let remark = "备注:本批玻璃为优等合格品,请在卸货时,当面消点验收、如有质量问题在一周内与本公司联系,否则概不负责!" |
| | | |
| | | let props = defineProps({ |
| | | deliveryId:null |
| | |
| | | const form = ref({ |
| | | }) |
| | | |
| | | |
| | | |
| | | |
| | | const Printing = ()=>{ |
| | | |
| | | // 需要打印的局部区域赋予"print-wrap"的id |
| | | let el = document.getElementById("pis"); |
| | | let doc = document; |
| | | let body = doc.body || doc.getElementsByTagName("body")[0]; |
| | | let printId = "print-" + Date.now(); |
| | | |
| | | // 创建无副作用的打印容器(因不确定页面的打印元素有无其它样式) |
| | | let content = doc.createElement("div"); |
| | | content.id = printId; |
| | | |
| | | // 样式控制与打印无关的元素隐藏 |
| | | let style = doc.createElement("style"); |
| | | style.innerHTML = |
| | | "body>#" + |
| | | printId + |
| | | "{display:none}@media print{body>:not(#" + |
| | | printId + |
| | | "){display:none !important}body>#" + |
| | | printId + |
| | | "{display:block;padding-top:1px}}"; |
| | | |
| | | content.innerHTML = el.outerHTML; |
| | | // console.log("el.outerHTML", el.outerHTML); |
| | | body.appendChild(style); |
| | | |
| | | // 与style元素设置的样式相配合 |
| | | // 把打印内容的元素添加到body(作为body的子元素,可用body的子选择器 '>' 控制打印样式) |
| | | body.appendChild(content); |
| | | setTimeout(() => { |
| | | window.print(); |
| | | body.removeChild(content); |
| | | body.removeChild(style); |
| | | }, 20); |
| | | } |
| | | |
| | | |
| | | onMounted(()=>{ |
| | | console.log(props.deliveryId) |
| | | if(props.deliveryId===null || props.deliveryId===undefined || props.deliveryId===''){ |
| | | /*if(props.deliveryId===null || props.deliveryId===undefined || props.deliveryId===''){ |
| | | return |
| | | } |
| | | form.value.deliveryId = props.deliveryId |
| | | form.value.deliveryId = props.deliveryId*/ |
| | | if(route.query.deliveryID===null || route.query.deliveryID===undefined || route.query.deliveryID===''){ |
| | | return |
| | | } |
| | | form.value.deliveryId=route.query.deliveryID |
| | | |
| | | |
| | | request.post(`/Delivery/getSelectDeliveryPrinting`,form.value).then((res) => { |
| | | if(res.code==200){ |
| | | produceList = deepClone(res.data.data) |
| | | delivery=deepClone(res.data.delivery) |
| | | console.log(produceList) |
| | | console.log(delivery) |
| | | produceList.value = deepClone(res.data.data) |
| | | delivery.value=deepClone(res.data.delivery) |
| | | money.value=deepClone(res.data.money) |
| | | |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | |
| | | |
| | | }) |
| | | |
| | | setTimeout(function(){ |
| | | Printing() |
| | | }, 1000); |
| | | |
| | | |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div style="width: 100%;height: 100%"> |
| | | <div style="font-size: 30px;text-align: center">常州市吉利玻璃有限公司</div> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="6"><div></div></el-col> |
| | | <el-col :span="12"><div style="font-size: 25px;text-align: center">销售发货单</div></el-col> |
| | | <el-col :span="6"> |
| | | <div style="font-size: 20px;text-align: center;display: flex"> |
| | | <div>发货单号:</div> |
| | | <div>{{delivery.deliveryId}}</div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <div style="border: 1px solid #d3dce6;border-collapse: collapse;width: 100%"> |
| | | <table id="day-in" style="border: 1px solid #d3dce6;border-collapse: collapse;width: 100%"> |
| | | <tr> |
| | | <th>序号</th> |
| | | <th>楼层编号</th> |
| | | <th>宽(弧度)*高</th> |
| | | <th>数量</th> |
| | | <th>面积</th> |
| | | <th>单价</th> |
| | | <th>金额</th> |
| | | <th>加工要求</th> |
| | | </tr> |
| | | |
| | | <template v-for="(item, index) in produceList" :key="index" > |
| | | <tr> |
| | | <td colspan="3">产品名称:{{item.DeliveryDetail.orderDetail.productName}}</td> |
| | | <td colspan="3">对方单号:</td> |
| | | <td colspan="2">订单编号:{{item.DeliveryDetail.orderDetail.orderId}}</td> |
| | | </tr> |
| | | <div> |
| | | <el-button @click="Printing" style="margin-top: -5px" id="searchButton" type="primary" >打印</el-button> |
| | | |
| | | <tr v-for="(items, index1) in item.DeliveryDetailList" :key="index1"> |
| | | <td>{{items.order_number}}</td> |
| | | <td>{{items.buildingNumber}}</td> |
| | | <td>{{items.width}}x{{items.height}}</td> |
| | | <td>{{items.quantity}}</td> |
| | | <td>{{items.area}}</td> |
| | | <td>{{items.price}}</td> |
| | | <td>{{items.money}}</td> |
| | | <td>{{items.processingNote}}</td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="3">小计:</td> |
| | | <td>{{item.DeliveryDetail.quantity}}</td> |
| | | <td>{{item.DeliveryDetail.area}}</td> |
| | | <td></td> |
| | | <td>{{item.DeliveryDetail.money}}</td> |
| | | <td></td> |
| | | </tr> |
| | | <div id="pis" style="width: 100%;height: 100%"> |
| | | <div style="font-size: 30px;text-align: center;font-weight: bold;">常州市吉利玻璃有限公司</div> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="7"><div></div></el-col> |
| | | <el-col :span="10"><div style="font-size: 25px;text-align: center;font-weight: bold;">销售发货单</div></el-col> |
| | | <el-col :span="7"> |
| | | <div style="display: flex;margin-top: 10px;"> |
| | | <div style="font-weight: bold;font-size: 15px">发货单号:</div> |
| | | <div style="font-weight: bold;font-size: 15px">{{delivery.deliveryId}}</div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <div style="border: 1px solid #d3dce6;border-collapse: collapse;width: 100%;height: 100%;"> |
| | | <table id="table1" style="border: 1px solid #d3dce6;border-collapse: collapse;width: 100%;height: 100%;"> |
| | | <tr> |
| | | <th style="text-align: left;border:none;" colspan="3">客户名称:<span>{{delivery.customerName}}</span></th> |
| | | <th style="text-align: left;border:none;" colspan="3">项目名称:<span>{{delivery.project}}</span></th> |
| | | <th style="text-align: left;border:none;" colspan="2">联系人:<span>{{delivery.contacts}}</span></th> |
| | | |
| | | </template> |
| | | <tr> |
| | | <td colspan="3">合计:</td> |
| | | <td>{{delivery.quantity}}</td> |
| | | <td>{{delivery.area}}</td> |
| | | <td></td> |
| | | <td>{{delivery.money}}</td> |
| | | <td></td> |
| | | </tr> |
| | | </table> |
| | | </tr> |
| | | <tr> |
| | | <th style="text-align: left;border:none;" colspan="6">送货地址:<span>{{delivery.deliveryAddress}}</span></th> |
| | | <th style="text-align: left;border:none;" colspan="2">联系电话:<span>{{delivery.contactNumber}}</span></th> |
| | | |
| | | </tr> |
| | | <tr> |
| | | <th style="width: 6%;">序号</th> |
| | | <th style="width: 20%;">楼层编号</th> |
| | | <th style="width: 20%;">宽(弧度)*高</th> |
| | | <th style="width: 10%;">数量</th> |
| | | <th style="width: 10%;">面积</th> |
| | | <th style="width: 10%;">单价</th> |
| | | <th style="width: 12%;">金额</th> |
| | | <th style="width: 12%;">加工要求</th> |
| | | </tr> |
| | | |
| | | <template v-for="(item, index) in produceList" :key="index" > |
| | | <tr> |
| | | <td style="font-size: 15px;font-weight: bold;" colspan="3">产品名称:<span>{{item.DeliveryDetail.orderDetail.productName}}</span></td> |
| | | <td style="font-size: 15px;font-weight: bold;" colspan="3">对方单号:</td> |
| | | <td style="font-size: 15px;font-weight: bold;" colspan="2">订单编号:<span>{{item.DeliveryDetail.orderDetail.orderId}}</span></td> |
| | | </tr> |
| | | |
| | | <tr class="day-in" v-for="(items, index1) in item.DeliveryDetailList" :key="index1"> |
| | | <td>{{items.order_number}}</td> |
| | | <td>{{items.buildingNumber}}</td> |
| | | <td style="font-size: 15px;font-weight: bold;">{{items.width}}x{{items.height}}</td> |
| | | <td>{{items.quantity}}</td> |
| | | <td>{{items.area}}</td> |
| | | <td>{{items.price}}</td> |
| | | <td>{{items.money}}</td> |
| | | <td>{{items.processingNote}}</td> |
| | | </tr> |
| | | <tr class="day-in"> |
| | | <td style="font-size: 15px;font-weight: bold;" colspan="3">小计:</td> |
| | | <td>{{item.DeliveryDetail.quantity}}</td> |
| | | <td>{{item.DeliveryDetail.area}}</td> |
| | | <td></td> |
| | | <td>{{item.DeliveryDetail.money}}</td> |
| | | <td></td> |
| | | </tr> |
| | | |
| | | </template> |
| | | <tr class="day-in"> |
| | | <td style="font-size: 15px;font-weight: bold;" colspan="3">合计:</td> |
| | | <td>{{delivery.quantity}}</td> |
| | | <td>{{delivery.area}}</td> |
| | | <td></td> |
| | | <td>{{delivery.money}}</td> |
| | | <td></td> |
| | | </tr> |
| | | <tr class="day-in"> |
| | | <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6" colspan="3"> |
| | | <div style="display: flex;font-size: 10px;"> |
| | | <div>加工费用</div> |
| | | <div style="margin-left: 20%">单价</div> |
| | | <div style="margin-left: 20%">数量</div> |
| | | <div style="margin-left: 20%">金额</div> |
| | | </div> |
| | | |
| | | </td> |
| | | <td style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="5">总金额: {{delivery.money}}</td> |
| | | </tr> |
| | | <tr class="day-in"> |
| | | <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6;" colspan="3"></td> |
| | | <td style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="5">大写金额: {{money}}</td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="3"><div class="bottom">制单员:<span style="font-size: 10px">{{delivery.creator}}</span></div></el-col> |
| | | <el-col :span="5"><div class="bottom">制单日期:<span style="font-size: 10px">{{delivery.createTime}}</span></div></el-col> |
| | | <el-col :span="4"><div class="bottom">发货员:</div></el-col> |
| | | <el-col :span="4"><div class="bottom">司机:</div></el-col> |
| | | <el-col :span="4"><div class="bottom">客户签字:</div></el-col> |
| | | <el-col :span="4"><div class="bottom">签收日期:</div></el-col> |
| | | |
| | | </el-row> |
| | | <el-row :gutter="20" style="margin-top: 20px;"> |
| | | <el-col :span="3"><div class="bottom">架子 只</div></el-col> |
| | | <el-col :span="21"><div class="bottom">{{takeCare}}</div></el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" style="margin-top: 20px;"> |
| | | <el-col :span="24"><div class="bottom">{{remark}}</div></el-col> |
| | | </el-row> |
| | | |
| | | |
| | | |
| | | </div> |
| | | <!-- <div style="border: 1px solid #d3dce6;border-collapse: collapse;">--> |
| | | <!-- <el-row :gutter="20" >--> |
| | | |
| | | <!-- <el-col :span="9">--> |
| | | <!-- <div style="font-size: 20px;display: flex">--> |
| | | <!-- <div>客户名称:</div>--> |
| | | <!-- <div>常州市金宝石门窗有限公司</div>--> |
| | | <!-- </div>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="9">--> |
| | | <!-- <div style="font-size: 20px;display: flex">--> |
| | | <!-- <div>项目名称:</div>--> |
| | | <!-- <div>公园道</div>--> |
| | | <!-- </div>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="6">--> |
| | | <!-- <div style="font-size: 20px;display: flex">--> |
| | | <!-- <div>联系人:</div>--> |
| | | <!-- <div></div>--> |
| | | <!-- </div>--> |
| | | <!-- </el-col>--> |
| | | <!-- </el-row>--> |
| | | |
| | | <!-- <el-row :gutter="20" >--> |
| | | <!-- <el-col :span="18">--> |
| | | <!-- <div style="font-size: 20px;display: flex">--> |
| | | <!-- <div>送货地址:</div>--> |
| | | <!-- <div></div>--> |
| | | <!-- </div>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="6">--> |
| | | <!-- <div style="font-size: 20px;display: flex">--> |
| | | <!-- <div>联系电话:</div>--> |
| | | <!-- <div></div>--> |
| | | <!-- </div>--> |
| | | <!-- </el-col>--> |
| | | <!-- </el-row>--> |
| | | <!-- </div>--> |
| | | |
| | | <!-- <div style="border: 1px solid #d3dce6;border-collapse: collapse;">--> |
| | | <!-- <el-row :gutter="20" >--> |
| | | |
| | | <!-- <el-col :span="2">--> |
| | | <!-- <div class="alias">--> |
| | | <!-- <div>序号</div>--> |
| | | <!-- </div>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="5">--> |
| | | <!-- <div class="alias">--> |
| | | <!-- <div>楼层编号</div>--> |
| | | <!-- </div>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="5">--> |
| | | <!-- <div class="alias">--> |
| | | <!-- <div>宽(弧长)*高</div>--> |
| | | <!-- </div>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="2">--> |
| | | <!-- <div class="alias">--> |
| | | <!-- <div>数量</div>--> |
| | | <!-- </div>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="2">--> |
| | | <!-- <div class="alias">--> |
| | | <!-- <div>面积</div>--> |
| | | <!-- </div>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="2">--> |
| | | <!-- <div class="alias">--> |
| | | <!-- <div>单价</div>--> |
| | | <!-- </div>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="2">--> |
| | | <!-- <div class="alias" >--> |
| | | <!-- <div>金额</div>--> |
| | | <!-- </div>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="4">--> |
| | | <!-- <div class="alias" >--> |
| | | <!-- <div>加工要求</div>--> |
| | | <!-- </div>--> |
| | | <!-- </el-col>--> |
| | | <!-- </el-row>--> |
| | | |
| | | |
| | | <!-- </div>--> |
| | | |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <style> |
| | | @media print{ |
| | | @page { |
| | | mso-header:none; |
| | | margin: 10mm 16mm; |
| | | margin-bottom: 8mm; |
| | | margin-top:8mm; |
| | | |
| | | } |
| | | } |
| | | #table1 tr{ |
| | | height: 30px; |
| | | } |
| | | #table1 th{ |
| | | height: 30px; |
| | | border: 1px solid #d3dce6; |
| | | border-collapse: collapse; |
| | | font-size: 15px; |
| | | font-weight: bold; |
| | | } |
| | | .day-in td{ |
| | | text-align: center; |
| | | } |
| | | #table1 td{ |
| | | border: 1px solid #d3dce6; |
| | | border-collapse: collapse; |
| | | } |
| | | #deliveryPrinting .el-dialog__header{ |
| | | visibility:hidden |
| | | } |
| | | |
| | | .el-overlay-dialog{ |
| | | overflow-y: scroll; |
| | | } |
| | | ::-webkit-scrollbar { |
| | | display: none; |
| | | } |
| | | .bottom{ |
| | | font-size: 10px; |
| | | font-weight: bold; |
| | | |
| | | } |
| | | |
| | | </style> |
| | | |
| | | |
| | | <!-- |
| | | <template> |
| | | |
| | | <div> |
| | | <div id="pis" style="width: 100%;height: 100%"> |
| | | <div style="font-size: 35px;text-align: center;font-weight: bold;">常州市吉利玻璃有限公司</div> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="6"><div></div></el-col> |
| | | <el-col :span="12"><div style="font-size: 30px;text-align: center;font-weight: bold;">销售发货单</div></el-col> |
| | | <el-col :span="6"> |
| | | <div style="font-size: 20px;display: flex;margin-top: 10px"> |
| | | <div style="font-weight: bold;">发货单号:</div> |
| | | <div style="font-weight: bold;">{{delivery.deliveryId}}</div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <div style="border: 1px solid #d3dce6;border-collapse: collapse;width: 100%;height: 100%;"> |
| | | <table id="table1" style="border: 1px solid #d3dce6;border-collapse: collapse;width: 100%;height: 100%;"> |
| | | <tr> |
| | | <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="3">客户名称:{{delivery.customerName}}</th> |
| | | <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="3">项目名称:{{delivery.project}}</th> |
| | | <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="2">联系人:{{delivery.contacts}}</th> |
| | | |
| | | </tr> |
| | | <tr> |
| | | <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="6">送货地址:{{delivery.deliveryAddress}}</th> |
| | | <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="2">联系电话:{{delivery.contactNumber}}</th> |
| | | |
| | | </tr> |
| | | <tr> |
| | | <th style="width: 6%;font-size: 15px;font-weight: bold;">序号</th> |
| | | <th style="width: 20%;font-size: 15px;font-weight: bold;">楼层编号</th> |
| | | <th style="width: 20%;font-size: 15px;font-weight: bold;">宽(弧度)*高</th> |
| | | <th style="width: 10%;font-size: 15px;font-weight: bold;">数量</th> |
| | | <th style="width: 10%;font-size: 15px;font-weight: bold;">面积</th> |
| | | <th style="width: 10%;font-size: 15px;font-weight: bold;">单价</th> |
| | | <th style="width: 12%;font-size: 15px;font-weight: bold;">金额</th> |
| | | <th style="width: 12%;font-size: 15px;font-weight: bold;">加工要求</th> |
| | | </tr> |
| | | |
| | | <template v-for="(item, index) in produceList" :key="index" > |
| | | <tr> |
| | | <td style="font-size: 15px;font-weight: bold;" colspan="3">产品名称:{{item.DeliveryDetail.orderDetail.productName}}</td> |
| | | <td style="font-size: 15px;font-weight: bold;" colspan="3">对方单号:</td> |
| | | <td style="font-size: 15px;font-weight: bold;" colspan="2">订单编号:{{item.DeliveryDetail.orderDetail.orderId}}</td> |
| | | </tr> |
| | | |
| | | <tr class="day-in" v-for="(items, index1) in item.DeliveryDetailList" :key="index1"> |
| | | <td>{{items.order_number}}</td> |
| | | <td>{{items.buildingNumber}}</td> |
| | | <td style="font-size: 15px;font-weight: bold;">{{items.width}}x{{items.height}}</td> |
| | | <td>{{items.quantity}}</td> |
| | | <td>{{items.area}}</td> |
| | | <td>{{items.price}}</td> |
| | | <td>{{items.money}}</td> |
| | | <td>{{items.processingNote}}</td> |
| | | </tr> |
| | | <tr class="day-in"> |
| | | <td style="font-size: 15px;font-weight: bold;" colspan="3">小计:</td> |
| | | <td>{{item.DeliveryDetail.quantity}}</td> |
| | | <td>{{item.DeliveryDetail.area}}</td> |
| | | <td></td> |
| | | <td>{{item.DeliveryDetail.money}}</td> |
| | | <td></td> |
| | | </tr> |
| | | |
| | | </template> |
| | | <tr class="day-in"> |
| | | <td style="font-size: 15px;font-weight: bold;" colspan="3">合计:</td> |
| | | <td>{{delivery.quantity}}</td> |
| | | <td>{{delivery.area}}</td> |
| | | <td></td> |
| | | <td>{{delivery.money}}</td> |
| | | <td></td> |
| | | </tr> |
| | | <tr class="day-in"> |
| | | <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6" colspan="3"> |
| | | <div style="display: flex"> |
| | | <div>加工费用</div> |
| | | <div style="margin-left: 20%">单价</div> |
| | | <div style="margin-left: 20%">数量</div> |
| | | <div style="margin-left: 20%">金额</div> |
| | | </div> |
| | | |
| | | </td> |
| | | <td style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="5">总金额: {{delivery.money}}</td> |
| | | </tr> |
| | | <tr class="day-in"> |
| | | <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6;" colspan="3"></td> |
| | | <td style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="5">大写金额: {{money}}</td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="3"><div class="bottom">制单员:<span style="font-size: 15px">{{delivery.creator}}</span></div></el-col> |
| | | <el-col :span="5"><div class="bottom">制单日期:<span style="font-size: 15px">{{delivery.createTime}}</span></div></el-col> |
| | | <el-col :span="4"><div class="bottom">发货员:</div></el-col> |
| | | <el-col :span="4"><div class="bottom">司机:</div></el-col> |
| | | <el-col :span="4"><div class="bottom">客户签字:</div></el-col> |
| | | <el-col :span="4"><div class="bottom">签收日期:</div></el-col> |
| | | |
| | | </el-row> |
| | | <el-row :gutter="20" style="margin-top: 20px;"> |
| | | <el-col :span="3"><div class="bottom">架子 只</div></el-col> |
| | | <el-col :span="21"><div class="bottom">{{takeCare}}</div></el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" style="margin-top: 20px;"> |
| | | <el-col :span="24"><div class="bottom">{{remark}}</div></el-col> |
| | | </el-row> |
| | | |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <style > |
| | | .el-row { |
| | | margin-bottom: 10px; |
| | | #table1 tr{ |
| | | height: 30px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | #table1 th{ |
| | | height: 30px; |
| | | border: 1px solid #d3dce6; |
| | | border-collapse: collapse; |
| | | } |
| | | .el-col { |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | .grid-content { |
| | | border-radius: 4px; |
| | | min-height: 36px; |
| | | } |
| | | .alias{ |
| | | .day-in td{ |
| | | text-align: center; |
| | | font-size: 20px; |
| | | } |
| | | #table1 td{ |
| | | border: 1px solid #d3dce6; |
| | | border-collapse: collapse; |
| | | } |
| | | #deliveryPrinting .el-dialog__header{ |
| | | visibility:hidden |
| | | } |
| | | |
| | | </style> |
| | | .el-overlay-dialog{ |
| | | overflow-y: scroll; |
| | | } |
| | | ::-webkit-scrollbar { |
| | | display: none; |
| | | } |
| | | .bottom{ |
| | | font-size: 20px; |
| | | font-weight: bold; |
| | | |
| | | } |
| | | |
| | | </style>--> |
| | |
| | | break |
| | | } |
| | | case 'printing' :{ |
| | | const url = router.resolve({path: '/main/delivery/deliveryPrinting', query: { deliveryID: row.deliveryId }}) |
| | | /*const url = router.resolve({path: '/main/delivery/deliveryPrinting', query: { deliveryID: row.deliveryId }}) |
| | | window.open(url.href, '_blank') |
| | | break*/ |
| | | router.push({path: '/main/delivery/deliveryPrinting', query: { deliveryID: row.deliveryId }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | |
| | | <el-dialog |
| | | v-model="dialogTableVisible" |
| | | destroy-on-close |
| | | style="width: 75%;height:70% "> |
| | | id="deliveryPrinting" |
| | | style="width: 100%;height:100%;margin-top: 0; "> |
| | | <DeliveryPrinting |
| | | :deliveryId="rowClickIndex.deliveryId" |
| | | style="width: 100%;height: 100%" /> |
| | | style="width: 100%;height: 100%;" /> |
| | | </el-dialog> |
| | | </div> |
| | | |
| | |
| | | import deepClone from "@/utils/deepClone" |
| | | import useUserInfoStore from '@/stores/userInfo' |
| | | import SelectProduct from "@/views/sd/product/SelectProduct.vue" |
| | | import OrderOtherMoney from "@/components/sd/order/OrderOtherMoney.vue" |
| | | import {changeFilterEvent,filterChanged} from "@/hook" |
| | | import {addListener,toolbarButtonClickEvent} from "@/hook/mouseMove" |
| | | import downLoadFile from "@/hook/downLoadFile" |
| | |
| | | |
| | | let dialogTableVisible = ref(false) |
| | | let productVisible = ref(false) |
| | | let errorAreaVisible = ref(false) |
| | | let otherMoneyVisible = ref(false) |
| | | let errorArea = ref(null) |
| | | const userStore = useUserInfoStore() |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | |
| | | }) |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | orderOtherMoney:[], |
| | | orderType:[], |
| | | alType:[], |
| | | icon:[], |
| | |
| | | let filterData = ref({}) |
| | | let rowIndex = ref(null) |
| | | let rowClickIndex = ref(null) |
| | | let otherMoney = ref(null) |
| | | |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | |
| | | { code: 'copyAll', name: t('basicData.sameAfterwards'), prefixIcon: 'vxe-icon-feedback', visible: true, disabled: false }, |
| | | { code: 'clearChecked', name: t('basicData.clearSelection'), prefixIcon: 'vxe-icon-indicator', visible: true, disabled: false }, |
| | | { code: 'computedMoney', name: t('basicData.calculateAmount'), prefixIcon: 'vxe-icon-chart-bar-x', visible: true, disabled: true }, |
| | | { code: 'errorArea', name: '误差结算面积', prefixIcon: 'vxe-icon-chart-bar-x', visible: true, disabled: false }, |
| | | { code: 'otherMoney', name: '其他金额', prefixIcon: 'vxe-icon-chart-bar-x', visible: true, disabled: false } |
| | | ] |
| | | ] |
| | | } |
| | |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'cell', |
| | | showStatus: true |
| | | showStatus: true, |
| | | showIcon:false |
| | | },//表头参数 |
| | | columns:[ |
| | | {type: 'seq',fixed:"left", title: t('basicData.Number'), width: 80 }, |
| | |
| | | {field: 'bendRadius',width:160, title: t('order.bendRadius'),editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'edgingType',width:160, title: t('order.edgingType'),editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'processingNote',width:200, title: t('order.processingNote'),editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'remarks',width:140, title: t('basicData.remarks'),editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged} |
| | | {field: 'remarks',width:140, title: t('basicData.remarks'),editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | |
| | | |
| | | ], |
| | | //表单验证 |
| | |
| | | } |
| | | let order ={ |
| | | title:titleUploadData.value, |
| | | detail:$grid.getTableData().tableData |
| | | detail:$grid.getTableData().tableData, |
| | | otherMoney:otherMoney.value |
| | | } |
| | | saveOrder(order) |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | },//右键按钮事件 |
| | | }, |
| | | //右键按钮事件 |
| | | menuClick ({ menu, row, column }) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | |
| | | titleUploadData.value.money=countMoney(xGrid.value.getTableData().fullData).toString() |
| | | |
| | | gridOptions.menuConfig.body.options[0][5].disabled=true |
| | | break |
| | | } |
| | | case 'errorArea' :{ |
| | | errorAreaVisible.value=true |
| | | break |
| | | } |
| | | case 'otherMoney' :{ |
| | | otherMoneyVisible.value=true |
| | | break |
| | | } |
| | | } |
| | |
| | | } |
| | | if(res.data.order.productionOrder !==0 ){ |
| | | gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | |
| | | } |
| | | const orderDetails = res.data.orderDetails |
| | | orderDetails.forEach(item => { |
| | | item.otherColumns = JSON.parse(item.otherColumns) |
| | | }) |
| | | |
| | | //加载副表数据 |
| | | xGrid.value.reloadData(res.data.orderDetails) |
| | | xGrid.value.reloadData(orderDetails) |
| | | }else{ |
| | | ElMessage.error(res.msg) |
| | | } |
| | |
| | | |
| | | //页面第一次加载执行 |
| | | request.get(`/basicData/orderBasicData`).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | titleSelectJson.value=deepClone(res.data) |
| | | //其他金额 |
| | | otherMoney.value = titleSelectJson.value.orderOtherMoney[0] |
| | | //let columns = [] |
| | | otherMoney.value.forEach(item => { |
| | | let column = {field: `otherColumns.${item.column}`,width:50, title: item.alias,editRender: { name: 'input'}} |
| | | //columns.push(column) |
| | | gridOptions.columns.push(column) |
| | | }) |
| | | |
| | | //进入页面下拉框设置默认值 |
| | | titleUploadData.value.orderType = titleSelectJson.value.orderType[0].basicName |
| | | titleUploadData.value.orderClassify = titleSelectJson.value.orderClassify[0].basicName |
| | |
| | | list.forEach((item)=>{ |
| | | countMoney += parseFloat(item.grossAmount) |
| | | }) |
| | | otherMoney.value.forEach(item => { |
| | | countMoney+=item.quantity*item.price |
| | | }) |
| | | return parseFloat((countMoney).toFixed(2)) |
| | | } |
| | | //导入功能 |
| | |
| | | downLoadFile('/importTemplate.xlsx','importTemplate.xlsx') |
| | | } |
| | | |
| | | //字符串转object |
| | | |
| | | function getNestedProperty(obj, path) { |
| | | return path.split('.').reduce(function(o, p) { |
| | | if(o && o.hasOwnProperty(p)) { |
| | | return o[p]; |
| | | } |
| | | }, obj); |
| | | } |
| | | |
| | | //行单元格修改修改触发此事件 |
| | | const editClosedEvent = ({ row, column }) => { |
| | | //判断修改相应的数值修改面积与金额 |
| | |
| | | }else if(column.property === 'computeArea'){ |
| | | row.computeGrossArea=parseFloat((row.computeArea*row.quantity).toFixed(2)) |
| | | row.grossAmount=parseFloat((row.price * row.computeGrossArea).toFixed(2)) |
| | | }else if(column.property.indexOf('otherColumns.M')>-1){ |
| | | let quantity = 0 |
| | | xGrid.value.getTableData().fullData.forEach(item => { |
| | | quantity += item.quantity*(getNestedProperty(item,column.property)*1) |
| | | }) |
| | | if(!isNaN(quantity)){ |
| | | otherMoney.value.forEach(item => { |
| | | if(item.column===column.property.split('.')[1]){ |
| | | item.quantity = quantity |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | titleUploadData.value.money=countMoney(xGrid.value.getTableData().fullData).toString() |
| | | |
| | | titleUploadData.value.money=countMoney(xGrid.value.getTableData().fullData).toString() |
| | | |
| | | } |
| | | |
| | | //误差面积计算方法 |
| | | const errorAreaComputed = () => { |
| | | const regex = /^(0(\.\d{1,2})?|([1-9]\d{0,4})(\.\d{1,2})?|99999(\.9{1,2})?)$/ |
| | | if (!regex.test(errorArea.value)) { |
| | | ElMessage.warning(t('basicData.msg.range99999Dec2')) |
| | | return |
| | | } |
| | | const fullData = xGrid.value.getTableData().fullData |
| | | if (!fullData.length){ |
| | | ElMessage.warning("表格中无产品数据") |
| | | } |
| | | fullData.forEach((item,index) => { |
| | | if( !isNaN(item.computeArea*1) && item.computeArea != null && item.computeArea*1 < errorArea.value){ |
| | | item.computeArea = errorArea.value |
| | | item.computeGrossArea = parseFloat((item.computeArea*item.quantity).toFixed(2)) |
| | | item.grossAmount=parseFloat((item.price * item.computeGrossArea).toFixed(2)) |
| | | } |
| | | }) |
| | | titleUploadData.value.money=countMoney(xGrid.value.getTableData().fullData).toString() |
| | | errorAreaVisible.value= false |
| | | } |
| | | |
| | | |
| | | |
| | | //关闭其他金额界面 |
| | | const refOtherMoney = ref() |
| | | const closeOtherMoneyDialog = async (done) => { |
| | | const flag = await refOtherMoney.value.validate() |
| | | if(flag){ |
| | | done() |
| | | titleUploadData.value.money=countMoney(xGrid.value.getTableData().fullData).toString() |
| | | } |
| | | } |
| | | |
| | | |
| | | </script> |
| | |
| | | <el-row> |
| | | <el-col :span="2"><el-text>{{$t('order.money')}}:</el-text></el-col> |
| | | <el-col :span="2"><el-text >{{titleUploadData.money}}</el-text></el-col> |
| | | <el-col :span="2"><el-text>{{$t('order.customers')}}:</el-text></el-col> |
| | | <el-col :span="2"><el-text>{{$t('order.contractId')}}:</el-text></el-col> |
| | | <el-col :span="2"><el-input v-model="titleUploadData.contractId"/></el-col> |
| | | <el-col :span="2"><el-text>{{$t('order.customerBatch')}}:</el-text></el-col> |
| | | <el-col :span="2"><el-input v-model="titleUploadData.customerBatch"/></el-col> |
| | |
| | | <el-dialog v-model="productVisible" style="width: 80%;height:75% "> |
| | | <select-product :rowIndex="rowIndex" @getProductRow="getProductRow" style="width: 100%;height: 100%" /> |
| | | </el-dialog> |
| | | |
| | | <!--误差结算--> |
| | | <el-dialog v-model="errorAreaVisible" style="width: 300px;height:150px "> |
| | | <el-row> |
| | | <el-col :span="10"> |
| | | <el-input |
| | | v-model="errorArea" |
| | | :placeholder="'误差值'" |
| | | /> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-button @click="errorAreaComputed">确认</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | </el-dialog> |
| | | <el-dialog v-model="otherMoneyVisible" |
| | | :title="'其他金额'" |
| | | :close-on-click-modal="false" |
| | | :close-on-press-escape="false" |
| | | :before-close="closeOtherMoneyDialog" |
| | | style="width: 614px;height:445px "> |
| | | <order-other-money |
| | | ref="refOtherMoney" |
| | | :otherMoney="otherMoney" |
| | | style="width: 100%;height: 100%" /> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.entity.sd.BasicData; |
| | | import com.example.erp.service.sd.BasicDateService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Map; |
| | |
| | | @RestController |
| | | @RequestMapping("/basicData") |
| | | public class BasicDataController { |
| | | @Autowired |
| | | final |
| | | BasicDateService basicDateService; |
| | | |
| | | public BasicDataController(BasicDateService basicDateService) { |
| | | this.basicDateService = basicDateService; |
| | | } |
| | | |
| | | @GetMapping("/orderBasicData") |
| | | public Result getOrderBasicData(){ |
| | | return Result.seccess(basicDateService.getOrderBasicData()); |
| New file |
| | |
| | | package com.example.erp.controller.sd; |
| | | |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.entity.sd.BasicData; |
| | | import com.example.erp.service.sd.BasicOtherMoneyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @RestController |
| | | @RequestMapping("/basicOtherMoney") |
| | | public class BasicOtherMoneyController { |
| | | private final BasicOtherMoneyService basicOtherMoneyService; |
| | | |
| | | public BasicOtherMoneyController(BasicOtherMoneyService basicOtherMoneyService) { |
| | | this.basicOtherMoneyService = basicOtherMoneyService; |
| | | } |
| | | |
| | | @GetMapping("findAll") |
| | | @PostMapping("findAll") |
| | | public Result findAll(){ |
| | | return Result.seccess(basicOtherMoneyService.findAll()); |
| | | } |
| | | |
| | | @PostMapping("deleteById/{id}") |
| | | public Result deleteById(@PathVariable("id") Integer id){ |
| | | return Result.seccess(basicOtherMoneyService.deleteById(id)); |
| | | } |
| | | |
| | | @PostMapping("save") |
| | | public Result save(String alias){ |
| | | return Result.seccess(basicOtherMoneyService.save(alias)); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.example.erp.entity.sd; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | import org.apache.poi.hpsf.Decimal; |
| | | |
| | | import javax.persistence.Column; |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class BasicOtherMoney { |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | @TableField(value = "`column`") |
| | | private String column; |
| | | private String alias; |
| | | @Column(length=7 ,scale=2) |
| | | private BigDecimal quantity; |
| | | @Column(length=7 ,scale=2) |
| | | private BigDecimal price; |
| | | private Boolean state; |
| | | |
| | | } |
| | |
| | | private String edgingType; |
| | | private Double weight; |
| | | private Double perimeter; |
| | | private String otherColumns; |
| | | private Integer warehouseNum; |
| | | private Integer deliveryNum; |
| | | private Integer returnNum; |
| New file |
| | |
| | | package com.example.erp.entity.sd; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class OrderOtherMoney { |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | private String orderId; |
| | | @TableField(value = "`column`") |
| | | private String column; |
| | | private Double quantity; |
| | | private Double price; |
| | | private Double money; |
| | | private LocalDateTime createTime; |
| | | } |
| New file |
| | |
| | | package com.example.erp.mapper.sd; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.erp.entity.sd.BasicOtherMoney; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface BasicOtherMoneyMapper extends BaseMapper<BasicOtherMoney> { |
| | | } |
| New file |
| | |
| | | package com.example.erp.mapper.sd; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.erp.entity.sd.OrderOtherMoney; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface OrderOtherMoneyMapper extends BaseMapper<OrderOtherMoney> { |
| | | } |
| | |
| | | Integer ordersum = finishedGoodsInventoryMapper.findOrderQuantity(flowCard.getOrder().getOrderId()); |
| | | Integer ordernumbersum = finishedGoodsInventoryMapper.findOrderNumberdsum(flowCard.getOrder().getOrderId()); |
| | | |
| | | System.out.println("订单总数:" + ordersum + "已入库数量:" + ordernumbersum + "准备入库数量" + flowCard.getInventoryQuantity()); |
| | | /*System.out.println("订单总数:" + ordersum + "已入库数量:" + ordernumbersum + "准备入库数量" + flowCard.getInventoryQuantity());*/ |
| | | if (finishedGoodsInventorycount > 0) { |
| | | //修改库存表入库数量 |
| | | finishedGoodsInventoryMapper.updateInventory(flowCard,storageRegion, remark); |
| | |
| | | deliverydetailsum=0; |
| | | } |
| | | |
| | | System.out.println("订单总数:" + ordersum + "订单已发数量:" + orderDeliveryQuantitySum + "准备出库数量" + |
| | | /*System.out.println("订单总数:" + ordersum + "订单已发数量:" + orderDeliveryQuantitySum + "准备出库数量" + |
| | | orderDetail.getWarehouseNum()+ "发货数量" + orderDetail.getDeliveryDetail().getQuantity()+ "发货总数" + |
| | | deliverysum+ "已发数量" + deliverydetailsum); |
| | | deliverysum+ "已发数量" + deliverydetailsum);*/ |
| | | if (finishedGoodsInventorycount > 0) { |
| | | if(orderDetail.getWarehouseNum()>=orderDetail.getDeliveryDetail().getQuantity()){ |
| | | //修改库存表库存数量 |
| | |
| | | for (FinishedOperateLog finishedOperateLog : finishedOperateLogslist) { |
| | | Integer ordersum = finishedGoodsInventoryMapper.findOrderQuantity(finishedOperateLog.getOrderId()); |
| | | Integer ordernumbersum = finishedGoodsInventoryMapper.findOrderNumberdsum(finishedOperateLog.getOrderId()); |
| | | System.out.println(finishedOperateLog.getOperateType()); |
| | | |
| | | if(Objects.equals(finishedOperateLog.getOperateType(), "入库")){ |
| | | //修改记录表 |
| | | finishedOperateLogMapper.updateFinishedOperateLogState(finishedOperateLog,"已作废"); |
| | |
| | | package com.example.erp.service.sd; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.example.erp.entity.sd.BasicData; |
| | | import com.example.erp.entity.sd.Customer; |
| | | import com.example.erp.mapper.sd.BasicDateMapper; |
| | | import com.example.erp.mapper.sd.BasicOtherMoneyMapper; |
| | | import com.example.erp.mapper.sd.CustomerMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.example.erp.entity.sd.BasicData; |
| | | |
| | | import java.util.*; |
| | | |
| | | @Service |
| | | @DS("sd") |
| | | public class BasicDateService { |
| | | @Autowired |
| | | private BasicDateMapper basicDateMapper; |
| | | private final BasicDateMapper basicDateMapper; |
| | | |
| | | @Autowired |
| | | private CustomerMapper customerMapper; |
| | | private final CustomerMapper customerMapper; |
| | | private final BasicOtherMoneyMapper basicOtherMoneyMapper; |
| | | |
| | | public BasicDateService(BasicDateMapper basicDateMapper, CustomerMapper customerMapper, BasicOtherMoneyMapper basicOtherMoneyMapper) { |
| | | this.basicDateMapper = basicDateMapper; |
| | | this.customerMapper = customerMapper; |
| | | this.basicOtherMoneyMapper = basicOtherMoneyMapper; |
| | | } |
| | | |
| | | //获取订单基本数据 |
| | | public Map<String, List<Object>> getOrderBasicData() { |
| | |
| | | orderBasicDataMap.get("customer").add(customer); |
| | | } |
| | | |
| | | orderBasicDataMap.put("orderOtherMoney", Collections.singletonList(basicOtherMoneyMapper.selectList(null))); |
| | | |
| | | |
| | | //返回Map对象 |
| | | return orderBasicDataMap; |
| New file |
| | |
| | | package com.example.erp.service.sd; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.example.erp.entity.sd.BasicOtherMoney; |
| | | import com.example.erp.mapper.sd.BasicOtherMoneyMapper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @DS("sd") |
| | | public class BasicOtherMoneyService { |
| | | private final BasicOtherMoneyMapper basicOtherMoneyMapper; |
| | | |
| | | public BasicOtherMoneyService(BasicOtherMoneyMapper basicOtherMoneyMapper) { |
| | | this.basicOtherMoneyMapper = basicOtherMoneyMapper; |
| | | } |
| | | |
| | | public List<BasicOtherMoney> findAll() { |
| | | return basicOtherMoneyMapper.selectList(null); |
| | | |
| | | } |
| | | |
| | | public int deleteById(Integer id) { |
| | | return basicOtherMoneyMapper.deleteById(id); |
| | | } |
| | | |
| | | public int save(String alias) { |
| | | BasicOtherMoney basicOtherMoney = new BasicOtherMoney(); |
| | | basicOtherMoney.setAlias(alias); |
| | | return basicOtherMoneyMapper.insert(basicOtherMoney); |
| | | } |
| | | } |
| | |
| | | package com.example.erp.service.sd; |
| | | |
| | | import com.alibaba.excel.util.StringUtils; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.util.*; |
| | | import java.math.BigDecimal; |
| | | |
| | | @Service |
| | | @DS("sd") |
| | |
| | | public Map<String, Object> getSelectDeliveryPrinting( DeliveryDetail deliveryDetail) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List <Map<String, Object>> list=new ArrayList<Map<String, Object>>();//最终结果 |
| | | System.out.println(deliveryDetail); |
| | | List<DeliveryDetail> deliveryDetailList=deliveryDetailMapper.getSelectDeliveryPrinting(deliveryDetail); |
| | | for (int i = 0; i < deliveryDetailList.size(); i++) { |
| | | for (DeliveryDetail detail : deliveryDetailList) { |
| | | |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | |
| | | List <Map<String, Object>> deliveryDetailList2=deliveryDetailMapper.getSelectDeliveryDetailPrinting(deliveryDetailList.get(i).getDeliveryId(), |
| | | deliveryDetailList.get(i).getOrderDetail().getProductId(),deliveryDetailList.get(i).getOrderDetail().getOrderId()); |
| | | itemmap.put("DeliveryDetail",deliveryDetailList.get(i)); |
| | | itemmap.put("DeliveryDetailList",deliveryDetailList2); |
| | | List<Map<String, Object>> deliveryDetailList2 = deliveryDetailMapper.getSelectDeliveryDetailPrinting(detail.getDeliveryId(), |
| | | detail.getOrderDetail().getProductId(), detail.getOrderDetail().getOrderId()); |
| | | itemmap.put("DeliveryDetail", detail); |
| | | itemmap.put("DeliveryDetailList", deliveryDetailList2); |
| | | list.add(itemmap); |
| | | |
| | | |
| | | } |
| | | Delivery delivery=deliveryMapper.getSelectShippingOrderDetailDeliveryPrinting(deliveryDetail); |
| | | map.put("data", list); |
| | | map.put("delivery", deliveryMapper.getSelectShippingOrderDetailDeliveryPrinting(deliveryDetail)); |
| | | map.put("money", toChinese(delivery.getMoney().toString(), false)); |
| | | return map; |
| | | |
| | | } |
| | | |
| | | private static final String[] NUMBERS = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"}; |
| | | |
| | | private static final String[] IUNIT = {"元", "拾", "佰", "仟", "万", "拾", "佰", "仟", "亿", "拾", "佰", "仟"}; |
| | | |
| | | private static final String[] DUNIT = {"角", "分"}; |
| | | |
| | | private static final String[] CN_NUMBERS = {"零", "一", "二", "三", "四", "五", "六", "七", "八", "九"}; |
| | | |
| | | private static final String[] CN_IUNIT = {"", "十", "百", "千", "万", "十", "百", "千", "亿", "十", "百", "千"}; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 转换为大写的中文金额,支持负数 |
| | | * @param amount 金额 |
| | | * @param isSimplified 是否简体中文:true:简体,false:繁体 |
| | | * @return |
| | | */ |
| | | public static String toChinese(String amount, boolean isSimplified) { |
| | | // 判断输入的金额字符串是否符合要求 |
| | | if (StringUtils.isBlank(amount) || !amount.matches("(-)?[\\d]*(.)?[\\d]*")) { |
| | | throw new RuntimeException("请输入数字"); |
| | | } |
| | | |
| | | if ("0".equals(amount) || "0.00".equals(amount) || "0.0".equals(amount)) { |
| | | return isSimplified ? "零" : "零元"; |
| | | } |
| | | |
| | | // 判断金额数字中是否存在负号"-" |
| | | boolean flag = false; |
| | | if (amount.startsWith("-")) { |
| | | // 标志位,标志此金额数字为负数 |
| | | flag = true; |
| | | amount = amount.replaceAll("-", ""); |
| | | } |
| | | // 去掉金额数字中的逗号"," |
| | | amount = amount.replaceAll(",", ""); |
| | | // 初始化:分离整数部分和小数部分 |
| | | String[] separateNum = separateNum(amount); |
| | | // 整数部分数字 |
| | | String integerStr = separateNum[0]; |
| | | // 小数部分数字 |
| | | String decimalStr = separateNum[1]; |
| | | // beyond超出计算能力,直接返回 |
| | | if (integerStr.length() > IUNIT.length) { |
| | | throw new RuntimeException("输入数字超限"); |
| | | } |
| | | // 整数部分数字 |
| | | int[] integers = toIntArray(integerStr); |
| | | // 判断整数部分是否存在输入012的情况 |
| | | if (integers.length > 1 && integers[0] == 0) { |
| | | throw new RuntimeException("输入数字不符合要求"); |
| | | } |
| | | // 设置万单位 |
| | | boolean isWan = isWan5(integerStr); |
| | | // 小数部分数字 |
| | | int[] decimals = toIntArray(decimalStr); |
| | | // 返回最终的大写金额 |
| | | String result = ""; |
| | | String chineseInteger = getChineseInteger(integers, isWan, isSimplified); |
| | | String chineseDecimal = getChineseDecimal(decimals, isSimplified); |
| | | if (decimals.length > 0 && isSimplified) { |
| | | result = chineseInteger; |
| | | if (!chineseDecimal.equals("零零")) { |
| | | result = result + "点" + chineseDecimal; |
| | | } |
| | | } else { |
| | | result = chineseInteger + chineseDecimal; |
| | | |
| | | } |
| | | if (flag) { |
| | | // 如果是负数,加上"负" |
| | | return "负" + result; |
| | | } else { |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 分离整数部分和小数部分 |
| | | * @param str |
| | | * @return |
| | | */ |
| | | private static String[] separateNum(String str) { |
| | | String integerStr;// 整数部分数字 |
| | | String decimalStr;// 小数部分数字 |
| | | if (str.indexOf('.') >= 1) { |
| | | integerStr = str.substring(0, str.indexOf('.')); |
| | | decimalStr = str.substring(str.indexOf('.') + 1); |
| | | if (decimalStr.length() > 2) { |
| | | decimalStr = decimalStr.substring(0, 2); |
| | | } |
| | | } else if (str.indexOf('.') == 0) { |
| | | integerStr = ""; |
| | | decimalStr = str.substring(1); |
| | | } else { |
| | | integerStr = str; |
| | | decimalStr = ""; |
| | | } |
| | | return new String[] {integerStr, decimalStr}; |
| | | } |
| | | |
| | | /** |
| | | * 将字符串转为int数组 |
| | | * @param number 数字 |
| | | * @return |
| | | */ |
| | | private static int[] toIntArray(String number) { |
| | | int[] array = new int[number.length()]; |
| | | for (int i = 0; i < number.length(); i++) { |
| | | array[i] = Integer.parseInt(number.substring(i, i + 1)); |
| | | } |
| | | return array; |
| | | } |
| | | |
| | | /** |
| | | * 将整数部分转为大写的金额 |
| | | * @param integers 整数部分数字 |
| | | * @param isWan 整数部分是否已经是达到【万】 |
| | | * @return |
| | | */ |
| | | private static String getChineseInteger(int[] integers, boolean isWan, boolean isSimplified) { |
| | | |
| | | int length = integers.length; |
| | | if (!isSimplified && length == 1 && integers[0] == 0) { |
| | | return ""; |
| | | } |
| | | if (!isSimplified) { |
| | | return traditionalChineseInteger(integers, isWan); |
| | | } else { |
| | | return simplifiedChineseInteger(integers, isWan); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 繁体中文整数 |
| | | * @param integers |
| | | * @param isWan |
| | | * @return |
| | | */ |
| | | private static String traditionalChineseInteger(int[] integers, boolean isWan) { |
| | | StringBuilder chineseInteger = new StringBuilder(""); |
| | | int length = integers.length; |
| | | for (int i = 0; i < length; i++) { |
| | | String key = ""; |
| | | if (integers[i] == 0) { |
| | | if ((length - i) == 13)// 万(亿) |
| | | key = IUNIT[4]; |
| | | else if ((length - i) == 9) {// 亿 |
| | | key = IUNIT[8]; |
| | | } else if ((length - i) == 5 && isWan) {// 万 |
| | | key = IUNIT[4]; |
| | | } else if ((length - i) == 1) {// 元 |
| | | key = IUNIT[0]; |
| | | } |
| | | if ((length - i) > 1 && integers[i + 1] != 0) { |
| | | key += NUMBERS[0]; |
| | | } |
| | | } |
| | | chineseInteger.append(integers[i] == 0 ? key : (NUMBERS[integers[i]] + IUNIT[length - i - 1])); |
| | | } |
| | | return chineseInteger.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 简体中文整数 |
| | | * @param integers |
| | | * @param isWan |
| | | * @return |
| | | */ |
| | | private static String simplifiedChineseInteger(int[] integers, boolean isWan) { |
| | | StringBuilder chineseInteger = new StringBuilder(""); |
| | | int length = integers.length; |
| | | for (int i = 0; i < length; i++) { |
| | | String key = ""; |
| | | if (integers[i] == 0) { |
| | | if ((length - i) == 13) {// 万(亿) |
| | | key = CN_IUNIT[4]; |
| | | } else if ((length - i) == 9) {// 亿 |
| | | key = CN_IUNIT[8]; |
| | | } else if ((length - i) == 5 && isWan) {// 万 |
| | | key = CN_IUNIT[4]; |
| | | } else if ((length - i) == 1) {// 元 |
| | | key = CN_IUNIT[0]; |
| | | } |
| | | if ((length - i) > 1 && integers[i + 1] != 0) { |
| | | key += CN_NUMBERS[0]; |
| | | } |
| | | if (length == 1 && integers[i] == 0) { |
| | | key += CN_NUMBERS[0]; |
| | | } |
| | | } |
| | | chineseInteger.append(integers[i] == 0 ? key : (CN_NUMBERS[integers[i]] + CN_IUNIT[length - i - 1])); |
| | | } |
| | | return chineseInteger.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 将小数部分转为大写的金额 |
| | | * @param decimals 小数部分的数字 |
| | | * @return |
| | | */ |
| | | private static String getChineseDecimal(int[] decimals, boolean isSimplified) { |
| | | StringBuilder chineseDecimal = new StringBuilder(""); |
| | | if (!isSimplified) { |
| | | for (int i = 0; i < decimals.length; i++) { |
| | | String key = ""; |
| | | |
| | | if ((decimals.length - i) > 1 && decimals[i + 1] != 0) { |
| | | key += NUMBERS[0]; |
| | | } |
| | | |
| | | chineseDecimal.append(decimals[i] == 0 ? key : (NUMBERS[decimals[i]] + DUNIT[i])); |
| | | } |
| | | } else { |
| | | for (int i = 0; i < decimals.length; i++) { |
| | | chineseDecimal.append(CN_NUMBERS[decimals[i]]); |
| | | } |
| | | |
| | | } |
| | | return chineseDecimal.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 判断当前整数部分是否已经是达到【万】 |
| | | * @param integerStr 整数部分数字 |
| | | * @return |
| | | */ |
| | | private static boolean isWan5(String integerStr) { |
| | | int length = integerStr.length(); |
| | | if (length > 4) { |
| | | String subInteger = ""; |
| | | if (length > 8) { |
| | | subInteger = integerStr.substring(length - 8, length - 4); |
| | | } else { |
| | | subInteger = integerStr.substring(0, length - 4); |
| | | } |
| | | return Integer.parseInt(subInteger) > 0; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | public String orderNumberSetting(String type) { |
| | | //根据类型自动生成不同的操作单号 |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import com.example.erp.entity.sd.OrderProcessDetail; |
| | | import com.example.erp.entity.sd.*; |
| | | import com.example.erp.entity.userInfo.SysError; |
| | | import com.example.erp.exception.ServiceException; |
| | | import com.example.erp.mapper.sd.OrderDetailMapper; |
| | | import com.example.erp.mapper.sd.OrderGlassDetailMapper; |
| | | import com.example.erp.mapper.sd.OrderMapper; |
| | | import com.example.erp.mapper.sd.OrderProcessDetailMapper; |
| | | import com.example.erp.mapper.sd.*; |
| | | import com.example.erp.service.userInfo.SysErrorService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | |
| | | private final OrderDetailMapper orderDetailMapper; |
| | | private final OrderGlassDetailMapper orderGlassDetailMapper; |
| | | private final SysErrorService sysErrorService; |
| | | private final OrderOtherMoneyMapper orderOtherMoneyMapper; |
| | | |
| | | private final OrderProcessDetailMapper orderProcessDetailMapper; |
| | | public OrderService(OrderMapper orderMapper, OrderDetailMapper orderDetailMapper, OrderGlassDetailMapper orderGlassDetailMapper, OrderProcessDetailMapper orderProcessDetailMapper, SysErrorService sysErrorService) { |
| | | public OrderService(OrderMapper orderMapper, OrderDetailMapper orderDetailMapper, OrderGlassDetailMapper orderGlassDetailMapper, OrderProcessDetailMapper orderProcessDetailMapper, SysErrorService sysErrorService, OrderOtherMoneyMapper orderOtherMoneyMapper) { |
| | | this.orderMapper = orderMapper; |
| | | this.orderDetailMapper = orderDetailMapper; |
| | | this.orderGlassDetailMapper = orderGlassDetailMapper; |
| | | this.orderProcessDetailMapper = orderProcessDetailMapper; |
| | | this.sysErrorService = sysErrorService; |
| | | this.orderOtherMoneyMapper = orderOtherMoneyMapper; |
| | | } |
| | | |
| | | public boolean saveOrder(Map<String,Object> orderMap) throws Exception { |
| | | 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); |
| | | List<OrderOtherMoney> orderOtherMoneyList = JSONArray.parseArray(JSONObject.toJSONString(orderJson.get("otherMoney")), OrderOtherMoney.class); |
| | | boolean saveState = true; |
| | | //设置回滚点 |
| | | Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint(); |
| | | //判断传入id参数是否为空,未传入id为空插入订单表,传入更新表 |
| | | try{ |
| | | if(order.getOrderId() == null || order.getOrderId().isEmpty()){ |
| | | insertOrder(order,OrderDetails); |
| | | insertOrder(order,OrderDetails,orderOtherMoneyList); |
| | | }else { |
| | | updateOrder(order,OrderDetails); |
| | | updateOrder(order,OrderDetails,orderOtherMoneyList); |
| | | } |
| | | }catch (Exception e){ |
| | | TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint); |
| | |
| | | return saveState; |
| | | } |
| | | //生成订单数据 |
| | | public void insertOrder(Order order,List<OrderDetail> OrderDetails) { |
| | | public void insertOrder(Order order,List<OrderDetail> OrderDetails,List<OrderOtherMoney> orderOtherMoneyList) { |
| | | Integer maxOrderId = orderMapper.selectMaxOrderId(); |
| | | //查询订单id,并且自增 |
| | | String formattedNumber = String.format("%02d", maxOrderId+1); |
| | |
| | | order.setOrderId(orderId); |
| | | order.setCreateOrder(2); |
| | | orderMapper.insert(order); |
| | | insertOtherDetail(orderId,OrderDetails); |
| | | insertOtherDetail(orderId,OrderDetails,orderOtherMoneyList); |
| | | |
| | | } |
| | | //修改订单数据,并且重新生成多个副表数据 |
| | | public void updateOrder(Order order,List<OrderDetail> OrderDetails) { |
| | | public void updateOrder(Order order,List<OrderDetail> OrderDetails,List<OrderOtherMoney> orderOtherMoneyList) { |
| | | LambdaUpdateWrapper<Order> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(Order::getOrderId, order.getOrderId()); |
| | | orderMapper.update(order,updateWrapper); |
| | |
| | | orderDetailMapper.delete(new LambdaQueryWrapper<OrderDetail>().eq(OrderDetail::getOrderId, order.getOrderId())); |
| | | //删除订单小片表 |
| | | orderGlassDetailMapper.delete(new LambdaQueryWrapper<OrderGlassDetail>().eq(OrderGlassDetail::getOrderId, order.getOrderId())); |
| | | //删除其他金额明细表 |
| | | orderOtherMoneyMapper.delete(new LambdaQueryWrapper<OrderOtherMoney>().eq(OrderOtherMoney::getOrderId, order.getOrderId())); |
| | | |
| | | //删除订单工艺表 |
| | | // orderProcessDetailMapper.delete(new LambdaQueryWrapper<OrderProcessDetail>().eq(OrderProcessDetail::getOrderId, order.getOrderId())); |
| | | insertOtherDetail(order.getOrderId(),OrderDetails); |
| | | insertOtherDetail(order.getOrderId(),OrderDetails,orderOtherMoneyList); |
| | | } |
| | | |
| | | |
| | | //插入其他副表数据,被其他方法引用 |
| | | public void insertOtherDetail(String orderId,List<OrderDetail> OrderDetails) { |
| | | public void insertOtherDetail(String orderId,List<OrderDetail> OrderDetails,List<OrderOtherMoney> orderOtherMoneyList) { |
| | | //循环给订单明细表字段添加序号和周长 |
| | | for (int i = 0; i < OrderDetails.size(); i++) { |
| | | OrderDetails.get(i).setOrderNumber(i+1); |
| | |
| | | OrderDetails.get(i).setPerimeter(OrderDetails.get(i).getWidth()*OrderDetails.get(i).getHeight()*2/1000); |
| | | OrderDetails.get(i).setWeight(1.0); |
| | | } |
| | | |
| | | |
| | | |
| | | //往明细表插数据 |
| | | orderDetailMapper.insertBatch(OrderDetails); |
| | | //修改订单主表面积与周长以及重量 |
| | | orderMapper.updateOrderParameter(orderId); |
| | | //往小片表传入产品数据 |
| | | orderGlassDetailMapper.insertOrderGlassDetail(orderId); |
| | | //往订单其他金额副表传入数据 |
| | | orderOtherMoneyList.forEach(orderOtherMoney ->{ |
| | | orderOtherMoney.setId(null); |
| | | orderOtherMoney.setOrderId(orderId); |
| | | if(orderOtherMoney.getQuantity()!=null && orderOtherMoney.getPrice()!=null){ |
| | | orderOtherMoney.setMoney((orderOtherMoney.getQuantity()*orderOtherMoney.getPrice())); |
| | | } |
| | | orderOtherMoneyMapper.insert(orderOtherMoney); |
| | | }); |
| | | |
| | | //查询订单小片表获取工艺传入小片工艺表 |
| | | //List<OrderGlassDetail> orderGlassDetails = orderGlassDetailMapper.selectOrderGlassDetail(orderId); |
| | | /*List<OrderProcessDetail> orderProcessDetailList = getOrderProcessDetails(orderGlassDetails); |
| | |
| | | |
| | | <select id="getSelectShippingOrderDetailDeliveryPrinting" > |
| | | select |
| | | d.delivery_id,d.quantity,d.money,d.area, |
| | | d.delivery_id,d.quantity,d.money,d.area,d.project, |
| | | d.customer_id,d.customer_name,d.project,d.pay_method,d.pay_date,d.contacts,d.contact_number, |
| | | d.delivery_address,d.remarks,d.create_time,d.delivery_date,d.creator,d.salesman,d.salesman_id |
| | | from sd.delivery d |
| | |
| | | bend_radius, |
| | | edging_type, |
| | | weight, |
| | | perimeter |
| | | perimeter, |
| | | other_columns |
| | | ) |
| | | values |
| | | <foreach collection ="orderDetails" item="orderDetail" separator =","> |
| | |
| | | #{orderDetail.bendRadius}, |
| | | #{orderDetail.edgingType}, |
| | | #{orderDetail.weight}, |
| | | #{orderDetail.perimeter} |
| | | #{orderDetail.perimeter}, |
| | | #{orderDetail.otherColumns} |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | |
| | | |
| | | <select id="getSelectShippingOrderDetailDeliveryPrinting" > |
| | | select |
| | | d.delivery_id,d.quantity,d.money,d.area, |
| | | d.delivery_id,d.quantity,d.money,d.area,d.project, |
| | | d.customer_id,d.customer_name,d.project,d.pay_method,d.pay_date,d.contacts,d.contact_number, |
| | | d.delivery_address,d.remarks,d.create_time,d.delivery_date,d.creator,d.salesman,d.salesman_id |
| | | from sd.delivery d |
| | |
| | | bend_radius, |
| | | edging_type, |
| | | weight, |
| | | perimeter |
| | | perimeter, |
| | | other_columns |
| | | ) |
| | | values |
| | | <foreach collection ="orderDetails" item="orderDetail" separator =","> |
| | |
| | | #{orderDetail.bendRadius}, |
| | | #{orderDetail.edgingType}, |
| | | #{orderDetail.weight}, |
| | | #{orderDetail.perimeter} |
| | | #{orderDetail.perimeter}, |
| | | #{orderDetail.otherColumns} |
| | | ) |
| | | </foreach> |
| | | </insert> |