This commit is contained in:
cun-nan 2024-07-22 15:52:21 +08:00
parent 8ba1d5b094
commit db0c92e6a5
40 changed files with 1233 additions and 272 deletions

View File

@ -17,3 +17,12 @@ export function storeAmountIndex(query) {
params: query
})
}
// 查询首页店铺金额信息
export function selectStoreAmount(query) {
return request({
url: '/backendApi/store/selectStoreAmount',
method: 'get',
params: query
})
}

View File

@ -101,3 +101,12 @@ export function getOrderNumApi(query) {
})
}
// 查询店铺列表
export function getStorelist(query) {
return request({
url: '/business/storeInformation/store/selectListDept',
method: 'get',
params: query
})
}

View File

@ -9,8 +9,8 @@
</div>
</div>
<jcindex :id="id" v-if="tabindex == 0"></jcindex>
<payment :id="id" :deptId="deptId" v-if="tabindex == 1" ></payment>
<way :id="id" v-if="tabindex == 2" ></way>
<payment :id="id" :deptId="deptId" v-if="tabindex == 1" ></payment>
<way :id="id" :deptId="deptId" v-if="tabindex == 2" ></way>
<staff :id="id" v-if="tabindex == 3" ></staff>
<allOrder :id="id" v-if="tabindex == 4"></allOrder>
@ -66,7 +66,7 @@
},
{
name:'way',
title:'付方式',
title:'方式',
component:way
},
{

View File

@ -3,40 +3,50 @@
<el-card >
<div class="top-box">
<div class="d-s">
<el-input v-model="form.name" placeholder="请输入油站名称" style="width: 200px;margin-right: 15px;"></el-input>
<el-select v-model="value" placeholder="请选择所属机构" style="width: 200px;margin-right: 15px;">
<el-input v-model="queryParams.name" placeholder="请输入油站名称" style="width: 200px;margin-right: 15px;"></el-input>
<el-select v-model="queryParams.contractDeptId" placeholder="请选择所属机构" style="width: 200px;margin-right: 15px;">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
v-for="item in deptListSelect"
:key="item.deptId"
:label="item.deptName"
:value="item.deptId+''"
></el-option>
</el-select>
<el-select v-model="value" placeholder="请选择油站状态" style="width: 200px;margin-right: 15px;">
<el-select v-model="queryParams.status" placeholder="请选择油站状态" style="width: 200px;margin-right: 15px;">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
v-for="dict in dict.type.zhzt"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<el-select v-model="value" placeholder="请选择计费方式" style="width: 200px;margin-right: 15px;">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
<el-select v-model="queryParams.turnoverType" placeholder="请选择计费方式" style="width: 200px;margin-right: 15px;">
<el-option value="1" label="无限制"></el-option>
<el-option value="2" label="时间限制"></el-option>
<el-option value="3" label="预付费"></el-option>
<el-option value="4" label="后付费"></el-option>
<el-option value="5" label="年付费"></el-option>
<el-option value="6" label="可创建油站站点数量"></el-option>
</el-select>
<el-date-picker
v-model="value"
v-model="beginTime"
style="width: 140px"
type="date"
placeholder="选择日期">
value-format="yyyy-MM-dd"
placeholder="开始日期">
</el-date-picker>
<el-date-picker
v-model="endTime"
style="width: 140px"
type="date"
value-format="yyyy-MM-dd"
placeholder="结束日期">
</el-date-picker>
</div>
<div class="d-s">
<el-button type="primary" icon="el-icon-search">搜索</el-button>
<el-button icon="el-icon-refresh-right">重置</el-button>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh-right" @click="resetQuery">重置</el-button>
</div>
</div>
@ -51,52 +61,66 @@
width="50">
</el-table-column>
<el-table-column
prop="date"
prop="name"
align="center"
label="油站名称"
>
</el-table-column>
<el-table-column
prop="name"
prop="deptName"
align="center"
label="所属机构"
>
</el-table-column>
<el-table-column
prop="name"
prop="leaderName"
align="center"
width="100"
label="油站负责人"
>
</el-table-column>
<el-table-column
prop="name"
prop="leaderPhone"
align="center"
label="联系电话"
>
</el-table-column>
<el-table-column
prop="name"
prop="turnoverType"
align="center"
width="80"
label="计费方式"
>
<template slot-scope="scope">
<span v-if="scope.row.turnoverType == 1">无限制</span>
<span v-if="scope.row.turnoverType == 2">时间限制</span>
<span v-if="scope.row.turnoverType == 3">预付费</span>
<span v-if="scope.row.turnoverType == 4">后付费</span>
<span v-if="scope.row.turnoverType == 5">年付费</span>
<span v-if="scope.row.turnoverType == 6">可创建油站站点数量</span>
</template>
</el-table-column>
<el-table-column
prop="name"
prop="remind"
align="center"
label="到期提醒"
>
<template slot-scope="scope">
<span>{{ scope.row.remind || "--" }}</span>
</template>
</el-table-column>
<el-table-column
prop="name"
prop="userTotal"
align="center"
label="会员人数"
width="80"
>
<template slot-scope="scope">
<span>{{ scope.row.userTotal || 0 }}</span>
</template>
</el-table-column>
<el-table-column
prop="name"
prop="status"
align="center"
width="80"
label="油站状态"
@ -104,6 +128,8 @@
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
active-value="qy"
inactive-value="jy"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
@ -111,7 +137,7 @@
</template>
</el-table-column>
<el-table-column
prop="name"
prop="createTime"
align="center"
label="创建时间"
>
@ -123,8 +149,8 @@
label="操作">
<template slot-scope="scope">
<div style="display: flex;justify-content: center;width: 100%">
<div style="color: #409EFF;cursor: pointer;margin: 0 10px">进入油站</div>
<div style="color: #409EFF;cursor: pointer;margin: 0 10px">查看详情</div>
<div style="color: #409EFF;cursor: pointer;margin: 0 10px" v-hasPermi="['Service:enter']" @click="enterThePetrolStation(scope.row)">进入油站</div>
<div style="color: #409EFF;cursor: pointer;margin: 0 10px" @click="godetails(scope.row.id,scope.row.contractDeptId)">查看详情</div>
</div>
@ -135,70 +161,73 @@
<el-pagination
background
layout="prev, pager, next"
:total="1000">
:total="total">
</el-pagination>
</div>
</el-card>
<el-card style="margin-top: 20px" v-for="(item,index) in arrlist" :key="index">
<div slot="header" class="clearfix">
<span>{{item.storeName || ''}}</span>
<!-- <el-card style="margin-top: 20px" v-for="(item,index) in arrlist" :key="index">-->
<!-- <div slot="header" class="clearfix">-->
<!-- <span>{{item.storeName || ''}}</span>-->
</div>
<div class="box-wrap">
<div class="zong-box" v-for="(items,index) in item.storeList" :key="index" >
<div class="pur-box" @click="godetails(items.id,items.contractDeptId)">
<el-tag type="success" v-if="items.status=='qy'">启用</el-tag>
<el-tag type="danger" v-else>禁用</el-tag>
<div class="disper-box">
<div class="box-img">
<img v-if="items.logo" :src="imagePath + items.logo" style="width: 96px;height: 96px">
<img v-else src="https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png" style="width: 96px;height: 96px">
</div>
<div >
<div class="title">{{items.name || ''}}</div>
<div class="box-hui">
<div>注册时间</div>
<div>{{ items.createTime.substring(0,10) || ''}}</div>
</div>
<div class="box-hui">
<div>联系人</div>
<div>{{items.contact || '暂无'}}</div>
</div>
<div class="box-hui">
<div>联系电话</div>
<div>{{items.phone || '暂无'}}</div>
</div>
</div>
</div>
<!-- </div>-->
<!-- <div class="box-wrap">-->
<!-- <div class="zong-box" v-for="(items,index) in item.storeList" :key="index" >-->
<!-- <div class="pur-box" @click="godetails(items.id,items.contractDeptId)">-->
<!-- <el-tag type="success" v-if="items.status=='qy'">启用</el-tag>-->
<!-- <el-tag type="danger" v-else>禁用</el-tag>-->
<!-- <div class="disper-box">-->
<!-- <div class="box-img">-->
<!-- <img v-if="items.logo" :src="imagePath + items.logo" style="width: 96px;height: 96px">-->
<!-- <img v-else src="https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png" style="width: 96px;height: 96px">-->
<!-- </div>-->
<!-- <div >-->
<!-- <div class="title">{{items.name || ''}}</div>-->
<!-- <div class="box-hui">-->
<!-- <div>注册时间</div>-->
<!-- <div>{{ items.createTime.substring(0,10) || ''}}</div>-->
<!-- </div>-->
<!-- <div class="box-hui">-->
<!-- <div>联系人</div>-->
<!-- <div>{{items.contact || '暂无'}}</div>-->
<!-- </div>-->
<!-- <div class="box-hui">-->
<!-- <div>联系电话</div>-->
<!-- <div>{{items.phone || '暂无'}}</div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
</div>
<div class="hui-bottom">
<div>
<div class="shang-biao">{{item.storeList.length || 0}}</div>
<div class="xia-biao">创建门店数</div>
</div>
<div>
<!-- <div class="shang-biao">{{ items.userNum}}</div> -->
<div class="shang-biao">{{ items.userNum}}</div>
<div class="xia-biao">会员数</div>
</div>
<div>
<div class="shang-biao">{{ items.orderNum}}</div>
<div class="xia-biao">支付订单</div>
</div>
</div>
</div>
<!-- </div>-->
<!-- <div class="hui-bottom">-->
<!-- <div>-->
<!-- <div class="shang-biao">{{item.storeList.length || 0}}</div>-->
<!-- <div class="xia-biao">创建门店数</div>-->
<!-- </div>-->
<!-- <div>-->
<!-- &lt;!&ndash; <div class="shang-biao">{{ items.userNum}}</div> &ndash;&gt;-->
<!-- <div class="shang-biao">{{ items.userNum}}</div>-->
<!-- <div class="xia-biao">会员数</div>-->
<!-- </div>-->
<!-- <div>-->
<!-- <div class="shang-biao">{{ items.orderNum}}</div>-->
<!-- <div class="xia-biao">支付订单</div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
</div>
</el-card>
<!-- </div>-->
<!-- </el-card>-->
</div>
</template>
<script>
import { Storelist,getUserNumApi,
getOrderNumApi } from "@/api/service/service";
import {
Storelist, getUserNumApi,
getOrderNumApi, getStorelist, singleSignOnApi
} from "@/api/service/service";
import {selectChildByDeptId} from "@/api/system/Site/site";
export default {
name: 'service',
dicts: ['zhzt'],
@ -254,18 +283,61 @@ export default {
arrlist:[],
value1:'',
queryParams: {
storeName: '',
name: '',
contractDeptId:'',
status: '',
pageNo: 1,
pageSize: 10,
},
beginTime:"",
endTime:"",
deptListSelect:[]
}
},
created() {
this.getStoreList();
this.selectChildByDeptIdApi();
},
async mounted() {
await this.getlist()
},
methods:{
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
name: '',
contractDeptId:'',
status: '',
pageNo: 1,
pageSize: 10,
}
this.beginTime = ''
this.endTime = ''
this.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getStoreList();
},
//
selectChildByDeptIdApi() {
selectChildByDeptId().then(res => {
this.deptListSelect = res.data
})
},
getStoreList(){
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime)
dateRange.push(this.endTime)
}
getStorelist(this.addDateRange(this.queryParams,dateRange)).then(res => {
this.tableData = res.data.records
this.total = res.data.total
})
},
async getlist(){
await Storelist(this.queryParams).then(res=>{
console.log(res)
@ -294,6 +366,19 @@ export default {
})
},
enterThePetrolStation(data) {
if (data.status === 'jy') {
this.$message('该油站已被禁用');
return
}
singleSignOnApi(data.id).then(res=>{
if (res.code == 200) {
window.open(this.pcUrl+'index?entrance='+data.id)
}
})
},
}
}

View File

@ -9,7 +9,7 @@
说明为了保证加油站商户日常在线支付业务的稳定性目前支持多通道支付可以有效的避免单支付通道带来不稳定性从而造成油站不能正常支付问题加油站一旦出现不能正常支付的情况可以随时手工切换支付通道来保证加油站支付收款业务
</div>
</div>
<div class="o-button" @click="addMerchantShow()">新增商户信息</div>
<div class="o-button" v-hasPermi="['Merchant:add']" @click="addMerchantShow()">新增商户信息</div>
</div>
<el-table
:data="merchantList"
@ -79,7 +79,7 @@
width="100"
label="操作">
<template slot-scope="scope">
<div style="color: #409EFF;cursor: pointer" @click="editMerchant(scope.row)">修改</div>
<div style="color: #409EFF;cursor: pointer" v-hasPermi="['Merchant:edit']" @click="editMerchant(scope.row)">修改</div>
</template>
</el-table-column>
</el-table>
@ -91,7 +91,7 @@
注意:功能状态启用且通道规则发布生效后当前功能才有效,否则使用系统单商户号模式
</div>
</div>
<div class="o-button" @click="addRules()">新增规则</div>
<div class="o-button" v-hasPermi="['payment:add']" @click="addRules()">新增规则</div>
</div>
<el-table
:data="tableData1"
@ -193,8 +193,8 @@
label="操作">
<template slot-scope="scope">
<div style="display: flex;justify-content: center;width: 100%">
<div style="color: #409EFF;cursor: pointer;margin: 0 10px" @click="editRule(scope.row)">修改</div>
<div style="color: #409EFF;cursor: pointer;margin: 0 10px" @click="deleteRule(scope.row)">删除</div>
<div style="color: #409EFF;cursor: pointer;margin: 0 10px" v-hasPermi="['payment:edit']" @click="editRule(scope.row)">修改</div>
<div style="color: #409EFF;cursor: pointer;margin: 0 10px" v-hasPermi="['payment:delete']" @click="deleteRule(scope.row)">删除</div>
<div style="color: #409EFF;cursor: pointer;margin: 0 10px" @click="EnableRule(scope.row)">启用</div>
</div>

View File

@ -1,8 +1,12 @@
<script >
import {Userlist} from "@/api/system/Site/site";
export default {
props:['deptId'],
data() {
return {
value: true,
storeDeptInfo:{},
tableData: [{
date: '2016-05-02',
name: '王小虎',
@ -21,6 +25,16 @@ export default {
address: '上海市普陀区金沙江路 1516 弄'
}]
}
},
created() {
this.getInfo()
},
methods:{
getInfo(){
Userlist(this.deptId).then(res => {
this.storeDeptInfo = res.data
})
},
}
}
</script>
@ -29,26 +43,31 @@ export default {
<div class="container-app">
<div class="d-s">
<div class="left-size">机构名称</div>
<div>百业兴连锁加油站</div>
<div>{{ storeDeptInfo.deptName || "--" }}</div>
</div>
<div class="d-s">
<div class="left-size">负责人姓名</div>
<div>xxxx</div>
<div>{{ storeDeptInfo.leaderName || "--" }}</div>
</div>
<div class="d-s">
<div class="left-size">负责人电话</div>
<div>15012345678</div>
<div>{{ storeDeptInfo.leaderPhone || "--" }}</div>
</div>
<div class="d-s">
<div class="left-size">机构类型</div>
<div>连锁店</div>
<div v-if="storeDeptInfo.deptType==1">代理商</div>
<div v-if="storeDeptInfo.deptType==2">连锁店</div>
<div v-if="storeDeptInfo.deptType==3">基本门店</div>
<div v-if="storeDeptInfo.deptType==4">三方机构</div>
</div>
<div class="d-s">
<div class="left-size">计费方式</div>
<div>年付费</div>
<div>预付费</div>
<div>后付费</div>
<div>无限制</div>
<div v-if="storeDeptInfo.turnoverType==1">无限制</div>
<div v-if="storeDeptInfo.turnoverType==2">时间限制</div>
<div v-if="storeDeptInfo.turnoverType==3">预付费</div>
<div v-if="storeDeptInfo.turnoverType==4">后付费</div>
<div v-if="storeDeptInfo.turnoverType==5">年付费</div>
<div v-if="storeDeptInfo.turnoverType==6">可创建油站站点数量</div>
</div>
<!-- 年付费 -->
<el-table
@ -194,19 +213,28 @@ export default {
label="创建人">
</el-table-column>
</el-table>
<!-- 无限制 -->
<!-- 时间限制限制 -->
<div class="d-s" v-if="storeDeptInfo.turnoverType==2">
<div class="left-size">开始时间</div>
<div>{{ storeDeptInfo.turnoverStartTime }}</div>
<div class="left-size">结束时间</div>
<div>{{ storeDeptInfo.turnoverEndTime }}</div>
</div>
<div class="d-s">
<div class="left-size">机构状态</div>
<div><el-switch
v-model="value"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
<div>
<el-switch
v-model="storeDeptInfo.status"
active-value="qy"
inactive-value="jy"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</div>
</div>
<div class="d-s">
<div class="left-size">备注</div>
<div>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
<div>--</div>
</div>
</div>
</template>

View File

@ -1,8 +1,14 @@
<template>
<div class="app-container">
<div class="bannser">
<img src="../../assets/images/banner.png" alt="" >
</div>
<el-carousel height="230px">
<el-carousel-item v-for="(item,index) in bannerList" :key="index">
<div class="bannser">
<!-- <img src="../../assets/images/banner.png" alt="" >-->
<img :src="imagePath+item.productImage" alt="" >
</div>
</el-carousel-item>
</el-carousel>
<div class="b-bs">
<div class="left-box">
<div class="san-box">
@ -158,6 +164,7 @@ import echarts from "echarts";
import {storeAmountIndex, storeTotalIndex} from "@/api/indexBanner";
import {selectChildByDeptId} from "@/api/system/Site/site";
import {parseTime} from "@/utils/fuint";
import {getBannerListApi} from "@/api/sys/banner";
export default {
data(){
@ -195,6 +202,8 @@ export default {
storeTotal:{},
//
storeAmount:{},
// banner
bannerList:{},
}
},
created() {
@ -204,11 +213,22 @@ export default {
this.getStoreTotal()
this.selectChildByDeptIdApi()
this.getStoreAmount()
this.selectBannerList()
},
mounted() {
this.initChart()
},
methods:{
selectBannerList(){
let queryParams = {
pageNo:1,
pageSize:10,
system_position:"系统首页"
}
getBannerListApi(queryParams).then(res=>{
this.bannerList = res.data.records
})
},
//
selectChildByDeptIdApi() {
selectChildByDeptId().then(res => {

View File

@ -1,10 +1,11 @@
<template>
<div class="app-container">
<el-carousel height="230px">
<el-carousel-item v-for="item in 4" :key="item">
<el-carousel-item v-for="(item,index) in bannerList" :key="index">
<div class="bannser">
<img src="../../assets/images/banner.png" alt="" >
<!-- <img src="../../assets/images/banner.png" alt="" >-->
<img :src="imagePath+item.productImage" alt="" >
</div>
</el-carousel-item>
</el-carousel>
@ -64,7 +65,7 @@
</el-date-picker>
</div>
<div style="margin-right: 40px">
<el-select v-model="value" clearable placeholder="请选择">
<el-select v-model="value" clearable placeholder="请选择" @change="chooseDept()">
<el-option
v-for="item in options"
:key="item.deptId"
@ -140,7 +141,7 @@
<div class="bottom_">
<div class="h-tt" style="margin-bottom: 15px" >数据统计</div>
<div class="d-s">
<div class="anniu-h" :class="{ 'anniu-act': index == 0 }" v-for="(item,index) in timeList" :key="index">
<div class="anniu-h" :class="{ 'anniu-act': index == timeIndex }" v-for="(item,index) in timeList" :key="index" @click="editColor(index)">
{{item}}
</div>
<el-date-picker
@ -149,7 +150,8 @@
range-separator="至"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期"
end-placeholder="结束日期">
end-placeholder="结束日期"
@change="getStoreList()">
</el-date-picker>
</div>
<div id="ctct" style="width: 100%; height: 315px;background: linear-gradient( 360deg, #F8F0E7 0%, #FFFFFF 100%); "></div>
@ -161,9 +163,10 @@
<script>
import echarts from "echarts";
import {storeAmountIndex, storeTotalIndex} from "@/api/indexBanner";
import {selectStoreAmount, storeAmountIndex, storeTotalIndex} from "@/api/indexBanner";
import {selectChildByDeptId} from "@/api/system/Site/site";
import {parseTime} from "@/utils/fuint";
import {getBannerListApi} from "@/api/sys/banner";
export default {
data(){
@ -175,7 +178,7 @@ export default {
"近一月",
"近一年",
],
timeIndex:0,
options: [{
value: '选项1',
label: '黄金糕'
@ -201,6 +204,9 @@ export default {
storeTotal:{},
//
storeAmount:{},
// banner
bannerList:{},
storeList:[]
}
},
created() {
@ -210,11 +216,68 @@ export default {
this.getStoreTotal()
this.selectChildByDeptIdApi()
this.getStoreAmount()
this.selectBannerList()
let start = new Date();
start.setHours(0)
start.setMinutes(0)
start.setSeconds(0)
start.setMilliseconds(0)
this.value2 = [start,new Date()];
this.getStoreList()
},
mounted() {
this.initChart()
// this.initChart()
},
methods:{
editColor(index){
this.timeIndex = index
if (this.timeList[index]=='今日'){
let start = new Date();
start.setHours(0)
start.setMinutes(0)
start.setSeconds(0)
start.setMilliseconds(0)
this.value2 = [start,new Date()];
} else if (this.timeList[index]=='近一周'){
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000)
this.value2 = [parseTime(oneWeekAgo),parseTime(nowDate)]
} else if (this.timeList[index]=='近一月'){
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 30 * 24 * 60 * 60 * 1000)
this.value2 = [parseTime(oneWeekAgo),parseTime(nowDate)]
} else if (this.timeList[index]=='近一年'){
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getFullYear() - 1, nowDate.getMonth(), nowDate.getDate())
this.value2 = [parseTime(oneWeekAgo),parseTime(nowDate)]
}
this.getStoreList()
},
getStoreList(){
selectStoreAmount(this.addDateRange({},this.value2)).then(res => {
this.storeList = res.data
this.initChart()
})
},
//
chooseDept(){
this.options.forEach(item => {
if (item.deptId == this.value){
this.queryParams.ancestors = item.ancestors
}
})
this.getStoreAmount()
},
selectBannerList(){
let queryParams = {
pageNo:1,
pageSize:10,
system_position:"系统首页"
}
getBannerListApi(queryParams).then(res=>{
this.bannerList = res.data.records
})
},
//
selectChildByDeptIdApi() {
selectChildByDeptId().then(res => {
@ -229,14 +292,50 @@ export default {
getStoreAmount(){
storeAmountIndex(this.addDateRange(this.queryParams,this.value1)).then(res => {
this.storeAmount = res.data
this.initChart()
})
},
countPercentage(upNum,downNum){
let percentage = 0;
percentage = (upNum / downNum)*100
return percentage.toFixed(2)
},
initChart() {
const chart = echarts.init(document.getElementById('ccc'))
const chart1 = echarts.init(document.getElementById('cccc'))
const chart2= echarts.init(document.getElementById('ccct'))
const chart3= echarts.init(document.getElementById('ctct'))
let dataList = []
let allTotal = 0
if (this.storeAmount.oilNameList) {
this.storeAmount.oilNameList.forEach(item => {
allTotal += item.countNum
})
this.storeAmount.oilNameList.forEach(item => {
let data = {value: 0, name: ""}
data.value = this.countPercentage(item.countNum, allTotal);
data.name = item.oilName + item.oilType + "占比"
dataList.push(data)
})
}
let storeNameList = []
let oilAmountList = []
let noOilAmountList = []
let rechargeBalanceList = []
let consumeBalanceList = []
let userBalanceList = []
if (this.storeList.length>0) {
this.storeList.forEach(item => {
storeNameList.push(item.storeName)
oilAmountList.push(item.oilAmount)
noOilAmountList.push(item.noOilAmount)
rechargeBalanceList.push(item.userRechargeBalance)
consumeBalanceList.push(item.userConsumeBalance)
userBalanceList.push(item.userBalance)
})
}
const option = {
color: [
@ -255,14 +354,15 @@ export default {
type: 'pie',
roseType: 'area',
radius: [5, '80%'],
data: [
{ value: 36, name: '#98汽油占比' },
{ value: 42, name: '0#柴油占比' },
{ value: 40, name: '#95汽油占比' },
{ value: 38, name: '#92柴油占比' },
],
// data: [
// { value: 36, name: '#98' },
// { value: 42, name: '0#' },
// { value: 40, name: '#95' },
// { value: 38, name: '#92' },
//
//
// ],
data: dataList,
emphasis: {
itemStyle: {
shadowBlur: 10,
@ -289,8 +389,10 @@ export default {
type: 'pie',
radius: '80%',
data: [
{ value: 28, name: '28%' },
{ value: 72, name: '72%' },
// { value: 28, name: '28%' },
// { value: 72, name: '72%' },
{ value: this.countPercentage(Number(this.storeAmount.oilNum),Number(this.storeAmount.oilNum)+Number(this.storeAmount.noOilNum)), name: "油品交易占比" },
{ value: this.countPercentage(Number(this.storeAmount.noOilNum),Number(this.storeAmount.oilNum)+Number(this.storeAmount.noOilNum)), name: "非油品交易占比" },
],
emphasis: {
@ -320,10 +422,14 @@ export default {
type: 'pie',
radius: [50, '80%'],
data: [
{ value: 28, name: '会员充值占比' },
{ value: 72, name: '积分商城交易占比' },
{ value: 28, name: '油品交易占比' },
{ value: 72, name: '便利店交易占比' },
// { value: 28, name: '' },
// { value: 72, name: '' },
// { value: 28, name: '' },
// { value: 72, name: '便' },
{ value: this.countPercentage(Number(this.storeAmount.userNum),Number(this.storeAmount.oilNum)+Number(this.storeAmount.userNum)+Number(this.storeAmount.integralNum)+Number(this.storeAmount.goodNum)), name: '会员充值占比' },
{ value: this.countPercentage(Number(this.storeAmount.integralNum),Number(this.storeAmount.oilNum)+Number(this.storeAmount.userNum)+Number(this.storeAmount.integralNum)+Number(this.storeAmount.goodNum)), name: '积分商城交易占比' },
{ value: this.countPercentage(Number(this.storeAmount.oilNum),Number(this.storeAmount.oilNum)+Number(this.storeAmount.userNum)+Number(this.storeAmount.integralNum)+Number(this.storeAmount.goodNum)), name: '油品交易占比' },
{ value: this.countPercentage(Number(this.storeAmount.goodNum),Number(this.storeAmount.oilNum)+Number(this.storeAmount.userNum)+Number(this.storeAmount.integralNum)+Number(this.storeAmount.goodNum)), name: '便利店交易占比' },
],
emphasis: {
@ -349,12 +455,13 @@ export default {
},
legend: {
data: ['Evaporation', '会员余额', '会员充值金额','会员消费金额','油品交易额','非油品交易额']
data: ['Evaporation','油品交易额','非油品交易额', '会员充值金额','会员消费金额', '会员余额']
},
xAxis: [
{
type: 'category',
data: ['中建锦绣广场1站', '中建锦绣广场2站', '中建锦绣广场3站', '中建锦绣广场4站', '中建锦绣广场5站', '中建锦绣广场6站', '中建锦绣广场7站'],
// data: ['广1', '广2', '广3', '广4', '广5', '广6', '广7'],
data: storeNameList,
axisPointer: {
type: 'shadow'
}
@ -364,82 +471,25 @@ export default {
{
type: 'value',
name: '金额(元)',
min: 0,
max: 250,
interval: 50,
// min: 0,
// max: 10000,
// interval: 2000,
axisLabel: {
formatter: '{value}'
}
},
{
type: 'value',
name: '',
min: 0,
max: 25,
interval: 5,
axisLabel: {
formatter: '{value} '
}
}
// {
// type: 'value',
// name: '',
// min: 0,
// max: 25,
// interval: 5,
// axisLabel: {
// formatter: '{value} '
// }
// }
],
series: [
{
name: '会员余额',
color: '#D55F5F',
type: 'bar',
tooltip: {
valueFormatter: function (value) {
return value;
}
},
barWidth: 13,
itemStyle: {
normal: {
barBorderRadius: [50, 50, 0, 0]
}
},
data: [
2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3
]
},
{
name: '会员充值金额',
color: '#0DC291',
type: 'bar',
tooltip: {
valueFormatter: function (value) {
return value;
}
},
barWidth: 13,
itemStyle: {
normal: {
barBorderRadius: [50, 50, 0, 0]
}
},
data: [
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
]
},
{
name: '会员消费金额',
color: '#409EFF',
type: 'bar',
tooltip: {
valueFormatter: function (value) {
return value;
}
},
barWidth: 13,
itemStyle: {
normal: {
barBorderRadius: [50, 50, 0, 0]
}
},
data: [
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
]
},
{
name: '油品交易额',
color: '#FF9655',
@ -456,9 +506,10 @@ export default {
}
},
barGap: '60%',
data: [
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
]
// data: [
// 2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
// ]
data: oilAmountList
},
{
name: '非油品交易额',
@ -475,9 +526,70 @@ export default {
barBorderRadius: [50, 50, 0, 0]
}
},
data: [
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
]
// data: [
// 2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
// ]
data: noOilAmountList
},
{
name: '会员充值金额',
color: '#0DC291',
type: 'bar',
tooltip: {
valueFormatter: function (value) {
return value;
}
},
barWidth: 13,
itemStyle: {
normal: {
barBorderRadius: [50, 50, 0, 0]
}
},
// data: [
// 2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
// ]
data: rechargeBalanceList
},
{
name: '会员消费金额',
color: '#409EFF',
type: 'bar',
tooltip: {
valueFormatter: function (value) {
return value;
}
},
barWidth: 13,
itemStyle: {
normal: {
barBorderRadius: [50, 50, 0, 0]
}
},
// data: [
// 2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
// ]
data: consumeBalanceList
},
{
name: '会员余额',
color: '#D55F5F',
type: 'bar',
tooltip: {
valueFormatter: function (value) {
return value;
}
},
barWidth: 13,
itemStyle: {
normal: {
barBorderRadius: [50, 50, 0, 0]
}
},
// data: [
// 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3
// ]
data: userBalanceList
}
],
grid: {

View File

@ -1,8 +1,14 @@
<template>
<div class="app-container">
<div class="bannser">
<img src="../../assets/images/banner.png" alt="" >
</div>
<el-carousel height="230px">
<el-carousel-item v-for="(item,index) in bannerList" :key="index">
<div class="bannser">
<!-- <img src="../../assets/images/banner.png" alt="" >-->
<img :src="imagePath+item.productImage" alt="" >
</div>
</el-carousel-item>
</el-carousel>
<div class="b-bs">
<div class="left-box">
<div class="san-box">
@ -58,7 +64,7 @@
</el-date-picker>
</div>
<div style="margin-right: 40px">
<el-select v-model="value" clearable placeholder="请选择">
<el-select v-model="value" clearable placeholder="请选择" @change="chooseDept()">
<el-option
v-for="item in options"
:key="item.deptId"
@ -113,7 +119,7 @@
</div>
<div class="h-r-ba"></div>
<div>
<div class="h-tt" >活跃油站</div>
<!-- <div class="h-tt" >活跃油站</div>-->
<div class="d-s" style="justify-content: space-between">
<div id="cccc" style="width: 300px;height: 200px;margin-right: 50px"></div>
<div id="ccct" style="width: 300px;height: 200px;"></div>
@ -158,6 +164,7 @@ import echarts from "echarts";
import {storeAmountIndex, storeTotalIndex} from "@/api/indexBanner";
import {selectChildByDeptId} from "@/api/system/Site/site";
import {parseTime} from "@/utils/fuint";
import {getBannerListApi} from "@/api/sys/banner";
export default {
data(){
@ -195,6 +202,8 @@ export default {
storeTotal:{},
//
storeAmount:{},
// banner
bannerList:{},
}
},
created() {
@ -204,11 +213,31 @@ export default {
this.getStoreTotal()
this.selectChildByDeptIdApi()
this.getStoreAmount()
this.selectBannerList()
},
mounted() {
this.initChart()
// this.initChart()
},
methods:{
//
chooseDept(){
this.options.forEach(item => {
if (item.deptId == this.value){
this.queryParams.ancestors = item.ancestors
}
})
this.getStoreAmount()
},
selectBannerList(){
let queryParams = {
pageNo:1,
pageSize:10,
system_position:"系统首页"
}
getBannerListApi(queryParams).then(res=>{
this.bannerList = res.data.records
})
},
//
selectChildByDeptIdApi() {
selectChildByDeptId().then(res => {
@ -223,19 +252,40 @@ export default {
getStoreAmount(){
storeAmountIndex(this.addDateRange(this.queryParams,this.value1)).then(res => {
this.storeAmount = res.data
this.initChart()
})
},
countPercentage(upNum,downNum){
let percentage = 0;
percentage = (upNum / downNum)*100
return percentage.toFixed(2)
},
initChart() {
const chart = echarts.init(document.getElementById('ccc'))
const chart1 = echarts.init(document.getElementById('cccc'))
const chart2= echarts.init(document.getElementById('ccct'))
const chart3= echarts.init(document.getElementById('ctct'))
let dataList = []
let allTotal = 0
if (this.storeAmount.oilNameList) {
this.storeAmount.oilNameList.forEach(item => {
allTotal += item.countNum
})
this.storeAmount.oilNameList.forEach(item => {
let data = {value: 0, name: ""}
data.value = this.countPercentage(item.countNum, allTotal);
data.name = item.oilName + item.oilType + "占比"
dataList.push(data)
})
}
const option = {
color: [
'#0DC291',
'#FFB519',
'#b7f1e2',
'#fc7150',
'#fea500',
'#5facfe',
],
tooltip: {
trigger: 'item'
@ -245,15 +295,21 @@ export default {
{
name: 'Access From',
type: 'pie',
radius: '80%',
data: [
{ value: 28, name: '28%' },
{ value: 72, name: '72%' },
],
roseType: 'area',
radius: [5, '80%'],
// data: [
// { value: 36, name: '#98' },
// { value: 42, name: '0#' },
// { value: 40, name: '#95' },
// { value: 38, name: '#92' },
//
//
// ],
data: dataList,
emphasis: {
itemStyle: {
shadowBlur: 10,
borderRadius: 8,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
@ -276,8 +332,10 @@ export default {
type: 'pie',
radius: '80%',
data: [
{ value: 28, name: '28%' },
{ value: 72, name: '72%' },
// { value: 28, name: '28%' },
// { value: 72, name: '72%' },
{ value: this.countPercentage(Number(this.storeAmount.oilNum),Number(this.storeAmount.oilNum)+Number(this.storeAmount.noOilNum)), name: "油品交易占比" },
{ value: this.countPercentage(Number(this.storeAmount.noOilNum),Number(this.storeAmount.oilNum)+Number(this.storeAmount.noOilNum)), name: "非油品交易占比" },
],
emphasis: {
@ -292,8 +350,10 @@ export default {
};
const option2 = {
color: [
'#0DC291',
'#FFB519',
'#46c2c4',
'#6e4dd8',
'#214790',
'#d55f5f',
],
tooltip: {
trigger: 'item'
@ -303,10 +363,16 @@ export default {
{
name: 'Access From',
type: 'pie',
radius: '80%',
radius: [50, '80%'],
data: [
{ value: 28, name: '28%' },
{ value: 72, name: '72%' },
// { value: 28, name: '' },
// { value: 72, name: '' },
// { value: 28, name: '' },
// { value: 72, name: '便' },
{ value: this.countPercentage(Number(this.storeAmount.userNum),Number(this.storeAmount.oilNum)+Number(this.storeAmount.userNum)+Number(this.storeAmount.integralNum)+Number(this.storeAmount.goodNum)), name: '会员充值占比' },
{ value: this.countPercentage(Number(this.storeAmount.integralNum),Number(this.storeAmount.oilNum)+Number(this.storeAmount.userNum)+Number(this.storeAmount.integralNum)+Number(this.storeAmount.goodNum)), name: '积分商城交易占比' },
{ value: this.countPercentage(Number(this.storeAmount.oilNum),Number(this.storeAmount.oilNum)+Number(this.storeAmount.userNum)+Number(this.storeAmount.integralNum)+Number(this.storeAmount.goodNum)), name: '油品交易占比' },
{ value: this.countPercentage(Number(this.storeAmount.goodNum),Number(this.storeAmount.oilNum)+Number(this.storeAmount.userNum)+Number(this.storeAmount.integralNum)+Number(this.storeAmount.goodNum)), name: '便利店交易占比' },
],
emphasis: {
@ -319,6 +385,7 @@ export default {
}
]
};
const option3 = {
color: ['#FF9655', '#0DC291', '#409EFF'],
tooltip: {

View File

@ -1,7 +1,10 @@
<template>
<div class="">
<!-- 代理-->
<agent v-if="power == 1"></agent>
<!-- 连锁-->
<manage v-if="power == 2"></manage>
<!-- 油站-->
<shopowner v-if="power == 3"></shopowner>
</div>
</template>
@ -13,7 +16,7 @@ import shopowner from "@/views/homeComponents/shopowner.vue"
export default {
data(){
return{
power:2
power:3
}
},
created() {

View File

@ -70,7 +70,7 @@ public interface AllOrderInfoMapper extends BaseMapper<AllOrderInfo> {
* @param allOrderInfo
* @return
*/
Integer selectTotal(@Param("allOrderInfo") AllOrderInfo allOrderInfo);
Integer selectTotal(@Param("allOrderInfo") AllOrderInfo allOrderInfo,@Param("storeIds") List<Integer> storeIds);
Double selectAllAmount(@Param("allOrderInfo") AllOrderInfo allOrderInfo);

View File

@ -134,4 +134,6 @@ public interface OilOrderMapper extends BaseMapper<OilOrder> {
List<OilOrderVo> getInfoByOilType(@Param("allOrderInfo") OilOrder oilOrder);
List<OilOrderVo> getInfoByOilGun(@Param("allOrderInfo") OilOrder oilOrder);
List<OilOrderVo> getInfoByEm(@Param("allOrderInfo") OilOrder oilOrder);
List<OilOrderVo> selectOilsCount(@Param("oilOrderVo") OilOrderVo oilOrderVo,@Param("storeIds") List<Integer> storeIds);
}

View File

@ -145,6 +145,9 @@
<if test="allOrderInfo.payType != null and allOrderInfo.payType != ''">
and aoi.pay_type = #{allOrderInfo.payType}
</if>
<if test="allOrderInfo.status != null and allOrderInfo.status != ''">
and aoi.status = #{allOrderInfo.status}
</if>
<if test="allOrderInfo.params.beginTime != null and allOrderInfo.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(pay_time,'%y%m%d') &gt;= date_format(#{allOrderInfo.params.beginTime},'%y%m%d')
</if>

View File

@ -728,4 +728,23 @@
from oil_order;
</select>
<select id="selectOilsCount" resultType="com.fuint.business.order.vo.OilOrderVo">
SELECT oo.oils,count(*) countNum,oin.oil_type,oin.oil_name FROM oil_order oo
LEFT JOIN oil_name oin ON oo.oils = oin.id
<where>
<if test="storeIds != null">
oo.store_id in
<foreach collection="storeIds" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="oilOrderVo.params.beginTime != null and oilOrderVo.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(pay_time,'%y%m%d') &gt;= date_format(#{oilOrderVo.params.beginTime},'%y%m%d')
</if>
<if test="oilOrderVo.params.endTime != null and oilOrderVo.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(pay_time,'%y%m%d') &lt;= date_format(#{oilOrderVo.params.endTime},'%y%m%d')
</if>
</where>
GROUP BY oo.oils
</select>
</mapper>

View File

@ -14,6 +14,7 @@ import com.fuint.system.dept.vo.SysDeptVo;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
@Transactional
public interface AllOrderInfoService {
@ -102,11 +103,20 @@ public interface AllOrderInfoService {
* @param map
* @return
*/
Integer selectStoreTotal(Map<String,String> map);
Integer selectStoreTotal(Map<String,String> map, List<Integer> storeIds);
/**
* 查询某个时间段内油品交易笔数占比
* @param map
* @return
*/
Integer selectProportion(Map<String,String> map, List<Integer> storeIds,List<String> types);
/**
*
* @return
*/
Map<String,Object> getAmount(AllOrderInfoVo allOrderInfoVo);
Double selectAmount(Map<String,String> map, Integer storeId,List<String> types);
}

View File

@ -8,6 +8,8 @@ import com.fuint.business.order.entity.CashierOrder;
import com.fuint.business.order.vo.CardBalanceChangeVo;
import org.springframework.transaction.annotation.Transactional;
import java.util.Map;
@Transactional
public interface CardBalanceChangeService extends IService<CardBalanceChange> {
/**
@ -29,4 +31,12 @@ public interface CardBalanceChangeService extends IService<CardBalanceChange> {
* @return
*/
IPage<CardBalanceChange> getStoreOrdersList(Page page, CardBalanceChange cardBalanceChange);
/**
* 根据店铺id和余额变化类型查询订单总额
* @param storeId
* @param type 0-减少 1增加
* @return
*/
Double selectAllAmount(Map<String, String> map, Integer storeId, String type);
}

View File

@ -226,4 +226,6 @@ public interface OilOrderService extends IService<OilOrder> {
* @return
*/
Map<String, Object> addOrderPosScan(OilOrderVo oilOrderVo) throws Exception;
List<OilOrderVo> selectProportion(Map<String, String> map,List<Integer> storeIds);
}

View File

@ -24,6 +24,7 @@ import com.fuint.business.order.vo.Excel.DayExcel;
import com.fuint.business.order.vo.Excel.InstituionExcel;
import com.fuint.business.order.vo.Excel.OilDepotExcel;
import com.fuint.business.order.vo.Excel.TradingExcel;
import com.fuint.business.order.vo.OilOrderVo;
import com.fuint.business.order.vo.OrderGoodsVo;
import com.fuint.business.petrolStationManagement.entity.OilGun;
import com.fuint.business.petrolStationManagement.entity.OilName;
@ -1083,14 +1084,38 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
}
@Override
public Integer selectStoreTotal(Map<String, String> map) {
public Integer selectStoreTotal(Map<String, String> map,List<Integer> storeIds) {
String startTime = map.get("startTime");
String endTime = map.get("endTime");
QueryWrapper queryWrapper = new QueryWrapper<>();
if (ObjectUtil.isNotEmpty(startTime) && ObjectUtil.isNotEmpty(endTime)){
queryWrapper.apply(true,"create_time BETWEEN '" + startTime + "' and '" + endTime + "'");
}
if (ObjectUtil.isNotEmpty(storeIds)){
queryWrapper.in("store_id",storeIds);
}
queryWrapper.groupBy("store_id");
queryWrapper.orderByDesc("create_time");
List<AllOrderInfo> allOrderInfos = baseMapper.selectList(queryWrapper);
Integer row = 0;
if (ObjectUtil.isNotEmpty(allOrderInfos)) row = allOrderInfos.size();
return row;
}
@Override
public Integer selectProportion(Map<String, String> map,List<Integer> storeIds,List<String> types) {
String startTime = map.get("startTime");
String endTime = map.get("endTime");
QueryWrapper queryWrapper = new QueryWrapper<>();
if (ObjectUtil.isNotEmpty(startTime) && ObjectUtil.isNotEmpty(endTime)){
queryWrapper.apply(true,"create_time BETWEEN '" + startTime + "' and '" + endTime + "'");
}
if (ObjectUtil.isNotEmpty(storeIds)){
queryWrapper.in("store_id",storeIds);
}
if (ObjectUtil.isNotEmpty(types)){
queryWrapper.in("type",types);
}
List<AllOrderInfo> allOrderInfos = baseMapper.selectList(queryWrapper);
Integer row = 0;
if (ObjectUtil.isNotEmpty(allOrderInfos)) row = allOrderInfos.size();
@ -1102,15 +1127,57 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
Map<String, Object> map = new HashMap<>();
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
List<SysDeptVo> sysDeptVos = deptService.selectChildByDeptId(nowAccountInfo.getDeptId());
List<Integer> ids = new ArrayList<>();
SysDept sysDept = deptService.getById(nowAccountInfo.getDeptId());
String ancestors = sysDept.getAncestors();
if (!"0".equals(sysDept.getAncestors())) {
ancestors = sysDept.getAncestors()+ "," +sysDept.getDeptId();
}
if (ObjectUtil.isNotEmpty(allOrderInfoVo.getAncestors())){
ancestors = allOrderInfoVo.getAncestors();
}
MtStore store = new MtStore();
List<MtStore> mtStores = mtStoreMapper.selectStoreList(store, ancestors);
List<Integer> storeIds = new ArrayList<>();
for (MtStore mtStore : mtStores) {
storeIds.add(mtStore.getId());
}
QueryWrapper queryWrapper = new QueryWrapper<>();
if (ObjectUtil.isNotEmpty(storeIds)){
queryWrapper.in("store_id",storeIds);
}
if (ObjectUtil.isNotEmpty(allOrderInfoVo.getParams())
&& ObjectUtil.isNotEmpty(allOrderInfoVo.getParams().get("beginTime"))
&& ObjectUtil.isNotEmpty(allOrderInfoVo.getParams().get("endTime"))){
queryWrapper.apply(true,"create_time BETWEEN '" + allOrderInfoVo.getParams().get("beginTime") + "' and '" + allOrderInfoVo.getParams().get("endTime") + "'");
}
Integer tradeTotal = ObjectUtil.isNotEmpty(baseMapper.selectTotal(allOrderInfoVo)) ? baseMapper.selectTotal(allOrderInfoVo) : 0;
Double tradeAmount = ObjectUtil.isNotEmpty(baseMapper.selectAllAmount(allOrderInfoVo)) ? baseMapper.selectAllAmount(allOrderInfoVo) : 0;
Integer tradeTotal = ObjectUtil.isNotEmpty(baseMapper.selectCount(queryWrapper)) ? baseMapper.selectCount(queryWrapper) : 0;
List list = this.listObjs(queryWrapper.select("pay_money"));
Double tradeAmount = 0.0;
if (!list.isEmpty()) {
for (Object payMoney: list) {
tradeAmount += Double.valueOf(payMoney.toString());
}
}
allOrderInfoVo.setStatus("refund");
Integer refundTotal = ObjectUtil.isNotEmpty(baseMapper.selectTotal(allOrderInfoVo)) ? baseMapper.selectTotal(allOrderInfoVo) : 0;
Double refundAmount = ObjectUtil.isNotEmpty(baseMapper.selectAllAmount(allOrderInfoVo)) ? baseMapper.selectAllAmount(allOrderInfoVo) : 0;
if (ObjectUtil.isNotEmpty(allOrderInfoVo.getStatus())){
queryWrapper.eq("status",allOrderInfoVo.getStatus());
}
Integer refundTotal = ObjectUtil.isNotEmpty(baseMapper.selectCount(queryWrapper)) ? baseMapper.selectCount(queryWrapper) : 0;
List list1 = this.listObjs(queryWrapper.select("pay_money"));
Double refundAmount = 0.0;
if (!list1.isEmpty()) {
for (Object payMoney: list1) {
refundAmount += Double.valueOf(payMoney.toString());
}
}
// Integer tradeTotal = ObjectUtil.isNotEmpty(baseMapper.selectTotal(allOrderInfoVo,storeIds)) ? baseMapper.selectTotal(allOrderInfoVo,storeIds) : 0;
// Double tradeAmount = ObjectUtil.isNotEmpty(baseMapper.selectAllAmount(allOrderInfoVo)) ? baseMapper.selectAllAmount(allOrderInfoVo) : 0;
// allOrderInfoVo.setStatus("refund");
// Integer refundTotal = ObjectUtil.isNotEmpty(baseMapper.selectTotal(allOrderInfoVo,storeIds)) ? baseMapper.selectTotal(allOrderInfoVo,storeIds) : 0;
// Double refundAmount = ObjectUtil.isNotEmpty(baseMapper.selectAllAmount(allOrderInfoVo)) ? baseMapper.selectAllAmount(allOrderInfoVo) : 0;
Double averagePrice = tradeAmount/tradeTotal;
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
@ -1122,17 +1189,50 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
LocalDate date2 = LocalDate.parse(allOrderInfoVo.getParams().get("endTime").toString(), formatter);
Integer daysBetween = Math.toIntExact(ChronoUnit.DAYS.between(date1, date2));
dayTradeAmount = tradeAmount / daysBetween;
dayTradeTotal = tradeTotal / daysBetween;
if (daysBetween!=0) {
dayTradeAmount = tradeAmount / daysBetween;
dayTradeTotal = tradeTotal / daysBetween;
}
map1.put("startTime", allOrderInfoVo.getParams().get("beginTime").toString());
map1.put("endTime", allOrderInfoVo.getParams().get("endTime").toString());
}
Integer storeTotal = selectStoreTotal(map1);
Integer storeTotal = selectStoreTotal(map1,storeIds);
DecimalFormat df = new DecimalFormat("#.00"); // 格式化字符串表示两位小数
// 设置格式化器
df.setRoundingMode(RoundingMode.HALF_UP); // 可选设置四舍五入模式
List<String> types = new ArrayList<>();
// 油品笔数
types.add("1");
types.add("6");
types.add("7");
types.add("8");
Integer oilNum = selectProportion(map1, storeIds, types);
types = new ArrayList<>();
// 非油品笔数
types.add("2");
types.add("3");
types.add("4");
types.add("5");
Integer noOilNum = selectProportion(map1, storeIds, types);
types = new ArrayList<>();
// 会员充值
types.add("3");
types.add("5");
Integer userNum = selectProportion(map1, storeIds, types);
types = new ArrayList<>();
// 积分商城
types.add("4");
Integer integralNum = selectProportion(map1, storeIds, types);
types = new ArrayList<>();
// 便利店
types.add("2");
Integer goodNum = selectProportion(map1, storeIds, types);
// 油品油号信息
List<OilOrderVo> oilOrderVos = orderService.selectProportion(map1, storeIds);
map.put("tradeTotal",tradeTotal);
map.put("tradeAmount",tradeAmount > 0 ? df.format(tradeAmount) : 0);
map.put("refundTotal",refundTotal);
@ -1141,9 +1241,38 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
map.put("dayTradeAmount",dayTradeAmount > 0 ? df.format(dayTradeAmount) : 0);
map.put("dayTradeTotal",dayTradeTotal);
map.put("storeTotal",storeTotal);
map.put("oilNum",oilNum);
map.put("noOilNum",noOilNum);
map.put("userNum",userNum);
map.put("integralNum",integralNum);
map.put("goodNum",goodNum);
map.put("oilNameList",oilOrderVos);
return map;
}
@Override
public Double selectAmount(Map<String, String> map, Integer storeId, List<String> types) {
String startTime = map.get("startTime");
String endTime = map.get("endTime");
QueryWrapper queryWrapper = new QueryWrapper<>();
if (ObjectUtil.isNotEmpty(startTime) && ObjectUtil.isNotEmpty(endTime)){
queryWrapper.apply(true,"create_time BETWEEN '" + startTime + "' and '" + endTime + "'");
}
if (ObjectUtil.isNotEmpty(storeId)){
queryWrapper.eq("store_id",storeId);
}
if (ObjectUtil.isNotEmpty(types)){
queryWrapper.in("type",types);
}
queryWrapper.select("SUM(pay_money) as payMoney");
AllOrderInfo allOrderInfo = baseMapper.selectOne(queryWrapper);
Double payMoney = 0.0;
if (ObjectUtil.isNotEmpty(allOrderInfo) && ObjectUtil.isNotEmpty(allOrderInfo.getPayMoney())){
payMoney = allOrderInfo.getPayMoney();
}
return payMoney;
}
private long dayCount(String beginTimeStr, String endTimeStr ) {
// 将字符串表示的时间转换成 LocalDate 对象

View File

@ -1,6 +1,8 @@
package com.fuint.business.order.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -19,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service
public class CardBalanceChangeServiceImpl extends ServiceImpl<CardBalanceChangeMapper, CardBalanceChange> implements CardBalanceChangeService {
@ -82,4 +85,30 @@ public class CardBalanceChangeServiceImpl extends ServiceImpl<CardBalanceChangeM
IPage page1 = page(page, queryWrapper);
return page1;
}
@Override
public Double selectAllAmount(Map<String, String> map, Integer storeId, String type) {
String startTime = map.get("startTime");
String endTime = map.get("endTime");
QueryWrapper queryWrapper = new QueryWrapper<>();
if (ObjectUtil.isNotEmpty(startTime) && ObjectUtil.isNotEmpty(endTime)){
queryWrapper.apply(true,"create_time BETWEEN '" + startTime + "' and '" + endTime + "'");
}
if (type.equals("1")){
queryWrapper.eq("change_type",type);
queryWrapper.eq("from_type","余额充值");
}else if (type.equals("0")){
queryWrapper.eq("change_type",type);
}
if (ObjectUtil.isNotEmpty(storeId)){
queryWrapper.eq("store_id",storeId);
}
queryWrapper.select("SUM(balance) as balance");
CardBalanceChange cardBalanceChange = baseMapper.selectOne(queryWrapper);
Double balance = 0.0;
if (ObjectUtil.isNotEmpty(cardBalanceChange) && ObjectUtil.isNotEmpty(cardBalanceChange.getBalance())){
balance = cardBalanceChange.getBalance();
}
return balance;
}
}

View File

@ -2576,4 +2576,16 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
res.put("scanCode",mainScan);
return res;
}
@Override
public List<OilOrderVo> selectProportion(Map<String, String> map,List<Integer> storeIds) {
String startTime = map.get("startTime");
String endTime = map.get("endTime");
OilOrderVo oilOrderVo = new OilOrderVo();
Map<String , Object> map1 = new HashMap<>();
map1.put("beginTime",startTime);
map1.put("endTime",endTime);
oilOrderVo.setParams(map1);
return baseMapper.selectOilsCount(oilOrderVo,storeIds);
}
}

View File

@ -1,5 +1,6 @@
package com.fuint.business.order.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fuint.business.order.entity.AllOrderInfo;
import lombok.Data;
@ -61,7 +62,8 @@ public class AllOrderInfoVo extends AllOrderInfo {
private String userBalanceByAli;
private String userBalanceCountByali;
@TableField(exist = false)
private String ancestors;
}

View File

@ -12,6 +12,7 @@ public class OilOrderVo extends OilOrder {
private String storeName;
private String description;
private String oilName;
private String oilType;
private String gunName;
private String realName;
private Double sumOilNum;
@ -33,6 +34,11 @@ public class OilOrderVo extends OilOrder {
private String authCode;
@TableField(exist = false)
private Double oilCardAmount1;
/**
* 数量信息
*/
@TableField(exist = false)
private Integer countNum;
private String sum;
private String amount92;

View File

@ -351,7 +351,17 @@ public class BackendStoreController extends BaseController {
// 中台首页店铺数量查询
@GetMapping("/getStoreTotal")
public ResponseObject getStoreTotal(LJStore store){
public ResponseObject getStoreTotal(MtStore store){
return getSuccessResult(storeService.getStoreTotal(store));
}
/**
* 中台首页多个店铺信息查询
* @param store
* @return
*/
@GetMapping("/selectStoreAmount")
public ResponseObject selectStoreAmount(MtStore store){
return getSuccessResult(storeService.selectStoreAmount(store));
}
}

View File

@ -50,5 +50,5 @@ public interface MtStoreMapper extends BaseMapper<MtStore> {
List<MtStore> queryStoresByDeptIds(@Param("list") List<Long> deptIds);
List<Long> queryStoresByDeptIdsR(@Param("list") List<Long> deptIds);
List<MtStore> selectStoreList(@Param("storeVo") MtStore store,@Param("ownDeptStr") String ownDeptStr);
}

View File

@ -52,4 +52,29 @@
</foreach>
</select>
<select id="selectStoreList" resultType="com.fuint.business.store.entity.MtStore">
SELECT ms.* FROM mt_store ms
LEFT JOIN sys_dept sd ON ms.contract_dept_id = sd.dept_id
<where>
sd.if_delete = 0 and ms.if_delete = 0
<if test="ownDeptStr !=null and ownDeptStr !=''">
and sd.ancestors like concat(#{ownDeptStr},'%')
</if>
<if test="storeVo.name !=null and storeVo.name !=''">
and ms.name like concat('%',#{storeVo.name},'%')
</if>
<if test="storeVo.contractDeptId !=null and storeVo.contractDeptId !=''">
and ms.contract_dept_id = #{storeVo.contractDeptId}
</if>
<if test="storeVo.status !=null and storeVo.status !=''">
and ms.status = #{storeVo.status}
</if>
<if test="storeVo.params.beginTime != null and storeVo.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(ms.create_time,'%y%m%d') &gt;= date_format(#{storeVo.params.beginTime},'%y%m%d')
</if>
<if test="storeVo.params.endTime != null and storeVo.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(ms.create_time,'%y%m%d') &lt;= date_format(#{storeVo.params.endTime},'%y%m%d')
</if>
</where>
</select>
</mapper>

View File

@ -1,6 +1,7 @@
package com.fuint.business.store.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.store.vo.StoreAmount;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.common.dto.StoreDto;
import com.fuint.framework.exception.BusinessCheckException;
@ -117,7 +118,16 @@ public interface StoreService extends IService<MtStore> {
List<Map<Object,Object>> getByStroeName(MtStore storeName);
Map<String,Object> getStoreTotal(LJStore store);
/**
* 查询油站数量数据
* @param store
* @return
*/
Map<String,Object> getStoreTotal(MtStore store);
List<Integer> getStoreIds(List<SysDeptVo> sysDeptVos);
/**
* 查询店铺信息
* @return
*/
List<StoreAmount> selectStoreAmount(MtStore store);
}

View File

@ -9,10 +9,13 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.order.mapper.AllOrderInfoMapper;
import com.fuint.business.order.service.AllOrderInfoService;
import com.fuint.business.order.service.CardBalanceChangeService;
import com.fuint.business.store.entity.MtStore;
import com.fuint.business.store.mapper.MtStoreMapper;
import com.fuint.business.store.service.StoreService;
import com.fuint.business.store.vo.StoreAmount;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.userManager.service.UserBalanceService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.dto.StoreDto;
import com.fuint.common.enums.StatusEnum;
@ -56,6 +59,7 @@ import java.math.BigDecimal;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.concurrent.TimeUnit;
@ -84,6 +88,15 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
*/
@Autowired
private MerchantService merchantService;
@Autowired
@Lazy
private ISysDeptService deptService;
@Autowired
@Lazy
private CardBalanceChangeService cardBalanceChangeService;
@Autowired
@Lazy
private UserBalanceService userBalanceService;
/**
* 分页查询店铺列表
@ -617,12 +630,23 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
}
@Override
public Map<String, Object> getStoreTotal(LJStore store) {
Map<String, Object> map = new HashMap<>();
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("if_delete","0");
Integer allTotal = baseMapper.selectCount(queryWrapper);
public Map<String, Object> getStoreTotal(MtStore store) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
SysDept sysDept = deptService.getById(nowAccountInfo.getDeptId());
String ancestors = sysDept.getAncestors();
if (!"0".equals(sysDept.getAncestors())) {
ancestors = sysDept.getAncestors()+ "," +sysDept.getDeptId();
}
Map<String, Object> map = new HashMap<>();
List<MtStore> mtStores = baseMapper.selectStoreList(store, ancestors);
Integer allTotal = mtStores.size();
List<Integer> storeIds = new ArrayList<>();
for (MtStore mtStore : mtStores) {
storeIds.add(mtStore.getId());
}
// 查询过去七天活跃的数据
Map<String,String> map1 = new HashMap<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@ -630,19 +654,26 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
calendar.add(Calendar.DATE, -7); // 减去7天
Date sevenDaysAgo = calendar.getTime();
String startTime = sdf.format(sevenDaysAgo);
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String endTime = dateFormat.format(new Date());
map1.put("startTime",startTime);
map1.put("endTime",endTime);
Integer weekTotal = allOrderInfoService.selectStoreTotal(map1);
Integer weekTotal = allOrderInfoService.selectStoreTotal(map1,storeIds);
// 查询过去一个月的数据
LocalDate now1 = LocalDate.now();
LocalDate sevenDaysAgo1 = now1.minusDays(30);
QueryWrapper queryWrapperSevenDays1 = new QueryWrapper<>();
queryWrapperSevenDays1.eq("if_delete","0");
queryWrapperSevenDays1.ge("create_time", sevenDaysAgo1);
Integer monthTotal = baseMapper.selectCount(queryWrapperSevenDays1);
Map<String,Object> map2 = new HashMap<>();
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar calendar2 = Calendar.getInstance();
calendar2.add(Calendar.DATE, -30); // 减去7天
Date sevenDaysAgo2 = calendar2.getTime();
String startTime2 = sdf2.format(sevenDaysAgo2);
DateFormat dateFormat2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String endTime2 = dateFormat2.format(new Date());
map2.put("beginTime",startTime2);
map2.put("endTime",endTime2);
store.setParams(map2);
List<MtStore> mtStores1 = baseMapper.selectStoreList(store, ancestors);
Integer monthTotal = mtStores1.size();
map.put("allTotal",allTotal);
map.put("weekTotal",ObjectUtil.isNotEmpty(weekTotal) ? weekTotal : 0);
@ -651,14 +682,58 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
}
@Override
public List<Integer> getStoreIds(List<SysDeptVo> sysDeptVos) {
List<Integer> ids = new ArrayList<>();
for (SysDeptVo sysDeptVo : sysDeptVos) {
public List<StoreAmount> selectStoreAmount(MtStore store) {
List<StoreAmount> list = new ArrayList<>();
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
SysDept sysDept = deptService.getById(nowAccountInfo.getDeptId());
String ancestors = sysDept.getAncestors();
if (!"0".equals(sysDept.getAncestors())) {
ancestors = sysDept.getAncestors()+ "," +sysDept.getDeptId();
}
return null;
}
List<MtStore> mtStores = baseMapper.selectStoreList(new MtStore(), ancestors);
for (MtStore mtStore : mtStores) {
StoreAmount storeAmount = new StoreAmount();
storeAmount.setStoreId(mtStore.getId());
storeAmount.setStoreName(mtStore.getName());
list.add(storeAmount);
}
Map<String, String> map1 = new HashMap<>();
if (ObjectUtil.isNotEmpty(store.getParams()) && ObjectUtil.isNotEmpty(store.getParams().get("beginTime"))
&& ObjectUtil.isNotEmpty(store.getParams().get("endTime"))) {
map1.put("startTime", store.getParams().get("beginTime").toString());
map1.put("endTime", store.getParams().get("endTime").toString());
}
for (StoreAmount storeAmount : list) {
List<String> types = new ArrayList<>();
// 油品金额
types.add("1");
types.add("6");
types.add("7");
types.add("8");
Double oilNum = allOrderInfoService.selectAmount(map1, storeAmount.getStoreId(), types);
storeAmount.setOilAmount(oilNum);
types = new ArrayList<>();
// 非油品金额
types.add("2");
types.add("3");
types.add("4");
types.add("5");
Double noOilNum = allOrderInfoService.selectAmount(map1, storeAmount.getStoreId(), types);
storeAmount.setNoOilAmount(noOilNum);
// 会员充值余额
Double rechargeBalance = cardBalanceChangeService.selectAllAmount(map1, storeAmount.getStoreId(), "1");
storeAmount.setUserRechargeBalance(rechargeBalance);
// 会员消费余额
Double consumeBalance = cardBalanceChangeService.selectAllAmount(map1, storeAmount.getStoreId(), "0");
storeAmount.setUserConsumeBalance(consumeBalance);
// 会员余额
Double userBalance = userBalanceService.selectAllBalance(storeAmount.getStoreId());
storeAmount.setUserBalance(userBalance);
}
return list;
}
// 将在部门里面删除的在油站中删除
public void beachDelStore() {

View File

@ -0,0 +1,35 @@
package com.fuint.business.store.vo;
import lombok.Data;
@Data
public class StoreAmount {
/**
* 店铺id
*/
private Integer storeId;
/**
* 店铺名称
*/
private String storeName;
/**
* 油品交易金额
*/
private Double oilAmount;
/**
* 非油品交易金额
*/
private Double NoOilAmount;
/**
* 用户充值余额
*/
private Double userRechargeBalance;
/**
* 用户消费余额
*/
private Double userConsumeBalance;
/**
* 用户余额
*/
private Double userBalance;
}

View File

@ -1,8 +1,10 @@
package com.fuint.business.storeInformation.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.entity.QRCode;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.business.storeInformation.vo.LjStoreVo;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.springframework.beans.factory.annotation.Autowired;
@ -114,6 +116,14 @@ public class LJStoreController extends BaseController {
return getSuccessResult(b);
}
@GetMapping("/selectListDept")
public ResponseObject selectListDepts(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
LjStoreVo storeVo){
Page page =new Page(pageNo,pageSize);
return getSuccessResult(storeService.selectListDepts(page,storeVo));
}
// /**
// * 修改等级规则信息
// * @param map

View File

@ -1,10 +1,15 @@
package com.fuint.business.storeInformation.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.vo.LjStoreVo;
import org.apache.ibatis.annotations.Param;
/**
* 店铺表 mapper层
*/
public interface LJStoreMapper extends BaseMapper<LJStore> {
IPage<LjStoreVo> selectListDepts(IPage page, @Param("storeVo") LjStoreVo storeVo,@Param("ownDeptStr") String ownDeptStr);
}

View File

@ -0,0 +1,35 @@
<?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="com.fuint.business.storeInformation.mapper.LJStoreMapper">
<select id="selectListDepts" resultType="com.fuint.business.storeInformation.vo.LjStoreVo">
SELECT ms.*,sd.dept_name,sd.leader_name,sd.leader_phone,sd.turnover_type,sd.turnover_limit,
sd.turnover_start_time,sd.turnover_end_time,sd.rates,sd.prepaid_amount,sd.create_time deptCreateTime,sd.store_num
FROM mt_store ms
LEFT JOIN sys_dept sd ON ms.contract_dept_id = sd.dept_id
<where>
sd.if_delete = 0 and ms.if_delete = 0
<if test="ownDeptStr !=null and ownDeptStr !=''">
and sd.ancestors like concat(#{ownDeptStr},'%')
</if>
<if test="storeVo.name !=null and storeVo.name !=''">
and ms.name like concat('%',#{storeVo.name},'%')
</if>
<if test="storeVo.contractDeptId !=null and storeVo.contractDeptId !=''">
and ms.contract_dept_id = #{storeVo.contractDeptId}
</if>
<if test="storeVo.status !=null and storeVo.status !=''">
and ms.status = #{storeVo.status}
</if>
<if test="storeVo.turnoverType !=null and storeVo.turnoverType !=''">
and sd.turnover_type = #{storeVo.turnoverType}
</if>
<if test="storeVo.params.beginTime != null and storeVo.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(ms.create_time,'%y%m%d') &gt;= date_format(#{storeVo.params.beginTime},'%y%m%d')
</if>
<if test="storeVo.params.endTime != null and storeVo.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(ms.create_time,'%y%m%d') &lt;= date_format(#{storeVo.params.endTime},'%y%m%d')
</if>
</where>
order by ms.create_time desc
</select>
</mapper>

View File

@ -1,8 +1,11 @@
package com.fuint.business.storeInformation.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.vo.LjStoreVo;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@ -81,4 +84,12 @@ public interface ILJStoreService extends IService<LJStore> {
boolean ifDeleteByDeptId(Long deptId);
boolean ifRefPass(String refPass);
/**
* 查询店铺机构信息
* @param page
* @param storeVo
* @return
*/
IPage<LjStoreVo> selectListDepts(IPage page, LjStoreVo storeVo);
}

View File

@ -3,25 +3,35 @@ package com.fuint.business.storeInformation.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.order.entity.AllOrderInfo;
import com.fuint.business.order.service.AllOrderInfoService;
import com.fuint.business.petrolStationManagement.service.OilNumberService;
import com.fuint.business.petrolStationManagement.vo.OilNumberNameVo;
import com.fuint.business.store.entity.MtStore;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.mapper.LJStoreMapper;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.business.storeInformation.vo.LjStoreVo;
import com.fuint.business.userManager.entity.ChainStoreConfig;
import com.fuint.business.userManager.entity.UserBalance;
import com.fuint.business.userManager.service.ChainStoreConfigService;
import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.service.UserBalanceService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.StringUtils;
import com.fuint.common.util.TokenUtil;
import com.fuint.system.dept.entity.SysDept;
import com.fuint.system.dept.service.ISysDeptService;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.util.*;
/**
@ -33,6 +43,16 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
@Lazy
private UserBalanceService userBalanceService;
@Autowired
@Lazy
private LJUserService userService;
@Autowired
@Lazy
private ISysDeptService deptService;
@Autowired
@Lazy
private AllOrderInfoService allOrderInfoService;
/**
* 根据id查询店铺信息
* @return
@ -299,4 +319,61 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
}
return false;
}
@Override
public IPage<LjStoreVo> selectListDepts(IPage page, LjStoreVo storeVo) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
SysDept sysDept = deptService.getById(nowAccountInfo.getDeptId());
String ancestors = sysDept.getAncestors();
if (!"0".equals(sysDept.getAncestors())) {
ancestors = sysDept.getAncestors()+ "," +sysDept.getDeptId();
}
IPage<LjStoreVo> ljStoreVoIPage = baseMapper.selectListDepts(page, storeVo,ancestors);
for (LjStoreVo record : ljStoreVoIPage.getRecords()) {
record.setUserTotal(userService.selectUserCountByChainStoreId(record.getChainStoreId()));
if (ObjectUtil.isNotEmpty(record.getTurnoverType()) && record.getTurnoverType().equals("1")){
// 无限制
LocalDate givenDate = record.getDeptCreateTime().toInstant()
.atZone(ZoneId.systemDefault())
.toLocalDate();
LocalDate currentDate = LocalDate.now();
long daysBetween = ChronoUnit.DAYS.between(givenDate, currentDate);
record.setRemind("以免费使用系统"+daysBetween+"");
} else if (ObjectUtil.isNotEmpty(record.getTurnoverType()) && record.getTurnoverType().equals("2")) {
// 时间限制
LocalDate givenDate = record.getTurnoverEndTime().toInstant()
.atZone(ZoneId.systemDefault())
.toLocalDate();
LocalDate currentDate = LocalDate.now();
long daysBetween = ChronoUnit.DAYS.between( currentDate,givenDate);
record.setRemind("距系统到期还有"+daysBetween+"");
} else if (ObjectUtil.isNotEmpty(record.getTurnoverType()) && record.getTurnoverType().equals("3")) {
// 预付费
AllOrderInfo allOrderInfo = new AllOrderInfo();
allOrderInfo.setStoreId(record.getId());
allOrderInfo.setStatus("paid");
String amount = allOrderInfoService.sumPayMoney(allOrderInfo);
Double residue = Double.valueOf(record.getTurnoverLimit()) - Double.valueOf(amount)/10000;
record.setRemind("还剩余"+residue+"万交易流量");
} else if (ObjectUtil.isNotEmpty(record.getTurnoverType()) && record.getTurnoverType().equals("4")) {
// 后付费
record.setRemind("系统服务费待付"+record.getPrepaidAmount()+"");
} else if (ObjectUtil.isNotEmpty(record.getTurnoverType()) && record.getTurnoverType().equals("5")) {
// 年付费
LocalDate givenDate = record.getTurnoverEndTime().toInstant()
.atZone(ZoneId.systemDefault())
.toLocalDate();
LocalDate currentDate = LocalDate.now();
long daysBetween = ChronoUnit.DAYS.between(currentDate,givenDate);
record.setRemind("距系统到期还有"+daysBetween+"");
} else if (ObjectUtil.isNotEmpty(record.getTurnoverType()) && record.getTurnoverType().equals("6")) {
// 可创建油站站点数量
record.setRemind("可创建油站站点数量为"+record.getStoreNum()+"");
}
}
return ljStoreVoIPage;
}
}

View File

@ -0,0 +1,71 @@
package com.fuint.business.storeInformation.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fuint.business.storeInformation.entity.LJStore;
import lombok.Data;
import java.util.Date;
@Data
public class LjStoreVo extends LJStore {
/**
* 机构名称
*/
private String deptName;
/**
* 联系人
*/
private String leaderName;
/**
* 联系电话
*/
private String leaderPhone;
/**
* 设置流水类型
* 1无限制
* 2时间限制
* 3预付费
* 4后付费
* 5年付费
* 6可创建油站站点数量
*/
private String turnoverType;
/**
* 流水可用于预付费和后付费 预付费时用于可跑流量后付费用实际交易
*/
private String turnoverLimit;
/**
*创建时间
*/
private Date deptCreateTime;
/**
*开始时间设置
*/
private Date turnoverStartTime;
/**
*结束时间设置
*/
private Date turnoverEndTime;
/**
*费率
*/
private Double rates;
/**
*油站数
*/
private Integer storeNum;
/**
* 预付金额可用于预付费和后付费 预付费时用于预付金额后付费用于系统服务费年付费的总价
*/
private Double prepaidAmount;
/**
* 会员人数
*/
@TableField(exist = false)
private Integer userTotal;
/**
* 到期提醒
*/
@TableField(exist = false)
private String remind;
}

View File

@ -95,4 +95,10 @@ public interface LJUserMapper extends BaseMapper<LJUser> {
List<LJUserVo> getUserCountList(LJUserVo user);
/**
* 根据连锁店id查询会员人数
* @param chainStoreId
* @return
*/
Integer selectUserCountByChainStoreId(@Param("chainStoreId") Integer chainStoreId);
}

View File

@ -343,4 +343,11 @@
mi.storeId = #{storeId}
</where>
</select>
<select id="selectUserCountByChainStoreId" resultType="java.lang.Integer"
parameterType="java.lang.Integer">
SELECT count(*) FROM mt_user mu LEFT JOIN mt_user_balance mub ON mub.mt_user_id = mu.id
<where>
mub.chain_store_id = #{chainStoreId}
</where>
</select>
</mapper>

View File

@ -178,4 +178,11 @@ public interface LJUserService extends IService<LJUser> {
* @return
*/
LJUser selectUserByUserId(String userId);
/**
* 根据连锁店id查询会员人数
* @param chainStoreId
* @return
*/
Integer selectUserCountByChainStoreId(Integer chainStoreId);
}

View File

@ -75,4 +75,5 @@ public interface UserBalanceService extends IService<UserBalance> {
int addUserBalance(Integer userId, Integer chainStoreId, Double changeBalance);
Double selectAllBalance(Integer storeId);
}

View File

@ -614,4 +614,9 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
queryWrapper.eq("user_id",userId);
return baseMapper.selectOne(queryWrapper);
}
@Override
public Integer selectUserCountByChainStoreId(Integer chainStoreId) {
return baseMapper.selectUserCountByChainStoreId(chainStoreId);
}
}

View File

@ -174,6 +174,20 @@ public class UserBalanceServiceImpl extends ServiceImpl<UserBalanceMapper, UserB
return baseMapper.addUserBalance(userBalance.getId(), changeBalance);
}
@Override
public Double selectAllBalance(Integer storeId) {
LJStore ljStore = storeService.queryStoreById(storeId);
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("chain_store_id",ljStore.getChainStoreId());
queryWrapper.select("SUM(card_balance) as cardBalance");
UserBalance userBalance = baseMapper.selectOne(queryWrapper);
Double cardBalance = 0.0;
if (ObjectUtil.isNotEmpty(userBalance) && ObjectUtil.isNotEmpty(userBalance.getCardBalance())){
cardBalance = userBalance.getCardBalance();
}
return cardBalance;
}
@Resource
RedisLock redisLock;