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'
})
}
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) {
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',
})

View File

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

View File

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

View File

@ -50,65 +50,115 @@
</div>
</el-card>
<div class="tj">
<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="tjaocuo">
<div class="tj-num">
面值:{{item.cardAmount || 0}}
<div class="sshi">
<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 class="tj-num">
总发卡金额:{{item.total || 0}}
</div>
<div class="tj-num">
总数量:{{item.count || 0}}
<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 class="sshi">
<el-card class="kar" >
<div class="tj-num">已使用卡量</div>
</el-card>
<el-card class="kar" v-for="(item,index) in twolist" :key="index" >
<div class="ds">
<div class="tj-text">已使用卡量</div>
<el-divider></el-divider>
<div class="tj-num" v-if="twolist&&twolist.length == 0 ">暂无数据...</div>
<div>
</div>
<div class="ds"v-for="(item,index) in twolist" :key="index" >
<div class="tj-num">
面值:{{item.cardAmount || 0}}
<div class="tj-num">
<div class="one-size">
{{item.cardAmount || 0}}
</div>
<div class="tj-num">
总发卡金额:{{item.total || 0}}
</div>
<div class="tj-num">
总数量:{{item.count || 0}}
<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 class="sshi">
<el-card class="kar" >
<div class="tj-num">未使用卡量</div>
</el-card>
<el-card class="kar" v-for="(item,index) in threelist" :key="index" >
<div class="ds">
<div class="tj-text">未使用卡量</div>
<el-divider></el-divider>
<div class="tj-num" v-if="threelist&&threelist.length == 0 ">暂无数据...</div>
<div>
</div>
<div class="ds"v-for="(item,index) in threelist" :key="index" >
<div class="tj-num">
面值:{{item.cardAmount || 0}}
<div class="tj-num">
<div class="one-size">
{{item.cardAmount || 0}}
</div>
<div class="tj-num">
总发卡金额:{{item.total || 0}}
</div>
<div class="tj-num">
总数量:{{item.count || 0}}
<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>
@ -452,9 +502,8 @@ import {
.tj{
width: 100%;
display: flex;
justify-content: space-between;
margin-bottom: 20px;
}
.kar{
width: 100%;
@ -462,14 +511,38 @@ import {
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{
width: 100%;
display: flex;
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{
margin: 5px auto;
font-size: 28px;
//font-size: 28px;
color: #666;
text-align: center;
}
@ -494,5 +567,21 @@ import {
}
.sshi{
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>

View File

@ -30,6 +30,20 @@
<el-button type="primary" style="margin-left: 20px" icon="el-icon-search" @click="getlist">搜索</el-button>
</div>
</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-button type="primary" icon="el-icon-plus" style="margin-bottom: 10px " @click="addoilBlock()">新增囤油卡</el-button>
<el-alert
@ -41,76 +55,98 @@
:data="tableData"
style="width: 100%">
<el-table-column
label="序号"
type="index"
>
</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
prop="type"
label="油卡类型"
label="活动时间"
width="330"
>
<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>
</el-table-column>
<el-table-column
prop="oilType"
label="油品"
>
prop="type"
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-->
<!-- prop="oilType"-->
<!-- label="油品"-->
<!-- >-->
<!-- </el-table-column>-->
<el-table-column
prop="rechargeBalance"
label="充值金额"
label="充值金额(元)"
>
<template slot-scope="scope">
<el-tag>{{scope.row.rechargeBalance}}</el-tag>
</template>
</el-table-column>
<el-table-column
prop="lockupPrice"
label="锁价单价"
>
<template slot-scope="scope">
<el-tag>{{scope.row.lockupPrice}}</el-tag>
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- prop="lockupPrice"-->
<!-- label="锁价单价"-->
<!-- >-->
<!-- <template slot-scope="scope">-->
<!-- <el-tag>{{scope.row.lockupPrice}}</el-tag>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
prop="incomeLitres"
label="升数"
label="所得升数L"
>
<template slot-scope="scope">
<el-tag>{{scope.row.incomeLitres}}</el-tag>
</template>
</el-table-column>
<el-table-column
prop="points"
label="赠送积分"
>
<template slot-scope="scope">
<el-tag>{{scope.row.points}}</el-tag>
</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-->
<!-- prop="points"-->
<!-- label="赠送积分"-->
<!-- >-->
<!-- <template slot-scope="scope">-->
<!-- <el-tag>{{scope.row.points}}</el-tag>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
prop="activeStatus"
label="状态"
label="活动状态"
>
<template slot-scope="scope">
@ -125,11 +161,7 @@
</el-switch>
</template>
</el-table-column>
<el-table-column
prop="createTime"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
label="编辑"
>
@ -161,27 +193,20 @@
center>
<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-input v-model="ruleForm.lockupPrice" min="1">
@ -255,12 +280,15 @@
</template>
<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 {
dicts: ['oil_type'],
name: 'index',
data(){
return{
gbPrice:null,
oilPrice:null,
tjlist:[],
value:'',
type:0,
centerDialogVisible:false,
@ -344,7 +372,6 @@
},
'ruleForm.lockupPrice':{
handler: function() {
if(this.ruleForm.rechargeBalance != 0 && this.ruleForm.lockupPrice != 0 ){
this.ruleForm.incomeLitres = this.ruleForm.rechargeBalance / this.ruleForm.lockupPrice
@ -366,8 +393,19 @@
},
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){
this.oilList = []
oilName(this.queryParams.type).then(res=>{
@ -385,6 +423,10 @@
this.total = res.data.total;
}
})
getstatistics().then(res=>{
console.log(res)
this.tjlist = res.data
})
},
addoilBlock(){
@ -454,4 +496,22 @@
display: flex;
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>

View File

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

View File

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

View File

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

View File

@ -39,6 +39,10 @@ public class ActiveNewlywedsVO {
private Integer points;
//赠送成长值
private Integer growthValue;
private Integer youhuiTotal;
private Integer duihuanTotal;
private Integer youhuiTotaled;
private Integer duihuanTotaled;
//自定义规则
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 java.io.Serializable;
import java.util.List;
/**
* 新人有礼活动(ActiveNewlyweds)表服务接口
@ -39,7 +40,7 @@ public interface ActiveNewlywedsService extends IService<ActiveNewlyweds> {
* @param id
* @return
*/
ActiveNewlywedsVO getOneById(Serializable id);
List<ActiveNewlywedsVO> getOneById(Serializable id);
ActiveNewlywedsVO getOneByStoreId(Serializable id);
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.vo.ActiveRecommendAppletVO;
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.common.util.TokenUtil;
import org.apache.commons.lang3.ObjectUtils;
@ -44,6 +48,10 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
private StoreService storeService;
@Resource
private ActiveNewlywedsChildService activeNewlywedsChildService;
@Resource
private CardFavorableRecordService cardFavorableRecordService;
@Resource
private CardExchangeRecordService cardExchangeRecordService;
/**
*
* @param activeNewlywedsDTO
@ -54,13 +62,13 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
boolean save = false;
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
//根据店铺id查询
LambdaQueryWrapper<ActiveNewlyweds> lambdaQueryWrapper = new LambdaQueryWrapper<>();
/*LambdaQueryWrapper<ActiveNewlyweds> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveNewlyweds::getStoreId,storeId);
ActiveNewlyweds one = getOne(lambdaQueryWrapper);
if (ObjectUtils.isNotEmpty(one)){
activeNewlywedsDTO.setId(one.getId());
save = updateOneById(activeNewlywedsDTO);
}else {
}else {*/
if (ObjectUtils.isNotEmpty(TokenUtil.getNowAccountInfo().getStoreId())) {
activeNewlywedsDTO.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
activeNewlywedsDTO.setChainStoreId(storeService.getById(TokenUtil.getNowAccountInfo().getStoreId()).getChainStoreId());
@ -80,7 +88,7 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
return s;
}).collect(Collectors.toList());
save = activeNewlywedsChildService.saveBatch(list);
}
//}
/* //获取当前店铺的id和连锁店id
if (ObjectUtils.isNotEmpty(TokenUtil.getNowAccountInfo().getStoreId())) {
activeNewlywedsDTO.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
@ -151,36 +159,81 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
* @return
*/
@Override
public ActiveNewlywedsVO getOneById(Serializable id) {
public List<ActiveNewlywedsVO> getOneById(Serializable id) {
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
ActiveNewlywedsVO activeNewlywedsVO = new ActiveNewlywedsVO();
activeNewlywedsVO.setCourtesyReward(new String[0]);
ArrayList<ActiveNewlywedsVO> activeNewlywedsVOS = new ArrayList<>();
if (ObjectUtils.isNotEmpty(storeId)){
//获取新人有礼活动信息
LambdaQueryWrapper<ActiveNewlyweds> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveNewlyweds::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
ActiveNewlyweds activeNewlyweds = getOne(lambdaQueryWrapper);
//ActiveNewlyweds activeNewlyweds = getOne(lambdaQueryWrapper);
List<ActiveNewlyweds> list = list(lambdaQueryWrapper);
//获取兑换物品信息
if (ObjectUtils.isNotEmpty(activeNewlyweds)){
LambdaQueryWrapper<ActiveNewlywedsChild> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveNewlywedsChild::getActiveNewlywedsId,activeNewlyweds.getId());
queryWrapper.orderByDesc(ActiveNewlywedsChild::getCreateTime);
List<ActiveNewlywedsChild> activeNewlywedsChildList = activeNewlywedsChildService.list(queryWrapper);
BeanUtils.copyProperties(activeNewlyweds,activeNewlywedsVO);
//封装VO返回
activeNewlywedsVO.setCourtesyReward(activeNewlyweds.getCourtesyReward().split(","));
if (CollectionUtils.isNotEmpty(activeNewlywedsChildList)){
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList);
}else {
ArrayList<ActiveNewlywedsChild> activeNewlywedsChildLists = new ArrayList<>();
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildLists);
if (CollectionUtils.isNotEmpty(list)){
for (ActiveNewlyweds activeNewlyweds : list) {
int youhuiTed = 0;
int duihuanTed = 0;
ActiveNewlywedsVO activeNewlywedsVO = new ActiveNewlywedsVO();
activeNewlywedsVO.setCourtesyReward(new String[0]);
if (ObjectUtils.isNotEmpty(activeNewlyweds)){
LambdaQueryWrapper<ActiveNewlywedsChild> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveNewlywedsChild::getActiveNewlywedsId,activeNewlyweds.getId());
queryWrapper.orderByDesc(ActiveNewlywedsChild::getCreateTime);
List<ActiveNewlywedsChild> activeNewlywedsChildList = activeNewlywedsChildService.list(queryWrapper);
for (ActiveNewlywedsChild activeNewlywedsChild : activeNewlywedsChildList) {
//优惠券
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;
//邀请人获得 0优惠券 1兑换券 2成长值 3积分
private String inviterGiftType;
private String activeNewName;
private Integer activeNewId;
//赠送积分
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 java.io.Serializable;
import java.util.List;
/**
* 推荐有礼表(ActiveRecommend)表服务接口
@ -29,7 +30,7 @@ public interface ActiveRecommendService extends IService<ActiveRecommend> {
* @param id
* @return
*/
ActiveRecommendVO getOneById(Serializable id);
List<ActiveRecommendVO> getOneById(Serializable id);
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.vo.ActiveRecommendAppletVO;
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.store.service.StoreService;
import com.fuint.common.util.TokenUtil;
@ -42,6 +46,10 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
private ActiveRecommendChildService activeRecommendChildService;
@Resource
private CardFavorableService cardFavorableService;
@Resource
private CardFavorableRecordService cardFavorableRecordService;
@Resource
private CardExchangeRecordService cardExchangeRecordService;
/**
* 新增数据
* @param activeRecommendDTO
@ -53,13 +61,13 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
boolean save = false;
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
//根据店铺id查询
LambdaQueryWrapper<ActiveRecommend> lambdaQueryWrapper = new LambdaQueryWrapper<>();
/* LambdaQueryWrapper<ActiveRecommend> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveRecommend::getStoreId,storeId);
ActiveRecommend one = getOne(lambdaQueryWrapper);
if (ObjectUtils.isNotEmpty(one)){
activeRecommendDTO.setId(one.getId());
save = updateOneById(activeRecommendDTO);
}else {
}else {*/
//获取当前店铺的id和连锁店id
if (ObjectUtils.isNotEmpty(TokenUtil.getNowAccountInfo().getStoreId())) {
activeRecommendDTO.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
@ -84,7 +92,7 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
}).collect(Collectors.toList());
save = activeRecommendChildService.saveBatch(list);
}
}
//}
return save;
}
@ -94,42 +102,86 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
* @return
*/
@Override
public ActiveRecommendVO getOneById(Serializable id) {
public List<ActiveRecommendVO> getOneById(Serializable id) {
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
ActiveRecommendVO activeRecommendVO = new ActiveRecommendVO();
activeRecommendVO.setInviterGiftType(new String[0]);
ArrayList<ActiveRecommendVO> activeRecommendVOS = new ArrayList<>();
if (ObjectUtils.isNotEmpty(storeId)){
//获取新人有礼活动信息
LambdaQueryWrapper<ActiveRecommend> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveRecommend::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
ActiveRecommend activeRecommend = getOne(lambdaQueryWrapper);
//获取兑换物品信息
if (ObjectUtils.isNotEmpty(activeRecommend)){
LambdaQueryWrapper<ActiveRecommendChild> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveRecommendChild::getActiveRecommendId,activeRecommend.getId());
queryWrapper.orderByDesc(ActiveRecommendChild::getCreateTime);
List<ActiveRecommendChild> activeRecommendChildList = activeRecommendChildService.list(queryWrapper);
BeanUtils.copyProperties(activeRecommend,activeRecommendVO);
activeRecommendVO.setInviterGiftType(activeRecommend.getInviterGiftType().split(","));
if (CollectionUtils.isNotEmpty(activeRecommendChildList)){
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildList);
//ActiveRecommend activeRecommend = getOne(lambdaQueryWrapper);
List<ActiveRecommend> list = list(lambdaQueryWrapper);
for (ActiveRecommend activeRecommend : list) {
int youhuiTed = 0;
int duihuanTed = 0;
ActiveRecommendVO activeRecommendVO = new ActiveRecommendVO();
activeRecommendVO.setInviterGiftType(new String[0]);
//获取兑换物品信息
if (ObjectUtils.isNotEmpty(activeRecommend)){
LambdaQueryWrapper<ActiveRecommendChild> queryWrapper = new LambdaQueryWrapper<>();
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 {
ArrayList<ActiveRecommendChild> activeRecommendChildren = new ArrayList<>();
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查询单条数据(小程序端)
* @param id
* @param activeConsumption
* @return
*/
@Override

View File

@ -42,6 +42,10 @@ public class ActiveRecommendVO extends Model<ActiveRecommendVO> {
private String invitationCodeType;
//奖励显示 0优惠券 1成长值总额 2积分总额
private String rewardDisplay;
private Integer youhuiTotal;
private Integer duihuanTotal;
private Integer youhuiTotaled;
private Integer duihuanTotaled;
//活动规则
private String activeRule;
//活动状态 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.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.service.CardExchangeRecordService;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeService;
import com.fuint.business.member.entity.LJStaff;
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.util.TokenUtil;
import com.fuint.framework.web.BaseController;
@ -15,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
@ -33,6 +38,10 @@ public class CardExchangeRecordController extends BaseController {
private CardExchangeRecordService cardExchangeRecordService;
@Resource
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());
cardExchangeRecord.setRealName(ljStaff.getRealName());
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));
}

View File

@ -24,6 +24,7 @@ public class CardExchange extends Model<CardExchange> {
private Integer id;
//所属连锁店id
private Integer chainStorId;
private Integer giftId;
//所属店铺id
private Integer storeId;
//是否在线 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.extension.plugins.pagination.Page;
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.entity.CardExchange;
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.TokenUtil;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -27,6 +30,8 @@ public class CardExchangeServiceImpl extends ServiceImpl<CardExchangeMapper, Car
@Resource
private StoreService storeService;
@Autowired
private LJGoodsService goodsService;
/**
* 新增数据
* @param cardExchange
@ -49,6 +54,9 @@ public class CardExchangeServiceImpl extends ServiceImpl<CardExchangeMapper, Car
cardExchange.setQrCodeLink(qr_code_link);
String secretKey = "sQPoC/1do9BZMkg8I5c09A==";
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);
}

View File

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

View File

@ -150,9 +150,34 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
//会员信息
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.setRechargeType("0");
cardValueOrders.setBidBalance(cardValue.getBidBalance());
@ -164,7 +189,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
cardValueOrders.setGrowthValue(cardValue.getGrowthValue());
if (ObjectUtils.isNotEmpty(cardValue.getFringeBenefit())){
cardValueOrders.setFringeBenefit(cardValue.getFringeBenefit());
}
}*/
//优惠券优惠金额
if (ObjectUtils.isNotEmpty(cardValueRecordDTO.getCardFavorableId())){
CardFavorable cardFavorable = cardFavorableService.getById(cardValueRecordDTO.getCardFavorableId());
@ -190,9 +215,11 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
cardValueOrders.setName(ljUserVo.getName());
cardValueOrders.setMobile(ljUserVo.getMobile());
//员工信息
cardValueOrders.setStaffId(ljStaff.getId());
cardValueOrders.setRealName(ljStaff.getRealName());
cardValueOrders.setStaffMobile(ljStaff.getMobile());
if (ObjectUtils.isNotEmpty(ljStaff)){
cardValueOrders.setStaffId(ljStaff.getId());
cardValueOrders.setRealName(ljStaff.getRealName());
cardValueOrders.setStaffMobile(ljStaff.getMobile());
}
//员工提成信息
if (ObjectUtils.isNotEmpty(cardValue.getRoyaltyType())){
cardValueOrders.setRoyaltyType(cardValue.getRoyaltyType());
@ -846,74 +873,81 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
//查询储值卡对应的优惠券列表
List<CardFavorable> cardValueVouchers = getCardValueVouchers(cardValue);
//送优惠券兑换券
if (CollectionUtils.isNotEmpty(cardValueVouchers)) {
for (CardFavorable cardValueVoucher : cardValueVouchers) {
if (ObjectUtils.isNotEmpty(cardValueVoucher)){
cardValueOrders.setCardFavorableId(cardValueVoucher.getId());
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
cardFavorableRecord.setCardFavorableId(cardValueVoucher.getId());
cardFavorableRecord.setStoreId(cardValueOrders.getStoreId());
cardFavorableRecord.setMtUserId(ljUserVo.getId());
cardFavorableRecord.setName(ljUserVo.getName());
cardFavorableRecord.setMobile(ljUserVo.getMobile());
cardFavorableRecord.setStatus("0");
cardFavorableRecord.setExchangeFrom("充值送券");
//优惠券开始结束时间
if (ObjectUtils.isNotEmpty(cardValueVoucher) && ObjectUtils.isNotEmpty(cardValueVoucher.getTimeType())) {
if (cardValueVoucher.getTimeType().equals("0")) {
LocalDate today = LocalDate.now();
LocalDate localDate = today.plusDays(cardValueVoucher.getValidityZero());
Date from = Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
cardFavorableRecord.setEndTime(from);
} else if (cardValueVoucher.getTimeType().equals("1")) {
cardFavorableRecord.setStartTime(cardValueVoucher.getEffectiveDate());
LocalDate today = LocalDate.now();
LocalDate localDate = today.plusDays(cardValueVoucher.getValidityOne());
Date from = Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
cardFavorableRecord.setEndTime(from);
} else {
LocalDate today = LocalDate.now();
LocalDate localDate = today.plusDays(cardValueVoucher.getValidityTwo());
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);
if (cardValueOrders.getRechargeType().equals("1")){
//会员等级充值送券
giveCoupon(cardValueOrders.getMtUserId(),cardValueOrders.getStoreId(),ljUserVo,ljStaff);
}else {
if (CollectionUtils.isNotEmpty(cardValueVouchers)) {
for (CardFavorable cardValueVoucher : cardValueVouchers) {
if (ObjectUtils.isNotEmpty(cardValueVoucher)){
cardValueOrders.setCardFavorableId(cardValueVoucher.getId());
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
cardFavorableRecord.setCardFavorableId(cardValueVoucher.getId());
cardFavorableRecord.setStoreId(cardValueOrders.getStoreId());
cardFavorableRecord.setMtUserId(ljUserVo.getId());
cardFavorableRecord.setName(ljUserVo.getName());
cardFavorableRecord.setMobile(ljUserVo.getMobile());
cardFavorableRecord.setStatus("0");
cardFavorableRecord.setExchangeFrom("充值送券");
//优惠券开始结束时间
if (ObjectUtils.isNotEmpty(cardValueVoucher) && ObjectUtils.isNotEmpty(cardValueVoucher.getTimeType())) {
if (cardValueVoucher.getTimeType().equals("0")) {
LocalDate today = LocalDate.now();
LocalDate localDate = today.plusDays(cardValueVoucher.getValidityZero());
Date from = Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
cardFavorableRecord.setEndTime(from);
} else if (cardValueVoucher.getTimeType().equals("1")) {
cardFavorableRecord.setStartTime(cardValueVoucher.getEffectiveDate());
LocalDate today = LocalDate.now();
LocalDate localDate = today.plusDays(cardValueVoucher.getValidityOne());
Date from = Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
cardFavorableRecord.setEndTime(from);
} else {
LocalDate today = LocalDate.now();
LocalDate localDate = today.plusDays(cardValueVoucher.getValidityTwo());
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()) {
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
public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUserGrade> implements LJUserGradeService {
@Autowired
@Lazy
private ILJStoreService storeService;
@Autowired
@Lazy
private MtUserGradeChildService userGradeChildService;
@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.mapper.LJUserMapper;
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.vo.LJUserVo;
import com.fuint.common.dto.AccountInfo;
@ -34,6 +35,8 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
@Autowired
private UserBalanceService balanceService;
@Autowired
private UserBalanceMapper userBalanceMapper;
@Autowired
private ILJStoreService storeService;
/**
@ -134,12 +137,14 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
QueryWrapper queryWrapper = new QueryWrapper<>();
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<>();
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("point",point);

View File

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

View File

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

View File

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

View File

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

View File

@ -223,12 +223,12 @@
<el-tag v-else type="danger">禁用</el-tag>
</template>
</el-table-column>
<el-table-column label="公众号" align="center" prop="official">
<template slot-scope="scope">
<span v-if="scope.row.official == 'ygz'">已关注</span>
<span v-else>未关注</span>
</template>
</el-table-column>
<!-- <el-table-column label="公众号" align="center" prop="official">-->
<!-- <template slot-scope="scope">-->
<!-- <span v-if="scope.row.official == 'ygz'">已关注</span>-->
<!-- <span v-else>未关注</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" align="center" width="120" fixed='right'>
<template slot-scope="scope">
<el-button
@ -258,7 +258,7 @@
</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
type="info"
:closable="false">
@ -272,31 +272,31 @@
<el-button type="primary"
icon="el-icon-connection" @click="addMult" round>批量导入会员</el-button>
</div>
<div>
<el-table ref="tables" v-loading="loading" :data="userList">
<el-table-column prop="batchNumber" align="center" label="批次号" width="200"/>
<el-table-column prop="type" align="center" label="类型"/>
<el-table-column prop="memberNumber" align="center" label="会员数"/>
<el-table-column label="执行结果" align="center" >
<el-table-column prop="successNumber" align="center" label="成功人数"/>
<el-table-column prop="errorNumber" align="center" label="失败人数"/>
<el-table-column prop="repeatNumber" align="center" label="重复人数"/>
</el-table-column>
<el-table-column prop="createTime" align="center" label="处理时间" width="160">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<!-- <el-table-column prop="date" align="center" label="处理结果详情"/>-->
</el-table>
<!-- <div>-->
<!-- <el-table ref="tables" v-loading="loading" :data="userList">-->
<!-- <el-table-column prop="batchNumber" align="center" label="批次号" width="200"/>-->
<!-- <el-table-column prop="type" align="center" label="类型"/>-->
<!-- <el-table-column prop="memberNumber" align="center" label="会员数"/>-->
<!-- <el-table-column label="执行结果" align="center" >-->
<!-- <el-table-column prop="successNumber" align="center" label="成功人数"/>-->
<!-- <el-table-column prop="errorNumber" align="center" label="失败人数"/>-->
<!-- <el-table-column prop="repeatNumber" align="center" label="重复人数"/>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="createTime" align="center" label="处理时间" width="160">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ parseTime(scope.row.createTime) }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- &lt;!&ndash; <el-table-column prop="date" align="center" label="处理结果详情"/>&ndash;&gt;-->
<!-- </el-table>-->
<pagination
:total="total1"
:page.sync="queryParams.page"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
<!-- <pagination-->
<!-- :total="total1"-->
<!-- :page.sync="queryParams.page"-->
<!-- :limit.sync="queryParams.pageSize"-->
<!-- @pagination="getList"-->
<!-- />-->
<!-- </div>-->
</el-dialog>
<!-- 添加或修改对话框 -->
@ -347,7 +347,7 @@
<el-row>
<el-col :span="24">
<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-col>
</el-row>
@ -361,7 +361,7 @@
<el-row>
<el-col :span="24">
<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-col>
</el-row>
@ -372,19 +372,19 @@
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </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-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-col :span="24">
<el-form-item label="会员状态">
<el-form-item label="会员状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio label="qy" value="qy">启用</el-radio>
<el-radio label="jy" value="jy">禁用</el-radio>
@ -562,6 +562,7 @@
mobile: [
{ required: true, message: "请输入手机号", trigger: "blur" },
],
status: [{ required: true, message: "请选择会员状态", trigger: "blur" }],
},
}
},

View File

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

View File

@ -216,6 +216,7 @@
},
//
getUser() {
console.log(this.AppToken,2343);
if (!this.AppToken) {
return;
}
@ -223,7 +224,8 @@
url: 'business/userManager/user/getUser',
method: 'get',
}).then(res => {
if (res.data != null && res.data != "" && res.data != undefined) {
console.log(res,1541);
if (res.data) {
this.user = res.data
uni.setStorageSync('userId', res.data.id)
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;
uni.setStorageSync("storeId", _this.store.id)
uni.setStorageSync("chainStoreId", _this.store.chainStoreId)
let welfare = res.data.welfare
if (welfare) {
if (welfare.includes(",")) {
_this.welfare = res.data.welfare.split(",")
} else {
_this.welfare.push(res.data.welfare)
}
}
// let welfare = res.data.welfare
// if (welfare) {
// if (welfare.includes(",")) {
// _this.welfare = res.data.welfare.split(",")
// } else {
// _this.welfare.push(res.data.welfare)
// }
// }
}).catch(err => {
// uni.showLoading({
// title: JSON.stringify(err) + 222
@ -337,9 +337,8 @@
_this.storeId = response.data.store.id;
_this.getOilNumber(_this.storeId);
// _this.getStaffList(_this.storeId)
let welfare = response.data.store.welfare;
if (welfare != undefined && welfare != null && welfare != "") {
if (welfare.includes(",")) {
if (response.data.store.welfare) {
if (response.data.store.welfare.includes(",")) {
_this.welfare = response.data.store.welfare.split(",");
} else {
_this.welfare.push(response.data.store.welfare);

View File

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

View File

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