pc端会员充值修改
This commit is contained in:
parent
301be80121
commit
d518ecd277
@ -15,7 +15,7 @@
|
|||||||
</el-popover> -->
|
</el-popover> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="box-size">
|
<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>
|
||||||
<div class="box-but">
|
<div class="box-but">
|
||||||
|
|
||||||
@ -41,7 +41,7 @@
|
|||||||
<span style="margin-right: 5px">本周流水总额</span>
|
<span style="margin-right: 5px">本周流水总额</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-size">
|
<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>
|
||||||
<div class="box-but">
|
<div class="box-but">
|
||||||
|
|
||||||
@ -70,7 +70,7 @@
|
|||||||
<span style="margin-right: 5px">本月流水总额</span>
|
<span style="margin-right: 5px">本月流水总额</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-size">
|
<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>
|
||||||
<div class="box-but">
|
<div class="box-but">
|
||||||
|
|
||||||
|
@ -173,8 +173,9 @@
|
|||||||
@click="rechargeCard(cardValueList.length,-1)">
|
@click="rechargeCard(cardValueList.length,-1)">
|
||||||
<el-input placeholder="请输入充值金额"
|
<el-input placeholder="请输入充值金额"
|
||||||
size="medium"
|
size="medium"
|
||||||
v-model.number="cardValueForm.amount"
|
v-model="cardValueForm.amount"
|
||||||
@input="valueAmoutChange(cardValueForm.amount)"
|
@input="valueAmoutChange(cardValueForm.amount)"
|
||||||
|
oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
|
||||||
>
|
>
|
||||||
<template slot="prepend">自定义</template>
|
<template slot="prepend">自定义</template>
|
||||||
<template slot="append">元</template>
|
<template slot="append">元</template>
|
||||||
@ -276,7 +277,8 @@
|
|||||||
<div style="width: 7%;line-height: 40px">油品类型</div>
|
<div style="width: 7%;line-height: 40px">油品类型</div>
|
||||||
<el-radio-group v-model="tabOilType" style="margin-bottom: 30px;">
|
<el-radio-group v-model="tabOilType" style="margin-bottom: 30px;">
|
||||||
<el-radio-button v-for="(item,index) in oilTypeList" :label="item.oilType"
|
<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-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</div>
|
</div>
|
||||||
@ -343,8 +345,9 @@
|
|||||||
<div style="display: flex;margin: 20px 0">
|
<div style="display: flex;margin: 20px 0">
|
||||||
<div style="width: 7%">支付方式</div>
|
<div style="width: 7%">支付方式</div>
|
||||||
<div>
|
<div>
|
||||||
<el-radio v-for="dict in dict.type.payment_type" v-model="cardFuelDieselForm.paymentType"
|
<el-radio v-for="dict in payList" v-model="cardFuelDieselForm.paymentType"
|
||||||
:key="dict.value" :label="dict.value" :value="dict.value" border>{{ dict.label }}
|
v-if="dict.dictValue!=='APPLET_CODE'"
|
||||||
|
:key="dict.dictValue" :label="dict.dictValue" :value="dict.dictValue" border>{{ dict.dictLabel }}
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -946,17 +949,19 @@ export default {
|
|||||||
this.cardValueList.sort((a, b) => a.rechargeBalance - b.rechargeBalance);
|
this.cardValueList.sort((a, b) => a.rechargeBalance - b.rechargeBalance);
|
||||||
console.log("this.grade.name",this.grade)
|
console.log("this.grade.name",this.grade)
|
||||||
})
|
})
|
||||||
|
console.log("this.cardValueList", this.grade)
|
||||||
|
|
||||||
if (this.cardValueList.length > 0) {
|
if (this.cardValueList.length > 0) {
|
||||||
// 过滤
|
// 过滤
|
||||||
if (this.grade && this.grade.name) {
|
if (this.grade && this.grade.name) {
|
||||||
this.cardValueList = this.cardValueList.filter(item => {
|
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);
|
this.rechargeCard(0);
|
||||||
} else {
|
} else {
|
||||||
this.cardValueList = []
|
this.cardValueList = this.cardValueList.filter(item => {
|
||||||
|
return item.groupOriented === "1";
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -967,7 +972,7 @@ export default {
|
|||||||
|
|
||||||
console.log("data17.16", this.cardValueForm.amount)
|
console.log("data17.16", this.cardValueForm.amount)
|
||||||
if (!data) {
|
if (!data) {
|
||||||
this.cardValueForm.amount = 0
|
this.cardValueForm.amount = ''
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.cardValueForm.amount = data
|
this.cardValueForm.amount = data
|
||||||
@ -1075,7 +1080,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 根据油品过滤查询存油卡
|
// 根据油品过滤查询存油卡
|
||||||
async tabOilTypeClick(data) {
|
async tabOilTypeClick(data) {
|
||||||
// console.log("aaaaaaaaaaaaaa",data)
|
console.log("aaaaaaaaaaaaaa",data)
|
||||||
await this.getCardFuelDieselList()
|
await this.getCardFuelDieselList()
|
||||||
|
|
||||||
this.cardFuelDieselList = this.sourceCardFuelDieselList.filter(item => {
|
this.cardFuelDieselList = this.sourceCardFuelDieselList.filter(item => {
|
||||||
@ -1087,7 +1092,8 @@ export default {
|
|||||||
},
|
},
|
||||||
selectOilType(status, oilType) {
|
selectOilType(status, oilType) {
|
||||||
this.tabOilType = oilType;
|
this.tabOilType = oilType;
|
||||||
this.tabOilTypeClick(status);
|
console.log("453",oilType)
|
||||||
|
this.tabOilTypeClick(oilType);
|
||||||
},
|
},
|
||||||
// 查询员工
|
// 查询员工
|
||||||
|
|
||||||
@ -1109,7 +1115,7 @@ export default {
|
|||||||
this.flag = flag
|
this.flag = flag
|
||||||
|
|
||||||
if (flag === 1) {
|
if (flag === 1) {
|
||||||
if (this.cardValueForm.paymentType == '') {
|
if (this.cardValueForm.paymentType === '') {
|
||||||
this.$message.error('请选择支付方式');
|
this.$message.error('请选择支付方式');
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1125,7 +1131,7 @@ export default {
|
|||||||
this.realyPayBills = this.cardValueForm.rechargeBalance
|
this.realyPayBills = this.cardValueForm.rechargeBalance
|
||||||
}
|
}
|
||||||
} else if (flag === 2) {
|
} else if (flag === 2) {
|
||||||
if (this.cardFuelDieselForm.paymentType == '') {
|
if (this.cardFuelDieselForm.paymentType === '') {
|
||||||
this.$message.error('请选择支付方式');
|
this.$message.error('请选择支付方式');
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1239,12 +1245,15 @@ export default {
|
|||||||
let file = {}
|
let file = {}
|
||||||
// 拿到金额
|
// 拿到金额
|
||||||
file = this.cardFuelDieselList[index]
|
file = this.cardFuelDieselList[index]
|
||||||
|
console.log("file",file)
|
||||||
this.cardFuelDieselForm.points = file.points
|
this.cardFuelDieselForm.points = file.points
|
||||||
this.cardFuelDieselForm.rechargeBalance = file.rechargeBalance
|
this.cardFuelDieselForm.rechargeBalance = file.rechargeBalance
|
||||||
this.cardFuelDieselForm.oilType = file.oilType
|
this.cardFuelDieselForm.oilType = file.oilType
|
||||||
this.cardFuelDieselForm.type = file.type
|
this.cardFuelDieselForm.type = file.type
|
||||||
this.cardFuelDieselForm.chainStorId = file.chainStorId
|
this.cardFuelDieselForm.chainStorId = file.chainStorId
|
||||||
this.cardFuelDieselForm.incomeLitres = file.incomeLitres
|
this.cardFuelDieselForm.incomeLitres = file.incomeLitres
|
||||||
|
this.cardFuelDieselForm.lockupPrice = file.lockupPrice
|
||||||
|
this.cardFuelDieselForm.cardFuelId = file.id
|
||||||
|
|
||||||
// this.realyPayBills = file.rechargeBalance
|
// this.realyPayBills = file.rechargeBalance
|
||||||
|
|
||||||
@ -1254,12 +1263,11 @@ export default {
|
|||||||
|
|
||||||
let userForm = this.form
|
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('请先扫码');
|
this.$message.error('请先扫码');
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.flag === 1) {
|
|
||||||
// 会员id 会员名字会员手机号码
|
// 会员id 会员名字会员手机号码
|
||||||
this.cardValueForm.mtUserId = userForm.id
|
this.cardValueForm.mtUserId = userForm.id
|
||||||
this.cardValueForm.name = userForm.name
|
this.cardValueForm.name = userForm.name
|
||||||
@ -1274,33 +1282,30 @@ export default {
|
|||||||
if (response.data != null) {
|
if (response.data != null) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
id = response.data.id
|
id = response.data.id
|
||||||
// if (response.data.payStatus == "paid"){
|
|
||||||
// this.isPaySuccess = true;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
let this_ = this
|
let this_ = this
|
||||||
//
|
//
|
||||||
let timer = setInterval(async () => {
|
let timer = setInterval(async () => {
|
||||||
getCheckTheStatusOfYourPaymentApi(id).then(response => {
|
await getCheckTheStatusOfYourPaymentApi(id).then(response => {
|
||||||
if (response.data != null) {
|
if (response.data != null) {
|
||||||
if (response.data.payStatus == "unpaid") {
|
const payStatus = response.data.payStatus
|
||||||
|
if (payStatus === "unpaid") {
|
||||||
this_.isQuery = true;
|
this_.isQuery = true;
|
||||||
}
|
}else if (payStatus === "paid") {
|
||||||
if (response.data.payStatus == "paid") {
|
// 当支付成功时
|
||||||
this_.isPaySuccess = true;
|
this_.isPaySuccess = true;
|
||||||
this_.isQuery = false;
|
this_.isQuery = false;
|
||||||
}
|
}else if (payStatus === "payFail") {
|
||||||
if (response.data.payStatus == "payFail") {
|
|
||||||
this_.isPaySuccess = false;
|
this_.isPaySuccess = false;
|
||||||
this_.isQuery = false;
|
this_.isQuery = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, 500);
|
}, 1000);
|
||||||
|
|
||||||
let timer2 = setInterval(function () {
|
let timer2 = setInterval(function () {
|
||||||
if (this_.isQuery == false) {
|
if (!this_.isQuery) {
|
||||||
this_.loading = false;
|
this_.loading = false;
|
||||||
this_.isPay = false;
|
this_.isPay = false;
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
@ -1315,14 +1320,19 @@ export default {
|
|||||||
this_.loading = false;
|
this_.loading = false;
|
||||||
this_.isPay = false;
|
this_.isPay = false;
|
||||||
this.isPaySuccess = false;
|
this.isPaySuccess = false;
|
||||||
|
|
||||||
}, 30000)
|
}, 30000)
|
||||||
|
|
||||||
} else if (this.flag === 2) {
|
} 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.mtUserId = userForm.id
|
||||||
this.cardFuelDieselForm.name = userForm.name
|
this.cardFuelDieselForm.name = userForm.name
|
||||||
this.cardFuelDieselForm.mobile = userForm.mobile
|
this.cardFuelDieselForm.mobile = userForm.mobile
|
||||||
this.cardFuelDieselForm.authCode = this.authCode
|
this.cardFuelDieselForm.authCode = this.authCode
|
||||||
|
console.log("this.cardFuelDieselForm",this.cardFuelDieselForm)
|
||||||
|
|
||||||
|
|
||||||
let id;
|
let id;
|
||||||
@ -1376,6 +1386,7 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 获取支付列表
|
||||||
getPayList() {
|
getPayList() {
|
||||||
// console.log("payment_type1")
|
// console.log("payment_type1")
|
||||||
getDicts("payment_type").then(response => {
|
getDicts("payment_type").then(response => {
|
||||||
|
@ -43,14 +43,23 @@
|
|||||||
<div v-else>
|
<div v-else>
|
||||||
<el-table ref="tables2" v-loading="loading" :data="fuelList">
|
<el-table ref="tables2" v-loading="loading" :data="fuelList">
|
||||||
<el-table-column align="center" label="所属油站" prop="storeName"/>
|
<el-table-column align="center" label="所属油站" prop="storeName"/>
|
||||||
<el-table-column align="center" label="变动账户" prop="oilType" />
|
<el-table-column align="center" label="油品" >
|
||||||
<el-table-column label="类型" align="center" prop="changeType">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag v-if="scope.row.changeType == 0">减少</el-tag>
|
-<span>{{scope.row.type?scope.row.type:' -- '}}</span>
|
||||||
<el-tag type="success" v-else>增加</el-tag>
|
</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>
|
</template>
|
||||||
</el-table-column>
|
</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="orderNo"/>
|
||||||
<el-table-column label="描述" align="center" prop="fromType"/>
|
<el-table-column label="描述" align="center" prop="fromType"/>
|
||||||
<el-table-column label="变动时间" align="center" prop="createTime"/>
|
<el-table-column label="变动时间" align="center" prop="createTime"/>
|
||||||
|
@ -133,6 +133,8 @@ public class CardFuelRecord extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String oilName;
|
private String oilName;
|
||||||
|
|
||||||
|
private String status; //订单处理状态(防止二次执行,0是订单未完成,1是订单完成不可重复执行)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -132,6 +132,7 @@
|
|||||||
select
|
select
|
||||||
ms.name storeName,
|
ms.name storeName,
|
||||||
cfc.oil_type oilType,
|
cfc.oil_type oilType,
|
||||||
|
cfc.type type,
|
||||||
cfc.change_type changeType,
|
cfc.change_type changeType,
|
||||||
cfc.balance balance,
|
cfc.balance balance,
|
||||||
cfc.order_no orderNo,
|
cfc.order_no orderNo,
|
||||||
@ -151,8 +152,8 @@
|
|||||||
|
|
||||||
<!--新增所有列-->
|
<!--新增所有列-->
|
||||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
<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)
|
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})
|
values (#{userId}, #{chainStoreId}, #{storeId}, #{changeType}, #{fromType}, #{balance}, #{createTime}, #{createBy}, #{updateTime}, #{updateBy}, #{type}, #{oilType}, #{unit},#{orderNo})
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
<!--查询单个-->
|
<!--查询单个-->
|
||||||
<select id="queryById" resultMap="CardFuelRecordMap">
|
<select id="queryById" resultMap="CardFuelRecordMap">
|
||||||
select
|
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
|
from card_fuel_record
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
@ -217,7 +217,7 @@
|
|||||||
<!--新增所有列-->
|
<!--新增所有列-->
|
||||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
<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)
|
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>
|
||||||
|
|
||||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||||
@ -266,6 +266,7 @@
|
|||||||
<update id="update">
|
<update id="update">
|
||||||
update card_fuel_record
|
update card_fuel_record
|
||||||
<set>
|
<set>
|
||||||
|
update_time = NOW(),
|
||||||
<if test="mtUserId != null">
|
<if test="mtUserId != null">
|
||||||
mt_user_id = #{mtUserId},
|
mt_user_id = #{mtUserId},
|
||||||
</if>
|
</if>
|
||||||
@ -323,9 +324,6 @@
|
|||||||
<if test="updateBy != null and updateBy != ''">
|
<if test="updateBy != null and updateBy != ''">
|
||||||
update_by = #{updateBy},
|
update_by = #{updateBy},
|
||||||
</if>
|
</if>
|
||||||
<if test="updateTime != null">
|
|
||||||
update_time = #{updateTime},
|
|
||||||
</if>
|
|
||||||
<if test="payStatus != null and payStatus != ''">
|
<if test="payStatus != null and payStatus != ''">
|
||||||
pay_status = #{payStatus},
|
pay_status = #{payStatus},
|
||||||
</if>
|
</if>
|
||||||
@ -341,6 +339,10 @@
|
|||||||
<if test="oilType != null and oilType != ''">
|
<if test="oilType != null and oilType != ''">
|
||||||
oil_type = #{oilType},
|
oil_type = #{oilType},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="status != null and status != ''">
|
||||||
|
status = #{status},
|
||||||
|
</if>
|
||||||
|
|
||||||
</set>
|
</set>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.fuint.business.marketingActivity.cardFule.service.impl;
|
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.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelChange;
|
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelChange;
|
||||||
@ -67,8 +68,11 @@ public class CardFuelChangeServiceImpl implements CardFuelChangeService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public CardFuelChange insert(CardFuelChange cardFuelChange) {
|
public CardFuelChange insert(CardFuelChange cardFuelChange) {
|
||||||
|
if (ObjectUtil.isEmpty(cardFuelChange.getStoreId())) {
|
||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
cardFuelChange.setStoreId(nowAccountInfo.getStoreId());
|
cardFuelChange.setStoreId(nowAccountInfo.getStoreId());
|
||||||
|
}
|
||||||
|
|
||||||
this.cardFuelChangeMapper.insert(cardFuelChange);
|
this.cardFuelChangeMapper.insert(cardFuelChange);
|
||||||
return cardFuelChange;
|
return cardFuelChange;
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ public class CardFuelDieselServiceImpl extends ServiceImpl<CardFuelDieselMapper,
|
|||||||
//返回囤油卡状态
|
//返回囤油卡状态
|
||||||
for (CardFuelDiesel record : records) {
|
for (CardFuelDiesel record : records) {
|
||||||
if (ObjectUtils.isNotEmpty(record.getOilType())){
|
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");
|
record.setStatus(record.getStatus().equals("1") ? "true" : "false");
|
||||||
if(ObjectUtils.isNotEmpty(record.getActiveTime()) && "1".equals(record.getActiveTime())){
|
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.mapper.LJUserMapper;
|
||||||
import com.fuint.business.userManager.service.UserBalanceService;
|
import com.fuint.business.userManager.service.UserBalanceService;
|
||||||
import com.fuint.business.userManager.vo.LJUserVo;
|
import com.fuint.business.userManager.vo.LJUserVo;
|
||||||
|
import com.fuint.common.util.RedisLock;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -58,6 +59,7 @@ import javax.annotation.Resource;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 燃油充值表(CardFuelRecord)表服务实现类
|
* 燃油充值表(CardFuelRecord)表服务实现类
|
||||||
@ -168,6 +170,8 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
|||||||
return i>0;
|
return i>0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
ILJStaffService iljStaffService;
|
||||||
@Override
|
@Override
|
||||||
public CardFuelRecordDTO prepaidFuelTopUp(CardFuelRecordDTO cardFuelRecordDTO) {
|
public CardFuelRecordDTO prepaidFuelTopUp(CardFuelRecordDTO cardFuelRecordDTO) {
|
||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
@ -186,18 +190,29 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
|||||||
cardFuelRecordDTO.setPaymentNo(orderNo);
|
cardFuelRecordDTO.setPaymentNo(orderNo);
|
||||||
cardFuelRecordDTO.setStoreId(nowAccountInfo.getStoreId());
|
cardFuelRecordDTO.setStoreId(nowAccountInfo.getStoreId());
|
||||||
cardFuelRecordDTO.setChainStoreId(nowAccountInfo.getChainStoreId());
|
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);
|
cardFuelRecordMapper.insert(cardFuelRecordDTO);
|
||||||
Double theAmountToBePaid = 0.0;
|
double theAmountToBePaid = 0.0;
|
||||||
|
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
System.out.println("cardFuelRecordDTO.getRechargeBalance():"+cardFuelRecordDTO.getRechargeBalance());
|
|
||||||
|
|
||||||
double epsilon = 1e-10; // 阈值
|
double epsilon = 1e-10; // 阈值
|
||||||
if (!ObjectUtil.isEmpty(cardFuelRecordDTO.getRechargeBalance())
|
if (!ObjectUtil.isEmpty(cardFuelRecordDTO.getRechargeBalance())
|
||||||
&& cardFuelRecordDTO.getRechargeBalance() > epsilon
|
// && cardFuelRecordDTO.getRechargeBalance() > epsilon
|
||||||
|
&& cardFuelRecordDTO.getRechargeBalance().compareTo(0.00)>0
|
||||||
&& "unpaid".equals(cardFuelRecordDTO.getPayStatus())){
|
&& "unpaid".equals(cardFuelRecordDTO.getPayStatus())){
|
||||||
theAmountToBePaid = cardFuelRecordDTO.getRechargeBalance();
|
theAmountToBePaid = cardFuelRecordDTO.getRechargeBalance().doubleValue();
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,8 +221,6 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
|||||||
Integer allAmount = (int) (theAmountToBePaid*100);
|
Integer allAmount = (int) (theAmountToBePaid*100);
|
||||||
System.out.println("allAmount1:"+allAmount);
|
System.out.println("allAmount1:"+allAmount);
|
||||||
|
|
||||||
// Integer allAmount = (int) (0.01 * 100);
|
|
||||||
|
|
||||||
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(nowAccountInfo.getStoreId());
|
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(nowAccountInfo.getStoreId());
|
||||||
// 处理支付需要的数据
|
// 处理支付需要的数据
|
||||||
Map<String, String> map = new HashMap<>();
|
Map<String, String> map = new HashMap<>();
|
||||||
@ -232,10 +245,22 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
|||||||
return cardFuelRecordDTO;
|
return cardFuelRecordDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisLock redisLock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询支付状态 修改相关关联表
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public CardFuelRecord checkTheStatusOfYourPaymentByFuel(Integer id) {
|
public CardFuelRecord checkTheStatusOfYourPaymentByFuel(Integer id) {
|
||||||
CardFuelRecord cardFuelRecord = cardFuelRecordMapper.queryById(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());
|
LJUserVo ljUserVos = ljUserMapper.selectAllInfoById2(cardFuelRecord.getMtUserId(),cardFuelRecord.getChainStoreId());
|
||||||
|
|
||||||
@ -255,6 +280,13 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
|||||||
IntegralDetail integralDetail = changesInPoints(cardFuelRecord,ljUserVos);
|
IntegralDetail integralDetail = changesInPoints(cardFuelRecord,ljUserVos);
|
||||||
integralDetailService.insert2(integralDetail);
|
integralDetailService.insert2(integralDetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CardFuelRecord editCardFuelRecord = new CardFuelRecord();
|
||||||
|
editCardFuelRecord.setId(id);
|
||||||
|
editCardFuelRecord.setStatus("1");
|
||||||
|
cardFuelRecordMapper.update(editCardFuelRecord);
|
||||||
|
redisLock.unlock(lockKey);
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
return cardFuelRecord;
|
return cardFuelRecord;
|
||||||
}
|
}
|
||||||
@ -265,9 +297,9 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
|||||||
List<Map<String, String>> refuelMoneyList = new ArrayList<>();
|
List<Map<String, String>> refuelMoneyList = new ArrayList<>();
|
||||||
UserBalance userBalance = new UserBalance();
|
UserBalance userBalance = new UserBalance();
|
||||||
userBalance.setId(ljUserVos.getBalanceId());
|
userBalance.setId(ljUserVos.getBalanceId());
|
||||||
if (ObjectUtil.isEmpty(ljUserVos.getRefuelMoney())) {
|
if (ObjectUtil.isEmpty(ljUserVos.getRefuelMoney()) || ljUserVos.getRefuelMoney().length() < 6) {
|
||||||
|
// 判断是否存在加油卡
|
||||||
Map<String, String> refuelMoney = new HashMap<>();
|
Map<String, String> refuelMoney = new HashMap<>();
|
||||||
// todo 目前没有用id
|
|
||||||
// refuelMoney.put("oilNumberId",cardFuelRecord.getOilNumberId().toString());
|
// refuelMoney.put("oilNumberId",cardFuelRecord.getOilNumberId().toString());
|
||||||
// refuelMoney.put("oilNameId",cardFuelRecord.getType());
|
// refuelMoney.put("oilNameId",cardFuelRecord.getType());
|
||||||
refuelMoney.put("type",cardFuelRecord.getType());
|
refuelMoney.put("type",cardFuelRecord.getType());
|
||||||
@ -321,6 +353,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
|||||||
cardFuelChange.setBalance(cardFuelRecord.getIncomeLitres());
|
cardFuelChange.setBalance(cardFuelRecord.getIncomeLitres());
|
||||||
cardFuelChange.setType(cardFuelRecord.getType());
|
cardFuelChange.setType(cardFuelRecord.getType());
|
||||||
cardFuelChange.setOilType(cardFuelRecord.getOilType());
|
cardFuelChange.setOilType(cardFuelRecord.getOilType());
|
||||||
|
cardFuelChange.setOrderNo(cardFuelRecord.getPaymentNo());
|
||||||
return cardFuelChange;
|
return cardFuelChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -333,6 +366,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
|||||||
BigDecimal bigPoints = new BigDecimal(cardFuelRecord.getPoints());
|
BigDecimal bigPoints = new BigDecimal(cardFuelRecord.getPoints());
|
||||||
BigDecimal addPoints = bigPoints.add(new BigDecimal(ljUserVos.getPoints()));
|
BigDecimal addPoints = bigPoints.add(new BigDecimal(ljUserVos.getPoints()));
|
||||||
|
|
||||||
|
integralDetail.setCurrentPoints(addPoints.intValue());
|
||||||
integralDetail.setCurrentPoints(addPoints.intValue());
|
integralDetail.setCurrentPoints(addPoints.intValue());
|
||||||
integralDetail.setChangeReason("购买油卡赠送");
|
integralDetail.setChangeReason("购买油卡赠送");
|
||||||
integralDetail.setStoreId(cardFuelRecord.getStoreId());
|
integralDetail.setStoreId(cardFuelRecord.getStoreId());
|
||||||
|
@ -327,7 +327,8 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
|
|||||||
theAmountToBePaid = cardValueRecordDTO.getRealyPayBills();
|
theAmountToBePaid = cardValueRecordDTO.getRealyPayBills();
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
// todo
|
Integer allAmount1 = (int) (theAmountToBePaid*100);
|
||||||
|
System.out.println("allAmount123:"+allAmount1);
|
||||||
if (flag) {
|
if (flag) {
|
||||||
Integer allAmount = (int) (theAmountToBePaid*100);
|
Integer allAmount = (int) (theAmountToBePaid*100);
|
||||||
System.out.println("allAmount1:"+allAmount);
|
System.out.println("allAmount1:"+allAmount);
|
||||||
@ -436,7 +437,10 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
|
|||||||
CardValueRecord updateCardValueRecord = new CardValueRecord();
|
CardValueRecord updateCardValueRecord = new CardValueRecord();
|
||||||
updateCardValueRecord.setId(id);
|
updateCardValueRecord.setId(id);
|
||||||
updateCardValueRecord.setStatus("1");
|
updateCardValueRecord.setStatus("1");
|
||||||
|
cardValueRecord.setStatus("1");
|
||||||
baseMapper.updateById(updateCardValueRecord);
|
baseMapper.updateById(updateCardValueRecord);
|
||||||
|
|
||||||
|
redisLock.unlock(lockKey);
|
||||||
} else {
|
} else {
|
||||||
return cardValueRecord;
|
return cardValueRecord;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user