# Conflicts:
#	fuintCashierWeb/src/views/cashier/orderComponents/order_Unpaid.vue
This commit is contained in:
wangh 2024-01-18 09:03:42 +08:00
commit 46913be03f
49 changed files with 774 additions and 256 deletions

View File

@ -44,10 +44,29 @@ export function updateCommission(data) {
})
}
// 删除
// 删除工提成方案
export function delCommission(id) {
return request({
url: '/business/commission/staffCommission/' + id,
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
})
}

View File

@ -145,9 +145,13 @@
<el-select v-model="form.roleId" placeholder="请选择角色">
<el-option
v-for="item in roleList"
:key="item.dutyId"
:key="item.dutyId+''"
:label="item.dutyName"
:value="item.dutyId"
:value="item.dutyId+''"
></el-option>
<el-option
label="油站站长"
:value="12+''"
></el-option>
</el-select>
@ -602,6 +606,7 @@ export default {
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.auditPrem = this.form.auditPrem.toString();
if (!this.form.id) {
queryStaff({mobile:this.form.mobile}).then( response => {
if(response.data!=null){
@ -610,31 +615,25 @@ export default {
this.form.posPrem = JSON.stringify(this.form.posPrem);
this.form.appletPrem = JSON.stringify(this.form.appletPrem);
addStaff(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
if (response.data==1){
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
})
} else {
// queryStaff({mobile:this.form.mobile}).then( response => {
// if (response.data != null) {
// this.$modal.msgError("");
// } else {
// this.form.posPrem = JSON.stringify(this.form.posPrem);
// this.form.appletPrem = JSON.stringify(this.form.appletPrem);
updateStaff(this.form).then(response => {
if (response.data==1){
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}else {
this.$modal.msgError("手机号已存在");
}
updateStaff(this.form).then(response => {
if (response.data==1){
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}else {
this.$modal.msgError("手机号已存在");
}
});
// }
// })
});
}
}
});

View File

@ -4,15 +4,97 @@
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="油品提成方案" name="oil"></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-alert
title="方案说明"
type="info"
description="同一角色组、同一参与油品只能设置一种启用的提成方案">
v-if="activeName=='oil' || activeName=='nonOil'"
description="同一角色组、同一参与油品只能设置一种启用的提成方案,挂账订单不参与提成">
</el-alert>
<div style="margin-top: 20px">
<div style="margin-top: 20px" v-if="activeName=='oil' || activeName=='nonOil'">
<el-button
type="primary"
icon="el-icon-plus"
@ -23,21 +105,21 @@
@sort-change="handleSortChange">
<el-table-column label="ID" prop="id" align="center" width="60"/>
<el-table-column label="方案名称" prop="name" align="center"/>
<el-table-column label="员工角色" prop="staffRoleGroup" align="center">
<template slot-scope="scope">
<dict-tag :options="dict.type.staff_role" :value="scope.row.staffRoleGroup"/>
</template>
<el-table-column label="员工角色" prop="dutyName" align="center">
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.staff_role" :value="scope.row.staffRoleGroup"/>-->
<!-- </template>-->
</el-table-column>
<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">
<span v-if="form.type == 'orderAmount'">
<span v-if="scope.row.type == 'orderAmount'">
订单金额消费满{{scope.row.meetCondition}}
</span>
<span v-if="form.type == 'payAmount'">
<span v-if="scope.row.type == 'payAmount'">
实际金额消费满{{scope.row.meetCondition}}
</span>
<span v-if="form.type == 'refuleNum'">
<span v-if="scope.row.type == 'refuleNum'">
加油数量消费满{{scope.row.meetCondition}}单位/立方
</span>
</template>
@ -88,9 +170,10 @@
@pagination="getList"
/>
</div>
</el-card>
<!-- 添加或修改对话框 -->
<!-- 添加或修改提成方案对话框 -->
<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-row>
@ -106,14 +189,6 @@
<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-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-col>
</el-row>
@ -122,11 +197,11 @@
<el-form-item label="角色组" prop="staffRoleGroup">
<el-select v-model="form.staffRoleGroup" placeholder="请选择所属角色">
<el-option
v-for="dict in dict.type.staff_role"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
v-for="item in roleList"
:key="item.dutyId+''"
:label="item.dutyName"
:value="item.dutyId+''"
></el-option>
</el-select>
</el-form-item>
</el-col>
@ -134,9 +209,12 @@
<el-row>
<el-col :span="24">
<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-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-col>
</el-row>
@ -170,21 +248,6 @@
</el-form-item>
</el-col>
</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-col :span="24">
<el-form-item label="方案状态" prop="status">
@ -210,17 +273,21 @@
import {
addCommission, delCommission,
addCommission, allAmountCommissionRecord, delCommission,
getCommission,
listCommission,
listCommission, listCommissionRecord,
queryCommission,
updateCommission
} from "@/api/staffCommission/staffcommission";
import {listDuty} from "@/api/staff/duty";
import {queryStaffs} from "@/api/order/staff";
export default {
dicts: ['source','role','zhzt','comissionType','staff_role'],
data(){
return {
//
allAmount:0,
changeCom:false,
activeName: 'oil',
select:"元",
@ -231,8 +298,10 @@ export default {
title: "",
//
total: 0,
total1: 0,
//
list: [],
commissionList: [],
//
open: false,
//
@ -245,6 +314,13 @@ export default {
name: '',
commissionSource:'油品'
},
queryParams1: {
page: 1,
pageSize: 10,
},
staffList:[],
//
dateRange: [],
//
form: {
type:'orderAmount',
@ -252,6 +328,7 @@ export default {
},
//
showSearch: true,
roleList:[],
//
rules: {
name: [
@ -283,8 +360,21 @@ export default {
},
created() {
this.getList();
this.getDuty();
this.getStaffList();
},
methods:{
getStaffList(){
queryStaffs().then( response => {
this.staffList = response.data;
})
},
//
getDuty(){
listDuty().then(response => {
this.roleList = response.data
})
},
//
handleClick(tab, event) {
if (this.activeName == 'oil'){
@ -296,7 +386,8 @@ export default {
commissionSource:'油品'
};
this.getList();
}else {
}
if (this.activeName == 'nonOil') {
this.queryParams = {
page: 1,
pageSize: 10,
@ -306,6 +397,13 @@ export default {
};
this.getList();
}
if (this.activeName == 'staffCommission') {
this.queryParams1 = {
page: 1,
pageSize: 10,
};
this.getCommissionList();
}
},
getCheckbox(){
@ -320,6 +418,20 @@ export default {
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() {
this.resetForm("form");
@ -356,6 +468,22 @@ export default {
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) {
const name = row.name
@ -378,70 +506,28 @@ export default {
submitForm: function() {
this.$refs["form"].validate(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.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
updateCommission(this.form).then(response => {
this.$modal.msgSuccess("提成方案更新成功");
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+"提成方案")
if (response.data==1){
this.$modal.msgSuccess("提成方案更新成功");
this.open = false;
this.getList();
}else {
this.form.royaltyRate = this.form.royaltyRate + this.select
addCommission(this.form).then(response => {
this.$modal.msgError("同一个角色组只能对应一个" + this.form.commissionSource + "提成方案")
}
});
} else {
this.form.royaltyRate = this.form.royaltyRate + this.select
addCommission(this.form).then(response => {
if (response.data==1) {
this.$modal.msgSuccess("提成方案新增成功");
this.open = false;
this.getList();
});
}
}else {
this.form.royaltyRate = this.form.royaltyRate + this.select
addCommission(this.form).then(response => {
this.$modal.msgSuccess("提成方案新增成功");
this.open = false;
this.getList();
}else {
this.$modal.msgError("同一个角色组只能对应一个"+this.form.commissionSource+"提成方案")
}
});
}
})
}
}
});
@ -472,4 +558,33 @@ export default {
height: 100vh;
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>

View File

@ -48,7 +48,7 @@ Vue.prototype.getName = getName
Vue.prototype.download = download
Vue.prototype.handleTree = handleTree
// 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)

View File

@ -62,7 +62,7 @@ public class FyPayController {
// 业务逻辑 判断订单状态
AllOrderInfo allOrderInfo = allOrderInfoService.selectAllOrderInfoByOrderNo(orderNo);
if (ObjectUtil.isNotEmpty(allOrderInfo)){
allOrderInfo.setPayMoney(Double.valueOf(settleOrderAmt));
allOrderInfo.setPayMoney(Double.valueOf(settleOrderAmt)/100);
allOrderInfo.setTransactionId(transactionId);
allOrderInfo.setStatus("paid");
allOrderInfo.setPayTime(new Date());

View File

@ -34,7 +34,7 @@ public interface MerchantConfigService extends IService<MerchantConfig> {
* 根据店铺id查询商户信息
* @return
*/
public List<MerchantConfig> selectMeChByIsOpen();
public List<MerchantConfig> selectMeChByIsOpen(Integer storeId);
/**
* 查询所有商户配置信息

View File

@ -9,6 +9,7 @@ import com.fuint.api.fuyou.entity.*;
import com.fuint.api.fuyou.service.FyPayService;
import com.fuint.api.fuyou.service.MerchantConfigService;
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.service.IntegralOrdersService;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
@ -45,6 +46,9 @@ public class FyPayServiceImpl implements FyPayService {
private CardFuelRecordService cardFuelRecordService;
@Resource
private IntegralOrdersService integralOrdersService;
@Autowired
private StaffCommissionService staffCommissionService;
/**
* 条码支付
* @param map1
@ -171,7 +175,7 @@ public class FyPayServiceImpl implements FyPayService {
// 油品订单
oilOrder.setOrderStatus("paid");
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);
if (jsonObjects.size()<=1) {
@ -193,7 +197,7 @@ public class FyPayServiceImpl implements FyPayService {
// 商品订单
goodsOrder.setStatus("paid");
goodsOrder.setPayTime(date);
staffCommissionService.countStaffCommission(goodsOrder.getStaffId(),goodsOrder.getStoreId(),goodsOrder.getAmount(),goodsOrder.getPayAmount(),0.0,"商品",orderNo);
if (!map1.get("goodsOrder").equals("[]")){
List<JSONObject> goods = JSONArray.parseArray(map1.get("goodsOrder"), JSONObject.class);
OrderGoods orderGoods = new OrderGoods();
@ -225,6 +229,9 @@ public class FyPayServiceImpl implements FyPayService {
if (!ArrayUtil.isEmpty(list)){
if (list.size()>1){
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.setPayTime(date);
@ -483,12 +490,19 @@ public class FyPayServiceImpl implements FyPayService {
allOrderInfo.setType(receiveParameter.getType());
allOrderInfo.setStoreId(receiveParameter.getStoreId());
allOrderInfo.setGoodsMoney(receiveParameter.getGoodsMoney());
allOrderInfo.setPayMoney(receiveParameter.getGoodsMoney());
allOrderInfo.setPayType(receiveParameter.getPayType());
allOrderInfo.setUserId(receiveParameter.getUserId());
allOrderInfo.setPayChannel("cashier");
allOrderInfo.setStatus(payStatus);
if (payStatus.equals("paid")){
allOrderInfo.setPayTime(new Date());
}
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.setStatus("unpaid");
allOrderInfo.setContent(receiveParameter.getContent());
allOrderInfoService.insertAllOrderInfo(allOrderInfo);
AllOrderInfo allOrderInfo1 = allOrderInfoService.selectAllOrderInfoByOrderNo(receiveParameter.getOrderNo());
if (ObjectUtil.isEmpty(allOrderInfo1)){
allOrderInfoService.insertAllOrderInfo(allOrderInfo);
}
}
@Override

View File

@ -46,9 +46,10 @@ public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper,
}
@Override
public List<MerchantConfig> selectMeChByIsOpen() {
public List<MerchantConfig> selectMeChByIsOpen(Integer storeId) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("is_open_rule","1");
queryWrapper.eq("store_id",storeId);
List list = baseMapper.selectList(queryWrapper);
return list;
}

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.commission.entity.CommissionRecord;
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.ResponseObject;
import org.springframework.web.bind.annotation.*;
@ -89,7 +90,31 @@ public class CommissionRecordController extends BaseController {
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));
}
}

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.commission.entity.StaffCommission;
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.ResponseObject;
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 = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
IPage<StaffCommission> list = commissionService.selectCommissionList(page,commission);
IPage<StaffCommissionVo> list = commissionService.selectCommissionList(page,commission);
return getSuccessResult(list);
}

View File

@ -3,6 +3,7 @@ package com.fuint.business.commission.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.commission.entity.CommissionRecord;
import com.fuint.business.commission.vo.CommissionRecordVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;
import java.util.List;
@ -81,5 +82,19 @@ public interface CommissionRecordMapper {
*/
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);
}

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.commission.entity.StaffCommission;
import com.fuint.business.commission.vo.StaffCommissionVo;
import org.apache.ibatis.annotations.Param;
public interface StaffCommissionMapper extends BaseMapper<StaffCommission> {
@ -12,5 +13,5 @@ public interface StaffCommissionMapper extends BaseMapper<StaffCommission> {
* @param page
* @return
*/
public IPage<StaffCommission> selectCommissionList(Page page,@Param("commission") StaffCommission commission);
public IPage<StaffCommissionVo> selectCommissionList(Page page, @Param("commission") StaffCommission commission);
}

View File

@ -183,5 +183,55 @@
delete from commission_record where id = #{id}
</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') &gt;= 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') &lt;= 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') &gt;= 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') &lt;= date_format(#{commissionRecord.params.endTime},'%y%m%d')
</if>
</where>
</select>
</mapper>

View File

@ -2,14 +2,14 @@
<!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">
<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>
<select id="selectCommissionList" resultType="com.fuint.business.commission.entity.StaffCommission">
<select id="selectCommissionList" resultType="com.fuint.business.commission.vo.StaffCommissionVo">
<include refid="selectCommission"></include>
<where>
store_id = #{commission.storeId}
and commission_source = #{commission.commissionSource}
sc.store_id = #{commission.storeId}
and sc.commission_source = #{commission.commissionSource}
</where>
</select>
</mapper>

View File

@ -3,6 +3,7 @@ package com.fuint.business.commission.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.commission.entity.CommissionRecord;
import com.fuint.business.commission.vo.CommissionRecordVo;
import io.lettuce.core.dynamic.annotation.Param;
@ -56,4 +57,24 @@ public interface CommissionRecordService {
*/
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);
}

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.commission.entity.StaffCommission;
import com.fuint.business.commission.vo.StaffCommissionVo;
import java.util.List;
import java.util.Map;
@ -17,7 +18,7 @@ public interface StaffCommissionService extends IService<StaffCommission> {
* @param page
* @return
*/
public IPage<StaffCommission> selectCommissionList(Page page, StaffCommission commission);
public IPage<StaffCommissionVo> selectCommissionList(Page page, StaffCommission commission);
/**
* 根据id查询员工提成方案信息
@ -53,4 +54,15 @@ public interface StaffCommissionService extends IService<StaffCommission> {
*/
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);
}

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.commission.entity.CommissionRecord;
import com.fuint.business.commission.mapper.CommissionRecordMapper;
import com.fuint.business.commission.service.CommissionRecordService;
import com.fuint.business.commission.vo.CommissionRecordVo;
import org.springframework.stereotype.Service;
import com.fuint.common.util.TokenUtil;
import io.lettuce.core.dynamic.annotation.Param;
@ -92,4 +93,23 @@ public class CommissionRecordServiceImpl implements CommissionRecordService {
public boolean deleteById(Integer id) {
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);
}
}

View File

@ -1,14 +1,21 @@
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.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.mapper.StaffCommissionMapper;
import com.fuint.business.commission.service.CommissionRecordService;
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.util.TokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
@ -26,26 +33,12 @@ import java.util.Map;
@Service
public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMapper, StaffCommission> implements StaffCommissionService {
@Override
public IPage<StaffCommission> selectCommissionList(Page page, StaffCommission commission) {
public IPage<StaffCommissionVo> selectCommissionList(Page page, StaffCommission commission) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
commission.setStoreId(storeId);
IPage<StaffCommission> staffCommissionIPage = baseMapper.selectCommissionList(page, commission);
for (StaffCommission record : staffCommissionIPage.getRecords()) {
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;
IPage<StaffCommissionVo> staffCommissionIPage = baseMapper.selectCommissionList(page, commission);
return staffCommissionIPage;
}
@Override
@ -74,18 +67,93 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
@Override
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();
Integer storeId = nowAccountInfo.getStoreId();
commission.setStoreId(storeId);
int row = baseMapper.insert(commission);
row = baseMapper.insert(commission);
return row;
}
@Override
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;
}
@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);
}
}
}
}
}

View File

@ -1,4 +1,16 @@
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;
}

View File

@ -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;
}

View File

@ -508,7 +508,7 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
if (flag) {
// 调用支付接口
// 判断是否开启支付规则
List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen();
List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen(integralOrdersList.getStoreId());
// if (list.size() > 0) {
// oilConfigService.oilRule();
// }

View File

@ -423,10 +423,10 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
public PaymentActiveVO paymentActive(PaymentActiveDTO paymentActiveDTO) {
PaymentActiveVO paymentActiveVO = new PaymentActiveVO();
Integer storeId = paymentActiveDTO.getStoreId();
BigDecimal amount = new BigDecimal(0.00);
BigDecimal fullAmount = new BigDecimal(0.00);
BigDecimal a = new BigDecimal(0.1);
BigDecimal b = new BigDecimal(10);
BigDecimal amount = new BigDecimal("0.00");
BigDecimal fullAmount = new BigDecimal("0.00");
BigDecimal a = new BigDecimal("0.1");
BigDecimal b = new BigDecimal("10");
//折扣
List<ActiveDiscountPayVO> activeDiscountVOList = oilOrderMapper.selectActiveDiscount(storeId,paymentActiveDTO.getAmount());
if (CollectionUtils.isNotEmpty(activeDiscountVOList)){

View File

@ -210,6 +210,7 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
if (StringUtils.isNotEmpty(staff.getPassword())){
TAccount tAccount = accountService.selectAccountByStaffId(staff.getId());
tAccount.setPassword(staff.getPassword());
tAccount.setAccountName(staff.getMobile());
accountService.entryptPassword(tAccount);
try {
accountService.editAccount(tAccount,null);

View File

@ -98,5 +98,9 @@ public class CashierOrder extends BaseEntity implements Serializable {
* 退款备注
*/
private String refundRemark;
/**
* 支付方式
*/
private String payType;
}

View File

@ -125,7 +125,7 @@ public class OilOrder extends BaseEntity implements Serializable {
/**
* 油罐id
*/
@TableField(exist = false)
// @TableField(exist = false)
private Integer tankId;
}

View File

@ -39,17 +39,17 @@ public interface HangBillMapper extends BaseMapper<HangBill> {
* 查询当前店铺所有的订单总额
* @return
*/
double selectAllAmount(@Param("storeId") int storeId);
Double selectAllAmount(@Param("storeId") int storeId);
/**
* 查询当前店铺归还的账单总额
* @return
*/
double selectReturnAmount(@Param("storeId") int storeId);
Double selectReturnAmount(@Param("storeId") int storeId);
/**
* 查询当前店铺未归还的账单总额
* @return
*/
double selectNoReturnAmount(@Param("storeId") int storeId);
Double selectNoReturnAmount(@Param("storeId") int storeId);
}

View File

@ -54,7 +54,7 @@
<if test="allOrderInfo.params.endTime != null and allOrderInfo.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(pay_time,'%y%m%d') &lt;= date_format(#{allOrderInfo.params.endTime},'%y%m%d')
</if>
order by pay_time desc
order by aoi.create_time desc
</select>
<select id="sumPayMoney" resultType="java.lang.String">
select

View File

@ -18,7 +18,7 @@
<if test="order.status != null and order.status != ''">
and cvco.status = #{order.status}
</if>
order by cvco.pay_time desc
order by cvco.create_time desc
</where>
</select>
</mapper>

View File

@ -24,7 +24,7 @@
<if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(pay_time,'%y%m%d') &lt;= date_format(#{order.params.endTime},'%y%m%d')
</if>
order by pay_time desc
order by create_time desc
</where>
</select>
<select id="selectCashierOrderById" resultType="com.fuint.business.order.vo.CashierOrderVo"

View File

@ -36,6 +36,7 @@
<if test="hangBill.params.endTime != null and hangBill.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(hb.create_time,'%y%m%d') &lt;= date_format(#{hangBill.params.endTime},'%y%m%d')
</if>
order by create_time desc
</where>
</select>
<select id="selectHangBillById" resultType="com.fuint.business.order.vo.HangBillVo" parameterType="int">
@ -52,13 +53,13 @@
</where>
</select>
<select id="selectAllAmount" resultType="double">
<select id="selectAllAmount" resultType="java.lang.Double">
select sum(amount) from hang_bill where store_id = #{storeId}
</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>
<select id="selectNoReturnAmount" resultType="double">
<select id="selectNoReturnAmount" resultType="java.lang.Double">
select sum(outstand_amount) from hang_bill where store_id = #{storeId}
</select>
</mapper>

View File

@ -30,7 +30,7 @@
<if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%y%m%d') &lt;= date_format(#{order.params.endTime},'%y%m%d')
</if>
order by pay_time desc
order by create_time desc
</where>
</select>
<select id="getMtOrderList" resultType="com.fuint.business.order.vo.LJOrderVo">

View File

@ -39,7 +39,7 @@
<if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(pay_time,'%y%m%d') &lt;= date_format(#{order.params.endTime},'%y%m%d')
</if>
order by pay_time desc
order by create_time desc
</where>
</select>
<select id="selectOilOrderByOrderNo" resultType="com.fuint.business.order.vo.OilOrderVo"
@ -75,7 +75,7 @@
<if test="order.remark != null and order.remark != ''">
and remark = #{order.remark}
</if>
order by pay_time desc
order by create_time desc
</where>
</select>

View File

@ -12,7 +12,7 @@
<include refid="selectReturnRecord"></include>
<where>
rd.hang_bill_id = #{returnRecord.hangBillId}
order by pay_time desc
order by rd.create_time desc
</where>
</select>
<!-- <select id="selectHangBillById" resultType="com.fuint.business.order.vo.HangBillVo" parameterType="int">-->

View File

@ -83,7 +83,7 @@ public interface HangBillService extends IService<HangBill> {
* 查询当前店铺所有的订单总额
* @return
*/
double selectAllAmount();
Double selectAllAmount();
/**
* 查询当前店铺归还账单的数量
@ -95,11 +95,11 @@ public interface HangBillService extends IService<HangBill> {
* 查询当前店铺归还的账单总额
* @return
*/
double selectReturnAmount();
Double selectReturnAmount();
/**
* 查询当前店铺未归还的账单总额
* @return
*/
double selectNoReturnAmount();
Double selectNoReturnAmount();
}

View File

@ -80,7 +80,13 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
@Override
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;
}

View File

@ -1,5 +1,6 @@
package com.fuint.business.order.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -73,7 +74,13 @@ public class CashierOrderServiceImpl extends ServiceImpl<CashierOrderMapper, Cas
@Override
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;
}

View File

@ -254,7 +254,7 @@ public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> i
}
@Override
public double selectAllAmount() {
public Double selectAllAmount() {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
return baseMapper.selectAllAmount(nowAccountInfo.getStoreId());
}
@ -269,13 +269,13 @@ public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> i
}
@Override
public double selectReturnAmount() {
public Double selectReturnAmount() {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
return baseMapper.selectReturnAmount(nowAccountInfo.getStoreId());
}
@Override
public double selectNoReturnAmount() {
public Double selectNoReturnAmount() {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
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")){
Integer allAmount = (int) (Double.valueOf(map.get("repaidAmount"))*100);
// 判断是否开启支付规则
List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen();
List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen(storeId);
if (list.size()>0){
oilConfigService.oilRule();
}

View File

@ -13,6 +13,7 @@ import com.fuint.api.fuyou.entity.ReceiveParameter;
import com.fuint.api.fuyou.service.FyPayService;
import com.fuint.api.fuyou.service.MerchantConfigService;
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.service.LJGoodsService;
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelRecord;
@ -89,6 +90,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
private OilConfigService oilConfigService;
@Autowired
private LJGoodsService goodsService;
@Autowired
private StaffCommissionService staffCommissionService;
@Override
public IPage<OilOrder> selectOilOrderList(Page page, OilOrder order) {
@ -245,8 +248,6 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
payStatus = "unpaid";
}
Map<String,Object> orders = new HashMap<>();
OilOrder oilOrder1 = null;
@ -278,6 +279,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
ljOrder.setStaffId(staffId);
ljOrder.setStatus(payStatus);
if (payType.equals("CASH")){
staffCommissionService.countStaffCommission(staffId,storeId,goodsAmount,goodsActualPay,0.0,"商品",orderNo);
ljOrder.setPayTime(new Date());
}
// 将商品订单的json数据转换为数组
@ -309,27 +311,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
ljOrder1 = orderService.selectGoodsOrder(orderNo);
}
// 添加收银台订单信息
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);
Double oilLiters = 0.0;
// 添加油品订单信息
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 oilPrice = Double.valueOf(jsonObjects.get(i).get("oilPrice").toString());
Double oilNum = amount/oilPrice;
oilLiters += oilNum;
if (i==0){
order.setOrderType("主订单");
order.setOrderAmount(amount);
order.setPayAmount(oilActualPay);
order.setOrderNo(orderNo);
if (payType.equals("CASH")){
staffCommissionService.countStaffCommission(staffId,storeId,oilAmount,oilActualPay,oilLiters,"油品",orderNo);
}
}else {
order.setOrderType("子订单");
order.setOrderAmount(amount);
@ -369,6 +355,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
order.setPayType(payType);
order.setInvoicing("未开票");
order.setOrderStatus(payStatus);
order.setTankId(Integer.valueOf(jsonObjects.get(0).get("tankId").toString()));
if (payType.equals("CASH")){
order.setPayTime(new Date());
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调用第三方支付接口
if (!map.get("allAmount").equals("0") && !map.get("payType").equals("CASH")){
Integer allAmount = (int) (Double.valueOf(map.get("allAmount"))*100);
// 判断是否开启支付规则
List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen();
List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen(storeId);
if (list.size()>0){
oilConfigService.oilRule();
}
@ -503,6 +513,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
// 添加收银台订单信息
CashierOrder cashierOrder = new CashierOrder();
boolean flag = false;
Double oilLiters = 0.0;
for (int i = 0;i < oilOrders.size();i++) {
if (oilOrders.get(i).get("oilName").equals(oilName.getId().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;
status = "paid";
Double oilNum = amount / oilPrice;
oilLiters += oilNum;
if (i == 0) {
order.setOrderType("主订单");
order.setOrderAmount(amount);
@ -547,6 +559,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
flag = true;
status = "paid";
Double oilNum = amount / oilPrice;
oilLiters += oilNum;
if (i == 0) {
order.setOrderType("主订单");
order.setOrderAmount(amount);
@ -583,6 +596,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
flag = true;
status = "paid";
Double oilNum = amount / oilPrice;
oilLiters += oilNum;
if (i == 0) {
order.setOrderType("主订单");
order.setOrderAmount(amount);
@ -615,7 +629,6 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
oilOrder = this.selectOilOrderByOrderNo(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);
}else {
res.put("error","囤油卡或储值卡余额不足!");
}
@ -637,8 +650,10 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setTerminal(map.get("terminal"));
cashierOrder.setOilOrderId(oilOrder.getId());
cashierOrder.setSeekZero(0.0);
cashierOrder.setPayType(map.get("payType"));
cashierOrderService.insertCashierOrder(cashierOrder);
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");
}
}
@ -647,10 +662,12 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
if (cardBalance>=oilAmount){
// 添加油品订单信息
OilOrder order = new OilOrder();
Double oilLiters = 0.0;
for (int i = 0;i < oilOrders.size();i++) {
Double amount = Double.valueOf(oilOrders.get(i).get("amount").toString());
Double oilPrice = Double.valueOf(oilOrders.get(i).get("oilPrice").toString());
Double oilNum = amount / oilPrice;
oilLiters += oilNum;
if (i == 0) {
order.setOrderType("主订单");
order.setOrderAmount(amount);
@ -697,10 +714,11 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setTerminal(map.get("terminal"));
cashierOrder.setOilOrderId(oilOrder.getId());
cashierOrder.setSeekZero(0.0);
cashierOrder.setPayType(map.get("payType"));
cashierOrderService.insertCashierOrder(cashierOrder);
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");
staffCommissionService.countStaffCommission(Integer.valueOf(map.get("staffId")),storeId,oilAmount,oilAmount,oilLiters,"油品",orderNo);
// this.insertCardBalance(oilAmount,userId,storeId);
res.put("success","success");
}else {
@ -866,6 +884,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setOilDiscountAmount(oilOrder.getDiscountAmount());
cashierOrder.setTerminal(oilOrder.getTerminal());
cashierOrder.setSeekZero(0.0);
cashierOrder.setPayType(oilOrder.getPayType());
cashierOrderService.insertCashierOrder(cashierOrder);
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.addOilTracks(oilOrder,oilOrder.getStoreId());
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.setDiscountAmount(Double.valueOf(discountAmount));
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.addOilTracks(oilOrder,oilOrder.getStoreId());
staffCommissionService.countStaffCommission(oilOrder.getStaffId(),oilOrder.getStoreId(),oilOrder.getOrderAmount(),oilOrder.getPayAmount(),oilOrder.getOilNum(),"油品",orderNo);
CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo);
if (ObjectUtil.isNotEmpty(cashierOrder)){
cashierOrder.setOilOrderId(oilOrder.getId());
cashierOrder.setPayTime(new Date());
cashierOrder.setStatus("paid");
cashierOrder.setOilDiscountAmount(oilOrder.getDiscountAmount());
@ -1173,7 +1195,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
int growth = balance.getGrowthValue();
if (refuelMoney==null){
String refuelMoney1 = balance.getRefuelMoney();
if (StringUtils.isNotEmpty(refuelMoney1)){
if (StringUtils.isNotEmpty(refuelMoney1) && !"null".equals(refuelMoney1)){
JSONArray objects = JSONArray.parseArray(refuelMoney);
JSONArray objects1 = JSONArray.parseArray(refuelMoney1);
List<RefuelMoney> list = new ArrayList<>();

View File

@ -97,8 +97,8 @@ public class LJUserController extends BaseController {
* @return
*/
@GetMapping("/statistic")
public ResponseObject getStatistic(){
Map<String, Object> map = userService.selectStatistic();
public ResponseObject getStatistic(LJUserVo user){
Map<String, Object> map = userService.selectStatistic(user);
return getSuccessResult(map);
}

View File

@ -55,7 +55,10 @@
</select>
<!-- 查询会员统计信息-->
<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 id="selectUserByMobile" resultType="com.fuint.business.userManager.vo.LJUserVo"

View File

@ -44,7 +44,7 @@ public interface LJUserService extends IService<LJUser> {
* 查询会员统计信息
* @return
*/
public Map<String ,Object> selectStatistic();
public Map<String ,Object> selectStatistic(LJUserVo user);
/**
* 根据id查询会员信息

View File

@ -129,7 +129,7 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
res.put("userGrade",baseMapper.selectById(Integer.valueOf(gradeId)));
return res;
}else {
return null;
return res;
}
}
}

View File

@ -92,7 +92,7 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
* @return
*/
@Override
public Map<String, Object> selectStatistic() {
public Map<String, Object> selectStatistic(LJUserVo user) {
Map<String ,Object> map = new HashMap<>();
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();

View File

@ -62,33 +62,37 @@ export function editHangBill(data) {
}
// 当前店铺归还账单的数量
export function hangBillReturnTotal() {
export function hangBillReturnTotal(query) {
return request({
url: '/business/hangBill/returnTotal',
method: 'get',
params: query
})
}
// 当前店铺归还账单的数量
export function hangBillAllAmount() {
export function hangBillAllAmount(query) {
return request({
url: '/business/hangBill/allAmount',
method: 'get',
params: query
})
}
// 当前店铺归还账单的数量
export function hangBillAllReturnAmount() {
export function hangBillAllReturnAmount(query) {
return request({
url: '/business/hangBill/allReturnAmount',
method: 'get',
params: query
})
}
// 当前店铺归还账单的数量
export function hangBillAllNoReturnAmount() {
export function hangBillAllNoReturnAmount(query) {
return request({
url: '/business/hangBill/allNoReturnAmount',
method: 'get',
params: query
})
}

View File

@ -554,6 +554,21 @@
</div>
</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-form ref="form3" :model="form3">
@ -757,6 +772,7 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
open3:false,
open4:false,
dialogVisiblej:false,
dialogVisiblejLoading: false,
//
isQuery:true,
//
@ -784,7 +800,7 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
this.getUnitList();
this.getPayList();
this.getLists();
this.getStatistic();
// this.getStatistic();
},
directives: {
// v-focus
@ -802,17 +818,23 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
methods:{
//
getStatistic(){
hangBillReturnTotal().then(res => {
hangBillReturnTotal(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
this.returnTotal = res.data
})
hangBillAllAmount().then(res => {
this.allAmount = res.data
hangBillAllAmount(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
if (res.data) {
this.allAmount = res.data
}
})
hangBillAllReturnAmount().then(res => {
this.returnAllAmount = res.data
hangBillAllReturnAmount(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
if (res.data) {
this.returnAllAmount = res.data
}
})
hangBillAllNoReturnAmount().then(res => {
this.noReturnAllAmount = res.data
hangBillAllNoReturnAmount(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
if (res.data) {
this.noReturnAllAmount = res.data
}
})
},
getPayMeth(list,val){
@ -935,6 +957,7 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
this.repaidAmount = repaidAmount
},
handClose(){
this.dialogVisiblejLoading = false
this.isPay = true;
this.isPaySuccess = false;
this.dialogVisiblej = false;
@ -996,15 +1019,18 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
response.data.forEach(item => {
if (item.payStatus == "unpaid"){
_this.isQuery = true;
_this.dialogVisiblejLoading = true
}
if (item.payStatus == "paid"){
_this.isPaySuccess = true;
_this.isPay = false;
_this.isQuery = false;
_this.loading = false;
clearInterval(timer);
}
if (item.payStatus == "payFail"){
_this.isPaySuccess = false;
_this.isPay = false;
_this.isQuery = false;
_this.loading = false;
clearInterval(timer);
@ -1015,15 +1041,15 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
let timer2 = setInterval(function () {
if (_this.isBatch) {
if (_this.isQuery || !_this.open3 || !_this.open4){
_this.loading = false;
_this.isPay = false;
// _this.loading = false;
// _this.isPay = false;
clearInterval(timer);
clearTimeout(timer3);
}
}else {
if (_this.isQuery || !_this.open2) {
_this.loading = false;
_this.isPay = false;
// _this.loading = false;
// _this.isPay = false;
clearInterval(timer);
clearTimeout(timer3);
}
@ -1174,6 +1200,7 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
this.hangBillList = response.data.records
this.total = response.data.total;
})
this.getStatistic();
},
//
handleQuery() {

View File

@ -508,7 +508,22 @@
</div>
</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="dialogVisiblevip"
@ -883,8 +898,11 @@
oilGunList:[],
//
payList:[],
//
timestamp: 15,
dialogVisible: false,
dialogVisiblej: false,
dialogVisiblejLoading: false,
dialogVisiblevip:false,
dialogVisibleamount:false,
dialogVisibleMember:false,
@ -2299,6 +2317,7 @@
},
//
resetting(){
this.seekZero = 0;
this.oilOrder = [];
this.oilActualPay = 0;
this.oilTotal = 0;
@ -2339,7 +2358,6 @@
//
getOilTank(this.form.tankId).then(res => {
console.log(res)
if (res.data.storedQuantity-this.form.liters<0){
this.$modal.msgError("所加油的升数大于油罐内的升数,请重新选择加油升数")
return;
@ -2546,7 +2564,7 @@
return;
}
}
if (!this.authCode){
if (!this.authCode && ((+this.oilActualPay) + (+this.goodsActualPay))>0){
this.$modal.msgError("请先扫码");
return;
}
@ -2654,6 +2672,7 @@
_this.oilOrder = []
_this.goodsOrder = []
_this.amount = 0
_this.seekZero = 0;
};
this.userNo = ""
this.map = {
@ -2724,6 +2743,7 @@
if (response.data!=null){
if (response.data.status == "unpaid"){
_this.isQuery = true;
_this.dialogVisiblejLoading = true
}
if (response.data.status == "paid"){
_this.isPay = true;
@ -2749,7 +2769,8 @@
let timer2 = setInterval(function () {
if (_this.isQuery || !_this.dialogVisiblej) {
_this.loading = false;
_this.isPay = true;
// _this.isPay = true;
// _this.countdown()
clearInterval(timer);
clearTimeout(timer3);
@ -2764,7 +2785,22 @@
this.isPaySuccess = false;
}, 10000)
},
//
countdown(){
let _this = this
let timer = setInterval(() => {
// countdown1
_this.timestamp--;
// 0
if(_this.timestamp === 0) {
clearInterval(timer)
_this.timestamp = 15
}
}, 1000);
},
handClose(){
this.dialogVisiblejLoading = false
// this.resetting1()
this.authCode = "";
this.userNo = ""

View File

@ -144,7 +144,11 @@
</el-form>
</template>
</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">
<template slot-scope="props">
<span>{{ getName(oilNameList,props.row.oils) }}/{{ getName1(oilGunList,props.row.oilGunNum) }}</span>
@ -252,6 +256,8 @@
cash:'0',
},
oilGunList:[],
//
terminalList:[],
}
},
created() {
@ -262,12 +268,20 @@
},
methods:{
exportExcelOilOrder() {
exportExcelOilOrderApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
this.$download.saveAs(blob,'未支付订单统计.xLsx')
exportExcelOilOrderApi(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
const blob = new Blob([res], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});
this.$download.saveAs(blob, '未支付订单统计.xLsx')
})
},
getVal(list,val){
let name = "";
list.forEach(item => {
if (item.dictValue == val){
name = item.dictLabel
}
})
return name;
},
//
getOilGunList(){
getOilNumberGun().then(res => {
@ -363,6 +377,9 @@
queryStaffs().then( response => {
this.staffList = response.data;
})
getDicts("terminal").then( response => {
this.terminalList = response.data;
})
},
//
getList(val){

View File

@ -335,6 +335,7 @@
this.oilOrder.storeId = this.storeId
this.oilOrder.staffId = id
this.oilOrder.oilNum = Math.ceil((this.value/this.oilPrice)*100)/100
this.oilOrder.tankId = uni.getStorageSync("tankId")
let _this = this;
//
request({

View File

@ -39,7 +39,7 @@
<view style="background-color: white;width: 94%;margin: 15px auto;">
<view class="desc" v-if="isStoreValueCard">
<view class="desc">
<view style="display: flex;">
储值卡
<span style="display: flex;">(<span v-if="isUseChildCard">主卡</span>余额{{user.cardBalance}})</span>
@ -74,7 +74,7 @@
</view>
</view>
<view class="desc" v-if="isFullPreferential">
<view class="desc">
<view style="display: flex;">
活动优惠
<!-- <span style="display: flex;">(满减活动)</span> -->
@ -82,16 +82,16 @@
<view style="display: flex;">
<span style="margin-right: 10px;display: flex;">
-{{fullRedece}}
<span style="margin-left: 8px;margin-top: 8px;">
<!-- <span style="margin-left: 8px;margin-top: 8px;">
<u-checkbox-group>
<u-checkbox v-model="checkFull" :checked="checkFull" @change="changeFull"></u-checkbox>
</u-checkbox-group>
</span>
</span> -->
</span>
</view>
</view>
<view class="desc" v-if="cardsList.length>0">
<view class="desc" >
<view style="display: flex;">
优惠券优惠
<span style="display: flex;">(优惠券)</span>
@ -99,16 +99,16 @@
<view style="display: flex;">
<span style="margin-right: 10px;display: flex;">
-{{couponRedece}}
<span style="margin-left: 8px;margin-top: 8px;">
<!-- <span style="margin-left: 8px;margin-top: 8px;">
<u-checkbox-group>
<u-checkbox v-model="checkCoupon" :checked="checkCoupon" @change="changeCoupon"></u-checkbox>
</u-checkbox-group>
</span>
</span> -->
</span>
</view>
</view>
<view class="desc" v-if="isGradePreferential">
<view class="desc">
<view style="display: flex;">
会员等级优惠
<!-- <span style="display: flex;">({{userGrade.name}})</span> -->
@ -116,16 +116,17 @@
<view style="display: flex;">
<span style="margin-right: 10px;display: flex;">
-{{gradeRedece}}
<span style="margin-left: 8px;margin-top: 8px;">
<!-- <span style="margin-left: 8px;margin-top: 8px;">
<u-checkbox-group>
<u-checkbox v-model="checkGrade" @change="changeGrade"></u-checkbox>
</u-checkbox-group>
</span>
</span> -->
</span>
</view>
</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>
@ -254,7 +255,7 @@
},
onLoad(e) {
this.orderNo = e.orderNo
// this.orderNo = "2345202401161204280406d3"
// this.orderNo = "234520240117095256fbd86e"
},
onShow() {
this.getOilOrder();
@ -827,7 +828,7 @@
}
_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.refuelMoneyAfter = JSON.parse(res.data.userVo.refuelMoney)
_this.chooseRefuelMoney()
@ -852,7 +853,7 @@
_this.getStaffList(res.data.staffId)
_this.getStore(res.data.storeId)
_this.getOilNumber(res.data.storeId)
_this.chooseCoupons()
// _this.chooseCoupons()
_this.getUser(res.data.userId)
}
})