Merge branch 'master' of https://gitee.com/nny_1/oilSystem
# Conflicts: # fuintCashierWeb/src/views/cashier/orderComponents/order_Unpaid.vue
This commit is contained in:
commit
46913be03f
@ -44,10 +44,29 @@ export function updateCommission(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除会员
|
// 删除员工提成方案
|
||||||
export function delCommission(id) {
|
export function delCommission(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/business/commission/staffCommission/' + id,
|
url: '/business/commission/staffCommission/' + id,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询员工提成记录
|
||||||
|
export function listCommissionRecord(query) {
|
||||||
|
return request({
|
||||||
|
url: '/commissionRecord/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 查询员工提成总额
|
||||||
|
export function allAmountCommissionRecord(query) {
|
||||||
|
return request({
|
||||||
|
url: '/commissionRecord/allAmount',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -145,9 +145,13 @@
|
|||||||
<el-select v-model="form.roleId" placeholder="请选择角色">
|
<el-select v-model="form.roleId" placeholder="请选择角色">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in roleList"
|
v-for="item in roleList"
|
||||||
:key="item.dutyId"
|
:key="item.dutyId+''"
|
||||||
:label="item.dutyName"
|
:label="item.dutyName"
|
||||||
:value="item.dutyId"
|
:value="item.dutyId+''"
|
||||||
|
></el-option>
|
||||||
|
<el-option
|
||||||
|
label="油站站长"
|
||||||
|
:value="12+''"
|
||||||
></el-option>
|
></el-option>
|
||||||
|
|
||||||
</el-select>
|
</el-select>
|
||||||
@ -602,6 +606,7 @@ export default {
|
|||||||
submitForm: function() {
|
submitForm: function() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
this.form.auditPrem = this.form.auditPrem.toString();
|
||||||
if (!this.form.id) {
|
if (!this.form.id) {
|
||||||
queryStaff({mobile:this.form.mobile}).then( response => {
|
queryStaff({mobile:this.form.mobile}).then( response => {
|
||||||
if(response.data!=null){
|
if(response.data!=null){
|
||||||
@ -610,31 +615,25 @@ export default {
|
|||||||
this.form.posPrem = JSON.stringify(this.form.posPrem);
|
this.form.posPrem = JSON.stringify(this.form.posPrem);
|
||||||
this.form.appletPrem = JSON.stringify(this.form.appletPrem);
|
this.form.appletPrem = JSON.stringify(this.form.appletPrem);
|
||||||
addStaff(this.form).then(response => {
|
addStaff(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
if (response.data==1){
|
||||||
this.open = false;
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.getList();
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// queryStaff({mobile:this.form.mobile}).then( response => {
|
updateStaff(this.form).then(response => {
|
||||||
// if (response.data != null) {
|
if (response.data==1){
|
||||||
// this.$modal.msgError("手机号已存在");
|
this.$modal.msgSuccess("修改成功");
|
||||||
// } else {
|
this.open = false;
|
||||||
// this.form.posPrem = JSON.stringify(this.form.posPrem);
|
this.getList();
|
||||||
// this.form.appletPrem = JSON.stringify(this.form.appletPrem);
|
}else {
|
||||||
updateStaff(this.form).then(response => {
|
this.$modal.msgError("手机号已存在");
|
||||||
if (response.data==1){
|
}
|
||||||
this.$modal.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
}else {
|
|
||||||
this.$modal.msgError("手机号已存在");
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
// }
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -4,15 +4,97 @@
|
|||||||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||||
<el-tab-pane label="油品提成方案" name="oil"></el-tab-pane>
|
<el-tab-pane label="油品提成方案" name="oil"></el-tab-pane>
|
||||||
<el-tab-pane label="非油品提成方案" name="nonOil"></el-tab-pane>
|
<el-tab-pane label="非油品提成方案" name="nonOil"></el-tab-pane>
|
||||||
|
<el-tab-pane label="员工提成记录" name="staffCommission">
|
||||||
|
<div>
|
||||||
|
<el-form :model="queryParams1" ref="queryForm" size="small" :inline="true" label-width="68px">
|
||||||
|
<el-form-item label="交易员工" prop="staffId">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams1.staffId"
|
||||||
|
clearable
|
||||||
|
placeholder="全部"
|
||||||
|
>
|
||||||
|
<el-option v-for="item in staffList" :key="item.id" :label="item.realName" :value="item.id">
|
||||||
|
<span style="float: left">{{ item.realName }}</span>
|
||||||
|
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.mobile }}</span>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="订单类型">
|
||||||
|
<el-input v-model="queryParams1.type" placeholder="请输入订单类型"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="订单号">
|
||||||
|
<el-input v-model="queryParams1.orderNo" placeholder="请输入订单号"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dateRange"
|
||||||
|
style="width: 240px"
|
||||||
|
size="medium"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="-"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>会员充值统计</span>
|
||||||
|
</div>
|
||||||
|
<div class="box-gang">
|
||||||
|
<div class="box">
|
||||||
|
<div class="size-hui">提成笔数</div>
|
||||||
|
<div class="size-bole">{{ total1 }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="box">
|
||||||
|
<div class="size-hui">提成金额</div>
|
||||||
|
<div class="size-bole">{{ allAmount }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<div style="margin-top: 20px" v-if="activeName=='staffCommission'">
|
||||||
|
<el-table ref="tables" v-loading="loading" :data="commissionList">
|
||||||
|
<el-table-column label="ID" prop="id" align="center" width="60"/>
|
||||||
|
<el-table-column label="员工信息" align="center">
|
||||||
|
<el-table-column label="姓名" prop="realName" align="center"/>
|
||||||
|
<el-table-column label="手机号" prop="mobile" align="center"/>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="类型" prop="type" align="center" />
|
||||||
|
<el-table-column label="提成金额(元)" prop="amount" align="center" width="260"/>
|
||||||
|
<el-table-column label="关联订单号" prop="orderNo" align="center"/>
|
||||||
|
<el-table-column label="描述" prop="description" align="center"/>
|
||||||
|
<el-table-column label="创建时间" prop="createTime" align="center" width="160">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total1>0"
|
||||||
|
:total="total1"
|
||||||
|
:page.sync="queryParams1.page"
|
||||||
|
:limit.sync="queryParams1.pageSize"
|
||||||
|
@pagination="getCommissionList"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
|
||||||
<el-alert
|
<el-alert
|
||||||
title="方案说明"
|
title="方案说明"
|
||||||
type="info"
|
type="info"
|
||||||
description="同一角色组、同一参与油品只能设置一种启用的提成方案">
|
v-if="activeName=='oil' || activeName=='nonOil'"
|
||||||
|
description="同一角色组、同一参与油品只能设置一种启用的提成方案,挂账订单不参与提成">
|
||||||
</el-alert>
|
</el-alert>
|
||||||
|
|
||||||
<div style="margin-top: 20px">
|
<div style="margin-top: 20px" v-if="activeName=='oil' || activeName=='nonOil'">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@ -23,21 +105,21 @@
|
|||||||
@sort-change="handleSortChange">
|
@sort-change="handleSortChange">
|
||||||
<el-table-column label="ID" prop="id" align="center" width="60"/>
|
<el-table-column label="ID" prop="id" align="center" width="60"/>
|
||||||
<el-table-column label="方案名称" prop="name" align="center"/>
|
<el-table-column label="方案名称" prop="name" align="center"/>
|
||||||
<el-table-column label="员工角色" prop="staffRoleGroup" align="center">
|
<el-table-column label="员工角色" prop="dutyName" align="center">
|
||||||
<template slot-scope="scope">
|
<!-- <template slot-scope="scope">-->
|
||||||
<dict-tag :options="dict.type.staff_role" :value="scope.row.staffRoleGroup"/>
|
<!-- <dict-tag :options="dict.type.staff_role" :value="scope.row.staffRoleGroup"/>-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="提成来源" prop="commissionSource" align="center" />
|
<el-table-column label="提成来源" prop="commissionSource" align="center" />
|
||||||
<el-table-column label="满足条件" prop="meetCondition" align="center">
|
<el-table-column label="满足条件" prop="meetCondition" align="center" width="260">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="form.type == 'orderAmount'">
|
<span v-if="scope.row.type == 'orderAmount'">
|
||||||
订单金额消费满{{scope.row.meetCondition}}元
|
订单金额消费满{{scope.row.meetCondition}}元
|
||||||
</span>
|
</span>
|
||||||
<span v-if="form.type == 'payAmount'">
|
<span v-if="scope.row.type == 'payAmount'">
|
||||||
实际金额消费满{{scope.row.meetCondition}}元
|
实际金额消费满{{scope.row.meetCondition}}元
|
||||||
</span>
|
</span>
|
||||||
<span v-if="form.type == 'refuleNum'">
|
<span v-if="scope.row.type == 'refuleNum'">
|
||||||
加油数量消费满{{scope.row.meetCondition}}单位(升/立方)
|
加油数量消费满{{scope.row.meetCondition}}单位(升/立方)
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
@ -88,9 +170,10 @@
|
|||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<!-- 添加或修改对话框 -->
|
<!-- 添加或修改提成方案对话框 -->
|
||||||
<el-dialog :close-on-click-modal="false" :title="title" width="40%" :visible.sync="open" append-to-body>
|
<el-dialog :close-on-click-modal="false" :title="title" width="40%" :visible.sync="open" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
|
||||||
<el-row>
|
<el-row>
|
||||||
@ -106,14 +189,6 @@
|
|||||||
<el-radio-group v-model="form.commissionSource">
|
<el-radio-group v-model="form.commissionSource">
|
||||||
<el-radio v-for="dict in dict.type.source" @change="isChange" :label="dict.value">{{ dict.label }}</el-radio>
|
<el-radio v-for="dict in dict.type.source" @change="isChange" :label="dict.value">{{ dict.label }}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<!-- <el-radio-group v-model="commissionSource" ref="" @change="getCheckbox">-->
|
|
||||||
<!-- <el-checkbox-->
|
|
||||||
<!-- v-for="dict in dict.type.source"-->
|
|
||||||
<!-- :key="dict.value"-->
|
|
||||||
<!-- :label="dict.label"-->
|
|
||||||
<!-- :value="dict.value"-->
|
|
||||||
<!-- ></el-checkbox>-->
|
|
||||||
<!-- </el-radio-group>-->
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -122,11 +197,11 @@
|
|||||||
<el-form-item label="角色组" prop="staffRoleGroup">
|
<el-form-item label="角色组" prop="staffRoleGroup">
|
||||||
<el-select v-model="form.staffRoleGroup" placeholder="请选择所属角色">
|
<el-select v-model="form.staffRoleGroup" placeholder="请选择所属角色">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dict.type.staff_role"
|
v-for="item in roleList"
|
||||||
:key="dict.value"
|
:key="item.dutyId+''"
|
||||||
:label="dict.label"
|
:label="item.dutyName"
|
||||||
:value="dict.value"
|
:value="item.dutyId+''"
|
||||||
/>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -134,9 +209,12 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="提成类型" prop="type">
|
<el-form-item label="提成类型" prop="type">
|
||||||
<el-radio-group v-model="form.type">
|
<el-radio-group v-model="form.type" v-if="form.commissionSource=='油品'">
|
||||||
<el-radio v-for="dict in dict.type.comissionType" :label="dict.value">{{ dict.label }}</el-radio>
|
<el-radio v-for="dict in dict.type.comissionType" :label="dict.value">{{ dict.label }}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
|
<el-radio-group v-model="form.type" v-else>
|
||||||
|
<el-radio v-for="dict in dict.type.comissionType" :label="dict.value" v-if="dict.value!='refuleNum'">{{ dict.label }}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -170,21 +248,6 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<!-- <el-row>-->
|
|
||||||
<!-- <el-col :span="24">-->
|
|
||||||
<!-- <el-form-item label="生效时间" prop="takeEffect">-->
|
|
||||||
<!-- <el-date-picker-->
|
|
||||||
<!-- v-model="form.takeEffect"-->
|
|
||||||
<!-- type="daterange"-->
|
|
||||||
<!-- value-format="yyyy-MM-dd HH:mm:ss"-->
|
|
||||||
<!-- range-separator="至"-->
|
|
||||||
<!-- start-placeholder="开始日期"-->
|
|
||||||
<!-- end-placeholder="结束日期">-->
|
|
||||||
<!-- </el-date-picker>-->
|
|
||||||
<!-- <div style="font-size: 12px;color: grey">时间范围内的油品交易有效</div>-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<!-- </el-col>-->
|
|
||||||
<!-- </el-row>-->
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="方案状态" prop="status">
|
<el-form-item label="方案状态" prop="status">
|
||||||
@ -210,17 +273,21 @@
|
|||||||
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
addCommission, delCommission,
|
addCommission, allAmountCommissionRecord, delCommission,
|
||||||
getCommission,
|
getCommission,
|
||||||
listCommission,
|
listCommission, listCommissionRecord,
|
||||||
queryCommission,
|
queryCommission,
|
||||||
updateCommission
|
updateCommission
|
||||||
} from "@/api/staffCommission/staffcommission";
|
} from "@/api/staffCommission/staffcommission";
|
||||||
|
import {listDuty} from "@/api/staff/duty";
|
||||||
|
import {queryStaffs} from "@/api/order/staff";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
dicts: ['source','role','zhzt','comissionType','staff_role'],
|
dicts: ['source','role','zhzt','comissionType','staff_role'],
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
|
// 提成总额
|
||||||
|
allAmount:0,
|
||||||
changeCom:false,
|
changeCom:false,
|
||||||
activeName: 'oil',
|
activeName: 'oil',
|
||||||
select:"元",
|
select:"元",
|
||||||
@ -231,8 +298,10 @@ export default {
|
|||||||
title: "",
|
title: "",
|
||||||
// 总条数
|
// 总条数
|
||||||
total: 0,
|
total: 0,
|
||||||
|
total1: 0,
|
||||||
// 表格数据
|
// 表格数据
|
||||||
list: [],
|
list: [],
|
||||||
|
commissionList: [],
|
||||||
// 是否显示修改对话框
|
// 是否显示修改对话框
|
||||||
open: false,
|
open: false,
|
||||||
// 默认排序
|
// 默认排序
|
||||||
@ -245,6 +314,13 @@ export default {
|
|||||||
name: '',
|
name: '',
|
||||||
commissionSource:'油品'
|
commissionSource:'油品'
|
||||||
},
|
},
|
||||||
|
queryParams1: {
|
||||||
|
page: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
},
|
||||||
|
staffList:[],
|
||||||
|
// 日期范围
|
||||||
|
dateRange: [],
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {
|
form: {
|
||||||
type:'orderAmount',
|
type:'orderAmount',
|
||||||
@ -252,6 +328,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 显示搜索条件
|
// 显示搜索条件
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
|
roleList:[],
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
name: [
|
name: [
|
||||||
@ -283,8 +360,21 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
this.getDuty();
|
||||||
|
this.getStaffList();
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
|
getStaffList(){
|
||||||
|
queryStaffs().then( response => {
|
||||||
|
this.staffList = response.data;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 查询角色列表
|
||||||
|
getDuty(){
|
||||||
|
listDuty().then(response => {
|
||||||
|
this.roleList = response.data
|
||||||
|
})
|
||||||
|
},
|
||||||
// 点击标签页
|
// 点击标签页
|
||||||
handleClick(tab, event) {
|
handleClick(tab, event) {
|
||||||
if (this.activeName == 'oil'){
|
if (this.activeName == 'oil'){
|
||||||
@ -296,7 +386,8 @@ export default {
|
|||||||
commissionSource:'油品'
|
commissionSource:'油品'
|
||||||
};
|
};
|
||||||
this.getList();
|
this.getList();
|
||||||
}else {
|
}
|
||||||
|
if (this.activeName == 'nonOil') {
|
||||||
this.queryParams = {
|
this.queryParams = {
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
@ -306,6 +397,13 @@ export default {
|
|||||||
};
|
};
|
||||||
this.getList();
|
this.getList();
|
||||||
}
|
}
|
||||||
|
if (this.activeName == 'staffCommission') {
|
||||||
|
this.queryParams1 = {
|
||||||
|
page: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
};
|
||||||
|
this.getCommissionList();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getCheckbox(){
|
getCheckbox(){
|
||||||
@ -320,6 +418,20 @@ export default {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 查询员工提成记录信息
|
||||||
|
getCommissionList(){
|
||||||
|
this.loading = true;
|
||||||
|
listCommissionRecord(this.addDateRange(this.queryParams1, this.dateRange)).then(res => {
|
||||||
|
this.commissionList = res.data.records;
|
||||||
|
this.total1 = res.data.total;
|
||||||
|
this.loading = false;
|
||||||
|
})
|
||||||
|
allAmountCommissionRecord(this.addDateRange(this.queryParams1, this.dateRange)).then(res => {
|
||||||
|
if (res.data){
|
||||||
|
this.allAmount = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
// 表单重置
|
// 表单重置
|
||||||
reset() {
|
reset() {
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
@ -356,6 +468,22 @@ export default {
|
|||||||
this.title = "编辑提成方案";
|
this.title = "编辑提成方案";
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 搜索按钮操作
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams1.page = 1;
|
||||||
|
this.getCommissionList();
|
||||||
|
},
|
||||||
|
// 重置按钮操作
|
||||||
|
resetQuery() {
|
||||||
|
this.dateRange = [];
|
||||||
|
this.queryParams1 = {
|
||||||
|
page: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
}
|
||||||
|
// this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
// 删除按钮操作
|
// 删除按钮操作
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const name = row.name
|
const name = row.name
|
||||||
@ -378,70 +506,28 @@ export default {
|
|||||||
submitForm: function() {
|
submitForm: function() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
// let date = new Date();
|
|
||||||
// let year = date.getFullYear()
|
|
||||||
// let month = date.getMonth()+1
|
|
||||||
// let day = date.getDate()
|
|
||||||
// let hour = date.getHours()
|
|
||||||
// let minutes = date.getMinutes()
|
|
||||||
// let second = date.getSeconds()
|
|
||||||
// let now = year+"-"+this.add0(month)+"-"+this.add0(day)+" "+hour+":"+minutes+":"+second
|
|
||||||
// if(this.form.takeEffect[0] < now && this.form.takeEffect[1] > now){
|
|
||||||
// this.form.status = 'qy'
|
|
||||||
// }else {
|
|
||||||
// this.form.status = 'jy'
|
|
||||||
// }
|
|
||||||
// // this.form.commissionSource = this.commissionSource.toString()
|
|
||||||
// this.form.takeEffect = JSON.stringify(this.form.takeEffect)
|
|
||||||
if (this.form.id) {
|
if (this.form.id) {
|
||||||
if (this.changeCom){
|
|
||||||
queryCommission(this.form).then(response => {
|
|
||||||
if (response.data != null) {
|
|
||||||
if (this.changeCom) {
|
|
||||||
this.$modal.msgError("同一个角色组只能对应一个" + this.form.commissionSource + "提成方案")
|
|
||||||
}else {
|
|
||||||
this.$modal.msgError("当前时间段已存在相同油品、相同角色组的方案")
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.form.royaltyRate = this.form.royaltyRate + this.select
|
|
||||||
updateCommission(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("提成方案更新成功");
|
|
||||||
this.open = false;
|
|
||||||
this.changeCom = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}else {
|
|
||||||
this.form.royaltyRate = this.form.royaltyRate + this.select
|
this.form.royaltyRate = this.form.royaltyRate + this.select
|
||||||
updateCommission(this.form).then(response => {
|
updateCommission(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("提成方案更新成功");
|
if (response.data==1){
|
||||||
this.open = false;
|
this.$modal.msgSuccess("提成方案更新成功");
|
||||||
this.getList();
|
this.open = false;
|
||||||
});
|
this.getList();
|
||||||
}
|
|
||||||
} else {
|
|
||||||
queryCommission(this.form).then(response => {
|
|
||||||
if (response.data != null){
|
|
||||||
if (response.data.status == 'qy'){
|
|
||||||
this.$modal.msgError("同一个角色组只能对应一个"+this.form.commissionSource+"提成方案")
|
|
||||||
}else {
|
}else {
|
||||||
this.form.royaltyRate = this.form.royaltyRate + this.select
|
this.$modal.msgError("同一个角色组只能对应一个" + this.form.commissionSource + "提成方案")
|
||||||
addCommission(this.form).then(response => {
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.form.royaltyRate = this.form.royaltyRate + this.select
|
||||||
|
addCommission(this.form).then(response => {
|
||||||
|
if (response.data==1) {
|
||||||
this.$modal.msgSuccess("提成方案新增成功");
|
this.$modal.msgSuccess("提成方案新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
}else {
|
||||||
}
|
this.$modal.msgError("同一个角色组只能对应一个"+this.form.commissionSource+"提成方案")
|
||||||
}else {
|
}
|
||||||
this.form.royaltyRate = this.form.royaltyRate + this.select
|
|
||||||
addCommission(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("提成方案新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -472,4 +558,33 @@ export default {
|
|||||||
height: 100vh;
|
height: 100vh;
|
||||||
background: #f6f8f9;
|
background: #f6f8f9;
|
||||||
}
|
}
|
||||||
|
.clearfix{
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
}
|
||||||
|
.box-card{
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
.box-gang{
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.box{
|
||||||
|
width: 200px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 10px;
|
||||||
|
background: #f9f9f9;
|
||||||
|
height: 86px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
.size-hui{
|
||||||
|
font-size: 14px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
.size-bole{
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -48,7 +48,7 @@ Vue.prototype.getName = getName
|
|||||||
Vue.prototype.download = download
|
Vue.prototype.download = download
|
||||||
Vue.prototype.handleTree = handleTree
|
Vue.prototype.handleTree = handleTree
|
||||||
// Vue.prototype.pcUrl = 'http://192.168.0.121:82/'
|
// Vue.prototype.pcUrl = 'http://192.168.0.121:82/'
|
||||||
Vue.prototype.pcUrl = 'http://192.168.0.178:82/'
|
Vue.prototype.pcUrl = 'http://192.168.0.121:82/'
|
||||||
|
|
||||||
// 全局组件挂载
|
// 全局组件挂载
|
||||||
Vue.component('DictTag', DictTag)
|
Vue.component('DictTag', DictTag)
|
||||||
|
@ -62,7 +62,7 @@ public class FyPayController {
|
|||||||
// 业务逻辑 判断订单状态
|
// 业务逻辑 判断订单状态
|
||||||
AllOrderInfo allOrderInfo = allOrderInfoService.selectAllOrderInfoByOrderNo(orderNo);
|
AllOrderInfo allOrderInfo = allOrderInfoService.selectAllOrderInfoByOrderNo(orderNo);
|
||||||
if (ObjectUtil.isNotEmpty(allOrderInfo)){
|
if (ObjectUtil.isNotEmpty(allOrderInfo)){
|
||||||
allOrderInfo.setPayMoney(Double.valueOf(settleOrderAmt));
|
allOrderInfo.setPayMoney(Double.valueOf(settleOrderAmt)/100);
|
||||||
allOrderInfo.setTransactionId(transactionId);
|
allOrderInfo.setTransactionId(transactionId);
|
||||||
allOrderInfo.setStatus("paid");
|
allOrderInfo.setStatus("paid");
|
||||||
allOrderInfo.setPayTime(new Date());
|
allOrderInfo.setPayTime(new Date());
|
||||||
|
@ -34,7 +34,7 @@ public interface MerchantConfigService extends IService<MerchantConfig> {
|
|||||||
* 根据店铺id查询商户信息
|
* 根据店铺id查询商户信息
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<MerchantConfig> selectMeChByIsOpen();
|
public List<MerchantConfig> selectMeChByIsOpen(Integer storeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有商户配置信息
|
* 查询所有商户配置信息
|
||||||
|
@ -9,6 +9,7 @@ import com.fuint.api.fuyou.entity.*;
|
|||||||
import com.fuint.api.fuyou.service.FyPayService;
|
import com.fuint.api.fuyou.service.FyPayService;
|
||||||
import com.fuint.api.fuyou.service.MerchantConfigService;
|
import com.fuint.api.fuyou.service.MerchantConfigService;
|
||||||
import com.fuint.api.fuyou.util.Utils;
|
import com.fuint.api.fuyou.util.Utils;
|
||||||
|
import com.fuint.business.commission.service.StaffCommissionService;
|
||||||
import com.fuint.business.integral.entity.IntegralOrders;
|
import com.fuint.business.integral.entity.IntegralOrders;
|
||||||
import com.fuint.business.integral.service.IntegralOrdersService;
|
import com.fuint.business.integral.service.IntegralOrdersService;
|
||||||
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
|
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
|
||||||
@ -45,6 +46,9 @@ public class FyPayServiceImpl implements FyPayService {
|
|||||||
private CardFuelRecordService cardFuelRecordService;
|
private CardFuelRecordService cardFuelRecordService;
|
||||||
@Resource
|
@Resource
|
||||||
private IntegralOrdersService integralOrdersService;
|
private IntegralOrdersService integralOrdersService;
|
||||||
|
@Autowired
|
||||||
|
private StaffCommissionService staffCommissionService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 条码支付
|
* 条码支付
|
||||||
* @param map1
|
* @param map1
|
||||||
@ -171,7 +175,7 @@ public class FyPayServiceImpl implements FyPayService {
|
|||||||
// 油品订单
|
// 油品订单
|
||||||
oilOrder.setOrderStatus("paid");
|
oilOrder.setOrderStatus("paid");
|
||||||
oilOrder.setPayTime(date);
|
oilOrder.setPayTime(date);
|
||||||
|
staffCommissionService.countStaffCommission(oilOrder.getStaffId(),oilOrder.getStoreId(),oilOrder.getOrderAmount(),oilOrder.getPayAmount(),oilOrder.getOilNum(),"油品",orderNo);
|
||||||
// 修改油罐容量
|
// 修改油罐容量
|
||||||
List<JSONObject> jsonObjects = JSONArray.parseArray(map1.get("oilOrder"), JSONObject.class);
|
List<JSONObject> jsonObjects = JSONArray.parseArray(map1.get("oilOrder"), JSONObject.class);
|
||||||
if (jsonObjects.size()<=1) {
|
if (jsonObjects.size()<=1) {
|
||||||
@ -193,7 +197,7 @@ public class FyPayServiceImpl implements FyPayService {
|
|||||||
// 商品订单
|
// 商品订单
|
||||||
goodsOrder.setStatus("paid");
|
goodsOrder.setStatus("paid");
|
||||||
goodsOrder.setPayTime(date);
|
goodsOrder.setPayTime(date);
|
||||||
|
staffCommissionService.countStaffCommission(goodsOrder.getStaffId(),goodsOrder.getStoreId(),goodsOrder.getAmount(),goodsOrder.getPayAmount(),0.0,"商品",orderNo);
|
||||||
if (!map1.get("goodsOrder").equals("[]")){
|
if (!map1.get("goodsOrder").equals("[]")){
|
||||||
List<JSONObject> goods = JSONArray.parseArray(map1.get("goodsOrder"), JSONObject.class);
|
List<JSONObject> goods = JSONArray.parseArray(map1.get("goodsOrder"), JSONObject.class);
|
||||||
OrderGoods orderGoods = new OrderGoods();
|
OrderGoods orderGoods = new OrderGoods();
|
||||||
@ -225,6 +229,9 @@ public class FyPayServiceImpl implements FyPayService {
|
|||||||
if (!ArrayUtil.isEmpty(list)){
|
if (!ArrayUtil.isEmpty(list)){
|
||||||
if (list.size()>1){
|
if (list.size()>1){
|
||||||
for (OilOrder order : list) {
|
for (OilOrder order : list) {
|
||||||
|
if (order.getOrderType().equals("主订单")){
|
||||||
|
staffCommissionService.countStaffCommission(order.getStaffId(),order.getStoreId(),order.getOrderAmount(),order.getPayAmount(),order.getOilNum(),"油品",orderNo);
|
||||||
|
}
|
||||||
// 添加多个油品订单
|
// 添加多个油品订单
|
||||||
order.setOrderStatus("paid");
|
order.setOrderStatus("paid");
|
||||||
order.setPayTime(date);
|
order.setPayTime(date);
|
||||||
@ -483,12 +490,19 @@ public class FyPayServiceImpl implements FyPayService {
|
|||||||
allOrderInfo.setType(receiveParameter.getType());
|
allOrderInfo.setType(receiveParameter.getType());
|
||||||
allOrderInfo.setStoreId(receiveParameter.getStoreId());
|
allOrderInfo.setStoreId(receiveParameter.getStoreId());
|
||||||
allOrderInfo.setGoodsMoney(receiveParameter.getGoodsMoney());
|
allOrderInfo.setGoodsMoney(receiveParameter.getGoodsMoney());
|
||||||
|
allOrderInfo.setPayMoney(receiveParameter.getGoodsMoney());
|
||||||
allOrderInfo.setPayType(receiveParameter.getPayType());
|
allOrderInfo.setPayType(receiveParameter.getPayType());
|
||||||
allOrderInfo.setUserId(receiveParameter.getUserId());
|
allOrderInfo.setUserId(receiveParameter.getUserId());
|
||||||
allOrderInfo.setPayChannel("cashier");
|
allOrderInfo.setPayChannel("cashier");
|
||||||
allOrderInfo.setStatus(payStatus);
|
allOrderInfo.setStatus(payStatus);
|
||||||
|
if (payStatus.equals("paid")){
|
||||||
|
allOrderInfo.setPayTime(new Date());
|
||||||
|
}
|
||||||
allOrderInfo.setContent(receiveParameter.getContent());
|
allOrderInfo.setContent(receiveParameter.getContent());
|
||||||
allOrderInfoService.insertAllOrderInfo(allOrderInfo);
|
AllOrderInfo allOrderInfo1 = allOrderInfoService.selectAllOrderInfoByOrderNo(receiveParameter.getOrderNo());
|
||||||
|
if (ObjectUtil.isEmpty(allOrderInfo1)){
|
||||||
|
allOrderInfoService.insertAllOrderInfo(allOrderInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -505,7 +519,10 @@ public class FyPayServiceImpl implements FyPayService {
|
|||||||
allOrderInfo.setPayChannel("applet");
|
allOrderInfo.setPayChannel("applet");
|
||||||
allOrderInfo.setStatus("unpaid");
|
allOrderInfo.setStatus("unpaid");
|
||||||
allOrderInfo.setContent(receiveParameter.getContent());
|
allOrderInfo.setContent(receiveParameter.getContent());
|
||||||
allOrderInfoService.insertAllOrderInfo(allOrderInfo);
|
AllOrderInfo allOrderInfo1 = allOrderInfoService.selectAllOrderInfoByOrderNo(receiveParameter.getOrderNo());
|
||||||
|
if (ObjectUtil.isEmpty(allOrderInfo1)){
|
||||||
|
allOrderInfoService.insertAllOrderInfo(allOrderInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -46,9 +46,10 @@ public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MerchantConfig> selectMeChByIsOpen() {
|
public List<MerchantConfig> selectMeChByIsOpen(Integer storeId) {
|
||||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("is_open_rule","1");
|
queryWrapper.eq("is_open_rule","1");
|
||||||
|
queryWrapper.eq("store_id",storeId);
|
||||||
List list = baseMapper.selectList(queryWrapper);
|
List list = baseMapper.selectList(queryWrapper);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.fuint.business.commission.entity.CommissionRecord;
|
import com.fuint.business.commission.entity.CommissionRecord;
|
||||||
import com.fuint.business.commission.service.CommissionRecordService;
|
import com.fuint.business.commission.service.CommissionRecordService;
|
||||||
|
import com.fuint.business.commission.vo.CommissionRecordVo;
|
||||||
import com.fuint.framework.web.BaseController;
|
import com.fuint.framework.web.BaseController;
|
||||||
import com.fuint.framework.web.ResponseObject;
|
import com.fuint.framework.web.ResponseObject;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -89,7 +90,31 @@ public class CommissionRecordController extends BaseController {
|
|||||||
return getSuccessResult(this.commissionRecordService.deleteById(id));
|
return getSuccessResult(this.commissionRecordService.deleteById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件分页查询提成记录信息
|
||||||
|
* @param commissionRecord
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("list")
|
||||||
|
public ResponseObject list(CommissionRecordVo commissionRecord,
|
||||||
|
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize) {
|
||||||
|
Page page = new Page(pageNo, pageSize);
|
||||||
|
IPage< CommissionRecordVo> iPageList = this.commissionRecordService.selectCommissionList(page, commissionRecord);
|
||||||
|
return getSuccessResult(iPageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消费总金额
|
||||||
|
* @param commissionRecord
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("allAmount")
|
||||||
|
public ResponseObject allAmount(CommissionRecordVo commissionRecord) {
|
||||||
|
return getSuccessResult(commissionRecordService.selectAllAmount(commissionRecord));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.fuint.business.commission.entity.StaffCommission;
|
import com.fuint.business.commission.entity.StaffCommission;
|
||||||
import com.fuint.business.commission.service.StaffCommissionService;
|
import com.fuint.business.commission.service.StaffCommissionService;
|
||||||
|
import com.fuint.business.commission.vo.StaffCommissionVo;
|
||||||
import com.fuint.framework.web.BaseController;
|
import com.fuint.framework.web.BaseController;
|
||||||
import com.fuint.framework.web.ResponseObject;
|
import com.fuint.framework.web.ResponseObject;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -31,7 +32,7 @@ public class StaffCommissionController extends BaseController {
|
|||||||
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
|
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
|
||||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
|
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
|
||||||
Page page =new Page(pageNo,pageSize);
|
Page page =new Page(pageNo,pageSize);
|
||||||
IPage<StaffCommission> list = commissionService.selectCommissionList(page,commission);
|
IPage<StaffCommissionVo> list = commissionService.selectCommissionList(page,commission);
|
||||||
return getSuccessResult(list);
|
return getSuccessResult(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ package com.fuint.business.commission.mapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.fuint.business.commission.entity.CommissionRecord;
|
import com.fuint.business.commission.entity.CommissionRecord;
|
||||||
|
import com.fuint.business.commission.vo.CommissionRecordVo;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -81,5 +82,19 @@ public interface CommissionRecordMapper {
|
|||||||
*/
|
*/
|
||||||
int deleteById(Integer id);
|
int deleteById(Integer id);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件分页查询员工提成记录信息
|
||||||
|
* @param page
|
||||||
|
* @param commissionRecord
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<CommissionRecordVo> selectCommissionList(@Param("page") Page page,@Param("commissionRecord") CommissionRecordVo commissionRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件查询提成总额
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Double selectAllAmount(@Param("commissionRecord") CommissionRecordVo commissionRecord);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.fuint.business.commission.entity.StaffCommission;
|
import com.fuint.business.commission.entity.StaffCommission;
|
||||||
|
import com.fuint.business.commission.vo.StaffCommissionVo;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
public interface StaffCommissionMapper extends BaseMapper<StaffCommission> {
|
public interface StaffCommissionMapper extends BaseMapper<StaffCommission> {
|
||||||
@ -12,5 +13,5 @@ public interface StaffCommissionMapper extends BaseMapper<StaffCommission> {
|
|||||||
* @param page
|
* @param page
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public IPage<StaffCommission> selectCommissionList(Page page,@Param("commission") StaffCommission commission);
|
public IPage<StaffCommissionVo> selectCommissionList(Page page, @Param("commission") StaffCommission commission);
|
||||||
}
|
}
|
||||||
|
@ -183,5 +183,55 @@
|
|||||||
delete from commission_record where id = #{id}
|
delete from commission_record where id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectCommissionList" resultType="com.fuint.business.commission.vo.CommissionRecordVo">
|
||||||
|
select cr.*,ms.real_name,ms.mobile from commission_record cr
|
||||||
|
left join mt_staff ms on cr.staff_id = ms.id
|
||||||
|
<where>
|
||||||
|
<if test="commissionRecord.storeId != null and commissionRecord.storeId != ''">
|
||||||
|
and cr.store_id = #{commissionRecord.storeId}
|
||||||
|
</if>
|
||||||
|
<if test="commissionRecord.staffId != null and commissionRecord.staffId != ''">
|
||||||
|
and cr.staff_id = #{commissionRecord.staffId}
|
||||||
|
</if>
|
||||||
|
<if test="commissionRecord.type != null and commissionRecord.type != ''">
|
||||||
|
and cr.type like concat('%', #{commissionRecord.type}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="commissionRecord.orderNo != null and commissionRecord.orderNo != ''">
|
||||||
|
and cr.order_no like concat('%', #{commissionRecord.orderNo}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="commissionRecord.params.beginTime != null and commissionRecord.params.beginTime != ''"><!-- 开始时间检索 -->
|
||||||
|
and date_format(cr.create_time,'%y%m%d') >= date_format(#{commissionRecord.params.beginTime},'%y%m%d')
|
||||||
|
</if>
|
||||||
|
<if test="commissionRecord.params.endTime != null and commissionRecord.params.endTime != ''"><!-- 结束时间检索 -->
|
||||||
|
and date_format(cr.create_time,'%y%m%d') <= date_format(#{commissionRecord.params.endTime},'%y%m%d')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by cr.create_time desc
|
||||||
|
</select>
|
||||||
|
<select id="selectAllAmount" resultType="java.lang.Double"
|
||||||
|
parameterType="com.fuint.business.commission.vo.CommissionRecordVo">
|
||||||
|
select sum(amount) from commission_record
|
||||||
|
<where>
|
||||||
|
<if test="commissionRecord.storeId != null and commissionRecord.storeId != ''">
|
||||||
|
and store_id = #{commissionRecord.storeId}
|
||||||
|
</if>
|
||||||
|
<if test="commissionRecord.staffId != null and commissionRecord.staffId != ''">
|
||||||
|
and staff_id = #{commissionRecord.staffId}
|
||||||
|
</if>
|
||||||
|
<if test="commissionRecord.type != null and commissionRecord.type != ''">
|
||||||
|
and type like concat('%', #{commissionRecord.type}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="commissionRecord.orderNo != null and commissionRecord.orderNo != ''">
|
||||||
|
and order_no like concat('%', #{commissionRecord.orderNo}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="commissionRecord.params.beginTime != null and commissionRecord.params.beginTime != ''"><!-- 开始时间检索 -->
|
||||||
|
and date_format(create_time,'%y%m%d') >= date_format(#{commissionRecord.params.beginTime},'%y%m%d')
|
||||||
|
</if>
|
||||||
|
<if test="commissionRecord.params.endTime != null and commissionRecord.params.endTime != ''"><!-- 结束时间检索 -->
|
||||||
|
and date_format(create_time,'%y%m%d') <= date_format(#{commissionRecord.params.endTime},'%y%m%d')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.fuint.business.commission.mapper.StaffCommissionMapper">
|
<mapper namespace="com.fuint.business.commission.mapper.StaffCommissionMapper">
|
||||||
<sql id="selectCommission">
|
<sql id="selectCommission">
|
||||||
select * from staff_commission
|
select sc.*,td.duty_name from staff_commission sc left join t_duty td on sc.staff_role_group = td.duty_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectCommissionList" resultType="com.fuint.business.commission.entity.StaffCommission">
|
<select id="selectCommissionList" resultType="com.fuint.business.commission.vo.StaffCommissionVo">
|
||||||
<include refid="selectCommission"></include>
|
<include refid="selectCommission"></include>
|
||||||
<where>
|
<where>
|
||||||
store_id = #{commission.storeId}
|
sc.store_id = #{commission.storeId}
|
||||||
and commission_source = #{commission.commissionSource}
|
and sc.commission_source = #{commission.commissionSource}
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
@ -3,6 +3,7 @@ package com.fuint.business.commission.service;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.fuint.business.commission.entity.CommissionRecord;
|
import com.fuint.business.commission.entity.CommissionRecord;
|
||||||
|
import com.fuint.business.commission.vo.CommissionRecordVo;
|
||||||
import io.lettuce.core.dynamic.annotation.Param;
|
import io.lettuce.core.dynamic.annotation.Param;
|
||||||
|
|
||||||
|
|
||||||
@ -56,4 +57,24 @@ public interface CommissionRecordService {
|
|||||||
*/
|
*/
|
||||||
boolean deleteById(Integer id);
|
boolean deleteById(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加提成记录信息
|
||||||
|
* @param commissionRecord
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int insertRecord(CommissionRecord commissionRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件分页查询员工提成记录信息
|
||||||
|
* @param page
|
||||||
|
* @param commissionRecord
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<CommissionRecordVo> selectCommissionList(Page page, CommissionRecordVo commissionRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件查询提成总额
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Double selectAllAmount(CommissionRecordVo commissionRecord);
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.fuint.business.commission.entity.StaffCommission;
|
import com.fuint.business.commission.entity.StaffCommission;
|
||||||
|
import com.fuint.business.commission.vo.StaffCommissionVo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -17,7 +18,7 @@ public interface StaffCommissionService extends IService<StaffCommission> {
|
|||||||
* @param page
|
* @param page
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public IPage<StaffCommission> selectCommissionList(Page page, StaffCommission commission);
|
public IPage<StaffCommissionVo> selectCommissionList(Page page, StaffCommission commission);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询员工提成方案信息
|
* 根据id查询员工提成方案信息
|
||||||
@ -53,4 +54,15 @@ public interface StaffCommissionService extends IService<StaffCommission> {
|
|||||||
*/
|
*/
|
||||||
public int updateStaffCommission(StaffCommission commission);
|
public int updateStaffCommission(StaffCommission commission);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据员工id计算提成金额
|
||||||
|
* @param staffId 员工id
|
||||||
|
* @param storeId 店铺id
|
||||||
|
* @param amount 订单金额
|
||||||
|
* @param payAmount 实付金额
|
||||||
|
* @param oilLiters 油品消费升数
|
||||||
|
* @param type 订单类型(油品、非油品)
|
||||||
|
* @param orderNo 关联订单号
|
||||||
|
*/
|
||||||
|
void countStaffCommission(Integer staffId,Integer storeId,Double amount,Double payAmount,Double oilLiters,String type,String orderNo);
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.fuint.business.commission.entity.CommissionRecord;
|
import com.fuint.business.commission.entity.CommissionRecord;
|
||||||
import com.fuint.business.commission.mapper.CommissionRecordMapper;
|
import com.fuint.business.commission.mapper.CommissionRecordMapper;
|
||||||
import com.fuint.business.commission.service.CommissionRecordService;
|
import com.fuint.business.commission.service.CommissionRecordService;
|
||||||
|
import com.fuint.business.commission.vo.CommissionRecordVo;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.fuint.common.util.TokenUtil;
|
import com.fuint.common.util.TokenUtil;
|
||||||
import io.lettuce.core.dynamic.annotation.Param;
|
import io.lettuce.core.dynamic.annotation.Param;
|
||||||
@ -92,4 +93,23 @@ public class CommissionRecordServiceImpl implements CommissionRecordService {
|
|||||||
public boolean deleteById(Integer id) {
|
public boolean deleteById(Integer id) {
|
||||||
return this.commissionRecordMapper.deleteById(id) > 0;
|
return this.commissionRecordMapper.deleteById(id) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int insertRecord(CommissionRecord commissionRecord) {
|
||||||
|
return commissionRecordMapper.insert(commissionRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<CommissionRecordVo> selectCommissionList(Page page, CommissionRecordVo commissionRecord) {
|
||||||
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
|
commissionRecord.setStoreId(nowAccountInfo.getStoreId());
|
||||||
|
return commissionRecordMapper.selectCommissionList(page, commissionRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Double selectAllAmount(CommissionRecordVo commissionRecord) {
|
||||||
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
|
commissionRecord.setStoreId(nowAccountInfo.getStoreId());
|
||||||
|
return commissionRecordMapper.selectAllAmount(commissionRecord);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,21 @@
|
|||||||
package com.fuint.business.commission.service.impl;
|
package com.fuint.business.commission.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.fuint.business.commission.entity.CommissionRecord;
|
||||||
import com.fuint.business.commission.entity.StaffCommission;
|
import com.fuint.business.commission.entity.StaffCommission;
|
||||||
import com.fuint.business.commission.mapper.StaffCommissionMapper;
|
import com.fuint.business.commission.mapper.StaffCommissionMapper;
|
||||||
|
import com.fuint.business.commission.service.CommissionRecordService;
|
||||||
import com.fuint.business.commission.service.StaffCommissionService;
|
import com.fuint.business.commission.service.StaffCommissionService;
|
||||||
|
import com.fuint.business.commission.vo.StaffCommissionVo;
|
||||||
|
import com.fuint.business.member.entity.LJStaff;
|
||||||
|
import com.fuint.business.member.service.ILJStaffService;
|
||||||
import com.fuint.common.dto.AccountInfo;
|
import com.fuint.common.dto.AccountInfo;
|
||||||
import com.fuint.common.util.TokenUtil;
|
import com.fuint.common.util.TokenUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@ -26,26 +33,12 @@ import java.util.Map;
|
|||||||
@Service
|
@Service
|
||||||
public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMapper, StaffCommission> implements StaffCommissionService {
|
public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMapper, StaffCommission> implements StaffCommissionService {
|
||||||
@Override
|
@Override
|
||||||
public IPage<StaffCommission> selectCommissionList(Page page, StaffCommission commission) {
|
public IPage<StaffCommissionVo> selectCommissionList(Page page, StaffCommission commission) {
|
||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
Integer storeId = nowAccountInfo.getStoreId();
|
Integer storeId = nowAccountInfo.getStoreId();
|
||||||
commission.setStoreId(storeId);
|
commission.setStoreId(storeId);
|
||||||
IPage<StaffCommission> staffCommissionIPage = baseMapper.selectCommissionList(page, commission);
|
IPage<StaffCommissionVo> staffCommissionIPage = baseMapper.selectCommissionList(page, commission);
|
||||||
for (StaffCommission record : staffCommissionIPage.getRecords()) {
|
return staffCommissionIPage;
|
||||||
if (record.getTakeEffect()!=null && record.getTakeEffect().equals("")){
|
|
||||||
String substring = record.getTakeEffect().substring(24, 43);
|
|
||||||
Date date = new Date();
|
|
||||||
SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
String now = dateFormat.format(date);
|
|
||||||
int row = substring.compareTo(now);
|
|
||||||
if (row == -1){
|
|
||||||
record.setStatus("jy");
|
|
||||||
baseMapper.updateById(record);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
IPage<StaffCommission> commissionIPage = baseMapper.selectCommissionList(page, commission);
|
|
||||||
return commissionIPage;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -74,18 +67,93 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int insertStaffCommission(StaffCommission commission) {
|
public int insertStaffCommission(StaffCommission commission) {
|
||||||
|
StaffCommission staffCommission = this.selectCommissionByRole(commission);
|
||||||
|
int row = 0;
|
||||||
|
// 判断当前店铺是否存在同角色的同一提成方案
|
||||||
|
if (ObjectUtil.isNotEmpty(staffCommission)){
|
||||||
|
row = 0;
|
||||||
|
return row;
|
||||||
|
}
|
||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
Integer storeId = nowAccountInfo.getStoreId();
|
Integer storeId = nowAccountInfo.getStoreId();
|
||||||
commission.setStoreId(storeId);
|
commission.setStoreId(storeId);
|
||||||
int row = baseMapper.insert(commission);
|
row = baseMapper.insert(commission);
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int updateStaffCommission(StaffCommission commission) {
|
public int updateStaffCommission(StaffCommission commission) {
|
||||||
int row = baseMapper.updateById(commission);
|
StaffCommission staffCommission = this.selectCommissionByRole(commission);
|
||||||
|
int row = 0;
|
||||||
|
// 判断当前店铺是否存在同角色的同一提成方案
|
||||||
|
if (ObjectUtil.isNotEmpty(staffCommission) && staffCommission.getId()!=commission.getId()){
|
||||||
|
row = 0;
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
row = baseMapper.updateById(commission);
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CommissionRecordService commissionRecordService;
|
||||||
|
@Autowired
|
||||||
|
private ILJStaffService staffService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void countStaffCommission(Integer staffId,Integer storeId,Double amount,Double payAmount,Double oilLiters,String type,String orderNo) {
|
||||||
|
LJStaff staff = staffService.selectStaffById(staffId);
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("store_id",storeId);
|
||||||
|
queryWrapper.eq("status","qy");
|
||||||
|
// 查询当前店铺启用的提成方案信息
|
||||||
|
List<StaffCommission> list = baseMapper.selectList(queryWrapper);
|
||||||
|
if (list.size()>0 && ObjectUtil.isNotEmpty(staff)){
|
||||||
|
for (StaffCommission staffCommission : list) {
|
||||||
|
CommissionRecord commissionRecord = new CommissionRecord();
|
||||||
|
if (type.equals(staffCommission.getCommissionSource()) && staff.getRoleId().equals(staffCommission.getStaffRoleGroup())){
|
||||||
|
commissionRecord.setStaffId(staffId);
|
||||||
|
commissionRecord.setStoreId(storeId);
|
||||||
|
commissionRecord.setType(type+"订单出售");
|
||||||
|
commissionRecord.setDescription(type+"订单出售提成");
|
||||||
|
commissionRecord.setOrderNo(orderNo);
|
||||||
|
Double royaltyRate = Double.valueOf(staffCommission.getRoyaltyRate().substring(0,staffCommission.getRoyaltyRate().length()-1));
|
||||||
|
String unit = staffCommission.getRoyaltyRate().substring(staffCommission.getRoyaltyRate().length()-1);
|
||||||
|
// 按照订单金额计算提成
|
||||||
|
if (staffCommission.getType().equals("orderAmount")){
|
||||||
|
if (amount>=Double.valueOf(staffCommission.getMeetCondition())){
|
||||||
|
if (unit.equals("元")){
|
||||||
|
commissionRecord.setAmount(royaltyRate);
|
||||||
|
}
|
||||||
|
if (unit.equals("%")){
|
||||||
|
commissionRecord.setAmount(amount*(royaltyRate/100));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 按照实付金额计算提成
|
||||||
|
if (staffCommission.getType().equals("payAmount")){
|
||||||
|
if (payAmount>=Double.valueOf(staffCommission.getMeetCondition())){
|
||||||
|
if (unit.equals("元")){
|
||||||
|
commissionRecord.setAmount(royaltyRate);
|
||||||
|
}
|
||||||
|
if (unit.equals("%")){
|
||||||
|
commissionRecord.setAmount(payAmount*(royaltyRate/100));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 按照加油数量计算提成
|
||||||
|
if (staffCommission.getType().equals("refuleNum")){
|
||||||
|
if (oilLiters>=Double.valueOf(staffCommission.getMeetCondition())){
|
||||||
|
if (unit.equals("元")){
|
||||||
|
commissionRecord.setAmount(royaltyRate);
|
||||||
|
}
|
||||||
|
if (unit.equals("%")){
|
||||||
|
commissionRecord.setAmount(oilLiters*(royaltyRate/100));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
commissionRecordService.insertRecord(commissionRecord);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,16 @@
|
|||||||
package com.fuint.business.commission.vo;
|
package com.fuint.business.commission.vo;
|
||||||
|
|
||||||
public class CommissionRecordVo {
|
import com.fuint.business.commission.entity.CommissionRecord;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CommissionRecordVo extends CommissionRecord {
|
||||||
|
/**
|
||||||
|
* 员工姓名
|
||||||
|
*/
|
||||||
|
private String realName;
|
||||||
|
/**
|
||||||
|
* 员工手机号
|
||||||
|
*/
|
||||||
|
private String mobile;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.fuint.business.commission.vo;
|
||||||
|
|
||||||
|
import com.fuint.business.commission.entity.StaffCommission;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class StaffCommissionVo extends StaffCommission {
|
||||||
|
/**
|
||||||
|
* 角色名
|
||||||
|
*/
|
||||||
|
private String dutyName;
|
||||||
|
}
|
@ -508,7 +508,7 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
|||||||
if (flag) {
|
if (flag) {
|
||||||
// 调用支付接口
|
// 调用支付接口
|
||||||
// 判断是否开启支付规则
|
// 判断是否开启支付规则
|
||||||
List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen();
|
List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen(integralOrdersList.getStoreId());
|
||||||
// if (list.size() > 0) {
|
// if (list.size() > 0) {
|
||||||
// oilConfigService.oilRule();
|
// oilConfigService.oilRule();
|
||||||
// }
|
// }
|
||||||
|
@ -423,10 +423,10 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
|
|||||||
public PaymentActiveVO paymentActive(PaymentActiveDTO paymentActiveDTO) {
|
public PaymentActiveVO paymentActive(PaymentActiveDTO paymentActiveDTO) {
|
||||||
PaymentActiveVO paymentActiveVO = new PaymentActiveVO();
|
PaymentActiveVO paymentActiveVO = new PaymentActiveVO();
|
||||||
Integer storeId = paymentActiveDTO.getStoreId();
|
Integer storeId = paymentActiveDTO.getStoreId();
|
||||||
BigDecimal amount = new BigDecimal(0.00);
|
BigDecimal amount = new BigDecimal("0.00");
|
||||||
BigDecimal fullAmount = new BigDecimal(0.00);
|
BigDecimal fullAmount = new BigDecimal("0.00");
|
||||||
BigDecimal a = new BigDecimal(0.1);
|
BigDecimal a = new BigDecimal("0.1");
|
||||||
BigDecimal b = new BigDecimal(10);
|
BigDecimal b = new BigDecimal("10");
|
||||||
//折扣
|
//折扣
|
||||||
List<ActiveDiscountPayVO> activeDiscountVOList = oilOrderMapper.selectActiveDiscount(storeId,paymentActiveDTO.getAmount());
|
List<ActiveDiscountPayVO> activeDiscountVOList = oilOrderMapper.selectActiveDiscount(storeId,paymentActiveDTO.getAmount());
|
||||||
if (CollectionUtils.isNotEmpty(activeDiscountVOList)){
|
if (CollectionUtils.isNotEmpty(activeDiscountVOList)){
|
||||||
|
@ -210,6 +210,7 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
|||||||
if (StringUtils.isNotEmpty(staff.getPassword())){
|
if (StringUtils.isNotEmpty(staff.getPassword())){
|
||||||
TAccount tAccount = accountService.selectAccountByStaffId(staff.getId());
|
TAccount tAccount = accountService.selectAccountByStaffId(staff.getId());
|
||||||
tAccount.setPassword(staff.getPassword());
|
tAccount.setPassword(staff.getPassword());
|
||||||
|
tAccount.setAccountName(staff.getMobile());
|
||||||
accountService.entryptPassword(tAccount);
|
accountService.entryptPassword(tAccount);
|
||||||
try {
|
try {
|
||||||
accountService.editAccount(tAccount,null);
|
accountService.editAccount(tAccount,null);
|
||||||
|
@ -98,5 +98,9 @@ public class CashierOrder extends BaseEntity implements Serializable {
|
|||||||
* 退款备注
|
* 退款备注
|
||||||
*/
|
*/
|
||||||
private String refundRemark;
|
private String refundRemark;
|
||||||
|
/**
|
||||||
|
* 支付方式
|
||||||
|
*/
|
||||||
|
private String payType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ public class OilOrder extends BaseEntity implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 油罐id
|
* 油罐id
|
||||||
*/
|
*/
|
||||||
@TableField(exist = false)
|
// @TableField(exist = false)
|
||||||
private Integer tankId;
|
private Integer tankId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,17 +39,17 @@ public interface HangBillMapper extends BaseMapper<HangBill> {
|
|||||||
* 查询当前店铺所有的订单总额
|
* 查询当前店铺所有的订单总额
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
double selectAllAmount(@Param("storeId") int storeId);
|
Double selectAllAmount(@Param("storeId") int storeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询当前店铺归还的账单总额
|
* 查询当前店铺归还的账单总额
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
double selectReturnAmount(@Param("storeId") int storeId);
|
Double selectReturnAmount(@Param("storeId") int storeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询当前店铺未归还的账单总额
|
* 查询当前店铺未归还的账单总额
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
double selectNoReturnAmount(@Param("storeId") int storeId);
|
Double selectNoReturnAmount(@Param("storeId") int storeId);
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
<if test="allOrderInfo.params.endTime != null and allOrderInfo.params.endTime != ''"><!-- 结束时间检索 -->
|
<if test="allOrderInfo.params.endTime != null and allOrderInfo.params.endTime != ''"><!-- 结束时间检索 -->
|
||||||
and date_format(pay_time,'%y%m%d') <= date_format(#{allOrderInfo.params.endTime},'%y%m%d')
|
and date_format(pay_time,'%y%m%d') <= date_format(#{allOrderInfo.params.endTime},'%y%m%d')
|
||||||
</if>
|
</if>
|
||||||
order by pay_time desc
|
order by aoi.create_time desc
|
||||||
</select>
|
</select>
|
||||||
<select id="sumPayMoney" resultType="java.lang.String">
|
<select id="sumPayMoney" resultType="java.lang.String">
|
||||||
select
|
select
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<if test="order.status != null and order.status != ''">
|
<if test="order.status != null and order.status != ''">
|
||||||
and cvco.status = #{order.status}
|
and cvco.status = #{order.status}
|
||||||
</if>
|
</if>
|
||||||
order by cvco.pay_time desc
|
order by cvco.create_time desc
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
@ -24,7 +24,7 @@
|
|||||||
<if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
|
<if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
|
||||||
and date_format(pay_time,'%y%m%d') <= date_format(#{order.params.endTime},'%y%m%d')
|
and date_format(pay_time,'%y%m%d') <= date_format(#{order.params.endTime},'%y%m%d')
|
||||||
</if>
|
</if>
|
||||||
order by pay_time desc
|
order by create_time desc
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<select id="selectCashierOrderById" resultType="com.fuint.business.order.vo.CashierOrderVo"
|
<select id="selectCashierOrderById" resultType="com.fuint.business.order.vo.CashierOrderVo"
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
<if test="hangBill.params.endTime != null and hangBill.params.endTime != ''"><!-- 结束时间检索 -->
|
<if test="hangBill.params.endTime != null and hangBill.params.endTime != ''"><!-- 结束时间检索 -->
|
||||||
and date_format(hb.create_time,'%y%m%d') <= date_format(#{hangBill.params.endTime},'%y%m%d')
|
and date_format(hb.create_time,'%y%m%d') <= date_format(#{hangBill.params.endTime},'%y%m%d')
|
||||||
</if>
|
</if>
|
||||||
|
order by create_time desc
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<select id="selectHangBillById" resultType="com.fuint.business.order.vo.HangBillVo" parameterType="int">
|
<select id="selectHangBillById" resultType="com.fuint.business.order.vo.HangBillVo" parameterType="int">
|
||||||
@ -52,13 +53,13 @@
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAllAmount" resultType="double">
|
<select id="selectAllAmount" resultType="java.lang.Double">
|
||||||
select sum(amount) from hang_bill where store_id = #{storeId}
|
select sum(amount) from hang_bill where store_id = #{storeId}
|
||||||
</select>
|
</select>
|
||||||
<select id="selectReturnAmount" resultType="double">
|
<select id="selectReturnAmount" resultType="java.lang.Double">
|
||||||
select sum(repaid_amount) from hang_bill where store_id = #{storeId}
|
select sum(repaid_amount) from hang_bill where store_id = #{storeId}
|
||||||
</select>
|
</select>
|
||||||
<select id="selectNoReturnAmount" resultType="double">
|
<select id="selectNoReturnAmount" resultType="java.lang.Double">
|
||||||
select sum(outstand_amount) from hang_bill where store_id = #{storeId}
|
select sum(outstand_amount) from hang_bill where store_id = #{storeId}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
@ -30,7 +30,7 @@
|
|||||||
<if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
|
<if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
|
||||||
and date_format(create_time,'%y%m%d') <= date_format(#{order.params.endTime},'%y%m%d')
|
and date_format(create_time,'%y%m%d') <= date_format(#{order.params.endTime},'%y%m%d')
|
||||||
</if>
|
</if>
|
||||||
order by pay_time desc
|
order by create_time desc
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<select id="getMtOrderList" resultType="com.fuint.business.order.vo.LJOrderVo">
|
<select id="getMtOrderList" resultType="com.fuint.business.order.vo.LJOrderVo">
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
<if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
|
<if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
|
||||||
and date_format(pay_time,'%y%m%d') <= date_format(#{order.params.endTime},'%y%m%d')
|
and date_format(pay_time,'%y%m%d') <= date_format(#{order.params.endTime},'%y%m%d')
|
||||||
</if>
|
</if>
|
||||||
order by pay_time desc
|
order by create_time desc
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<select id="selectOilOrderByOrderNo" resultType="com.fuint.business.order.vo.OilOrderVo"
|
<select id="selectOilOrderByOrderNo" resultType="com.fuint.business.order.vo.OilOrderVo"
|
||||||
@ -75,7 +75,7 @@
|
|||||||
<if test="order.remark != null and order.remark != ''">
|
<if test="order.remark != null and order.remark != ''">
|
||||||
and remark = #{order.remark}
|
and remark = #{order.remark}
|
||||||
</if>
|
</if>
|
||||||
order by pay_time desc
|
order by create_time desc
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<include refid="selectReturnRecord"></include>
|
<include refid="selectReturnRecord"></include>
|
||||||
<where>
|
<where>
|
||||||
rd.hang_bill_id = #{returnRecord.hangBillId}
|
rd.hang_bill_id = #{returnRecord.hangBillId}
|
||||||
order by pay_time desc
|
order by rd.create_time desc
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<!-- <select id="selectHangBillById" resultType="com.fuint.business.order.vo.HangBillVo" parameterType="int">-->
|
<!-- <select id="selectHangBillById" resultType="com.fuint.business.order.vo.HangBillVo" parameterType="int">-->
|
||||||
|
@ -83,7 +83,7 @@ public interface HangBillService extends IService<HangBill> {
|
|||||||
* 查询当前店铺所有的订单总额
|
* 查询当前店铺所有的订单总额
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
double selectAllAmount();
|
Double selectAllAmount();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询当前店铺归还账单的数量
|
* 查询当前店铺归还账单的数量
|
||||||
@ -95,11 +95,11 @@ public interface HangBillService extends IService<HangBill> {
|
|||||||
* 查询当前店铺归还的账单总额
|
* 查询当前店铺归还的账单总额
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
double selectReturnAmount();
|
Double selectReturnAmount();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询当前店铺未归还的账单总额
|
* 查询当前店铺未归还的账单总额
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
double selectNoReturnAmount();
|
Double selectNoReturnAmount();
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,13 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int insertAllOrderInfo(AllOrderInfo allOrderInfo) {
|
public int insertAllOrderInfo(AllOrderInfo allOrderInfo) {
|
||||||
return baseMapper.insert(allOrderInfo);
|
int row = 0;
|
||||||
|
AllOrderInfo allOrderInfo1 = this.selectAllOrderInfoByOrderNo(allOrderInfo.getOrderNo());
|
||||||
|
if (ObjectUtil.isNotEmpty(allOrderInfo1)){
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
row = baseMapper.insert(allOrderInfo);
|
||||||
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.fuint.business.order.service.impl;
|
package com.fuint.business.order.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.excel.EasyExcel;
|
import com.alibaba.excel.EasyExcel;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@ -73,7 +74,13 @@ public class CashierOrderServiceImpl extends ServiceImpl<CashierOrderMapper, Cas
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int insertCashierOrder(CashierOrder order) {
|
public int insertCashierOrder(CashierOrder order) {
|
||||||
int row = baseMapper.insert(order);
|
CashierOrder cashierOrder = this.selectCashierOrder(order.getOrderNo());
|
||||||
|
int row = 0;
|
||||||
|
if (ObjectUtil.isNotEmpty(cashierOrder)){
|
||||||
|
row = 0;
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
row = baseMapper.insert(order);
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double selectAllAmount() {
|
public Double selectAllAmount() {
|
||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
return baseMapper.selectAllAmount(nowAccountInfo.getStoreId());
|
return baseMapper.selectAllAmount(nowAccountInfo.getStoreId());
|
||||||
}
|
}
|
||||||
@ -269,13 +269,13 @@ public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double selectReturnAmount() {
|
public Double selectReturnAmount() {
|
||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
return baseMapper.selectReturnAmount(nowAccountInfo.getStoreId());
|
return baseMapper.selectReturnAmount(nowAccountInfo.getStoreId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double selectNoReturnAmount() {
|
public Double selectNoReturnAmount() {
|
||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
return baseMapper.selectNoReturnAmount(nowAccountInfo.getStoreId());
|
return baseMapper.selectNoReturnAmount(nowAccountInfo.getStoreId());
|
||||||
}
|
}
|
||||||
@ -290,7 +290,7 @@ public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> i
|
|||||||
if (!map.get("repaidAmount").equals("0") && !payType.equals("CASH")){
|
if (!map.get("repaidAmount").equals("0") && !payType.equals("CASH")){
|
||||||
Integer allAmount = (int) (Double.valueOf(map.get("repaidAmount"))*100);
|
Integer allAmount = (int) (Double.valueOf(map.get("repaidAmount"))*100);
|
||||||
// 判断是否开启支付规则
|
// 判断是否开启支付规则
|
||||||
List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen();
|
List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen(storeId);
|
||||||
if (list.size()>0){
|
if (list.size()>0){
|
||||||
oilConfigService.oilRule();
|
oilConfigService.oilRule();
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ import com.fuint.api.fuyou.entity.ReceiveParameter;
|
|||||||
import com.fuint.api.fuyou.service.FyPayService;
|
import com.fuint.api.fuyou.service.FyPayService;
|
||||||
import com.fuint.api.fuyou.service.MerchantConfigService;
|
import com.fuint.api.fuyou.service.MerchantConfigService;
|
||||||
import com.fuint.api.fuyou.service.OilConfigService;
|
import com.fuint.api.fuyou.service.OilConfigService;
|
||||||
|
import com.fuint.business.commission.service.StaffCommissionService;
|
||||||
import com.fuint.business.convenienceSore.entity.LJGoods;
|
import com.fuint.business.convenienceSore.entity.LJGoods;
|
||||||
import com.fuint.business.convenienceSore.service.LJGoodsService;
|
import com.fuint.business.convenienceSore.service.LJGoodsService;
|
||||||
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelRecord;
|
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelRecord;
|
||||||
@ -89,6 +90,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
private OilConfigService oilConfigService;
|
private OilConfigService oilConfigService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private LJGoodsService goodsService;
|
private LJGoodsService goodsService;
|
||||||
|
@Autowired
|
||||||
|
private StaffCommissionService staffCommissionService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<OilOrder> selectOilOrderList(Page page, OilOrder order) {
|
public IPage<OilOrder> selectOilOrderList(Page page, OilOrder order) {
|
||||||
@ -245,8 +248,6 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
payStatus = "unpaid";
|
payStatus = "unpaid";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Map<String,Object> orders = new HashMap<>();
|
Map<String,Object> orders = new HashMap<>();
|
||||||
|
|
||||||
OilOrder oilOrder1 = null;
|
OilOrder oilOrder1 = null;
|
||||||
@ -278,6 +279,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
ljOrder.setStaffId(staffId);
|
ljOrder.setStaffId(staffId);
|
||||||
ljOrder.setStatus(payStatus);
|
ljOrder.setStatus(payStatus);
|
||||||
if (payType.equals("CASH")){
|
if (payType.equals("CASH")){
|
||||||
|
staffCommissionService.countStaffCommission(staffId,storeId,goodsAmount,goodsActualPay,0.0,"商品",orderNo);
|
||||||
ljOrder.setPayTime(new Date());
|
ljOrder.setPayTime(new Date());
|
||||||
}
|
}
|
||||||
// 将商品订单的json数据转换为数组
|
// 将商品订单的json数据转换为数组
|
||||||
@ -309,27 +311,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
ljOrder1 = orderService.selectGoodsOrder(orderNo);
|
ljOrder1 = orderService.selectGoodsOrder(orderNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加收银台订单信息
|
Double oilLiters = 0.0;
|
||||||
CashierOrder cashierOrder = new CashierOrder();
|
|
||||||
cashierOrder.setStaffId(staffId);
|
|
||||||
cashierOrder.setStoreId(storeId);
|
|
||||||
cashierOrder.setPayUser(payUser);
|
|
||||||
cashierOrder.setAmount(oilAmount+goodsAmount);
|
|
||||||
cashierOrder.setStatus(payStatus);
|
|
||||||
if (payType.equals("CASH")){
|
|
||||||
cashierOrder.setPayAmount(Double.valueOf(map.get("authCode")));
|
|
||||||
cashierOrder.setPayTime(new Date());
|
|
||||||
this.insertAllOrderInfo(orderNo,storeId,Double.valueOf(map.get("allAmount")),payType,userId,"PC","6","paid");
|
|
||||||
}else {
|
|
||||||
cashierOrder.setPayAmount(oilActualPay+goodsActualPay);
|
|
||||||
}
|
|
||||||
cashierOrder.setSeekZero(seekZero);
|
|
||||||
cashierOrder.setOrderNo(orderNo);
|
|
||||||
cashierOrder.setGoodsOrderAmount(goodsAmount);
|
|
||||||
cashierOrder.setGoodsDiscountAmount(goodsDiscount);
|
|
||||||
cashierOrder.setOilOrderAmount(oilAmount);
|
|
||||||
cashierOrder.setOilDiscountAmount(oilDiscount);
|
|
||||||
cashierOrder.setTerminal(terminal);
|
|
||||||
|
|
||||||
// 添加油品订单信息
|
// 添加油品订单信息
|
||||||
if (!oilOrder.equals("[]")){
|
if (!oilOrder.equals("[]")){
|
||||||
@ -340,11 +322,15 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
Double amount = Double.valueOf(jsonObjects.get(i).get("amount").toString());
|
Double amount = Double.valueOf(jsonObjects.get(i).get("amount").toString());
|
||||||
Double oilPrice = Double.valueOf(jsonObjects.get(i).get("oilPrice").toString());
|
Double oilPrice = Double.valueOf(jsonObjects.get(i).get("oilPrice").toString());
|
||||||
Double oilNum = amount/oilPrice;
|
Double oilNum = amount/oilPrice;
|
||||||
|
oilLiters += oilNum;
|
||||||
if (i==0){
|
if (i==0){
|
||||||
order.setOrderType("主订单");
|
order.setOrderType("主订单");
|
||||||
order.setOrderAmount(amount);
|
order.setOrderAmount(amount);
|
||||||
order.setPayAmount(oilActualPay);
|
order.setPayAmount(oilActualPay);
|
||||||
order.setOrderNo(orderNo);
|
order.setOrderNo(orderNo);
|
||||||
|
if (payType.equals("CASH")){
|
||||||
|
staffCommissionService.countStaffCommission(staffId,storeId,oilAmount,oilActualPay,oilLiters,"油品",orderNo);
|
||||||
|
}
|
||||||
}else {
|
}else {
|
||||||
order.setOrderType("子订单");
|
order.setOrderType("子订单");
|
||||||
order.setOrderAmount(amount);
|
order.setOrderAmount(amount);
|
||||||
@ -369,6 +355,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
order.setPayType(payType);
|
order.setPayType(payType);
|
||||||
order.setInvoicing("未开票");
|
order.setInvoicing("未开票");
|
||||||
order.setOrderStatus(payStatus);
|
order.setOrderStatus(payStatus);
|
||||||
|
order.setTankId(Integer.valueOf(jsonObjects.get(0).get("tankId").toString()));
|
||||||
if (payType.equals("CASH")){
|
if (payType.equals("CASH")){
|
||||||
order.setPayTime(new Date());
|
order.setPayTime(new Date());
|
||||||
this.addOilTrack(jsonObjects.get(i),storeId);
|
this.addOilTrack(jsonObjects.get(i),storeId);
|
||||||
@ -382,11 +369,34 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加收银台订单信息
|
||||||
|
CashierOrder cashierOrder = new CashierOrder();
|
||||||
|
cashierOrder.setStaffId(staffId);
|
||||||
|
cashierOrder.setStoreId(storeId);
|
||||||
|
cashierOrder.setPayUser(payUser);
|
||||||
|
cashierOrder.setAmount(oilAmount+goodsAmount);
|
||||||
|
cashierOrder.setStatus(payStatus);
|
||||||
|
if (payType.equals("CASH")){
|
||||||
|
cashierOrder.setPayAmount(Double.valueOf(map.get("authCode")));
|
||||||
|
cashierOrder.setPayTime(new Date());
|
||||||
|
this.insertAllOrderInfo(orderNo,storeId,Double.valueOf(map.get("allAmount")),payType,userId,"PC","6","paid");
|
||||||
|
}else {
|
||||||
|
cashierOrder.setPayAmount(oilActualPay+goodsActualPay);
|
||||||
|
}
|
||||||
|
cashierOrder.setSeekZero(seekZero);
|
||||||
|
cashierOrder.setOrderNo(orderNo);
|
||||||
|
cashierOrder.setGoodsOrderAmount(goodsAmount);
|
||||||
|
cashierOrder.setGoodsDiscountAmount(goodsDiscount);
|
||||||
|
cashierOrder.setOilOrderAmount(oilAmount);
|
||||||
|
cashierOrder.setOilDiscountAmount(oilDiscount);
|
||||||
|
cashierOrder.setTerminal(terminal);
|
||||||
|
cashierOrder.setPayType(payType);
|
||||||
|
|
||||||
// 如果金额不等于0调用第三方支付接口
|
// 如果金额不等于0调用第三方支付接口
|
||||||
if (!map.get("allAmount").equals("0") && !map.get("payType").equals("CASH")){
|
if (!map.get("allAmount").equals("0") && !map.get("payType").equals("CASH")){
|
||||||
Integer allAmount = (int) (Double.valueOf(map.get("allAmount"))*100);
|
Integer allAmount = (int) (Double.valueOf(map.get("allAmount"))*100);
|
||||||
// 判断是否开启支付规则
|
// 判断是否开启支付规则
|
||||||
List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen();
|
List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen(storeId);
|
||||||
if (list.size()>0){
|
if (list.size()>0){
|
||||||
oilConfigService.oilRule();
|
oilConfigService.oilRule();
|
||||||
}
|
}
|
||||||
@ -503,6 +513,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
// 添加收银台订单信息
|
// 添加收银台订单信息
|
||||||
CashierOrder cashierOrder = new CashierOrder();
|
CashierOrder cashierOrder = new CashierOrder();
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
|
Double oilLiters = 0.0;
|
||||||
for (int i = 0;i < oilOrders.size();i++) {
|
for (int i = 0;i < oilOrders.size();i++) {
|
||||||
if (oilOrders.get(i).get("oilName").equals(oilName.getId().toString())){
|
if (oilOrders.get(i).get("oilName").equals(oilName.getId().toString())){
|
||||||
Double amount = Double.valueOf(oilOrders.get(i).get("amount").toString());
|
Double amount = Double.valueOf(oilOrders.get(i).get("amount").toString());
|
||||||
@ -511,6 +522,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
flag = true;
|
flag = true;
|
||||||
status = "paid";
|
status = "paid";
|
||||||
Double oilNum = amount / oilPrice;
|
Double oilNum = amount / oilPrice;
|
||||||
|
oilLiters += oilNum;
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
order.setOrderType("主订单");
|
order.setOrderType("主订单");
|
||||||
order.setOrderAmount(amount);
|
order.setOrderAmount(amount);
|
||||||
@ -547,6 +559,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
flag = true;
|
flag = true;
|
||||||
status = "paid";
|
status = "paid";
|
||||||
Double oilNum = amount / oilPrice;
|
Double oilNum = amount / oilPrice;
|
||||||
|
oilLiters += oilNum;
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
order.setOrderType("主订单");
|
order.setOrderType("主订单");
|
||||||
order.setOrderAmount(amount);
|
order.setOrderAmount(amount);
|
||||||
@ -583,6 +596,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
flag = true;
|
flag = true;
|
||||||
status = "paid";
|
status = "paid";
|
||||||
Double oilNum = amount / oilPrice;
|
Double oilNum = amount / oilPrice;
|
||||||
|
oilLiters += oilNum;
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
order.setOrderType("主订单");
|
order.setOrderType("主订单");
|
||||||
order.setOrderAmount(amount);
|
order.setOrderAmount(amount);
|
||||||
@ -615,7 +629,6 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
oilOrder = this.selectOilOrderByOrderNo(orderNo);
|
oilOrder = this.selectOilOrderByOrderNo(orderNo);
|
||||||
this.updateGrowthValue1(oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo);
|
this.updateGrowthValue1(oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo);
|
||||||
// this.insertCardBalance((Double.valueOf(oilOrders.get(i).get("liters").toString())-refuelMoneyLiters)*oilPrice,userId,storeId);
|
// this.insertCardBalance((Double.valueOf(oilOrders.get(i).get("liters").toString())-refuelMoneyLiters)*oilPrice,userId,storeId);
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
res.put("error","囤油卡或储值卡余额不足!");
|
res.put("error","囤油卡或储值卡余额不足!");
|
||||||
}
|
}
|
||||||
@ -637,8 +650,10 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
cashierOrder.setTerminal(map.get("terminal"));
|
cashierOrder.setTerminal(map.get("terminal"));
|
||||||
cashierOrder.setOilOrderId(oilOrder.getId());
|
cashierOrder.setOilOrderId(oilOrder.getId());
|
||||||
cashierOrder.setSeekZero(0.0);
|
cashierOrder.setSeekZero(0.0);
|
||||||
|
cashierOrder.setPayType(map.get("payType"));
|
||||||
cashierOrderService.insertCashierOrder(cashierOrder);
|
cashierOrderService.insertCashierOrder(cashierOrder);
|
||||||
this.insertAllOrderInfo(orderNo, storeId, oilAmount, map.get("payType"), userId, "PC", "1", status);
|
this.insertAllOrderInfo(orderNo, storeId, oilAmount, map.get("payType"), userId, "PC", "1", status);
|
||||||
|
staffCommissionService.countStaffCommission(Integer.valueOf(map.get("staffId")),storeId,oilAmount,oilAmount,oilLiters,"油品",orderNo);
|
||||||
res.put("success","success");
|
res.put("success","success");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -647,10 +662,12 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
if (cardBalance>=oilAmount){
|
if (cardBalance>=oilAmount){
|
||||||
// 添加油品订单信息
|
// 添加油品订单信息
|
||||||
OilOrder order = new OilOrder();
|
OilOrder order = new OilOrder();
|
||||||
|
Double oilLiters = 0.0;
|
||||||
for (int i = 0;i < oilOrders.size();i++) {
|
for (int i = 0;i < oilOrders.size();i++) {
|
||||||
Double amount = Double.valueOf(oilOrders.get(i).get("amount").toString());
|
Double amount = Double.valueOf(oilOrders.get(i).get("amount").toString());
|
||||||
Double oilPrice = Double.valueOf(oilOrders.get(i).get("oilPrice").toString());
|
Double oilPrice = Double.valueOf(oilOrders.get(i).get("oilPrice").toString());
|
||||||
Double oilNum = amount / oilPrice;
|
Double oilNum = amount / oilPrice;
|
||||||
|
oilLiters += oilNum;
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
order.setOrderType("主订单");
|
order.setOrderType("主订单");
|
||||||
order.setOrderAmount(amount);
|
order.setOrderAmount(amount);
|
||||||
@ -697,10 +714,11 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
cashierOrder.setTerminal(map.get("terminal"));
|
cashierOrder.setTerminal(map.get("terminal"));
|
||||||
cashierOrder.setOilOrderId(oilOrder.getId());
|
cashierOrder.setOilOrderId(oilOrder.getId());
|
||||||
cashierOrder.setSeekZero(0.0);
|
cashierOrder.setSeekZero(0.0);
|
||||||
|
cashierOrder.setPayType(map.get("payType"));
|
||||||
cashierOrderService.insertCashierOrder(cashierOrder);
|
cashierOrderService.insertCashierOrder(cashierOrder);
|
||||||
this.updateGrowthValue1(oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo);
|
this.updateGrowthValue1(oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo);
|
||||||
this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,map.get("payType"),userId,"PC","1","paid");
|
this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,map.get("payType"),userId,"PC","1","paid");
|
||||||
|
staffCommissionService.countStaffCommission(Integer.valueOf(map.get("staffId")),storeId,oilAmount,oilAmount,oilLiters,"油品",orderNo);
|
||||||
// this.insertCardBalance(oilAmount,userId,storeId);
|
// this.insertCardBalance(oilAmount,userId,storeId);
|
||||||
res.put("success","success");
|
res.put("success","success");
|
||||||
}else {
|
}else {
|
||||||
@ -866,6 +884,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
cashierOrder.setOilDiscountAmount(oilOrder.getDiscountAmount());
|
cashierOrder.setOilDiscountAmount(oilOrder.getDiscountAmount());
|
||||||
cashierOrder.setTerminal(oilOrder.getTerminal());
|
cashierOrder.setTerminal(oilOrder.getTerminal());
|
||||||
cashierOrder.setSeekZero(0.0);
|
cashierOrder.setSeekZero(0.0);
|
||||||
|
cashierOrder.setPayType(oilOrder.getPayType());
|
||||||
cashierOrderService.insertCashierOrder(cashierOrder);
|
cashierOrderService.insertCashierOrder(cashierOrder);
|
||||||
return orderNo;
|
return orderNo;
|
||||||
}
|
}
|
||||||
@ -992,6 +1011,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
this.updateGrowthValue(payAmount,userId, Integer.valueOf(oilOrder.getOils()),oilCardAmount,oilOrder.getStoreId(),orderNo);
|
this.updateGrowthValue(payAmount,userId, Integer.valueOf(oilOrder.getOils()),oilCardAmount,oilOrder.getStoreId(),orderNo);
|
||||||
this.addOilTracks(oilOrder,oilOrder.getStoreId());
|
this.addOilTracks(oilOrder,oilOrder.getStoreId());
|
||||||
this.insertCardOrder(oilOrder.getUserId(),oilOrder.getStoreId(),orderNo,oilOrder.getOrderAmount(),"paid", Double.valueOf(balanceAmount),payAmount);
|
this.insertCardOrder(oilOrder.getUserId(),oilOrder.getStoreId(),orderNo,oilOrder.getOrderAmount(),"paid", Double.valueOf(balanceAmount),payAmount);
|
||||||
|
staffCommissionService.countStaffCommission(oilOrder.getStaffId(),oilOrder.getStoreId(),oilOrder.getOrderAmount(),oilOrder.getOrderAmount(),oilOrder.getOilNum(),"油品",orderNo);
|
||||||
oilOrder.setPayAmount(payAmount);
|
oilOrder.setPayAmount(payAmount);
|
||||||
oilOrder.setDiscountAmount(Double.valueOf(discountAmount));
|
oilOrder.setDiscountAmount(Double.valueOf(discountAmount));
|
||||||
oilOrder.setPayTime(new Date());
|
oilOrder.setPayTime(new Date());
|
||||||
@ -1062,8 +1082,10 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
}
|
}
|
||||||
this.updateGrowthValue(oilOrder.getPayAmount(),userId, Integer.valueOf(oilOrder.getOils()),null,oilOrder.getStoreId(),orderNo);
|
this.updateGrowthValue(oilOrder.getPayAmount(),userId, Integer.valueOf(oilOrder.getOils()),null,oilOrder.getStoreId(),orderNo);
|
||||||
this.addOilTracks(oilOrder,oilOrder.getStoreId());
|
this.addOilTracks(oilOrder,oilOrder.getStoreId());
|
||||||
|
staffCommissionService.countStaffCommission(oilOrder.getStaffId(),oilOrder.getStoreId(),oilOrder.getOrderAmount(),oilOrder.getPayAmount(),oilOrder.getOilNum(),"油品",orderNo);
|
||||||
CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo);
|
CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo);
|
||||||
if (ObjectUtil.isNotEmpty(cashierOrder)){
|
if (ObjectUtil.isNotEmpty(cashierOrder)){
|
||||||
|
cashierOrder.setOilOrderId(oilOrder.getId());
|
||||||
cashierOrder.setPayTime(new Date());
|
cashierOrder.setPayTime(new Date());
|
||||||
cashierOrder.setStatus("paid");
|
cashierOrder.setStatus("paid");
|
||||||
cashierOrder.setOilDiscountAmount(oilOrder.getDiscountAmount());
|
cashierOrder.setOilDiscountAmount(oilOrder.getDiscountAmount());
|
||||||
@ -1173,7 +1195,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
int growth = balance.getGrowthValue();
|
int growth = balance.getGrowthValue();
|
||||||
if (refuelMoney==null){
|
if (refuelMoney==null){
|
||||||
String refuelMoney1 = balance.getRefuelMoney();
|
String refuelMoney1 = balance.getRefuelMoney();
|
||||||
if (StringUtils.isNotEmpty(refuelMoney1)){
|
if (StringUtils.isNotEmpty(refuelMoney1) && !"null".equals(refuelMoney1)){
|
||||||
JSONArray objects = JSONArray.parseArray(refuelMoney);
|
JSONArray objects = JSONArray.parseArray(refuelMoney);
|
||||||
JSONArray objects1 = JSONArray.parseArray(refuelMoney1);
|
JSONArray objects1 = JSONArray.parseArray(refuelMoney1);
|
||||||
List<RefuelMoney> list = new ArrayList<>();
|
List<RefuelMoney> list = new ArrayList<>();
|
||||||
|
@ -97,8 +97,8 @@ public class LJUserController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/statistic")
|
@GetMapping("/statistic")
|
||||||
public ResponseObject getStatistic(){
|
public ResponseObject getStatistic(LJUserVo user){
|
||||||
Map<String, Object> map = userService.selectStatistic();
|
Map<String, Object> map = userService.selectStatistic(user);
|
||||||
return getSuccessResult(map);
|
return getSuccessResult(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,10 @@
|
|||||||
</select>
|
</select>
|
||||||
<!-- 查询会员统计信息-->
|
<!-- 查询会员统计信息-->
|
||||||
<select id="selectSumByStore" resultType="java.lang.Double" parameterType="int">
|
<select id="selectSumByStore" resultType="java.lang.Double" parameterType="int">
|
||||||
select sum(${sumValue}) from mt_user_balance where chain_store_id = #{chainStoreId}
|
select sum(${sumValue}) from mt_user_balance
|
||||||
|
<where>
|
||||||
|
chain_store_id = #{chainStoreId}
|
||||||
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<!-- 根据手机号查询会员信息-->
|
<!-- 根据手机号查询会员信息-->
|
||||||
<select id="selectUserByMobile" resultType="com.fuint.business.userManager.vo.LJUserVo"
|
<select id="selectUserByMobile" resultType="com.fuint.business.userManager.vo.LJUserVo"
|
||||||
|
@ -44,7 +44,7 @@ public interface LJUserService extends IService<LJUser> {
|
|||||||
* 查询会员统计信息
|
* 查询会员统计信息
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Map<String ,Object> selectStatistic();
|
public Map<String ,Object> selectStatistic(LJUserVo user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询会员信息
|
* 根据id查询会员信息
|
||||||
|
@ -129,7 +129,7 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
|
|||||||
res.put("userGrade",baseMapper.selectById(Integer.valueOf(gradeId)));
|
res.put("userGrade",baseMapper.selectById(Integer.valueOf(gradeId)));
|
||||||
return res;
|
return res;
|
||||||
}else {
|
}else {
|
||||||
return null;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> selectStatistic() {
|
public Map<String, Object> selectStatistic(LJUserVo user) {
|
||||||
Map<String ,Object> map = new HashMap<>();
|
Map<String ,Object> map = new HashMap<>();
|
||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
Integer storeId = nowAccountInfo.getStoreId();
|
Integer storeId = nowAccountInfo.getStoreId();
|
||||||
|
@ -62,33 +62,37 @@ export function editHangBill(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 当前店铺归还账单的数量
|
// 当前店铺归还账单的数量
|
||||||
export function hangBillReturnTotal() {
|
export function hangBillReturnTotal(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/business/hangBill/returnTotal',
|
url: '/business/hangBill/returnTotal',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 当前店铺归还账单的数量
|
// 当前店铺归还账单的数量
|
||||||
export function hangBillAllAmount() {
|
export function hangBillAllAmount(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/business/hangBill/allAmount',
|
url: '/business/hangBill/allAmount',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 当前店铺归还账单的数量
|
// 当前店铺归还账单的数量
|
||||||
export function hangBillAllReturnAmount() {
|
export function hangBillAllReturnAmount(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/business/hangBill/allReturnAmount',
|
url: '/business/hangBill/allReturnAmount',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 当前店铺归还账单的数量
|
// 当前店铺归还账单的数量
|
||||||
export function hangBillAllNoReturnAmount() {
|
export function hangBillAllNoReturnAmount(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/business/hangBill/allNoReturnAmount',
|
url: '/business/hangBill/allNoReturnAmount',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -554,6 +554,21 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 立即结算-->
|
||||||
|
<el-dialog
|
||||||
|
title="扫码支付"
|
||||||
|
:visible.sync="dialogVisiblejLoading"
|
||||||
|
width="30%"
|
||||||
|
:close-on-click-modal="false">
|
||||||
|
<div>
|
||||||
|
<el-result icon="info" title="支付状态未查询成功,请移至订单查看">
|
||||||
|
<template slot="extra">
|
||||||
|
<el-button type="primary" @click="handClose">关 闭</el-button>
|
||||||
|
</template>
|
||||||
|
</el-result>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 批量挂账归还-->
|
<!-- 批量挂账归还-->
|
||||||
<el-dialog title="批量挂账归还" :visible.sync="open3" append-to-body>
|
<el-dialog title="批量挂账归还" :visible.sync="open3" append-to-body>
|
||||||
<el-form ref="form3" :model="form3">
|
<el-form ref="form3" :model="form3">
|
||||||
@ -757,6 +772,7 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
|
|||||||
open3:false,
|
open3:false,
|
||||||
open4:false,
|
open4:false,
|
||||||
dialogVisiblej:false,
|
dialogVisiblej:false,
|
||||||
|
dialogVisiblejLoading: false,
|
||||||
// 是否查询支付成功信息
|
// 是否查询支付成功信息
|
||||||
isQuery:true,
|
isQuery:true,
|
||||||
// 是否是批量归还
|
// 是否是批量归还
|
||||||
@ -784,7 +800,7 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
|
|||||||
this.getUnitList();
|
this.getUnitList();
|
||||||
this.getPayList();
|
this.getPayList();
|
||||||
this.getLists();
|
this.getLists();
|
||||||
this.getStatistic();
|
// this.getStatistic();
|
||||||
},
|
},
|
||||||
directives: {
|
directives: {
|
||||||
// 注册一个局部的自定义指令 v-focus
|
// 注册一个局部的自定义指令 v-focus
|
||||||
@ -802,17 +818,23 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
|
|||||||
methods:{
|
methods:{
|
||||||
// 获取挂账统计信息
|
// 获取挂账统计信息
|
||||||
getStatistic(){
|
getStatistic(){
|
||||||
hangBillReturnTotal().then(res => {
|
hangBillReturnTotal(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
|
||||||
this.returnTotal = res.data
|
this.returnTotal = res.data
|
||||||
})
|
})
|
||||||
hangBillAllAmount().then(res => {
|
hangBillAllAmount(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
|
||||||
this.allAmount = res.data
|
if (res.data) {
|
||||||
|
this.allAmount = res.data
|
||||||
|
}
|
||||||
})
|
})
|
||||||
hangBillAllReturnAmount().then(res => {
|
hangBillAllReturnAmount(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
|
||||||
this.returnAllAmount = res.data
|
if (res.data) {
|
||||||
|
this.returnAllAmount = res.data
|
||||||
|
}
|
||||||
})
|
})
|
||||||
hangBillAllNoReturnAmount().then(res => {
|
hangBillAllNoReturnAmount(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
|
||||||
this.noReturnAllAmount = res.data
|
if (res.data) {
|
||||||
|
this.noReturnAllAmount = res.data
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getPayMeth(list,val){
|
getPayMeth(list,val){
|
||||||
@ -935,6 +957,7 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
|
|||||||
this.repaidAmount = repaidAmount
|
this.repaidAmount = repaidAmount
|
||||||
},
|
},
|
||||||
handClose(){
|
handClose(){
|
||||||
|
this.dialogVisiblejLoading = false
|
||||||
this.isPay = true;
|
this.isPay = true;
|
||||||
this.isPaySuccess = false;
|
this.isPaySuccess = false;
|
||||||
this.dialogVisiblej = false;
|
this.dialogVisiblej = false;
|
||||||
@ -996,15 +1019,18 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
|
|||||||
response.data.forEach(item => {
|
response.data.forEach(item => {
|
||||||
if (item.payStatus == "unpaid"){
|
if (item.payStatus == "unpaid"){
|
||||||
_this.isQuery = true;
|
_this.isQuery = true;
|
||||||
|
_this.dialogVisiblejLoading = true
|
||||||
}
|
}
|
||||||
if (item.payStatus == "paid"){
|
if (item.payStatus == "paid"){
|
||||||
_this.isPaySuccess = true;
|
_this.isPaySuccess = true;
|
||||||
|
_this.isPay = false;
|
||||||
_this.isQuery = false;
|
_this.isQuery = false;
|
||||||
_this.loading = false;
|
_this.loading = false;
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
}
|
}
|
||||||
if (item.payStatus == "payFail"){
|
if (item.payStatus == "payFail"){
|
||||||
_this.isPaySuccess = false;
|
_this.isPaySuccess = false;
|
||||||
|
_this.isPay = false;
|
||||||
_this.isQuery = false;
|
_this.isQuery = false;
|
||||||
_this.loading = false;
|
_this.loading = false;
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
@ -1015,15 +1041,15 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
|
|||||||
let timer2 = setInterval(function () {
|
let timer2 = setInterval(function () {
|
||||||
if (_this.isBatch) {
|
if (_this.isBatch) {
|
||||||
if (_this.isQuery || !_this.open3 || !_this.open4){
|
if (_this.isQuery || !_this.open3 || !_this.open4){
|
||||||
_this.loading = false;
|
// _this.loading = false;
|
||||||
_this.isPay = false;
|
// _this.isPay = false;
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
clearTimeout(timer3);
|
clearTimeout(timer3);
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
if (_this.isQuery || !_this.open2) {
|
if (_this.isQuery || !_this.open2) {
|
||||||
_this.loading = false;
|
// _this.loading = false;
|
||||||
_this.isPay = false;
|
// _this.isPay = false;
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
clearTimeout(timer3);
|
clearTimeout(timer3);
|
||||||
}
|
}
|
||||||
@ -1174,6 +1200,7 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
|
|||||||
this.hangBillList = response.data.records
|
this.hangBillList = response.data.records
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
})
|
})
|
||||||
|
this.getStatistic();
|
||||||
},
|
},
|
||||||
// 搜索按钮操作
|
// 搜索按钮操作
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
|
@ -508,7 +508,22 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 会员登录-->
|
<!-- 立即结算-->
|
||||||
|
<el-dialog
|
||||||
|
title="扫码支付"
|
||||||
|
:visible.sync="dialogVisiblejLoading"
|
||||||
|
width="30%"
|
||||||
|
:close-on-click-modal="false">
|
||||||
|
<div>
|
||||||
|
<el-result icon="info" title="支付状态未查询成功,请移至订单查看">
|
||||||
|
<template slot="extra">
|
||||||
|
<el-button type="primary" @click="handClose">关 闭</el-button>
|
||||||
|
</template>
|
||||||
|
</el-result>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 会员登录-->
|
||||||
<el-dialog
|
<el-dialog
|
||||||
title="会员信息"
|
title="会员信息"
|
||||||
:visible.sync="dialogVisiblevip"
|
:visible.sync="dialogVisiblevip"
|
||||||
@ -883,8 +898,11 @@
|
|||||||
oilGunList:[],
|
oilGunList:[],
|
||||||
// 支付方式列表
|
// 支付方式列表
|
||||||
payList:[],
|
payList:[],
|
||||||
|
// 倒计时
|
||||||
|
timestamp: 15,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
dialogVisiblej: false,
|
dialogVisiblej: false,
|
||||||
|
dialogVisiblejLoading: false,
|
||||||
dialogVisiblevip:false,
|
dialogVisiblevip:false,
|
||||||
dialogVisibleamount:false,
|
dialogVisibleamount:false,
|
||||||
dialogVisibleMember:false,
|
dialogVisibleMember:false,
|
||||||
@ -2299,6 +2317,7 @@
|
|||||||
},
|
},
|
||||||
// 重置油品订单
|
// 重置油品订单
|
||||||
resetting(){
|
resetting(){
|
||||||
|
this.seekZero = 0;
|
||||||
this.oilOrder = [];
|
this.oilOrder = [];
|
||||||
this.oilActualPay = 0;
|
this.oilActualPay = 0;
|
||||||
this.oilTotal = 0;
|
this.oilTotal = 0;
|
||||||
@ -2339,7 +2358,6 @@
|
|||||||
|
|
||||||
// 校验油罐内油是否足够
|
// 校验油罐内油是否足够
|
||||||
getOilTank(this.form.tankId).then(res => {
|
getOilTank(this.form.tankId).then(res => {
|
||||||
console.log(res)
|
|
||||||
if (res.data.storedQuantity-this.form.liters<0){
|
if (res.data.storedQuantity-this.form.liters<0){
|
||||||
this.$modal.msgError("所加油的升数大于油罐内的升数,请重新选择加油升数")
|
this.$modal.msgError("所加油的升数大于油罐内的升数,请重新选择加油升数")
|
||||||
return;
|
return;
|
||||||
@ -2546,7 +2564,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!this.authCode){
|
if (!this.authCode && ((+this.oilActualPay) + (+this.goodsActualPay))>0){
|
||||||
this.$modal.msgError("请先扫码");
|
this.$modal.msgError("请先扫码");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2654,6 +2672,7 @@
|
|||||||
_this.oilOrder = []
|
_this.oilOrder = []
|
||||||
_this.goodsOrder = []
|
_this.goodsOrder = []
|
||||||
_this.amount = 0
|
_this.amount = 0
|
||||||
|
_this.seekZero = 0;
|
||||||
};
|
};
|
||||||
this.userNo = ""
|
this.userNo = ""
|
||||||
this.map = {
|
this.map = {
|
||||||
@ -2724,6 +2743,7 @@
|
|||||||
if (response.data!=null){
|
if (response.data!=null){
|
||||||
if (response.data.status == "unpaid"){
|
if (response.data.status == "unpaid"){
|
||||||
_this.isQuery = true;
|
_this.isQuery = true;
|
||||||
|
_this.dialogVisiblejLoading = true
|
||||||
}
|
}
|
||||||
if (response.data.status == "paid"){
|
if (response.data.status == "paid"){
|
||||||
_this.isPay = true;
|
_this.isPay = true;
|
||||||
@ -2749,7 +2769,8 @@
|
|||||||
let timer2 = setInterval(function () {
|
let timer2 = setInterval(function () {
|
||||||
if (_this.isQuery || !_this.dialogVisiblej) {
|
if (_this.isQuery || !_this.dialogVisiblej) {
|
||||||
_this.loading = false;
|
_this.loading = false;
|
||||||
_this.isPay = true;
|
// _this.isPay = true;
|
||||||
|
// _this.countdown()
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
clearTimeout(timer3);
|
clearTimeout(timer3);
|
||||||
|
|
||||||
@ -2764,7 +2785,22 @@
|
|||||||
this.isPaySuccess = false;
|
this.isPaySuccess = false;
|
||||||
}, 10000)
|
}, 10000)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 倒计时刷新
|
||||||
|
countdown(){
|
||||||
|
let _this = this
|
||||||
|
let timer = setInterval(() => {
|
||||||
|
// countdown减1
|
||||||
|
_this.timestamp--;
|
||||||
|
// 如果倒计时为0,清除定时器
|
||||||
|
if(_this.timestamp === 0) {
|
||||||
|
clearInterval(timer)
|
||||||
|
_this.timestamp = 15
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
},
|
||||||
handClose(){
|
handClose(){
|
||||||
|
this.dialogVisiblejLoading = false
|
||||||
// this.resetting1()
|
// this.resetting1()
|
||||||
this.authCode = "";
|
this.authCode = "";
|
||||||
this.userNo = ""
|
this.userNo = ""
|
||||||
|
@ -144,7 +144,11 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="terminal" label="终端" align="center" width="80"></el-table-column>
|
<el-table-column prop="terminal" label="终端" align="center" width="80">
|
||||||
|
<template slot-scope="props">
|
||||||
|
<span>{{ getVal(terminalList,props.row.terminal) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="oils" label="油品/油枪" align="center">
|
<el-table-column prop="oils" label="油品/油枪" align="center">
|
||||||
<template slot-scope="props">
|
<template slot-scope="props">
|
||||||
<span>{{ getName(oilNameList,props.row.oils) }}/{{ getName1(oilGunList,props.row.oilGunNum) }}</span>
|
<span>{{ getName(oilNameList,props.row.oils) }}/{{ getName1(oilGunList,props.row.oilGunNum) }}</span>
|
||||||
@ -252,6 +256,8 @@
|
|||||||
cash:'0',
|
cash:'0',
|
||||||
},
|
},
|
||||||
oilGunList:[],
|
oilGunList:[],
|
||||||
|
// 终端列表
|
||||||
|
terminalList:[],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -262,12 +268,20 @@
|
|||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
exportExcelOilOrder() {
|
exportExcelOilOrder() {
|
||||||
|
exportExcelOilOrderApi(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
|
||||||
exportExcelOilOrderApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{
|
const blob = new Blob([res], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});
|
||||||
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
this.$download.saveAs(blob, '未支付订单统计.xLsx')
|
||||||
this.$download.saveAs(blob,'未支付订单统计.xLsx')
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
getVal(list,val){
|
||||||
|
let name = "";
|
||||||
|
list.forEach(item => {
|
||||||
|
if (item.dictValue == val){
|
||||||
|
name = item.dictLabel
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return name;
|
||||||
|
},
|
||||||
// 获取油枪信息
|
// 获取油枪信息
|
||||||
getOilGunList(){
|
getOilGunList(){
|
||||||
getOilNumberGun().then(res => {
|
getOilNumberGun().then(res => {
|
||||||
@ -363,6 +377,9 @@
|
|||||||
queryStaffs().then( response => {
|
queryStaffs().then( response => {
|
||||||
this.staffList = response.data;
|
this.staffList = response.data;
|
||||||
})
|
})
|
||||||
|
getDicts("terminal").then( response => {
|
||||||
|
this.terminalList = response.data;
|
||||||
|
})
|
||||||
},
|
},
|
||||||
// 获取列表信息
|
// 获取列表信息
|
||||||
getList(val){
|
getList(val){
|
||||||
|
@ -335,6 +335,7 @@
|
|||||||
this.oilOrder.storeId = this.storeId
|
this.oilOrder.storeId = this.storeId
|
||||||
this.oilOrder.staffId = id
|
this.oilOrder.staffId = id
|
||||||
this.oilOrder.oilNum = Math.ceil((this.value/this.oilPrice)*100)/100
|
this.oilOrder.oilNum = Math.ceil((this.value/this.oilPrice)*100)/100
|
||||||
|
this.oilOrder.tankId = uni.getStorageSync("tankId")
|
||||||
let _this = this;
|
let _this = this;
|
||||||
// 添加油品订单信息
|
// 添加油品订单信息
|
||||||
request({
|
request({
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
<view style="background-color: white;width: 94%;margin: 15px auto;">
|
<view style="background-color: white;width: 94%;margin: 15px auto;">
|
||||||
|
|
||||||
<view class="desc" v-if="isStoreValueCard">
|
<view class="desc">
|
||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
储值卡
|
储值卡
|
||||||
<span style="display: flex;">(<span v-if="isUseChildCard">主卡</span>余额:¥{{user.cardBalance}})</span>
|
<span style="display: flex;">(<span v-if="isUseChildCard">主卡</span>余额:¥{{user.cardBalance}})</span>
|
||||||
@ -74,7 +74,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="desc" v-if="isFullPreferential">
|
<view class="desc">
|
||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
活动优惠
|
活动优惠
|
||||||
<!-- <span style="display: flex;">(满减活动)</span> -->
|
<!-- <span style="display: flex;">(满减活动)</span> -->
|
||||||
@ -82,16 +82,16 @@
|
|||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
<span style="margin-right: 10px;display: flex;">
|
<span style="margin-right: 10px;display: flex;">
|
||||||
-¥{{fullRedece}}
|
-¥{{fullRedece}}
|
||||||
<span style="margin-left: 8px;margin-top: 8px;">
|
<!-- <span style="margin-left: 8px;margin-top: 8px;">
|
||||||
<u-checkbox-group>
|
<u-checkbox-group>
|
||||||
<u-checkbox v-model="checkFull" :checked="checkFull" @change="changeFull"></u-checkbox>
|
<u-checkbox v-model="checkFull" :checked="checkFull" @change="changeFull"></u-checkbox>
|
||||||
</u-checkbox-group>
|
</u-checkbox-group>
|
||||||
</span>
|
</span> -->
|
||||||
</span>
|
</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="desc" v-if="cardsList.length>0">
|
<view class="desc" >
|
||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
优惠券优惠
|
优惠券优惠
|
||||||
<span style="display: flex;">(优惠券)</span>
|
<span style="display: flex;">(优惠券)</span>
|
||||||
@ -99,16 +99,16 @@
|
|||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
<span style="margin-right: 10px;display: flex;">
|
<span style="margin-right: 10px;display: flex;">
|
||||||
-¥{{couponRedece}}
|
-¥{{couponRedece}}
|
||||||
<span style="margin-left: 8px;margin-top: 8px;">
|
<!-- <span style="margin-left: 8px;margin-top: 8px;">
|
||||||
<u-checkbox-group>
|
<u-checkbox-group>
|
||||||
<u-checkbox v-model="checkCoupon" :checked="checkCoupon" @change="changeCoupon"></u-checkbox>
|
<u-checkbox v-model="checkCoupon" :checked="checkCoupon" @change="changeCoupon"></u-checkbox>
|
||||||
</u-checkbox-group>
|
</u-checkbox-group>
|
||||||
</span>
|
</span> -->
|
||||||
</span>
|
</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="desc" v-if="isGradePreferential">
|
<view class="desc">
|
||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
会员等级优惠
|
会员等级优惠
|
||||||
<!-- <span style="display: flex;">({{userGrade.name}})</span> -->
|
<!-- <span style="display: flex;">({{userGrade.name}})</span> -->
|
||||||
@ -116,16 +116,17 @@
|
|||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
<span style="margin-right: 10px;display: flex;">
|
<span style="margin-right: 10px;display: flex;">
|
||||||
-¥{{gradeRedece}}
|
-¥{{gradeRedece}}
|
||||||
<span style="margin-left: 8px;margin-top: 8px;">
|
<!-- <span style="margin-left: 8px;margin-top: 8px;">
|
||||||
<u-checkbox-group>
|
<u-checkbox-group>
|
||||||
<u-checkbox v-model="checkGrade" @change="changeGrade"></u-checkbox>
|
<u-checkbox v-model="checkGrade" @change="changeGrade"></u-checkbox>
|
||||||
</u-checkbox-group>
|
</u-checkbox-group>
|
||||||
</span>
|
</span> -->
|
||||||
</span>
|
</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="desc" v-if="!isFullPreferential && !isGradePreferential && !isOilStorageCard && !isStoreValueCard">无优惠</view>
|
<view class="desc" v-if="!isFullPreferential && !isGradePreferential && !isOilStorageCard && !isStoreValueCard">无优惠</view>
|
||||||
|
|
||||||
|
<view style="margin: 10px 20px 0;color: red;font-size: 12px;">已为您计算出最大优惠</view>
|
||||||
<view style="margin: 10px 20px 0;color: red;font-size: 12px;">注:囤油卡不参与任何优惠活动</view>
|
<view style="margin: 10px 20px 0;color: red;font-size: 12px;">注:囤油卡不参与任何优惠活动</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -254,7 +255,7 @@
|
|||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.orderNo = e.orderNo
|
this.orderNo = e.orderNo
|
||||||
// this.orderNo = "2345202401161204280406d3"
|
// this.orderNo = "234520240117095256fbd86e"
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getOilOrder();
|
this.getOilOrder();
|
||||||
@ -827,7 +828,7 @@
|
|||||||
}
|
}
|
||||||
_this.user = res.data.userVo;
|
_this.user = res.data.userVo;
|
||||||
_this.user = res.data.userVo;
|
_this.user = res.data.userVo;
|
||||||
if (res.data.userVo.refuelMoney){
|
if (res.data.userVo.refuelMoney && res.data.userVo.refuelMoney!='null'){
|
||||||
_this.refuelMoney = JSON.parse(res.data.userVo.refuelMoney)
|
_this.refuelMoney = JSON.parse(res.data.userVo.refuelMoney)
|
||||||
_this.refuelMoneyAfter = JSON.parse(res.data.userVo.refuelMoney)
|
_this.refuelMoneyAfter = JSON.parse(res.data.userVo.refuelMoney)
|
||||||
_this.chooseRefuelMoney()
|
_this.chooseRefuelMoney()
|
||||||
@ -852,7 +853,7 @@
|
|||||||
_this.getStaffList(res.data.staffId)
|
_this.getStaffList(res.data.staffId)
|
||||||
_this.getStore(res.data.storeId)
|
_this.getStore(res.data.storeId)
|
||||||
_this.getOilNumber(res.data.storeId)
|
_this.getOilNumber(res.data.storeId)
|
||||||
_this.chooseCoupons()
|
// _this.chooseCoupons()
|
||||||
_this.getUser(res.data.userId)
|
_this.getUser(res.data.userId)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user