Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
8537041269
45
fuintAdmin/src/api/staff/user/cardvaluechild.js
Normal file
45
fuintAdmin/src/api/staff/user/cardvaluechild.js
Normal file
@ -0,0 +1,45 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询子卡信息列表
|
||||
export function listCardValueChild(id) {
|
||||
return request({
|
||||
url: 'cardValudChildrens/listPC/'+id,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
// 根据id查询子卡信息
|
||||
export function cardValueChildInfo(id) {
|
||||
return request({
|
||||
url: 'cardValudChildrens/'+id,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
// 添加子卡信息
|
||||
export function addCardValueChild(data) {
|
||||
return request({
|
||||
url: 'cardValudChildrens',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 修改子卡信息
|
||||
export function editCardValueChild(data) {
|
||||
return request({
|
||||
url: 'cardValudChildrens/edit',
|
||||
method: 'put',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 查询子卡订单信息
|
||||
export function listCardValueChildOrder(query) {
|
||||
return request({
|
||||
url: 'business/order/cardValueChildOrder/list',
|
||||
method: 'get',
|
||||
params:query,
|
||||
})
|
||||
}
|
@ -15,7 +15,7 @@
|
||||
</el-popover> -->
|
||||
</div>
|
||||
<div class="box-size">
|
||||
{{ this.statisticsData.today_sum ? this.statisticsData.today_sum : 0 }}
|
||||
{{ this.statisticsData.today_sum ? parseFloat(this.statisticsData.today_sum).toFixed(2) : 0 }}
|
||||
</div>
|
||||
<div class="box-but">
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
<span style="margin-right: 5px">本周流水总额</span>
|
||||
</div>
|
||||
<div class="box-size">
|
||||
{{ this.statisticsData.this_week_sum?this.statisticsData.this_week_sum:0 }}
|
||||
{{ this.statisticsData.this_week_sum?parseFloat(this.statisticsData.this_week_sum).toFixed(2):0 }}
|
||||
</div>
|
||||
<div class="box-but">
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
<span style="margin-right: 5px">本月流水总额</span>
|
||||
</div>
|
||||
<div class="box-size">
|
||||
{{this.statisticsData.this_month_sum?this.statisticsData.this_month_sum:0}}
|
||||
{{this.statisticsData.this_month_sum?parseFloat(this.statisticsData.this_month_sum).toFixed(2):0}}
|
||||
</div>
|
||||
<div class="box-but">
|
||||
|
||||
|
@ -551,7 +551,7 @@ export default {
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: "会员名称不能为空", trigger: "blur" },
|
||||
{ min: 2, max: 200, message: '会员名称长度必须介于2 和 100 之间', trigger: 'blur' }
|
||||
// { min: 2, max: 200, message: '会员名称长度必须介于2 和 100 之间', trigger: 'blur' }
|
||||
],
|
||||
gradeId: [{ required: true, message: "请选择会员等级", trigger: "blur" }],
|
||||
status: [{ required: true, message: "请选择会员状态", trigger: "blur" }],
|
||||
|
@ -173,8 +173,9 @@
|
||||
@click="rechargeCard(cardValueList.length,-1)">
|
||||
<el-input placeholder="请输入充值金额"
|
||||
size="medium"
|
||||
v-model.number="cardValueForm.amount"
|
||||
v-model="cardValueForm.amount"
|
||||
@input="valueAmoutChange(cardValueForm.amount)"
|
||||
oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
|
||||
>
|
||||
<template slot="prepend">自定义</template>
|
||||
<template slot="append">元</template>
|
||||
@ -276,7 +277,8 @@
|
||||
<div style="width: 7%;line-height: 40px">油品类型</div>
|
||||
<el-radio-group v-model="tabOilType" style="margin-bottom: 30px;">
|
||||
<el-radio-button v-for="(item,index) in oilTypeList" :label="item.oilType"
|
||||
@click.native="tabOilTypeClick(item.status)">{{ item.type }}
|
||||
@click.native="tabOilTypeClick(item.oilType)">
|
||||
{{ item.type }}
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
@ -343,8 +345,9 @@
|
||||
<div style="display: flex;margin: 20px 0">
|
||||
<div style="width: 7%">支付方式</div>
|
||||
<div>
|
||||
<el-radio v-for="dict in dict.type.payment_type" v-model="cardFuelDieselForm.paymentType"
|
||||
:key="dict.value" :label="dict.value" :value="dict.value" border>{{ dict.label }}
|
||||
<el-radio v-for="dict in payList" v-model="cardFuelDieselForm.paymentType"
|
||||
v-if="dict.dictValue!=='APPLET_CODE'"
|
||||
:key="dict.dictValue" :label="dict.dictValue" :value="dict.dictValue" border>{{ dict.dictLabel }}
|
||||
</el-radio>
|
||||
</div>
|
||||
</div>
|
||||
@ -436,7 +439,7 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="新手机号" prop="mobile" style="width: 420px">
|
||||
<el-input v-model="form.mobile" placeholder="请输入新手机号" maxlength="30"/>
|
||||
<el-input v-model.number="form.mobile" placeholder="请输入新手机号" maxlength="30"/>
|
||||
<span style="font-size: 12px;color: grey">
|
||||
手机号更换后,旧手机号将无法使用,更换后实时生效
|
||||
</span>
|
||||
@ -537,96 +540,130 @@
|
||||
</el-dialog>
|
||||
|
||||
<!-- 子卡管理-->
|
||||
<el-dialog :close-on-click-modal="false" width="60%" :title="title" :visible.sync="openSubCard" append-to-body>
|
||||
<el-dialog :title="title" :visible.sync="openSubCard" append-to-body>
|
||||
<!-- <cardValueChild :pUserId="form.id" :handleUpdate="handleUpdate1" :handleAdd="handleAdd1"></cardValueChild>-->
|
||||
<el-tabs v-model="subCardActive" @tab-click="handleClick">
|
||||
<el-tab-pane label="子卡管理" name="subCardManage">
|
||||
<div style="display: flex;justify-content: space-between;margin: 10px 0">
|
||||
<div style="font-size: 16px">会员信息:{{form.mobile}}</div>
|
||||
<el-button type="primary">新增子卡</el-button>
|
||||
<el-button type="primary" :disabled="cardValueChildList.length>=2" @click="handleAdd1">新增子卡</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-table ref="tables" v-loading="loading" :data="list">
|
||||
<el-table-column prop="date" label="子卡卡号"/>
|
||||
<el-table-column label="基础信息">
|
||||
<el-table-column prop="name" label="子卡姓名"/>
|
||||
<el-table-column prop="address" label="手机号"/>
|
||||
<el-table-column prop="address" label="车牌号"/>
|
||||
<el-table ref="tables" v-loading="loading" :data="cardValueChildList">
|
||||
<el-table-column label="子卡ID" prop="id" align="center" width="60"/>
|
||||
<el-table-column label="子卡手机号" prop="cardChildPhones" align="center"/>
|
||||
<el-table-column label="创建时间" align="center" width="160" prop="createTime">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="额度管理">
|
||||
<el-table-column prop="name" label="配额额度"/>
|
||||
<el-table-column prop="address" label="已用额度"/>
|
||||
<el-table-column prop="address" label="可用额度"/>
|
||||
<el-table-column label="操作" align="center" fixed='right'>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate1(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-document"
|
||||
@click="handleOrder(scope.row)"
|
||||
>交易记录</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="date" label="状态"/>
|
||||
<el-table-column prop="date" label="操作"/>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="queryParams.page"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<!-- <pagination-->
|
||||
<!-- :total="total"-->
|
||||
<!-- :page.sync="queryParams.page"-->
|
||||
<!-- :limit.sync="queryParams.pageSize"-->
|
||||
<!-- @pagination="getList"-->
|
||||
<!-- />-->
|
||||
</div>
|
||||
<el-alert
|
||||
title="关于子卡"
|
||||
type="info"
|
||||
description="子卡为会员子母卡功能,子卡共享母卡的储值额度及信息,子卡为实体会员卡信息,消费需在PC或手持机中才可进行使用">
|
||||
style="margin-top: 20px"
|
||||
:closable="false"
|
||||
description="子卡为会员子母卡功能,子卡共享母卡的储值额度及信息,子卡为实体会员卡信息,消费需在小程序中才可进行使用">
|
||||
</el-alert>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="子卡消费记录" name="consumption">
|
||||
<div style="display: flex;justify-content: space-between;margin: 10px 0">
|
||||
<div style="font-size: 16px">
|
||||
<el-form ref="form" :model="subCardList" :rules="rules" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="子卡卡号" prop="userNo">
|
||||
<el-form :model="subCardList" ref="queryForm" size="small" :inline="true" label-width="85px">
|
||||
<el-form-item label="子卡手机号" prop="cardChildPhones">
|
||||
<el-input
|
||||
v-model="subCardList.idCard"
|
||||
placeholder="请输入卡号信息"
|
||||
v-model="subCardList.cardChildPhones"
|
||||
placeholder="请输入子卡手机号"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="关联单号">
|
||||
<el-input
|
||||
v-model="subCardList.orderId"
|
||||
placeholder="关联单号信息"
|
||||
<el-form-item label="支付状态" prop="status">
|
||||
<el-select
|
||||
v-model="subCardList.status"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.pay_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item>
|
||||
<el-button type="primary">新增子卡</el-button>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<el-table ref="tables" v-loading="loading" :data="list">
|
||||
<el-table-column prop="date" label="子卡卡号"/>
|
||||
<el-table-column prop="date" label="消费金额"/>
|
||||
<el-table-column label="消费信息">
|
||||
<el-table-column prop="name" label="关联单号"/>
|
||||
<el-table-column prop="address" label="描述信息"/>
|
||||
<el-table ref="tables" v-loading="loading" :data="orderList">
|
||||
<el-table-column type="expand">
|
||||
<template slot-scope="props">
|
||||
<el-form label-position="left" class="demo-table-expand" style="margin-left: 20px">
|
||||
<el-form-item label="备注信息">
|
||||
<span>{{ props.row.remark }}</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="ID" prop="id" align="center" width="60"/>
|
||||
<el-table-column label="子卡手机号" prop="cardChildPhones" align="center" />
|
||||
<el-table-column label="订单号" prop="orderNo" align="center" />
|
||||
<el-table-column label="订单金额" prop="amount" align="center" />
|
||||
<el-table-column label="消费金额" prop="payAmount" align="center" />
|
||||
<el-table-column label="支付状态" prop="status" align="center" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.pay_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="支付时间" prop="payTime" align="center" >
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.payTime ? parseTime(scope.row.payTime) :"--" }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="date" label="消费时间"/>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="queryParams.page"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
:page.sync="subCardList.page"
|
||||
:limit.sync="subCardList.pageSize"
|
||||
@pagination="getOrderList"
|
||||
/>
|
||||
</div>
|
||||
<el-alert
|
||||
title="关于子卡"
|
||||
type="info"
|
||||
style="margin-top: 20px"
|
||||
:closable="false"
|
||||
description="当前会员的所有子卡消费记录信息,可根据对应子卡卡号进行检索查询">
|
||||
</el-alert>
|
||||
</el-tab-pane>
|
||||
@ -687,6 +724,43 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 添加或修改子卡信息-->
|
||||
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openSubCard1" width="30%">
|
||||
<el-form ref="form1" :model="form1" :rules="rules" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="主卡信息" prop="userId" style="width: 420px">
|
||||
<el-select
|
||||
v-model="form1.userId"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
disabled
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
:label="form.mobile"
|
||||
:value="form.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="子卡手机号" prop="cardChildPhones" style="width: 420px">
|
||||
<el-input
|
||||
v-model.number="form1.cardChildPhones"
|
||||
placeholder="请输入子卡手机号"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="openSubCard1 = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitSubCard">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -715,7 +789,14 @@ import pointsRecord from "@/views/member/userInfoOrder/pointsRecord.vue";
|
||||
import couponList from "@/views/member/userInfoOrder/couponList.vue";
|
||||
import growthValueRecord from "@/views/member/userInfoOrder/growthValueRecord.vue";
|
||||
import refuelMoneyRecord from "@/views/member/userInfoOrder/refuelMoneyRecord.vue";
|
||||
import cardValueChild from "@/views/member/userInfoOrder/cardValueChild.vue";
|
||||
import {allFixingLevel, getFixingLevel} from "@/api/staff/user/fixinglevel";
|
||||
import {
|
||||
addCardValueChild,
|
||||
cardValueChildInfo,
|
||||
editCardValueChild,
|
||||
listCardValueChild, listCardValueChildOrder
|
||||
} from "@/api/staff/user/cardvaluechild";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -727,15 +808,18 @@ export default {
|
||||
couponList,
|
||||
growthValueRecord,
|
||||
refuelMoneyRecord,
|
||||
cardValueChild,
|
||||
},
|
||||
computed: {
|
||||
item() {
|
||||
return item
|
||||
}
|
||||
},
|
||||
dicts: ['official', 'zhzt', 'zcrzdj', 'payment_type'],
|
||||
dicts: ['official', 'zhzt', 'zcrzdj', 'payment_type','pay_status'],
|
||||
data() {
|
||||
return {
|
||||
orderList:[],
|
||||
openSubCard1:false,
|
||||
baseUrl: process.env.VUE_APP_BASE_API,
|
||||
flag: null,
|
||||
fixingLevelList: [],
|
||||
@ -831,11 +915,13 @@ export default {
|
||||
tabOilType: '92',
|
||||
// 关于副卡信息
|
||||
aboutSecondCard: [],
|
||||
cardValueChildList:[],
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
id: '',
|
||||
// 会员信息
|
||||
form: {},
|
||||
form1: {},
|
||||
// 店铺信息
|
||||
store: '',
|
||||
// 会员等级信息
|
||||
@ -853,7 +939,13 @@ export default {
|
||||
name: '',
|
||||
status: '',
|
||||
},
|
||||
subCardList: [],
|
||||
subCardList:{
|
||||
page:1,
|
||||
pageSize:10,
|
||||
cardChildPhones:'',
|
||||
userId:'',
|
||||
status:''
|
||||
},
|
||||
list: [],
|
||||
// 表单校验
|
||||
rules: {
|
||||
@ -861,6 +953,8 @@ export default {
|
||||
name: [{required: true, message: "请输入会员昵称,内容不可为空", trigger: "blur"}],
|
||||
type: [{required: true, message: "请选择操作类型", trigger: "blur"}],
|
||||
fixingLevel: [{required: true, message: "请选择认证信息", trigger: "blur"}],
|
||||
userId:[{ required: true, message: '请选择主卡信息', trigger: 'change' }],
|
||||
cardChildPhones:[{required: true, message: "请输入子卡手机号", trigger: "blur"}],
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -875,8 +969,73 @@ export default {
|
||||
this.getInformation();
|
||||
this.getFixingLevelList();
|
||||
this.getStore();
|
||||
this.getCardList()
|
||||
this.getOrderList()
|
||||
},
|
||||
methods: {
|
||||
handleQuery(){
|
||||
this.subCardList.page = 1;
|
||||
this.getOrderList()
|
||||
},
|
||||
handleOrder(data){
|
||||
this.subCardList.cardChildPhones = data.cardChildPhones
|
||||
this.subCardActive = "consumption"
|
||||
this.subCardList.page = 1;
|
||||
this.getOrderList()
|
||||
},
|
||||
// 查询子卡的交易信息
|
||||
getOrderList(){
|
||||
this.subCardList.userId = this.id
|
||||
listCardValueChildOrder(this.subCardList).then(res => {
|
||||
this.orderList = res.data.records
|
||||
this.total = res.data.total
|
||||
})
|
||||
},
|
||||
// 查询当前用户的子卡信息
|
||||
getCardList(){
|
||||
listCardValueChild(this.id).then(res => {
|
||||
this.cardValueChildList = res.data
|
||||
})
|
||||
},
|
||||
handleAdd1(){
|
||||
this.title = "添加子卡信息"
|
||||
this.openSubCard1 = true
|
||||
},
|
||||
handleUpdate1(data){
|
||||
cardValueChildInfo(data.id).then(res => {
|
||||
this.form1 = res.data
|
||||
this.title = "修改子卡信息"
|
||||
this.openSubCard1 = true
|
||||
})
|
||||
},
|
||||
// 添加或修改子卡信息
|
||||
submitSubCard(){
|
||||
this.$refs["form1"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form1.id) {
|
||||
editCardValueChild(this.form1).then(res => {
|
||||
if (res.data==1){
|
||||
this.$modal.msgSuccess("修改成功!")
|
||||
this.openSubCard1 = false
|
||||
this.getCardList()
|
||||
}else {
|
||||
this.$modal.msgError("手机号已存在,请重新添加")
|
||||
}
|
||||
})
|
||||
}else {
|
||||
addCardValueChild(this.form1).then(res => {
|
||||
if (res.data.success=="添加成功!"){
|
||||
this.$modal.msgSuccess("添加成功!")
|
||||
this.openSubCard1 = false
|
||||
this.getCardList()
|
||||
}else {
|
||||
this.$modal.msgError(res.data.error)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
fixingLevelinfo(list, id) {
|
||||
let name = "";
|
||||
list.forEach(item => {
|
||||
@ -946,17 +1105,19 @@ export default {
|
||||
this.cardValueList.sort((a, b) => a.rechargeBalance - b.rechargeBalance);
|
||||
console.log("this.grade.name",this.grade)
|
||||
})
|
||||
console.log("this.cardValueList", this.grade)
|
||||
|
||||
if (this.cardValueList.length > 0) {
|
||||
// 过滤
|
||||
if (this.grade && this.grade.name) {
|
||||
this.cardValueList = this.cardValueList.filter(item => {
|
||||
return item.membershipLevel.includes(this.grade.name);
|
||||
return item.groupOriented === "1" || item.membershipLevel.includes(this.grade.id);
|
||||
});
|
||||
console.log("this.cardValueList", this.cardValueList)
|
||||
this.rechargeCard(0);
|
||||
} else {
|
||||
this.cardValueList = []
|
||||
this.cardValueList = this.cardValueList.filter(item => {
|
||||
return item.groupOriented === "1";
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -967,7 +1128,7 @@ export default {
|
||||
|
||||
console.log("data17.16", this.cardValueForm.amount)
|
||||
if (!data) {
|
||||
this.cardValueForm.amount = 0
|
||||
this.cardValueForm.amount = ''
|
||||
|
||||
} else {
|
||||
this.cardValueForm.amount = data
|
||||
@ -1012,6 +1173,7 @@ export default {
|
||||
const commissionAmount = totalAmount.multipliedBy(percentageCommissions).dividedBy(100).decimalPlaces(2);
|
||||
this.cardValueForm.amountCommission = commissionAmount
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -1075,7 +1237,7 @@ export default {
|
||||
},
|
||||
// 根据油品过滤查询存油卡
|
||||
async tabOilTypeClick(data) {
|
||||
// console.log("aaaaaaaaaaaaaa",data)
|
||||
console.log("aaaaaaaaaaaaaa",data)
|
||||
await this.getCardFuelDieselList()
|
||||
|
||||
this.cardFuelDieselList = this.sourceCardFuelDieselList.filter(item => {
|
||||
@ -1087,7 +1249,8 @@ export default {
|
||||
},
|
||||
selectOilType(status, oilType) {
|
||||
this.tabOilType = oilType;
|
||||
this.tabOilTypeClick(status);
|
||||
console.log("453",oilType)
|
||||
this.tabOilTypeClick(oilType);
|
||||
},
|
||||
// 查询员工
|
||||
|
||||
@ -1109,7 +1272,7 @@ export default {
|
||||
this.flag = flag
|
||||
|
||||
if (flag === 1) {
|
||||
if (this.cardValueForm.paymentType == '') {
|
||||
if (this.cardValueForm.paymentType === '') {
|
||||
this.$message.error('请选择支付方式');
|
||||
return
|
||||
}
|
||||
@ -1125,7 +1288,7 @@ export default {
|
||||
this.realyPayBills = this.cardValueForm.rechargeBalance
|
||||
}
|
||||
} else if (flag === 2) {
|
||||
if (this.cardFuelDieselForm.paymentType == '') {
|
||||
if (this.cardFuelDieselForm.paymentType === '') {
|
||||
this.$message.error('请选择支付方式');
|
||||
return
|
||||
}
|
||||
@ -1239,12 +1402,15 @@ export default {
|
||||
let file = {}
|
||||
// 拿到金额
|
||||
file = this.cardFuelDieselList[index]
|
||||
console.log("file",file)
|
||||
this.cardFuelDieselForm.points = file.points
|
||||
this.cardFuelDieselForm.rechargeBalance = file.rechargeBalance
|
||||
this.cardFuelDieselForm.oilType = file.oilType
|
||||
this.cardFuelDieselForm.type = file.type
|
||||
this.cardFuelDieselForm.chainStorId = file.chainStorId
|
||||
this.cardFuelDieselForm.incomeLitres = file.incomeLitres
|
||||
this.cardFuelDieselForm.lockupPrice = file.lockupPrice
|
||||
this.cardFuelDieselForm.cardFuelId = file.id
|
||||
|
||||
// this.realyPayBills = file.rechargeBalance
|
||||
|
||||
@ -1254,12 +1420,11 @@ export default {
|
||||
|
||||
let userForm = this.form
|
||||
|
||||
if (!this.authCode && this.cardValueForm.paymentType != "CASH") {
|
||||
if (this.flag === 1) {
|
||||
if (!this.authCode && this.cardValueForm.paymentType !== "CASH") {
|
||||
this.$message.error('请先扫码');
|
||||
return
|
||||
}
|
||||
|
||||
if (this.flag === 1) {
|
||||
// 会员id 会员名字会员手机号码
|
||||
this.cardValueForm.mtUserId = userForm.id
|
||||
this.cardValueForm.name = userForm.name
|
||||
@ -1274,33 +1439,30 @@ export default {
|
||||
if (response.data != null) {
|
||||
this.loading = true;
|
||||
id = response.data.id
|
||||
// if (response.data.payStatus == "paid"){
|
||||
// this.isPaySuccess = true;
|
||||
// }
|
||||
}
|
||||
});
|
||||
let this_ = this
|
||||
//
|
||||
let timer = setInterval(async () => {
|
||||
getCheckTheStatusOfYourPaymentApi(id).then(response => {
|
||||
await getCheckTheStatusOfYourPaymentApi(id).then(response => {
|
||||
if (response.data != null) {
|
||||
if (response.data.payStatus == "unpaid") {
|
||||
const payStatus = response.data.payStatus
|
||||
if (payStatus === "unpaid") {
|
||||
this_.isQuery = true;
|
||||
}
|
||||
if (response.data.payStatus == "paid") {
|
||||
}else if (payStatus === "paid") {
|
||||
// 当支付成功时
|
||||
this_.isPaySuccess = true;
|
||||
this_.isQuery = false;
|
||||
}
|
||||
if (response.data.payStatus == "payFail") {
|
||||
}else if (payStatus === "payFail") {
|
||||
this_.isPaySuccess = false;
|
||||
this_.isQuery = false;
|
||||
}
|
||||
}
|
||||
})
|
||||
}, 500);
|
||||
}, 1000);
|
||||
|
||||
let timer2 = setInterval(function () {
|
||||
if (this_.isQuery == false) {
|
||||
if (!this_.isQuery) {
|
||||
this_.loading = false;
|
||||
this_.isPay = false;
|
||||
clearInterval(timer);
|
||||
@ -1315,14 +1477,19 @@ export default {
|
||||
this_.loading = false;
|
||||
this_.isPay = false;
|
||||
this.isPaySuccess = false;
|
||||
|
||||
}, 30000)
|
||||
|
||||
} else if (this.flag === 2) {
|
||||
// console.log("cardFuelDieselForm",this.cardFuelDieselForm)
|
||||
if (!this.authCode && this.cardFuelDieselForm.paymentType !== "CASH") {
|
||||
this.$message.error('请先扫码');
|
||||
return
|
||||
}
|
||||
console.log("cardFuelDieselForm",this.cardFuelDieselForm)
|
||||
this.cardFuelDieselForm.mtUserId = userForm.id
|
||||
this.cardFuelDieselForm.name = userForm.name
|
||||
this.cardFuelDieselForm.mobile = userForm.mobile
|
||||
this.cardFuelDieselForm.authCode = this.authCode
|
||||
console.log("this.cardFuelDieselForm",this.cardFuelDieselForm)
|
||||
|
||||
|
||||
let id;
|
||||
@ -1376,6 +1543,7 @@ export default {
|
||||
|
||||
},
|
||||
|
||||
// 获取支付列表
|
||||
getPayList() {
|
||||
// console.log("payment_type1")
|
||||
getDicts("payment_type").then(response => {
|
||||
|
@ -43,14 +43,23 @@
|
||||
<div v-else>
|
||||
<el-table ref="tables2" v-loading="loading" :data="fuelList">
|
||||
<el-table-column align="center" label="所属油站" prop="storeName"/>
|
||||
<el-table-column align="center" label="变动账户" prop="oilType" />
|
||||
<el-table-column label="类型" align="center" prop="changeType">
|
||||
<el-table-column align="center" label="油品" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.changeType == 0">减少</el-tag>
|
||||
<el-tag type="success" v-else>增加</el-tag>
|
||||
-<span>{{scope.row.type?scope.row.type:' -- '}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类型" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.changeType === '0'">减少</el-tag>
|
||||
<el-tag type="success" v-else-if="scope.row.changeType === '1' ">增加</el-tag>
|
||||
<el-tag type="success" v-else>--</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="变动升数" align="center" prop="balance">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.balance?scope.row.balance:"--"}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="变动升数" align="center" prop="balance"/>
|
||||
<el-table-column label="订单号" align="center" prop="orderNo"/>
|
||||
<el-table-column label="描述" align="center" prop="fromType"/>
|
||||
<el-table-column label="变动时间" align="center" prop="createTime"/>
|
||||
|
300
fuintAdmin/src/views/member/userInfoOrder/cardValueChild.vue
Normal file
300
fuintAdmin/src/views/member/userInfoOrder/cardValueChild.vue
Normal file
@ -0,0 +1,300 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-tabs v-model="subCardActive" @tab-click="handleClick">
|
||||
<el-tab-pane label="子卡管理" name="subCardManage">
|
||||
<div style="display: flex;justify-content: space-between;margin: 10px 0">
|
||||
<div style="font-size: 16px">会员信息:{{form.mobile}}</div>
|
||||
<el-button type="primary" :disabled="cardValueChildList.length>=2" @click="handleAdd1">新增子卡</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-table ref="tables" v-loading="loading" :data="cardValueChildList">
|
||||
<el-table-column label="子卡ID" prop="id" align="center" width="60"/>
|
||||
<el-table-column label="子卡手机号" prop="cardChildPhones" align="center"/>
|
||||
<el-table-column label="创建时间" align="center" width="160" prop="createTime">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" fixed='right'>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate1(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-document"
|
||||
@click="handleOrder(scope.row)"
|
||||
>交易记录</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- <pagination-->
|
||||
<!-- :total="total"-->
|
||||
<!-- :page.sync="queryParams.page"-->
|
||||
<!-- :limit.sync="queryParams.pageSize"-->
|
||||
<!-- @pagination="getList"-->
|
||||
<!-- />-->
|
||||
</div>
|
||||
<el-alert
|
||||
title="关于子卡"
|
||||
type="info"
|
||||
style="margin-top: 20px"
|
||||
:closable="false"
|
||||
description="子卡为会员子母卡功能,子卡共享母卡的储值额度及信息,子卡为实体会员卡信息,消费需在小程序中才可进行使用">
|
||||
</el-alert>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="子卡消费记录" name="consumption">
|
||||
<div style="display: flex;justify-content: space-between;margin: 10px 0">
|
||||
<div style="font-size: 16px">
|
||||
<el-form :model="subCardList" ref="queryForm" size="small" :inline="true" label-width="85px">
|
||||
<el-form-item label="子卡手机号" prop="cardChildPhones">
|
||||
<el-input
|
||||
v-model="subCardList.cardChildPhones"
|
||||
placeholder="请输入子卡手机号"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付状态" prop="status">
|
||||
<el-select
|
||||
v-model="subCardList.status"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.pay_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<el-table ref="tables" v-loading="loading" :data="orderList">
|
||||
<el-table-column type="expand">
|
||||
<template slot-scope="props">
|
||||
<el-form label-position="left" class="demo-table-expand" style="margin-left: 20px">
|
||||
<el-form-item label="备注信息">
|
||||
<span>{{ props.row.remark }}</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="ID" prop="id" align="center" width="60"/>
|
||||
<el-table-column label="子卡手机号" prop="cardChildPhones" align="center" />
|
||||
<el-table-column label="订单号" prop="orderNo" align="center" />
|
||||
<el-table-column label="订单金额" prop="amount" align="center" />
|
||||
<el-table-column label="消费金额" prop="payAmount" align="center" />
|
||||
<el-table-column label="支付状态" prop="status" align="center" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.pay_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="支付时间" prop="payTime" align="center" >
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.payTime ? parseTime(scope.row.payTime) :"--" }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="subCardList.page"
|
||||
:limit.sync="subCardList.pageSize"
|
||||
@pagination="getOrderList"
|
||||
/>
|
||||
</div>
|
||||
<el-alert
|
||||
title="关于子卡"
|
||||
type="info"
|
||||
style="margin-top: 20px"
|
||||
:closable="false"
|
||||
description="当前会员的所有子卡消费记录信息,可根据对应子卡卡号进行检索查询">
|
||||
</el-alert>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<el-dialog :title="title" :visible.sync="openSubCard1" width="30%">
|
||||
<el-form ref="form1" :model="form1" :rules="rules" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="主卡信息" prop="userId" style="width: 420px">
|
||||
<el-select
|
||||
v-model="form1.userId"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
disabled
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
:label="form.mobile"
|
||||
:value="form.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="子卡手机号" prop="cardChildPhones" style="width: 420px">
|
||||
<el-input
|
||||
v-model.number="form1.cardChildPhones"
|
||||
placeholder="请输入子卡手机号"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="openSubCard1 = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitSubCard">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getUser} from "@/api/staff/user/user";
|
||||
import {
|
||||
addCardValueChild,
|
||||
cardValueChildInfo, editCardValueChild,
|
||||
listCardValueChild,
|
||||
listCardValueChildOrder
|
||||
} from "@/api/staff/user/cardvaluechild";
|
||||
|
||||
export default {
|
||||
props:["pUserId"],
|
||||
dicts:['pay_status'],
|
||||
data(){
|
||||
return{
|
||||
subCardActive:'subCardManage',
|
||||
form:{},
|
||||
form1:{
|
||||
userId:this.pUserId
|
||||
},
|
||||
loading:false,
|
||||
total:0,
|
||||
queryParams:{
|
||||
page:1,
|
||||
pageSize:10,
|
||||
},
|
||||
cardValueChildList:[],
|
||||
userId:"",
|
||||
subCardList: {
|
||||
page:1,
|
||||
pageSize:10,
|
||||
cardChildPhones:'',
|
||||
status:''
|
||||
},
|
||||
orderList:[],
|
||||
title:"",
|
||||
openSubCard1:false,
|
||||
rules:{
|
||||
userId:[{ required: true, message: '请选择主卡信息', trigger: 'change' }],
|
||||
cardChildPhones:[{required: true, message: "请输入子卡手机号", trigger: "blur"}],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.userId = this.$route.query.id;
|
||||
|
||||
this.getUser()
|
||||
this.getCardList()
|
||||
this.getOrderList()
|
||||
},
|
||||
methods:{
|
||||
// 获取当前会员信息
|
||||
getUser(){
|
||||
getUser(this.userId).then(response => {
|
||||
this.form = response.data
|
||||
})
|
||||
},
|
||||
// 查询当前用户的子卡信息
|
||||
getCardList(){
|
||||
listCardValueChild(this.userId).then(res => {
|
||||
this.cardValueChildList = res.data
|
||||
})
|
||||
},
|
||||
// 查询子卡的交易信息
|
||||
getOrderList(){
|
||||
listCardValueChildOrder(this.subCardList).then(res => {
|
||||
this.orderList = res.data.records
|
||||
this.total = res.data.total
|
||||
})
|
||||
},
|
||||
handleAdd1(){
|
||||
// this.title = "添加子卡信息"
|
||||
// this.openSubCard1 = true
|
||||
this.$emit("handleAdd")
|
||||
},
|
||||
handleUpdate1(data){
|
||||
// cardValueChildInfo(data.id).then(res => {
|
||||
// this.form1 = res.data
|
||||
// this.title = "修改子卡信息"
|
||||
// this.openSubCard1 = true
|
||||
// })
|
||||
this.$emit("handleUpdate")
|
||||
},
|
||||
// 添加或修改子卡信息
|
||||
submitSubCard(){
|
||||
this.$refs["form1"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form1.id) {
|
||||
editCardValueChild(this.form1).then(res => {
|
||||
if (res.data==1){
|
||||
this.$modal.msgSuccess("修改成功!")
|
||||
this.openSubCard1 = false
|
||||
this.getCardList()
|
||||
}else {
|
||||
this.$modal.msgError("手机号已存在,请重新添加")
|
||||
}
|
||||
})
|
||||
}else {
|
||||
addCardValueChild(this.form1).then(res => {
|
||||
if (res.data.success=="添加成功!"){
|
||||
this.$modal.msgSuccess("添加成功!")
|
||||
this.openSubCard1 = false
|
||||
this.getCardList()
|
||||
}else {
|
||||
this.$modal.msgError(res.data.error)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
handleOrder(data){
|
||||
this.subCardList.cardChildPhones = data.cardChildPhones
|
||||
this.subCardActive = "consumption"
|
||||
this.subCardList.page = 1;
|
||||
this.getOrderList()
|
||||
},
|
||||
handleQuery(){
|
||||
this.subCardList.page = 1;
|
||||
this.getOrderList()
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
// console.log(tab, event);
|
||||
// this.refStaff()
|
||||
// this.realyPayBills = 0
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
@ -779,9 +779,17 @@ export default {
|
||||
this.form.naturalGasRule = JSON.stringify(this.naturalGasPreferential)
|
||||
if (this.form.id) {
|
||||
updateUserGrade(this.form).then(response => {
|
||||
if (response.data==1) {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}else if (response.data==2) {
|
||||
this.$modal.msgError("修改失败,已存在当前等级的会员等级信息");
|
||||
}else if (response.data==3) {
|
||||
this.$modal.msgError("修改失败,会员等级名称已存在");
|
||||
}else {
|
||||
this.$modal.msgError("修改失败,已存在当前成长值的会员等级");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
queryUserGrade({name:this.form.name}).then( response => {
|
||||
|
@ -133,6 +133,8 @@ public class CardFuelRecord extends BaseEntity {
|
||||
*/
|
||||
private String oilName;
|
||||
|
||||
private String status; //订单处理状态(防止二次执行,0是订单未完成,1是订单完成不可重复执行)
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -132,6 +132,7 @@
|
||||
select
|
||||
ms.name storeName,
|
||||
cfc.oil_type oilType,
|
||||
cfc.type type,
|
||||
cfc.change_type changeType,
|
||||
cfc.balance balance,
|
||||
cfc.order_no orderNo,
|
||||
@ -151,8 +152,8 @@
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into card_fuel_change(user_id, chain_store_id, store_id, change_type, from_type, balance, create_time, create_by, update_time, update_by, type, oil_type, unit)
|
||||
values (#{userId}, #{chainStoreId}, #{storeId}, #{changeType}, #{fromType}, #{balance}, #{createTime}, #{createBy}, #{updateTime}, #{updateBy}, #{type}, #{oilType}, #{unit})
|
||||
insert into card_fuel_change(user_id, chain_store_id, store_id, change_type, from_type, balance, create_time, create_by, update_time, update_by, type, oil_type, unit,order_no)
|
||||
values (#{userId}, #{chainStoreId}, #{storeId}, #{changeType}, #{fromType}, #{balance}, #{createTime}, #{createBy}, #{updateTime}, #{updateBy}, #{type}, #{oilType}, #{unit},#{orderNo})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
|
@ -35,7 +35,7 @@
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="CardFuelRecordMap">
|
||||
select
|
||||
id, mt_user_id, name, mobile, mt_staff_id, real_name, staff_mobile, card_fuel_id, recharge_balance, income_litres, payment_type, remark, points, growth_value, royalty_type, percentage_commissions, amount_commission, create_by, create_time, update_by, update_time, pay_status, store_id, payment_no, type, oil_type, chain_store_id
|
||||
id, mt_user_id, name, mobile, mt_staff_id, real_name, staff_mobile, card_fuel_id, recharge_balance, income_litres, payment_type, remark, points, growth_value, royalty_type, percentage_commissions, amount_commission, create_by, create_time, update_by, update_time, pay_status, store_id, payment_no, type, oil_type, chain_store_id,status
|
||||
from card_fuel_record
|
||||
where id = #{id}
|
||||
</select>
|
||||
@ -217,7 +217,7 @@
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into card_fuel_record(mt_user_id, name, mobile, mt_staff_id, real_name, staff_mobile, card_fuel_id, recharge_balance,lockup_price, income_litres,pay_amount, payment_type, remark, points, growth_value, royalty_type, percentage_commissions, amount_commission, create_by, create_time, update_by, update_time, pay_status, store_id, payment_no, type, oil_type,oil_name,chain_store_id)
|
||||
values (#{mtUserId}, #{name}, #{mobile}, #{mtStaffId}, #{realName}, #{staffMobile}, #{cardFuelId}, #{rechargeBalance}, #{lockupPrice}, #{incomeLitres}, #{payAmount}, #{paymentType}, #{remark}, #{points}, #{growthValue}, #{royaltyType}, #{percentageCommissions}, #{amountCommission}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{payStatus}, #{storeId}, #{paymentNo}, #{type}, #{oilType},#{oilName}, #{chainStoreId})
|
||||
values (#{mtUserId}, #{name}, #{mobile}, #{mtStaffId}, #{realName}, #{staffMobile}, #{cardFuelId}, #{rechargeBalance}, #{lockupPrice}, #{incomeLitres}, #{payAmount}, #{paymentType}, #{remark}, #{points}, #{growthValue}, #{royaltyType}, #{percentageCommissions}, #{amountCommission}, #{createBy}, #{createTime}, #{updateBy}, #{createTime}, #{payStatus}, #{storeId}, #{paymentNo}, #{type}, #{oilType},#{oilName}, #{chainStoreId})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
@ -266,6 +266,7 @@
|
||||
<update id="update">
|
||||
update card_fuel_record
|
||||
<set>
|
||||
update_time = NOW(),
|
||||
<if test="mtUserId != null">
|
||||
mt_user_id = #{mtUserId},
|
||||
</if>
|
||||
@ -323,9 +324,6 @@
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="payStatus != null and payStatus != ''">
|
||||
pay_status = #{payStatus},
|
||||
</if>
|
||||
@ -341,6 +339,10 @@
|
||||
<if test="oilType != null and oilType != ''">
|
||||
oil_type = #{oilType},
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
status = #{status},
|
||||
</if>
|
||||
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.marketingActivity.cardFule.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelChange;
|
||||
@ -67,8 +68,11 @@ public class CardFuelChangeServiceImpl implements CardFuelChangeService {
|
||||
*/
|
||||
@Override
|
||||
public CardFuelChange insert(CardFuelChange cardFuelChange) {
|
||||
if (ObjectUtil.isEmpty(cardFuelChange.getStoreId())) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
cardFuelChange.setStoreId(nowAccountInfo.getStoreId());
|
||||
}
|
||||
|
||||
this.cardFuelChangeMapper.insert(cardFuelChange);
|
||||
return cardFuelChange;
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ public class CardFuelDieselServiceImpl extends ServiceImpl<CardFuelDieselMapper,
|
||||
//返回囤油卡状态
|
||||
for (CardFuelDiesel record : records) {
|
||||
if (ObjectUtils.isNotEmpty(record.getOilType())){
|
||||
record.setOilType(oilNameService.selectOilNameById(Integer.parseInt(record.getOilType())).getOilName());
|
||||
record.setType(record.getType()+" "+oilNameService.selectOilNameById(Integer.parseInt(record.getOilType())).getOilName());
|
||||
}
|
||||
record.setStatus(record.getStatus().equals("1") ? "true" : "false");
|
||||
if(ObjectUtils.isNotEmpty(record.getActiveTime()) && "1".equals(record.getActiveTime())){
|
||||
|
@ -45,6 +45,7 @@ import com.fuint.business.userManager.entity.UserBalance;
|
||||
import com.fuint.business.userManager.mapper.LJUserMapper;
|
||||
import com.fuint.business.userManager.service.UserBalanceService;
|
||||
import com.fuint.business.userManager.vo.LJUserVo;
|
||||
import com.fuint.common.util.RedisLock;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -58,6 +59,7 @@ import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 燃油充值表(CardFuelRecord)表服务实现类
|
||||
@ -168,6 +170,8 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
||||
return i>0;
|
||||
}
|
||||
|
||||
@Resource
|
||||
ILJStaffService iljStaffService;
|
||||
@Override
|
||||
public CardFuelRecordDTO prepaidFuelTopUp(CardFuelRecordDTO cardFuelRecordDTO) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
@ -186,18 +190,29 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
||||
cardFuelRecordDTO.setPaymentNo(orderNo);
|
||||
cardFuelRecordDTO.setStoreId(nowAccountInfo.getStoreId());
|
||||
cardFuelRecordDTO.setChainStoreId(nowAccountInfo.getChainStoreId());
|
||||
cardFuelRecordDTO.setPayAmount(cardFuelRecordDTO.getRechargeBalance());
|
||||
|
||||
if (ObjectUtil.isEmpty(cardFuelRecordDTO.getMtStaffId())) {
|
||||
cardFuelRecordDTO.setMtStaffId(nowAccountInfo.getStaffId());
|
||||
}
|
||||
|
||||
LJStaff ljStaff = iljStaffService.selectStaffById(cardFuelRecordDTO.getMtStaffId());
|
||||
if (ObjectUtil.isNotEmpty(ljStaff)) {
|
||||
cardFuelRecordDTO.setStaffMobile(ljStaff.getMobile());
|
||||
cardFuelRecordDTO.setRealName(ljStaff.getRealName());
|
||||
}
|
||||
|
||||
cardFuelRecordMapper.insert(cardFuelRecordDTO);
|
||||
Double theAmountToBePaid = 0.0;
|
||||
double theAmountToBePaid = 0.0;
|
||||
|
||||
boolean flag = false;
|
||||
System.out.println("cardFuelRecordDTO.getRechargeBalance():"+cardFuelRecordDTO.getRechargeBalance());
|
||||
|
||||
double epsilon = 1e-10; // 阈值
|
||||
if (!ObjectUtil.isEmpty(cardFuelRecordDTO.getRechargeBalance())
|
||||
&& cardFuelRecordDTO.getRechargeBalance() > epsilon
|
||||
// && cardFuelRecordDTO.getRechargeBalance() > epsilon
|
||||
&& cardFuelRecordDTO.getRechargeBalance().compareTo(0.00)>0
|
||||
&& "unpaid".equals(cardFuelRecordDTO.getPayStatus())){
|
||||
theAmountToBePaid = cardFuelRecordDTO.getRechargeBalance();
|
||||
theAmountToBePaid = cardFuelRecordDTO.getRechargeBalance().doubleValue();
|
||||
flag = true;
|
||||
}
|
||||
|
||||
@ -206,8 +221,6 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
||||
Integer allAmount = (int) (theAmountToBePaid*100);
|
||||
System.out.println("allAmount1:"+allAmount);
|
||||
|
||||
// Integer allAmount = (int) (0.01 * 100);
|
||||
|
||||
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(nowAccountInfo.getStoreId());
|
||||
// 处理支付需要的数据
|
||||
Map<String, String> map = new HashMap<>();
|
||||
@ -232,10 +245,22 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
||||
return cardFuelRecordDTO;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private RedisLock redisLock;
|
||||
|
||||
/**
|
||||
* 查询支付状态 修改相关关联表
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public CardFuelRecord checkTheStatusOfYourPaymentByFuel(Integer id) {
|
||||
CardFuelRecord cardFuelRecord = cardFuelRecordMapper.queryById(id);
|
||||
if ("paid".equals(cardFuelRecord.getPayStatus())){
|
||||
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
String lockKey = "CardFuelRecord"+nowAccountInfo.getStoreId()+id;
|
||||
Boolean isLock = redisLock.tryLock(lockKey, 5000, TimeUnit.MILLISECONDS);
|
||||
if (isLock && "paid".equals(cardFuelRecord.getPayStatus()) && "0".equals(cardFuelRecord.getStatus())){
|
||||
// 查询用户信息
|
||||
LJUserVo ljUserVos = ljUserMapper.selectAllInfoById2(cardFuelRecord.getMtUserId(),cardFuelRecord.getChainStoreId());
|
||||
|
||||
@ -255,6 +280,13 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
||||
IntegralDetail integralDetail = changesInPoints(cardFuelRecord,ljUserVos);
|
||||
integralDetailService.insert2(integralDetail);
|
||||
}
|
||||
|
||||
CardFuelRecord editCardFuelRecord = new CardFuelRecord();
|
||||
editCardFuelRecord.setId(id);
|
||||
editCardFuelRecord.setStatus("1");
|
||||
cardFuelRecordMapper.update(editCardFuelRecord);
|
||||
redisLock.unlock(lockKey);
|
||||
|
||||
}else {
|
||||
return cardFuelRecord;
|
||||
}
|
||||
@ -265,9 +297,9 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
||||
List<Map<String, String>> refuelMoneyList = new ArrayList<>();
|
||||
UserBalance userBalance = new UserBalance();
|
||||
userBalance.setId(ljUserVos.getBalanceId());
|
||||
if (ObjectUtil.isEmpty(ljUserVos.getRefuelMoney())) {
|
||||
if (ObjectUtil.isEmpty(ljUserVos.getRefuelMoney()) || ljUserVos.getRefuelMoney().length() < 6) {
|
||||
// 判断是否存在加油卡
|
||||
Map<String, String> refuelMoney = new HashMap<>();
|
||||
// todo 目前没有用id
|
||||
// refuelMoney.put("oilNumberId",cardFuelRecord.getOilNumberId().toString());
|
||||
// refuelMoney.put("oilNameId",cardFuelRecord.getType());
|
||||
refuelMoney.put("type",cardFuelRecord.getType());
|
||||
@ -321,6 +353,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
||||
cardFuelChange.setBalance(cardFuelRecord.getIncomeLitres());
|
||||
cardFuelChange.setType(cardFuelRecord.getType());
|
||||
cardFuelChange.setOilType(cardFuelRecord.getOilType());
|
||||
cardFuelChange.setOrderNo(cardFuelRecord.getPaymentNo());
|
||||
return cardFuelChange;
|
||||
}
|
||||
|
||||
@ -333,6 +366,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
||||
BigDecimal bigPoints = new BigDecimal(cardFuelRecord.getPoints());
|
||||
BigDecimal addPoints = bigPoints.add(new BigDecimal(ljUserVos.getPoints()));
|
||||
|
||||
integralDetail.setCurrentPoints(addPoints.intValue());
|
||||
integralDetail.setCurrentPoints(addPoints.intValue());
|
||||
integralDetail.setChangeReason("购买油卡赠送");
|
||||
integralDetail.setStoreId(cardFuelRecord.getStoreId());
|
||||
|
@ -327,7 +327,8 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
|
||||
theAmountToBePaid = cardValueRecordDTO.getRealyPayBills();
|
||||
flag = true;
|
||||
}
|
||||
// todo
|
||||
Integer allAmount1 = (int) (theAmountToBePaid*100);
|
||||
System.out.println("allAmount123:"+allAmount1);
|
||||
if (flag) {
|
||||
Integer allAmount = (int) (theAmountToBePaid*100);
|
||||
System.out.println("allAmount1:"+allAmount);
|
||||
@ -436,7 +437,10 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
|
||||
CardValueRecord updateCardValueRecord = new CardValueRecord();
|
||||
updateCardValueRecord.setId(id);
|
||||
updateCardValueRecord.setStatus("1");
|
||||
cardValueRecord.setStatus("1");
|
||||
baseMapper.updateById(updateCardValueRecord);
|
||||
|
||||
redisLock.unlock(lockKey);
|
||||
} else {
|
||||
return cardValueRecord;
|
||||
}
|
||||
|
@ -71,7 +71,26 @@ public class CardValudChildrensController extends BaseController {
|
||||
*/
|
||||
@GetMapping("/list/{storeId}")
|
||||
public ResponseObject list(@PathVariable Integer storeId){
|
||||
return getSuccessResult(cardValudChildrensService.selectCardValudChildrensByUserId(storeId));
|
||||
return getSuccessResult(cardValudChildrensService.selectCardValudChildrensByUserId(null,storeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户id查询子卡列表信息
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/listPC/{userId}")
|
||||
public ResponseObject list1(@PathVariable Integer userId){
|
||||
return getSuccessResult(cardValudChildrensService.selectCardValudChildrensByUserIdAndStoreId(userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改子卡信息
|
||||
* @param cardValudChildrens
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/edit")
|
||||
public ResponseObject edit(@RequestBody CardValudChildrens cardValudChildrens){
|
||||
return getSuccessResult(cardValudChildrensService.edit(cardValudChildrens));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -22,10 +22,23 @@ public interface CardValudChildrensService extends IService<CardValudChildrens>
|
||||
Map<String,String> add(CardValudChildrens cardValudChildrens);
|
||||
|
||||
/**
|
||||
* 查询当前用户的子卡信息
|
||||
* 修改数据
|
||||
* @param cardValudChildrens
|
||||
* @return
|
||||
*/
|
||||
List<CardValudChildrens> selectCardValudChildrensByUserId(Integer storeId);
|
||||
int edit(CardValudChildrens cardValudChildrens);
|
||||
|
||||
/**
|
||||
* 查询当前用户的子卡信息 小程序
|
||||
* @return
|
||||
*/
|
||||
List<CardValudChildrens> selectCardValudChildrensByUserId(Integer userId,Integer storeId);
|
||||
|
||||
/**
|
||||
* 查询当前用户的子卡信息 PC
|
||||
* @return
|
||||
*/
|
||||
List<CardValudChildrens> selectCardValudChildrensByUserIdAndStoreId(Integer userId);
|
||||
|
||||
/**
|
||||
* 根据店铺id和子卡手机号查询子卡信息
|
||||
|
@ -50,18 +50,26 @@ public class CardValudChildrensServiceImpl extends ServiceImpl<CardValudChildren
|
||||
@Override
|
||||
public Map<String,String> add(CardValudChildrens cardValudChildrens) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer storeId = cardValudChildrens.getStoreId();
|
||||
Integer userId = cardValudChildrens.getUserId();
|
||||
if (cardValudChildrens.getStoreId()==null){
|
||||
storeId = nowAccountInfo.getStoreId();
|
||||
}
|
||||
if (cardValudChildrens.getUserId()==null){
|
||||
userId = nowAccountInfo.getId();
|
||||
}
|
||||
Map<String,String> res = new HashMap<>();
|
||||
if (ObjectUtils.isNotEmpty(cardValudChildrens)){
|
||||
LJUser user = userService.queryUserByUserId(nowAccountInfo.getId());
|
||||
LJStore store = storeService.selectStoreByStoreId(cardValudChildrens.getStoreId());
|
||||
UserBalance balance = userBalanceService.selectUserBalance(nowAccountInfo.getId(), store.getChainStoreId());
|
||||
LJUser user = userService.queryUserByUserId(userId);
|
||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||
UserBalance balance = userBalanceService.selectUserBalance(userId, store.getChainStoreId());
|
||||
if (user.getMobile().equals(cardValudChildrens.getCardChildPhones())){
|
||||
res.put("error","添加失败,子卡手机号不能与主卡手机号一样!");
|
||||
return res;
|
||||
}
|
||||
cardValudChildrens.setCardValueId(balance.getId());
|
||||
|
||||
List<CardValudChildrens> list = this.selectCardValudChildrensByUserId(cardValudChildrens.getStoreId());
|
||||
List<CardValudChildrens> list = this.selectCardValudChildrensByUserId(userId,storeId);
|
||||
if (list.size()>=2){
|
||||
res.put("error","添加失败,最多只能添加两张子卡!");
|
||||
return res;
|
||||
@ -78,7 +86,8 @@ public class CardValudChildrensServiceImpl extends ServiceImpl<CardValudChildren
|
||||
res.put("error", "添加失败,此手机号已存在!");
|
||||
return res;
|
||||
}
|
||||
cardValudChildrens.setUserId(nowAccountInfo.getId());
|
||||
cardValudChildrens.setUserId(userId);
|
||||
cardValudChildrens.setStoreId(storeId);
|
||||
baseMapper.insert(cardValudChildrens);
|
||||
res.put("success", "添加成功!");
|
||||
}
|
||||
@ -87,10 +96,45 @@ public class CardValudChildrensServiceImpl extends ServiceImpl<CardValudChildren
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CardValudChildrens> selectCardValudChildrensByUserId(Integer storeId) {
|
||||
public int edit(CardValudChildrens cardValudChildrens) {
|
||||
int row = 0;
|
||||
boolean flag = false;
|
||||
String mobile = "";
|
||||
List<CardValudChildrens> list = this.selectCardValudChildrensByUserId(cardValudChildrens.getUserId(),cardValudChildrens.getStoreId());
|
||||
for (CardValudChildrens valudChildrens : list) {
|
||||
if (cardValudChildrens.getCardChildPhones().equals(valudChildrens.getCardChildPhones())){
|
||||
if (cardValudChildrens.getId()!=valudChildrens.getId()){
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
if (cardValudChildrens.getId()==valudChildrens.getId()){
|
||||
mobile = valudChildrens.getCardChildPhones();
|
||||
}
|
||||
}
|
||||
if (flag){
|
||||
row = 0;
|
||||
return row;
|
||||
}
|
||||
LJUser user = userService.selectUserByMobile(mobile);
|
||||
if (ObjectUtils.isNotEmpty(user)){
|
||||
user.setMobile(cardValudChildrens.getCardChildPhones());
|
||||
userService.updateById(user);
|
||||
}
|
||||
row = baseMapper.updateById(cardValudChildrens);
|
||||
return row;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CardValudChildrens> selectCardValudChildrensByUserId(Integer userId,Integer storeId) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
if (userId==null){
|
||||
userId = nowAccountInfo.getId();
|
||||
}
|
||||
if (storeId==null){
|
||||
storeId = nowAccountInfo.getStoreId();
|
||||
}
|
||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||
UserBalance balance = userBalanceService.selectUserBalance(nowAccountInfo.getId(), store.getChainStoreId());
|
||||
UserBalance balance = userBalanceService.selectUserBalance(userId, store.getChainStoreId());
|
||||
List<CardValudChildrens> list = null;
|
||||
if (ObjectUtils.isNotEmpty(balance)){
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
@ -101,6 +145,21 @@ public class CardValudChildrensServiceImpl extends ServiceImpl<CardValudChildren
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CardValudChildrens> selectCardValudChildrensByUserIdAndStoreId(Integer userId) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
LJStore store = storeService.selectStoreByStoreId(nowAccountInfo.getStoreId());
|
||||
UserBalance balance = userBalanceService.selectUserBalance(userId, store.getChainStoreId());
|
||||
List<CardValudChildrens> list = null;
|
||||
if (ObjectUtils.isNotEmpty(balance)){
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("card_value_id",balance.getId());
|
||||
queryWrapper.eq("store_id",nowAccountInfo.getStoreId());
|
||||
list = baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CardValudChildrens selectCardValueChildrenByMobileAndStoreId(String mobile, Integer storeId) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
|
@ -3,7 +3,8 @@
|
||||
<mapper namespace="com.fuint.business.order.mapper.CardValueChildOrderMapper">
|
||||
|
||||
<select id="selectCardValueChildOrderList" resultType="com.fuint.business.order.vo.CardValueChildOrderVo">
|
||||
select cvco.*,cvc.card_child_phones from card_value_child_order cvco left join card_valud_childrens cvc on cvco.card_value_child_id = cvc.id
|
||||
select cvco.*,cvc.card_child_phones from card_value_child_order cvco
|
||||
left join card_valud_childrens cvc on cvco.card_value_child_id = cvc.id
|
||||
<where>
|
||||
<if test="order.storeId != null and order.storeId != ''">
|
||||
and cvco.store_id = #{order.storeId}
|
||||
@ -11,6 +12,12 @@
|
||||
<if test="order.cardChildPhones != null and order.cardChildPhones != ''">
|
||||
and cvc.card_child_phones = #{order.cardChildPhones}
|
||||
</if>
|
||||
<if test="order.userId != null and order.userId != ''">
|
||||
and cvc.user_id = #{order.userId}
|
||||
</if>
|
||||
<if test="order.status != null and order.status != ''">
|
||||
and cvco.status = #{order.status}
|
||||
</if>
|
||||
order by cvco.pay_time desc
|
||||
</where>
|
||||
</select>
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.order.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;
|
||||
@ -14,6 +15,8 @@ import com.fuint.business.storeInformation.entity.LJStore;
|
||||
import com.fuint.business.storeInformation.service.ILJStoreService;
|
||||
import com.fuint.business.userManager.entity.LJUser;
|
||||
import com.fuint.business.userManager.service.LJUserService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -28,6 +31,13 @@ public class CardValueChildOrderServiceImpl extends ServiceImpl<CardValueChildOr
|
||||
|
||||
@Override
|
||||
public IPage<CardValueChildOrderVo> selectCardValueChildOrderList(Page page, CardValueChildOrderVo cardValueChildOrderVo) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
if (cardValueChildOrderVo.getStoreId()==null){
|
||||
cardValueChildOrderVo.setStoreId(nowAccountInfo.getStoreId());
|
||||
}
|
||||
if (cardValueChildOrderVo.getUserId()==null){
|
||||
cardValueChildOrderVo.setUserId(nowAccountInfo.getId());
|
||||
}
|
||||
return baseMapper.selectCardValueChildOrderList(page,cardValueChildOrderVo);
|
||||
}
|
||||
|
||||
@ -44,10 +54,15 @@ public class CardValueChildOrderServiceImpl extends ServiceImpl<CardValueChildOr
|
||||
LJStore store = storeService.selectStoreByStoreId(cardValueChildOrder.getStoreId());
|
||||
CardValudChildrens cardValudChildrens = cardValudChildrensService.selectCardValueChildrenByMobileAndStoreId(user.getMobile(), cardValueChildOrder.getStoreId());
|
||||
|
||||
int row = 0;
|
||||
|
||||
if (ObjectUtil.isNotEmpty(cardValudChildrens)){
|
||||
cardValueChildOrder.setCardValueId(cardValudChildrens.getCardValueId());
|
||||
cardValueChildOrder.setCardValueChildId(cardValudChildrens.getId());
|
||||
cardValueChildOrder.setChainStoreId(store.getChainStoreId());
|
||||
return baseMapper.insert(cardValueChildOrder);
|
||||
row =baseMapper.insert(cardValueChildOrder);
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -47,6 +47,7 @@ import com.fuint.business.userManager.service.LJUserService;
|
||||
import com.fuint.business.userManager.service.UserBalanceService;
|
||||
import com.fuint.business.userManager.vo.LJUserVo;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.StringUtils;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import com.fuint.system.config.service.SysConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -355,6 +356,10 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
order.setPayTime(new Date());
|
||||
this.addOilTrack(jsonObjects.get(i),storeId);
|
||||
}
|
||||
if (map.get("allAmount").equals("0")){
|
||||
order.setPayTime(new Date());
|
||||
order.setOrderStatus("paid");
|
||||
}
|
||||
baseMapper.insert(order);
|
||||
oilOrder1 = this.selectOilOrderByOrderNo(orderNo);
|
||||
}
|
||||
@ -404,7 +409,6 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
cashierOrder.setGoodsOrderId(goodsOrder1.getId());
|
||||
}
|
||||
cashierOrderService.insertCashierOrder(cashierOrder);
|
||||
// this.insertAllOrderInfo(orderNo,storeId,oilAmount,payType,userId,"PC");
|
||||
return orders;
|
||||
}
|
||||
|
||||
@ -420,16 +424,16 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
|
||||
if (!map.get("oilOrder").equals("[]")) {
|
||||
oilOrders = JSONArray.parseArray(map.get("oilOrder"), JSONObject.class);
|
||||
// 条码支付
|
||||
if (authCode.contains("19")) {
|
||||
String[] split = authCode.split("19");
|
||||
// 二维码支付
|
||||
if (authCode.contains("9E")) {
|
||||
String[] split = authCode.split("9E");
|
||||
// 获取用户id
|
||||
Integer userId = Integer.valueOf(split[1]);
|
||||
res = this.updateUserBalanceAndInsetOrder(userId,map,oilAmount,oilOrders,nowAccountInfo.getStoreId());
|
||||
}
|
||||
// 二维码支付
|
||||
if (authCode.contains("9E")) {
|
||||
String[] split = authCode.split("9E");
|
||||
// 条码支付
|
||||
if (authCode.contains("19") && authCode.matches("\\d+")) {
|
||||
String[] split = authCode.split("19");
|
||||
// 获取用户id
|
||||
Integer userId = Integer.valueOf(split[1]);
|
||||
res = this.updateUserBalanceAndInsetOrder(userId,map,oilAmount,oilOrders,nowAccountInfo.getStoreId());
|
||||
@ -529,15 +533,17 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
String oilType = ((JSONObject) refuelMoney).get("oilType").toString();
|
||||
Double refuelMoneyLiters = Double.valueOf(((JSONObject) refuelMoney).get("refuelMoney").toString());
|
||||
// 根据油品名称查询油品id
|
||||
OilName oilName = oilNameService.selectOilNameByOilName(oilType);
|
||||
OilName oilName = oilNameService.selectOilNameById(Integer.valueOf(oilType));
|
||||
OilOrder order = new OilOrder();
|
||||
OilOrder oilOrder = null;
|
||||
|
||||
// 添加收银台订单信息
|
||||
CashierOrder cashierOrder = new CashierOrder();
|
||||
boolean flag = false;
|
||||
for (int i = 0;i < oilOrders.size();i++) {
|
||||
if (oilOrders.get(i).get("oilName").equals(oilName.getId().toString())){
|
||||
if (refuelMoneyLiters>=Double.valueOf(oilOrders.get(i).get("liters").toString())){
|
||||
flag = true;
|
||||
Double amount = Double.valueOf(oilOrders.get(i).get("amount").toString());
|
||||
Double oilPrice = Double.valueOf(oilOrders.get(i).get("oilPrice").toString());
|
||||
Double oilNum = amount / oilPrice;
|
||||
@ -591,10 +597,11 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
}
|
||||
}
|
||||
|
||||
if (flag){
|
||||
cashierOrderService.insertCashierOrder(cashierOrder);
|
||||
// this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,map.get("payType"),userId,"applet");
|
||||
res.put("success","success");
|
||||
}
|
||||
}
|
||||
|
||||
}else {
|
||||
res.put("error","储值卡余额不足!");
|
||||
@ -646,8 +653,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
refuelMoney1.setRefuelMoney(((JSONObject) money).get("refuelMoney").toString());
|
||||
Double refuelMoneyLiters = Double.valueOf(((JSONObject) money).get("refuelMoney").toString());
|
||||
// 根据油品名称查询油品id
|
||||
OilName oilName = oilNameService.selectOilNameByOilName(((JSONObject) money).get("oilType").toString());
|
||||
if (oilName.getId().toString().equals(oilId.toString())){
|
||||
// OilName oilName = oilNameService.selectOilNameByOilName(((JSONObject) money).get("oilType").toString());
|
||||
if (((JSONObject) money).get("oilType").toString().equals(oilId.toString())){
|
||||
refuelMoney1.setRefuelMoney(String.valueOf(refuelMoney));
|
||||
}
|
||||
list.add(refuelMoney1);
|
||||
@ -978,7 +985,25 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||
UserBalance balance = userBalanceService.selectUserBalance(userid,store.getChainStoreId());
|
||||
int growth = balance.getGrowthValue();
|
||||
if (refuelMoney==null){
|
||||
String refuelMoney1 = balance.getRefuelMoney();
|
||||
if (StringUtils.isNotEmpty(refuelMoney1)){
|
||||
JSONArray objects = JSONArray.parseArray(refuelMoney1);
|
||||
List<RefuelMoney> list = new ArrayList<>();
|
||||
for (Object object : objects) {
|
||||
if (((JSONObject)object).get("oilType").toString().equals(oilId)){
|
||||
RefuelMoney refuelMoney2 = new RefuelMoney();
|
||||
refuelMoney2.setType(((JSONObject) object).get("type").toString());
|
||||
refuelMoney2.setOilType(((JSONObject) object).get("oilType").toString());
|
||||
refuelMoney2.setRefuelMoney("0");
|
||||
list.add(refuelMoney2);
|
||||
}
|
||||
}
|
||||
balance.setRefuelMoney(JSONObject.toJSONString(list));
|
||||
}
|
||||
}else {
|
||||
balance.setRefuelMoney(refuelMoney);
|
||||
}
|
||||
// 查询会员等级列表信息
|
||||
Page page = new Page(1,20);
|
||||
LJUserGrade ljUserGrade1 = new LJUserGrade();
|
||||
|
@ -185,8 +185,7 @@ public class LJUserController extends BaseController {
|
||||
@PostMapping("/name")
|
||||
public ResponseObject userVoByName(@Validated @RequestBody Map<String ,String > map){
|
||||
String name = map.get("name");
|
||||
List<LJUserVo> list = userService.queryUserByName(name);
|
||||
return getSuccessResult(list);
|
||||
return getSuccessResult(userService.queryUserByName(name));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -33,6 +33,9 @@ public class LJUserGrade extends BaseEntity implements Serializable {
|
||||
@TableId(value = "ID", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("连锁店ID")
|
||||
private Integer chainStoreId;
|
||||
|
||||
@ApiModelProperty("店铺ID")
|
||||
private Integer storeId;
|
||||
|
||||
|
@ -68,7 +68,7 @@ public interface LJUserMapper extends BaseMapper<LJUser> {
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public List<LJUserVo> selectUserByName(@Param("name") String name);
|
||||
public List<LJUserVo> selectUserByName(@Param("name") String name,@Param("chainStoreId") Integer chainStoreId);
|
||||
|
||||
/**
|
||||
* 统计信息
|
||||
|
@ -8,7 +8,7 @@
|
||||
<select id="selectUserGradeList" resultType="com.fuint.business.userManager.entity.LJUserGrade">
|
||||
<include refid="selectUserGrade"></include>
|
||||
<where>
|
||||
store_id = #{userGrade.storeId}
|
||||
chain_store_id = #{userGrade.chainStoreId}
|
||||
</where>
|
||||
order by grade
|
||||
</select>
|
||||
|
@ -67,9 +67,12 @@
|
||||
</select>
|
||||
<select id="selectUserByName" resultType="com.fuint.business.userManager.vo.LJUserVo"
|
||||
parameterType="java.lang.String">
|
||||
<include refid="selectUser"></include>
|
||||
<include refid="selectUserAndBalance"></include>
|
||||
<where>
|
||||
mu.name like concat('%', #{name}, '%')
|
||||
<if test="chainStoreId != null and chainStoreId != ''">
|
||||
and mub.chain_store_id = #{chainStoreId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
@ -95,6 +95,8 @@ public interface LJUserGradeService extends IService<LJUserGrade> {
|
||||
*/
|
||||
public int insertUserGrade(LJUserGrade userGrade,Integer storeId);
|
||||
|
||||
List<LJUserGrade> selectUserGradeByChainStoreId(Integer chainStoreId);
|
||||
|
||||
/**
|
||||
* 修改会员等级信息
|
||||
* @param userGrade
|
||||
|
@ -89,7 +89,7 @@ public interface LJUserService extends IService<LJUser> {
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public List<LJUserVo> queryUserByName(String name);
|
||||
public Map<String,Object> queryUserByName(String name);
|
||||
|
||||
/**
|
||||
* 根据id删除会员信息
|
||||
|
@ -34,11 +34,15 @@ import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUserGrade> implements LJUserGradeService {
|
||||
@Autowired
|
||||
private ILJStoreService storeService;
|
||||
|
||||
@Override
|
||||
public IPage<LJUserGrade> selectUserGradeList(Page page, LJUserGrade userGrade) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer storeId = nowAccountInfo.getStoreId();
|
||||
userGrade.setStoreId(storeId);
|
||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||
userGrade.setChainStoreId(store.getChainStoreId());
|
||||
IPage<LJUserGrade> ljUserGradeIPage = baseMapper.selectUserGradeList(page, userGrade);
|
||||
for (LJUserGrade record : ljUserGradeIPage.getRecords()) {
|
||||
if (StringUtils.isNotEmpty(record.getGasolineRule())){
|
||||
@ -56,9 +60,10 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
|
||||
|
||||
@Override
|
||||
public List<LJUserGrade> selectUserGradeAll(int storeId) {
|
||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("status","qy");
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
queryWrapper.eq("chain_store_id",store.getChainStoreId());
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@ -71,9 +76,10 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
|
||||
|
||||
@Override
|
||||
public List<LJUserGrade> selectUserGradeAllByStoreId(int storeId) {
|
||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("status","qy");
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
queryWrapper.eq("chain_store_id",store.getChainStoreId());
|
||||
queryWrapper.orderByAsc("grade");
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
@ -86,14 +92,13 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
|
||||
@Override
|
||||
public LJUserGrade selectUserGradeByIdAndStoreId(int id) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
LJStore store = storeService.selectStoreByStoreId(nowAccountInfo.getStoreId());
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("store_id",nowAccountInfo.getStoreId());
|
||||
queryWrapper.eq("chain_store_id",store.getChainStoreId());
|
||||
queryWrapper.eq("id",id);
|
||||
return baseMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private ILJStoreService storeService;
|
||||
@Autowired
|
||||
private ChainStoreConfigService chainStoreConfigService;
|
||||
@Autowired
|
||||
@ -145,8 +150,9 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
|
||||
|
||||
@Override
|
||||
public LJUserGrade selectUserGradeByStoreId(int storeId) {
|
||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
queryWrapper.eq("chain_store_id",store.getChainStoreId());
|
||||
queryWrapper.orderByAsc("grade");
|
||||
List<LJUserGrade> list = baseMapper.selectList(queryWrapper);
|
||||
return list.get(0);
|
||||
@ -183,11 +189,14 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
|
||||
return 2;
|
||||
}
|
||||
|
||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
queryWrapper.eq("chain_store_id",store.getChainStoreId());
|
||||
Integer num = baseMapper.selectCount(queryWrapper);
|
||||
if (num<20){
|
||||
userGrade.setStoreId(storeId);
|
||||
userGrade.setChainStoreId(store.getChainStoreId());
|
||||
row = baseMapper.insert(userGrade);
|
||||
}else {
|
||||
row = 0;
|
||||
@ -195,9 +204,37 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
|
||||
return row;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LJUserGrade> selectUserGradeByChainStoreId(Integer chainStoreId) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("chain_store_id",chainStoreId);
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateUserGrade(LJUserGrade userGrade) {
|
||||
int row = baseMapper.updateById(userGrade);
|
||||
int row = 0;
|
||||
boolean flag = false;
|
||||
LJStore store = storeService.selectStoreByStoreId(userGrade.getStoreId());
|
||||
List<LJUserGrade> ljUserGrades = this.selectUserGradeByChainStoreId(store.getChainStoreId());
|
||||
for (LJUserGrade ljUserGrade : ljUserGrades) {
|
||||
if (ljUserGrade.getGrade().equals(userGrade.getGrade()) && ljUserGrade.getId()!=userGrade.getId()){
|
||||
row = 2;
|
||||
flag = true;
|
||||
}
|
||||
if (ljUserGrade.getName().equals(userGrade.getName()) && ljUserGrade.getId()!=userGrade.getId()){
|
||||
row = 3;
|
||||
flag = true;
|
||||
}
|
||||
if (ljUserGrade.getGrowthValue().equals(userGrade.getGrowthValue()) && ljUserGrade.getId()!=userGrade.getId()){
|
||||
row = 4;
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
if (flag) {
|
||||
return row;
|
||||
}
|
||||
row = baseMapper.updateById(userGrade);
|
||||
return row;
|
||||
}
|
||||
}
|
||||
|
@ -159,6 +159,7 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
||||
if (ObjectUtil.isNotEmpty(store)){
|
||||
ljUserVo = baseMapper.selectUserByMobileAndChantStoreId(mobile,store.getChainStoreId());
|
||||
}
|
||||
ljUserVo.setStoreId(store.getId());
|
||||
return ljUserVo;
|
||||
}
|
||||
|
||||
@ -205,9 +206,14 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<LJUserVo> queryUserByName(String name) {
|
||||
List<LJUserVo> list = baseMapper.selectUserByName(name);
|
||||
return list;
|
||||
public Map<String,Object> queryUserByName(String name) {
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
LJStore store = storeService.selectStoreByStoreId(nowAccountInfo.getStoreId());
|
||||
List<LJUserVo> list = baseMapper.selectUserByName(name,store.getChainStoreId());
|
||||
map.put("userVo",list);
|
||||
map.put("storeId",store.getId());
|
||||
return map;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
|
@ -253,8 +253,13 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper,SysDept> imple
|
||||
|
||||
QRCode qrCode = new QRCode();
|
||||
iqrCodeService.insertQRCode(qrCode,store.getId());
|
||||
|
||||
// 判断当前连锁店是否存在会员等级信息 不存在则添加一个默认的等级
|
||||
List<LJUserGrade> ljUserGrades = userGradeService.selectUserGradeByChainStoreId(chainStoreInfo.getId());
|
||||
if (ljUserGrades.size()==0){
|
||||
LJUserGrade userGrade = new LJUserGrade();
|
||||
userGrade.setStoreId(store.getId());
|
||||
userGrade.setChainStoreId(chainStoreInfo.getId());
|
||||
userGrade.setGrade(1);
|
||||
userGrade.setName("普通会员");
|
||||
userGrade.setStatus("qy");
|
||||
@ -267,6 +272,8 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper,SysDept> imple
|
||||
userGrade.setNaturalGasDiscount("无优惠");
|
||||
userGrade.setNaturalGasRule("[{\"naturalGas1\":1,\"naturalGas2\":1,\"naturalGas3\":1}]");
|
||||
userGradeService.insertUserGrade(userGrade,store.getId());
|
||||
}
|
||||
|
||||
|
||||
}else {
|
||||
throw new Exception("数据有误,请联系管理员");
|
||||
|
@ -15,7 +15,7 @@
|
||||
background-color: rgb(67,119,204)">
|
||||
<div>
|
||||
<template>
|
||||
<img v-if="member.avatar" class="list-avatar" :src="member.avatar">
|
||||
<img v-if="member.avatar" class="list-avatar" :src="baseUrl + member.avatar">
|
||||
<img v-else class="list-avatar" src="@/assets/images/avatar.png">
|
||||
</template>
|
||||
</div>
|
||||
@ -135,7 +135,7 @@
|
||||
</div>
|
||||
<div>- {{ consumeRefuelMoney }}L</div>
|
||||
</div>
|
||||
<div class="center-left-hj" v-show="isMember">
|
||||
<div class="center-left-hj" v-show="isMember && balance>0">
|
||||
<div>
|
||||
<el-checkbox style="color: black;font-size: 16px"
|
||||
v-model="checkAll4" @change="handleCheckAllChange4">
|
||||
@ -152,17 +152,6 @@
|
||||
width="400"
|
||||
trigger="click">
|
||||
<div>
|
||||
<!-- <el-checkbox-group v-model="checkedCities5" @change="handleCheckedCitiesChange5">-->
|
||||
<!-- <el-checkbox v-for="(item,index) in couponDiscount" :label="item.name" :key="index">-->
|
||||
<!-- <div style="display: flex;justify-content: space-between;height: 40px;line-height: 40px;">-->
|
||||
<!-- <div style="width: 200px">{{item.name}}</div>-->
|
||||
<!-- <div style="line-height: 20px;width:150px;font-size: 12px;text-align: right">-->
|
||||
<!-- <div style="color: red">-¥{{ item.reduce }}</div>-->
|
||||
<!-- <div style="color: grey">满{{ item.full }}元,减{{ item.reduce }}元</div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-checkbox>-->
|
||||
<!-- </el-checkbox-group>-->
|
||||
<el-radio-group v-model="checkedCities5" @input="handleCheckedCitiesChange5">
|
||||
<el-radio v-for="(item,index) in couponDiscount"
|
||||
:label="item.name" :key="index" style="display: flex;">
|
||||
@ -482,7 +471,7 @@
|
||||
:visible.sync="dialogVisiblej"
|
||||
width="30%"
|
||||
:close-on-click-modal="false">
|
||||
<div v-if="isPay == true"
|
||||
<div v-if="isPay==false"
|
||||
v-loading="loading">
|
||||
<div style="text-align: center;font-size: 15px;font-weight: bold">应收金额</div>
|
||||
<div style="text-align: center;font-size: 30px;font-weight: bold;color: red;margin: 10px 0">
|
||||
@ -639,12 +628,12 @@
|
||||
title="请选择会员"
|
||||
:visible.sync="dialogVisibleMember"
|
||||
:close-on-click-modal="false">
|
||||
<div class="wrap-wrap">
|
||||
<div class="wrap-wrap" style="height:700px;overflow-y: scroll;">
|
||||
<el-table ref="tables" :data="memberList">
|
||||
<el-table-column label="ID" align="center" prop="id" width="80" />
|
||||
<el-table-column label="头像" align="center" width="70">
|
||||
<template slot-scope="scope">
|
||||
<img v-if="scope.row.avatar" class="list-avatar" :src="scope.row.avatar">
|
||||
<img v-if="scope.row.avatar" class="list-avatar" :src="baseUrl + scope.row.avatar">
|
||||
<img v-else class="list-avatar" src="@/assets/images/avatar.png">
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -804,6 +793,7 @@
|
||||
name: "homeindex",
|
||||
data(){
|
||||
return{
|
||||
baseUrl:process.env.VUE_APP_BASE_API,
|
||||
// 满减全选
|
||||
checkAll1: false,
|
||||
isIndeterminate1: true,
|
||||
@ -822,7 +812,7 @@
|
||||
checkedCities3: [],
|
||||
cities3: cityOptions,
|
||||
// 储值卡全选
|
||||
checkAll4: true,
|
||||
checkAll4: false,
|
||||
isIndeterminate4: true,
|
||||
checkedCities4: [],
|
||||
cities4: cityOptions,
|
||||
@ -852,6 +842,7 @@
|
||||
loading:false,
|
||||
// 油号
|
||||
oilType:'',
|
||||
oilNameID:'',
|
||||
// 油品类型
|
||||
type:"",
|
||||
// 取单列表
|
||||
@ -898,6 +889,7 @@
|
||||
// 会员列表信息
|
||||
memberList:[],
|
||||
select1:'会员手机号',
|
||||
storeId:"",
|
||||
// 查询会员信息参数
|
||||
userNo:"",
|
||||
// 查询的商品信息
|
||||
@ -1020,7 +1012,7 @@
|
||||
menu:1,
|
||||
index:0,
|
||||
// 是否支付
|
||||
isPay:true,
|
||||
isPay:false,
|
||||
isPaySuccess:false,
|
||||
// 订单号
|
||||
orderNo:'',
|
||||
@ -1032,7 +1024,7 @@
|
||||
// 油号列表
|
||||
oilNumberList:[],
|
||||
// 是否可以点会员确定按钮
|
||||
isSure:false,
|
||||
isSure:true,
|
||||
// 优惠券消费金额
|
||||
couponAmount:0,
|
||||
// 是否为满减互斥
|
||||
@ -1242,7 +1234,7 @@
|
||||
}
|
||||
this.checkedCities1 = val ? list : [];
|
||||
this.isIndeterminate1 = false;
|
||||
this.isExclusion();
|
||||
this.isDefaultUseCard();
|
||||
},
|
||||
handleCheckedCitiesChange1(value) {
|
||||
this.fullReduction = 0;
|
||||
@ -1258,7 +1250,7 @@
|
||||
let checkedCount = value.length;
|
||||
this.checkAll1 = checkedCount === this.fullReduceDiscount.length;
|
||||
this.isIndeterminate1 = checkedCount > 0 && checkedCount < this.fullReduceDiscount.length;
|
||||
this.isExclusion();
|
||||
this.isDefaultUseCard();
|
||||
},
|
||||
handleCheckAllChange2(val) {
|
||||
let list = []
|
||||
@ -1274,7 +1266,7 @@
|
||||
}
|
||||
this.checkedCities2 = val ? list : [];
|
||||
this.isIndeterminate2 = false;
|
||||
this.isExclusion();
|
||||
this.isDefaultUseCard();
|
||||
},
|
||||
handleCheckedCitiesChange2(value) {
|
||||
this.oilDiscount = 0
|
||||
@ -1290,7 +1282,7 @@
|
||||
let checkedCount = value.length;
|
||||
this.checkAll2 = checkedCount === this.gradeDiscount.length;
|
||||
this.isIndeterminate2 = checkedCount > 0 && checkedCount < this.gradeDiscount.length;
|
||||
this.isExclusion();
|
||||
this.isDefaultUseCard();
|
||||
},
|
||||
handleCheckAllChange3(val) {
|
||||
if (val==false){
|
||||
@ -1301,7 +1293,7 @@
|
||||
this.isOilStorageCard = true;
|
||||
this.changeRefuelMoney()
|
||||
}
|
||||
this.isExclusion();
|
||||
this.isDefaultUseCard();
|
||||
},
|
||||
handleCheckedCitiesChange3(value) {
|
||||
let checkedCount = value.length;
|
||||
@ -1315,7 +1307,7 @@
|
||||
}else {
|
||||
this.isUseBalance = false;
|
||||
}
|
||||
this.isExclusion();
|
||||
this.isDefaultUseCard();
|
||||
},
|
||||
handleCheckedCitiesChange4(value) {
|
||||
let checkedCount = value.length;
|
||||
@ -1359,7 +1351,7 @@
|
||||
this.couponAmount = 0
|
||||
this.checkedCities5 = ""
|
||||
}
|
||||
this.isExclusion();
|
||||
this.isDefaultUseCard();
|
||||
},
|
||||
handleCheckedCitiesChange5(value) {
|
||||
this.couponAmount = 0;
|
||||
@ -1375,7 +1367,7 @@
|
||||
}
|
||||
})
|
||||
this.checkAll5 = true;
|
||||
this.isExclusion();
|
||||
this.isDefaultUseCard();
|
||||
},
|
||||
// 模糊查询商品信息
|
||||
querySearch(queryString, cb) {
|
||||
@ -1908,7 +1900,7 @@
|
||||
}
|
||||
_this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount
|
||||
_this.checkAll2 = true;
|
||||
_this.isExclusion();
|
||||
_this.isDefaultUseCard();
|
||||
})
|
||||
},
|
||||
// 选择会员
|
||||
@ -1918,10 +1910,14 @@
|
||||
this.map.payUser = data.mobile;
|
||||
this.map.userId = data.id;
|
||||
this.balance = this.member.cardBalance;
|
||||
this.getGrade(data.id,data.gradeId)
|
||||
if (data.refuelMoney){
|
||||
// 使用囤油卡
|
||||
this.refuelMoney = JSON.parse(data.refuelMoney)
|
||||
this.changeRefuelMoney();
|
||||
this.handleChange();
|
||||
this.preferentialData.storeId = data.storeId;
|
||||
}else
|
||||
this.getGrade(data.id,data.gradeId)
|
||||
// this.handleChange();
|
||||
this.preferentialData.storeId = this.storeId;
|
||||
this.preferentialData.userId = data.id;
|
||||
this.preferentialData.gradeId = data.gradeId;
|
||||
if (this.oilOrder.length>0){
|
||||
@ -1939,6 +1935,7 @@
|
||||
_this.couponDiscount =[];
|
||||
_this.couponIds = [],
|
||||
selectCoupon(_this.preferentialData).then(response => {
|
||||
// console.log(response)
|
||||
_this.couponAmount = 0;
|
||||
_this.couponIds = response.data
|
||||
if (response.data.length>0){
|
||||
@ -2014,23 +2011,25 @@
|
||||
})
|
||||
}
|
||||
_this.checkAll5 = true;
|
||||
_this.isExclusion();
|
||||
_this.isDefaultUseCard();
|
||||
})
|
||||
})
|
||||
},
|
||||
// 使用囤油卡 囤油卡不参与任何优惠
|
||||
countOilCard(){
|
||||
if (this.hoardAmount!=0){
|
||||
if (this.balance!=0 && this.balance >= (this.oilAmount - this.hoardAmount)){
|
||||
if (this.hoardAmount>0){
|
||||
if (this.balance!=0 && this.balance >= this.hoardAmount){
|
||||
this.oilActualPay = 0
|
||||
this.consumeAmount = this.hoardAmount
|
||||
}else {
|
||||
this.oilActualPay = (this.oilAmount - this.hoardAmount -this.balance).toFixed(2)
|
||||
this.oilActualPay = (this.hoardAmount -this.balance).toFixed(2)
|
||||
this.consumeAmount = this.balance
|
||||
}
|
||||
}else {
|
||||
this.oilActualPay = 0
|
||||
this.consumeAmount = 0
|
||||
}
|
||||
console.log("囤油卡",this.isOilStorageCard,this.hoardAmount,this.balance,this.oilAmount,this.oilActualPay,this.consumeAmount)
|
||||
},
|
||||
// 使用优惠券不使用满减
|
||||
countAmountFull(){
|
||||
@ -2046,6 +2045,7 @@
|
||||
}else {
|
||||
this.oilActualPay = (this.oilAmount - this.oilDiscount).toFixed(2)
|
||||
}
|
||||
console.log("优惠券",this.oilAmount, this.oilDiscount,this.couponAmount)
|
||||
},
|
||||
// 使用优惠券和满减不使用储值卡
|
||||
countAmountUnBalance(){
|
||||
@ -2055,6 +2055,7 @@
|
||||
this.oilActualPay = (this.oilAmount - this.oilDiscount).toFixed(2)
|
||||
}
|
||||
this.consumeAmount = 0
|
||||
console.log("优惠券和满减",this.oilAmount , this.fullReduction , this.oilDiscount , this.couponAmount)
|
||||
},
|
||||
// 使用储值卡不使用优惠券 || 使用满减不使用优惠券
|
||||
countAmountBalance(){
|
||||
@ -2069,6 +2070,7 @@
|
||||
}else {
|
||||
this.oilActualPay = (this.oilAmount - this.oilDiscount).toFixed(2)
|
||||
}
|
||||
console.log("储值卡满减",this.oilAmount, this.oilDiscount,this.fullReduction)
|
||||
},
|
||||
// 判断互斥限制
|
||||
isExclusion(){
|
||||
@ -2113,18 +2115,37 @@
|
||||
return;
|
||||
}
|
||||
// 使用囤油卡
|
||||
// if (this.isOilStorageCard){
|
||||
// this.checkAll1 = false;
|
||||
// this.fullReduction = 0;
|
||||
// this.checkAll2 = false;
|
||||
// this.checkedCities2 = [];
|
||||
// this.oilDiscount = 0;
|
||||
// this.checkAll5 = false;
|
||||
// this.couponAmount = 0;
|
||||
// this.countOilCard();
|
||||
// return;
|
||||
// }
|
||||
this.countAmountBalance();
|
||||
}
|
||||
},
|
||||
// 默认使用囤油卡
|
||||
isDefaultUseCard(){
|
||||
if (this.isOilStorageCard){
|
||||
this.checkAll3 = true;
|
||||
this.checkAll1 = false;
|
||||
this.fullReduction = 0;
|
||||
this.checkAll2 = false;
|
||||
this.checkedCities2 = [],
|
||||
this.checkedCities2 = [];
|
||||
this.oilDiscount = 0;
|
||||
this.checkAll5 = false;
|
||||
this.couponAmount = 0;
|
||||
this.countOilCard();
|
||||
return;
|
||||
if (this.hoardAmount>0 && this.balance > 0){
|
||||
this.checkAll4 = true;
|
||||
}
|
||||
this.countAmountBalance();
|
||||
}else {
|
||||
this.isExclusion()
|
||||
}
|
||||
},
|
||||
// 调用优惠参数接口
|
||||
@ -2184,17 +2205,17 @@
|
||||
_this.checkedCities1 = []
|
||||
_this.fullReduction = 0
|
||||
}
|
||||
_this.isExclusion();
|
||||
_this.isDefaultUseCard();
|
||||
})
|
||||
})
|
||||
},
|
||||
// 选择会员信息
|
||||
handleChoose(data) {
|
||||
this.isSure = true;
|
||||
this.isSure = false;
|
||||
this.member = data;
|
||||
if (data.refuelMoney != null && data.refuelMoney != ""){
|
||||
this.refuelMoney = JSON.parse(data.refuelMoney)
|
||||
}
|
||||
// if (data.refuelMoney != null && data.refuelMoney != ""){
|
||||
// this.refuelMoney = JSON.parse(data.refuelMoney)
|
||||
// }
|
||||
this.dialogVisibleMember = false;
|
||||
},
|
||||
// 清空商品订单列表
|
||||
@ -2274,8 +2295,10 @@
|
||||
settlement(){
|
||||
this.authCode = ""
|
||||
this.seekZero = 0;
|
||||
this.isPay = true
|
||||
this.isPay = false
|
||||
console.log(this.isPay)
|
||||
this.dialogVisiblej = true
|
||||
this.getStaff()
|
||||
},
|
||||
// 重置油品订单
|
||||
resetting(){
|
||||
@ -2306,7 +2329,7 @@
|
||||
// 油品订单信息
|
||||
getOilOrder(){
|
||||
this.dialogVisibleamount = false
|
||||
this.form.oilType = this.oilType;
|
||||
this.form.oilType = this.oilNameID;
|
||||
this.form.type = this.type;
|
||||
// 计算油的升数
|
||||
if (this.select == "元"){
|
||||
@ -2358,13 +2381,17 @@
|
||||
_this.consumeRefuelMoney = 0;
|
||||
_this.oilActualPay = 0;
|
||||
_this.hoardAmount = 0;
|
||||
_this.oilAmount = 0;
|
||||
_this.oilOrder.forEach(item => {
|
||||
let conRefMon = 0;
|
||||
let hoardAmount = 0;
|
||||
if (_this.refuelMoney!=null){
|
||||
let id = ""
|
||||
if (_this.refuelMoney){
|
||||
for (let i = 0;i < _this.refuelMoney.length;i++){
|
||||
// 囤油卡升数变化
|
||||
if (_this.refuelMoney[i].oilType==item.oilType){
|
||||
if (_this.refuelMoney[i].oilType==item.oilType && _this.refuelMoney[i].refuelMoney>0){
|
||||
id = item.id
|
||||
_this.isOilStorageCard = true
|
||||
if ((_this.refuelMoney[i].refuelMoney-item.liters)>=0){
|
||||
conRefMon = item.liters
|
||||
}else {
|
||||
@ -2372,18 +2399,34 @@
|
||||
// 扣除升数后需要消费的金额
|
||||
hoardAmount = item.amount - (_this.refuelMoney[i].refuelMoney * item.oilPrice).toFixed(2)
|
||||
}
|
||||
}else {
|
||||
hoardAmount = item.amount
|
||||
}
|
||||
}
|
||||
}
|
||||
_this.consumeRefuelMoney += +conRefMon
|
||||
if (_this.consumeRefuelMoney!=0){
|
||||
_this.isOilStorageCard = true;
|
||||
_this.checkAll3 = true;
|
||||
_this.consumeAmount = 0;
|
||||
}
|
||||
_this.hoardAmount += +hoardAmount
|
||||
_this.oilAmount += +item.amount
|
||||
// _this.changeBalance(_this.hoardAmount,id)
|
||||
// if (_this.consumeRefuelMoney!=0){
|
||||
// _this.isOilStorageCard = true;
|
||||
// _this.checkAll3 = true;
|
||||
// _this.consumeAmount = 0;
|
||||
// }
|
||||
_this.isDefaultUseCard();
|
||||
})
|
||||
_this.isExclusion();
|
||||
},
|
||||
changeBalance(hoardAmount,id){
|
||||
if (this.balance>0 && id != ""){
|
||||
this.oilOrder.forEach(item => {
|
||||
if (this.balance >= item.amount){
|
||||
this.consumeAmount = item.amount
|
||||
}else {
|
||||
this.consumeAmount = this.balance
|
||||
this.oilActualPay = item.amount - this.balance
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// 选择“元”或“L”
|
||||
changeSelect(){
|
||||
@ -2424,6 +2467,7 @@
|
||||
name = item.oilName;
|
||||
oilType = item.oilType;
|
||||
_this.oilType = item.oilName;
|
||||
_this.oilNameID = item.id;
|
||||
_this.type = item.oilType;
|
||||
}
|
||||
})
|
||||
@ -2442,15 +2486,18 @@
|
||||
getUserInfoMobile({mobile:this.userNo}).then( response => {
|
||||
if (response.data!=null){
|
||||
this.member = response.data
|
||||
this.storeId = response.data.storeId
|
||||
this.isSure = false
|
||||
}else {
|
||||
this.$modal.msgError("会员信息不存在")
|
||||
}
|
||||
})
|
||||
}else {
|
||||
getUserVoName({name:this.userNo}).then( response => {
|
||||
this.memberList = response.data
|
||||
})
|
||||
this.dialogVisibleMember = true;
|
||||
getUserVoName({name:this.userNo}).then( response => {
|
||||
this.memberList = response.data.userVo
|
||||
this.storeId = response.data.storeId
|
||||
})
|
||||
}
|
||||
},
|
||||
// 查询所有商品信息
|
||||
@ -2521,13 +2568,13 @@
|
||||
|
||||
let _this = this;
|
||||
if (this.payType=="APPLET_CODE"){
|
||||
this.loading = true;
|
||||
scanAppletQrCode(_this.map).then( resp => {
|
||||
if (resp.data.success!=undefined){
|
||||
if (resp.data.success=='success'){
|
||||
this.loading = true;
|
||||
setTimeout(function (){
|
||||
_this.isPaySuccess = true;
|
||||
this.loading = false;
|
||||
_this.isPay = false;
|
||||
_this.loading = false;
|
||||
_this.isPay = true;
|
||||
_this.resetting1();
|
||||
},3000)
|
||||
}else {
|
||||
@ -2568,11 +2615,10 @@
|
||||
})
|
||||
this.loading = true;
|
||||
_this.queryPayStatus();
|
||||
// console.log(_this.isQuery)
|
||||
let timer = setInterval(function () {
|
||||
if (_this.isQuery == false) {
|
||||
_this.loading = false;
|
||||
_this.isPay = false;
|
||||
_this.isPay = true;
|
||||
clearInterval(_this.timer);
|
||||
}
|
||||
},500)
|
||||
@ -2582,7 +2628,6 @@
|
||||
_this.resetting1();
|
||||
},
|
||||
resetting1(){
|
||||
// console.log(111)
|
||||
let _this = this;
|
||||
this.authCode = "";
|
||||
if (_this.isPaySuccess == true){
|
||||
@ -2700,22 +2745,11 @@
|
||||
},500)
|
||||
},
|
||||
handClose(){
|
||||
if(this.isPaySuccess){
|
||||
this.oilAmount = 0;
|
||||
this.oilActualPay = 0;
|
||||
this.oilDiscount = 0;
|
||||
this.goodsAmount = 0;
|
||||
this.goodsActualPay = 0;
|
||||
this.goodsDiscount = 0;
|
||||
this.consumeAmount = 0;
|
||||
this.consumeRefuelMoney = 0;
|
||||
this.oilTotal = 0;
|
||||
this.goodsTotal = 0;
|
||||
this.isMember = false;
|
||||
}
|
||||
this.isPay = true;
|
||||
this.dialogVisiblej = false
|
||||
this.resetting1()
|
||||
this.member = {};
|
||||
this.isPaySuccess = false;
|
||||
this.isPay = false;
|
||||
this.dialogVisiblej = false
|
||||
},
|
||||
// 支付方式
|
||||
payMethod(payType){
|
||||
|
@ -148,6 +148,7 @@
|
||||
oilPrice: 0,
|
||||
// 油品名称
|
||||
oilName: "",
|
||||
oilNameId:"",
|
||||
// 油品类型
|
||||
oilType:"",
|
||||
// 油品id
|
||||
@ -169,6 +170,7 @@
|
||||
deductAmount:0,
|
||||
// 囤油卡信息
|
||||
refuelMoney:[],
|
||||
refuelMoneyAfter:[],
|
||||
// 会员等级优惠信息
|
||||
gradeDiscount:[],
|
||||
// 优惠券优惠信息
|
||||
@ -200,7 +202,7 @@
|
||||
},
|
||||
onLoad(e) {
|
||||
this.orderNo = e.orderNo
|
||||
// this.orderNo = "23452024011011251833f48e"
|
||||
// this.orderNo = "234520240111104725ec1fbe"
|
||||
},
|
||||
onShow() {
|
||||
this.getOilOrder();
|
||||
@ -211,14 +213,12 @@
|
||||
methods: {
|
||||
// 支付接口
|
||||
payment(){
|
||||
let refuel = this.refuelMoney
|
||||
refuel.refuelMoney = this.refuelMoney.refuelMoney - this.oilCardRedece
|
||||
let map = {
|
||||
orderNo : this.orderNo,
|
||||
payAmount : this.payAmount,
|
||||
// payAmount : "0.01",
|
||||
discountAmount : this.fullRedece+this.gradeRedece+this.couponRedece,
|
||||
oilCardAmount : JSON.stringify(refuel),
|
||||
oilCardAmount : JSON.stringify(this.refuelMoneyAfter),
|
||||
oilCardLiters : this.oilCardRedece,
|
||||
balanceAmount : this.balanceRedece,
|
||||
isOilStorageCard : this.isOilStorageCard,
|
||||
@ -308,19 +308,23 @@
|
||||
// 查看是否有可使用的囤油卡
|
||||
chooseRefuelMoney(){
|
||||
let falg = false;
|
||||
this.refuelMoney.forEach(item => {
|
||||
if (item.oilType == this.oilName){
|
||||
for(let i = 0;i<this.refuelMoney.length;i++){
|
||||
if (this.refuelMoney[i].oilType == this.oilNameId){
|
||||
falg = true
|
||||
this.refuelBalance = item.refuelMoney
|
||||
this.refuelBalance = this.refuelMoney[i].refuelMoney
|
||||
if (this.refuelMoney[i].refuelMoney>0){
|
||||
this.isOilStorageCard = true
|
||||
if (this.oilCardRedece >= this.oilOrder.oilNum){
|
||||
}
|
||||
if (this.refuelMoney[i].refuelMoney >= this.oilOrder.oilNum){
|
||||
this.oilCardRedece = this.oilOrder.oilNum
|
||||
this.refuelMoneyAfter[i].refuelMoney = this.refuelMoney[i].refuelMoney - this.oilOrder.oilNum
|
||||
}else{
|
||||
this.oilCardRedece = item.refuelMoney
|
||||
this.oilCardRedece = this.refuelMoney[i].refuelMoney
|
||||
this.refuelMoneyAfter[i].refuelMoney = 0
|
||||
this.chooseCardBalance(1)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
if (falg == false) {
|
||||
this.chooseCardBalance(0)
|
||||
this.chooseGrade(this.user.id,this.user.gradeId)
|
||||
@ -342,12 +346,17 @@
|
||||
}else{
|
||||
// 使用囤油卡
|
||||
// 扣除囤油卡金额后需要支付的金额
|
||||
let residueAmount = (this.oilOrder.oilNum - this.oilCardRedece) * this.oilPrice
|
||||
let residueAmount = 0
|
||||
if(this.oilCardRedece>0){
|
||||
residueAmount = ((this.oilOrder.oilNum - this.oilCardRedece) * this.oilPrice).toFixed(2)
|
||||
}else{
|
||||
residueAmount = this.oilOrder.orderAmount
|
||||
}
|
||||
if (this.user.cardBalance >= residueAmount){
|
||||
this.balanceRedece = residueAmount
|
||||
} else {
|
||||
this.balanceRedece = this.user.cardBalance
|
||||
this.payAmount = (this.oilOrder.orderAmount - residueAmount - this.balanceRedece).toFixed(2)
|
||||
this.payAmount = ((residueAmount*100).toFixed(0) - (this.balanceRedece*100).toFixed(0))/100
|
||||
}
|
||||
}
|
||||
}else{
|
||||
@ -691,8 +700,10 @@
|
||||
}
|
||||
_this.user = res.data.userVo;
|
||||
_this.user = res.data.userVo;
|
||||
// console.log(res.data.userVo.refuelMoney);
|
||||
if (res.data.userVo.refuelMoney!=null && res.data.userVo.refuelMoney!=""){
|
||||
_this.refuelMoney = JSON.parse(res.data.userVo.refuelMoney)
|
||||
_this.refuelMoneyAfter = JSON.parse(res.data.userVo.refuelMoney)
|
||||
_this.chooseRefuelMoney()
|
||||
}else{
|
||||
_this.chooseCardBalance(0)
|
||||
@ -751,9 +762,11 @@
|
||||
method: 'get',
|
||||
}).then((res) => {
|
||||
res.data.forEach(item => {
|
||||
// console.log(item);
|
||||
if (item.oilName == _this.oilOrder.oils) {
|
||||
_this.oilPrice = item.gbPrice;
|
||||
_this.oilName = item.oilNames;
|
||||
_this.oilNameId = item.oilName;
|
||||
_this.oilType = item.oilType;
|
||||
_this.oilId = item.oilId;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user