This commit is contained in:
wangh 2024-01-10 15:43:57 +08:00
parent 8c857bebe3
commit 48ce157316
4 changed files with 488 additions and 426 deletions

View File

@ -6,7 +6,8 @@
<el-page-header @back="goBack" content="详情页面"></el-page-header>
</div>
<div>
<el-button type="primary" plain round @click="subCard">子卡管理<i class="el-icon-bank-card el-icon--right"></i></el-button>
<el-button type="primary" plain round @click="subCard">子卡管理<i
class="el-icon-bank-card el-icon--right"></i></el-button>
<!-- <el-button type="primary" plain round>会员码</el-button>-->
</div>
</div>
@ -18,7 +19,9 @@
<img v-else src="@/assets/images/avatar.png" style="width: 80px;height: 80px">
</div>
<!-- <el-button type="warning" plain round size="mini" style="margin: 10px" @click="bindIdCard">绑定实体卡</el-button><br>-->
<el-button type="primary" icon="el-icon-bank-card" round style="margin: 10px;width: 50%;height: 40px" @click="userRecharge">会员充值</el-button>
<el-button type="primary" icon="el-icon-bank-card" round style="margin: 10px;width: 50%;height: 40px"
@click="userRecharge">会员充值
</el-button>
</div>
<div class="right">
<el-descriptions>
@ -34,7 +37,8 @@
<dict-tag :options="dict.type.zhzt" :value="form.status"/>
</el-descriptions-item>
<el-descriptions-item label="加油次数">{{ form.consumeNum }}</el-descriptions-item>
<el-descriptions-item label="加油总金额">{{form.refuelMoney ? form.refuelMoney : "--"}}</el-descriptions-item>
<el-descriptions-item label="加油总金额">{{ form.refuelMoney ? form.refuelMoney : "--" }}
</el-descriptions-item>
<!-- <el-descriptions-item label="所属油站">{{ store.name }}</el-descriptions-item>-->
<el-descriptions-item label="注册时间">{{ form.createTime }}</el-descriptions-item>
<el-descriptions-item label="关联子卡">
@ -53,7 +57,10 @@
<!-- <dict-tag :options="dict.type.zcrzdj" :value="form.fixingLevel"/>-->
</span>
</el-descriptions-item>
<el-descriptions-item label="备注信息">{{ form.description ? form.description : "--" }}</el-descriptions-item>
<el-descriptions-item label="备注信息">{{
form.description ? form.description : "--"
}}
</el-descriptions-item>
</el-descriptions>
</div>
</div>
@ -145,29 +152,13 @@
<el-tabs v-model="activeRecharge" type="card" @tab-click="handleClick">
<el-tab-pane label="储值卡" name="balance">
<div>
<!-- <el-row>
<el-col :span="24">
<div style="display: flex">
<div style="width: 7%;line-height: 40px">油品类型</div>
<el-radio-button>储值卡充值</el-radio-button>
</div>
</el-col>
</el-row> -->
<el-row>
<!--
.conten-bottom{
box-sizing: border-box;
padding: 20px 20px;
display: flex;
flex-wrap: wrap;
} -->
<el-col :span="1.5">
<div style="height: 50px;line-height: 50px">充值金额</div>
</el-col>
<el-col :span="22">
<div v-if="cardValueList.length>0" style="display: flex;margin: 13px 5px;box-sizing: border-box;flex-wrap: wrap; ">
<div v-if="cardValueList.length>0"
style="display: flex;margin: 13px 5px;box-sizing: border-box;flex-wrap: wrap; ">
<div class="mon"
v-for="(item,index) in cardValueList" :key="index"
:class="activeKey === index ? 'select' : ''"
@ -184,7 +175,6 @@
size="medium"
v-model.number="cardValueForm.amount"
@input="valueAmoutChange(cardValueForm.amount)"
>
<template slot="prepend">自定义</template>
<template slot="append"></template>
@ -215,7 +205,8 @@
disabled>
<template slot="append">积分</template>
</el-input>
<span class="bom">赠送积分 仅自定义金额模式下可手动输入,活动充值赠送积分不可手动更改[需开启积分活动有效]</span>
<span
class="bom">赠送积分 仅自定义金额模式下可手动输入,活动充值赠送积分不可手动更改[需开启积分活动有效]</span>
</div>
</div>
@ -263,7 +254,8 @@
<div style="display: flex;margin: 20px 0">
<div style="width: 7%">支付方式</div>
<div>
<el-radio v-for="dict in payList" v-model="cardValueForm.paymentType" v-if="dict.dictValue!='APPLET_CODE'"
<el-radio v-for="dict in payList" v-model="cardValueForm.paymentType"
v-if="dict.dictValue!='APPLET_CODE'"
:key="dict.dictValue" :label="dict.dictValue" :value="dict.dictValue" border>
{{ dict.dictLabel }}
</el-radio>
@ -283,7 +275,9 @@
<div style="display: flex">
<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 }}</el-radio-button>
<el-radio-button v-for="(item,index) in oilTypeList" :label="item.oilType"
@click.native="tabOilTypeClick(item.status)">{{ item.type }}
</el-radio-button>
</el-radio-group>
</div>
</el-col>
@ -314,7 +308,8 @@
<el-input placeholder="0" disabled v-model="cardFuelDieselForm.points">
<template slot="append">积分</template>
</el-input>
<span class="bom">升数卡充值不支持自定义积分,选择对应充值活动获得对应积分[需开启积分活动有效]</span>
<span
class="bom">升数卡充值不支持自定义积分,选择对应充值活动获得对应积分[需开启积分活动有效]</span>
</div>
</div>
<div style="display:flex;margin-left: 20px">
@ -348,7 +343,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>
<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>
</div>
</div>
</el-col>
@ -363,7 +360,8 @@
</el-dialog>
<!-- 选择员工-->
<el-dialog :close-on-click-modal="false" width="50%" height="50%" title="选择员工" :visible.sync="openStaff" append-to-body>
<el-dialog :close-on-click-modal="false" width="50%" height="50%" title="选择员工" :visible.sync="openStaff"
append-to-body>
<select-staff @send-data="handleDataFromChild">
</select-staff>
@ -384,10 +382,16 @@
</div>
<!-- <div style="text-align: center;margin-bottom: 10px">赠送金额</div> -->
<div>
<el-input v-model="authCode" @keydown.enter.native="collection" placeholder="扫描或输入付款码、支持微信、支付宝、云闪付">
<el-input v-model="authCode" @keydown.enter.native="collection"
placeholder="扫描或输入付款码、支持微信、支付宝、云闪付">
<i
slot="suffix">
<svg t="1697791915471" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1479" width="32" height="32"><path d="M149.333333 170.858667A21.546667 21.546667 0 0 1 170.858667 149.333333H384V106.666667H170.858667A64.213333 64.213333 0 0 0 106.666667 170.858667V384h42.666666V170.858667zM170.858667 874.666667A21.546667 21.546667 0 0 1 149.333333 853.141333V640H106.666667v213.141333A64.213333 64.213333 0 0 0 170.858667 917.333333H384v-42.666666H170.858667zM853.12 149.333333A21.546667 21.546667 0 0 1 874.666667 170.858667V384h42.666666V170.858667A64.213333 64.213333 0 0 0 853.141333 106.666667H640v42.666666h213.141333zM874.666667 853.141333A21.546667 21.546667 0 0 1 853.141333 874.666667H640v42.666666h213.141333A64.213333 64.213333 0 0 0 917.333333 853.141333V640h-42.666666v213.141333zM106.666667 490.666667h810.666666v42.666666H106.666667v-42.666666z" fill="#3D3D3D" p-id="1480"></path></svg>
<svg t="1697791915471" class="icon" viewBox="0 0 1024 1024" version="1.1"
xmlns="http://www.w3.org/2000/svg" p-id="1479" width="32" height="32">
<path
d="M149.333333 170.858667A21.546667 21.546667 0 0 1 170.858667 149.333333H384V106.666667H170.858667A64.213333 64.213333 0 0 0 106.666667 170.858667V384h42.666666V170.858667zM170.858667 874.666667A21.546667 21.546667 0 0 1 149.333333 853.141333V640H106.666667v213.141333A64.213333 64.213333 0 0 0 170.858667 917.333333H384v-42.666666H170.858667zM853.12 149.333333A21.546667 21.546667 0 0 1 874.666667 170.858667V384h42.666666V170.858667A64.213333 64.213333 0 0 0 853.141333 106.666667H640v42.666666h213.141333zM874.666667 853.141333A21.546667 21.546667 0 0 1 853.141333 874.666667H640v42.666666h213.141333A64.213333 64.213333 0 0 0 917.333333 853.141333V640h-42.666666v213.141333zM106.666667 490.666667h810.666666v42.666666H106.666667v-42.666666z"
fill="#3D3D3D" p-id="1480"></path>
</svg>
</i>
</el-input>
</div>
@ -426,7 +430,8 @@
</el-dialog>
<!-- 更换手机号对话框-->
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openMobile" style="margin-top: 200px" width="500px" append-to-body>
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openMobile" style="margin-top: 200px"
width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="24">
@ -446,7 +451,8 @@
</el-dialog>
<!-- 更换用户昵称对话框-->
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openName" style="margin-top: 200px" width="500px" append-to-body>
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openName" style="margin-top: 200px"
width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="24">
@ -520,7 +526,8 @@
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<div style="width: 80%;margin: 0 auto">
<el-input v-model="form.idcard" placeholder="请读卡或输入卡号"></el-input>
<p style="font-size: 12px;color: grey;">实体卡号最低5位且不可重复绑定后不可删除如需更换卡号请在会员详情页面内进行卡片重新绑定</p>
<p style="font-size: 12px;color: grey;">
实体卡号最低5位且不可重复绑定后不可删除如需更换卡号请在会员详情页面内进行卡片重新绑定</p>
</div>
</el-form>
<div slot="footer" class="dialog-footer">
@ -627,7 +634,8 @@
</el-dialog>
<!-- 每日交易次数-->
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openConfig" style="margin-top: 200px" width="400px" append-to-body>
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openConfig" style="margin-top: 200px"
width="400px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="24">
@ -645,7 +653,8 @@
</el-dialog>
<!-- 固定等级-->
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openLevel" style="margin-top: 200px" width="500px" append-to-body>
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openLevel" style="margin-top: 200px"
width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="24">
@ -686,7 +695,15 @@ import {getUser, updateUser} from "@/api/staff/user/user";
import {ljStoreInfo} from "@/api/staff/store";
import {getUserGrade, getUserGradeInfo} from "@/api/staff/user/usergrade";
import {getList} from "@/api/EventMarketing/oilBlock";
import {getCountOilTypeApi,getCardValueListApi,getPrepaidCardTopUpApi,getCheckTheStatusOfYourPaymentApi,getDicts,getPrepaidFuelTopUpApi,getCheckTheStatusOfYourPaymentByFuelApi} from "@/api/EventMarketing/cardSet";
import {
getCountOilTypeApi,
getCardValueListApi,
getPrepaidCardTopUpApi,
getCheckTheStatusOfYourPaymentApi,
getDicts,
getPrepaidFuelTopUpApi,
getCheckTheStatusOfYourPaymentByFuelApi
} from "@/api/EventMarketing/cardSet";
import {getSysConfig} from "@/api/staff/user/sysconfig";
import item from "../../layout/components/Sidebar/Item.vue";
import SelectStaff from "@/components/local/selectStaff";
@ -927,15 +944,20 @@ export default {
await getCardValueListApi(quy).then(res => {
this.cardValueList = res.data.records;
this.cardValueList.sort((a, b) => a.rechargeBalance - b.rechargeBalance);
console.log("this.grade.name",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);
});
console.log("this.cardValueList", this.cardValueList)
this.rechargeCard(0);
} else {
this.cardValueList = []
}
}
},
@ -990,7 +1012,6 @@ export default {
const commissionAmount = totalAmount.multipliedBy(percentageCommissions).dividedBy(100).decimalPlaces(2);
this.cardValueForm.amountCommission = commissionAmount
}
}
})
}
@ -1398,6 +1419,12 @@ export default {
amountCommission: null,
rechargeType: '0'
}
//
this.getUserInfo();
this.getInformation();
this.getFixingLevelList();
this.getStore();
},
//
@ -1469,6 +1496,7 @@ export default {
height: 100%;
background: #f6f8f9;
}
.left {
width: 20%;
display: table-cell;
@ -1477,18 +1505,22 @@ export default {
/*水平居中*/
text-align: center;
}
.right {
flex: 1;
}
.sta {
height: 100px;
margin-top: 10px;
padding-top: 30px;
}
.idcard {
text-align: center;
font-weight: bold
}
.mon {
width: 20%;
height: 50px;
@ -1499,6 +1531,7 @@ export default {
margin: 0 10px;
margin-bottom: 10px;
}
.select {
position: relative;
background-color: #fff;
@ -1529,28 +1562,35 @@ export default {
border-left-color: transparent;
transform: rotate(45deg);
}
.amount {
color: #00afff;
}
.amount1 {
color: #00afff;
font-size: 20px;
}
.top1 {
font-size: 16px;
}
.jine {
width: 24%;
display: flex;
}
.bom {
font-size: 12px;
color: grey;
}
.zeng {
width: 255px;
line-height: 40px;
}
.mon2 {
width: 20%;
height: 75px;

View File

@ -203,10 +203,10 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
// 支付
if (flag) {
Integer allAmount1 = (int) (theAmountToBePaid*100);
System.out.println("allAmount1:"+allAmount1);
Integer allAmount = (int) (theAmountToBePaid*100);
System.out.println("allAmount1:"+allAmount);
Integer allAmount = (int) (0.01 * 100);
// Integer allAmount = (int) (0.01 * 100);
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(nowAccountInfo.getStoreId());
// 处理支付需要的数据

View File

@ -77,5 +77,7 @@ public class CardValueRecord extends Model<CardValueRecord> {
//连锁店id
private Integer chainStoreId;
private String status;
}

View File

@ -46,6 +46,8 @@ 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.dto.AccountInfo;
import com.fuint.common.util.RedisLock;
import com.fuint.common.util.RedisUtil;
import com.fuint.common.util.RocketUtil;
import com.fuint.common.util.TokenUtil;
import com.fuint.repository.mapper.MtStaffMapper;
@ -53,6 +55,7 @@ import com.fuint.repository.model.MtStaff;
import io.lettuce.core.dynamic.annotation.Param;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.redisson.api.RLock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -62,6 +65,7 @@ import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
* 储值充值表(CardValueRecord)表服务实现类
@ -304,6 +308,9 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
bigDecimal = bigDecimal.add(new BigDecimal(cardValueRecordDTO.getGiftBalance()).add(new BigDecimal(cardValueRecordDTO.getRechargeBalance().toString())));
cardValueRecordDTO.setBidBalance(bigDecimal.doubleValue());
}
if (ObjectUtils.isEmpty(cardValueRecordDTO.getMtStaffId())) {
cardValueRecordDTO.setMtStaffId(nowAccountInfo.getStaffId());
}
baseMapper.insert(cardValueRecordDTO);
double epsilon = 1e-10; // 阈值
@ -322,9 +329,9 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
}
// todo
if (flag) {
Integer allAmount1 = (int) (theAmountToBePaid*100);
System.out.println("allAmount1:"+allAmount1);
Integer allAmount = (int) (0.01*100);
Integer allAmount = (int) (theAmountToBePaid*100);
System.out.println("allAmount1:"+allAmount);
// Integer allAmount = (int) (0.01*100);
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(nowAccountInfo.getStoreId());
// 处理支付需要的数据
@ -368,6 +375,9 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
// 支付 payment_type
return cardValueRecordDTO;
}
@Autowired
private RedisLock redisLock;
/**
* 查询支付状态 修改相关关联表
@ -378,9 +388,13 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
@Transactional
public CardValueRecord checkTheStatusOfYourPayment(Integer id) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
CardValueRecord cardValueRecord = baseMapper.selectById(id);
String lockKey = "CardValueRecord"+nowAccountInfo.getStoreId()+id;
Boolean isLock = redisLock.tryLock(lockKey, 5000, TimeUnit.MILLISECONDS);
// 支付成功之后
if ("paid".equals(cardValueRecord.getPayStatus())){
if (isLock && "paid".equals(cardValueRecord.getPayStatus()) && "0".equals(cardValueRecord.getStatus())){
// 查询用户信息
LJUserVo ljUserVos = ljUserMapper.selectAllInfoById2(cardValueRecord.getMtUserId(), cardValueRecord.getChainStoreId());
@ -398,6 +412,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
cardBalanceChange.setBalance(cardValueRecord.getGiftBalance());
cardBalanceChange.setStoreId(cardValueRecord.getStoreId());
cardBalanceChange.setChainStoreId(cardValueRecord.getChainStoreId());
cardBalanceChange.setCreateBy(cardValueRecord.getMtStaffId().toString());
cardBalanceChangeService.insertCardBalance2(cardBalanceChange);
}
@ -417,6 +432,11 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
commissionRecordService.insert2(commissionRecord);
}
// 修改订单的处理状态 (避免二次执行)
CardValueRecord updateCardValueRecord = new CardValueRecord();
updateCardValueRecord.setId(id);
updateCardValueRecord.setStatus("1");
baseMapper.updateById(updateCardValueRecord);
} else {
return cardValueRecord;
}