Merge branch 'master' of https://gitee.com/nny_1/oilSystem
This commit is contained in:
commit
a6cc143bed
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,
|
||||
})
|
||||
}
|
@ -439,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>
|
||||
@ -539,101 +539,9 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 子卡管理-->
|
||||
<el-dialog :close-on-click-modal="false" width="60%" :title="title" :visible.sync="openSubCard" append-to-body>
|
||||
<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>
|
||||
</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-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>
|
||||
<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"
|
||||
/>
|
||||
</div>
|
||||
<el-alert
|
||||
title="关于子卡"
|
||||
type="info"
|
||||
description="子卡为会员子母卡功能,子卡共享母卡的储值额度及信息,子卡为实体会员卡信息,消费需在PC或手持机中才可进行使用">
|
||||
</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-input
|
||||
v-model="subCardList.idCard"
|
||||
placeholder="请输入卡号信息"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="关联单号">
|
||||
<el-input
|
||||
v-model="subCardList.orderId"
|
||||
placeholder="关联单号信息"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item>
|
||||
<el-button type="primary">新增子卡</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-column>
|
||||
<el-table-column prop="date" label="消费时间"/>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="queryParams.page"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
<el-alert
|
||||
title="关于子卡"
|
||||
type="info"
|
||||
description="当前会员的所有子卡消费记录信息,可根据对应子卡卡号进行检索查询">
|
||||
</el-alert>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<!-- 子卡管理-->
|
||||
<el-dialog :title="title" :visible.sync="openSubCard" append-to-body>
|
||||
<cardValueChild :pUserId="form.id"></cardValueChild>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 每日交易次数-->
|
||||
@ -718,6 +626,7 @@ 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";
|
||||
|
||||
export default {
|
||||
@ -730,6 +639,7 @@ export default {
|
||||
couponList,
|
||||
growthValueRecord,
|
||||
refuelMoneyRecord,
|
||||
cardValueChild,
|
||||
},
|
||||
computed: {
|
||||
item() {
|
||||
@ -1017,6 +927,7 @@ export default {
|
||||
const commissionAmount = totalAmount.multipliedBy(percentageCommissions).dividedBy(100).decimalPlaces(2);
|
||||
this.cardValueForm.amountCommission = commissionAmount
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
298
fuintAdmin/src/views/member/userInfoOrder/cardValueChild.vue
Normal file
298
fuintAdmin/src/views/member/userInfoOrder/cardValueChild.vue
Normal file
@ -0,0 +1,298 @@
|
||||
<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="list.length>=2" @click="handleAdd">新增子卡</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-table ref="tables" v-loading="loading" :data="list">
|
||||
<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="handleUpdate(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="dialogVisible" width="30%">
|
||||
<el-form ref="form" :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="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitFrom">确 定</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,
|
||||
},
|
||||
list:[],
|
||||
userId:"",
|
||||
subCardList: {
|
||||
page:1,
|
||||
pageSize:10,
|
||||
cardChildPhones:'',
|
||||
status:''
|
||||
},
|
||||
orderList:[],
|
||||
title:"",
|
||||
dialogVisible:false,
|
||||
rules:{
|
||||
userId:[{ required: true, message: '请选择主卡信息', trigger: 'change' }],
|
||||
cardChildPhones:[{required: true, message: "请输入子卡手机号", trigger: "blur"}],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.userId = this.$route.query.id;
|
||||
|
||||
this.getUser()
|
||||
this.getList()
|
||||
this.getOrderList()
|
||||
},
|
||||
methods:{
|
||||
// 获取当前会员信息
|
||||
getUser(){
|
||||
getUser(this.userId).then(response => {
|
||||
this.form = response.data
|
||||
})
|
||||
},
|
||||
// 查询当前用户的子卡信息
|
||||
getList(){
|
||||
listCardValueChild(this.userId).then(res => {
|
||||
this.list = res.data
|
||||
})
|
||||
},
|
||||
// 查询子卡的交易信息
|
||||
getOrderList(){
|
||||
listCardValueChildOrder(this.subCardList).then(res => {
|
||||
this.orderList = res.data.records
|
||||
this.total = res.data.total
|
||||
})
|
||||
},
|
||||
handleAdd(){
|
||||
this.title = "添加子卡信息"
|
||||
this.dialogVisible = true
|
||||
},
|
||||
handleUpdate(data){
|
||||
cardValueChildInfo(data.id).then(res => {
|
||||
this.form1 = res.data
|
||||
this.title = "修改子卡信息"
|
||||
this.dialogVisible = true
|
||||
})
|
||||
},
|
||||
// 添加或修改子卡信息
|
||||
submitFrom(){
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form1.id) {
|
||||
editCardValueChild(this.form1).then(res => {
|
||||
if (res.data==1){
|
||||
this.$modal.msgSuccess("修改成功!")
|
||||
this.dialogVisible = false
|
||||
this.getList()
|
||||
}else {
|
||||
this.$modal.msgError("手机号已存在,请重新添加")
|
||||
}
|
||||
})
|
||||
}else {
|
||||
addCardValueChild(this.form1).then(res => {
|
||||
if (res.data.success=="添加成功!"){
|
||||
this.$modal.msgSuccess("添加成功!")
|
||||
this.dialogVisible = false
|
||||
this.getList()
|
||||
}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 => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
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 => {
|
||||
|
@ -421,7 +421,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
|
||||
if (activeDiscountPayVO.getOilId().contains(paymentActiveDTO.getOilId().toString()) &&
|
||||
activeDiscountPayVO.getAdaptUser().contains(paymentActiveDTO.getMtUserLevel().toString())){
|
||||
if (activeDiscountPayVO.getAmount().multiply(activeDiscountPayVO.getDiscount()).compareTo(amount) > 0){
|
||||
amount = paymentActiveDTO.getAmount().subtract(((b.subtract(activeDiscountPayVO.getDiscount())).multiply(activeDiscountPayVO.getAmount()).multiply(a)));
|
||||
amount = paymentActiveDTO.getAmount().subtract(((b.subtract(activeDiscountPayVO.getDiscount())).multiply(paymentActiveDTO.getAmount()).multiply(a)));
|
||||
paymentActiveVO.setActiveId(activeDiscountPayVO.getActiveId());
|
||||
paymentActiveVO.setAmount(amount);
|
||||
paymentActiveVO.setFavorableAmount((b.subtract(activeDiscountPayVO.getDiscount())).multiply(activeDiscountPayVO.getAmount()).multiply(a));
|
||||
@ -439,10 +439,10 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
|
||||
if ((paymentActiveDTO.getAmount()).compareTo(activeDiscountPayVO.getAmount()) >= 0){
|
||||
fullAmount = paymentActiveDTO.getAmount().subtract(activeDiscountPayVO.getDiscount());
|
||||
if (amount.compareTo(fullAmount) > 0){
|
||||
amount = paymentActiveDTO.getAmount().subtract(fullAmount);
|
||||
amount = paymentActiveDTO.getAmount().subtract(activeDiscountPayVO.getDiscount());
|
||||
paymentActiveVO.setActiveId(activeDiscountPayVO.getActiveId());
|
||||
paymentActiveVO.setAmount(amount);
|
||||
paymentActiveVO.setFavorableAmount(paymentActiveDTO.getAmount().subtract(activeDiscountPayVO.getDiscount()));
|
||||
paymentActiveVO.setFavorableAmount(paymentActiveDTO.getAmount().subtract(fullAmount));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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<>();
|
||||
|
@ -354,6 +354,7 @@
|
||||
LEFT JOIN active_discount_child adc ON ad.id = adc.active_discount_id
|
||||
where ad.store_id = #{storeId}
|
||||
and adc.amount <= #{amount}
|
||||
and ad.status = 0
|
||||
</select>
|
||||
|
||||
<select id="selectActiveFule" resultType="com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountPayVO">
|
||||
@ -369,6 +370,7 @@
|
||||
LEFT JOIN active_discount_child adc ON af.id = adc.active_fullminus_id
|
||||
where af.store_id = #{storeId}
|
||||
and adc.amount <= #{amount}
|
||||
and status = 0
|
||||
</select>
|
||||
|
||||
<select id="selectActiveConsumption" resultType="com.fuint.business.marketingActivity.activeDiscount.vo.ActiveConsumptionVO">
|
||||
|
@ -14,6 +14,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 +30,10 @@ public class CardValueChildOrderServiceImpl extends ServiceImpl<CardValueChildOr
|
||||
|
||||
@Override
|
||||
public IPage<CardValueChildOrderVo> selectCardValueChildOrderList(Page page, CardValueChildOrderVo cardValueChildOrderVo) {
|
||||
if (cardValueChildOrderVo.getStoreId()==null){
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
cardValueChildOrderVo.setStoreId(nowAccountInfo.getStoreId());
|
||||
}
|
||||
return baseMapper.selectCardValueChildOrderList(page,cardValueChildOrderVo);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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>
|
||||
|
@ -95,6 +95,8 @@ public interface LJUserGradeService extends IService<LJUserGrade> {
|
||||
*/
|
||||
public int insertUserGrade(LJUserGrade userGrade,Integer storeId);
|
||||
|
||||
List<LJUserGrade> selectUserGradeByChainStoreId(Integer chainStoreId);
|
||||
|
||||
/**
|
||||
* 修改会员等级信息
|
||||
* @param userGrade
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -253,20 +253,27 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper,SysDept> imple
|
||||
|
||||
QRCode qrCode = new QRCode();
|
||||
iqrCodeService.insertQRCode(qrCode,store.getId());
|
||||
LJUserGrade userGrade = new LJUserGrade();
|
||||
userGrade.setStoreId(store.getId());
|
||||
userGrade.setGrade(1);
|
||||
userGrade.setName("普通会员");
|
||||
userGrade.setStatus("qy");
|
||||
userGrade.setGrowthValue(1);
|
||||
userGrade.setPreferential("自定义优惠");
|
||||
userGrade.setGasolineDiscount("无优惠");
|
||||
userGrade.setGasolineRule("[{\"gasolineRule1\":1,\"gasolineRule2\":1,\"gasolineRule3\":1}]");
|
||||
userGrade.setDieselDiscount("无优惠");
|
||||
userGrade.setDieselRule("[{\"dieselRule1\":1,\"dieselRule2\":1,\"dieselRule3\":1}]");
|
||||
userGrade.setNaturalGasDiscount("无优惠");
|
||||
userGrade.setNaturalGasRule("[{\"naturalGas1\":1,\"naturalGas2\":1,\"naturalGas3\":1}]");
|
||||
userGradeService.insertUserGrade(userGrade,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");
|
||||
userGrade.setGrowthValue(1);
|
||||
userGrade.setPreferential("自定义优惠");
|
||||
userGrade.setGasolineDiscount("无优惠");
|
||||
userGrade.setGasolineRule("[{\"gasolineRule1\":1,\"gasolineRule2\":1,\"gasolineRule3\":1}]");
|
||||
userGrade.setDieselDiscount("无优惠");
|
||||
userGrade.setDieselRule("[{\"dieselRule1\":1,\"dieselRule2\":1,\"dieselRule3\":1}]");
|
||||
userGrade.setNaturalGasDiscount("无优惠");
|
||||
userGrade.setNaturalGasRule("[{\"naturalGas1\":1,\"naturalGas2\":1,\"naturalGas3\":1}]");
|
||||
userGradeService.insertUserGrade(userGrade,store.getId());
|
||||
}
|
||||
|
||||
|
||||
}else {
|
||||
throw new Exception("数据有误,请联系管理员");
|
||||
|
@ -691,6 +691,7 @@
|
||||
}
|
||||
_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.chooseRefuelMoney()
|
||||
|
Loading…
Reference in New Issue
Block a user