parent
43200f64b4
commit
a1aff53bf3
9 changed files with 1065 additions and 1054 deletions
@ -1,465 +1,465 @@ |
||||
<template> |
||||
<a-card :bordered="false"> |
||||
<!-- 查询区域 --> |
||||
<div class="table-page-search-wrapper"> |
||||
<a-form layout="inline" @keyup.enter.native="searchQuery"> |
||||
<a-row :gutter="24"> |
||||
<!--<a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||
<!--<a-form-item label="是否子单">--> |
||||
<!--<j-dict-select-tag placeholder="请选择是否子单" v-model="queryParam.ischild" dictCode="ischild"/>--> |
||||
<!--</a-form-item>--> |
||||
<!--</a-col>--> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="订单编号"> |
||||
<a-input placeholder="请输入订单编号" v-model="queryParam.ordersNum"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="订单类型"> |
||||
<j-dict-select-tag placeholder="请选择订单类型" v-model="queryParam.ordersType" dictCode="orders_type"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<!--<a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||
<!--<a-form-item label="支付方式">--> |
||||
<!--<j-dict-select-tag placeholder="请选择支付方式" v-model="queryParam.paymentMethod" dictCode="payment_method"/>--> |
||||
<!--</a-form-item>--> |
||||
<!--</a-col>--> |
||||
<!--<a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||
<!--<a-form-item label="支付状态">--> |
||||
<!--<j-dict-select-tag placeholder="请选择支付状态" v-model="queryParam.paymentStatus" dictCode="payment_status"/>--> |
||||
<!--</a-form-item>--> |
||||
<!--</a-col>--> |
||||
<!--<a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||
<!--<a-form-item label="账号/卡号">--> |
||||
<!--<a-input placeholder="请输入账号/卡号" v-model="queryParam.accountNo"></a-input>--> |
||||
<!--</a-form-item>--> |
||||
<!--</a-col>--> |
||||
<!--<a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||
<!--<a-form-item label="城市">--> |
||||
<!--<j-area-linkage type="cascader" v-model="queryParam.cityId" placeholder="请选择省市区"/>--> |
||||
<!--</a-form-item>--> |
||||
<!--</a-col>--> |
||||
<!--<a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||
<!--<a-form-item label="发票客户类型">--> |
||||
<!--<j-dict-select-tag placeholder="请选择发票客户类型" v-model="queryParam.invoiceCustomerType" dictCode="invoice_customer_type"/>--> |
||||
<!--</a-form-item>--> |
||||
<!--</a-col>--> |
||||
<!--<a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||
<!--<a-form-item label="发票类型">--> |
||||
<!--<j-dict-select-tag placeholder="请选择发票类型" v-model="queryParam.invoiceType" dictCode="invoice_type"/>--> |
||||
<!--</a-form-item>--> |
||||
<!--</a-col>--> |
||||
<!--<a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||
<!--<a-form-item label="公户账号">--> |
||||
<!--<a-input placeholder="请输入公户账号" v-model="queryParam.accountNumber"></a-input>--> |
||||
<!--</a-form-item>--> |
||||
<!--</a-col>--> |
||||
<!--<a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||
<!--<a-form-item label="物流企业">--> |
||||
<!--<j-select-depart placeholder="请选择物流企业" v-model="queryParam.logisticsEnterprisesId"/>--> |
||||
<!--</a-form-item>--> |
||||
<!--</a-col>--> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="交付状态"> |
||||
<j-dict-select-tag placeholder="请选择交付状态" v-model="queryParam.deliveryStatus" dictCode="delivery_status"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
||||
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button> |
||||
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> |
||||
</span> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form> |
||||
</div> |
||||
<!-- 查询区域-END --> |
||||
|
||||
<!-- 操作按钮区域 --> |
||||
<div class="table-operator"> |
||||
<!--<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>--> |
||||
<!--<a-button type="primary" icon="download" @click="handleExportXls('订单基本信息管理')">导出</a-button>--> |
||||
<!--<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">--> |
||||
<!--<a-button type="primary" icon="import">导入</a-button>--> |
||||
<!--</a-upload>--> |
||||
<!--<!– 高级查询区域 –>--> |
||||
<!--<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>--> |
||||
<!--<a-dropdown v-if="selectedRowKeys.length > 0">--> |
||||
<!--<a-menu slot="overlay">--> |
||||
<!--<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>--> |
||||
<!--</a-menu>--> |
||||
<!--<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>--> |
||||
<!--</a-dropdown>--> |
||||
</div> |
||||
|
||||
<!-- table区域-begin --> |
||||
<div> |
||||
<!--<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">--> |
||||
<!--<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项--> |
||||
<!--<a style="margin-left: 24px" @click="onClearSelected">清空</a>--> |
||||
<!--</div>--> |
||||
|
||||
<a-table |
||||
ref="table" |
||||
size="middle" |
||||
:scroll="{x:true}" |
||||
bordered |
||||
rowKey="id" |
||||
:columns="columns" |
||||
:dataSource="dataSource" |
||||
:pagination="ipagination" |
||||
:loading="loading" |
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
||||
class="j-table-force-nowrap" |
||||
@change="handleTableChange"> |
||||
|
||||
<template slot="htmlSlot" slot-scope="text"> |
||||
<div v-html="text"></div> |
||||
</template> |
||||
<template slot="imgSlot" slot-scope="text"> |
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> |
||||
<img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> |
||||
</template> |
||||
<template slot="pcaSlot" slot-scope="text"> |
||||
<div>{{ getPcaText(text) }}</div> |
||||
</template> |
||||
<template slot="fileSlot" slot-scope="text"> |
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> |
||||
<a-button |
||||
v-else |
||||
:ghost="true" |
||||
type="primary" |
||||
icon="download" |
||||
size="small" |
||||
@click="downloadFile(text)"> |
||||
下载 |
||||
</a-button> |
||||
</template> |
||||
|
||||
<span slot="action" slot-scope="text, record"> |
||||
<a v-if="record.deliveryStatus==2" @click="paidan(record)">派单</a> |
||||
<a-divider v-if="record.deliveryStatus==2" type="vertical" /> |
||||
|
||||
<!--<a @click="handleEdit(record)">编辑</a>--> |
||||
<!--<a-divider type="vertical" />--> |
||||
|
||||
<a @click="handleDetail(record)">详情</a> |
||||
<a-divider type="vertical" /> |
||||
|
||||
<!--<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">--> |
||||
<!--<a>删除</a>--> |
||||
<!--</a-popconfirm>--> |
||||
</span> |
||||
|
||||
</a-table> |
||||
</div> |
||||
|
||||
<zy-orders-modal ref="modalForm" @ok="modalFormOk"></zy-orders-modal> |
||||
<j-select-production-dep ref="productionForm" @ok="paidanFormOk"/> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import { mixinDevice } from '@/utils/mixin' |
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||
import ZyOrdersModal from '@/views/zyorders/modules/ZyOrdersModal' |
||||
import JSelectProductionDep from './workdep/JSelectProductionDep' |
||||
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
||||
import Area from '@/components/_util/Area' |
||||
import { httpAction, getAction } from '@/api/manage' |
||||
|
||||
export default { |
||||
name: 'ZyProductionOrderList', |
||||
mixins:[JeecgListMixin, mixinDevice], |
||||
components: { |
||||
ZyOrdersModal, |
||||
JSelectProductionDep |
||||
}, |
||||
data () { |
||||
return { |
||||
description: '派单订单基本信息管理页面', |
||||
// 表头 |
||||
columns: [ |
||||
{ |
||||
title: '#', |
||||
dataIndex: '', |
||||
key:'rowIndex', |
||||
width:60, |
||||
align:"center", |
||||
customRender:function (t,r,index) { |
||||
return parseInt(index)+1; |
||||
} |
||||
}, |
||||
// { |
||||
// title:'是否子单', |
||||
// align:"center", |
||||
// dataIndex: 'ischild_dictText' |
||||
// }, |
||||
{ |
||||
title:'订单编号', |
||||
align:"center", |
||||
dataIndex: 'ordersNum' |
||||
}, |
||||
{ |
||||
title:'下单时间', |
||||
align:"center", |
||||
dataIndex: 'orderTime', |
||||
customRender:function (text) { |
||||
return !text?"":(text.length>10?text.substr(0,10):text) |
||||
} |
||||
}, |
||||
// { |
||||
// title:'总金额(元)', |
||||
// align:"center", |
||||
// dataIndex: 'money' |
||||
// }, |
||||
// { |
||||
// title:'运费', |
||||
// align:"center", |
||||
// dataIndex: 'freight' |
||||
// }, |
||||
// { |
||||
// title:'促销', |
||||
// align:"center", |
||||
// dataIndex: 'promotionPrice' |
||||
// }, |
||||
// { |
||||
// title:'实付款', |
||||
// align:"center", |
||||
// dataIndex: 'actualPayment' |
||||
// }, |
||||
{ |
||||
title:'交货期(天)', |
||||
align:"center", |
||||
dataIndex: 'deliveryTime' |
||||
}, |
||||
{ |
||||
title:'订单类型', |
||||
align:"center", |
||||
dataIndex: 'ordersType_dictText' |
||||
}, |
||||
{ |
||||
title:'客户', |
||||
align:"center", |
||||
dataIndex: 'userId_dictText' |
||||
}, |
||||
// { |
||||
// title:'商品条目数量', |
||||
// align:"center", |
||||
// dataIndex: 'goodsQuantity' |
||||
// }, |
||||
// { |
||||
// title:'支付方式', |
||||
// align:"center", |
||||
// dataIndex: 'paymentMethod_dictText' |
||||
// }, |
||||
{ |
||||
title:'支付状态', |
||||
align:"center", |
||||
dataIndex: 'paymentStatus_dictText' |
||||
}, |
||||
// { |
||||
// title:'账号/卡号', |
||||
// align:"center", |
||||
// dataIndex: 'accountNo' |
||||
// }, |
||||
// { |
||||
// title:'开户银行', |
||||
// align:"center", |
||||
// dataIndex: 'bankDeposit' |
||||
// }, |
||||
// { |
||||
// title:'支付时间', |
||||
// align:"center", |
||||
// dataIndex: 'paymentTime', |
||||
// customRender:function (text) { |
||||
// return !text?"":(text.length>10?text.substr(0,10):text) |
||||
// } |
||||
// }, |
||||
// { |
||||
// title:'城市', |
||||
// align:"center", |
||||
// dataIndex: 'cityId', |
||||
// scopedSlots: {customRender: 'pcaSlot'} |
||||
// }, |
||||
// { |
||||
// title:'地址', |
||||
// align:"center", |
||||
// dataIndex: 'address' |
||||
// }, |
||||
// { |
||||
// title:'邮编', |
||||
// align:"center", |
||||
// dataIndex: 'zipCode' |
||||
// }, |
||||
{ |
||||
title:'收货人', |
||||
align:"center", |
||||
dataIndex: 'receiver_dictText' |
||||
}, |
||||
{ |
||||
title:'联系电话', |
||||
align:"center", |
||||
dataIndex: 'mobile' |
||||
}, |
||||
// { |
||||
// title:'发票客户类型', |
||||
// align:"center", |
||||
// dataIndex: 'invoiceCustomerType_dictText' |
||||
// }, |
||||
// { |
||||
// title:'发票类型', |
||||
// align:"center", |
||||
// dataIndex: 'invoiceType_dictText' |
||||
// }, |
||||
// { |
||||
// title:'纳税人识别号', |
||||
// align:"center", |
||||
// dataIndex: 'taxIdentificationNumber' |
||||
// }, |
||||
// { |
||||
// title:'开票地址', |
||||
// align:"center", |
||||
// dataIndex: 'addressBilling' |
||||
// }, |
||||
// { |
||||
// title:'电话', |
||||
// align:"center", |
||||
// dataIndex: 'telephone' |
||||
// }, |
||||
// { |
||||
// title:'公户开户行', |
||||
// align:"center", |
||||
// dataIndex: 'bankPublic' |
||||
// }, |
||||
// { |
||||
// title:'公户账号', |
||||
// align:"center", |
||||
// dataIndex: 'accountNumber' |
||||
// }, |
||||
{ |
||||
title:'销售门店', |
||||
align:"center", |
||||
dataIndex: 'salesEnterpriseId_dictText' |
||||
}, |
||||
{ |
||||
title:'销售员', |
||||
align:"center", |
||||
dataIndex: 'salespersonId_dictText' |
||||
}, |
||||
// { |
||||
// title:'物流企业', |
||||
// align:"center", |
||||
// dataIndex: 'logisticsEnterprisesId_dictText' |
||||
// }, |
||||
{ |
||||
title:'交付状态', |
||||
align:"center", |
||||
dataIndex: 'deliveryStatus_dictText' |
||||
}, |
||||
{ |
||||
title: '操作', |
||||
dataIndex: 'action', |
||||
align:"center", |
||||
fixed:"right", |
||||
width:147, |
||||
scopedSlots: { customRender: 'action' } |
||||
} |
||||
], |
||||
url: { |
||||
list: "/workOrder/workOrder/productionlist", |
||||
delete: "/zyorders/zyOrders/delete", |
||||
deleteBatch: "/zyorders/zyOrders/deleteBatch", |
||||
exportXlsUrl: "/zyorders/zyOrders/exportXls", |
||||
importExcelUrl: "zyorders/zyOrders/importExcel", |
||||
paidan:"/workOrder/workOrder/paidan", |
||||
|
||||
}, |
||||
dictOptions:{}, |
||||
pcaData:'', |
||||
superFieldList:[], |
||||
} |
||||
}, |
||||
created() { |
||||
this.pcaData = new Area() |
||||
this.getSuperFieldList(); |
||||
}, |
||||
computed: { |
||||
importExcelUrl: function(){ |
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
||||
}, |
||||
}, |
||||
methods: { |
||||
paidan(record){ |
||||
this.$refs.productionForm.showModal(record.id,record.ordersNum+"订单派单管理") |
||||
|
||||
// getAction(this.url.paidan,{id:record.id}).then((res) => { |
||||
// if (res.success) { |
||||
// this.$message.success("派单成功!"); |
||||
// this.loadData(); |
||||
// }else{ |
||||
// this.$message.error(res.message); |
||||
// } |
||||
// }) |
||||
}, |
||||
paidanFormOk(orderId,depId) { |
||||
// 新增/修改 成功时,重载列表 |
||||
getAction(this.url.paidan,{'orderId':orderId,'depId':depId}).then((res) => { |
||||
if (res.success) { |
||||
this.$message.success("派单成功!"); |
||||
this.loadData(); |
||||
}else{ |
||||
this.$message.error(res.message); |
||||
} |
||||
}) |
||||
}, |
||||
getPcaText(code){ |
||||
return this.pcaData.getText(code); |
||||
}, |
||||
initDictConfig(){ |
||||
}, |
||||
getSuperFieldList(){ |
||||
let fieldList=[]; |
||||
fieldList.push({type:'int',value:'ischild',text:'是否子单',dictCode:'ischild'}) |
||||
fieldList.push({type:'string',value:'orderId',text:'原订单',dictCode:'zy_orders,orders_num,id'}) |
||||
fieldList.push({type:'date',value:'orderTime',text:'下单时间'}) |
||||
fieldList.push({type:'string',value:'ordersNum',text:'订单编号',dictCode:''}) |
||||
fieldList.push({type:'double',value:'money',text:'总金额',dictCode:''}) |
||||
fieldList.push({type:'double',value:'freight',text:'运费',dictCode:''}) |
||||
fieldList.push({type:'double',value:'promotionPrice',text:'促销',dictCode:''}) |
||||
fieldList.push({type:'double',value:'actualPayment',text:'实付款',dictCode:''}) |
||||
fieldList.push({type:'int',value:'deliveryTime',text:'交货期',dictCode:''}) |
||||
fieldList.push({type:'int',value:'ordersType',text:'订单类型',dictCode:'orders_type'}) |
||||
fieldList.push({type:'sel_user',value:'userId',text:'顾客'}) |
||||
fieldList.push({type:'int',value:'goodsQuantity',text:'商品条目数量',dictCode:''}) |
||||
fieldList.push({type:'int',value:'paymentMethod',text:'支付方式',dictCode:'payment_method'}) |
||||
fieldList.push({type:'int',value:'paymentStatus',text:'支付状态',dictCode:'payment_status'}) |
||||
fieldList.push({type:'string',value:'accountNo',text:'账号/卡号',dictCode:''}) |
||||
fieldList.push({type:'string',value:'bankDeposit',text:'开户银行',dictCode:''}) |
||||
fieldList.push({type:'date',value:'paymentTime',text:'支付时间'}) |
||||
fieldList.push({type:'pca',value:'cityId',text:'城市'}) |
||||
fieldList.push({type:'string',value:'address',text:'地址',dictCode:''}) |
||||
fieldList.push({type:'string',value:'zipCode',text:'邮编',dictCode:''}) |
||||
fieldList.push({type:'sel_user',value:'receiver',text:'收货人'}) |
||||
fieldList.push({type:'string',value:'mobile',text:'联系电话',dictCode:''}) |
||||
fieldList.push({type:'int',value:'invoiceCustomerType',text:'发票客户类型',dictCode:'invoice_customer_type'}) |
||||
fieldList.push({type:'int',value:'invoiceType',text:'发票类型',dictCode:'invoice_type'}) |
||||
fieldList.push({type:'string',value:'taxIdentificationNumber',text:'纳税人识别号',dictCode:''}) |
||||
fieldList.push({type:'string',value:'addressBilling',text:'开票地址',dictCode:''}) |
||||
fieldList.push({type:'string',value:'telephone',text:'电话',dictCode:''}) |
||||
fieldList.push({type:'string',value:'bankPublic',text:'公户开户行',dictCode:''}) |
||||
fieldList.push({type:'string',value:'accountNumber',text:'公户账号',dictCode:''}) |
||||
fieldList.push({type:'sel_depart',value:'salesEnterpriseId',text:'销售门店'}) |
||||
fieldList.push({type:'sel_user',value:'salespersonId',text:'销售员'}) |
||||
fieldList.push({type:'sel_depart',value:'logisticsEnterprisesId',text:'物流企业'}) |
||||
fieldList.push({type:'int',value:'deliveryStatus',text:'交付状态',dictCode:'delivery_status'}) |
||||
this.superFieldList = fieldList |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style scoped> |
||||
@import '~@assets/less/common.less'; |
||||
<template> |
||||
<a-card :bordered="false"> |
||||
<!-- 查询区域 --> |
||||
<div class="table-page-search-wrapper"> |
||||
<a-form layout="inline" @keyup.enter.native="searchQuery"> |
||||
<a-row :gutter="24"> |
||||
<!--<a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||
<!--<a-form-item label="是否子单">--> |
||||
<!--<j-dict-select-tag placeholder="请选择是否子单" v-model="queryParam.ischild" dictCode="ischild"/>--> |
||||
<!--</a-form-item>--> |
||||
<!--</a-col>--> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="订单编号"> |
||||
<a-input placeholder="请输入订单编号" v-model="queryParam.ordersNum"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="订单类型"> |
||||
<j-dict-select-tag placeholder="请选择订单类型" v-model="queryParam.ordersType" dictCode="orders_type"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<!--<a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||
<!--<a-form-item label="支付方式">--> |
||||
<!--<j-dict-select-tag placeholder="请选择支付方式" v-model="queryParam.paymentMethod" dictCode="payment_method"/>--> |
||||
<!--</a-form-item>--> |
||||
<!--</a-col>--> |
||||
<!--<a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||
<!--<a-form-item label="支付状态">--> |
||||
<!--<j-dict-select-tag placeholder="请选择支付状态" v-model="queryParam.paymentStatus" dictCode="payment_status"/>--> |
||||
<!--</a-form-item>--> |
||||
<!--</a-col>--> |
||||
<!--<a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||
<!--<a-form-item label="账号/卡号">--> |
||||
<!--<a-input placeholder="请输入账号/卡号" v-model="queryParam.accountNo"></a-input>--> |
||||
<!--</a-form-item>--> |
||||
<!--</a-col>--> |
||||
<!--<a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||
<!--<a-form-item label="城市">--> |
||||
<!--<j-area-linkage type="cascader" v-model="queryParam.cityId" placeholder="请选择省市区"/>--> |
||||
<!--</a-form-item>--> |
||||
<!--</a-col>--> |
||||
<!--<a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||
<!--<a-form-item label="发票客户类型">--> |
||||
<!--<j-dict-select-tag placeholder="请选择发票客户类型" v-model="queryParam.invoiceCustomerType" dictCode="invoice_customer_type"/>--> |
||||
<!--</a-form-item>--> |
||||
<!--</a-col>--> |
||||
<!--<a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||
<!--<a-form-item label="发票类型">--> |
||||
<!--<j-dict-select-tag placeholder="请选择发票类型" v-model="queryParam.invoiceType" dictCode="invoice_type"/>--> |
||||
<!--</a-form-item>--> |
||||
<!--</a-col>--> |
||||
<!--<a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||
<!--<a-form-item label="公户账号">--> |
||||
<!--<a-input placeholder="请输入公户账号" v-model="queryParam.accountNumber"></a-input>--> |
||||
<!--</a-form-item>--> |
||||
<!--</a-col>--> |
||||
<!--<a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||
<!--<a-form-item label="物流企业">--> |
||||
<!--<j-select-depart placeholder="请选择物流企业" v-model="queryParam.logisticsEnterprisesId"/>--> |
||||
<!--</a-form-item>--> |
||||
<!--</a-col>--> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="交付状态"> |
||||
<j-dict-select-tag placeholder="请选择交付状态" v-model="queryParam.deliveryStatus" dictCode="delivery_status"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
||||
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button> |
||||
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> |
||||
</span> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form> |
||||
</div> |
||||
<!-- 查询区域-END --> |
||||
|
||||
<!-- 操作按钮区域 --> |
||||
<div class="table-operator"> |
||||
<!--<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>--> |
||||
<!--<a-button type="primary" icon="download" @click="handleExportXls('订单基本信息管理')">导出</a-button>--> |
||||
<!--<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">--> |
||||
<!--<a-button type="primary" icon="import">导入</a-button>--> |
||||
<!--</a-upload>--> |
||||
<!--<!– 高级查询区域 –>--> |
||||
<!--<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>--> |
||||
<!--<a-dropdown v-if="selectedRowKeys.length > 0">--> |
||||
<!--<a-menu slot="overlay">--> |
||||
<!--<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>--> |
||||
<!--</a-menu>--> |
||||
<!--<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>--> |
||||
<!--</a-dropdown>--> |
||||
</div> |
||||
|
||||
<!-- table区域-begin --> |
||||
<div> |
||||
<!--<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">--> |
||||
<!--<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项--> |
||||
<!--<a style="margin-left: 24px" @click="onClearSelected">清空</a>--> |
||||
<!--</div>--> |
||||
|
||||
<a-table |
||||
ref="table" |
||||
size="middle" |
||||
:scroll="{x:true}" |
||||
bordered |
||||
rowKey="id" |
||||
:columns="columns" |
||||
:dataSource="dataSource" |
||||
:pagination="ipagination" |
||||
:loading="loading" |
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
||||
class="j-table-force-nowrap" |
||||
@change="handleTableChange"> |
||||
|
||||
<template slot="htmlSlot" slot-scope="text"> |
||||
<div v-html="text"></div> |
||||
</template> |
||||
<template slot="imgSlot" slot-scope="text"> |
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> |
||||
<img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> |
||||
</template> |
||||
<template slot="pcaSlot" slot-scope="text"> |
||||
<div>{{ getPcaText(text) }}</div> |
||||
</template> |
||||
<template slot="fileSlot" slot-scope="text"> |
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> |
||||
<a-button |
||||
v-else |
||||
:ghost="true" |
||||
type="primary" |
||||
icon="download" |
||||
size="small" |
||||
@click="downloadFile(text)"> |
||||
下载 |
||||
</a-button> |
||||
</template> |
||||
|
||||
<span slot="action" slot-scope="text, record"> |
||||
<a v-if="record.deliveryStatus==2" @click="paidan(record)">派单</a> |
||||
<a-divider v-if="record.deliveryStatus==2" type="vertical" /> |
||||
|
||||
<!--<a @click="handleEdit(record)">编辑</a>--> |
||||
<!--<a-divider type="vertical" />--> |
||||
|
||||
<a @click="handleDetail(record)">详情</a> |
||||
<a-divider type="vertical" /> |
||||
|
||||
<!--<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">--> |
||||
<!--<a>删除</a>--> |
||||
<!--</a-popconfirm>--> |
||||
</span> |
||||
|
||||
</a-table> |
||||
</div> |
||||
|
||||
<zy-orders-modal ref="modalForm" @ok="modalFormOk"></zy-orders-modal> |
||||
<j-select-production-dep ref="productionForm" @ok="paidanFormOk"/> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import { mixinDevice } from '@/utils/mixin' |
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||
import ZyOrdersModal from '@/views/zyorders/modules/ZyOrdersModal' |
||||
import JSelectProductionDep from './workdep/JSelectProductionDep' |
||||
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
||||
import Area from '@/components/_util/Area' |
||||
import { httpAction, getAction } from '@/api/manage' |
||||
|
||||
export default { |
||||
name: 'ZyProductionOrderList', |
||||
mixins:[JeecgListMixin, mixinDevice], |
||||
components: { |
||||
ZyOrdersModal, |
||||
JSelectProductionDep |
||||
}, |
||||
data () { |
||||
return { |
||||
description: '派单订单基本信息管理页面', |
||||
// 表头 |
||||
columns: [ |
||||
{ |
||||
title: '#', |
||||
dataIndex: '', |
||||
key:'rowIndex', |
||||
width:60, |
||||
align:"center", |
||||
customRender:function (t,r,index) { |
||||
return parseInt(index)+1; |
||||
} |
||||
}, |
||||
// { |
||||
// title:'是否子单', |
||||
// align:"center", |
||||
// dataIndex: 'ischild_dictText' |
||||
// }, |
||||
{ |
||||
title:'订单编号', |
||||
align:"center", |
||||
dataIndex: 'ordersNum' |
||||
}, |
||||
{ |
||||
title:'下单时间', |
||||
align:"center", |
||||
dataIndex: 'orderTime', |
||||
customRender:function (text) { |
||||
return !text?"":(text.length>10?text.substr(0,10):text) |
||||
} |
||||
}, |
||||
// { |
||||
// title:'总金额(元)', |
||||
// align:"center", |
||||
// dataIndex: 'money' |
||||
// }, |
||||
// { |
||||
// title:'运费', |
||||
// align:"center", |
||||
// dataIndex: 'freight' |
||||
// }, |
||||
// { |
||||
// title:'促销', |
||||
// align:"center", |
||||
// dataIndex: 'promotionPrice' |
||||
// }, |
||||
// { |
||||
// title:'实付款', |
||||
// align:"center", |
||||
// dataIndex: 'actualPayment' |
||||
// }, |
||||
{ |
||||
title:'交货期(天)', |
||||
align:"center", |
||||
dataIndex: 'deliveryTime' |
||||
}, |
||||
{ |
||||
title:'订单类型', |
||||
align:"center", |
||||
dataIndex: 'ordersType_dictText' |
||||
}, |
||||
{ |
||||
title:'客户', |
||||
align:"center", |
||||
dataIndex: 'userId_dictText' |
||||
}, |
||||
// { |
||||
// title:'商品条目数量', |
||||
// align:"center", |
||||
// dataIndex: 'goodsQuantity' |
||||
// }, |
||||
// { |
||||
// title:'支付方式', |
||||
// align:"center", |
||||
// dataIndex: 'paymentMethod_dictText' |
||||
// }, |
||||
{ |
||||
title:'支付状态', |
||||
align:"center", |
||||
dataIndex: 'paymentStatus_dictText' |
||||
}, |
||||
// { |
||||
// title:'账号/卡号', |
||||
// align:"center", |
||||
// dataIndex: 'accountNo' |
||||
// }, |
||||
// { |
||||
// title:'开户银行', |
||||
// align:"center", |
||||
// dataIndex: 'bankDeposit' |
||||
// }, |
||||
// { |
||||
// title:'支付时间', |
||||
// align:"center", |
||||
// dataIndex: 'paymentTime', |
||||
// customRender:function (text) { |
||||
// return !text?"":(text.length>10?text.substr(0,10):text) |
||||
// } |
||||
// }, |
||||
// { |
||||
// title:'城市', |
||||
// align:"center", |
||||
// dataIndex: 'cityId', |
||||
// scopedSlots: {customRender: 'pcaSlot'} |
||||
// }, |
||||
// { |
||||
// title:'地址', |
||||
// align:"center", |
||||
// dataIndex: 'address' |
||||
// }, |
||||
// { |
||||
// title:'邮编', |
||||
// align:"center", |
||||
// dataIndex: 'zipCode' |
||||
// }, |
||||
// { |
||||
// title:'收货人', |
||||
// align:"center", |
||||
// dataIndex: 'receiver_dictText' |
||||
// }, |
||||
// { |
||||
// title:'联系电话', |
||||
// align:"center", |
||||
// dataIndex: 'mobile' |
||||
// }, |
||||
// { |
||||
// title:'发票客户类型', |
||||
// align:"center", |
||||
// dataIndex: 'invoiceCustomerType_dictText' |
||||
// }, |
||||
// { |
||||
// title:'发票类型', |
||||
// align:"center", |
||||
// dataIndex: 'invoiceType_dictText' |
||||
// }, |
||||
// { |
||||
// title:'纳税人识别号', |
||||
// align:"center", |
||||
// dataIndex: 'taxIdentificationNumber' |
||||
// }, |
||||
// { |
||||
// title:'开票地址', |
||||
// align:"center", |
||||
// dataIndex: 'addressBilling' |
||||
// }, |
||||
// { |
||||
// title:'电话', |
||||
// align:"center", |
||||
// dataIndex: 'telephone' |
||||
// }, |
||||
// { |
||||
// title:'公户开户行', |
||||
// align:"center", |
||||
// dataIndex: 'bankPublic' |
||||
// }, |
||||
// { |
||||
// title:'公户账号', |
||||
// align:"center", |
||||
// dataIndex: 'accountNumber' |
||||
// }, |
||||
{ |
||||
title:'销售门店', |
||||
align:"center", |
||||
dataIndex: 'salesEnterpriseId_dictText' |
||||
}, |
||||
// { |
||||
// title:'销售员', |
||||
// align:"center", |
||||
// dataIndex: 'salespersonId_dictText' |
||||
// }, |
||||
// { |
||||
// title:'物流企业', |
||||
// align:"center", |
||||
// dataIndex: 'logisticsEnterprisesId_dictText' |
||||
// }, |
||||
{ |
||||
title:'交付状态', |
||||
align:"center", |
||||
dataIndex: 'deliveryStatus_dictText' |
||||
}, |
||||
{ |
||||
title: '操作', |
||||
dataIndex: 'action', |
||||
align:"center", |
||||
fixed:"right", |
||||
width:147, |
||||
scopedSlots: { customRender: 'action' } |
||||
} |
||||
], |
||||
url: { |
||||
list: "/workOrder/workOrder/productionlist", |
||||
delete: "/zyorders/zyOrders/delete", |
||||
deleteBatch: "/zyorders/zyOrders/deleteBatch", |
||||
exportXlsUrl: "/zyorders/zyOrders/exportXls", |
||||
importExcelUrl: "zyorders/zyOrders/importExcel", |
||||
paidan:"/workOrder/workOrder/paidan", |
||||
|
||||
}, |
||||
dictOptions:{}, |
||||
pcaData:'', |
||||
superFieldList:[], |
||||
} |
||||
}, |
||||
created() { |
||||
this.pcaData = new Area() |
||||
this.getSuperFieldList(); |
||||
}, |
||||
computed: { |
||||
importExcelUrl: function(){ |
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
||||
}, |
||||
}, |
||||
methods: { |
||||
paidan(record){ |
||||
this.$refs.productionForm.showModal(record.id,record.ordersNum+"订单派单管理") |
||||
|
||||
// getAction(this.url.paidan,{id:record.id}).then((res) => { |
||||
// if (res.success) { |
||||
// this.$message.success("派单成功!"); |
||||
// this.loadData(); |
||||
// }else{ |
||||
// this.$message.error(res.message); |
||||
// } |
||||
// }) |
||||
}, |
||||
paidanFormOk(orderId,depId) { |
||||
// 新增/修改 成功时,重载列表 |
||||
getAction(this.url.paidan,{'orderId':orderId,'depId':depId}).then((res) => { |
||||
if (res.success) { |
||||
this.$message.success("派单成功!"); |
||||
this.loadData(); |
||||
}else{ |
||||
this.$message.error(res.message); |
||||
} |
||||
}) |
||||
}, |
||||
getPcaText(code){ |
||||
return this.pcaData.getText(code); |
||||
}, |
||||
initDictConfig(){ |
||||
}, |
||||
getSuperFieldList(){ |
||||
let fieldList=[]; |
||||
fieldList.push({type:'int',value:'ischild',text:'是否子单',dictCode:'ischild'}) |
||||
fieldList.push({type:'string',value:'orderId',text:'原订单',dictCode:'zy_orders,orders_num,id'}) |
||||
fieldList.push({type:'date',value:'orderTime',text:'下单时间'}) |
||||
fieldList.push({type:'string',value:'ordersNum',text:'订单编号',dictCode:''}) |
||||
fieldList.push({type:'double',value:'money',text:'总金额',dictCode:''}) |
||||
fieldList.push({type:'double',value:'freight',text:'运费',dictCode:''}) |
||||
fieldList.push({type:'double',value:'promotionPrice',text:'促销',dictCode:''}) |
||||
fieldList.push({type:'double',value:'actualPayment',text:'实付款',dictCode:''}) |
||||
fieldList.push({type:'int',value:'deliveryTime',text:'交货期',dictCode:''}) |
||||
fieldList.push({type:'int',value:'ordersType',text:'订单类型',dictCode:'orders_type'}) |
||||
fieldList.push({type:'sel_user',value:'userId',text:'顾客'}) |
||||
fieldList.push({type:'int',value:'goodsQuantity',text:'商品条目数量',dictCode:''}) |
||||
fieldList.push({type:'int',value:'paymentMethod',text:'支付方式',dictCode:'payment_method'}) |
||||
fieldList.push({type:'int',value:'paymentStatus',text:'支付状态',dictCode:'payment_status'}) |
||||
fieldList.push({type:'string',value:'accountNo',text:'账号/卡号',dictCode:''}) |
||||
fieldList.push({type:'string',value:'bankDeposit',text:'开户银行',dictCode:''}) |
||||
fieldList.push({type:'date',value:'paymentTime',text:'支付时间'}) |
||||
fieldList.push({type:'pca',value:'cityId',text:'城市'}) |
||||
fieldList.push({type:'string',value:'address',text:'地址',dictCode:''}) |
||||
fieldList.push({type:'string',value:'zipCode',text:'邮编',dictCode:''}) |
||||
fieldList.push({type:'sel_user',value:'receiver',text:'收货人'}) |
||||
fieldList.push({type:'string',value:'mobile',text:'联系电话',dictCode:''}) |
||||
fieldList.push({type:'int',value:'invoiceCustomerType',text:'发票客户类型',dictCode:'invoice_customer_type'}) |
||||
fieldList.push({type:'int',value:'invoiceType',text:'发票类型',dictCode:'invoice_type'}) |
||||
fieldList.push({type:'string',value:'taxIdentificationNumber',text:'纳税人识别号',dictCode:''}) |
||||
fieldList.push({type:'string',value:'addressBilling',text:'开票地址',dictCode:''}) |
||||
fieldList.push({type:'string',value:'telephone',text:'电话',dictCode:''}) |
||||
fieldList.push({type:'string',value:'bankPublic',text:'公户开户行',dictCode:''}) |
||||
fieldList.push({type:'string',value:'accountNumber',text:'公户账号',dictCode:''}) |
||||
fieldList.push({type:'sel_depart',value:'salesEnterpriseId',text:'销售门店'}) |
||||
fieldList.push({type:'sel_user',value:'salespersonId',text:'销售员'}) |
||||
fieldList.push({type:'sel_depart',value:'logisticsEnterprisesId',text:'物流企业'}) |
||||
fieldList.push({type:'int',value:'deliveryStatus',text:'交付状态',dictCode:'delivery_status'}) |
||||
this.superFieldList = fieldList |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style scoped> |
||||
@import '~@assets/less/common.less'; |
||||
</style> |
@ -1,206 +1,206 @@ |
||||
package org.jeecg.modules.demo.zyorders.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.util.Date; |
||||
import java.math.BigDecimal; |
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
import org.jeecgframework.poi.excel.annotation.Excel; |
||||
import org.jeecg.common.aspect.annotation.Dict; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
/** |
||||
* @Description: 订单基本信息管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-26 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("zy_orders") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="zy_orders对象", description="订单基本信息管理") |
||||
public class ZyOrders implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private java.lang.String id; |
||||
/**创建人*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
private java.lang.String createBy; |
||||
/**创建日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "创建日期") |
||||
private java.util.Date createTime; |
||||
/**更新人*/ |
||||
@ApiModelProperty(value = "更新人") |
||||
private java.lang.String updateBy; |
||||
/**更新日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "更新日期") |
||||
private java.util.Date updateTime; |
||||
/**所属部门*/ |
||||
@ApiModelProperty(value = "所属部门") |
||||
private java.lang.String sysOrgCode; |
||||
/**是否子单*/ |
||||
@Excel(name = "是否子单", width = 15, dicCode = "ischild") |
||||
@Dict(dicCode = "ischild") |
||||
@ApiModelProperty(value = "是否子单") |
||||
private java.lang.Integer ischild; |
||||
/**原订单id*/ |
||||
@Excel(name = "原订单id", width = 15) |
||||
@Dict(dictTable = "zy_orders", dicText = "orders_num", dicCode = "id") |
||||
@ApiModelProperty(value = "原订单id") |
||||
private java.lang.String orderId; |
||||
/**下单时间*/ |
||||
@Excel(name = "下单时间", width = 15, format = "yyyy-MM-dd") |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd") |
||||
@ApiModelProperty(value = "下单时间") |
||||
private java.util.Date orderTime; |
||||
/**订单编号*/ |
||||
@Excel(name = "订单编号", width = 15) |
||||
@ApiModelProperty(value = "订单编号") |
||||
private java.lang.String ordersNum; |
||||
/**总金额*/ |
||||
@Excel(name = "总金额", width = 15) |
||||
@ApiModelProperty(value = "总金额") |
||||
private java.lang.Double money; |
||||
/**运费*/ |
||||
@Excel(name = "运费", width = 15) |
||||
@ApiModelProperty(value = "运费") |
||||
private java.lang.Double freight; |
||||
/**促销*/ |
||||
@Excel(name = "促销", width = 15) |
||||
@ApiModelProperty(value = "促销") |
||||
private java.lang.Double promotionPrice; |
||||
/**实付款*/ |
||||
@Excel(name = "实付款", width = 15) |
||||
@ApiModelProperty(value = "实付款") |
||||
private java.lang.Double actualPayment; |
||||
/**交货期*/ |
||||
@Excel(name = "交货期", width = 15) |
||||
@ApiModelProperty(value = "交货期") |
||||
private java.lang.Integer deliveryTime; |
||||
/**订单类型*/ |
||||
@Excel(name = "订单类型", width = 15, dicCode = "orders_type") |
||||
@Dict(dicCode = "orders_type") |
||||
@ApiModelProperty(value = "订单类型") |
||||
private java.lang.Integer ordersType; |
||||
/**顾客id*/ |
||||
@Excel(name = "顾客id", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") |
||||
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") |
||||
@ApiModelProperty(value = "顾客id") |
||||
private java.lang.String userId; |
||||
/**商品条目数量*/ |
||||
@Excel(name = "商品条目数量", width = 15) |
||||
@ApiModelProperty(value = "商品条目数量") |
||||
private java.lang.Integer goodsQuantity; |
||||
/**支付方式*/ |
||||
@Excel(name = "支付方式", width = 15, dicCode = "payment_method") |
||||
@Dict(dicCode = "payment_method") |
||||
@ApiModelProperty(value = "支付方式") |
||||
private java.lang.Integer paymentMethod; |
||||
/**支付状态*/ |
||||
@Excel(name = "支付状态", width = 15, dicCode = "payment_status") |
||||
@Dict(dicCode = "payment_status") |
||||
@ApiModelProperty(value = "支付状态") |
||||
private java.lang.Integer paymentStatus; |
||||
/**账号/卡号*/ |
||||
@Excel(name = "账号/卡号", width = 15) |
||||
@ApiModelProperty(value = "账号/卡号") |
||||
private java.lang.String accountNo; |
||||
/**开户银行*/ |
||||
@Excel(name = "开户银行", width = 15) |
||||
@ApiModelProperty(value = "开户银行") |
||||
private java.lang.String bankDeposit; |
||||
/**支付时间*/ |
||||
@Excel(name = "支付时间", width = 15, format = "yyyy-MM-dd") |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd") |
||||
@ApiModelProperty(value = "支付时间") |
||||
private java.util.Date paymentTime; |
||||
/**城市*/ |
||||
@Excel(name = "城市", width = 15) |
||||
@ApiModelProperty(value = "城市") |
||||
private java.lang.String cityId; |
||||
/**地址*/ |
||||
@Excel(name = "地址", width = 15) |
||||
@ApiModelProperty(value = "地址") |
||||
private java.lang.String address; |
||||
/**邮编*/ |
||||
@Excel(name = "邮编", width = 15) |
||||
@ApiModelProperty(value = "邮编") |
||||
private java.lang.String zipCode; |
||||
/**收货人*/ |
||||
@Excel(name = "收货人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") |
||||
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") |
||||
@ApiModelProperty(value = "收货人") |
||||
private java.lang.String receiver; |
||||
/**联系电话*/ |
||||
@Excel(name = "联系电话", width = 15) |
||||
@ApiModelProperty(value = "联系电话") |
||||
private java.lang.String mobile; |
||||
/**发票客户类型*/ |
||||
@Excel(name = "发票客户类型", width = 15, dicCode = "invoice_customer_type") |
||||
@Dict(dicCode = "invoice_customer_type") |
||||
@ApiModelProperty(value = "发票客户类型") |
||||
private java.lang.Integer invoiceCustomerType; |
||||
/**发票类型*/ |
||||
@Excel(name = "发票类型", width = 15, dicCode = "invoice_type") |
||||
@Dict(dicCode = "invoice_type") |
||||
@ApiModelProperty(value = "发票类型") |
||||
private java.lang.Integer invoiceType; |
||||
/**纳税人识别号*/ |
||||
@Excel(name = "纳税人识别号", width = 15) |
||||
@ApiModelProperty(value = "纳税人识别号") |
||||
private java.lang.String taxIdentificationNumber; |
||||
/**开票地址*/ |
||||
@Excel(name = "开票地址", width = 15) |
||||
@ApiModelProperty(value = "开票地址") |
||||
private java.lang.String addressBilling; |
||||
/**电话*/ |
||||
@Excel(name = "电话", width = 15) |
||||
@ApiModelProperty(value = "电话") |
||||
private java.lang.String telephone; |
||||
/**公户开户行*/ |
||||
@Excel(name = "公户开户行", width = 15) |
||||
@ApiModelProperty(value = "公户开户行") |
||||
private java.lang.String bankPublic; |
||||
/**公户账号*/ |
||||
@Excel(name = "公户账号", width = 15) |
||||
@ApiModelProperty(value = "公户账号") |
||||
private java.lang.String accountNumber; |
||||
/**销售门店*/ |
||||
@Excel(name = "销售门店", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") |
||||
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") |
||||
@ApiModelProperty(value = "销售门店") |
||||
private java.lang.String salesEnterpriseId; |
||||
/**销售员*/ |
||||
@Excel(name = "销售员", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") |
||||
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") |
||||
@ApiModelProperty(value = "销售员") |
||||
private java.lang.String salespersonId; |
||||
/**物流企业*/ |
||||
@Excel(name = "物流企业", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") |
||||
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") |
||||
@ApiModelProperty(value = "物流企业") |
||||
private java.lang.String logisticsEnterprisesId; |
||||
/**交付状态*/ |
||||
@Excel(name = "交付状态", width = 15, dicCode = "delivery_status") |
||||
@Dict(dicCode = "delivery_status") |
||||
@ApiModelProperty(value = "交付状态") |
||||
private java.lang.Integer deliveryStatus; |
||||
} |
||||
package org.jeecg.modules.demo.zyorders.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.util.Date; |
||||
import java.math.BigDecimal; |
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
import org.jeecgframework.poi.excel.annotation.Excel; |
||||
import org.jeecg.common.aspect.annotation.Dict; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
/** |
||||
* @Description: 订单基本信息管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-26 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("zy_orders") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="zy_orders对象", description="订单基本信息管理") |
||||
public class ZyOrders implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private java.lang.String id; |
||||
/**创建人*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
private java.lang.String createBy; |
||||
/**创建日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "创建日期") |
||||
private java.util.Date createTime; |
||||
/**更新人*/ |
||||
@ApiModelProperty(value = "更新人") |
||||
private java.lang.String updateBy; |
||||
/**更新日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "更新日期") |
||||
private java.util.Date updateTime; |
||||
/**所属部门*/ |
||||
@ApiModelProperty(value = "所属部门") |
||||
private java.lang.String sysOrgCode; |
||||
/**是否子单*/ |
||||
@Excel(name = "是否子单", width = 15, dicCode = "ischild") |
||||
@Dict(dicCode = "ischild") |
||||
@ApiModelProperty(value = "是否子单") |
||||
private java.lang.Integer ischild; |
||||
/**原订单id*/ |
||||
@Excel(name = "原订单id", width = 15) |
||||
@Dict(dictTable = "zy_orders", dicText = "orders_num", dicCode = "id") |
||||
@ApiModelProperty(value = "原订单id") |
||||
private java.lang.String orderId; |
||||
/**下单时间*/ |
||||
@Excel(name = "下单时间", width = 15, format = "yyyy-MM-dd HH:mm:ss") |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "下单时间") |
||||
private java.util.Date orderTime; |
||||
/**订单编号*/ |
||||
@Excel(name = "订单编号", width = 15) |
||||
@ApiModelProperty(value = "订单编号") |
||||
private java.lang.String ordersNum; |
||||
/**总金额*/ |
||||
@Excel(name = "总金额", width = 15) |
||||
@ApiModelProperty(value = "总金额") |
||||
private java.lang.Double money; |
||||
/**运费*/ |
||||
@Excel(name = "运费", width = 15) |
||||
@ApiModelProperty(value = "运费") |
||||
private java.lang.Double freight; |
||||
/**促销*/ |
||||
@Excel(name = "促销", width = 15) |
||||
@ApiModelProperty(value = "促销") |
||||
private java.lang.Double promotionPrice; |
||||
/**实付款*/ |
||||
@Excel(name = "实付款", width = 15) |
||||
@ApiModelProperty(value = "实付款") |
||||
private java.lang.Double actualPayment; |
||||
/**交货期*/ |
||||
@Excel(name = "交货期", width = 15) |
||||
@ApiModelProperty(value = "交货期") |
||||
private java.lang.Integer deliveryTime; |
||||
/**订单类型*/ |
||||
@Excel(name = "订单类型", width = 15, dicCode = "orders_type") |
||||
@Dict(dicCode = "orders_type") |
||||
@ApiModelProperty(value = "订单类型") |
||||
private java.lang.Integer ordersType; |
||||
/**顾客id*/ |
||||
@Excel(name = "顾客id", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") |
||||
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id") |
||||
@ApiModelProperty(value = "顾客id") |
||||
private java.lang.String userId; |
||||
/**商品条目数量*/ |
||||
@Excel(name = "商品条目数量", width = 15) |
||||
@ApiModelProperty(value = "商品条目数量") |
||||
private java.lang.Integer goodsQuantity; |
||||
/**支付方式*/ |
||||
@Excel(name = "支付方式", width = 15, dicCode = "payment_method") |
||||
@Dict(dicCode = "payment_method") |
||||
@ApiModelProperty(value = "支付方式") |
||||
private java.lang.Integer paymentMethod; |
||||
/**支付状态*/ |
||||
@Excel(name = "支付状态", width = 15, dicCode = "payment_status") |
||||
@Dict(dicCode = "payment_status") |
||||
@ApiModelProperty(value = "支付状态") |
||||
private java.lang.Integer paymentStatus; |
||||
/**账号/卡号*/ |
||||
@Excel(name = "账号/卡号", width = 15) |
||||
@ApiModelProperty(value = "账号/卡号") |
||||
private java.lang.String accountNo; |
||||
/**开户银行*/ |
||||
@Excel(name = "开户银行", width = 15) |
||||
@ApiModelProperty(value = "开户银行") |
||||
private java.lang.String bankDeposit; |
||||
/**支付时间*/ |
||||
@Excel(name = "支付时间", width = 15, format = "yyyy-MM-dd hh:mm:ss") |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "支付时间") |
||||
private java.util.Date paymentTime; |
||||
/**城市*/ |
||||
@Excel(name = "城市", width = 15) |
||||
@ApiModelProperty(value = "城市") |
||||
private java.lang.String cityId; |
||||
/**地址*/ |
||||
@Excel(name = "地址", width = 15) |
||||
@ApiModelProperty(value = "地址") |
||||
private java.lang.String address; |
||||
/**邮编*/ |
||||
@Excel(name = "邮编", width = 15) |
||||
@ApiModelProperty(value = "邮编") |
||||
private java.lang.String zipCode; |
||||
/**收货人*/ |
||||
@Excel(name = "收货人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") |
||||
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") |
||||
@ApiModelProperty(value = "收货人") |
||||
private java.lang.String receiver; |
||||
/**联系电话*/ |
||||
@Excel(name = "联系电话", width = 15) |
||||
@ApiModelProperty(value = "联系电话") |
||||
private java.lang.String mobile; |
||||
/**发票客户类型*/ |
||||
@Excel(name = "发票客户类型", width = 15, dicCode = "invoice_customer_type") |
||||
@Dict(dicCode = "invoice_customer_type") |
||||
@ApiModelProperty(value = "发票客户类型") |
||||
private java.lang.Integer invoiceCustomerType; |
||||
/**发票类型*/ |
||||
@Excel(name = "发票类型", width = 15, dicCode = "invoice_type") |
||||
@Dict(dicCode = "invoice_type") |
||||
@ApiModelProperty(value = "发票类型") |
||||
private java.lang.Integer invoiceType; |
||||
/**纳税人识别号*/ |
||||
@Excel(name = "纳税人识别号", width = 15) |
||||
@ApiModelProperty(value = "纳税人识别号") |
||||
private java.lang.String taxIdentificationNumber; |
||||
/**开票地址*/ |
||||
@Excel(name = "开票地址", width = 15) |
||||
@ApiModelProperty(value = "开票地址") |
||||
private java.lang.String addressBilling; |
||||
/**电话*/ |
||||
@Excel(name = "电话", width = 15) |
||||
@ApiModelProperty(value = "电话") |
||||
private java.lang.String telephone; |
||||
/**公户开户行*/ |
||||
@Excel(name = "公户开户行", width = 15) |
||||
@ApiModelProperty(value = "公户开户行") |
||||
private java.lang.String bankPublic; |
||||
/**公户账号*/ |
||||
@Excel(name = "公户账号", width = 15) |
||||
@ApiModelProperty(value = "公户账号") |
||||
private java.lang.String accountNumber; |
||||
/**销售门店*/ |
||||
@Excel(name = "销售门店", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") |
||||
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") |
||||
@ApiModelProperty(value = "销售门店") |
||||
private java.lang.String salesEnterpriseId; |
||||
/**销售员*/ |
||||
@Excel(name = "销售员", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") |
||||
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") |
||||
@ApiModelProperty(value = "销售员") |
||||
private java.lang.String salespersonId; |
||||
/**物流企业*/ |
||||
@Excel(name = "物流企业", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") |
||||
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") |
||||
@ApiModelProperty(value = "物流企业") |
||||
private java.lang.String logisticsEnterprisesId; |
||||
/**交付状态*/ |
||||
@Excel(name = "交付状态", width = 15, dicCode = "delivery_status") |
||||
@Dict(dicCode = "delivery_status") |
||||
@ApiModelProperty(value = "交付状态") |
||||
private java.lang.Integer deliveryStatus; |
||||
} |
||||
|
@ -1,21 +1,21 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="org.jeecg.modules.demo.zyorders.mapper.ZyOrdersMapper"> |
||||
|
||||
|
||||
<select id="getTotalOrderAndWeek" resultType="org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo"> |
||||
SELECT |
||||
a.todayNum, |
||||
b.weekTotal |
||||
FROM |
||||
( |
||||
( SELECT COUNT( 1 ) todayNum FROM zy_orders WHERE to_days( create_time ) = to_days( now()) and payment_status=1 and ischild=0 ) a, |
||||
( |
||||
SELECT |
||||
COUNT( 1 ) weekTotal |
||||
FROM |
||||
zy_orders |
||||
WHERE |
||||
DATE_SUB( CURDATE(), INTERVAL 7 DAY ) <= DATE( create_time ) and payment_status=1 and ischild=0 ) b) |
||||
</select> |
||||
</mapper> |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="org.jeecg.modules.demo.zyorders.mapper.ZyOrdersMapper"> |
||||
|
||||
|
||||
<select id="getTotalOrderAndWeek" resultType="org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo"> |
||||
SELECT |
||||
a.todayNum, |
||||
b.weekTotal |
||||
FROM |
||||
( |
||||
( SELECT COUNT( 1 ) todayNum FROM zy_orders WHERE to_days( create_time ) = to_days( now()) and payment_status=1 and ischild=0 ) a, |
||||
( |
||||
SELECT |
||||
COUNT( 1 ) weekTotal |
||||
FROM |
||||
zy_orders |
||||
WHERE |
||||
DATE_SUB( CURDATE(), INTERVAL 7 DAY ) <= DATE( payment_time ) and payment_status=1 and ischild=0 ) b) |
||||
</select> |
||||
</mapper> |
||||
|
@ -1,345 +1,337 @@ |
||||
package org.jeecg.modules.demo.zyorders.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import org.jeecg.modules.demo.customerinvoice.entity.CustomerInvoice; |
||||
import org.jeecg.modules.demo.customerinvoice.mapper.CustomerInvoiceMapper; |
||||
import org.jeecg.modules.demo.customerreceivingaddress.entity.CustomerReceivingAddress; |
||||
import org.jeecg.modules.demo.customerreceivingaddress.mapper.CustomerReceivingAddressMapper; |
||||
import org.jeecg.modules.demo.goodsaccessories.entity.GoodsAccessories; |
||||
import org.jeecg.modules.demo.goodsaccessories.mapper.GoodsAccessoriesMapper; |
||||
import org.jeecg.modules.demo.goodsfabric.entity.GoodsFabric; |
||||
import org.jeecg.modules.demo.goodsfabric.mapper.GoodsFabricMapper; |
||||
import org.jeecg.modules.demo.goodsmodule.entity.GoodsModule; |
||||
import org.jeecg.modules.demo.goodsmodule.mapper.GoodsModuleMapper; |
||||
import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; |
||||
import org.jeecg.modules.demo.ordergoods.entity.OrderGoodsJk; |
||||
import org.jeecg.modules.demo.ordergoods.mapper.OrderGoodsMapper; |
||||
import org.jeecg.modules.demo.ordergoodsaccessories.entity.OrderGoodsAccessories; |
||||
import org.jeecg.modules.demo.ordergoodsaccessories.mapper.OrderGoodsAccessoriesMapper; |
||||
import org.jeecg.modules.demo.ordergoodsfabric.entity.OrderGoodsFabric; |
||||
import org.jeecg.modules.demo.ordergoodsfabric.mapper.OrderGoodsFabricMapper; |
||||
import org.jeecg.modules.demo.ordergoodsmodule.entity.OrderGoodsModule; |
||||
import org.jeecg.modules.demo.ordergoodsmodule.mapper.OrderGoodsModuleMapper; |
||||
import org.jeecg.modules.demo.zygoods.entity.ZyGoods; |
||||
import org.jeecg.modules.demo.zygoods.mapper.ZyGoodsMapper; |
||||
import org.jeecg.modules.demo.zyorders.entity.ZyOrders; |
||||
import org.jeecg.modules.demo.zyorders.entity.ZyOrdersJk; |
||||
import org.jeecg.modules.demo.zyorders.mapper.ZyOrdersMapper; |
||||
import org.jeecg.modules.demo.zyorders.service.IZyOrdersService; |
||||
import org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
import java.text.SimpleDateFormat; |
||||
import java.util.ArrayList; |
||||
import java.util.Calendar; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Description: 订单基本信息管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-26 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class ZyOrdersServiceImpl extends ServiceImpl<ZyOrdersMapper, ZyOrders> implements IZyOrdersService { |
||||
|
||||
//商品
|
||||
@Autowired |
||||
private ZyGoodsMapper zyGoodsMapper; |
||||
|
||||
//订单商品表
|
||||
@Autowired |
||||
private OrderGoodsMapper zyOrderGoodsMapper; |
||||
|
||||
//商品模块表
|
||||
@Autowired |
||||
private GoodsModuleMapper zyGoodsModuleMapper; |
||||
|
||||
|
||||
//订单商品模块表
|
||||
@Autowired |
||||
private OrderGoodsModuleMapper zyOrderGoodsModuleMapper; |
||||
|
||||
|
||||
//商品面料表
|
||||
@Autowired |
||||
private GoodsFabricMapper zyGoodsFabricMapper; |
||||
|
||||
//订单商品面料表
|
||||
@Autowired |
||||
private OrderGoodsFabricMapper zyOrderGoodsFabricMapper; |
||||
|
||||
//商品辅料表
|
||||
@Autowired |
||||
private GoodsAccessoriesMapper zyGoodsAccessoriesMapper; |
||||
|
||||
//订单商品辅料表
|
||||
@Autowired |
||||
private OrderGoodsAccessoriesMapper zyOrderGoodsAccessoriesMapper; |
||||
|
||||
|
||||
|
||||
//顾客地址表
|
||||
@Autowired |
||||
CustomerReceivingAddressMapper customerReceivingAddressMapper; |
||||
|
||||
//客户发票信息
|
||||
@Autowired |
||||
CustomerInvoiceMapper customerInvoiceMapper; |
||||
|
||||
|
||||
|
||||
/** |
||||
* 大屏数据-获取订单的状态 |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public List<ZyOrders> getOrderStatus() { |
||||
String starTime; |
||||
String endTime; |
||||
Date date = new Date(); |
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); |
||||
|
||||
String todayStr = formatter.format(date);//今天
|
||||
//System.out.println(todayStr);
|
||||
|
||||
|
||||
Calendar calendar = Calendar.getInstance(); |
||||
calendar.setTime(date); |
||||
//把日期往后增加一天.整数往后推,负数往前移动(1:表示明天、-1:表示昨天,0:表示今天)
|
||||
calendar.add(Calendar.DATE, 1); |
||||
//这个时间就是日期往后推一天的结果,明天
|
||||
date = calendar.getTime(); |
||||
String tomorrowStr = formatter.format(date); |
||||
|
||||
//System.out.println(tomorrowStr);
|
||||
|
||||
|
||||
starTime = todayStr + " 00:00:00"; |
||||
endTime = tomorrowStr + " 00:00:00"; |
||||
|
||||
// System.out.println(starTime);
|
||||
// System.out.println(endTime);
|
||||
|
||||
QueryWrapper<ZyOrders> wrapper = new QueryWrapper<>(); |
||||
wrapper.ge("create_time", starTime).le("create_time", endTime).eq("payment_status", 1); |
||||
|
||||
List<ZyOrders> zyOrderList = baseMapper.selectList(wrapper); |
||||
return zyOrderList; |
||||
} |
||||
|
||||
/** |
||||
* 大屏数据-获取历史订单 |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public List<ZyOrders> getOldOrder() { |
||||
QueryWrapper<ZyOrders> wrapper = new QueryWrapper<>(); |
||||
wrapper |
||||
// .eq("is_delete", 0)
|
||||
.orderByDesc("create_time"); |
||||
List<ZyOrders> orderList = baseMapper.selectList(wrapper); |
||||
return orderList; |
||||
} |
||||
|
||||
/** |
||||
* 获取今日订单及七日订单 |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public TodayOrderAndQIriVo getOrder() { |
||||
TodayOrderAndQIriVo todayOrderAndQIriVo = baseMapper.getTotalOrderAndWeek(); |
||||
if (todayOrderAndQIriVo != null) { |
||||
return todayOrderAndQIriVo; |
||||
} else { |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param zyOrdersJk |
||||
* @param orderGoodsJkList |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public List<String> orderJk(ZyOrdersJk zyOrdersJk, List<OrderGoodsJk> orderGoodsJkList) { |
||||
|
||||
Double actual_payment = 0.00; |
||||
Double money = 0.00; |
||||
for(int i = 0 ; i < orderGoodsJkList.size() ; i++){ |
||||
ZyGoods zyGoods = zyGoodsMapper.selectById(orderGoodsJkList.get(i).getGoodsId()); |
||||
money = money + zyGoods.getUnitPrice()*orderGoodsJkList.get(i).getGoodsNum(); |
||||
actual_payment = actual_payment + zyGoods.getPromotionPrice()*orderGoodsJkList.get(i).getGoodsNum(); |
||||
} |
||||
ZyOrders zyOrders = new ZyOrders(); |
||||
zyOrders.setIschild(0); |
||||
zyOrders.setOrderTime(new Date()); |
||||
zyOrders.setOrdersNum(getOrdersNum()); |
||||
zyOrders.setMoney(money); |
||||
zyOrders.setFreight(zyOrdersJk.getFreight()); |
||||
zyOrders.setPromotionPrice(money-actual_payment); |
||||
zyOrders.setActualPayment(actual_payment); |
||||
zyOrders.setDeliveryTime(zyOrdersJk.getDeliveryTime()); |
||||
zyOrders.setOrdersType(zyOrdersJk.getOrdersType()); |
||||
zyOrders.setUserId(zyOrdersJk.getUserId()); |
||||
zyOrders.setGoodsQuantity(zyOrdersJk.getGoodsQuantity()); |
||||
//顾客地址
|
||||
if(zyOrdersJk.getAddressId()!=null&&zyOrdersJk.getAddressId()!="") |
||||
{ |
||||
CustomerReceivingAddress customerReceivingAddress = customerReceivingAddressMapper.selectById(zyOrdersJk.getAddressId()); |
||||
zyOrders.setCityId(customerReceivingAddress.getCityId()); |
||||
zyOrders.setAddress(customerReceivingAddress.getAddress()); |
||||
zyOrders.setZipCode(customerReceivingAddress.getZipCode()); |
||||
zyOrders.setReceiver(zyOrdersJk.getReceiver()); |
||||
zyOrders.setMobile(customerReceivingAddress.getMobile()); |
||||
} |
||||
|
||||
//顾客发票
|
||||
if(zyOrdersJk.getInvoiceId()!=null&&zyOrdersJk.getInvoiceId()!="") |
||||
{ |
||||
CustomerInvoice customerInvoice = customerInvoiceMapper.selectById(zyOrdersJk.getInvoiceId()); |
||||
zyOrders.setInvoiceCustomerType(Integer.parseInt(customerInvoice.getCustomerType())); |
||||
zyOrders.setInvoiceType(Integer.parseInt(customerInvoice.getInvoiceType())); |
||||
zyOrders.setTaxIdentificationNumber(customerInvoice.getTaxIdentificationNumber()); |
||||
zyOrders.setAddressBilling(customerInvoice.getAddress()); |
||||
zyOrders.setTelephone(customerInvoice.getTelephone()); |
||||
zyOrders.setBankPublic(customerInvoice.getBankDeposit()); |
||||
zyOrders.setAccountNumber(customerInvoice.getAccountNumber()); |
||||
} |
||||
|
||||
zyOrders.setSalesEnterpriseId(zyOrdersJk.getSalesEnterpriseId()); |
||||
zyOrders.setSalespersonId(zyOrdersJk.getSalespersonId()); |
||||
zyOrders.setLogisticsEnterprisesId(zyOrdersJk.getLogisticsEnterprisesId()); |
||||
zyOrders.setDeliveryStatus(0); |
||||
baseMapper.insert(zyOrders); |
||||
for(int j = 0 ; j < orderGoodsJkList.size() ; j++){ |
||||
ZyGoods zyGoods = zyGoodsMapper.selectById(orderGoodsJkList.get(j).getGoodsId()); |
||||
OrderGoods orderGoods = new OrderGoods(); |
||||
orderGoods.setOrdersId(zyOrders.getId()); |
||||
orderGoods.setGoodsId(orderGoodsJkList.get(j).getGoodsId()); |
||||
orderGoods.setGoodsNum(orderGoodsJkList.get(j).getGoodsNum()); |
||||
orderGoods.setGoodsCode(zyGoods.getGoodsCode()); |
||||
orderGoods.setGoodsName(zyGoods.getGoodsName()); |
||||
orderGoods.setGoodsIntr(zyGoods.getGoodsIntr()); |
||||
orderGoods.setCustomized(zyGoods.getCustomized()); |
||||
orderGoods.setMeasureId(zyOrdersJk.getMeasureId()); |
||||
orderGoods.setGoodsPicture(zyGoods.getGoodsPicture()); |
||||
orderGoods.setDefaultPicture(zyGoods.getDefaultPicture()); |
||||
orderGoods.setGoodsVideo(zyGoods.getGoodsVideo()); |
||||
orderGoods.setClothsTypeId(zyGoods.getClothsTypeId()); |
||||
orderGoods.setStyleId(zyGoods.getStyleId()); |
||||
orderGoods.setModelId(zyGoods.getModelId()); |
||||
orderGoods.setUnit(zyGoods.getUnit()); |
||||
orderGoods.setNumber(zyGoods.getNumber()); |
||||
orderGoods.setUnitPrice(zyGoods.getUnitPrice()); |
||||
orderGoods.setDiscount(zyGoods.getDiscount()); |
||||
orderGoods.setPromotionPrice(zyGoods.getPromotionPrice()); |
||||
orderGoods.setRecommend(zyGoods.getRecommend()); |
||||
orderGoods.setPlaceOrigin(zyGoods.getPlaceOrigin()); |
||||
orderGoods.setStatus(zyGoods.getStatus()); |
||||
orderGoods.setTotalPrice(zyGoods.getUnitPrice()*orderGoodsJkList.get(j).getGoodsNum()); |
||||
orderGoods.setPayTotalPrice(zyGoods.getPromotionPrice()*orderGoodsJkList.get(j).getGoodsNum()); |
||||
zyOrderGoodsMapper.insert(orderGoods); |
||||
GoodsModule goodsModule = new GoodsModule(); |
||||
QueryWrapper<GoodsModule> queryWrapperzsm = new QueryWrapper(); |
||||
queryWrapperzsm.eq("goods_id",zyGoods.getId()); |
||||
queryWrapperzsm.eq("style_id",zyGoods.getStyleId()); |
||||
List<GoodsModule> listzsm = zyGoodsModuleMapper.selectList(queryWrapperzsm); |
||||
for (int k = 0 ; k < listzsm.size() ; k++){ |
||||
OrderGoodsModule orderGoodsModule = new OrderGoodsModule(); |
||||
orderGoodsModule.setOrderGoodsId(orderGoods.getId()); |
||||
orderGoodsModule.setGoodsId(zyGoods.getId()); |
||||
orderGoodsModule.setStyleId(zyGoods.getStyleId()); |
||||
orderGoodsModule.setStyleModuleId(listzsm.get(k).getStyleModuleId()); |
||||
orderGoodsModule.setModuleId(listzsm.get(k).getModuleId()); |
||||
zyOrderGoodsModuleMapper.insert(orderGoodsModule); |
||||
} |
||||
GoodsFabric goodsFabric = new GoodsFabric(); |
||||
QueryWrapper<GoodsFabric> queryWrapperzsf =new QueryWrapper(); |
||||
queryWrapperzsf.eq("goods_id",zyGoods.getId()); |
||||
List<GoodsFabric> listzsf = zyGoodsFabricMapper.selectList(queryWrapperzsf); |
||||
for (int o = 0 ; o < listzsf.size() ; o++){ |
||||
OrderGoodsFabric orderGoodsFabric = new OrderGoodsFabric(); |
||||
orderGoodsFabric.setOrderGoodsId(orderGoods.getId()); |
||||
orderGoodsFabric.setGoodsId(zyGoods.getId()); |
||||
orderGoodsFabric.setFabricId(listzsf.get(o).getFabricId()); |
||||
zyOrderGoodsFabricMapper.insert(orderGoodsFabric); |
||||
} |
||||
GoodsAccessories goodsAccessories = new GoodsAccessories(); |
||||
QueryWrapper<GoodsAccessories> queryWrapperzsa = new QueryWrapper(); |
||||
queryWrapperzsa.eq("goods_id",zyGoods.getId()); |
||||
List<GoodsAccessories> listzsa = zyGoodsAccessoriesMapper.selectList(queryWrapperzsa); |
||||
for (int p = 0 ; p < listzsa.size() ; p++){ |
||||
OrderGoodsAccessories orderGoodsAccessories = new OrderGoodsAccessories(); |
||||
orderGoodsAccessories.setOrderGoodsId(orderGoods.getId()); |
||||
orderGoodsAccessories.setGoodsId(zyGoods.getId()); |
||||
orderGoodsAccessories.setAccessoriesId(listzsa.get(p).getAccessoriesId()); |
||||
zyOrderGoodsAccessoriesMapper.insert(orderGoodsAccessories); |
||||
} |
||||
|
||||
|
||||
} |
||||
List<String> ids = new ArrayList<>(); |
||||
ZyOrders zos = new ZyOrders(); |
||||
QueryWrapper<ZyOrders> queryWrapperzos = new QueryWrapper(); |
||||
queryWrapperzos.eq("order_id",zyOrders.getId()); |
||||
List<ZyOrders> listzos = baseMapper.selectList(queryWrapperzos); |
||||
if(listzos.size()>0){ |
||||
//return Result.error("该订单已经拆分,不可以再次拆单!");
|
||||
return null; |
||||
}else{ |
||||
OrderGoods orderGoods = new OrderGoods(); |
||||
QueryWrapper<OrderGoods> queryWrapperog = new QueryWrapper(); |
||||
queryWrapperog.eq("orders_id",zyOrders.getId()); |
||||
List<OrderGoods> listog = zyOrderGoodsMapper.selectList(queryWrapperog); |
||||
if(listog.size()>0){ |
||||
for (int i = 0 ; i < listog.size() ; i++){ |
||||
ZyOrders zo = new ZyOrders(); |
||||
zo = zyOrders; |
||||
zo.setId(null); |
||||
zo.setOrdersNum(getOrdersNum()); |
||||
zo.setOrderId(listog.get(i).getId()); |
||||
zo.setFreight(Double.parseDouble("0")); |
||||
zo.setIschild(1); |
||||
zo.setOrderId(zyOrders.getId()); |
||||
zo.setMoney(listog.get(i).getTotalPrice()); |
||||
zo.setPromotionPrice(listog.get(i).getPromotionPrice()); |
||||
zo.setActualPayment(listog.get(i).getPayTotalPrice()); |
||||
zo.setGoodsQuantity(1); |
||||
baseMapper.insert(zo); |
||||
ids.add(zo.getId()); |
||||
OrderGoods og = new OrderGoods(); |
||||
og = listog.get(i); |
||||
og.setOrdersId(zo.getId()); |
||||
zyOrderGoodsMapper.updateById(og); |
||||
} |
||||
} |
||||
} |
||||
return ids; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 生成订单编号 |
||||
* |
||||
* @param |
||||
* @return |
||||
*/ |
||||
public String getOrdersNum() { |
||||
String mrstr = "000000000000000000"; |
||||
QueryWrapper<ZyOrders> qw=new QueryWrapper(); |
||||
int listsize = baseMapper.selectCount(qw); |
||||
int strsize = listsize+1; |
||||
String str = strsize+""; |
||||
int strlength = str.length(); |
||||
String substr = mrstr.substring(0,mrstr.length()-strlength); |
||||
String OrdersNum = substr+str; |
||||
return OrdersNum; |
||||
} |
||||
|
||||
} |
||||
package org.jeecg.modules.demo.zyorders.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import org.jeecg.modules.demo.customerinvoice.entity.CustomerInvoice; |
||||
import org.jeecg.modules.demo.customerinvoice.mapper.CustomerInvoiceMapper; |
||||
import org.jeecg.modules.demo.customerreceivingaddress.entity.CustomerReceivingAddress; |
||||
import org.jeecg.modules.demo.customerreceivingaddress.mapper.CustomerReceivingAddressMapper; |
||||
import org.jeecg.modules.demo.goodsaccessories.entity.GoodsAccessories; |
||||
import org.jeecg.modules.demo.goodsaccessories.mapper.GoodsAccessoriesMapper; |
||||
import org.jeecg.modules.demo.goodsfabric.entity.GoodsFabric; |
||||
import org.jeecg.modules.demo.goodsfabric.mapper.GoodsFabricMapper; |
||||
import org.jeecg.modules.demo.goodsmodule.entity.GoodsModule; |
||||
import org.jeecg.modules.demo.goodsmodule.mapper.GoodsModuleMapper; |
||||
import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; |
||||
import org.jeecg.modules.demo.ordergoods.entity.OrderGoodsJk; |
||||
import org.jeecg.modules.demo.ordergoods.mapper.OrderGoodsMapper; |
||||
import org.jeecg.modules.demo.ordergoodsaccessories.entity.OrderGoodsAccessories; |
||||
import org.jeecg.modules.demo.ordergoodsaccessories.mapper.OrderGoodsAccessoriesMapper; |
||||
import org.jeecg.modules.demo.ordergoodsfabric.entity.OrderGoodsFabric; |
||||
import org.jeecg.modules.demo.ordergoodsfabric.mapper.OrderGoodsFabricMapper; |
||||
import org.jeecg.modules.demo.ordergoodsmodule.entity.OrderGoodsModule; |
||||
import org.jeecg.modules.demo.ordergoodsmodule.mapper.OrderGoodsModuleMapper; |
||||
import org.jeecg.modules.demo.zygoods.entity.ZyGoods; |
||||
import org.jeecg.modules.demo.zygoods.mapper.ZyGoodsMapper; |
||||
import org.jeecg.modules.demo.zyorders.entity.ZyOrders; |
||||
import org.jeecg.modules.demo.zyorders.entity.ZyOrdersJk; |
||||
import org.jeecg.modules.demo.zyorders.mapper.ZyOrdersMapper; |
||||
import org.jeecg.modules.demo.zyorders.service.IZyOrdersService; |
||||
import org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
import java.text.SimpleDateFormat; |
||||
import java.util.ArrayList; |
||||
import java.util.Calendar; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Description: 订单基本信息管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-26 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class ZyOrdersServiceImpl extends ServiceImpl<ZyOrdersMapper, ZyOrders> implements IZyOrdersService { |
||||
|
||||
//商品
|
||||
@Autowired |
||||
private ZyGoodsMapper zyGoodsMapper; |
||||
|
||||
//订单商品表
|
||||
@Autowired |
||||
private OrderGoodsMapper zyOrderGoodsMapper; |
||||
|
||||
//商品模块表
|
||||
@Autowired |
||||
private GoodsModuleMapper zyGoodsModuleMapper; |
||||
|
||||
|
||||
//订单商品模块表
|
||||
@Autowired |
||||
private OrderGoodsModuleMapper zyOrderGoodsModuleMapper; |
||||
|
||||
|
||||
//商品面料表
|
||||
@Autowired |
||||
private GoodsFabricMapper zyGoodsFabricMapper; |
||||
|
||||
//订单商品面料表
|
||||
@Autowired |
||||
private OrderGoodsFabricMapper zyOrderGoodsFabricMapper; |
||||
|
||||
//商品辅料表
|
||||
@Autowired |
||||
private GoodsAccessoriesMapper zyGoodsAccessoriesMapper; |
||||
|
||||
//订单商品辅料表
|
||||
@Autowired |
||||
private OrderGoodsAccessoriesMapper zyOrderGoodsAccessoriesMapper; |
||||
|
||||
|
||||
|
||||
//顾客地址表
|
||||
@Autowired |
||||
CustomerReceivingAddressMapper customerReceivingAddressMapper; |
||||
|
||||
//客户发票信息
|
||||
@Autowired |
||||
CustomerInvoiceMapper customerInvoiceMapper; |
||||
|
||||
|
||||
|
||||
/** |
||||
* 大屏数据-获取订单的状态 |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public List<ZyOrders> getOrderStatus() { |
||||
String starTime; |
||||
String endTime; |
||||
Date date = new Date(); |
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); |
||||
String todayStr = formatter.format(date);//今天
|
||||
Calendar calendar = Calendar.getInstance(); |
||||
calendar.setTime(date); |
||||
//把日期往后增加一天.整数往后推,负数往前移动(1:表示明天、-1:表示昨天,0:表示今天)
|
||||
calendar.add(Calendar.DATE, 1); |
||||
//这个时间就是日期往后推一天的结果,明天
|
||||
date = calendar.getTime(); |
||||
String tomorrowStr = formatter.format(date); |
||||
|
||||
starTime = todayStr + " 00:00:00"; |
||||
endTime = tomorrowStr + " 00:00:00"; |
||||
|
||||
QueryWrapper<ZyOrders> wrapper = new QueryWrapper<>(); |
||||
wrapper.ge("create_time", starTime).le("create_time", endTime).eq("payment_status", 1); |
||||
|
||||
List<ZyOrders> zyOrderList = baseMapper.selectList(wrapper); |
||||
return zyOrderList; |
||||
} |
||||
|
||||
/** |
||||
* 大屏数据-获取历史订单 |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public List<ZyOrders> getOldOrder() { |
||||
QueryWrapper<ZyOrders> wrapper = new QueryWrapper<>(); |
||||
wrapper |
||||
// .eq("is_delete", 0)
|
||||
.orderByDesc("create_time"); |
||||
List<ZyOrders> orderList = baseMapper.selectList(wrapper); |
||||
return orderList; |
||||
} |
||||
|
||||
/** |
||||
* 获取今日订单及七日订单 |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public TodayOrderAndQIriVo getOrder() { |
||||
TodayOrderAndQIriVo todayOrderAndQIriVo = baseMapper.getTotalOrderAndWeek(); |
||||
if (todayOrderAndQIriVo != null) { |
||||
return todayOrderAndQIriVo; |
||||
} else { |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param zyOrdersJk |
||||
* @param orderGoodsJkList |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public List<String> orderJk(ZyOrdersJk zyOrdersJk, List<OrderGoodsJk> orderGoodsJkList) { |
||||
|
||||
Double actual_payment = 0.00; |
||||
Double money = 0.00; |
||||
for(int i = 0 ; i < orderGoodsJkList.size() ; i++){ |
||||
ZyGoods zyGoods = zyGoodsMapper.selectById(orderGoodsJkList.get(i).getGoodsId()); |
||||
money = money + zyGoods.getUnitPrice()*orderGoodsJkList.get(i).getGoodsNum(); |
||||
actual_payment = actual_payment + zyGoods.getPromotionPrice()*orderGoodsJkList.get(i).getGoodsNum(); |
||||
} |
||||
ZyOrders zyOrders = new ZyOrders(); |
||||
zyOrders.setIschild(0); |
||||
zyOrders.setOrderTime(new Date()); |
||||
zyOrders.setOrdersNum(getOrdersNum()); |
||||
zyOrders.setMoney(money); |
||||
zyOrders.setFreight(zyOrdersJk.getFreight()); |
||||
zyOrders.setPromotionPrice(money-actual_payment); |
||||
zyOrders.setActualPayment(actual_payment); |
||||
zyOrders.setDeliveryTime(zyOrdersJk.getDeliveryTime()); |
||||
zyOrders.setOrdersType(zyOrdersJk.getOrdersType()); |
||||
zyOrders.setUserId(zyOrdersJk.getUserId()); |
||||
zyOrders.setGoodsQuantity(zyOrdersJk.getGoodsQuantity()); |
||||
//顾客地址
|
||||
if(zyOrdersJk.getAddressId()!=null&&zyOrdersJk.getAddressId()!="") |
||||
{ |
||||
CustomerReceivingAddress customerReceivingAddress = customerReceivingAddressMapper.selectById(zyOrdersJk.getAddressId()); |
||||
zyOrders.setCityId(customerReceivingAddress.getCityId()); |
||||
zyOrders.setAddress(customerReceivingAddress.getAddress()); |
||||
zyOrders.setZipCode(customerReceivingAddress.getZipCode()); |
||||
zyOrders.setReceiver(zyOrdersJk.getReceiver()); |
||||
zyOrders.setMobile(customerReceivingAddress.getMobile()); |
||||
} |
||||
|
||||
//顾客发票
|
||||
if(zyOrdersJk.getInvoiceId()!=null&&zyOrdersJk.getInvoiceId()!="") |
||||
{ |
||||
CustomerInvoice customerInvoice = customerInvoiceMapper.selectById(zyOrdersJk.getInvoiceId()); |
||||
zyOrders.setInvoiceCustomerType(Integer.parseInt(customerInvoice.getCustomerType())); |
||||
zyOrders.setInvoiceType(Integer.parseInt(customerInvoice.getInvoiceType())); |
||||
zyOrders.setTaxIdentificationNumber(customerInvoice.getTaxIdentificationNumber()); |
||||
zyOrders.setAddressBilling(customerInvoice.getAddress()); |
||||
zyOrders.setTelephone(customerInvoice.getTelephone()); |
||||
zyOrders.setBankPublic(customerInvoice.getBankDeposit()); |
||||
zyOrders.setAccountNumber(customerInvoice.getAccountNumber()); |
||||
} |
||||
|
||||
zyOrders.setSalesEnterpriseId(zyOrdersJk.getSalesEnterpriseId()); |
||||
zyOrders.setSalespersonId(zyOrdersJk.getSalespersonId()); |
||||
zyOrders.setLogisticsEnterprisesId(zyOrdersJk.getLogisticsEnterprisesId()); |
||||
zyOrders.setDeliveryStatus(0); |
||||
zyOrders.setPaymentStatus(1); |
||||
zyOrders.setPaymentTime(new Date()); |
||||
baseMapper.insert(zyOrders); |
||||
for(int j = 0 ; j < orderGoodsJkList.size() ; j++){ |
||||
ZyGoods zyGoods = zyGoodsMapper.selectById(orderGoodsJkList.get(j).getGoodsId()); |
||||
OrderGoods orderGoods = new OrderGoods(); |
||||
orderGoods.setOrdersId(zyOrders.getId()); |
||||
orderGoods.setGoodsId(orderGoodsJkList.get(j).getGoodsId()); |
||||
orderGoods.setGoodsNum(orderGoodsJkList.get(j).getGoodsNum()); |
||||
orderGoods.setGoodsCode(zyGoods.getGoodsCode()); |
||||
orderGoods.setGoodsName(zyGoods.getGoodsName()); |
||||
orderGoods.setGoodsIntr(zyGoods.getGoodsIntr()); |
||||
orderGoods.setCustomized(zyGoods.getCustomized()); |
||||
orderGoods.setMeasureId(zyOrdersJk.getMeasureId()); |
||||
orderGoods.setGoodsPicture(zyGoods.getGoodsPicture()); |
||||
orderGoods.setDefaultPicture(zyGoods.getDefaultPicture()); |
||||
orderGoods.setGoodsVideo(zyGoods.getGoodsVideo()); |
||||
orderGoods.setClothsTypeId(zyGoods.getClothsTypeId()); |
||||
orderGoods.setStyleId(zyGoods.getStyleId()); |
||||
orderGoods.setModelId(zyGoods.getModelId()); |
||||
orderGoods.setUnit(zyGoods.getUnit()); |
||||
orderGoods.setNumber(zyGoods.getNumber()); |
||||
orderGoods.setUnitPrice(zyGoods.getUnitPrice()); |
||||
orderGoods.setDiscount(zyGoods.getDiscount()); |
||||
orderGoods.setPromotionPrice(zyGoods.getPromotionPrice()); |
||||
orderGoods.setRecommend(zyGoods.getRecommend()); |
||||
orderGoods.setPlaceOrigin(zyGoods.getPlaceOrigin()); |
||||
orderGoods.setStatus(zyGoods.getStatus()); |
||||
orderGoods.setTotalPrice(zyGoods.getUnitPrice()*orderGoodsJkList.get(j).getGoodsNum()); |
||||
orderGoods.setPayTotalPrice(zyGoods.getPromotionPrice()*orderGoodsJkList.get(j).getGoodsNum()); |
||||
zyOrderGoodsMapper.insert(orderGoods); |
||||
GoodsModule goodsModule = new GoodsModule(); |
||||
QueryWrapper<GoodsModule> queryWrapperzsm = new QueryWrapper(); |
||||
queryWrapperzsm.eq("goods_id",zyGoods.getId()); |
||||
queryWrapperzsm.eq("style_id",zyGoods.getStyleId()); |
||||
List<GoodsModule> listzsm = zyGoodsModuleMapper.selectList(queryWrapperzsm); |
||||
for (int k = 0 ; k < listzsm.size() ; k++){ |
||||
OrderGoodsModule orderGoodsModule = new OrderGoodsModule(); |
||||
orderGoodsModule.setOrderGoodsId(orderGoods.getId()); |
||||
orderGoodsModule.setGoodsId(zyGoods.getId()); |
||||
orderGoodsModule.setStyleId(zyGoods.getStyleId()); |
||||
orderGoodsModule.setStyleModuleId(listzsm.get(k).getStyleModuleId()); |
||||
orderGoodsModule.setModuleId(listzsm.get(k).getModuleId()); |
||||
zyOrderGoodsModuleMapper.insert(orderGoodsModule); |
||||
} |
||||
GoodsFabric goodsFabric = new GoodsFabric(); |
||||
QueryWrapper<GoodsFabric> queryWrapperzsf =new QueryWrapper(); |
||||
queryWrapperzsf.eq("goods_id",zyGoods.getId()); |
||||
List<GoodsFabric> listzsf = zyGoodsFabricMapper.selectList(queryWrapperzsf); |
||||
for (int o = 0 ; o < listzsf.size() ; o++){ |
||||
OrderGoodsFabric orderGoodsFabric = new OrderGoodsFabric(); |
||||
orderGoodsFabric.setOrderGoodsId(orderGoods.getId()); |
||||
orderGoodsFabric.setGoodsId(zyGoods.getId()); |
||||
orderGoodsFabric.setFabricId(listzsf.get(o).getFabricId()); |
||||
zyOrderGoodsFabricMapper.insert(orderGoodsFabric); |
||||
} |
||||
GoodsAccessories goodsAccessories = new GoodsAccessories(); |
||||
QueryWrapper<GoodsAccessories> queryWrapperzsa = new QueryWrapper(); |
||||
queryWrapperzsa.eq("goods_id",zyGoods.getId()); |
||||
List<GoodsAccessories> listzsa = zyGoodsAccessoriesMapper.selectList(queryWrapperzsa); |
||||
for (int p = 0 ; p < listzsa.size() ; p++){ |
||||
OrderGoodsAccessories orderGoodsAccessories = new OrderGoodsAccessories(); |
||||
orderGoodsAccessories.setOrderGoodsId(orderGoods.getId()); |
||||
orderGoodsAccessories.setGoodsId(zyGoods.getId()); |
||||
orderGoodsAccessories.setAccessoriesId(listzsa.get(p).getAccessoriesId()); |
||||
zyOrderGoodsAccessoriesMapper.insert(orderGoodsAccessories); |
||||
} |
||||
|
||||
|
||||
} |
||||
List<String> ids = new ArrayList<>(); |
||||
ZyOrders zos = new ZyOrders(); |
||||
QueryWrapper<ZyOrders> queryWrapperzos = new QueryWrapper(); |
||||
queryWrapperzos.eq("order_id",zyOrders.getId()); |
||||
List<ZyOrders> listzos = baseMapper.selectList(queryWrapperzos); |
||||
if(listzos.size()>0){ |
||||
//return Result.error("该订单已经拆分,不可以再次拆单!");
|
||||
return null; |
||||
}else{ |
||||
OrderGoods orderGoods = new OrderGoods(); |
||||
QueryWrapper<OrderGoods> queryWrapperog = new QueryWrapper(); |
||||
queryWrapperog.eq("orders_id",zyOrders.getId()); |
||||
List<OrderGoods> listog = zyOrderGoodsMapper.selectList(queryWrapperog); |
||||
if(listog.size()>0){ |
||||
for (int i = 0 ; i < listog.size() ; i++){ |
||||
ZyOrders zo = new ZyOrders(); |
||||
zo = zyOrders; |
||||
zo.setId(null); |
||||
zo.setOrdersNum(getOrdersNum()); |
||||
zo.setOrderId(listog.get(i).getId()); |
||||
zo.setFreight(Double.parseDouble("0")); |
||||
zo.setIschild(1); |
||||
zo.setOrderId(zyOrders.getId()); |
||||
zo.setMoney(listog.get(i).getTotalPrice()); |
||||
zo.setPromotionPrice(listog.get(i).getPromotionPrice()); |
||||
zo.setActualPayment(listog.get(i).getPayTotalPrice()); |
||||
zo.setGoodsQuantity(1); |
||||
baseMapper.insert(zo); |
||||
ids.add(zo.getId()); |
||||
OrderGoods og = new OrderGoods(); |
||||
og = listog.get(i); |
||||
og.setOrdersId(zo.getId()); |
||||
zyOrderGoodsMapper.updateById(og); |
||||
} |
||||
} |
||||
} |
||||
return ids; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 生成订单编号 |
||||
* |
||||
* @param |
||||
* @return |
||||
*/ |
||||
public String getOrdersNum() { |
||||
String mrstr = "000000000000000000"; |
||||
QueryWrapper<ZyOrders> qw=new QueryWrapper(); |
||||
int listsize = baseMapper.selectCount(qw); |
||||
int strsize = listsize+1; |
||||
String str = strsize+""; |
||||
int strlength = str.length(); |
||||
String substr = mrstr.substring(0,mrstr.length()-strlength); |
||||
String OrdersNum = substr+str; |
||||
return OrdersNum; |
||||
} |
||||
|
||||
} |
||||
|
Loading…
Reference in new issue