master
喻忠伟 2 years ago
parent 43200f64b4
commit a1aff53bf3
  1. 928
      ant-design-vue-jeecg/src/views/zyWorkorderManagement/ZyProductionOrderList.vue
  2. 2
      jeecg-boot/jeecg-boot-module-orderbymakeclothplan/src/main/java/org/jeecg/modules/orderbymakeclothplan/controller/ZyOrderController.java
  3. 16
      jeecg-boot/jeecg-boot-module-orderbymakeclothplan/src/main/java/org/jeecg/modules/orderbymakeclothplan/service/impl/ZyOrderServiceImpl.java
  4. 4
      jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/Service/impl/ZyShopServiceImpl.java
  5. 6
      jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/mapper/xml/ZyShopMapper.xml
  6. 412
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/entity/ZyOrders.java
  7. 42
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/mapper/xml/ZyOrdersMapper.xml
  8. 682
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java
  9. 27
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/LargeScreenController.java

@ -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>-->
<!--&lt;!&ndash; 高级查询区域 &ndash;&gt;-->
<!--<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>-->
<!--&lt;!&ndash; 高级查询区域 &ndash;&gt;-->
<!--<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>

@ -238,7 +238,7 @@ public class ZyOrderController {
@ApiOperation(value = "获取完成订单的百分比", notes = "获取完成订单的百分比")
@GetMapping("/percentageProduction")
public Result<?> percentageProduction() {
Double percent = orderService.percentageProduction();
Double percent = orderService.percentageProduction();
return Result.OK(percent);
}

@ -66,11 +66,8 @@ public class ZyOrderServiceImpl implements ZyOrderService {
String endTime;
Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String todayStr = formatter.format(date);//今天
System.out.println(todayStr);
//System.out.println(todayStr);
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
//把日期往后增加一天.整数往后推,负数往前移动(1:表示明天、-1:表示昨天,0:表示今天)
@ -78,16 +75,11 @@ public class ZyOrderServiceImpl implements ZyOrderService {
//这个时间就是日期往后推一天的结果,明天
date = calendar.getTime();
String tomorrowStr = formatter.format(date);
System.out.println(tomorrowStr);
//System.out.println(tomorrowStr);
starTime = todayStr + " 00:00:00";
endTime = tomorrowStr + " 00:00:00";
System.out.println(starTime);
System.out.println(endTime);
// System.out.println(starTime);
// System.out.println(endTime);
QueryWrapper<ZyOrder> wrapper = new QueryWrapper<>();
wrapper.ge("create_time", starTime).le("create_time", endTime).eq("pay_status", 1);

@ -91,7 +91,7 @@ public class ZyShopServiceImpl implements ZyShopService {
@Override
public String selectOrderBetweenThisW() {
String start_time = GetTime.getLastSevenDay(7);
String end_time = String.format("%tF", date);
String end_time = String.format("%tF", date)+" 23:59:59";
return zyShopMapper.selectOrderBetweenThisW(start_time, end_time);
}
@ -103,7 +103,7 @@ public class ZyShopServiceImpl implements ZyShopService {
@Override
public Double selectSalesVolumeBetweenThisW() {
String start_time = GetTime.getLastSevenDay(7);
String end_time = String.format("%tF", date);
String end_time = String.format("%tF", date)+" 23:59:59";;
return zyShopMapper.selectSalesVolumeBetweenThisW(start_time, end_time);
}

@ -15,7 +15,7 @@
</select>
<!-- 查询该店铺当天所有销售额 -->
<select id="selectSalesVolumeByThisD" resultType="Integer">
<select id="selectSalesVolumeByThisD" resultType="Double">
SELECT total_money
FROM zy_order
WHERE shop_id = #{id}
@ -23,14 +23,14 @@
</select>
<!-- 查询近七日订单数 -->
<select id="selectOrderBetweenThisW" resultType="String">
<select id="selectOrderBetweenThisW" resultType="Integer">
select count(*)
from zy_orders
where payment_time BETWEEN #{start_time} AND #{end_time} AND ischild=0
</select>
<!-- 查询近七日销售额 -->
<select id="selectSalesVolumeBetweenThisW" resultType="Integer">
<select id="selectSalesVolumeBetweenThisW" resultType="Double">
SELECT sum(money) as total_money
FROM zy_orders
WHERE payment_time between #{start_time} and #{end_time} AND ischild=0

@ -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 ) &lt;= 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 ) &lt;= 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;
}
}

@ -1,5 +1,6 @@
package org.jeecg.modules.largeScreen;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@ -9,9 +10,12 @@ import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import org.jeecg.modules.demo.zyorders.service.IZyOrdersService;
import org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo;
import org.jeecg.modules.shop.vo.OrderSales;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.service.ISysDepartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
/**
@ -28,6 +32,9 @@ public class LargeScreenController {
@Autowired
private IZyOrdersService zyOrdersService;
@Autowired
private ISysDepartService sysDepartService;
/********************************************订单大数据监控系统********************************************/
@ -88,4 +95,24 @@ public class LargeScreenController {
}
}
//店铺list
@AutoLog(value = "获取今日订单及七日订单")
@ApiOperation(value = "获取今日订单及七日订单", notes = "获取今日订单及七日订单")
@GetMapping("/getShopList")
public Result<?> getShopList() {
QueryWrapper<SysDepart> qw=new QueryWrapper();
//查询店铺和网店
List<String> data=new ArrayList<>();
data.add("5");
data.add("4");
qw.in("org_category",data);
List<SysDepart> list = sysDepartService.list(qw);
if (list.isEmpty()){
return Result.OK("未查询到店铺信息");
}
return Result.OK(list);
}
}

Loading…
Cancel
Save