This commit is contained in:
DESKTOP-369JRHT\12997 2024-11-09 17:18:02 +08:00
parent c93515f1f2
commit adccfd43fd
19 changed files with 523 additions and 279 deletions

View File

@ -15,11 +15,6 @@
</div>
<div class="right-box">
<div class="d-s">
<!-- <div class="icon-img">-->
<!-- <img src="../../../src/assets/new/t-sousuo.png" alt="">-->
<!-- </div>-->
<!-- 搜索-->
<!-- </div>-->
<search id="header-search" class="right-menu-item"/>
<span style="margin-right: 10px; ">搜索</span>
<div class="d-s" @click="click">

View File

@ -2,7 +2,9 @@
<div v-if="!item.hidden">
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)">
<el-menu-item v-if="!isCollapse" :index="resolvePath(onlyOneChild.path)" style="padding-left: 20px;height: 48px" :class="{'submenu-title-noDropdown':!isNest}">
<el-menu-item v-if="!isCollapse" :index="resolvePath(onlyOneChild.path)"
ref="menu"
@open="handleOpen" style="padding-left: 20px;height: 48px" :class="{'submenu-title-noDropdown':!isNest}">
<!-- <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />-->
<span style="margin-left: 30px" v-if="onlyOneChild.meta.title!='系统首页'">{{onlyOneChild.meta.title}}</span>
<div v-else style="background-color: white;width: 200px;height: 100%;position: fixed;left: 0px">
@ -11,7 +13,9 @@
<span>{{onlyOneChild.meta.title}}</span>
</div>
</el-menu-item>
<el-menu-item v-if="isCollapse" :index="resolvePath(onlyOneChild.path)" style="padding-left: 20px;height: 60px" :class="{'submenu-title-noDropdown':!isNest}">
<el-menu-item v-if="isCollapse" :index="resolvePath(onlyOneChild.path)"
ref="menu"
@open="handleOpen" style="padding-left: 20px;height: 60px" :class="{'submenu-title-noDropdown':!isNest}">
<!-- <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />-->
<span style="margin-left: 30px" v-if="onlyOneChild.meta.title!='系统首页'">{{onlyOneChild.meta.title}}</span>
<div v-else style="background-color: white;width: 70px;height: 100%;position: fixed;left: 0px;text-align: center">
@ -23,7 +27,8 @@
</app-link>
</template>
<el-submenu v-else ref="subMenu" :style="{'height':isCollapse ? '60px':''}" :index="resolvePath(item.path)" popper-append-to-body >
<el-submenu v-else ref="subMenu" :style="{'height':isCollapse ? '60px':''}"
@open="handleOpen" :index="resolvePath(item.path)" popper-append-to-body >
<template slot="title">
<div v-if="!isCollapse" >
<!-- <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />-->
@ -174,10 +179,23 @@ export default {
data() {
this.onlyOneChild = null
return {
defaultActive:""
defaultActive:"",
keyIndex: 0
}
},
watch:{
$route () {
//
if (this.$route.path == '/index') {
this.$refs.menu.close(this.keyIndex);
this.$refs.subMenu.close(this.keyIndex);
}
}
},
methods: {
handleOpen(key) {
this.keyIndex = key;
},
hasOneShowingChild(children = [], parent) {
if (!children) {
children = [];

View File

@ -19,6 +19,8 @@
:collapse-transition="false"
style="margin-bottom: 80px;height: 60px"
mode="vertical"
ref="menu"
@open="handleOpen"
>
<sidebar-item
v-for="(route, index) in sidebarRouters"
@ -41,6 +43,8 @@
:collapse-transition="false"
style="margin-bottom: 80px;height: 48px"
mode="vertical"
ref="menu"
@open="handleOpen"
>
<sidebar-item
v-for="(route, index) in sidebarRouters"
@ -109,8 +113,28 @@ export default {
return '商户管理员';
}
}
},
data() {
return {
keyIndex: 0
}
};
},
watch:{
$route () {
//
if (this.$route.path == '/index') {
this.$refs.menu.close(this.keyIndex);
}
}
},
methods: {
handleOpen(key) {
this.keyIndex = key;
}
}
}
</script>
<style lang="scss" scoped>
@ -127,6 +151,7 @@ export default {
border-radius: 8px;
margin: 0px 6px 10px 6px;
cursor: pointer;
.name {
font-weight: bold;
font-size: 14px;
@ -134,6 +159,7 @@ export default {
text-align: center;
overflow: hidden;
}
.role {
font-size: 10px;
margin-top: 3px;

View File

@ -14,14 +14,12 @@
</div>
</div>
</template>
<script>
import RightPanel from '@/components/RightPanel'
import { AppMain, Navbar, Settings, Sidebar, TagsView } from './components'
import ResizeMixin from './mixin/ResizeHandler'
import { mapState } from 'vuex'
import variables from '@/assets/styles/variables.scss'
export default {
name: 'Layout',
components: {

View File

@ -34,10 +34,6 @@
</span>
</div>
</div>
<div style="height: 100%; width: 30%; display: flex; flex-direction: column; justify-content: space-between;">
<el-form ref="myForm" label-width="100px">
<el-form-item label="盘点单号">
@ -94,6 +90,7 @@
</el-col>
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
</el-row>
<div style="height: 71vh;overflow: auto; scrollbar-width: none">
<el-table ref="tables"
v-loading="loading"
:data="orderList"
@ -157,14 +154,10 @@
</el-table-column>
</el-table>
</div>
<!-- <pagination-->
<!-- v-show="total>0"-->
<!-- :total="total"-->
<!-- :page.sync="queryParams.page"-->
<!-- :limit.sync="queryParams.pageSize"-->
<!-- @pagination="getList"-->
<!-- />-->
</div>
<!-- 添加采购油品-->
@ -918,6 +911,5 @@ export default {
box-sizing: border-box;
padding: 15px;
margin: 10px;
height: 80vh;
}
</style>

View File

@ -2,7 +2,9 @@
<div v-if="!item.hidden">
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)">
<el-menu-item v-if="!isCollapse" :index="resolvePath(onlyOneChild.path)" style="padding-left: 20px;" :class="{'submenu-title-noDropdown':!isNest}">
<el-menu-item v-if="!isCollapse" :index="resolvePath(onlyOneChild.path)" style="padding-left: 20px;"
ref="menu"
@open="handleOpen" :class="{'submenu-title-noDropdown':!isNest}">
<!-- <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />-->
<span style="margin-left: 30px" v-if="onlyOneChild.meta.title!='系统首页'">{{onlyOneChild.meta.title}}</span>
<div v-else style="background-color: white;width: 200px;height: 100%;position: fixed;left: 0px">
@ -11,7 +13,9 @@
<span>{{onlyOneChild.meta.title}}</span>
</div>
</el-menu-item>
<el-menu-item v-if="isCollapse" :index="resolvePath(onlyOneChild.path)" style="padding-left: 20px;height: 60px" :class="{'submenu-title-noDropdown':!isNest}">
<el-menu-item v-if="isCollapse" :index="resolvePath(onlyOneChild.path)"
ref="menu"
@open="handleOpen" style="padding-left: 20px;height: 60px" :class="{'submenu-title-noDropdown':!isNest}">
<!-- <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />-->
<span style="margin-left: 30px" v-if="onlyOneChild.meta.title!='系统首页'">{{onlyOneChild.meta.title}}</span>
<div v-else style="background-color: white;width: 70px;height: 100%;position: fixed;left: 0px;text-align: center">
@ -24,7 +28,8 @@
</app-link>
</template>
<el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
<el-submenu v-else ref="subMenu"
@open="handleOpen" :index="resolvePath(item.path)" popper-append-to-body>
<template slot="title">
<div v-if="!isCollapse" >
<!-- <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />-->
@ -205,9 +210,23 @@ export default {
},
data() {
this.onlyOneChild = null
return {}
return {
keyIndex: 0
}
},
watch:{
$route () {
//
if (this.$route.path == '/index') {
this.$refs.menu.close(this.keyIndex);
this.$refs.subMenu.close(this.keyIndex);
}
}
},
methods: {
handleOpen(key) {
this.keyIndex = key;
},
hasOneShowingChild(children = [], parent) {
console.log('212')
if (!children) {

View File

@ -1,5 +1,6 @@
<template>
<div :class="{'has-logo':showLogo}" :style="{ backgroundColor: settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
<div :class="{'has-logo':showLogo}"
:style="{ backgroundColor: settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
<logo v-if="showLogo" :collapse="isCollapse"/>
<!-- <div class="store-info" v-if="storeName">-->
<!-- <div class="name">{{ storeName }}</div>-->
@ -17,6 +18,8 @@
:collapse-transition="false"
mode="vertical"
style="margin-bottom: 80px;"
ref="menu"
@open="handleOpen"
>
<sidebar-item
v-for="(route, index) in sidebarRouters"
@ -82,6 +85,26 @@ export default {
return '商户管理员';
}
}
},
data() {
return {
keyIndex: 0
}
},
watch: {
$route() {
//
if (this.$route.path == '/index') {
this.$refs.menu.close(this.keyIndex);
}
}
},
methods: {
handleOpen(key) {
this.keyIndex = key;
}
}
};
</script>
@ -97,6 +120,7 @@ export default {
border-radius: 2px;
margin: 0px 6px 10px 6px;
cursor: pointer;
.name {
font-weight: bold;
font-size: 14px;
@ -104,6 +128,7 @@ export default {
text-align: center;
overflow: hidden;
}
.role {
font-size: 10px;
margin-top: 3px;
@ -112,5 +137,4 @@ export default {
}
</style>

View File

@ -558,7 +558,11 @@
border
:data="dutyList">
<el-table-column label="序号" align="center" type="index" width="50"></el-table-column>
<el-table-column label="角色名称" align="center" prop="dutyName" />
<el-table-column label="角色名称" align="center" prop="dutyName" >
<template slot-scope="scope">
{{scope.row.dutyName}}
</template>
</el-table-column>
<!-- <el-table-column label="角色类型" align="center" prop="dutyType" >-->
<!-- <template slot-scope="scope">-->
<!-- <span v-if="scope.row.dutyType=='1'">超级管理员</span>-->
@ -699,12 +703,13 @@
<!-- <el-radio :key=1 :label=1 :value=1>启用</el-radio>-->
<!-- <el-radio :key=0 :label=0 :value=0>禁用</el-radio>-->
<!-- </el-radio-group>-->
<el-switch
v-model="form.accountStatus"
active-color="#13ce66"
inactive-color="#ff4949"
active-value="1"
inactive-value="0">
:active-value="1"
:inactive-value="0">
</el-switch>
</el-form-item>
</el-col>

View File

@ -19,9 +19,12 @@
</div>
<div class="hui_box">
<dai_yunyingfenxi-pay-type v-if="radio1 === '支付方式分析'"></dai_yunyingfenxi-pay-type>
<dai_yunyingfenxi-paym v-if="radio1 === '支付通道分析'"></dai_yunyingfenxi-paym>
</div>
</div>
</template>
<script>
@ -65,6 +68,10 @@ export default {
box-sizing: border-box;
//padding: 10px;
}
.hui_box{
box-sizing: border-box;
padding: 10px;
}
.app-top{
width: 100%;
//margin-bottom: 20px;

View File

@ -1,7 +1,7 @@
<!-- 收银台订单-->
<template>
<div style="padding-top: 15px; padding-right: 20px; background: #f6f8f9;padding-bottom: 15px">
<div class="card-change2" style="margin-left: 20px; padding-top: 0px;padding-bottom: 5px" shadow="never" >
<div >
<div class="top_box" shadow="never" >
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="120px" >
<div class="d-s" style="justify-content: space-between">
<div class="d-s">
@ -62,7 +62,7 @@
</div>
</div>
</div>
<div class="card-change" style="min-height: 500px; margin-left: 20px;margin-top: 20px" shadow="never">
<div class="card-change" shadow="never">
<div class="table-box">
<el-table
:data="orderList"
@ -293,23 +293,32 @@ export default {
</script>
<style scoped>
.box-card {
.top_box{
border-radius: 6px;
background: #fff;
box-sizing: border-box;
padding: 10px;
width: 100%;
margin: 0px 20px 4px 20px;
border: none;
box-shadow: none;
}
.table-box{
width: 100%;
height: 60vh;
scrollbar-width: none;
overflow: auto;
}
.center_box{
border-radius: 6px;
background: #fff;
box-sizing: border-box;
padding: 10px;
width: 100%;
margin: 5px auto;
}
.el-form--inline .el-form-item {
margin-right: 20px;
}
.table-box {
width: 100%;
height: 56vh;
overflow: auto;
}
.wrap-boxs {
width: 100%;
display: flex;

View File

@ -41,14 +41,14 @@
</div>
<template >
<div class="rl_box">
<yunyingfenxi-vip v-if="radio1 === '会员分析'"></yunyingfenxi-vip>
<yunyingfenxi-oil v-if="radio1 === '油品分析'"></yunyingfenxi-oil>
<yunyingfenxi-store v-if="radio1 === '便利店分析'"></yunyingfenxi-store>
<yunyingfenxi-int v-if="radio1 === '积分商城分析'"></yunyingfenxi-int>
<dai_yunyingfenxi-pay-type v-if="radio1 === '支付方式分析'"></dai_yunyingfenxi-pay-type>
<dai_yunyingfenxi-paym v-if="radio1 === '支付通道分析'"></dai_yunyingfenxi-paym>
</template>
</div>
</div>
</template>
@ -97,7 +97,6 @@ export default {
.app-center{
width: 100%;
box-sizing: border-box;
//padding: 10px;
}
.app-top{
width: 100%;
@ -126,15 +125,16 @@ background-color: #FFFFFF;
font-size: 14px;
color: #999999
}
.fount-box2{
font-size: 14px;
color: #999999
}
.heng-box{
background-color: #FF770F;
width: 100%;
height: 2px;
margin-top: 10px;
}
.rl_box{
width: 100%;
box-sizing: border-box;
padding: 10px;
padding-bottom: 0px;
}
</style>

View File

@ -1,7 +1,7 @@
<!-- 收银台订单-->
<template>
<div style="padding-top: 20px; padding-right: 20px; background: #f6f8f9;padding-bottom: 15px">
<div class="card-change2-1" shadow="never" style="margin-bottom: 25px;">
<div >
<div class="top_box" shadow="never" >
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="120px">
<div class="d-s" style="justify-content: space-between;width: 100%">
<div class="d-s">
@ -58,7 +58,7 @@
</div>
</div>
</div>
<div class="card-change-1" style="min-height: 500px;" shadow="never">
<div class="center_box" shadow="never">
<div class="table-box">
<el-table
:data="orderList"
@ -289,23 +289,33 @@ export default {
</script>
<style scoped>
.box-card {
.top_box{
border-radius: 6px;
background: #fff;
box-sizing: border-box;
padding: 10px;
width: 100%;
margin: 0px 20px 4px 20px;
border: none;
box-shadow: none;
}
.table-box{
width: 100%;
height: 57vh;
scrollbar-width: none;
overflow: auto;
}
.center_box{
border-radius: 6px;
background: #fff;
box-sizing: border-box;
padding: 10px;
width: 100%;
margin: 5px auto;
}
.el-form--inline .el-form-item {
margin-right: 20px;
}
.table-box {
width: 100%;
height: 52vh;
min-height: 600px;
overflow: auto;
}
.wrap-box {
width: 100%;

View File

@ -1,7 +1,7 @@
<!-- 油品分析 -->
<template>
<div style="padding-top: 20px; padding-right: 20px; background: #f6f8f9;padding-bottom: 15px">
<div class="card-change2-1" shadow="never" style="margin-bottom: 25px;">
<div >
<div class="top_box" shadow="never" >
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="120px">
<div class="d-s" style="justify-content: space-between;width: 100%">
<div class="d-s">
@ -68,9 +68,7 @@
</div>
</div>
</div>
<div class="card-change-1" style="min-height: 500px;" shadow="never">
<div class="center_box" shadow="never">
<div class="table-box" >
<el-table
:data="orderList"
@ -339,23 +337,32 @@ import {parseTime} from "@/utils/fuint";
</script>
<style scoped>
.box-card{
.top_box{
border-radius: 6px;
background: #fff;
box-sizing: border-box;
padding: 10px;
width: 100%;
margin: 0px 20px 4px 20px;
border: none;
box-shadow: none;
}
.table-box{
width: 100%;
height: 57vh;
scrollbar-width: none;
overflow: auto;
}
.center_box{
border-radius: 6px;
background: #fff;
box-sizing: border-box;
padding: 10px;
width: 100%;
margin: 5px auto;
}
.el-form--inline .el-form-item {
margin-right: 20px;
}
.table-box{
width: 100%;
height: 52vh;
min-height: 600px;
overflow: auto;
}
.wrap-box{
width: 100%;
display: flex;

View File

@ -1,7 +1,7 @@
<!-- 收银台订单-->
<template>
<div style="padding-top: 20px; padding-right: 20px; background: #f6f8f9;padding-bottom: 15px" >
<div class="card-change2-1" shadow="never" style="margin-bottom: 25px;">
<div >
<div class="top_box" shadow="never" >
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="120px" >
<div class="d-s" style="justify-content: space-between;width: 100%">
<div class="d-s">
@ -59,7 +59,7 @@
</div>
</div>
</div>
<div class="card-change-1" style="min-height: 500px;" shadow="never">
<div class="center_box" shadow="never">
<div class="table-box">
<el-table
:data="orderList"
@ -93,7 +93,7 @@
<el-table-column label="热销商品信息" align="center">
<el-table-column prop="goodsName" label="商品名称" width="100" align="center"></el-table-column>
<el-table-column prop="goodsNum" label="销售数量" width="100" align="center"></el-table-column>
<el-table-column prop="goodsAmount" label="销售金额 (元)" width="150" align="center"></el-table-column>
<el-table-column prop="goodsAmount" label="销售金额 (元)" width="100" align="center"></el-table-column>
<!-- <el-table-column prop="supplierName" label="供应商名称" width="100" align="center"></el-table-column>-->
</el-table-column>
<el-table-column prop="statDate" label="统计日期" width="200" align="center">
@ -312,23 +312,34 @@ import {parseTime} from "@/utils/fuint";
</script>
<style scoped>
.box-card{
.top_box{
border-radius: 6px;
background: #fff;
box-sizing: border-box;
padding: 10px;
width: 100%;
margin: 0px 20px 4px 20px;
border: none;
box-shadow: none;
}
.table-box{
width: 100%;
height: 57vh;
scrollbar-width: none;
overflow: auto;
}
.center_box{
border-radius: 6px;
background: #fff;
box-sizing: border-box;
padding: 10px;
width: 100%;
margin: 5px auto;
}
.el-form--inline .el-form-item {
margin-right: 20px;
}
.table-box{
width: 100%;
height: 52vh;
min-height: 600px;
overflow: auto;
}
.wrap-box{
width: 100%;
display: flex;

View File

@ -1,7 +1,7 @@
<!-- 收银台订单-->
<template>
<div class="" style="padding-top: 20px; padding-right: 20px; background: #f6f8f9;padding-bottom: 15px">
<div class="card-change2-1" style="padding-top: 20px; margin-bottom: 25px;" shadow="never">
<div class="" >
<div class="top_box"shadow="never">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="120px">
<el-form-item label="" prop="deptId" style="width: 180px">
<el-select
@ -53,7 +53,7 @@
</div>
</div>
</div>
<div class="card-change-1" style="min-height: 500px;" shadow="never">
<div class="center_box" shadow="never">
<div class="table-box">
<el-table
:data="orderList"
@ -236,23 +236,32 @@ import {getFenXiUserbalanceDataApi, getFenXiUserbalanceListApi} from "@/api/fina
</script>
<style scoped>
.box-card{
.top_box{
border-radius: 6px;
background: #fff;
box-sizing: border-box;
padding: 10px;
width: 100%;
margin: 0px 20px 4px 20px;
border: none;
box-shadow: none;
}
.table-box{
width: 100%;
height: 59vh;
scrollbar-width: none;
overflow: auto;
}
.center_box{
border-radius: 6px;
background: #fff;
box-sizing: border-box;
padding: 10px;
width: 100%;
margin: 5px auto;
}
.el-form--inline .el-form-item {
margin-right: 20px;
}
.table-box{
width: 100%;
height: 52vh;
min-height: 600px;
overflow: auto;
}
.wrap-box{
width: 100%;
display: flex;

View File

@ -57,11 +57,12 @@
<div style="margin-right: 40px">
<el-date-picker
v-model="value1"
type="daterange"
value-format="yyyy-MM-dd"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions"
@change="getStoreAmount">
</el-date-picker>
</div>
@ -162,11 +163,12 @@
<span style="margin-top: -10px;">
<el-date-picker
v-model="value2"
type="daterange"
type="datetimerange"
range-separator="至"
value-format="yyyy-MM-dd"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions"
:disabled="disabled"
@change="getStoreList()">
</el-date-picker>
@ -232,13 +234,18 @@ export default {
bannerList:{},
storeList:[],
hardwareList:[],
noticeList:[]
noticeList:[],
pickerOptions: {
disabledDate: time => {
return time.getTime() > new Date();
}
}
}
},
created() {
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000)
this.value1 = [formatDate(oneWeekAgo),formatDate(nowDate)]
this.value1 = [parseTime(oneWeekAgo),parseTime(nowDate)]
this.getStoreTotal()
this.selectChildByDeptIdApi()
// this.getStoreAmount()
@ -304,7 +311,7 @@ export default {
}
this.getStoreList()
},
getStoreList(){
getStoreList(val){
getStoreAmountByTime(this.addDateRange({},this.value2)).then(res => {
this.storeList = res.data
this.initChart()

View File

@ -63,6 +63,7 @@
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions"
@change="getStoreAmount">
</el-date-picker>
</div>
@ -173,6 +174,7 @@
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions"
:disabled="disabled"
@change="getStoreList()">
</el-date-picker>
@ -236,7 +238,12 @@ export default {
bannerList:{},
storeList:[],
hardwareList:[],
noticeList:[]
noticeList:[],
pickerOptions: {
disabledDate: time => {
return time.getTime() > new Date();
}
}
}
},
created() {

View File

@ -1732,7 +1732,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
}
Double averagePrice = tradeAmount / tradeTotal;
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
Double dayTradeAmount = 0.0;
Integer dayTradeTotal = 0;

View File

@ -61,6 +61,8 @@ import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.concurrent.TimeUnit;
@ -752,7 +754,7 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
for (MtStore mtStore : mtStores) {
storeIds.add(mtStore.getId());
}
List<StoreNumVo> storeNumVos = null;
List<StoreNumVo> storeNumVos = new ArrayList<>();
if (ObjectUtil.isNotEmpty(store.getParams()) && ObjectUtil.isNotEmpty(store.getParams().get("beginTime"))
&& ObjectUtil.isNotEmpty(store.getParams().get("endTime"))){
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@ -770,12 +772,60 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
try {
if (!today.after( dateFormat.parse(store.getParams().get("beginTime").toString()) )){
storeNumVos = baseMapper.selectStoreNum(store, storeIds);
List<String> allDatesBetweenDay = getAllDatesBetweenDay(store.getParams().get("beginTime").toString(), store.getParams().get("endTime").toString());
List<StoreNumVo> storeNumVos1 = baseMapper.selectStoreNum(store, storeIds);
for (String time : allDatesBetweenDay) {
StoreNumVo storeNumVo = new StoreNumVo();
storeNumVo.setTradeTime(time);
storeNumVo.setTradeNum(0);
storeNumVo.setStoreNum(0);
storeNumVo.setTradeAmount(0.0);
for (StoreNumVo numVo : storeNumVos1) {
if (numVo.getTradeTime().equals(time)){
storeNumVo.setTradeNum(numVo.getTradeNum());
storeNumVo.setStoreNum(numVo.getStoreNum());
storeNumVo.setTradeAmount(numVo.getTradeAmount());
}
}
storeNumVos.add(storeNumVo);
}
}else {
if (yearDay.before(dateFormat.parse(store.getParams().get("beginTime").toString()))){
storeNumVos = baseMapper.selectStoreNumByDay(store, storeIds);
List<String> allDatesBetweenMonth = getAllDatesBetweenMonth(store.getParams().get("beginTime").toString(), store.getParams().get("endTime").toString());
List<StoreNumVo> storeNumVos1 = baseMapper.selectStoreNumByDay(store, storeIds);
for (String time : allDatesBetweenMonth) {
StoreNumVo storeNumVo = new StoreNumVo();
storeNumVo.setTradeTime(time);
storeNumVo.setTradeNum(0);
storeNumVo.setStoreNum(0);
storeNumVo.setTradeAmount(0.0);
for (StoreNumVo numVo : storeNumVos1) {
if (numVo.getTradeTime().equals(time)){
storeNumVo.setTradeNum(numVo.getTradeNum());
storeNumVo.setStoreNum(numVo.getStoreNum());
storeNumVo.setTradeAmount(numVo.getTradeAmount());
}
}
storeNumVos.add(storeNumVo);
}
}else {
storeNumVos = baseMapper.selectStoreNumByMonth(store, storeIds);
List<String> allDatesBetweenYear = getAllDatesBetweenYear(store.getParams().get("beginTime").toString(), store.getParams().get("endTime").toString());
List<StoreNumVo> storeNumVos1 = baseMapper.selectStoreNumByMonth(store, storeIds);
for (String time : allDatesBetweenYear) {
StoreNumVo storeNumVo = new StoreNumVo();
storeNumVo.setTradeTime(time);
storeNumVo.setTradeNum(0);
storeNumVo.setStoreNum(0);
storeNumVo.setTradeAmount(0.0);
for (StoreNumVo numVo : storeNumVos1) {
if (numVo.getTradeTime().equals(time)){
storeNumVo.setTradeNum(numVo.getTradeNum());
storeNumVo.setStoreNum(numVo.getStoreNum());
storeNumVo.setTradeAmount(numVo.getTradeAmount());
}
}
storeNumVos.add(storeNumVo);
}
}
}
}catch (Exception e){
@ -786,6 +836,56 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
return storeNumVos;
}
public List<String> getAllDatesBetweenYear(String startTime, String endTime) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("yyyy-MM");
LocalDate startDate = LocalDate.parse(startTime, formatter);
LocalDate endDate = LocalDate.parse(endTime, formatter);
List<String> dateList = new ArrayList<>();
while (!startDate.isAfter(endDate)) {
dateList.add(startDate.format(formatter1));
startDate = startDate.plusMonths(1);
}
return dateList;
}
public List<String> getAllDatesBetweenDay(String startTime, String endTime) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("HH:mm");
LocalDateTime startDate = LocalDateTime.parse(startTime, formatter);
LocalDateTime endDate = LocalDateTime.parse(endTime, formatter);
List<String> dateList = new ArrayList<>();
while (!startDate.isAfter(endDate)) {
dateList.add(startDate.format(formatter1));
startDate = startDate.plusHours(1);
}
return dateList;
}
public List<String> getAllDatesBetweenMonth(String startTime, String endTime) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDateTime startDate = LocalDateTime.parse(startTime, formatter);
LocalDateTime endDate = LocalDateTime.parse(endTime, formatter);
List<String> dateList = new ArrayList<>();
while (!startDate.isAfter(endDate)) {
dateList.add(startDate.format(formatter1));
startDate = startDate.plusDays(1);
}
return dateList;
}
@Override
public List<MtStore> getStoreByDeptId(Integer deptId) {
QueryWrapper queryWrapper = new QueryWrapper<>();