优化项
This commit is contained in:
parent
087b4ded03
commit
a61a99cde7
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,
|
||||||
|
})
|
||||||
|
}
|
@ -436,7 +436,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="新手机号" prop="mobile" style="width: 420px">
|
<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 style="font-size: 12px;color: grey">
|
||||||
手机号更换后,旧手机号将无法使用,更换后实时生效
|
手机号更换后,旧手机号将无法使用,更换后实时生效
|
||||||
</span>
|
</span>
|
||||||
@ -536,101 +536,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</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>
|
||||||
<el-tabs v-model="subCardActive" @tab-click="handleClick">
|
<cardValueChild :pUserId="form.id"></cardValueChild>
|
||||||
<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>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 每日交易次数-->
|
<!-- 每日交易次数-->
|
||||||
@ -715,6 +623,7 @@ import pointsRecord from "@/views/member/userInfoOrder/pointsRecord.vue";
|
|||||||
import couponList from "@/views/member/userInfoOrder/couponList.vue";
|
import couponList from "@/views/member/userInfoOrder/couponList.vue";
|
||||||
import growthValueRecord from "@/views/member/userInfoOrder/growthValueRecord.vue";
|
import growthValueRecord from "@/views/member/userInfoOrder/growthValueRecord.vue";
|
||||||
import refuelMoneyRecord from "@/views/member/userInfoOrder/refuelMoneyRecord.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 {allFixingLevel, getFixingLevel} from "@/api/staff/user/fixinglevel";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -727,6 +636,7 @@ export default {
|
|||||||
couponList,
|
couponList,
|
||||||
growthValueRecord,
|
growthValueRecord,
|
||||||
refuelMoneyRecord,
|
refuelMoneyRecord,
|
||||||
|
cardValueChild,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
item() {
|
item() {
|
||||||
@ -1012,6 +922,7 @@ export default {
|
|||||||
const commissionAmount = totalAmount.multipliedBy(percentageCommissions).dividedBy(100).decimalPlaces(2);
|
const commissionAmount = totalAmount.multipliedBy(percentageCommissions).dividedBy(100).decimalPlaces(2);
|
||||||
this.cardValueForm.amountCommission = commissionAmount
|
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>
|
@ -71,7 +71,26 @@ public class CardValudChildrensController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping("/list/{storeId}")
|
@GetMapping("/list/{storeId}")
|
||||||
public ResponseObject list(@PathVariable Integer 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);
|
Map<String,String> add(CardValudChildrens cardValudChildrens);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询当前用户的子卡信息
|
* 修改数据
|
||||||
|
* @param cardValudChildrens
|
||||||
* @return
|
* @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和子卡手机号查询子卡信息
|
* 根据店铺id和子卡手机号查询子卡信息
|
||||||
|
@ -50,18 +50,26 @@ public class CardValudChildrensServiceImpl extends ServiceImpl<CardValudChildren
|
|||||||
@Override
|
@Override
|
||||||
public Map<String,String> add(CardValudChildrens cardValudChildrens) {
|
public Map<String,String> add(CardValudChildrens cardValudChildrens) {
|
||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
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<>();
|
Map<String,String> res = new HashMap<>();
|
||||||
if (ObjectUtils.isNotEmpty(cardValudChildrens)){
|
if (ObjectUtils.isNotEmpty(cardValudChildrens)){
|
||||||
LJUser user = userService.queryUserByUserId(nowAccountInfo.getId());
|
LJUser user = userService.queryUserByUserId(userId);
|
||||||
LJStore store = storeService.selectStoreByStoreId(cardValudChildrens.getStoreId());
|
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||||
UserBalance balance = userBalanceService.selectUserBalance(nowAccountInfo.getId(), store.getChainStoreId());
|
UserBalance balance = userBalanceService.selectUserBalance(userId, store.getChainStoreId());
|
||||||
if (user.getMobile().equals(cardValudChildrens.getCardChildPhones())){
|
if (user.getMobile().equals(cardValudChildrens.getCardChildPhones())){
|
||||||
res.put("error","添加失败,子卡手机号不能与主卡手机号一样!");
|
res.put("error","添加失败,子卡手机号不能与主卡手机号一样!");
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
cardValudChildrens.setCardValueId(balance.getId());
|
cardValudChildrens.setCardValueId(balance.getId());
|
||||||
|
|
||||||
List<CardValudChildrens> list = this.selectCardValudChildrensByUserId(cardValudChildrens.getStoreId());
|
List<CardValudChildrens> list = this.selectCardValudChildrensByUserId(userId,storeId);
|
||||||
if (list.size()>=2){
|
if (list.size()>=2){
|
||||||
res.put("error","添加失败,最多只能添加两张子卡!");
|
res.put("error","添加失败,最多只能添加两张子卡!");
|
||||||
return res;
|
return res;
|
||||||
@ -78,7 +86,8 @@ public class CardValudChildrensServiceImpl extends ServiceImpl<CardValudChildren
|
|||||||
res.put("error", "添加失败,此手机号已存在!");
|
res.put("error", "添加失败,此手机号已存在!");
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
cardValudChildrens.setUserId(nowAccountInfo.getId());
|
cardValudChildrens.setUserId(userId);
|
||||||
|
cardValudChildrens.setStoreId(storeId);
|
||||||
baseMapper.insert(cardValudChildrens);
|
baseMapper.insert(cardValudChildrens);
|
||||||
res.put("success", "添加成功!");
|
res.put("success", "添加成功!");
|
||||||
}
|
}
|
||||||
@ -87,10 +96,45 @@ public class CardValudChildrensServiceImpl extends ServiceImpl<CardValudChildren
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
|
if (userId==null){
|
||||||
|
userId = nowAccountInfo.getId();
|
||||||
|
}
|
||||||
|
if (storeId==null){
|
||||||
|
storeId = nowAccountInfo.getStoreId();
|
||||||
|
}
|
||||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||||
UserBalance balance = userBalanceService.selectUserBalance(nowAccountInfo.getId(), store.getChainStoreId());
|
UserBalance balance = userBalanceService.selectUserBalance(userId, store.getChainStoreId());
|
||||||
List<CardValudChildrens> list = null;
|
List<CardValudChildrens> list = null;
|
||||||
if (ObjectUtils.isNotEmpty(balance)){
|
if (ObjectUtils.isNotEmpty(balance)){
|
||||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||||
@ -101,6 +145,21 @@ public class CardValudChildrensServiceImpl extends ServiceImpl<CardValudChildren
|
|||||||
return list;
|
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
|
@Override
|
||||||
public CardValudChildrens selectCardValueChildrenByMobileAndStoreId(String mobile, Integer storeId) {
|
public CardValudChildrens selectCardValueChildrenByMobileAndStoreId(String mobile, Integer storeId) {
|
||||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||||
|
@ -14,6 +14,8 @@ import com.fuint.business.storeInformation.entity.LJStore;
|
|||||||
import com.fuint.business.storeInformation.service.ILJStoreService;
|
import com.fuint.business.storeInformation.service.ILJStoreService;
|
||||||
import com.fuint.business.userManager.entity.LJUser;
|
import com.fuint.business.userManager.entity.LJUser;
|
||||||
import com.fuint.business.userManager.service.LJUserService;
|
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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -28,6 +30,10 @@ public class CardValueChildOrderServiceImpl extends ServiceImpl<CardValueChildOr
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<CardValueChildOrderVo> selectCardValueChildOrderList(Page page, CardValueChildOrderVo cardValueChildOrderVo) {
|
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);
|
return baseMapper.selectCardValueChildOrderList(page,cardValueChildOrderVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +33,9 @@ public class LJUserGrade extends BaseEntity implements Serializable {
|
|||||||
@TableId(value = "ID", type = IdType.AUTO)
|
@TableId(value = "ID", type = IdType.AUTO)
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty("连锁店ID")
|
||||||
|
private Integer chainStoreId;
|
||||||
|
|
||||||
@ApiModelProperty("店铺ID")
|
@ApiModelProperty("店铺ID")
|
||||||
private Integer storeId;
|
private Integer storeId;
|
||||||
|
|
||||||
|
@ -691,6 +691,7 @@
|
|||||||
}
|
}
|
||||||
_this.user = res.data.userVo;
|
_this.user = res.data.userVo;
|
||||||
_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!=""){
|
if (res.data.userVo.refuelMoney!=null && res.data.userVo.refuelMoney!=""){
|
||||||
_this.refuelMoney = JSON.parse(res.data.userVo.refuelMoney)
|
_this.refuelMoney = JSON.parse(res.data.userVo.refuelMoney)
|
||||||
_this.chooseRefuelMoney()
|
_this.chooseRefuelMoney()
|
||||||
|
Loading…
Reference in New Issue
Block a user