This commit is contained in:
wangh 2024-02-29 17:02:13 +08:00
commit 46282a3edb
33 changed files with 781 additions and 361 deletions

View File

@ -42,3 +42,9 @@ export function delExchange(id) {
method: 'delete' method: 'delete'
}) })
} }
export function getqueryGoods() {
return request({
url: 'business/convenience/goods/queryGoods',
method: 'get'
})
}

View File

@ -51,7 +51,15 @@ export function deleteList(id) {
export function getoilnum(id) { export function getoilnum(id) {
return request({ return request({
url: 'petrolStationManagement/oilNumber/getOilPrice/'+id, url: 'business/petrolStationManagement/oilNumber/getOilPrice/'+id,
method: 'get',
})
}
// 统计
export function getstatistics() {
return request({
url: 'business/marketingActivity/cardFuelRecord/selectFuelRecordCount',
method: 'get', method: 'get',
}) })

View File

@ -8,7 +8,7 @@
</div> </div>
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm"> <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="活动图片" prop="activePictureUrl"> <!-- <el-form-item label="活动图片" prop="activePictureUrl">
<el-upload <el-upload
:action="uploadAction" :action="uploadAction"
list-type="picture-card" list-type="picture-card"
@ -24,7 +24,7 @@
/> />
<i v-if="!this.ruleForm.activePictureUrl" class="el-icon-plus"></i> <i v-if="!this.ruleForm.activePictureUrl" class="el-icon-plus"></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>-->
<el-form-item label="邀请人获得" prop="inviterGiftType"> <el-form-item label="邀请人获得" prop="inviterGiftType">
<el-checkbox-group v-model="ruleForm.inviterGiftType" > <el-checkbox-group v-model="ruleForm.inviterGiftType" >
<el-checkbox v-for="city in Typelist" :label="city.type" :key="city.type">{{city.text}}</el-checkbox> <el-checkbox v-for="city in Typelist" :label="city.type" :key="city.type">{{city.text}}</el-checkbox>
@ -243,7 +243,7 @@
</div> </div>
</div> </div>
<el-form-item label="分享标题" prop="title"> <!-- <el-form-item label="分享标题" prop="title">
<el-input v-model="ruleForm.title"></el-input> <el-input v-model="ruleForm.title"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="分享图片" prop="titleUrl"> <el-form-item label="分享图片" prop="titleUrl">
@ -262,13 +262,13 @@
/> />
<i v-if="!this.ruleForm.titleUrl" class="el-icon-plus"></i> <i v-if="!this.ruleForm.titleUrl" class="el-icon-plus"></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>-->
<el-form-item label="邀请二维码" prop="invitationCodeType"> <!-- <el-form-item label="邀请二维码" prop="invitationCodeType">
<el-radio-group v-model="ruleForm.invitationCodeType"> <el-radio-group v-model="ruleForm.invitationCodeType">
<el-radio label="0">小程序码</el-radio> <el-radio label="0">小程序码</el-radio>
<el-radio label="1">参数二维码</el-radio> <el-radio label="1">参数二维码</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>-->
<!-- <el-form-item label="奖励显示" prop="rewardDisplay"> <!-- <el-form-item label="奖励显示" prop="rewardDisplay">
<el-radio-group v-model="ruleForm.rewardDisplay"> <el-radio-group v-model="ruleForm.rewardDisplay">
<el-radio label="0">优惠券总额</el-radio> <el-radio label="0">优惠券总额</el-radio>
@ -598,9 +598,9 @@ export default {
form: {}, form: {},
// //
rules: { rules: {
activePictureUrl: [ /*activePictureUrl: [
{ required: true, message: '必填项不能为空', trigger: 'blur' }, { required: true, message: '必填项不能为空', trigger: 'blur' },
], ],*/
inviterGiftType: [ inviterGiftType: [
{ required: true, message: '必填项不能为空', trigger: 'blur' }, { required: true, message: '必填项不能为空', trigger: 'blur' },
], ],
@ -610,9 +610,6 @@ export default {
growthValue: [ growthValue: [
{ required: true, message: '必填项不能为空', trigger: 'blur' }, { required: true, message: '必填项不能为空', trigger: 'blur' },
], ],
title: [
{ required: true, message: '必填项不能为空', trigger: 'blur' },
],
invitationCodeType:[ invitationCodeType:[
{ required: true, message: '必填项不能为空', trigger: 'blur' }, { required: true, message: '必填项不能为空', trigger: 'blur' },
], ],

View File

@ -142,7 +142,7 @@
</el-card> </el-card>
<!-- 添加或修改兑换券对话框 --> <!-- 添加或修改兑换券对话框 -->
<el-dialog :title="title" :visible.sync="open" width="40%" append-to-body> <el-dialog :title="title" :visible.sync="open" width="40%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" :label-position="labelPosition" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" :label-position="labelPosition" label-width="140px">
<!-- <el-form-item label="所属连锁店id" prop="chainStorId">--> <!-- <el-form-item label="所属连锁店id" prop="chainStorId">-->
<!-- <el-input v-model="form.chainStorId" placeholder="请输入所属连锁店id" />--> <!-- <el-input v-model="form.chainStorId" placeholder="请输入所属连锁店id" />-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
@ -160,8 +160,16 @@
</el-radio-group> </el-radio-group>
<!-- <p v-if="form.type == 2" style="color: red">洗车卡为不限次数卡,仅在有效期内可用,如按次数,请选择洗车券</p>--> <!-- <p v-if="form.type == 2" style="color: red">洗车卡为不限次数卡,仅在有效期内可用,如按次数,请选择洗车券</p>-->
</el-form-item> </el-form-item>
<el-form-item label="选择兑换商品" prop="giftName"> <el-form-item label="选择兑换商品" prop="giftId">
<el-input type="textarea" v-model="form.giftName" placeholder="请输入兑换礼品名"></el-input> <!-- <el-input type="textarea" v-model="form.giftName" placeholder="请输入兑换礼品名"></el-input>-->
<el-select v-model="form.giftId" placeholder="请选择" @change="change" >
<el-option
v-for="dict in goodsList"
:key="dict.id.toString()"
:label="dict.name"
:value="dict.id">
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="卡券有效期" prop="validity"> <el-form-item label="卡券有效期" prop="validity">
<el-input type="number" placeholder="请输入卡券有效期" v-model="form.validity"> <el-input type="number" placeholder="请输入卡券有效期" v-model="form.validity">
@ -211,13 +219,15 @@ import {
getExchange, getExchange,
delExchange, delExchange,
addExchange, addExchange,
updateExchange updateExchange,
getqueryGoods
} from '@/api/EventMarketing/cardExchange' } from '@/api/EventMarketing/cardExchange'
export default { export default {
name: 'Exchange', name: 'Exchange',
data() { data() {
return { return {
goodsList:[],
labelPosition:'left', labelPosition:'left',
centerDialogVisible: false, centerDialogVisible: false,
loadingdialog:true, loadingdialog:true,
@ -290,6 +300,11 @@ export default {
}, },
methods: { methods: {
change(e){
console.log(e)
this.form.giftId = e
},
qrcodelook(url) { qrcodelook(url) {
this.loadingdialog = true this.loadingdialog = true
this.centerDialogVisible = true this.centerDialogVisible = true
@ -317,6 +332,10 @@ export default {
this.total = response.data.total this.total = response.data.total
this.loading = false this.loading = false
}) })
getqueryGoods().then(res=>{
console.log(res)
this.goodsList = res.data
})
}, },
// //
cancel() { cancel() {
@ -377,6 +396,7 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
console.log(this.form)
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {

View File

@ -50,65 +50,115 @@
</div> </div>
</el-card> </el-card>
<div class="tj"> <div class="tjaocuo">
<div class="sshi">
<el-card class="kar" >
<div class="tj-num">总发卡量</div>
</el-card>
<el-card class="kar" v-for="(item,index) in onelist" :key="index" >
<div class="ds" >
<div class="tj-num"> <div class="sshi">
面值:{{item.cardAmount || 0}} <div class="tj-text">总发卡量</div>
<el-divider></el-divider>
<div class="tj-num" v-if="onelist&&onelist.length == 0 ">暂无数据...</div>
<div>
</div>
<div class="ds"v-for="(item,index) in onelist" :key="index" >
<div class="tj-num">
<div class="one-size">
{{item.cardAmount || 0}}
</div> </div>
<div class="tj-num"> <div >
总发卡金额:{{item.total || 0}} 面值
</div>
<div class="tj-num">
总数量:{{item.count || 0}}
</div> </div>
</div> </div>
</el-card> <div class="tj-num">
<div class="two-size">
{{item.total || 0}}
</div>
<div>
总发卡金额
</div>
</div>
<div class="tj-num">
<div class="three-size">{{item.count || 0}}</div>
<div>
总数量
</div>
</div>
</div>
</div> </div>
<div class="sshi"> <div class="sshi">
<el-card class="kar" > <div class="tj-text">已使用卡量</div>
<div class="tj-num">已使用卡量</div> <el-divider></el-divider>
</el-card> <div class="tj-num" v-if="twolist&&twolist.length == 0 ">暂无数据...</div>
<el-card class="kar" v-for="(item,index) in twolist" :key="index" > <div>
<div class="ds"> </div>
<div class="ds"v-for="(item,index) in twolist" :key="index" >
<div class="tj-num"> <div class="tj-num">
面值:{{item.cardAmount || 0}} <div class="one-size">
{{item.cardAmount || 0}}
</div> </div>
<div class="tj-num"> <div >
总发卡金额:{{item.total || 0}} 面值
</div>
<div class="tj-num">
总数量:{{item.count || 0}}
</div> </div>
</div> </div>
</el-card> <div class="tj-num">
<div class="two-size">
{{item.total || 0}}
</div>
<div>
总发卡金额
</div>
</div>
<div class="tj-num">
<div class="three-size">{{item.count || 0}}</div>
<div>
总数量
</div>
</div>
</div>
</div> </div>
<div class="sshi"> <div class="sshi">
<el-card class="kar" > <div class="tj-text">未使用卡量</div>
<div class="tj-num">未使用卡量</div> <el-divider></el-divider>
</el-card> <div class="tj-num" v-if="threelist&&threelist.length == 0 ">暂无数据...</div>
<el-card class="kar" v-for="(item,index) in threelist" :key="index" > <div>
<div class="ds"> </div>
<div class="ds"v-for="(item,index) in threelist" :key="index" >
<div class="tj-num"> <div class="tj-num">
面值:{{item.cardAmount || 0}} <div class="one-size">
{{item.cardAmount || 0}}
</div> </div>
<div class="tj-num"> <div >
总发卡金额:{{item.total || 0}} 面值
</div>
<div class="tj-num">
总数量:{{item.count || 0}}
</div> </div>
</div> </div>
<div class="tj-num">
<div class="two-size">
{{item.total || 0}}
</div>
<div>
总发卡金额
</div>
</div>
<div class="tj-num">
<div class="three-size">{{item.count || 0}}</div>
<div>
总数量
</div>
</div>
</div>
</el-card>
</div> </div>
@ -452,9 +502,8 @@ import {
.tj{ .tj{
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-bottom: 20px;
} }
.kar{ .kar{
width: 100%; width: 100%;
@ -462,14 +511,38 @@ import {
margin-bottom: 10px; margin-bottom: 10px;
} }
.one-size{
font-size: 20px;
font-weight: bold;
color: #000;
}
.two-size{
font-size: 20px;
font-weight: bold;
color: #78b0fb;
}
.three-size{
font-size: 20px;
font-weight: bold;
color: #f73f3f;
}
.ds{ .ds{
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
background: #f4f4f4;
border-radius: 6px;
margin-bottom: 15px;
box-sizing: border-box;
padding: 15px 5px;
}
.tj-text{
font-size: 18px;
font-weight: bold;
} }
.tj-num{ .tj-num{
margin: 5px auto; margin: 5px auto;
font-size: 28px; //font-size: 28px;
color: #666; color: #666;
text-align: center; text-align: center;
} }
@ -494,5 +567,21 @@ import {
} }
.sshi{ .sshi{
width: 33%; width: 33%;
background: #FFFFFF;
box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
box-sizing: border-box;
padding: 15px;
border-radius: 6px;
//background: #f9f9f9;
}
.tjaocuo{
width: 100%;
margin-bottom: 15px;
display: flex;
justify-content: space-between;
} }
</style> </style>

View File

@ -30,6 +30,20 @@
<el-button type="primary" style="margin-left: 20px" icon="el-icon-search" @click="getlist">搜索</el-button> <el-button type="primary" style="margin-left: 20px" icon="el-icon-search" @click="getlist">搜索</el-button>
</div> </div>
</el-card> </el-card>
<el-card style="margin-bottom: 15px">
<div style="margin-bottom: 15px">统计</div>
<el-divider></el-divider>
<div class="wrap-box">
<div class="tjbox" v-for="(item,index) in tjlist" :key="index" >
<div>油品名称: <span class="cu">{{item.oilName}}</span> </div>
<div>总参与人数: <span class="cu">{{item.peoples}}</span></div>
<div>售出总金额: <span class="cu">{{item.money}}</span></div>
<div>售出总升数: <span class="cu">{{item.litres}}</span></div>
</div>
</div>
</el-card>
<el-card style="margin-bottom: 20px"> <el-card style="margin-bottom: 20px">
<el-button type="primary" icon="el-icon-plus" style="margin-bottom: 10px " @click="addoilBlock()">新增囤油卡</el-button> <el-button type="primary" icon="el-icon-plus" style="margin-bottom: 10px " @click="addoilBlock()">新增囤油卡</el-button>
<el-alert <el-alert
@ -41,76 +55,98 @@
:data="tableData" :data="tableData"
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
label="序号"
type="index" type="index"
> >
</el-table-column> </el-table-column>
<el-table-column
prop="lockupPrice"
label="囤油锁定价(元)/L"
>
</el-table-column>
<el-table-column
prop="oilPrice"
label="当前挂牌价(元)/L"
>
</el-table-column>
<el-table-column
prop="gbPrice"
label="当前国标价(元)/L"
>
</el-table-column>
<el-table-column <el-table-column
prop="type" prop="type"
label="油卡类型" label="活动时间"
width="330"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag>{{scope.row.type}}</el-tag> <div style="display: flex;align-items: center">
<div>{{scope.row.createTime}}</div>
<div> --- </div>
<div>{{scope.row.endTime}}</div>
</div>
<!-- <el-tag>{{scope.row.type}}</el-tag>-->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="oilType" prop="type"
label="油品" label="限制时间"
> width="350"
>
<template slot-scope="scope">
<div style="display: flex;align-items: center" v-if="scope.row.stipulateTimeS">
<div>{{scope.row.stipulateTimeS}}</div>
<div> --- </div>
<div>{{scope.row.stipulateTimeE}}</div>
</div>
<!-- <el-tag>{{scope.row.type}}</el-tag>-->
</template>
</el-table-column> </el-table-column>
<!-- <el-table-column-->
<!-- prop="oilType"-->
<!-- label="油品"-->
<!-- >-->
<!-- </el-table-column>-->
<el-table-column <el-table-column
prop="rechargeBalance" prop="rechargeBalance"
label="充值金额" label="充值金额(元)"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag>{{scope.row.rechargeBalance}}</el-tag> <el-tag>{{scope.row.rechargeBalance}}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column-->
prop="lockupPrice" <!-- prop="lockupPrice"-->
label="锁价单价" <!-- label="锁价单价"-->
> <!-- >-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<el-tag>{{scope.row.lockupPrice}}</el-tag> <!-- <el-tag>{{scope.row.lockupPrice}}</el-tag>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column <el-table-column
prop="incomeLitres" prop="incomeLitres"
label="升数" label="所得升数L"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag>{{scope.row.incomeLitres}}</el-tag> <el-tag>{{scope.row.incomeLitres}}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
prop="points" <!-- <el-table-column-->
label="赠送积分" <!-- prop="points"-->
> <!-- label="赠送积分"-->
<template slot-scope="scope"> <!-- >-->
<el-tag>{{scope.row.points}}</el-tag> <!-- <template slot-scope="scope">-->
</template> <!-- <el-tag>{{scope.row.points}}</el-tag>-->
</el-table-column> <!-- </template>-->
<el-table-column <!-- </el-table-column>-->
prop="activeTime"
label="活动时间"
>
<template slot-scope="scope">
<span v-if="scope.row.activeTime == 1">不限时间</span>
<span v-if="scope.row.activeTime == 2">自定义时间</span>
</template>
</el-table-column>
<el-table-column
prop="activityProgress"
label="活动进度"
>
<template slot-scope="scope">
<el-tag type="info"v-if="scope.row.activityProgress == 2">已结束</el-tag>
<el-tag type="success" v-if="scope.row.activityProgress == 1">进行中</el-tag>
<el-tag type="danger" v-if="scope.row.activityProgress == 0">待开始</el-tag>
</template>
</el-table-column>
<el-table-column <el-table-column
prop="activeStatus" prop="activeStatus"
label="状态" label="活动状态"
> >
<template slot-scope="scope"> <template slot-scope="scope">
@ -125,11 +161,7 @@
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
prop="createTime"
align="center"
label="更新时间">
</el-table-column>
<el-table-column <el-table-column
label="编辑" label="编辑"
> >
@ -161,27 +193,20 @@
center> center>
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px" class="demo-ruleForm"> <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px" class="demo-ruleForm">
<div style="display: flex; align-items: center ">
<el-form-item label="油品类型" prop="oilType">
<el-select v-model="ruleForm.oilType" placeholder="请选择" @change="getoiltype" >
<el-option
v-for="dict in oilList"
:key="dict.id.toString()"
:label="dict.oilName"
:value="dict.id.toString()">
</el-option>
</el-select>
</el-form-item>
<div style="margin-left: 10px" v-if="oilPrice&&gbPrice">今日油价<span style="color: red">{{oilPrice || ''}}</span> /L 国标油价<span style="color: red">{{oilPrice || ''}}</span>/L </div>
</div>
<el-form-item label="油品类型" prop="oilType">
<el-select v-model="ruleForm.oilType" placeholder="请选择" >
<el-option
v-for="dict in oilList"
:key="dict.id.toString()"
:label="dict.oilName"
:value="dict.id.toString()">
</el-option>
</el-select>
<!-- <el-radio-group v-model="ruleForm.oilType" >-->
<!-- <el-radio-->
<!-- v-for="dict in oilList"-->
<!-- :key="dict.id"-->
<!-- :label="dict.oilName"-->
<!-- :value="dict.id"-->
<!-- />-->
<!-- </el-radio-group>-->
</el-form-item>
<el-form-item label="锁价单价" prop="lockupPrice"> <el-form-item label="锁价单价" prop="lockupPrice">
<el-input v-model="ruleForm.lockupPrice" min="1"> <el-input v-model="ruleForm.lockupPrice" min="1">
@ -255,12 +280,15 @@
</template> </template>
<script> <script>
import { getList,oilName,addList,eitList,getById,getoilnum} from "@/api/EventMarketing/oilBlock"; import { getList,oilName,addList,eitList,getById,getoilnum,getstatistics} from "@/api/EventMarketing/oilBlock";
export default { export default {
dicts: ['oil_type'], dicts: ['oil_type'],
name: 'index', name: 'index',
data(){ data(){
return{ return{
gbPrice:null,
oilPrice:null,
tjlist:[],
value:'', value:'',
type:0, type:0,
centerDialogVisible:false, centerDialogVisible:false,
@ -344,7 +372,6 @@
}, },
'ruleForm.lockupPrice':{ 'ruleForm.lockupPrice':{
handler: function() { handler: function() {
if(this.ruleForm.rechargeBalance != 0 && this.ruleForm.lockupPrice != 0 ){ if(this.ruleForm.rechargeBalance != 0 && this.ruleForm.lockupPrice != 0 ){
this.ruleForm.incomeLitres = this.ruleForm.rechargeBalance / this.ruleForm.lockupPrice this.ruleForm.incomeLitres = this.ruleForm.rechargeBalance / this.ruleForm.lockupPrice
@ -366,8 +393,19 @@
}, },
methods:{ methods:{
//
// getoiltype(e){
getoilnum(e).then(res=>{
console.log(res)
if(res.code == 200){
this.gbPrice = res.data.gbPrice
this.oilPrice = res.data.oilPrice
}
})
},
radiovalue(lable){ radiovalue(lable){
this.oilList = [] this.oilList = []
oilName(this.queryParams.type).then(res=>{ oilName(this.queryParams.type).then(res=>{
@ -385,6 +423,10 @@
this.total = res.data.total; this.total = res.data.total;
} }
}) })
getstatistics().then(res=>{
console.log(res)
this.tjlist = res.data
})
}, },
addoilBlock(){ addoilBlock(){
@ -454,4 +496,22 @@
display: flex; display: flex;
align-items: center; align-items: center;
} }
.tjbox{
width: 19%;
background: #f9f9f9;
margin-right: 1%;
margin-bottom: 1%;
box-sizing: border-box;
padding: 15px;
border-radius: 6px;
}
.cu{
font-weight: bold;
}
.wrap-box{
width: 100%;
display: flex;
flex-wrap: wrap;
margin-bottom: 20px;
}
</style> </style>

View File

@ -91,7 +91,7 @@
</el-card> </el-card>
<el-card style="margin-top: 20px"> <el-card style="margin-top: 20px">
<div> <div v-if="activeName=='goods'">
<el-button <el-button
type="primary" type="primary"
@click="batchGrounding('qy')" @click="batchGrounding('qy')"

View File

@ -254,7 +254,7 @@
</el-card> </el-card>
<!-- 添加会员信息选择是否批量录入--> <!-- 添加会员信息选择是否批量录入-->
<el-dialog :title="title" width="55%" :visible.sync="openUser" append-to-body> <el-dialog :title="title" width="40%" :visible.sync="openUser" append-to-body>
<el-alert <el-alert
type="info" type="info"
:closable="false"> :closable="false">
@ -268,31 +268,31 @@
<el-button type="primary" <el-button type="primary"
icon="el-icon-connection" @click="addMult" round>批量导入会员</el-button> icon="el-icon-connection" @click="addMult" round>批量导入会员</el-button>
</div> </div>
<div> <!-- <div>-->
<el-table ref="tables" v-loading="loading" :data="userList"> <!-- <el-table ref="tables" v-loading="loading" :data="userList">-->
<el-table-column prop="batchNumber" align="center" label="批次号" width="200"/> <!-- <el-table-column prop="batchNumber" align="center" label="批次号" width="200"/>-->
<el-table-column prop="type" align="center" label="类型"/> <!-- <el-table-column prop="type" align="center" label="类型"/>-->
<el-table-column prop="memberNumber" align="center" label="会员数"/> <!-- <el-table-column prop="memberNumber" align="center" label="会员数"/>-->
<el-table-column label="执行结果" align="center" > <!-- <el-table-column label="执行结果" align="center" >-->
<el-table-column prop="successNumber" align="center" label="成功人数"/> <!-- <el-table-column prop="successNumber" align="center" label="成功人数"/>-->
<el-table-column prop="errorNumber" align="center" label="失败人数"/> <!-- <el-table-column prop="errorNumber" align="center" label="失败人数"/>-->
<el-table-column prop="repeatNumber" align="center" label="重复人数"/> <!-- <el-table-column prop="repeatNumber" align="center" label="重复人数"/>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column prop="createTime" align="center" label="处理时间" width="160"> <!-- <el-table-column prop="createTime" align="center" label="处理时间" width="160">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<span>{{ parseTime(scope.row.createTime) }}</span> <!-- <span>{{ parseTime(scope.row.createTime) }}</span>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<!-- <el-table-column prop="date" align="center" label="处理结果详情"/>--> <!--&lt;!&ndash; <el-table-column prop="date" align="center" label="处理结果详情"/>&ndash;&gt;-->
</el-table> <!-- </el-table>-->
<pagination <!-- <pagination-->
:total="total1" <!-- :total="total1"-->
:page.sync="queryParams.page" <!-- :page.sync="queryParams.page"-->
:limit.sync="queryParams.pageSize" <!-- :limit.sync="queryParams.pageSize"-->
@pagination="getList" <!-- @pagination="getList"-->
/> <!-- />-->
</div> <!-- </div>-->
</el-dialog> </el-dialog>
<!-- 添加或修改对话框 --> <!-- 添加或修改对话框 -->

View File

@ -172,7 +172,7 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
} }
} }
} }
activeConsumptionVO.setDuihuanTotaled(youhuiTed); activeConsumptionVO.setYouhuiTotaled(youhuiTed);
activeConsumptionVO.setDuihuanTotaled(duihuanTed); activeConsumptionVO.setDuihuanTotaled(duihuanTed);
return activeConsumptionVO; return activeConsumptionVO;
}).collect(Collectors.toList()); }).collect(Collectors.toList());

View File

@ -39,6 +39,10 @@ public class ActiveNewlywedsVO {
private Integer points; private Integer points;
//赠送成长值 //赠送成长值
private Integer growthValue; private Integer growthValue;
private Integer youhuiTotal;
private Integer duihuanTotal;
private Integer youhuiTotaled;
private Integer duihuanTotaled;
//自定义规则 //自定义规则
private String remark; private String remark;
//新人有礼卡券列表 //新人有礼卡券列表

View File

@ -10,6 +10,7 @@ import com.fuint.business.marketingActivity.activeNewlyweds.dto.ActiveNewlywedsD
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlyweds; import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlyweds;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
/** /**
* 新人有礼活动(ActiveNewlyweds)表服务接口 * 新人有礼活动(ActiveNewlyweds)表服务接口
@ -39,7 +40,7 @@ public interface ActiveNewlywedsService extends IService<ActiveNewlyweds> {
* @param id * @param id
* @return * @return
*/ */
ActiveNewlywedsVO getOneById(Serializable id); List<ActiveNewlywedsVO> getOneById(Serializable id);
ActiveNewlywedsVO getOneByStoreId(Serializable id); ActiveNewlywedsVO getOneByStoreId(Serializable id);
ActiveNewlywedsVO getOneByIdApplet(ActiveConsumption activeConsumption); ActiveNewlywedsVO getOneByIdApplet(ActiveConsumption activeConsumption);

View File

@ -18,6 +18,10 @@ import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecomme
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendChild; import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendChild;
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendAppletVO; import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendAppletVO;
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendVO; import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendVO;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.store.service.StoreService; import com.fuint.business.store.service.StoreService;
import com.fuint.common.util.TokenUtil; import com.fuint.common.util.TokenUtil;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
@ -44,6 +48,10 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
private StoreService storeService; private StoreService storeService;
@Resource @Resource
private ActiveNewlywedsChildService activeNewlywedsChildService; private ActiveNewlywedsChildService activeNewlywedsChildService;
@Resource
private CardFavorableRecordService cardFavorableRecordService;
@Resource
private CardExchangeRecordService cardExchangeRecordService;
/** /**
* *
* @param activeNewlywedsDTO * @param activeNewlywedsDTO
@ -54,13 +62,13 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
boolean save = false; boolean save = false;
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId(); Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
//根据店铺id查询 //根据店铺id查询
LambdaQueryWrapper<ActiveNewlyweds> lambdaQueryWrapper = new LambdaQueryWrapper<>(); /*LambdaQueryWrapper<ActiveNewlyweds> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveNewlyweds::getStoreId,storeId); lambdaQueryWrapper.eq(ActiveNewlyweds::getStoreId,storeId);
ActiveNewlyweds one = getOne(lambdaQueryWrapper); ActiveNewlyweds one = getOne(lambdaQueryWrapper);
if (ObjectUtils.isNotEmpty(one)){ if (ObjectUtils.isNotEmpty(one)){
activeNewlywedsDTO.setId(one.getId()); activeNewlywedsDTO.setId(one.getId());
save = updateOneById(activeNewlywedsDTO); save = updateOneById(activeNewlywedsDTO);
}else { }else {*/
if (ObjectUtils.isNotEmpty(TokenUtil.getNowAccountInfo().getStoreId())) { if (ObjectUtils.isNotEmpty(TokenUtil.getNowAccountInfo().getStoreId())) {
activeNewlywedsDTO.setStoreId(TokenUtil.getNowAccountInfo().getStoreId()); activeNewlywedsDTO.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
activeNewlywedsDTO.setChainStoreId(storeService.getById(TokenUtil.getNowAccountInfo().getStoreId()).getChainStoreId()); activeNewlywedsDTO.setChainStoreId(storeService.getById(TokenUtil.getNowAccountInfo().getStoreId()).getChainStoreId());
@ -80,7 +88,7 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
return s; return s;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
save = activeNewlywedsChildService.saveBatch(list); save = activeNewlywedsChildService.saveBatch(list);
} //}
/* //获取当前店铺的id和连锁店id /* //获取当前店铺的id和连锁店id
if (ObjectUtils.isNotEmpty(TokenUtil.getNowAccountInfo().getStoreId())) { if (ObjectUtils.isNotEmpty(TokenUtil.getNowAccountInfo().getStoreId())) {
activeNewlywedsDTO.setStoreId(TokenUtil.getNowAccountInfo().getStoreId()); activeNewlywedsDTO.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
@ -151,36 +159,81 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
* @return * @return
*/ */
@Override @Override
public ActiveNewlywedsVO getOneById(Serializable id) { public List<ActiveNewlywedsVO> getOneById(Serializable id) {
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId(); Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
ActiveNewlywedsVO activeNewlywedsVO = new ActiveNewlywedsVO(); ArrayList<ActiveNewlywedsVO> activeNewlywedsVOS = new ArrayList<>();
activeNewlywedsVO.setCourtesyReward(new String[0]);
if (ObjectUtils.isNotEmpty(storeId)){ if (ObjectUtils.isNotEmpty(storeId)){
//获取新人有礼活动信息 //获取新人有礼活动信息
LambdaQueryWrapper<ActiveNewlyweds> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ActiveNewlyweds> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveNewlyweds::getStoreId,TokenUtil.getNowAccountInfo().getStoreId()); lambdaQueryWrapper.eq(ActiveNewlyweds::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
ActiveNewlyweds activeNewlyweds = getOne(lambdaQueryWrapper); //ActiveNewlyweds activeNewlyweds = getOne(lambdaQueryWrapper);
List<ActiveNewlyweds> list = list(lambdaQueryWrapper);
//获取兑换物品信息 //获取兑换物品信息
if (ObjectUtils.isNotEmpty(activeNewlyweds)){ if (CollectionUtils.isNotEmpty(list)){
LambdaQueryWrapper<ActiveNewlywedsChild> queryWrapper = new LambdaQueryWrapper<>(); for (ActiveNewlyweds activeNewlyweds : list) {
queryWrapper.eq(ActiveNewlywedsChild::getActiveNewlywedsId,activeNewlyweds.getId()); int youhuiTed = 0;
queryWrapper.orderByDesc(ActiveNewlywedsChild::getCreateTime); int duihuanTed = 0;
List<ActiveNewlywedsChild> activeNewlywedsChildList = activeNewlywedsChildService.list(queryWrapper); ActiveNewlywedsVO activeNewlywedsVO = new ActiveNewlywedsVO();
BeanUtils.copyProperties(activeNewlyweds,activeNewlywedsVO); activeNewlywedsVO.setCourtesyReward(new String[0]);
//封装VO返回 if (ObjectUtils.isNotEmpty(activeNewlyweds)){
activeNewlywedsVO.setCourtesyReward(activeNewlyweds.getCourtesyReward().split(",")); LambdaQueryWrapper<ActiveNewlywedsChild> queryWrapper = new LambdaQueryWrapper<>();
if (CollectionUtils.isNotEmpty(activeNewlywedsChildList)){ queryWrapper.eq(ActiveNewlywedsChild::getActiveNewlywedsId,activeNewlyweds.getId());
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList); queryWrapper.orderByDesc(ActiveNewlywedsChild::getCreateTime);
}else { List<ActiveNewlywedsChild> activeNewlywedsChildList = activeNewlywedsChildService.list(queryWrapper);
ArrayList<ActiveNewlywedsChild> activeNewlywedsChildLists = new ArrayList<>(); for (ActiveNewlywedsChild activeNewlywedsChild : activeNewlywedsChildList) {
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildLists); //优惠券
if (activeNewlywedsChild.getActiveGift().equals("1")){
LambdaQueryWrapper<CardFavorableRecord> queryWrappers = new LambdaQueryWrapper<>();
queryWrappers.eq(CardFavorableRecord::getActiveId,activeNewlywedsChild.getActiveNewlywedsId());
queryWrappers.eq(CardFavorableRecord::getCardFavorableId,activeNewlywedsChild.getVouchersId());
List<CardFavorableRecord> lists = cardFavorableRecordService.list(queryWrappers);
activeNewlywedsVO.setYouhuiTotal(list.size());
for (CardFavorableRecord cardFavorableRecord : lists) {
if (cardFavorableRecord.getStatus().equals("1")){
youhuiTed+=1;
}
}
}
//兑换券
if (activeNewlywedsChild.getActiveGift().equals("2")){
LambdaQueryWrapper<CardExchangeRecord> queryWrapperss = new LambdaQueryWrapper<>();
queryWrapperss.eq(CardExchangeRecord::getActiveId,activeNewlywedsChild.getActiveNewlywedsId());
queryWrapperss.eq(CardExchangeRecord::getCardExchangeId,activeNewlywedsChild.getVouchersId());
List<CardExchangeRecord> lisst = cardExchangeRecordService.list(queryWrapperss);
activeNewlywedsVO.setDuihuanTotal(list.size());
for (CardExchangeRecord cardExchangeRecord : lisst) {
if (cardExchangeRecord.getStatus().equals("1")){
duihuanTed+=1;
}
}
}
}
BeanUtils.copyProperties(activeNewlyweds,activeNewlywedsVO);
//封装VO返回
activeNewlywedsVO.setCourtesyReward(activeNewlyweds.getCourtesyReward().split(","));
activeNewlywedsVO.setYouhuiTotaled(youhuiTed);
activeNewlywedsVO.setDuihuanTotaled(duihuanTed);
if (CollectionUtils.isNotEmpty(activeNewlywedsChildList)){
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList);
activeNewlywedsVOS.add(activeNewlywedsVO);
}else {
ArrayList<ActiveNewlywedsChild> activeNewlywedsChildLists = new ArrayList<>();
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildLists);
activeNewlywedsVOS.add(activeNewlywedsVO);
}
}else {
ArrayList<ActiveNewlywedsChild> activeNewlywedsChildList = new ArrayList<>();
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList);
activeNewlywedsVO.setDuihuanTotaled(youhuiTed);
activeNewlywedsVO.setDuihuanTotaled(duihuanTed);
activeNewlywedsVO.setDuihuanTotal(0);
activeNewlywedsVO.setDuihuanTotal(0);
activeNewlywedsVOS.add(activeNewlywedsVO);
}
} }
}else {
ArrayList<ActiveNewlywedsChild> activeNewlywedsChildList = new ArrayList<>();
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList);
} }
} }
return activeNewlywedsVO; return activeNewlywedsVOS;
} }
/** /**

View File

@ -30,6 +30,8 @@ public class ActiveRecommend extends Model<ActiveRecommend> {
private String activePictureUrl; private String activePictureUrl;
//邀请人获得 0优惠券 1兑换券 2成长值 3积分 //邀请人获得 0优惠券 1兑换券 2成长值 3积分
private String inviterGiftType; private String inviterGiftType;
private String activeNewName;
private Integer activeNewId;
//赠送积分 //赠送积分
private Integer points; private Integer points;
//赠送成长值 //赠送成长值

View File

@ -8,6 +8,7 @@ import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendAp
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendVO; import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendVO;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
/** /**
* 推荐有礼表(ActiveRecommend)表服务接口 * 推荐有礼表(ActiveRecommend)表服务接口
@ -29,7 +30,7 @@ public interface ActiveRecommendService extends IService<ActiveRecommend> {
* @param id * @param id
* @return * @return
*/ */
ActiveRecommendVO getOneById(Serializable id); List<ActiveRecommendVO> getOneById(Serializable id);
ActiveRecommendVO getOneByIdApplet(ActiveConsumption activeConsumption); ActiveRecommendVO getOneByIdApplet(ActiveConsumption activeConsumption);
/** /**

View File

@ -12,6 +12,10 @@ import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecomm
import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecommendService; import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecommendService;
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendAppletVO; import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendAppletVO;
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendVO; import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendVO;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService; import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService;
import com.fuint.business.store.service.StoreService; import com.fuint.business.store.service.StoreService;
import com.fuint.common.util.TokenUtil; import com.fuint.common.util.TokenUtil;
@ -42,6 +46,10 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
private ActiveRecommendChildService activeRecommendChildService; private ActiveRecommendChildService activeRecommendChildService;
@Resource @Resource
private CardFavorableService cardFavorableService; private CardFavorableService cardFavorableService;
@Resource
private CardFavorableRecordService cardFavorableRecordService;
@Resource
private CardExchangeRecordService cardExchangeRecordService;
/** /**
* 新增数据 * 新增数据
* @param activeRecommendDTO * @param activeRecommendDTO
@ -53,13 +61,13 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
boolean save = false; boolean save = false;
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId(); Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
//根据店铺id查询 //根据店铺id查询
LambdaQueryWrapper<ActiveRecommend> lambdaQueryWrapper = new LambdaQueryWrapper<>(); /* LambdaQueryWrapper<ActiveRecommend> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveRecommend::getStoreId,storeId); lambdaQueryWrapper.eq(ActiveRecommend::getStoreId,storeId);
ActiveRecommend one = getOne(lambdaQueryWrapper); ActiveRecommend one = getOne(lambdaQueryWrapper);
if (ObjectUtils.isNotEmpty(one)){ if (ObjectUtils.isNotEmpty(one)){
activeRecommendDTO.setId(one.getId()); activeRecommendDTO.setId(one.getId());
save = updateOneById(activeRecommendDTO); save = updateOneById(activeRecommendDTO);
}else { }else {*/
//获取当前店铺的id和连锁店id //获取当前店铺的id和连锁店id
if (ObjectUtils.isNotEmpty(TokenUtil.getNowAccountInfo().getStoreId())) { if (ObjectUtils.isNotEmpty(TokenUtil.getNowAccountInfo().getStoreId())) {
activeRecommendDTO.setStoreId(TokenUtil.getNowAccountInfo().getStoreId()); activeRecommendDTO.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
@ -84,7 +92,7 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
}).collect(Collectors.toList()); }).collect(Collectors.toList());
save = activeRecommendChildService.saveBatch(list); save = activeRecommendChildService.saveBatch(list);
} }
} //}
return save; return save;
} }
@ -94,42 +102,86 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
* @return * @return
*/ */
@Override @Override
public ActiveRecommendVO getOneById(Serializable id) { public List<ActiveRecommendVO> getOneById(Serializable id) {
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId(); Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
ActiveRecommendVO activeRecommendVO = new ActiveRecommendVO(); ArrayList<ActiveRecommendVO> activeRecommendVOS = new ArrayList<>();
activeRecommendVO.setInviterGiftType(new String[0]);
if (ObjectUtils.isNotEmpty(storeId)){ if (ObjectUtils.isNotEmpty(storeId)){
//获取新人有礼活动信息 //获取新人有礼活动信息
LambdaQueryWrapper<ActiveRecommend> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ActiveRecommend> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveRecommend::getStoreId,TokenUtil.getNowAccountInfo().getStoreId()); lambdaQueryWrapper.eq(ActiveRecommend::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
ActiveRecommend activeRecommend = getOne(lambdaQueryWrapper); //ActiveRecommend activeRecommend = getOne(lambdaQueryWrapper);
//获取兑换物品信息 List<ActiveRecommend> list = list(lambdaQueryWrapper);
if (ObjectUtils.isNotEmpty(activeRecommend)){ for (ActiveRecommend activeRecommend : list) {
LambdaQueryWrapper<ActiveRecommendChild> queryWrapper = new LambdaQueryWrapper<>(); int youhuiTed = 0;
queryWrapper.eq(ActiveRecommendChild::getActiveRecommendId,activeRecommend.getId()); int duihuanTed = 0;
queryWrapper.orderByDesc(ActiveRecommendChild::getCreateTime); ActiveRecommendVO activeRecommendVO = new ActiveRecommendVO();
List<ActiveRecommendChild> activeRecommendChildList = activeRecommendChildService.list(queryWrapper); activeRecommendVO.setInviterGiftType(new String[0]);
BeanUtils.copyProperties(activeRecommend,activeRecommendVO); //获取兑换物品信息
activeRecommendVO.setInviterGiftType(activeRecommend.getInviterGiftType().split(",")); if (ObjectUtils.isNotEmpty(activeRecommend)){
if (CollectionUtils.isNotEmpty(activeRecommendChildList)){ LambdaQueryWrapper<ActiveRecommendChild> queryWrapper = new LambdaQueryWrapper<>();
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildList); queryWrapper.eq(ActiveRecommendChild::getActiveRecommendId,activeRecommend.getId());
queryWrapper.orderByDesc(ActiveRecommendChild::getCreateTime);
List<ActiveRecommendChild> activeRecommendChildList = activeRecommendChildService.list(queryWrapper);
for (ActiveRecommendChild activeRecommendChild : activeRecommendChildList) {
//优惠券
if (activeRecommendChild.getActiveGift().equals("1")){
LambdaQueryWrapper<CardFavorableRecord> queryWrappers = new LambdaQueryWrapper<>();
queryWrappers.eq(CardFavorableRecord::getActiveId,activeRecommendChild.getActiveRecommendId());
queryWrappers.eq(CardFavorableRecord::getCardFavorableId,activeRecommendChild.getVouchersId());
List<CardFavorableRecord> lists = cardFavorableRecordService.list(queryWrappers);
activeRecommendVO.setYouhuiTotal(list.size());
for (CardFavorableRecord cardFavorableRecord : lists) {
if (cardFavorableRecord.getStatus().equals("1")){
youhuiTed+=1;
}
}
}
//兑换券
if (activeRecommendChild.getActiveGift().equals("2")){
LambdaQueryWrapper<CardExchangeRecord> queryWrapperss = new LambdaQueryWrapper<>();
queryWrapperss.eq(CardExchangeRecord::getActiveId,activeRecommendChild.getActiveRecommendId());
queryWrapperss.eq(CardExchangeRecord::getCardExchangeId,activeRecommendChild.getVouchersId());
List<CardExchangeRecord> lisst = cardExchangeRecordService.list(queryWrapperss);
activeRecommendVO.setDuihuanTotal(list.size());
for (CardExchangeRecord cardExchangeRecord : lisst) {
if (cardExchangeRecord.getStatus().equals("1")){
duihuanTed+=1;
}
}
}
}
BeanUtils.copyProperties(activeRecommend,activeRecommendVO);
activeRecommendVO.setInviterGiftType(activeRecommend.getInviterGiftType().split(","));
activeRecommendVO.setYouhuiTotaled(youhuiTed);
activeRecommendVO.setDuihuanTotaled(duihuanTed);
if (CollectionUtils.isNotEmpty(activeRecommendChildList)){
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildList);
activeRecommendVOS.add(activeRecommendVO);
}else {
ArrayList<ActiveRecommendChild> activeRecommendChildren = new ArrayList<>();
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildren);
activeRecommendVOS.add(activeRecommendVO);
}
}else { }else {
ArrayList<ActiveRecommendChild> activeRecommendChildren = new ArrayList<>(); ArrayList<ActiveRecommendChild> activeRecommendChildren = new ArrayList<>();
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildren); activeRecommendVO.setActiveRecommendChildList(activeRecommendChildren);
activeRecommendVO.setDuihuanTotaled(youhuiTed);
activeRecommendVO.setDuihuanTotaled(duihuanTed);
activeRecommendVO.setDuihuanTotal(0);
activeRecommendVO.setDuihuanTotal(0);
activeRecommendVOS.add(activeRecommendVO);
} }
}else {
ArrayList<ActiveRecommendChild> activeRecommendChildren = new ArrayList<>();
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildren);
} }
} }
return activeRecommendVO; return activeRecommendVOS;
} }
/** /**
* 通过店铺id查询单条数据(小程序端) * 通过店铺id查询单条数据(小程序端)
* @param id * @param activeConsumption
* @return * @return
*/ */
@Override @Override

View File

@ -42,6 +42,10 @@ public class ActiveRecommendVO extends Model<ActiveRecommendVO> {
private String invitationCodeType; private String invitationCodeType;
//奖励显示 0优惠券 1成长值总额 2积分总额 //奖励显示 0优惠券 1成长值总额 2积分总额
private String rewardDisplay; private String rewardDisplay;
private Integer youhuiTotal;
private Integer duihuanTotal;
private Integer youhuiTotaled;
private Integer duihuanTotaled;
//活动规则 //活动规则
private String activeRule; private String activeRule;
//活动状态 0进行中 1 待生效 2已结束 //活动状态 0进行中 1 待生效 2已结束

View File

@ -2,10 +2,14 @@ package com.fuint.business.marketingActivity.cardExchange.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.cardExchange.dto.CardExchangeRecordDTO; import com.fuint.business.marketingActivity.cardExchange.dto.CardExchangeRecordDTO;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchange;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord; import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService; import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeService;
import com.fuint.business.member.entity.LJStaff; import com.fuint.business.member.entity.LJStaff;
import com.fuint.business.member.service.ILJStaffService; import com.fuint.business.member.service.ILJStaffService;
import com.fuint.business.order.entity.LJOrder;
import com.fuint.business.order.service.LJOrderService;
import com.fuint.common.dto.AccountInfo; import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil; import com.fuint.common.util.TokenUtil;
import com.fuint.framework.web.BaseController; import com.fuint.framework.web.BaseController;
@ -15,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -33,6 +38,10 @@ public class CardExchangeRecordController extends BaseController {
private CardExchangeRecordService cardExchangeRecordService; private CardExchangeRecordService cardExchangeRecordService;
@Resource @Resource
private ILJStaffService iljStaffService; private ILJStaffService iljStaffService;
@Resource
private CardExchangeService cardExchangeService;
@Resource
private LJOrderService ljOrderService;
/** /**
* 分页查询所有数据 * 分页查询所有数据
@ -114,6 +123,20 @@ public class CardExchangeRecordController extends BaseController {
LJStaff ljStaff = iljStaffService.selectStaffById(nowAccountInfo.getStaffId()); LJStaff ljStaff = iljStaffService.selectStaffById(nowAccountInfo.getStaffId());
cardExchangeRecord.setRealName(ljStaff.getRealName()); cardExchangeRecord.setRealName(ljStaff.getRealName());
cardExchangeRecord.setStaffMobile(ljStaff.getMobile()); cardExchangeRecord.setStaffMobile(ljStaff.getMobile());
Integer cardExchangeId = cardExchangeRecord.getCardExchangeId();
CardExchange cardExchange = cardExchangeService.getById(cardExchangeId);
Integer giftId = cardExchange.getGiftId();
LJOrder ljOrder = new LJOrder();
ljOrder.setTerminal("pc");
ljOrder.setPayUser(cardExchangeRecord.getMobile());
ljOrder.setStoreId(nowAccountInfo.getStoreId());
ljOrder.setUserId(cardExchangeRecord.getMtUserId());
ljOrder.setGoodsNum(1);
ljOrder.setPayType("0");
ljOrder.setStatus("paid");
ljOrder.setPayTime(new Date());
ljOrder.setStaffId(nowAccountInfo.getStaffId());
ljOrderService.addGoodOrder(ljOrder,giftId);
return getSuccessResult(this.cardExchangeRecordService.updateById(cardExchangeRecord)); return getSuccessResult(this.cardExchangeRecordService.updateById(cardExchangeRecord));
} }

View File

@ -24,6 +24,7 @@ public class CardExchange extends Model<CardExchange> {
private Integer id; private Integer id;
//所属连锁店id //所属连锁店id
private Integer chainStorId; private Integer chainStorId;
private Integer giftId;
//所属店铺id //所属店铺id
private Integer storeId; private Integer storeId;
//是否在线 0在线 1 下线 //是否在线 0在线 1 下线

View File

@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.convenienceSore.entity.LJGoods;
import com.fuint.business.convenienceSore.service.LJGoodsService;
import com.fuint.business.marketingActivity.cardExchange.mapper.CardExchangeMapper; import com.fuint.business.marketingActivity.cardExchange.mapper.CardExchangeMapper;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchange; import com.fuint.business.marketingActivity.cardExchange.entity.CardExchange;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeService; import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeService;
@ -11,6 +13,7 @@ import com.fuint.business.store.service.StoreService;
import com.fuint.common.util.CryptoUtils; import com.fuint.common.util.CryptoUtils;
import com.fuint.common.util.TokenUtil; import com.fuint.common.util.TokenUtil;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -27,6 +30,8 @@ public class CardExchangeServiceImpl extends ServiceImpl<CardExchangeMapper, Car
@Resource @Resource
private StoreService storeService; private StoreService storeService;
@Autowired
private LJGoodsService goodsService;
/** /**
* 新增数据 * 新增数据
* @param cardExchange * @param cardExchange
@ -49,6 +54,9 @@ public class CardExchangeServiceImpl extends ServiceImpl<CardExchangeMapper, Car
cardExchange.setQrCodeLink(qr_code_link); cardExchange.setQrCodeLink(qr_code_link);
String secretKey = "sQPoC/1do9BZMkg8I5c09A=="; String secretKey = "sQPoC/1do9BZMkg8I5c09A==";
CryptoUtils.encryptSymmetrically(secretKey, null,cardExchange.getQrCodeLink(), CryptoUtils.Algorithm.Encryption.AES_ECB_PKCS5); CryptoUtils.encryptSymmetrically(secretKey, null,cardExchange.getQrCodeLink(), CryptoUtils.Algorithm.Encryption.AES_ECB_PKCS5);
Integer giftId = cardExchange.getGiftId();
LJGoods ljGoods = goodsService.selectLJGoodsById(giftId);
cardExchange.setGiftName(ljGoods.getName());
return save(cardExchange); return save(cardExchange);
} }

View File

@ -12,6 +12,7 @@ public class CardValueRecordDTO extends CardValueRecord {
private String obtain; private String obtain;
private String authCode; private String authCode;
private Double realyPayBills; private Double realyPayBills;
private Double balance;
//付款类型 1.微信 2.支付宝 //付款类型 1.微信 2.支付宝
private String payType; private String payType;
private String oilName; private String oilName;
@ -23,6 +24,7 @@ public class CardValueRecordDTO extends CardValueRecord {
private String appltType; private String appltType;
private String paymentType; private String paymentType;
private String payStatus; private String payStatus;
private String types;
// /** // /**
// * 会员id // * 会员id

View File

@ -150,9 +150,34 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
//会员信息 //会员信息
LJUserVo ljUserVo = ljUserMapper.queryUserByChainStoreId(nowAccountInfo.getId(),store.getChainStoreId()); LJUserVo ljUserVo = ljUserMapper.queryUserByChainStoreId(nowAccountInfo.getId(),store.getChainStoreId());
//员工信息 //员工信息
LJStaff ljStaff = mtStaffService.selectStaffById(cardValueRecordDTO.getMtStaffId()); LJStaff ljStaff = new LJStaff();
if(ObjectUtils.isNotEmpty(cardValueRecordDTO.getMtStaffId())){
ljStaff = mtStaffService.selectStaffById(cardValueRecordDTO.getMtStaffId());
}
CardValueVO cardValue = new CardValueVO();
//自定义
if (ObjectUtils.isNotEmpty(cardValueRecordDTO.getTypes()) && cardValueRecordDTO.getTypes().equals("1")){
cardValueOrders.setRechargeType("1");
cardValueOrders.setBidBalance(cardValueRecordDTO.getBalance());
cardValueOrders.setRechargeBalance(cardValueRecordDTO.getBalance());
}else {
//查询储值卡信息
cardValue = cardValueService.getOneById(cardValueRecordDTO.getId());
cardValueOrders.setCardValueId(cardValue.getId());
cardValueOrders.setRechargeType("0");
cardValueOrders.setBidBalance(cardValue.getBidBalance());
cardValueOrders.setRechargeBalance(cardValue.getRechargeBalance());
if (ObjectUtils.isNotEmpty(cardValue.getGiftBalance())){
cardValueOrders.setGiftBalance(cardValue.getGiftBalance());
}
cardValueOrders.setPoints(cardValue.getPoints());
cardValueOrders.setGrowthValue(cardValue.getGrowthValue());
if (ObjectUtils.isNotEmpty(cardValue.getFringeBenefit())){
cardValueOrders.setFringeBenefit(cardValue.getFringeBenefit());
}
}
//查询储值卡信息 //查询储值卡信息
CardValueVO cardValue = cardValueService.getOneById(cardValueRecordDTO.getId()); /* CardValueVO cardValue = cardValueService.getOneById(cardValueRecordDTO.getId());
cardValueOrders.setCardValueId(cardValue.getId()); cardValueOrders.setCardValueId(cardValue.getId());
cardValueOrders.setRechargeType("0"); cardValueOrders.setRechargeType("0");
cardValueOrders.setBidBalance(cardValue.getBidBalance()); cardValueOrders.setBidBalance(cardValue.getBidBalance());
@ -164,7 +189,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
cardValueOrders.setGrowthValue(cardValue.getGrowthValue()); cardValueOrders.setGrowthValue(cardValue.getGrowthValue());
if (ObjectUtils.isNotEmpty(cardValue.getFringeBenefit())){ if (ObjectUtils.isNotEmpty(cardValue.getFringeBenefit())){
cardValueOrders.setFringeBenefit(cardValue.getFringeBenefit()); cardValueOrders.setFringeBenefit(cardValue.getFringeBenefit());
} }*/
//优惠券优惠金额 //优惠券优惠金额
if (ObjectUtils.isNotEmpty(cardValueRecordDTO.getCardFavorableId())){ if (ObjectUtils.isNotEmpty(cardValueRecordDTO.getCardFavorableId())){
CardFavorable cardFavorable = cardFavorableService.getById(cardValueRecordDTO.getCardFavorableId()); CardFavorable cardFavorable = cardFavorableService.getById(cardValueRecordDTO.getCardFavorableId());
@ -190,9 +215,11 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
cardValueOrders.setName(ljUserVo.getName()); cardValueOrders.setName(ljUserVo.getName());
cardValueOrders.setMobile(ljUserVo.getMobile()); cardValueOrders.setMobile(ljUserVo.getMobile());
//员工信息 //员工信息
cardValueOrders.setStaffId(ljStaff.getId()); if (ObjectUtils.isNotEmpty(ljStaff)){
cardValueOrders.setRealName(ljStaff.getRealName()); cardValueOrders.setStaffId(ljStaff.getId());
cardValueOrders.setStaffMobile(ljStaff.getMobile()); cardValueOrders.setRealName(ljStaff.getRealName());
cardValueOrders.setStaffMobile(ljStaff.getMobile());
}
//员工提成信息 //员工提成信息
if (ObjectUtils.isNotEmpty(cardValue.getRoyaltyType())){ if (ObjectUtils.isNotEmpty(cardValue.getRoyaltyType())){
cardValueOrders.setRoyaltyType(cardValue.getRoyaltyType()); cardValueOrders.setRoyaltyType(cardValue.getRoyaltyType());
@ -846,74 +873,81 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
//查询储值卡对应的优惠券列表 //查询储值卡对应的优惠券列表
List<CardFavorable> cardValueVouchers = getCardValueVouchers(cardValue); List<CardFavorable> cardValueVouchers = getCardValueVouchers(cardValue);
//送优惠券兑换券 //送优惠券兑换券
if (CollectionUtils.isNotEmpty(cardValueVouchers)) { if (cardValueOrders.getRechargeType().equals("1")){
for (CardFavorable cardValueVoucher : cardValueVouchers) { //会员等级充值送券
if (ObjectUtils.isNotEmpty(cardValueVoucher)){ giveCoupon(cardValueOrders.getMtUserId(),cardValueOrders.getStoreId(),ljUserVo,ljStaff);
cardValueOrders.setCardFavorableId(cardValueVoucher.getId()); }else {
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord(); if (CollectionUtils.isNotEmpty(cardValueVouchers)) {
cardFavorableRecord.setCardFavorableId(cardValueVoucher.getId()); for (CardFavorable cardValueVoucher : cardValueVouchers) {
cardFavorableRecord.setStoreId(cardValueOrders.getStoreId()); if (ObjectUtils.isNotEmpty(cardValueVoucher)){
cardFavorableRecord.setMtUserId(ljUserVo.getId()); cardValueOrders.setCardFavorableId(cardValueVoucher.getId());
cardFavorableRecord.setName(ljUserVo.getName()); CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
cardFavorableRecord.setMobile(ljUserVo.getMobile()); cardFavorableRecord.setCardFavorableId(cardValueVoucher.getId());
cardFavorableRecord.setStatus("0"); cardFavorableRecord.setStoreId(cardValueOrders.getStoreId());
cardFavorableRecord.setExchangeFrom("充值送券"); cardFavorableRecord.setMtUserId(ljUserVo.getId());
//优惠券开始结束时间 cardFavorableRecord.setName(ljUserVo.getName());
if (ObjectUtils.isNotEmpty(cardValueVoucher) && ObjectUtils.isNotEmpty(cardValueVoucher.getTimeType())) { cardFavorableRecord.setMobile(ljUserVo.getMobile());
if (cardValueVoucher.getTimeType().equals("0")) { cardFavorableRecord.setStatus("0");
LocalDate today = LocalDate.now(); cardFavorableRecord.setExchangeFrom("充值送券");
LocalDate localDate = today.plusDays(cardValueVoucher.getValidityZero()); //优惠券开始结束时间
Date from = Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant()); if (ObjectUtils.isNotEmpty(cardValueVoucher) && ObjectUtils.isNotEmpty(cardValueVoucher.getTimeType())) {
cardFavorableRecord.setEndTime(from); if (cardValueVoucher.getTimeType().equals("0")) {
} else if (cardValueVoucher.getTimeType().equals("1")) { LocalDate today = LocalDate.now();
cardFavorableRecord.setStartTime(cardValueVoucher.getEffectiveDate()); LocalDate localDate = today.plusDays(cardValueVoucher.getValidityZero());
LocalDate today = LocalDate.now(); Date from = Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
LocalDate localDate = today.plusDays(cardValueVoucher.getValidityOne()); cardFavorableRecord.setEndTime(from);
Date from = Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant()); } else if (cardValueVoucher.getTimeType().equals("1")) {
cardFavorableRecord.setEndTime(from); cardFavorableRecord.setStartTime(cardValueVoucher.getEffectiveDate());
} else { LocalDate today = LocalDate.now();
LocalDate today = LocalDate.now(); LocalDate localDate = today.plusDays(cardValueVoucher.getValidityOne());
LocalDate localDate = today.plusDays(cardValueVoucher.getValidityTwo()); Date from = Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
LocalDate localDates = today.plusDays(Integer.parseInt(cardValueVoucher.getValidityDay())); cardFavorableRecord.setEndTime(from);
Date from = Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant()); } else {
Date froms = Date.from(localDates.atStartOfDay(ZoneId.systemDefault()).toInstant()); LocalDate today = LocalDate.now();
cardFavorableRecord.setStartTime(froms); LocalDate localDate = today.plusDays(cardValueVoucher.getValidityTwo());
cardFavorableRecord.setEndTime(from); LocalDate localDates = today.plusDays(Integer.parseInt(cardValueVoucher.getValidityDay()));
Date from = Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
Date froms = Date.from(localDates.atStartOfDay(ZoneId.systemDefault()).toInstant());
cardFavorableRecord.setStartTime(froms);
cardFavorableRecord.setEndTime(from);
}
} }
cardFavorableRecordService.save(cardFavorableRecord);
} }
cardFavorableRecordService.save(cardFavorableRecord);
}
/* /*
if (cardValue.getRechargeBalance() >= cardValueVoucher.getSatisfiedAmount()) { if (cardValue.getRechargeBalance() >= cardValueVoucher.getSatisfiedAmount()) {
cardFavorableValue += cardValueVoucher.getDiscountAmount(); cardFavorableValue += cardValueVoucher.getDiscountAmount();
}*/ }*/
}
}
//查询储值卡对应的兑换券列表
List<CardExchange> cardExchangeVouchers = getCardExchangeVouchers(cardValue);
if (CollectionUtils.isNotEmpty(cardExchangeVouchers)){
for (CardExchange cardExchangeVoucher : cardExchangeVouchers) {
if (ObjectUtils.isNotEmpty(cardExchangeVoucher)){
CardExchangeRecord cardExchangeRecord = new CardExchangeRecord();
cardValueOrders.setCardExchangeId(cardExchangeVoucher.getId());
cardExchangeRecord.setCardExchangeId(cardExchangeVoucher.getId());
cardExchangeRecord.setStoreId(cardValueOrders.getStoreId());
cardExchangeRecord.setMtUserId(ljUserVo.getId());
cardExchangeRecord.setName(ljUserVo.getName());
cardExchangeRecord.setMobile(ljUserVo.getMobile());
cardExchangeRecord.setPhoto(ljUserVo.getAvatar());
cardExchangeRecord.setMtStaffId(ljStaff.getId());
cardExchangeRecord.setRealName(ljStaff.getRealName());
cardExchangeRecord.setStaffMobile(ljStaff.getMobile());
cardExchangeRecord.setStatus("0");
cardExchangeRecord.setExchangeFrom("充值送券");
cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord);
} }
} }
//查询储值卡对应的兑换券列表
List<CardExchange> cardExchangeVouchers = getCardExchangeVouchers(cardValue);
if (CollectionUtils.isNotEmpty(cardExchangeVouchers)){
for (CardExchange cardExchangeVoucher : cardExchangeVouchers) {
if (ObjectUtils.isNotEmpty(cardExchangeVoucher)){
CardExchangeRecord cardExchangeRecord = new CardExchangeRecord();
cardValueOrders.setCardExchangeId(cardExchangeVoucher.getId());
cardExchangeRecord.setCardExchangeId(cardExchangeVoucher.getId());
cardExchangeRecord.setStoreId(cardValueOrders.getStoreId());
cardExchangeRecord.setMtUserId(ljUserVo.getId());
cardExchangeRecord.setName(ljUserVo.getName());
cardExchangeRecord.setMobile(ljUserVo.getMobile());
cardExchangeRecord.setPhoto(ljUserVo.getAvatar());
cardExchangeRecord.setMtStaffId(ljStaff.getId());
cardExchangeRecord.setRealName(ljStaff.getRealName());
cardExchangeRecord.setStaffMobile(ljStaff.getMobile());
cardExchangeRecord.setStatus("0");
cardExchangeRecord.setExchangeFrom("充值送券");
cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord);
}
}
}
//会员等级充值送券
giveCoupon(cardValueOrders.getMtUserId(),cardValueOrders.getStoreId(),ljUserVo,ljStaff);
} }
//会员等级充值送券
giveCoupon(cardValueOrders.getMtUserId(),cardValueOrders.getStoreId(),ljUserVo,ljStaff);
//生成充值记录 //生成充值记录

View File

@ -30,8 +30,10 @@ import java.util.Map;
@Service @Service
public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUserGrade> implements LJUserGradeService { public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUserGrade> implements LJUserGradeService {
@Autowired @Autowired
@Lazy
private ILJStoreService storeService; private ILJStoreService storeService;
@Autowired @Autowired
@Lazy
private MtUserGradeChildService userGradeChildService; private MtUserGradeChildService userGradeChildService;
@Override @Override

View File

@ -12,6 +12,7 @@ import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.business.userManager.entity.*; import com.fuint.business.userManager.entity.*;
import com.fuint.business.userManager.mapper.LJUserMapper; import com.fuint.business.userManager.mapper.LJUserMapper;
import com.fuint.business.userManager.mapper.MtInvitationMapper; import com.fuint.business.userManager.mapper.MtInvitationMapper;
import com.fuint.business.userManager.mapper.UserBalanceMapper;
import com.fuint.business.userManager.service.*; import com.fuint.business.userManager.service.*;
import com.fuint.business.userManager.vo.LJUserVo; import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.dto.AccountInfo; import com.fuint.common.dto.AccountInfo;
@ -34,6 +35,8 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
@Autowired @Autowired
private UserBalanceService balanceService; private UserBalanceService balanceService;
@Autowired @Autowired
private UserBalanceMapper userBalanceMapper;
@Autowired
private ILJStoreService storeService; private ILJStoreService storeService;
/** /**
@ -134,12 +137,14 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.apply(true, "TO_DAYS(NOW())-TO_DAYS(create_time) = 0"); queryWrapper.apply(true, "TO_DAYS(NOW())-TO_DAYS(create_time) = 0");
Integer addNum = baseMapper.selectCount(queryWrapper); // Integer addNum = baseMapper.selectCount(queryWrapper);
Integer addNum = userBalanceMapper.selectCount(queryWrapper);
QueryWrapper queryWrapper1 = new QueryWrapper<>(); QueryWrapper queryWrapper1 = new QueryWrapper<>();
queryWrapper1.apply(true, "TO_DAYS(NOW())-TO_DAYS(create_time) = 1"); queryWrapper1.apply(true, "TO_DAYS(NOW())-TO_DAYS(create_time) = 1");
Integer yesterdayAddNum = baseMapper.selectCount(queryWrapper1); // Integer yesterdayAddNum = baseMapper.selectCount(queryWrapper1);
Integer yesterdayAddNum = userBalanceMapper.selectCount(queryWrapper1);
map.put("balance",balance); map.put("balance",balance);
map.put("point",point); map.put("point",point);

View File

@ -3,22 +3,38 @@ package com.fuint.business.userManager.service.impl;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.business.userManager.entity.ChainStoreConfig;
import com.fuint.business.userManager.entity.LJUserGrade;
import com.fuint.business.userManager.entity.MtUserGradeChild; import com.fuint.business.userManager.entity.MtUserGradeChild;
import com.fuint.business.userManager.mapper.MtUserGradeChildMapper; import com.fuint.business.userManager.mapper.MtUserGradeChildMapper;
import com.fuint.business.userManager.service.ChainStoreConfigService;
import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.business.userManager.service.LJUserService; import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.service.MtUserGradeChildService; import com.fuint.business.userManager.service.MtUserGradeChildService;
import com.fuint.business.userManager.vo.LJUserVo; import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.util.StringUtils;
import com.fuint.common.util.TokenUtil; import com.fuint.common.util.TokenUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@Service @Service
public class MtUserGradeChildServiceImpl extends ServiceImpl<MtUserGradeChildMapper,MtUserGradeChild> implements MtUserGradeChildService { public class MtUserGradeChildServiceImpl extends ServiceImpl<MtUserGradeChildMapper,MtUserGradeChild> implements MtUserGradeChildService {
@Autowired @Autowired
@Lazy @Lazy
private LJUserService userService; private LJUserService userService;
@Autowired
private ILJStoreService storeService;
@Autowired
@Lazy
private ChainStoreConfigService chainStoreConfigService;
@Resource
private LJUserGradeService ljUserGradeService;
@Override @Override
public List<MtUserGradeChild> selectListByGradeId(Integer gradeId) { public List<MtUserGradeChild> selectListByGradeId(Integer gradeId) {
@ -30,9 +46,22 @@ public class MtUserGradeChildServiceImpl extends ServiceImpl<MtUserGradeChildMap
@Override @Override
public List<MtUserGradeChild> selectListByUserId(Integer userId,Integer storeId) { public List<MtUserGradeChild> selectListByUserId(Integer userId,Integer storeId) {
LJUserVo userVo = userService.queryUserById(userId, storeId); LJUserVo userVo = userService.queryUserById(userId, storeId);
QueryWrapper queryWrapper = new QueryWrapper<>(); LJStore store = storeService.selectStoreById();
queryWrapper.eq("user_grade_id",userVo.getGradeId()); ChainStoreConfig chainStoreConfig = chainStoreConfigService.selectChainStoreById(store.getChainStoreId());
return baseMapper.selectList(queryWrapper); String isEnableLevel = chainStoreConfig.getIsEnableLevel();
if (isEnableLevel.equals("yes")){
if (ObjectUtil.isNotEmpty(userVo.getGradeId())){
LJUserGrade ljUserGrade = ljUserGradeService.selectUserGradeById(userVo.getGradeId());
if (!ljUserGrade.getIfRechargeCoupon().equals("1")){
return new ArrayList<MtUserGradeChild>();
}
}else{
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_grade_id",userVo.getGradeId());
return baseMapper.selectList(queryWrapper);
}
}
return new ArrayList<MtUserGradeChild>();
} }
@Override @Override

View File

@ -19,10 +19,11 @@ export function listCardOilRecord(query) {
} }
// 查询优惠券信息列表 // 查询优惠券信息列表
export function cardBalanceCount() { export function cardBalanceCount(query) {
return request({ return request({
url: '/business/CardBalanceChange/getBalanceStoreCount', url: '/business/CardBalanceChange/getBalanceStoreCount',
method: 'get', method: 'get',
params: query
}) })
} }

View File

@ -317,7 +317,7 @@
<div v-if="isMember">{{ item.memberPrice }}</div> <div v-if="isMember">{{ item.memberPrice }}</div>
<div> <div>
<el-input-number v-model="item.num" size="small" controls-position="right" <el-input-number v-model="item.num" size="small" controls-position="right"
@change="handleChange" :min="1" :max="10000"></el-input-number> @change="handleChange" :min="1" :max="item.stock"></el-input-number>
</div> </div>
<div @click="delGoods(index)"><i class="el-icon-circle-close" style="font-size: 22px"></i></div> <div @click="delGoods(index)"><i class="el-icon-circle-close" style="font-size: 22px"></i></div>
</div> </div>
@ -3475,6 +3475,7 @@
if (goods[i].id == val.id) { if (goods[i].id == val.id) {
if (val.stock<goods[i].num + 1){ if (val.stock<goods[i].num + 1){
this.$modal.msgError("商品库存不足,请重新选择商品") this.$modal.msgError("商品库存不足,请重新选择商品")
result = false;
break; break;
} }
goods[i].num = goods[i].num + 1; goods[i].num = goods[i].num + 1;
@ -3488,6 +3489,7 @@
break; break;
} else { } else {
result = true; result = true;
console.log(265)
} }
} }
// this.goodsAmount = amount; // this.goodsAmount = amount;
@ -3504,7 +3506,7 @@
if (_this.isMember) { if (_this.isMember) {
this.goodsDiscount += (val.retailPrice - val.memberPrice) this.goodsDiscount += (val.retailPrice - val.memberPrice)
} }
console.log(this.goodsAmount) console.log(this.goodsAmount,847)
this.goodsAmount += +val.retailPrice this.goodsAmount += +val.retailPrice
this.goodsActualPay = this.goodsAmount - this.goodsDiscount; this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
this.goodsOrder.push(val); this.goodsOrder.push(val);
@ -4040,8 +4042,9 @@
_this.isQuery = false; _this.isQuery = false;
_this.amount = 0 _this.amount = 0
_this.printLocally()
_this.loading = false; _this.loading = false;
_this.printLocally()
_this.resetting1();
if (response.data.oilOrderAmount>0){ if (response.data.oilOrderAmount>0){
// for (let i =0;i<_this.oilPreferentialData.length;i++){ // for (let i =0;i<_this.oilPreferentialData.length;i++){

View File

@ -651,6 +651,7 @@ import {oilNumbers} from "@/api/cashier/oilnumber";
if (val!=undefined){ if (val!=undefined){
this.queryParams.page = val this.queryParams.page = val
} }
this.dateRange = []
if (this.beginTime && this.endTime) { if (this.beginTime && this.endTime) {
this.dateRange.push(this.beginTime.toLocaleDateString()) this.dateRange.push(this.beginTime.toLocaleDateString())
this.dateRange.push(this.endTime.toLocaleDateString()) this.dateRange.push(this.endTime.toLocaleDateString())
@ -665,10 +666,12 @@ import {oilNumbers} from "@/api/cashier/oilnumber";
if (val!=undefined){ if (val!=undefined){
this.queryParams.page = val this.queryParams.page = val
} }
this.dateRange = []
if (this.beginTime && this.endTime) { if (this.beginTime && this.endTime) {
this.dateRange.push(this.beginTime.toLocaleDateString()) this.dateRange.push(this.beginTime.toLocaleDateString())
this.dateRange.push(this.endTime.toLocaleDateString()) this.dateRange.push(this.endTime.toLocaleDateString())
} }
console.log(this.dateRange)
cardBalanceCount(this.addDateRange(this.queryParams, this.dateRange)).then(res => { cardBalanceCount(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
this.inCount = res.data.inCount this.inCount = res.data.inCount
this.outCount = res.data.outCount this.outCount = res.data.outCount
@ -681,6 +684,7 @@ import {oilNumbers} from "@/api/cashier/oilnumber";
if (val!=undefined){ if (val!=undefined){
this.queryParams.page = val this.queryParams.page = val
} }
this.dateRange = []
if (this.beginTime && this.endTime) { if (this.beginTime && this.endTime) {
this.dateRange.push(this.beginTime.toLocaleDateString()) this.dateRange.push(this.beginTime.toLocaleDateString())
this.dateRange.push(this.endTime.toLocaleDateString()) this.dateRange.push(this.endTime.toLocaleDateString())
@ -695,6 +699,7 @@ import {oilNumbers} from "@/api/cashier/oilnumber";
if (val!=undefined){ if (val!=undefined){
this.queryParams.page = val this.queryParams.page = val
} }
this.dateRange = []
if (this.beginTime && this.endTime) { if (this.beginTime && this.endTime) {
this.dateRange.push(this.beginTime.toLocaleDateString()) this.dateRange.push(this.beginTime.toLocaleDateString())
this.dateRange.push(this.endTime.toLocaleDateString()) this.dateRange.push(this.endTime.toLocaleDateString())

View File

@ -223,12 +223,12 @@
<el-tag v-else type="danger">禁用</el-tag> <el-tag v-else type="danger">禁用</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="公众号" align="center" prop="official"> <!-- <el-table-column label="公众号" align="center" prop="official">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<span v-if="scope.row.official == 'ygz'">已关注</span> <!-- <span v-if="scope.row.official == 'ygz'">已关注</span>-->
<span v-else>未关注</span> <!-- <span v-else>未关注</span>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column label="操作" align="center" width="120" fixed='right'> <el-table-column label="操作" align="center" width="120" fixed='right'>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -258,7 +258,7 @@
</el-card> </el-card>
<!-- 添加会员信息选择是否批量录入--> <!-- 添加会员信息选择是否批量录入-->
<el-dialog :close-on-click-modal="false" :title="title" width="55%" :visible.sync="openUser" append-to-body> <el-dialog :close-on-click-modal="false" :title="title" width="40%" :visible.sync="openUser" append-to-body>
<el-alert <el-alert
type="info" type="info"
:closable="false"> :closable="false">
@ -272,31 +272,31 @@
<el-button type="primary" <el-button type="primary"
icon="el-icon-connection" @click="addMult" round>批量导入会员</el-button> icon="el-icon-connection" @click="addMult" round>批量导入会员</el-button>
</div> </div>
<div> <!-- <div>-->
<el-table ref="tables" v-loading="loading" :data="userList"> <!-- <el-table ref="tables" v-loading="loading" :data="userList">-->
<el-table-column prop="batchNumber" align="center" label="批次号" width="200"/> <!-- <el-table-column prop="batchNumber" align="center" label="批次号" width="200"/>-->
<el-table-column prop="type" align="center" label="类型"/> <!-- <el-table-column prop="type" align="center" label="类型"/>-->
<el-table-column prop="memberNumber" align="center" label="会员数"/> <!-- <el-table-column prop="memberNumber" align="center" label="会员数"/>-->
<el-table-column label="执行结果" align="center" > <!-- <el-table-column label="执行结果" align="center" >-->
<el-table-column prop="successNumber" align="center" label="成功人数"/> <!-- <el-table-column prop="successNumber" align="center" label="成功人数"/>-->
<el-table-column prop="errorNumber" align="center" label="失败人数"/> <!-- <el-table-column prop="errorNumber" align="center" label="失败人数"/>-->
<el-table-column prop="repeatNumber" align="center" label="重复人数"/> <!-- <el-table-column prop="repeatNumber" align="center" label="重复人数"/>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column prop="createTime" align="center" label="处理时间" width="160"> <!-- <el-table-column prop="createTime" align="center" label="处理时间" width="160">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<span>{{ parseTime(scope.row.createTime) }}</span> <!-- <span>{{ parseTime(scope.row.createTime) }}</span>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<!-- <el-table-column prop="date" align="center" label="处理结果详情"/>--> <!-- &lt;!&ndash; <el-table-column prop="date" align="center" label="处理结果详情"/>&ndash;&gt;-->
</el-table> <!-- </el-table>-->
<pagination <!-- <pagination-->
:total="total1" <!-- :total="total1"-->
:page.sync="queryParams.page" <!-- :page.sync="queryParams.page"-->
:limit.sync="queryParams.pageSize" <!-- :limit.sync="queryParams.pageSize"-->
@pagination="getList" <!-- @pagination="getList"-->
/> <!-- />-->
</div> <!-- </div>-->
</el-dialog> </el-dialog>
<!-- 添加或修改对话框 --> <!-- 添加或修改对话框 -->
@ -347,7 +347,7 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="会员初始积分" prop="points"> <el-form-item label="会员初始积分" prop="points">
<el-input v-model="form.points" placeholder="0" maxlength="30"/> <el-input :disabled="title == '编辑会员'" v-model="form.points" placeholder="0" maxlength="30"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -361,7 +361,7 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="储值通用余额" prop="cardBalance"> <el-form-item label="储值通用余额" prop="cardBalance">
<el-input v-model="form.cardBalance" placeholder="0" maxlength="30"/> <el-input :disabled="title == '编辑会员'" v-model="form.cardBalance" placeholder="0" maxlength="30"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -372,19 +372,19 @@
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- </el-col>--> <!-- </el-col>-->
<!-- </el-row>--> <!-- </el-row>-->
<!-- <el-row>-->
<!-- <el-col :span="24">-->
<!-- <el-form-item label="是否关注公众号">-->
<!-- <el-radio-group v-model="form.official">-->
<!-- <el-radio label="ygz" value="ygz">已关注</el-radio>-->
<!-- <el-radio label="wgz" value="wgz">未关注</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="是否关注公众号"> <el-form-item label="会员状态" prop="status">
<el-radio-group v-model="form.official">
<el-radio label="ygz" value="ygz">已关注</el-radio>
<el-radio label="wgz" value="wgz">未关注</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="会员状态">
<el-radio-group v-model="form.status"> <el-radio-group v-model="form.status">
<el-radio label="qy" value="qy">启用</el-radio> <el-radio label="qy" value="qy">启用</el-radio>
<el-radio label="jy" value="jy">禁用</el-radio> <el-radio label="jy" value="jy">禁用</el-radio>
@ -562,6 +562,7 @@
mobile: [ mobile: [
{ required: true, message: "请输入手机号", trigger: "blur" }, { required: true, message: "请输入手机号", trigger: "blur" },
], ],
status: [{ required: true, message: "请选择会员状态", trigger: "blur" }],
}, },
} }
}, },

View File

@ -205,6 +205,7 @@
let storeId = "19"; let storeId = "19";
let staffId = ""; let staffId = "";
console.log(111);
if (str.includes("&")) { if (str.includes("&")) {
let arr = str.split("&"); let arr = str.split("&");
arr.forEach(item => { arr.forEach(item => {
@ -234,9 +235,9 @@
uni.setStorageSync("storeId", storeId) uni.setStorageSync("storeId", storeId)
} }
await this.getUserAuthority();
// await this.getOilType();
} }
await this.getUserAuthority();
// await this.getOilType();
await this.getTheJudgmentIsTheSame(); await this.getTheJudgmentIsTheSame();
}else{ }else{
await this.getUserAuthority(); await this.getUserAuthority();
@ -246,7 +247,7 @@
}, },
onShow() { onShow() {
this.isJoined() this.isJoined()
this.getIndexBanner() // this.getIndexBanner()
}, },
components: { components: {
tabbar tabbar
@ -277,14 +278,16 @@
method: 'get', method: 'get',
}).then(res => { }).then(res => {
_this.list1 = res.data _this.list1 = res.data
for (let i = 0; i < res.data.length; i++) { if (res.data.length>0){
if (res.data[i].bannerUrl.includes("http")) { for (let i = 0; i < res.data.length; i++) {
_this.list1[i].bannerUrl = res.data[i].bannerUrl if (res.data[i].bannerUrl.includes("http")) {
} else { _this.list1[i].bannerUrl = res.data[i].bannerUrl
_this.list1[i].bannerUrl = _this.baseUrl + res.data[i].bannerUrl } else {
_this.list1[i].bannerUrl = _this.baseUrl + res.data[i].bannerUrl
}
} }
console.log(_this.list1);
} }
console.log(_this.list1);
}) })
} }
}, },
@ -388,6 +391,7 @@
}, },
// tokenid // tokenid
async getTheJudgmentIsTheSame() { async getTheJudgmentIsTheSame() {
console.log(this.AppToken,547);
// //
if (!this.AppToken) { if (!this.AppToken) {
return; return;
@ -417,8 +421,8 @@
data: { data: {
code: res.code code: res.code
} }
}).then(res => { }).then(resp => {
if (!res.data) { if (!resp.data) {
uni.removeStorageSync("App-Token"); uni.removeStorageSync("App-Token");
} }
}) })
@ -443,7 +447,8 @@
storeId: uni.getStorageSync("storeId"), storeId: uni.getStorageSync("storeId"),
}, },
}).then((resp) => { }).then((resp) => {
if (!res.data) { console.log(resp,85412);
if (!resp.data) {
uni.removeStorageSync("App-Token"); uni.removeStorageSync("App-Token");
} }
}) })
@ -490,10 +495,6 @@
}, },
// //
getAddress(storeId) { getAddress(storeId) {
// uni.showToast({
// title:"id"+storeId,
// icon:"none"
// })
let _this = this; let _this = this;
uni.getLocation({ uni.getLocation({
// 使wgs84 使gcj02 // 使wgs84 使gcj02
@ -517,17 +518,19 @@
}, },
}).then((response) => { }).then((response) => {
console.log(response,"2154");
// uni.showToast({
// title:"121984:"+storeId
// })
if (response.data.store){ if (response.data.store){
_this.distance = (Math.ceil(response.data.distance)) _this.distance = (Math.ceil(response.data.distance))
.toFixed(1) .toFixed(1)
_this.store = response.data.store _this.store = response.data.store
console.log(response,"storeId");
uni.setStorageSync("storeId", response.data.store.id) uni.setStorageSync("storeId", response.data.store.id)
uni.setStorageSync("chainStoreId", response.data.store.chainStoreId) uni.setStorageSync("chainStoreId", response.data.store.chainStoreId)
// console.log(uni.getStorageSync("chainStoreId")); console.log(uni.getStorageSync("chainStoreId"));
let welfare = response.data.store.welfare if (response.data.store.welfare) {
if (welfare) { if (response.data.store.welfare.includes(",")) {
if (welfare.includes(",")) {
_this.welfare = response.data.store.welfare _this.welfare = response.data.store.welfare
.split(",") .split(",")
} else { } else {
@ -554,7 +557,7 @@
}) })
} }
}) }).catch(err => {})
// uni.showToast({ // uni.showToast({
// title: "", // title: "",

View File

@ -216,6 +216,7 @@
}, },
// //
getUser() { getUser() {
console.log(this.AppToken,2343);
if (!this.AppToken) { if (!this.AppToken) {
return; return;
} }
@ -223,7 +224,8 @@
url: 'business/userManager/user/getUser', url: 'business/userManager/user/getUser',
method: 'get', method: 'get',
}).then(res => { }).then(res => {
if (res.data != null && res.data != "" && res.data != undefined) { console.log(res,1541);
if (res.data) {
this.user = res.data this.user = res.data
uni.setStorageSync('userId', res.data.id) uni.setStorageSync('userId', res.data.id)
this.user.mobile = res.data.mobile.slice(0, 3) + "****" + res.data.mobile.slice(res.data this.user.mobile = res.data.mobile.slice(0, 3) + "****" + res.data.mobile.slice(res.data

View File

@ -301,14 +301,14 @@
_this.storeId = res.data.id; _this.storeId = res.data.id;
uni.setStorageSync("storeId", _this.store.id) uni.setStorageSync("storeId", _this.store.id)
uni.setStorageSync("chainStoreId", _this.store.chainStoreId) uni.setStorageSync("chainStoreId", _this.store.chainStoreId)
let welfare = res.data.welfare // let welfare = res.data.welfare
if (welfare) { // if (welfare) {
if (welfare.includes(",")) { // if (welfare.includes(",")) {
_this.welfare = res.data.welfare.split(",") // _this.welfare = res.data.welfare.split(",")
} else { // } else {
_this.welfare.push(res.data.welfare) // _this.welfare.push(res.data.welfare)
} // }
} // }
}).catch(err => { }).catch(err => {
// uni.showLoading({ // uni.showLoading({
// title: JSON.stringify(err) + 222 // title: JSON.stringify(err) + 222
@ -337,9 +337,8 @@
_this.storeId = response.data.store.id; _this.storeId = response.data.store.id;
_this.getOilNumber(_this.storeId); _this.getOilNumber(_this.storeId);
// _this.getStaffList(_this.storeId) // _this.getStaffList(_this.storeId)
let welfare = response.data.store.welfare; if (response.data.store.welfare) {
if (welfare != undefined && welfare != null && welfare != "") { if (response.data.store.welfare.includes(",")) {
if (welfare.includes(",")) {
_this.welfare = response.data.store.welfare.split(","); _this.welfare = response.data.store.welfare.split(",");
} else { } else {
_this.welfare.push(response.data.store.welfare); _this.welfare.push(response.data.store.welfare);

View File

@ -91,7 +91,11 @@
encryptedData: encryptedData, encryptedData: encryptedData,
}, },
}).then((resp) => { }).then((resp) => {
// console.log(resp) if (uni.getStorageSync("y_type") ==
'yaoqingyouli') {
this.activeRecommendRecords()
}
if (resp.code == 200) { if (resp.code == 200) {
uni.setStorageSync('App-Token', resp.data.token); uni.setStorageSync('App-Token', resp.data.token);
@ -102,8 +106,7 @@
url: '/pages/index/index' url: '/pages/index/index'
}) })
} }
console.log("swq", uni.getStorageSync( console.log("swq", uni.getStorageSync('App-Token'));
'App-Token'));
}) })
}, },
fail: err => { fail: err => {

View File

@ -476,6 +476,8 @@
if (this.refuelMoney[i].refuelMoney >= this.oilOrder.oilNum){ if (this.refuelMoney[i].refuelMoney >= this.oilOrder.oilNum){
this.oilCardRedece = this.oilOrder.oilNum this.oilCardRedece = this.oilOrder.oilNum
this.refuelMoneyAfter[i].refuelMoney = this.refuelMoney[i].refuelMoney - this.oilOrder.oilNum this.refuelMoneyAfter[i].refuelMoney = this.refuelMoney[i].refuelMoney - this.oilOrder.oilNum
this.payAmount = 0
this.checkOilCard = true
}else{ }else{
this.oilCardRedece = this.refuelMoney[i].refuelMoney this.oilCardRedece = this.refuelMoney[i].refuelMoney
this.refuelMoneyAfter[i].refuelMoney = 0 this.refuelMoneyAfter[i].refuelMoney = 0