Merge branch 'master' of https://gitee.com/nny_1/oilSystem
# Conflicts: # fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/impl/CardFuelRecordServiceImpl.java
This commit is contained in:
commit
0264b284a3
@ -54,7 +54,7 @@ export function updateActiveNewlyweds(data) {
|
||||
// 删除新人有礼活动
|
||||
export function delActiveNewlyweds(id) {
|
||||
return request({
|
||||
url: '/business/marketingActivity/activeNewlyweds/' + id,
|
||||
url: '/business/marketingActivity/activeNewlyweds/delById/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ export function listActiveRecommend(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
//优惠券
|
||||
export function listFavorable(query) {
|
||||
return request({
|
||||
@ -52,7 +53,7 @@ export function addActiveRecommend(data) {
|
||||
export function updateActiveRecommend(data) {
|
||||
return request({
|
||||
url: 'business/marketingActivity/activeRecommend',
|
||||
method: 'post',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@ -60,7 +61,7 @@ export function updateActiveRecommend(data) {
|
||||
// 删除推荐有礼
|
||||
export function delActiveRecommend(id) {
|
||||
return request({
|
||||
url: '/business/marketingActivity/activeRecommend/' + id,
|
||||
url: '/business/marketingActivity/activeRecommend/delById/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ import request from '@/utils/request'
|
||||
|
||||
export function issueCardFavorable(data) {
|
||||
return request({
|
||||
url: 'business/marketingActivity/cardFavorableRecord/issueCardFavorable',
|
||||
url: 'business/marketingActivity/oneActiveOneCoupon',
|
||||
method: 'post',
|
||||
data:data
|
||||
})
|
||||
@ -15,3 +15,11 @@ export function getCardFavorableLists(status) {
|
||||
params: status
|
||||
})
|
||||
}
|
||||
export function getAdaptUserList(data) {
|
||||
|
||||
return request({
|
||||
url: 'business/marketingActivity/cardFavorableRecord/getAdaptUserList',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
@ -101,7 +101,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
<!-- <el-table-column
|
||||
prop="activeStatus"
|
||||
label="活动状态"
|
||||
align="center"
|
||||
@ -118,7 +118,7 @@
|
||||
</el-switch>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
</el-table-column>-->
|
||||
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
|
@ -219,6 +219,7 @@
|
||||
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="loading" :data="activeFullminusList" @selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
|
@ -1,41 +1,142 @@
|
||||
<template>
|
||||
<div class="appconter">
|
||||
<el-card style="margin-bottom: 20px">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="活动名称" prop="activeName">
|
||||
<el-input
|
||||
v-model="queryParams.activeName"
|
||||
placeholder="请输入活动名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="queryParams.status" clearable placeholder="请选择活动状态">
|
||||
<el-option label="启用" value="0"></el-option>
|
||||
<el-option label="禁用" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否在线" prop="isonline">
|
||||
<el-select v-model="queryParams.isonline" clearable placeholder="请选择是否在线">
|
||||
<el-option label="在线" value="0"></el-option>
|
||||
<el-option label="下线" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span style="font-size: 20px">推荐有礼</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="addActivef"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-table v-loading="loading" :data="zList" @selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
type="index"
|
||||
align="center"
|
||||
label="序号"
|
||||
>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="活动编号" align="center" prop="id" />-->
|
||||
<el-table-column label="活动名称" align="center" prop="activeName" />
|
||||
<el-table-column label="活动时间" align="center" prop="adaptUserType" >
|
||||
<template slot-scope="scope">
|
||||
<span >{{scope.row.activeStartTime || 0}}-{{scope.row.activeEndTime || 0}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="活动状态 " align="center" prop="status" >
|
||||
<template slot-scope="scope">
|
||||
<span style="cursor: pointer;" @click="qiyong(scope.row)" v-if="scope.row.status == 0"> <el-tag>启用</el-tag > </span>
|
||||
<span style="cursor: pointer;" @click="jinyong(scope.row)" v-if="scope.row.status == 1"> <el-tag type="danger">禁用</el-tag> </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="赠送积分" align="center" prop="adaptUserType" >
|
||||
<template slot-scope="scope">
|
||||
<span >{{scope.row.points || 0}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="赠送成长值" align="center" prop="adaptUserType" >
|
||||
<template slot-scope="scope">
|
||||
<span >{{scope.row.growthValue || 0}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="活动更新时间" align="center" prop="updateTime" >
|
||||
<template slot-scope="scope">
|
||||
<span >{{scope.row.updateTime || '暂无更新'}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</div>
|
||||
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
|
||||
<!-- <el-form-item label="活动图片" prop="activePictureUrl">
|
||||
<el-upload
|
||||
:action="uploadAction"
|
||||
list-type="picture-card"
|
||||
:file-list="uploadFiles"
|
||||
:auto-upload="true"
|
||||
:show-file-list="false"
|
||||
:headers="uploadHeader"
|
||||
:on-success="handleUploadSuccess">
|
||||
<img
|
||||
v-if="this.ruleForm.activePictureUrl"
|
||||
:src="imagePath + this.ruleForm.activePictureUrl"
|
||||
class="list-img"
|
||||
/>
|
||||
<i v-if="!this.ruleForm.activePictureUrl" class="el-icon-plus"></i>
|
||||
</el-upload>
|
||||
</el-form-item>-->
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="lookDetail(scope.row)"
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDeletexia(scope.row)"
|
||||
v-if="scope.row.isonline == 0"
|
||||
>下线</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="Deleteshan(scope.row)"
|
||||
v-if="scope.row.isonline == 1"
|
||||
>删除</el-button>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-dialog title="推荐有礼" :visible.sync="xzshow" width="75%">
|
||||
<!-- <div slot="header" class="clearfix">-->
|
||||
<!-- <span style="font-size: 20px">推荐有礼</span>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm">
|
||||
<el-form-item label="活动名称" prop="activeName">
|
||||
<el-input v-model="ruleForm.activeName" placeholder="请输入活动名称" />
|
||||
</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>
|
||||
</el-checkbox-group>
|
||||
|
||||
</el-form-item>
|
||||
<!-- 优惠券-->
|
||||
<div class="xh-box" v-if="ruleForm.inviterGiftType && ruleForm.inviterGiftType.indexOf('0')>-1" >
|
||||
<div class="box-bt"> <div >赠送卡券</div> <el-button type="primary" icon="el-icon-plus" @click="getlistFavorable()" >新增</el-button> </div>
|
||||
<div style="margin: 10px 0px">
|
||||
|
||||
<el-table
|
||||
:data="ruleForm.ylist"
|
||||
border
|
||||
@ -68,9 +169,9 @@
|
||||
label="有效期(天)"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.timeType == 0" > <el-input-number v-model="scope.row.validityZero" controls-position="right" :min="1" :max="9999"></el-input-number>天 </span>
|
||||
<span v-if="scope.row.timeType == 1" > <el-input-number v-model="scope.row.validityOne" controls-position="right" :min="1" :max="9999"></el-input-number>天 </span>
|
||||
<span v-if="scope.row.timeType == 2" > <el-input-number v-model="scope.row.validityTwo" controls-position="right" :min="1" :max="9999"></el-input-number>天 </span>
|
||||
<span v-if="scope.row.timeType == 0" > <el-input-number v-model="scope.row.validityZero" controls-position="right" :min="1" :max="9999"></el-input-number> </span>
|
||||
<span v-if="scope.row.timeType == 1" > <el-input-number v-model="scope.row.validityOne" controls-position="right" :min="1" :max="9999"></el-input-number> </span>
|
||||
<span v-if="scope.row.timeType == 2" > <el-input-number v-model="scope.row.validityTwo" controls-position="right" :min="1" :max="9999"></el-input-number></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@ -94,7 +195,6 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- 兑换券-->
|
||||
@ -172,110 +272,15 @@
|
||||
<el-input-number v-model="ruleForm.growthValue" controls-position="right" :min="0" :max="999999999"></el-input-number>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="新用户获得" prop="newuserGiftType">
|
||||
<el-radio-group v-model="ruleForm.newuserGiftType">
|
||||
<el-radio label="0">优惠券</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 新用户-->
|
||||
<div class="xh-box" v-if=" ruleForm.newuserGiftType == 0 " >
|
||||
<div class="box-bt"> <div >新用户获得</div> <el-button type="primary" icon="el-icon-plus" @click="xgetlistFavorable()" >新增</el-button> </div>
|
||||
<div style="margin: 10px 0px">
|
||||
|
||||
<el-table
|
||||
:data="ruleForm.xylist"
|
||||
border
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
prop="giftCardName"
|
||||
label="卡券名称"
|
||||
width="0">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="giftCardType"
|
||||
label="券类型"
|
||||
width="80">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.giftCardType == 0" >油品券</span>
|
||||
<span v-if="scope.row.giftCardType == 1" >商品券</span>
|
||||
<span v-if="scope.row.giftCardType == 2" >通用券</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="date"
|
||||
label="券详情"
|
||||
width="80">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.giftCardDetail}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="date"
|
||||
label="有效期(天)"
|
||||
width="240">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.timeType == 0" > <el-input-number v-model="scope.row.validityZero" controls-position="right" :min="1" :max="9999"></el-input-number>天 </span>
|
||||
<span v-if="scope.row.timeType == 1" > <el-input-number v-model="scope.row.validityOne" controls-position="right" :min="1" :max="9999"></el-input-number>天 </span>
|
||||
<span v-if="scope.row.timeType == 2" > <el-input-number v-model="scope.row.validityTwo" controls-position="right" :min="1" :max="9999"></el-input-number>天 </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="date"
|
||||
label="数量"
|
||||
width="240">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="scope.row.giftCardTotal" controls-position="right" :min="1" :max="9999"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="address"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="xdeletedata(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="xh-box" >
|
||||
<div class="box-bt"> <div style="font-size: 16px;font-weight: bold" >新用户获得</div> <div><el-button type="primary" icon="el-icon-plus" @click="gethuodonglist()" >选择活动</el-button> </div> </div>
|
||||
<div class="box-bt" style="margin-top: 15px" v-if="ruleForm.activeNewName">
|
||||
<div style="font-size: 16px;font-weight: bold">活动名称:{{ruleForm.activeNewName}} </div>
|
||||
<el-button type="danger" icon="el-icon-delete" circle @click="scxrhd()" ></el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <el-form-item label="分享标题" prop="title">
|
||||
<el-input v-model="ruleForm.title"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="分享图片" prop="titleUrl">
|
||||
<el-upload
|
||||
:action="uploadAction"
|
||||
list-type="picture-card"
|
||||
:file-list="uploadFiles"
|
||||
:auto-upload="true"
|
||||
:show-file-list="false"
|
||||
:headers="uploadHeader"
|
||||
:on-success="handleUploadSuccesss">
|
||||
<img
|
||||
v-if="this.ruleForm.titleUrl"
|
||||
:src="imagePath + this.ruleForm.titleUrl"
|
||||
class="list-img"
|
||||
/>
|
||||
<i v-if="!this.ruleForm.titleUrl" class="el-icon-plus"></i>
|
||||
</el-upload>
|
||||
</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 label="奖励显示" prop="rewardDisplay">
|
||||
<el-radio-group v-model="ruleForm.rewardDisplay">
|
||||
<el-radio label="0">优惠券总额</el-radio>
|
||||
<el-radio label="1">成长值总额</el-radio>
|
||||
<el-radio label="2">积分总额</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="活动规则" prop="activeRule">
|
||||
<el-input type="textarea" v-model="ruleForm.activeRule"></el-input>
|
||||
</el-form-item>
|
||||
@ -293,7 +298,95 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
</el-card>
|
||||
</el-dialog>
|
||||
<!-- 新用户活动-->
|
||||
<el-dialog title="活动列表" :visible.sync="huodongshow">
|
||||
<div style="display: flex;align-items: center; margin-bottom: 20px ">
|
||||
<el-input v-model="huodongname" placeholder="优惠券名称"></el-input>
|
||||
<el-button type="primary" icon="el-icon-search" @click="xgetlistFavorable" >搜索</el-button>
|
||||
|
||||
</div>
|
||||
<el-table
|
||||
:data="huodonglist"
|
||||
border
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="活动名称"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column
|
||||
prop="date"
|
||||
label="有效期(天)"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.activeEndTime}}</span> -
|
||||
<span>{{scope.row.activeStartTime}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="address"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="huodongxz(scope.row)"
|
||||
>选择</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div><pagination
|
||||
v-show="zquerys.total>0"
|
||||
:total="zquerys.total"
|
||||
:page.sync="zquerys.pageNum"
|
||||
:limit.sync="zquerys.pageSize"
|
||||
@pagination="gethuodonglist"
|
||||
/></div>
|
||||
</el-dialog>
|
||||
<el-dialog title="详情统计" :visible.sync="opendetails" width="45%" append-to-body>
|
||||
<div style="display: flex;justify-content: space-between;width: 100%;">
|
||||
<div class="x-box">
|
||||
<div>优惠券数量统计</div>
|
||||
<div>总数量: {{statisticsyou.count ||0}}</div>
|
||||
<div>已使用数量: {{statisticsyou.countEd ||0}}</div>
|
||||
<div>未使用数量: {{statisticsyou.countLd ||0}}</div>
|
||||
</div>
|
||||
<div class="x-box">
|
||||
<div>兑换券数量统计</div>
|
||||
<div>总数量: {{statisticsyou.counts ||0}}</div>
|
||||
<div>已使用数量: {{statisticsyou.countEds ||0}}</div>
|
||||
<div>未使用数量: {{statisticsyou.countLds ||0}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
:data="looklist"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="昵称"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="mobile"
|
||||
label="联系方式"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
label="领取日期"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="exchangeFrom"
|
||||
label="获取方式"
|
||||
>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
<!-- 优惠券列表 - 新用户获得 -->
|
||||
<el-dialog title="优惠券列表" :visible.sync="xdialogTableVisible">
|
||||
<div style="display: flex;align-items: center; margin-bottom: 20px ">
|
||||
@ -487,7 +580,6 @@
|
||||
|
||||
</el-dialog>
|
||||
<!-- 添加或修改推荐有礼对话框 -->
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -495,10 +587,16 @@
|
||||
import { listActiveRecommend, getActiveRecommend, delActiveRecommend, addActiveRecommend, updateActiveRecommend,listFavorable,listExchange } from "@/api/EventMarketing/activeRecommend";
|
||||
import ImageUpload from '@/components/ImageUpload'
|
||||
import {getToken} from "@/utils/auth";
|
||||
import {getActiveNewlyweds, listActiveNewlyweds, updateActiveNewlyweds} from "@/api/EventMarketing/activeNewlyweds";
|
||||
import {looklook, looklooklook} from "@/api/EventMarketing/activeConsumption";
|
||||
export default {
|
||||
name: "ActiveRecommend",
|
||||
data() {
|
||||
return {
|
||||
opendetails:false,
|
||||
looklist:[],
|
||||
statisticsyou:{},
|
||||
xzshow:false,
|
||||
//请求优惠券 - 新人 列表时的参数
|
||||
xyouhuiquan:{
|
||||
name:'',
|
||||
@ -520,6 +618,11 @@ export default {
|
||||
pageSize: 10,
|
||||
total:0
|
||||
},
|
||||
zquerys: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
total:0
|
||||
},
|
||||
dtotal:0,
|
||||
imagePath:process.env.VUE_APP_SERVER_URL,
|
||||
// 上传地址
|
||||
@ -533,8 +636,15 @@ export default {
|
||||
xdialogTableVisible:false,
|
||||
dialogTableVisible:false,//优惠券
|
||||
dialogTableVisibledh:false,//兑换券
|
||||
huodonglist:[],
|
||||
huodongname:'',
|
||||
huodongquerys: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
huodongshow:false,
|
||||
ruleForm: {
|
||||
id:1,
|
||||
id:null,
|
||||
activePictureUrl: '',
|
||||
titleUrl:'',
|
||||
ylist:[],
|
||||
@ -546,6 +656,8 @@ export default {
|
||||
growthValue:'',
|
||||
region: '',
|
||||
activeConsumptionChildList:[],
|
||||
activeNewName:'',
|
||||
activeNewId:'',
|
||||
|
||||
},
|
||||
xylist:[],
|
||||
@ -557,6 +669,7 @@ export default {
|
||||
],
|
||||
ylist:[],
|
||||
dlist:[],
|
||||
zList:[],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
@ -577,9 +690,10 @@ export default {
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
activeName:null,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
id:1,
|
||||
id:null,
|
||||
chainStoreId: null,
|
||||
storeId: null,
|
||||
activePictureUrl: null,
|
||||
@ -595,12 +709,17 @@ export default {
|
||||
isonline: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
form: {
|
||||
activeName:'',
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
/*activePictureUrl: [
|
||||
{ required: true, message: '必填项不能为空', trigger: 'blur' },
|
||||
],*/
|
||||
activeName: [
|
||||
{ required: true, message: '必填项不能为空', trigger: 'blur' },
|
||||
],
|
||||
inviterGiftType: [
|
||||
{ required: true, message: '必填项不能为空', trigger: 'blur' },
|
||||
],
|
||||
@ -626,13 +745,34 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getactivelist()
|
||||
// this.getList();
|
||||
},
|
||||
|
||||
components:{
|
||||
ImageUpload
|
||||
},
|
||||
methods: {
|
||||
addActivef(){
|
||||
this.ruleForm ={
|
||||
id:null,
|
||||
activePictureUrl: '',
|
||||
titleUrl:'',
|
||||
ylist:[],
|
||||
dlist:[],
|
||||
xylist:[],
|
||||
inviterGiftType:[],
|
||||
name: '',
|
||||
points:'',
|
||||
growthValue:'',
|
||||
region: '',
|
||||
activeConsumptionChildList:[],
|
||||
activeNewName:'',
|
||||
activeNewId:'',
|
||||
|
||||
},
|
||||
this.xzshow = true
|
||||
},
|
||||
// 图片上传成功
|
||||
handleUploadSuccess(file) {
|
||||
console.log('图片上传成功',file)
|
||||
@ -644,10 +784,18 @@ export default {
|
||||
this.ruleForm.titleUrl = file.data.fileName
|
||||
},
|
||||
|
||||
|
||||
getactivelist(){
|
||||
this.loading = true;
|
||||
listActiveRecommend(this.queryParams).then(res=>{
|
||||
console.log(res)
|
||||
this.zList = res.data.records
|
||||
this.total = res.data.total
|
||||
this.loading = false;
|
||||
})
|
||||
},
|
||||
/** 查询推荐有礼列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// this.loading = true;
|
||||
getActiveRecommend(1).then(response => {
|
||||
this.ruleForm = response.data
|
||||
this.ruleForm.xylist = response.data.activeRecommendChildList.filter(item => item.giftUserType == '1')
|
||||
@ -656,7 +804,7 @@ export default {
|
||||
console.log( "1", this.ruleForm.xylist)//优惠券数组 新用户获得
|
||||
console.log( "2",this.ruleForm.ylist)// 优惠券数组
|
||||
console.log( "3",this.ruleForm.dlist)//兑换券数组
|
||||
this.loading = false;
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
@ -671,6 +819,15 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
// 新人活动列表
|
||||
gethuodonglist(){
|
||||
listActiveNewlyweds(this.zquerys).then(res=>{
|
||||
this.huodongshow = true
|
||||
this.huodonglist = res.data.records
|
||||
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
// 请求优惠券
|
||||
getlistFavorable(){
|
||||
this.ylist = []
|
||||
@ -726,6 +883,16 @@ export default {
|
||||
this.ruleForm.dlist.push(data)
|
||||
this.$message.success("新增成功")
|
||||
},
|
||||
huodongxz(row){
|
||||
console.log(row)
|
||||
this.ruleForm.activeNewName = row.name
|
||||
this.ruleForm.activeNewId = row.id
|
||||
this.huodongshow = false
|
||||
},
|
||||
scxrhd(){
|
||||
this.ruleForm.activeNewName = null
|
||||
this.ruleForm.activeNewId = null
|
||||
},
|
||||
//优惠券 新用户
|
||||
chosedataxyh(row){
|
||||
this.xdialogTableVisible = false
|
||||
@ -765,7 +932,6 @@ export default {
|
||||
}
|
||||
|
||||
this.pdidlist.push(row.id)
|
||||
|
||||
let data ={
|
||||
giftUserType:0,//邀请人获得
|
||||
activeGift: 1, //活动奖品 0:赠送积分1:赠送优惠券 2. 赠送兑换券 3:赠送成长值 4. 赠送实物
|
||||
@ -837,6 +1003,21 @@ export default {
|
||||
|
||||
}
|
||||
},
|
||||
lookDetail(row){
|
||||
this.opendetails = true
|
||||
let data = {
|
||||
id:row.id
|
||||
}
|
||||
looklook(data).then(res=>{
|
||||
this.looklist = res.data
|
||||
|
||||
console.log('详情',res)
|
||||
})
|
||||
looklooklook(row.id).then(resp=>{
|
||||
this.statisticsyou = resp.data
|
||||
console.log('优惠券详情统计',resp)
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
@ -844,8 +1025,10 @@ export default {
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: 1,
|
||||
|
||||
this.ruleForm = {
|
||||
id: null,
|
||||
activeName:null,
|
||||
chainStoreId: null,
|
||||
storeId: null,
|
||||
activePictureUrl: null,
|
||||
@ -865,7 +1048,7 @@ export default {
|
||||
activeRecommendChildList:[],
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
// this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
@ -891,47 +1074,95 @@ export default {
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.ruleForm ={
|
||||
id:null,
|
||||
activePictureUrl: '',
|
||||
titleUrl:'',
|
||||
ylist:[],
|
||||
dlist:[],
|
||||
xylist:[],
|
||||
inviterGiftType:[],
|
||||
name: '',
|
||||
points:'',
|
||||
growthValue:'',
|
||||
region: '',
|
||||
activeConsumptionChildList:[],
|
||||
|
||||
}
|
||||
const id = row.id || this.ids
|
||||
// getActiveRecommend(id).then(response => {
|
||||
// this.form = response.data;
|
||||
// this.xzshow = true;
|
||||
// this.title = "修改推荐有礼";
|
||||
// });
|
||||
getActiveRecommend(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改推荐有礼";
|
||||
this.ruleForm = response.data
|
||||
this.xzshow = true;
|
||||
if(response.data.activeRecommendChildList){
|
||||
this.ruleForm.xylist = response.data.activeRecommendChildList.filter(item => item.giftUserType == '1')
|
||||
this.ruleForm.ylist = response.data.activeRecommendChildList.filter(item => { return item.activeGift === '1' && item.giftUserType=== '0'; })
|
||||
this.ruleForm.dlist = response.data.activeRecommendChildList.filter(item => item.activeGift == '2')
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
},
|
||||
handleDeletexia(row){
|
||||
getActiveRecommend(row.id).then(response => {
|
||||
|
||||
let data = response.data
|
||||
data.isonline = 1
|
||||
updateActiveRecommend(data).then(response => {
|
||||
this.$modal.msgSuccess("下线成功");
|
||||
|
||||
this.getactivelist()
|
||||
});
|
||||
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
|
||||
this.ruleForm.activeRecommendChildList = this.ruleForm.ylist.concat(this.ruleForm.dlist,this.ruleForm.xylist);
|
||||
console.log(this.ruleForm.activeRecommendChildList)
|
||||
console.log(this.ruleForm)
|
||||
this.ruleForm.id = 1
|
||||
|
||||
// this.ruleForm.id = 1
|
||||
|
||||
this.$refs["ruleForm"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.ruleForm.id != null) {
|
||||
updateActiveRecommend(this.ruleForm).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addActiveRecommend(this.ruleForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
if(this.ruleForm.id ){
|
||||
console.log(this.ruleForm.id,'修改')
|
||||
updateActiveRecommend(this.ruleForm).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.xzshow = false;
|
||||
this.getactivelist()
|
||||
});
|
||||
}else {
|
||||
console.log(this.ruleForm.id,'新增')
|
||||
addActiveRecommend(this.ruleForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.xzshow = false;
|
||||
this.getactivelist()
|
||||
});
|
||||
}
|
||||
// if (this.ruleForm.id != '') {
|
||||
// console.log(this.ruleForm.id,'新增')
|
||||
|
||||
//
|
||||
// } else {
|
||||
// console.log(this.ruleForm.id,'修改')
|
||||
|
||||
// }
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
Deleteshan(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除推荐有礼编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delActiveRecommend(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.getactivelist()
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
@ -949,8 +1180,21 @@ export default {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.box-bt{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.appconter{
|
||||
box-sizing: border-box;
|
||||
padding: 15px;
|
||||
}
|
||||
.x-box{
|
||||
background: #f9f9f9;
|
||||
border-radius: 6px;
|
||||
box-sizing: border-box;
|
||||
padding: 15px;
|
||||
width: 45%;
|
||||
}
|
||||
</style>
|
||||
|
@ -89,7 +89,7 @@
|
||||
|
||||
</div>
|
||||
<div class="sshi">
|
||||
<div class="tj-text">已使用卡量</div>
|
||||
<div class="tj-text">未使用卡量</div>
|
||||
<el-divider></el-divider>
|
||||
<div class="tj-num" v-if="twolist&&twolist.length == 0 ">暂无数据...</div>
|
||||
<div>
|
||||
@ -125,7 +125,7 @@
|
||||
|
||||
</div>
|
||||
<div class="sshi">
|
||||
<div class="tj-text">未使用卡量</div>
|
||||
<div class="tj-text">已使用卡量</div>
|
||||
<el-divider></el-divider>
|
||||
<div class="tj-num" v-if="threelist&&threelist.length == 0 ">暂无数据...</div>
|
||||
<div>
|
||||
@ -165,17 +165,15 @@
|
||||
</div>
|
||||
|
||||
<el-card style="margin-bottom: 20px">
|
||||
<div>
|
||||
<!-- <div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="daking()" >新增礼品卡</el-button>
|
||||
</div>-->
|
||||
<div class="title_">
|
||||
电子礼品卡列表
|
||||
</div>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
prop="id"
|
||||
label="ID"
|
||||
width="80">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="number"
|
||||
label="电子礼品卡号"
|
||||
@ -239,11 +237,11 @@
|
||||
width="220"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
<!-- <el-table-column
|
||||
prop="remark"
|
||||
label="备注信息"
|
||||
width="280">
|
||||
</el-table-column>
|
||||
</el-table-column>-->
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
@ -579,9 +577,14 @@ import {
|
||||
margin-bottom: 15px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
.title_{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
justify-content: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
|
@ -2,7 +2,6 @@
|
||||
<div class="app-container">
|
||||
<el-card style="margin-bottom: 20px">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
|
||||
<el-form-item label="券状态" prop="name">
|
||||
<el-select v-model="status" clearable placeholder="请选择">
|
||||
<el-option
|
||||
@ -13,8 +12,6 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
</el-form-item>
|
||||
@ -55,7 +52,6 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
@ -65,11 +61,15 @@
|
||||
/>
|
||||
</el-card>
|
||||
<!-- 添加或修改消费有礼活动对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="45%" append-to-body>
|
||||
<el-dialog :title="title" :visible.sync="open" width="65%" append-to-body>
|
||||
|
||||
<el-form ref="form" :model="form" :rules="rules" :label-position="labelPosition" label-width="110px">
|
||||
<el-form-item label="活动名称" prop="activeName">
|
||||
<el-input v-model="activeName" placeholder="请输入活动名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="会员等级" prop="" >
|
||||
<el-select v-model="gradeIds" multiple clearable placeholder="会员等级">
|
||||
<el-option :label="item.name" :value="item.id.toString()" v-for="(item,index) in userGradeList" :key="index" > </el-option>
|
||||
<el-select v-model="gradeIds" multiple clearable placeholder="会员等级" @change="change">
|
||||
<el-option :label="item.name" :value="item.id.toString()" v-for="(item,index) in userGradeList" :key="index" > </el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="不活跃用户" prop="">
|
||||
@ -78,10 +78,37 @@
|
||||
<div style="margin-left: 5px">天 <span style="color: red">(查找最近N天未进行消费的用户)</span> </div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<!-- -->
|
||||
<div style="margin: 10px 0px">
|
||||
<el-table
|
||||
:data="rlist"
|
||||
border
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
prop="gradeName"
|
||||
label="会员等级名称"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="countAll"
|
||||
label="存量总数"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="count"
|
||||
label="不活跃总数"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="rate"
|
||||
label="百分比"
|
||||
>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- 选择优惠券-->
|
||||
<div class="xh-box" >
|
||||
<div class="box-bt"> <div >赠送卡券</div> <el-button type="primary" icon="el-icon-plus" @click="getlistFavorable()" >新增</el-button> </div>
|
||||
<div class="box-bt"> <div >赠送优惠券</div> <el-button type="primary" icon="el-icon-plus" @click="getlistFavorable()" >新增</el-button> </div>
|
||||
<div style="margin: 10px 0px">
|
||||
<el-table
|
||||
:data="form.tableDatas"
|
||||
@ -90,12 +117,12 @@
|
||||
<el-table-column
|
||||
prop="giftCardName"
|
||||
label="卡券名称"
|
||||
width="0">
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="giftCardType"
|
||||
label="券类型"
|
||||
width="80">
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.giftCardType == 0" >油品券</span>
|
||||
<span v-if="scope.row.giftCardType == 1" >商品券</span>
|
||||
@ -105,7 +132,7 @@
|
||||
<el-table-column
|
||||
prop="date"
|
||||
label="券详情"
|
||||
width="80">
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.giftCardDetail}}</span>
|
||||
</template>
|
||||
@ -113,19 +140,19 @@
|
||||
<el-table-column
|
||||
prop="date"
|
||||
label="有效期(天)"
|
||||
width="240">
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.timeType == 0" > <el-input-number v-model="scope.row.validityZero" controls-position="right" :min="1" :max="9999"></el-input-number>天 </span>
|
||||
<span v-if="scope.row.timeType == 1" > <el-input-number v-model="scope.row.validityOne" controls-position="right" :min="1" :max="9999"></el-input-number>天 </span>
|
||||
<span v-if="scope.row.timeType == 2" > <el-input-number v-model="scope.row.validityTwo" controls-position="right" :min="1" :max="9999"></el-input-number>天 </span>
|
||||
<span v-if="scope.row.timeType == 0" > <el-input-number v-model="scope.row.validityZero" controls-position="right" size="mini" :min="1" :max="9999"></el-input-number></span>
|
||||
<span v-if="scope.row.timeType == 1" > <el-input-number v-model="scope.row.validityOne" controls-position="right" size="mini" :min="1" :max="9999"></el-input-number></span>
|
||||
<span v-if="scope.row.timeType == 2" > <el-input-number v-model="scope.row.validityTwo" controls-position="right" size="mini" :min="1" :max="9999"></el-input-number></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="date"
|
||||
label="数量"
|
||||
width="240">
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="scope.row.giftCardTotal" controls-position="right" :min="1" :max="9999"></el-input-number>
|
||||
<el-input-number v-model="scope.row.giftCardTotal" controls-position="right" size="mini" :min="1" :max="9999"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@ -145,6 +172,72 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- 选择兑换券-->
|
||||
<div class="xh-box" >
|
||||
<div class="box-bt"> <div >选择兑换券</div> <el-button type="primary" icon="el-icon-plus" @click="getlistExchange()" >新增</el-button> </div>
|
||||
<div style="margin: 10px 0px">
|
||||
|
||||
<el-table
|
||||
:data="tableDatas"
|
||||
border
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
prop="giftCardName"
|
||||
label="卡券名称"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="date"
|
||||
label="券类型"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.giftCardType == 0" >油品券</span>
|
||||
<span v-if="scope.row.giftCardType == 1" >商品券</span>
|
||||
<span v-if="scope.row.giftCardType == 2" >通用券</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="date"
|
||||
label="券详情"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.giftCardDetail}}</span>
|
||||
<!-- <span>满{{scope.row.fullDeduction}}减 {{scope.row.discountAmount}}元 </span>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="date"
|
||||
label="有效期(天)"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span > <el-input-number v-model="scope.row.giftCardTime" controls-position="right" size="mini" :min="1" :max="9999"></el-input-number> </span>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="date"
|
||||
label="数量"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="scope.row.giftCardTotal" controls-position="right" size="mini" :min="1" :max="9999"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="address"
|
||||
label="操作"
|
||||
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="deletedhdata(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</el-form>
|
||||
@ -191,9 +284,9 @@
|
||||
label="有效期(天)"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.timeType == 0" >{{scope.row.validityZero}}天 </span>
|
||||
<span v-if="scope.row.timeType == 1" >{{scope.row.validityOne}}天 </span>
|
||||
<span v-if="scope.row.timeType == 2" >{{scope.row.validityTwo}}天 </span>
|
||||
<span v-if="scope.row.timeType == 0" >{{scope.row.validityZero}} </span>
|
||||
<span v-if="scope.row.timeType == 1" >{{scope.row.validityOne}} </span>
|
||||
<span v-if="scope.row.timeType == 2" >{{scope.row.validityTwo}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@ -257,7 +350,7 @@
|
||||
label="有效期(天)"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
<span >{{scope.row.validity}}天 </span>
|
||||
<span >{{scope.row.validity}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@ -282,32 +375,13 @@
|
||||
/></div>
|
||||
</el-dialog>
|
||||
<!-- 实物列表-->
|
||||
<el-dialog title="实物列表" :visible.sync="dialogTableVisiblesw">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
|
||||
<el-form-item label="选择商品">
|
||||
<el-select v-model="shopdata.goodsId" placeholder="请选择商品" @change="swchange">
|
||||
<el-option :label="item.name" :value="item" v-for="(item,index) in tableDatasw" :key="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品数量" prop="nmb" >
|
||||
<el-input-number v-model="shopdata.count" controls-position="right" :min="1" :max="9999"></el-input-number>
|
||||
|
||||
</el-form-item>
|
||||
<el-button
|
||||
|
||||
type="primary"
|
||||
@click="shwdata()"
|
||||
>确定</el-button>
|
||||
|
||||
</el-form>
|
||||
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getoiltype,getoilName, listActiveConsumption,listExchange,listLJGoods, getActiveConsumption, delActiveConsumption, addActiveConsumption, updateActiveConsumption,listFavorable } from "@/api/EventMarketing/activeConsumption";
|
||||
import {issueCardFavorable,getCardFavorableLists} from "@/api/EventMarketing/yijian";
|
||||
import {issueCardFavorable,getCardFavorableLists,getAdaptUserList} from "@/api/EventMarketing/yijian";
|
||||
import {listUserGrade} from "@/api/staff/user/usergrade";
|
||||
|
||||
export default {
|
||||
@ -323,6 +397,7 @@ export default {
|
||||
label: '已使用'
|
||||
},
|
||||
],
|
||||
rlist:[],
|
||||
labelPosition:'left',
|
||||
userGradeList:[],
|
||||
pdidlist:[],//判断优惠券id
|
||||
@ -417,12 +492,9 @@ export default {
|
||||
},
|
||||
status:null,
|
||||
// 表单参数
|
||||
form: {
|
||||
|
||||
|
||||
|
||||
},
|
||||
form: {},
|
||||
cardFavorableIds:[],
|
||||
activeName:'',
|
||||
gradeIds:[],
|
||||
days:15,
|
||||
// 表单校验
|
||||
@ -471,19 +543,24 @@ export default {
|
||||
activeConsumptionChildList: [
|
||||
{ required: true, message: '必填项不能为空', trigger: 'blur' },
|
||||
],
|
||||
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
|
||||
this.getoilName()
|
||||
this.listUserGrade()
|
||||
},
|
||||
methods: {
|
||||
change(e){
|
||||
let data = {
|
||||
gradeIds:e,
|
||||
days:this.days
|
||||
}
|
||||
getAdaptUserList(data).then(res=>{
|
||||
this.rlist = res.data
|
||||
})
|
||||
},
|
||||
indexMethod(index) {
|
||||
return index * 2;
|
||||
},
|
||||
@ -840,21 +917,24 @@ export default {
|
||||
this.form.activeConsumptionChildList = this.form.tableDatas.concat(this.tableDatas, this.form.shiwudata);
|
||||
console.log(this.form.activeConsumptionChildList)
|
||||
let data = {
|
||||
cardFavorableIds : this.cardFavorableIds,
|
||||
activeName : this.activeName,
|
||||
gradeIds:this.gradeIds,
|
||||
days:this.days
|
||||
condition:this.days,
|
||||
cardFavorableIds:this.cardFavorableIds,
|
||||
cardExchangeIds:this.pddhidlist
|
||||
|
||||
}
|
||||
issueCardFavorable(data).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList()
|
||||
})
|
||||
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
issueCardFavorable(data).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList()
|
||||
});
|
||||
}
|
||||
});
|
||||
// this.$refs["form"].validate(valid => {
|
||||
// if (valid) {
|
||||
// ;
|
||||
// }
|
||||
// });
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
|
@ -775,8 +775,17 @@ export default {
|
||||
}
|
||||
if (this.ids && this.ids.length>0){
|
||||
editStatus({ids:this.ids.toString(),status:val}).then(res => {
|
||||
this.$message.success(name+"成功")
|
||||
this.getList();
|
||||
if (val=='qy') {
|
||||
if (res.data > 0) {
|
||||
this.$message.success(name + "成功")
|
||||
this.getList();
|
||||
} else {
|
||||
this.$message.error("请确保上架的商品库存大于0且为商品设置零售价和会员价")
|
||||
}
|
||||
}else {
|
||||
this.$message.success(name + "成功")
|
||||
this.getList();
|
||||
}
|
||||
})
|
||||
}else {
|
||||
this.$message.error("请选择需要"+name+"的商品")
|
||||
|
@ -1171,6 +1171,10 @@ export default {
|
||||
},
|
||||
// 新增按钮操作
|
||||
handleAddMembers() {
|
||||
if (this.fixingLevelList.length==0){
|
||||
this.$message.error("请先设置企业会员等级")
|
||||
return;
|
||||
}
|
||||
this.openMembers = true;
|
||||
this.title = "批量用户认证";
|
||||
},
|
||||
|
@ -788,6 +788,7 @@ export default {
|
||||
this.openUser = false;
|
||||
this.getList();
|
||||
this.getUserList();
|
||||
|
||||
});
|
||||
}
|
||||
})
|
||||
|
@ -4,7 +4,7 @@
|
||||
<el-alert
|
||||
title="说明"
|
||||
type="error"
|
||||
description="为了保证加油站商户日常在线支付业务的稳定性,油客里里目前支持多通道支付
|
||||
description="为了保证加油站商户日常在线支付业务的稳定性,来个油惠目前支持多通道支付
|
||||
可以有效的避免单支付通道带来不稳定性,从而造成油站不能正常支付问题
|
||||
加油站一旦出现不能正常支付的情况,可以随时手工切换支付通道,来保证加油站支付收款业务"
|
||||
:closable="false"
|
||||
|
@ -685,7 +685,7 @@ export default {
|
||||
}
|
||||
if (!this.form.id) {
|
||||
queryStaff({mobile:this.form.mobile}).then( response => {
|
||||
if(response.data!=null){
|
||||
if(response.data){
|
||||
this.$modal.msgError("手机号已存在");
|
||||
}else {
|
||||
this.form.posPrem = JSON.stringify(this.form.posPrem);
|
||||
@ -696,6 +696,8 @@ export default {
|
||||
this.open = false;
|
||||
this.checked = false;
|
||||
this.getList();
|
||||
}else {
|
||||
this.$modal.msgError("新增失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
<el-alert
|
||||
title="说明"
|
||||
type="error"
|
||||
description="为了保证加油站商户日常在线支付业务的稳定性,油客里里目前支持多通道支付
|
||||
description="为了保证加油站商户日常在线支付业务的稳定性,来个油惠目前支持多通道支付
|
||||
可以有效的避免单支付通道带来不稳定性,从而造成油站不能正常支付问题
|
||||
加油站一旦出现不能正常支付的情况,可以随时手工切换支付通道,来保证加油站支付收款业务"
|
||||
:closable="false"
|
||||
|
@ -146,8 +146,7 @@ public class LJGoodsController extends BaseController {
|
||||
public ResponseObject updateStatus(@RequestBody Map<String,String> map){
|
||||
String ids = map.get("ids");
|
||||
String status = map.get("status");
|
||||
goodsService.batchGrounding(ids,status);
|
||||
return getSuccessResult("OK");
|
||||
return getSuccessResult(goodsService.batchGrounding(ids,status));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -86,7 +86,7 @@ public interface LJGoodsService extends IService<LJGoods> {
|
||||
* 批量上架、下架商品信息
|
||||
* @param ids
|
||||
*/
|
||||
void batchGrounding(String ids,String status);
|
||||
int batchGrounding(String ids,String status);
|
||||
|
||||
/**
|
||||
* 查询可兑换商品品类下的商品信息
|
||||
|
@ -212,8 +212,9 @@ public class LJGoodsServiceImpl extends ServiceImpl<LJGoodsMapper, LJGoods> impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void batchGrounding(String ids,String status) {
|
||||
public int batchGrounding(String ids,String status) {
|
||||
String[] split = ids.split(",");
|
||||
int row = 0;
|
||||
for (String s : split) {
|
||||
LJGoods ljGoods = this.selectLJGoodsById(Integer.parseInt(s));
|
||||
if (ObjectUtil.isNotEmpty(ljGoods)){
|
||||
@ -224,8 +225,10 @@ public class LJGoodsServiceImpl extends ServiceImpl<LJGoodsMapper, LJGoods> impl
|
||||
ljGoods.setStatus(status);
|
||||
}
|
||||
this.updateLJGoods(ljGoods);
|
||||
if (ljGoods.getStatus().equals("qy")) row += 1;
|
||||
}
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,7 +40,7 @@ public interface ActiveNewlywedsService extends IService<ActiveNewlyweds> {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<ActiveNewlywedsVO> getOneById(Serializable id);
|
||||
ActiveNewlywedsVO getOneById(Serializable id);
|
||||
ActiveNewlywedsVO getOneByStoreId(Serializable id);
|
||||
ActiveNewlywedsVO getOneByIdApplet(ActiveConsumption activeConsumption);
|
||||
|
||||
|
@ -115,13 +115,13 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
|
||||
/**
|
||||
* 分页查询所有数据
|
||||
* @param page
|
||||
* @param activeNewlyweds
|
||||
* @param activeNewlywedss
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage select(Page page, ActiveNewlyweds activeNewlyweds) {
|
||||
public IPage select(Page page, ActiveNewlyweds activeNewlywedss) {
|
||||
//构建查询条件
|
||||
LambdaQueryWrapper<ActiveNewlyweds> queryWrapper = new LambdaQueryWrapper<>();
|
||||
/*LambdaQueryWrapper<ActiveNewlyweds> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if(ObjectUtils.isNotEmpty(activeNewlyweds.getName())){
|
||||
queryWrapper.like(ActiveNewlyweds::getName,activeNewlyweds.getName());
|
||||
}
|
||||
@ -150,24 +150,16 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
|
||||
return activeNewlywedsVO;
|
||||
}).collect(Collectors.toList());
|
||||
page1.setRecords(activeNewlywedsVOList);
|
||||
return page1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过店铺查询单条数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ActiveNewlywedsVO> getOneById(Serializable id) {
|
||||
return page1;*/
|
||||
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
|
||||
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);
|
||||
List<ActiveNewlyweds> list = list(lambdaQueryWrapper);
|
||||
IPage page1 = page(page, lambdaQueryWrapper);
|
||||
List<ActiveNewlyweds> list = page1.getRecords();
|
||||
//List<ActiveNewlyweds> list = list(lambdaQueryWrapper);
|
||||
//获取兑换物品信息
|
||||
if (CollectionUtils.isNotEmpty(list)){
|
||||
for (ActiveNewlyweds activeNewlyweds : list) {
|
||||
@ -232,8 +224,86 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return activeNewlywedsVOS;
|
||||
page1.setRecords(list);
|
||||
return page1;
|
||||
//return activeNewlywedsVOS;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过店铺查询单条数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ActiveNewlywedsVO getOneById(Serializable id) {
|
||||
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
|
||||
//获取新人有礼活动信息
|
||||
LambdaQueryWrapper<ActiveNewlyweds> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(ActiveNewlyweds::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
|
||||
lambdaQueryWrapper.eq(ActiveNewlyweds::getId,id);
|
||||
ActiveNewlyweds activeNewlyweds = getOne(lambdaQueryWrapper);
|
||||
//List<ActiveNewlyweds> list = list(lambdaQueryWrapper);
|
||||
//获取兑换物品信息
|
||||
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(lists.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(lisst.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);
|
||||
}
|
||||
return activeNewlywedsVO;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,93 @@
|
||||
package com.fuint.business.marketingActivity.activeOneCoupon.controller;
|
||||
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.dtos.ActiveOneCouponDTO;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCoupon;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.service.ActiveOneCouponService;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 一键发券活动(ActiveOneCoupon)表控制层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-02 13:22:50
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("business/marketingActivity/oneActiveOneCoupon")
|
||||
public class ActiveOneCouponController extends BaseController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private ActiveOneCouponService activeOneCouponService;
|
||||
|
||||
/**
|
||||
* 分页查询所有数据
|
||||
*
|
||||
* @param activeOneCoupon 查询实体
|
||||
* @return 所有数据
|
||||
*/
|
||||
@GetMapping
|
||||
public ResponseObject selectAll(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
|
||||
@Param("activeOneCoupon") ActiveOneCoupon activeOneCoupon) {
|
||||
Page page = new Page(pageNo, pageSize);
|
||||
return getSuccessResult(this.activeOneCouponService.select(page, new QueryWrapper<>(activeOneCoupon)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
public ResponseObject selectOne(@PathVariable Serializable id) {
|
||||
return getSuccessResult(this.activeOneCouponService.getOneById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param activeOneCouponDTO 实体对象
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseObject insert(@RequestBody ActiveOneCouponDTO activeOneCouponDTO) {
|
||||
return getSuccessResult(this.activeOneCouponService.add(activeOneCouponDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param activeOneCouponDTO 实体对象
|
||||
* @return 修改结果
|
||||
*/
|
||||
@PutMapping
|
||||
public ResponseObject update(@RequestBody ActiveOneCouponDTO activeOneCouponDTO) {
|
||||
return getSuccessResult(this.activeOneCouponService.updateOneById(activeOneCouponDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
* @param idList 主键结合
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping
|
||||
public ResponseObject delete(@RequestParam("idList") List<Long> idList) {
|
||||
return getSuccessResult(this.activeOneCouponService.removeByIds(idList));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,17 @@
|
||||
package com.fuint.business.marketingActivity.activeOneCoupon.dtos;
|
||||
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCoupon;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ActiveOneCouponDTO extends ActiveOneCoupon implements Serializable {
|
||||
//优惠券ids
|
||||
private List<Integer> cardFavorableIds;
|
||||
//兑换券ids
|
||||
private List<Integer> cardExchangeIds;
|
||||
//会员等级ids
|
||||
private Integer[] gradeIds;
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.fuint.business.marketingActivity.activeOneCoupon.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 一键发券活动(ActiveOneCoupon)表实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-02 13:22:50
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class ActiveOneCoupon extends Model<ActiveOneCoupon> {
|
||||
//主键id
|
||||
private Integer id;
|
||||
private Integer storeId;
|
||||
private String activeName;
|
||||
//会员等级id
|
||||
private String gradeId;
|
||||
private Integer condition;
|
||||
//会员等级名字
|
||||
private String gradeName;
|
||||
//创建者
|
||||
private String createBy;
|
||||
//创建时间
|
||||
private Date createTime;
|
||||
//更新者
|
||||
private String updateBy;
|
||||
//更新时间
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 获取主键值
|
||||
*
|
||||
* @return 主键值
|
||||
*/
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.id;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,131 @@
|
||||
package com.fuint.business.marketingActivity.activeOneCoupon.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 一键发券子表(ActiveOneCouponChild)表实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-02 13:23:50
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class ActiveOneCouponChild extends Model<ActiveOneCouponChild> {
|
||||
//主键id
|
||||
private Integer id;
|
||||
private Integer storeId;
|
||||
//消费有礼活动id
|
||||
private Integer activeConsumptionId;
|
||||
//活动奖品 0:赠送积分1:赠送优惠券 2. 赠送兑换券 3:赠送成长值 4. 赠送实物
|
||||
private String activeGift;
|
||||
//券id
|
||||
private Integer vouchersId;
|
||||
//赠送卡券名称
|
||||
private String giftCardName;
|
||||
//券详情
|
||||
private String giftCardDetail;
|
||||
//创建者
|
||||
private String createBy;
|
||||
//创建时间
|
||||
private Date createTime;
|
||||
//更新者
|
||||
private String updateBy;
|
||||
//更新时间
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getActiveConsumptionId() {
|
||||
return activeConsumptionId;
|
||||
}
|
||||
|
||||
public void setActiveConsumptionId(Integer activeConsumptionId) {
|
||||
this.activeConsumptionId = activeConsumptionId;
|
||||
}
|
||||
|
||||
public String getActiveGift() {
|
||||
return activeGift;
|
||||
}
|
||||
|
||||
public void setActiveGift(String activeGift) {
|
||||
this.activeGift = activeGift;
|
||||
}
|
||||
|
||||
public Integer getVouchersId() {
|
||||
return vouchersId;
|
||||
}
|
||||
|
||||
public void setVouchersId(Integer vouchersId) {
|
||||
this.vouchersId = vouchersId;
|
||||
}
|
||||
|
||||
public String getGiftCardName() {
|
||||
return giftCardName;
|
||||
}
|
||||
|
||||
public void setGiftCardName(String giftCardName) {
|
||||
this.giftCardName = giftCardName;
|
||||
}
|
||||
|
||||
public String getGiftCardDetail() {
|
||||
return giftCardDetail;
|
||||
}
|
||||
|
||||
public void setGiftCardDetail(String giftCardDetail) {
|
||||
this.giftCardDetail = giftCardDetail;
|
||||
}
|
||||
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getUpdateBy() {
|
||||
return updateBy;
|
||||
}
|
||||
|
||||
public void setUpdateBy(String updateBy) {
|
||||
this.updateBy = updateBy;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取主键值
|
||||
*
|
||||
* @return 主键值
|
||||
*/
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.id;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
package com.fuint.business.marketingActivity.activeOneCoupon.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCouponChild;
|
||||
|
||||
/**
|
||||
* 一键发券子表(ActiveOneCouponChild)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-02 13:23:50
|
||||
*/
|
||||
public interface ActiveOneCouponChildMapper extends BaseMapper<ActiveOneCouponChild> {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
package com.fuint.business.marketingActivity.activeOneCoupon.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCoupon;
|
||||
|
||||
/**
|
||||
* 一键发券活动(ActiveOneCoupon)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-02 13:22:50
|
||||
*/
|
||||
public interface ActiveOneCouponMapper extends BaseMapper<ActiveOneCoupon> {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
package com.fuint.business.marketingActivity.activeOneCoupon.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCouponChild;
|
||||
|
||||
/**
|
||||
* 一键发券子表(ActiveOneCouponChild)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-02 13:23:50
|
||||
*/
|
||||
public interface ActiveOneCouponChildService extends IService<ActiveOneCouponChild> {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
package com.fuint.business.marketingActivity.activeOneCoupon.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.dtos.ActiveOneCouponDTO;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCoupon;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.vo.ActiveOneCouponVO;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 一键发券活动(ActiveOneCoupon)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-02 13:22:50
|
||||
*/
|
||||
public interface ActiveOneCouponService extends IService<ActiveOneCoupon> {
|
||||
|
||||
boolean add(ActiveOneCouponDTO activeOneCouponDTO);
|
||||
|
||||
IPage select(Page page, QueryWrapper<ActiveOneCoupon> activeOneCouponQueryWrapper);
|
||||
|
||||
ActiveOneCouponVO getOneById(Serializable id);
|
||||
|
||||
boolean updateOneById(ActiveOneCouponDTO activeOneCouponDTO);
|
||||
}
|
||||
|
@ -0,0 +1,19 @@
|
||||
package com.fuint.business.marketingActivity.activeOneCoupon.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.mapper.ActiveOneCouponChildMapper;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCouponChild;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.service.ActiveOneCouponChildService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 一键发券子表(ActiveOneCouponChild)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-02 13:23:51
|
||||
*/
|
||||
@Service("activeOneCouponChildService")
|
||||
public class ActiveOneCouponChildServiceImpl extends ServiceImpl<ActiveOneCouponChildMapper, ActiveOneCouponChild> implements ActiveOneCouponChildService {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,257 @@
|
||||
package com.fuint.business.marketingActivity.activeOneCoupon.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.dtos.ActiveOneCouponDTO;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCouponChild;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.mapper.ActiveOneCouponMapper;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCoupon;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.service.ActiveOneCouponChildService;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.service.ActiveOneCouponService;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.vo.ActiveOneCouponVO;
|
||||
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.marketingActivity.cardFavorable.entity.CardFavorable;
|
||||
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.vo.LJUserVos;
|
||||
import com.fuint.business.userManager.service.LJUserService;
|
||||
import com.fuint.business.userManager.vo.LJUserVo;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import com.fuint.repository.mapper.MtUserGradeMapper;
|
||||
import com.fuint.repository.model.MtUserGrade;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 一键发券活动(ActiveOneCoupon)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-02 13:22:50
|
||||
*/
|
||||
@Service("activeOneCouponService")
|
||||
public class ActiveOneCouponServiceImpl extends ServiceImpl<ActiveOneCouponMapper, ActiveOneCoupon> implements ActiveOneCouponService {
|
||||
|
||||
@Resource
|
||||
private MtUserGradeMapper mtUserGradeMapper;
|
||||
@Resource
|
||||
private CardFavorableService cardFavorableService;
|
||||
@Resource
|
||||
private ActiveOneCouponChildService activeOneCouponChildService;
|
||||
@Resource
|
||||
private CardExchangeService exchangeService;
|
||||
@Resource
|
||||
private LJUserService userService;
|
||||
@Resource
|
||||
private CardFavorableRecordService cardFavorableRecordService;
|
||||
@Resource
|
||||
private CardExchangeRecordService cardExchangeRecordService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public boolean add(ActiveOneCouponDTO activeOneCouponDTO) {
|
||||
ActiveOneCouponChild activeOneCouponChild = new ActiveOneCouponChild();
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
boolean flag = false;
|
||||
ActiveOneCoupon activeOneCoupon = new ActiveOneCoupon();
|
||||
//会员等级
|
||||
String gradeIdStr = "";
|
||||
String gradeIdName = "";
|
||||
Integer[] gradeIds = activeOneCouponDTO.getGradeIds();
|
||||
/* for (Integer gradeId : gradeIds) {
|
||||
gradeIdStr+=gradeId + ",";
|
||||
MtUserGrade mtUserGrade = mtUserGradeMapper.selectById(gradeId);
|
||||
gradeIdName += mtUserGrade.getName() + ",";
|
||||
}*/
|
||||
activeOneCoupon.setGradeId(gradeIdStr);
|
||||
activeOneCoupon.setGradeName(gradeIdName);
|
||||
activeOneCoupon.setStoreId(nowAccountInfo.getStoreId());
|
||||
activeOneCoupon.setCondition(activeOneCouponDTO.getCondition());
|
||||
flag = save(activeOneCoupon);
|
||||
//优惠券
|
||||
List<Integer> cardFavorableIds = activeOneCouponDTO.getCardFavorableIds();
|
||||
if (ObjectUtils.isNotEmpty(cardFavorableIds)){
|
||||
for (Integer cardFavorableId : cardFavorableIds) {
|
||||
activeOneCouponChild.setActiveGift("1");
|
||||
activeOneCouponChild.setActiveConsumptionId(activeOneCoupon.getId());
|
||||
activeOneCouponChild.setVouchersId(cardFavorableId);
|
||||
CardFavorable byId = cardFavorableService.getById(cardFavorableId);
|
||||
activeOneCouponChild.setGiftCardName(byId.getName());
|
||||
activeOneCouponChild.setStoreId(nowAccountInfo.getStoreId());
|
||||
flag = activeOneCouponChildService.save(activeOneCouponChild);
|
||||
}
|
||||
}
|
||||
//兑换券
|
||||
List<Integer> cardExchangeIds = activeOneCouponDTO.getCardExchangeIds();
|
||||
if (ObjectUtils.isNotEmpty(cardExchangeIds)){
|
||||
for (Integer cardExahangeId : cardExchangeIds) {
|
||||
activeOneCouponChild.setActiveGift("2");
|
||||
activeOneCouponChild.setActiveConsumptionId(activeOneCoupon.getId());
|
||||
activeOneCouponChild.setVouchersId(cardExahangeId);
|
||||
CardExchange byId = exchangeService.getById(cardExahangeId);
|
||||
activeOneCouponChild.setGiftCardName(byId.getName());
|
||||
activeOneCouponChild.setStoreId(nowAccountInfo.getStoreId());
|
||||
flag = activeOneCouponChildService.save(activeOneCouponChild);
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage select(Page page, QueryWrapper<ActiveOneCoupon> activeOneCouponQueryWrapper) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
LambdaQueryWrapper<ActiveOneCoupon> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(nowAccountInfo.getStoreId() != null, ActiveOneCoupon::getStoreId, nowAccountInfo.getStoreId());
|
||||
IPage page1 = page(page, queryWrapper);
|
||||
List<ActiveOneCoupon> records = page1.getRecords();
|
||||
ArrayList<ActiveOneCouponVO> activeOneCouponVOArrayList = new ArrayList<>();
|
||||
ArrayList<LJUserVos> userList = new ArrayList<>();
|
||||
for (ActiveOneCoupon record : records) {
|
||||
ActiveOneCouponVO activeOneCouponVO = new ActiveOneCouponVO();
|
||||
BeanUtils.copyProperties(record, activeOneCouponVO);
|
||||
String gradeIds = record.getGradeId();
|
||||
//会员存量
|
||||
String[] gradeId = gradeIds.split(",");
|
||||
for (String s : gradeId) {
|
||||
LJUserVos ljUserVos = new LJUserVos();
|
||||
MtUserGrade mtUserGrade = mtUserGradeMapper.selectById(s);
|
||||
ljUserVos.setGradeName(mtUserGrade.getName());
|
||||
LJUserVo ljUserVo = new LJUserVo();
|
||||
ljUserVo.setGradeId(Integer.parseInt(s));
|
||||
List<LJUserVo> userLists = userService.getUserCountList(ljUserVo);
|
||||
ljUserVos.setCountAll(userLists.size());
|
||||
|
||||
ljUserVo.setDays(record.getCondition());
|
||||
List<LJUserVo> userListss = userService.getUserLists(ljUserVo);
|
||||
ljUserVos.setCount(userListss.size());
|
||||
if (ObjectUtils.isNotEmpty(ljUserVos.getCountAll()) && ObjectUtils.isNotEmpty(ljUserVos.getCount()) && ljUserVos.getCountAll()!=0){
|
||||
ljUserVos.setRate(ljUserVos.getCount()/ljUserVos.getCountAll() + "%");
|
||||
}
|
||||
userList.add(ljUserVos);
|
||||
}
|
||||
|
||||
//优惠券
|
||||
LambdaQueryWrapper<CardFavorableRecord> queryWrapper1 = new LambdaQueryWrapper<>();
|
||||
queryWrapper1.eq(CardFavorableRecord::getExchangeFrom, "店铺一键送券!");
|
||||
queryWrapper1.eq(CardFavorableRecord::getActiveId, record.getId());
|
||||
queryWrapper1.eq(CardFavorableRecord::getStoreId, record.getStoreId());
|
||||
List<CardFavorableRecord> list = cardFavorableRecordService.list(queryWrapper1);
|
||||
activeOneCouponVO.setCouponReceiveCount(list.size());
|
||||
queryWrapper1.eq(CardFavorableRecord::getStatus, "1");
|
||||
List<CardFavorableRecord> list1 = cardFavorableRecordService.list(queryWrapper1);
|
||||
activeOneCouponVO.setCouponUseCount(list1.size());
|
||||
|
||||
//兑换券
|
||||
LambdaQueryWrapper<CardExchangeRecord> queryWrapper2 = new LambdaQueryWrapper<>();
|
||||
queryWrapper2.eq(CardExchangeRecord::getExchangeFrom, "店铺一键送券!");
|
||||
queryWrapper2.eq(CardExchangeRecord::getActiveId, record.getId());
|
||||
queryWrapper2.eq(CardExchangeRecord::getStoreId, record.getStoreId());
|
||||
List<CardExchangeRecord> list2 = cardExchangeRecordService.list(queryWrapper2);
|
||||
activeOneCouponVO.setExchangeReceiveCount(list2.size());
|
||||
queryWrapper2.eq(CardExchangeRecord::getStatus, "1");
|
||||
List<CardExchangeRecord> list3 = cardExchangeRecordService.list(queryWrapper2);
|
||||
activeOneCouponVO.setExchangeUseCount(list3.size());
|
||||
|
||||
//活动效果
|
||||
|
||||
activeOneCouponVOArrayList.add(activeOneCouponVO);
|
||||
}
|
||||
page1.setRecords(activeOneCouponVOArrayList);
|
||||
return page1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActiveOneCouponVO getOneById(Serializable id) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
|
||||
ActiveOneCouponVO activeOneCouponVO = new ActiveOneCouponVO();
|
||||
ActiveOneCoupon oneCoupon = getById(id);
|
||||
BeanUtils.copyProperties(oneCoupon, activeOneCouponVO);
|
||||
LambdaQueryWrapper<ActiveOneCouponChild> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ActiveOneCouponChild::getActiveConsumptionId, id);
|
||||
queryWrapper.eq(ActiveOneCouponChild::getStoreId, nowAccountInfo.getStoreId());
|
||||
List<ActiveOneCouponChild> activeOneCouponChildren = activeOneCouponChildService.list(queryWrapper);
|
||||
ArrayList<CardFavorable> cardFavorableArrayList = new ArrayList<>();
|
||||
ArrayList<CardExchange> cardExchangeArrayList = new ArrayList<>();
|
||||
for (ActiveOneCouponChild activeOneCouponChild : activeOneCouponChildren) {
|
||||
//优惠券
|
||||
if (activeOneCouponChild.getActiveGift().equals("1")){
|
||||
CardFavorable byId = cardFavorableService.getById(activeOneCouponChild.getVouchersId());
|
||||
cardFavorableArrayList.add(byId);
|
||||
}
|
||||
//兑换券
|
||||
if (activeOneCouponChild.getActiveGift().equals("2")){
|
||||
CardExchange byId = exchangeService.getById(activeOneCouponChild.getVouchersId());
|
||||
cardExchangeArrayList.add(byId);
|
||||
}
|
||||
}
|
||||
activeOneCouponVO.setCardFavorableList(cardFavorableArrayList);
|
||||
activeOneCouponVO.setCardExchangeList(cardExchangeArrayList);
|
||||
return activeOneCouponVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateOneById(ActiveOneCouponDTO activeOneCouponDTO) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
boolean flag = false;
|
||||
ActiveOneCoupon activeOneCoupon = new ActiveOneCoupon();
|
||||
BeanUtils.copyProperties(activeOneCouponDTO,activeOneCoupon);
|
||||
flag= updateById(activeOneCoupon);
|
||||
|
||||
//更新子表数据
|
||||
LambdaQueryWrapper<ActiveOneCouponChild> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ActiveOneCouponChild::getStoreId,nowAccountInfo.getStoreId());
|
||||
queryWrapper.eq(ActiveOneCouponChild::getActiveConsumptionId,activeOneCoupon.getId());
|
||||
List<ActiveOneCouponChild> list = activeOneCouponChildService.list(queryWrapper);
|
||||
if (CollectionUtils.isNotEmpty(list)){
|
||||
for (ActiveOneCouponChild activeOneCouponChild : list) {
|
||||
activeOneCouponChildService.removeById(activeOneCouponChild.getId());
|
||||
}
|
||||
}
|
||||
|
||||
//优惠券
|
||||
ActiveOneCouponChild activeOneCouponChild = new ActiveOneCouponChild();
|
||||
List<Integer> cardFavorableIds = activeOneCouponDTO.getCardFavorableIds();
|
||||
if (ObjectUtils.isNotEmpty(cardFavorableIds)){
|
||||
for (Integer cardFavorableId : cardFavorableIds) {
|
||||
activeOneCouponChild.setActiveGift("1");
|
||||
activeOneCouponChild.setActiveConsumptionId(activeOneCoupon.getId());
|
||||
activeOneCouponChild.setVouchersId(cardFavorableId);
|
||||
CardFavorable byId = cardFavorableService.getById(cardFavorableId);
|
||||
activeOneCouponChild.setGiftCardName(byId.getName());
|
||||
activeOneCouponChild.setStoreId(nowAccountInfo.getStoreId());
|
||||
flag = activeOneCouponChildService.save(activeOneCouponChild);
|
||||
}
|
||||
}
|
||||
//兑换券
|
||||
List<Integer> cardExchangeIds = activeOneCouponDTO.getCardExchangeIds();
|
||||
if (ObjectUtils.isNotEmpty(cardExchangeIds)){
|
||||
for (Integer cardExahangeId : cardExchangeIds) {
|
||||
activeOneCouponChild.setActiveGift("2");
|
||||
activeOneCouponChild.setActiveConsumptionId(activeOneCoupon.getId());
|
||||
activeOneCouponChild.setVouchersId(cardExahangeId);
|
||||
CardExchange byId = exchangeService.getById(cardExahangeId);
|
||||
activeOneCouponChild.setGiftCardName(byId.getName());
|
||||
activeOneCouponChild.setStoreId(nowAccountInfo.getStoreId());
|
||||
flag = activeOneCouponChildService.save(activeOneCouponChild);
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,37 @@
|
||||
package com.fuint.business.marketingActivity.activeOneCoupon.vo;
|
||||
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCoupon;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCouponChild;
|
||||
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchange;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.vo.LJUserVos;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ActiveOneCouponVO extends ActiveOneCoupon implements Serializable {
|
||||
private List<LJUserVos> vosList;
|
||||
//优惠券领取数量
|
||||
private Integer couponReceiveCount;
|
||||
//优惠券使用数量
|
||||
private Integer couponUseCount;
|
||||
//兑换券领取数量
|
||||
private Integer exchangeReceiveCount;
|
||||
//兑换券使用数量
|
||||
private Integer exchangeUseCount;
|
||||
//活动效果
|
||||
//充值
|
||||
private Double rechargeCount;
|
||||
//加油
|
||||
private Double oilCount;
|
||||
//洗车
|
||||
private Integer carWashCount;
|
||||
//商品
|
||||
private Integer productCount;
|
||||
|
||||
private List<ActiveOneCouponChild> activeOneCouponChildren;
|
||||
private List<CardFavorable> cardFavorableList;
|
||||
private List<CardExchange> cardExchangeList;
|
||||
}
|
@ -50,7 +50,7 @@ public class ActiveRecommendController extends BaseController {
|
||||
@Param("cardFuelDiesel") ActiveRecommend activeRecommend) {
|
||||
Page page = new Page(pageNo, pageSize);
|
||||
activeRecommend.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
|
||||
return getSuccessResult(this.activeRecommendService.page(page, new QueryWrapper<>(activeRecommend)));
|
||||
return getSuccessResult(this.activeRecommendService.select(page, activeRecommend));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3,6 +3,7 @@ package com.fuint.business.marketingActivity.activeRecommend.dto;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendChild;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
@ -15,13 +16,20 @@ import java.util.List;
|
||||
* @since 2023-11-13 15:09:50
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class ActiveRecommendDTO extends Model<ActiveRecommendDTO> {
|
||||
//主键id
|
||||
private Integer id;
|
||||
//所属连锁店id
|
||||
private Integer chainStoreId;
|
||||
//新人有礼活动id
|
||||
private Integer activeNewId;
|
||||
private String activeNewName;
|
||||
|
||||
//所属店铺id
|
||||
private Integer storeId;
|
||||
//活动名称
|
||||
private String activeName;
|
||||
//活动图片
|
||||
private String activePictureUrl;
|
||||
//邀请人获得 0:优惠券 1:兑换券 2:成长值 3:积分
|
||||
|
@ -32,6 +32,8 @@ public class ActiveRecommend extends Model<ActiveRecommend> {
|
||||
private String inviterGiftType;
|
||||
private String activeNewName;
|
||||
private Integer activeNewId;
|
||||
//活动名称
|
||||
private String activeName;
|
||||
//赠送积分
|
||||
private Integer points;
|
||||
//赠送成长值
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.fuint.business.marketingActivity.activeRecommend.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumption;
|
||||
import com.fuint.business.marketingActivity.activeRecommend.dto.ActiveRecommendDTO;
|
||||
@ -30,7 +32,7 @@ public interface ActiveRecommendService extends IService<ActiveRecommend> {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<ActiveRecommendVO> getOneById(Serializable id);
|
||||
ActiveRecommendVO getOneById(Serializable id);
|
||||
ActiveRecommendVO getOneByIdApplet(ActiveConsumption activeConsumption);
|
||||
|
||||
/**
|
||||
@ -45,5 +47,7 @@ public interface ActiveRecommendService extends IService<ActiveRecommend> {
|
||||
* @return
|
||||
*/
|
||||
ActiveRecommendAppletVO selectApplet(ActiveConsumption activeConsumption);
|
||||
|
||||
IPage select(Page page, ActiveRecommend activeRecommend);
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
package com.fuint.business.marketingActivity.activeRecommend.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumption;
|
||||
import com.fuint.business.marketingActivity.activeRecommend.dto.ActiveRecommendDTO;
|
||||
@ -102,18 +104,16 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ActiveRecommendVO> getOneById(Serializable id) {
|
||||
public ActiveRecommendVO getOneById(Serializable id) {
|
||||
|
||||
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
|
||||
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);
|
||||
List<ActiveRecommend> list = list(lambdaQueryWrapper);
|
||||
for (ActiveRecommend activeRecommend : list) {
|
||||
lambdaQueryWrapper.eq(ActiveRecommend::getId,id);
|
||||
ActiveRecommend activeRecommend = getOne(lambdaQueryWrapper);
|
||||
//List<ActiveRecommend> list = list(lambdaQueryWrapper);
|
||||
int youhuiTed = 0;
|
||||
int duihuanTed = 0;
|
||||
ActiveRecommendVO activeRecommendVO = new ActiveRecommendVO();
|
||||
@ -131,7 +131,7 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
|
||||
queryWrappers.eq(CardFavorableRecord::getActiveId,activeRecommendChild.getActiveRecommendId());
|
||||
queryWrappers.eq(CardFavorableRecord::getCardFavorableId,activeRecommendChild.getVouchersId());
|
||||
List<CardFavorableRecord> lists = cardFavorableRecordService.list(queryWrappers);
|
||||
activeRecommendVO.setYouhuiTotal(list.size());
|
||||
activeRecommendVO.setYouhuiTotal(lists.size());
|
||||
for (CardFavorableRecord cardFavorableRecord : lists) {
|
||||
if (cardFavorableRecord.getStatus().equals("1")){
|
||||
youhuiTed+=1;
|
||||
@ -144,7 +144,7 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
|
||||
queryWrapperss.eq(CardExchangeRecord::getActiveId,activeRecommendChild.getActiveRecommendId());
|
||||
queryWrapperss.eq(CardExchangeRecord::getCardExchangeId,activeRecommendChild.getVouchersId());
|
||||
List<CardExchangeRecord> lisst = cardExchangeRecordService.list(queryWrapperss);
|
||||
activeRecommendVO.setDuihuanTotal(list.size());
|
||||
activeRecommendVO.setDuihuanTotal(lisst.size());
|
||||
for (CardExchangeRecord cardExchangeRecord : lisst) {
|
||||
if (cardExchangeRecord.getStatus().equals("1")){
|
||||
duihuanTed+=1;
|
||||
@ -158,11 +158,9 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
|
||||
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<>();
|
||||
@ -171,11 +169,8 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
|
||||
activeRecommendVO.setDuihuanTotaled(duihuanTed);
|
||||
activeRecommendVO.setDuihuanTotal(0);
|
||||
activeRecommendVO.setDuihuanTotal(0);
|
||||
activeRecommendVOS.add(activeRecommendVO);
|
||||
}
|
||||
}
|
||||
}
|
||||
return activeRecommendVOS;
|
||||
return activeRecommendVO;
|
||||
}
|
||||
|
||||
|
||||
@ -308,6 +303,83 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
|
||||
return activeRecommendAppletVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage select(Page page, ActiveRecommend activeRecommends) {
|
||||
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
|
||||
ArrayList<ActiveRecommendVO> activeRecommendVOS = new ArrayList<>();
|
||||
|
||||
//获取新人有礼活动信息
|
||||
LambdaQueryWrapper<ActiveRecommend> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(ActiveRecommend::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
|
||||
//ActiveRecommend activeRecommend = getOne(lambdaQueryWrapper);
|
||||
//List<ActiveRecommend> list = list(lambdaQueryWrapper);
|
||||
IPage page1 = page(page, lambdaQueryWrapper);
|
||||
List<ActiveRecommend> list = page1.getRecords();
|
||||
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);
|
||||
}
|
||||
}
|
||||
page1.setRecords(list);
|
||||
return page1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数组转字符串
|
||||
* @param array
|
||||
|
@ -22,6 +22,8 @@ public class ActiveRecommendVO extends Model<ActiveRecommendVO> {
|
||||
private Integer id;
|
||||
//所属连锁店id
|
||||
private Integer chainStoreId;
|
||||
private String activeNewName;
|
||||
private String activeName;
|
||||
//所属店铺id
|
||||
private Integer storeId;
|
||||
//活动图片
|
||||
|
@ -112,8 +112,8 @@ public class CardFavorableRecordController extends BaseController {
|
||||
* 查询一键发券会员数接口
|
||||
*
|
||||
*/
|
||||
@GetMapping("getAdaptUserList")
|
||||
public ResponseObject getAdaptUserList(@Param("cardFavorableAdnUserDTO") CardFavorableAdnUserDTO cardFavorableAdnUserDTO) {
|
||||
@PostMapping("getAdaptUserList")
|
||||
public ResponseObject getAdaptUserList(@RequestBody CardFavorableAdnUserDTO cardFavorableAdnUserDTO) {
|
||||
return getSuccessResult(this.cardFavorableRecordService.getAdaptUserList(cardFavorableAdnUserDTO));
|
||||
}
|
||||
|
||||
|
@ -11,10 +11,14 @@ public class CardFavorableAdnUserDTO extends CardFavorable {
|
||||
private List<Integer> userIds;
|
||||
//优惠券ids
|
||||
private List<Integer> cardFavorableIds;
|
||||
//兑换券ids
|
||||
private List<Integer> cardExchangeIds;
|
||||
//等级ID
|
||||
private List<Integer> gradeIds;
|
||||
//天数
|
||||
private Integer days;
|
||||
//活动id
|
||||
private Integer activeId;
|
||||
|
||||
//优惠卷名称
|
||||
private String favorableName;
|
||||
|
@ -6,14 +6,18 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.marketingActivity.activeDiscountRecords.entity.ActiveDiscountRecords;
|
||||
import com.fuint.business.marketingActivity.activeDiscountRecords.mapper.ActiveDiscountRecordsMapper;
|
||||
import com.fuint.business.marketingActivity.activeDiscountRecords.service.ActiveDiscountRecordsService;
|
||||
import com.fuint.business.marketingActivity.activeExchange.dto.PaymentActiveDTO;
|
||||
import com.fuint.business.marketingActivity.activeExchange.service.ActiveExchangeService;
|
||||
import com.fuint.business.marketingActivity.activeExchange.vo.PaymentActiveVO;
|
||||
import com.fuint.business.marketingActivity.activeFullminusRecords.entity.ActiveFullminusRecords;
|
||||
import com.fuint.business.marketingActivity.activeFullminusRecords.mapper.ActiveFullminusRecordsMapper;
|
||||
import com.fuint.business.marketingActivity.activeFullminusRecords.service.ActiveFullminusRecordsService;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCoupon;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCouponChild;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.service.ActiveOneCouponChildService;
|
||||
import com.fuint.business.marketingActivity.activeOneCoupon.service.ActiveOneCouponService;
|
||||
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
|
||||
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.dto.CardFavorableAdnUserDTO;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.dto.IdListDTO;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable;
|
||||
@ -55,20 +59,33 @@ import java.util.Map;
|
||||
public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRecordMapper, CardFavorableRecord> implements CardFavorableRecordService {
|
||||
|
||||
@Resource
|
||||
@Lazy
|
||||
private CardFavorableRecordMapper cardFavorableRecordMapper;
|
||||
@Resource
|
||||
private LJUserService userService;
|
||||
@Resource
|
||||
@Lazy
|
||||
private CardFavorableService cardFavorableService;
|
||||
@Resource
|
||||
private OilNameService oilNameService;
|
||||
@Resource
|
||||
@Lazy
|
||||
private ActiveFullminusRecordsService activeFullminusRecordsService;
|
||||
@Resource
|
||||
@Lazy
|
||||
private ActiveDiscountRecordsService activeDiscountRecordsService;
|
||||
@Resource
|
||||
@Lazy
|
||||
private ActiveExchangeService activeExchangeService;
|
||||
@Resource
|
||||
@Lazy
|
||||
private CardExchangeRecordService cardExchangeRecordService;
|
||||
@Resource
|
||||
@Lazy
|
||||
private ActiveOneCouponService activeOneCouponService;
|
||||
@Resource
|
||||
@Lazy
|
||||
private ActiveOneCouponChildService activeOneCouponChildService;
|
||||
/**
|
||||
* 分页查询所有数据
|
||||
* @param page
|
||||
@ -320,37 +337,87 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
|
||||
*/
|
||||
@Override
|
||||
public boolean issueCardFavorable(CardFavorableAdnUserDTO cardFavorableAdnUserDTO) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer activeId = cardFavorableAdnUserDTO.getActiveId();
|
||||
LambdaQueryWrapper<ActiveOneCoupon> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ActiveOneCoupon::getId,activeId);
|
||||
queryWrapper.eq(ActiveOneCoupon::getStoreId,nowAccountInfo.getStoreId());
|
||||
ActiveOneCoupon activeOneCoupon = activeOneCouponService.getOne(queryWrapper);
|
||||
|
||||
String[] split = activeOneCoupon.getGradeId().split(",");
|
||||
//查询用户列表
|
||||
ArrayList<LJUserVo> ljUserVosList = new ArrayList<>();
|
||||
List<Integer> gradeIds = cardFavorableAdnUserDTO.getGradeIds();
|
||||
for (Integer gradeId : gradeIds) {
|
||||
// List<Integer> gradeIds = cardFavorableAdnUserDTO.getGradeIds();
|
||||
for (String gradeId : split) {
|
||||
LJUserVo ljUserVo = new LJUserVo();
|
||||
ljUserVo.setGradeId(gradeId);
|
||||
ljUserVo.setDays(cardFavorableAdnUserDTO.getDays());
|
||||
ljUserVo.setGradeId(Integer.parseInt(gradeId));
|
||||
ljUserVo.setDays(activeOneCoupon.getCondition());
|
||||
List<LJUserVo> userLists = userService.getUserLists(ljUserVo);
|
||||
ljUserVosList.addAll(userLists);
|
||||
}
|
||||
|
||||
boolean flag = false;
|
||||
//油站信息
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
//会员ids
|
||||
//List<Integer> userIds = cardFavorableAdnUserDTO.getUserIds();
|
||||
//优惠券ids
|
||||
List<Integer> cardIds = cardFavorableAdnUserDTO.getCardFavorableIds();
|
||||
for (Integer cardId : cardIds) {
|
||||
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
|
||||
if (CollectionUtils.isNotEmpty(ljUserVosList)){
|
||||
for (LJUserVo ljUserVo : ljUserVosList) {
|
||||
LJUser userInfo = userService.queryUserByUserId(ljUserVo.getId());
|
||||
cardFavorableRecord.setCardFavorableId(cardId);
|
||||
cardFavorableRecord.setStoreId(nowAccountInfo.getStoreId());
|
||||
cardFavorableRecord.setChainStorId(nowAccountInfo.getChainStoreId());
|
||||
cardFavorableRecord.setName(userInfo.getName());
|
||||
cardFavorableRecord.setMobile(userInfo.getMobile());
|
||||
cardFavorableRecord.setStatus("0");
|
||||
cardFavorableRecord.setExchangeFrom("店铺一键送券!");
|
||||
flag = addCardFavorableRecord(cardFavorableRecord);
|
||||
LambdaQueryWrapper<ActiveOneCouponChild> queryWrapper1 = new LambdaQueryWrapper<>();
|
||||
queryWrapper1.eq(ActiveOneCouponChild::getActiveConsumptionId,activeId);
|
||||
queryWrapper1.eq(ActiveOneCouponChild::getStoreId,nowAccountInfo.getStoreId());
|
||||
List<ActiveOneCouponChild> list = activeOneCouponChildService.list(queryWrapper1);
|
||||
ArrayList<Integer> integers = new ArrayList<>();
|
||||
for (ActiveOneCouponChild activeOneCouponChild : list) {
|
||||
if(activeOneCouponChild.getActiveGift().equals("1")){
|
||||
integers.add(activeOneCouponChild.getVouchersId());
|
||||
}
|
||||
}
|
||||
//List<Integer> cardIds = cardFavorableAdnUserDTO.getCardFavorableIds();
|
||||
if (ObjectUtils.isNotEmpty(integers)){
|
||||
for (Integer cardId : integers) {
|
||||
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
|
||||
if (CollectionUtils.isNotEmpty(ljUserVosList)){
|
||||
for (LJUserVo ljUserVo : ljUserVosList) {
|
||||
LJUser userInfo = userService.queryUserByUserId(ljUserVo.getId());
|
||||
cardFavorableRecord.setCardFavorableId(cardId);
|
||||
cardFavorableRecord.setStoreId(nowAccountInfo.getStoreId());
|
||||
cardFavorableRecord.setChainStorId(nowAccountInfo.getChainStoreId());
|
||||
cardFavorableRecord.setName(userInfo.getName());
|
||||
cardFavorableRecord.setMobile(userInfo.getMobile());
|
||||
cardFavorableRecord.setStatus("0");
|
||||
cardFavorableRecord.setExchangeFrom("店铺一键送券!");
|
||||
flag = addCardFavorableRecord(cardFavorableRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//兑换券ids
|
||||
LambdaQueryWrapper<ActiveOneCouponChild> queryWrapper2 = new LambdaQueryWrapper<>();
|
||||
queryWrapper2.eq(ActiveOneCouponChild::getActiveConsumptionId,activeId);
|
||||
queryWrapper2.eq(ActiveOneCouponChild::getStoreId,nowAccountInfo.getStoreId());
|
||||
List<ActiveOneCouponChild> lists = activeOneCouponChildService.list(queryWrapper1);
|
||||
ArrayList<Integer> integerss = new ArrayList<>();
|
||||
for (ActiveOneCouponChild activeOneCouponChild : lists) {
|
||||
if(activeOneCouponChild.getActiveGift().equals("2")){
|
||||
integerss.add(activeOneCouponChild.getVouchersId());
|
||||
}
|
||||
}
|
||||
//List<Integer> exchangeCardIds = cardFavorableAdnUserDTO.getCardExchangeIds();
|
||||
if (ObjectUtils.isNotEmpty(integerss)){
|
||||
for (Integer exchangeCardId : integerss) {
|
||||
if (CollectionUtils.isNotEmpty(ljUserVosList)) {
|
||||
for (LJUserVo ljUserVo : ljUserVosList) {
|
||||
CardExchangeRecord cardExchangeRecord = new CardExchangeRecord();
|
||||
cardExchangeRecord.setCardExchangeId(exchangeCardId);
|
||||
cardExchangeRecord.setStoreId(nowAccountInfo.getStoreId());
|
||||
cardExchangeRecord.setMtUserId(ljUserVo.getId());
|
||||
cardExchangeRecord.setName(ljUserVo.getName());
|
||||
cardExchangeRecord.setMobile(ljUserVo.getMobile());
|
||||
cardExchangeRecord.setPhoto(ljUserVo.getAvatar());
|
||||
cardExchangeRecord.setStatus("0");
|
||||
cardExchangeRecord.setExchangeFrom("店铺一键送券!");
|
||||
flag = cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -155,10 +155,10 @@ public class CardGiftServiceImpl extends ServiceImpl<CardGiftMapper, CardGift> i
|
||||
if(ObjectUtils.isNotEmpty(cardGift.getStatus())) {
|
||||
queryWrapper.eq(CardGift::getStatus,cardGift.getStatus());
|
||||
}
|
||||
if(ObjectUtils.isNotEmpty(cardGift.getStatus())) {
|
||||
if(ObjectUtils.isNotEmpty(cardGift.getSailStatus())) {
|
||||
queryWrapper.eq(CardGift::getSailStatus,cardGift.getSailStatus());
|
||||
}
|
||||
if(ObjectUtils.isNotEmpty(cardGift.getStatus())) {
|
||||
if(ObjectUtils.isNotEmpty(cardGift.getCardAmount())) {
|
||||
queryWrapper.eq(CardGift::getCardAmount,cardGift.getCardAmount());
|
||||
}
|
||||
queryWrapper.eq(CardGift::getStoreId, TokenUtil.getNowAccountInfo().getStoreId());
|
||||
|
@ -262,13 +262,14 @@ public class CardValueServiceImpl extends ServiceImpl<CardValueMapper, CardValue
|
||||
@Override
|
||||
public boolean updateOneById(CardValueDTO cardValueDTO) {
|
||||
boolean update = false;
|
||||
//更新新人有礼活动
|
||||
//更新活动
|
||||
CardValue cardValue = new CardValue();
|
||||
BeanUtils.copyProperties(cardValueDTO,cardValue);
|
||||
if (cardValueDTO.getIsonline().equals("1")){
|
||||
cardValue.setActiveStatus("2");
|
||||
cardValue.setUpdateBy(TokenUtil.getNowAccountInfo().getRealName());
|
||||
}
|
||||
cardValue.setMembershipLevel(arrayToString(cardValueDTO.getMembershipLevel()));
|
||||
update =updateById(cardValue);
|
||||
//更新子表数据
|
||||
LambdaQueryWrapper<CardValueChild> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
@ -176,6 +176,8 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
*/
|
||||
@Override
|
||||
public int insertStaff(LJStaff staff) {
|
||||
LJStaff staff2 = this.selectStaffByMobile(staff.getMobile());
|
||||
if (ObjectUtil.isNotEmpty(staff2)) return 0;
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer storeId = nowAccountInfo.getStoreId();
|
||||
if (ObjectUtil.isNotEmpty(staff.getStoreId())) {
|
||||
|
@ -10,6 +10,7 @@ import com.fuint.business.storeInformation.entity.LJStore;
|
||||
import com.fuint.business.storeInformation.service.ILJStoreService;
|
||||
import com.fuint.business.storeInformation.service.impl.LJStoreServiceImpl;
|
||||
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -29,6 +30,7 @@ import java.io.*;
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class QrCodeUtils {
|
||||
@Autowired
|
||||
private ILJStoreService storeService;
|
||||
@ -67,7 +69,8 @@ public class QrCodeUtils {
|
||||
//将小图片绘到大图片上,500,300 .表示你的小图片在大图片上的位置。
|
||||
g.drawImage(image, (bufImg.getWidth()-360)/2, 320, null);
|
||||
// 设置字体,样式,字体大小
|
||||
g.setFont(new Font("TimesRoman", Font.BOLD, 40));
|
||||
// g.setFont(new Font("TimesRoman", Font.BOLD, 40));
|
||||
g.setFont(chineseFont());
|
||||
//设置颜色。
|
||||
g.setColor(Color.BLACK);
|
||||
|
||||
@ -108,11 +111,40 @@ public class QrCodeUtils {
|
||||
ImageIO.write(bufImg, "jpg", outImgStream);
|
||||
outImgStream.flush();
|
||||
outImgStream.close();
|
||||
} catch (IOException e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public Font chineseFont() throws Exception {
|
||||
// 设置中文
|
||||
Font b = null;
|
||||
//获取系统字体的路径
|
||||
String prefixFont = "";
|
||||
String os = System.getProperties().getProperty("os.name");//获取系统类型
|
||||
if (os.startsWith("win") || os.startsWith("Win")) {//win下获取字体的路径
|
||||
prefixFont = "C:\\Windows\\Fonts" + File.separator + "STSONG.TTF";
|
||||
|
||||
// Font font = Font.createFont(Font.TRUETYPE_FONT, new ClassPathResource("classpath:font/msyh.ttc").getFile());
|
||||
// b = font.deriveFont(Font.BOLD, 40);
|
||||
b = new Font("TimesRoman", Font.BOLD, 40);
|
||||
} else {
|
||||
prefixFont = "/usr/share/fonts" + File.separator + "msyh.ttc";
|
||||
try {
|
||||
Font font = Font.createFont(Font.TRUETYPE_FONT, new File(prefixFont));
|
||||
b = font.deriveFont(Font.BOLD, 40);
|
||||
// b = new Font("msyh", Font.BOLD, 40);
|
||||
|
||||
} catch (Exception e) {
|
||||
//如果发生异常执行默认的字体
|
||||
b = new Font("msyh", Font.BOLD, 40);
|
||||
log.error(e.getMessage(),"找不到字体");
|
||||
|
||||
}
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
public int returnX(Graphics2D g,Integer bufImgWidth,String name){
|
||||
FontMetrics fm = g.getFontMetrics();
|
||||
Rectangle2D stringBounds = fm.getStringBounds(name, g);
|
||||
|
@ -5,12 +5,15 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.business.userManager.entity.LJUser;
|
||||
import com.fuint.business.userManager.vo.LJUserVo;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 会员信息 业务层
|
||||
*/
|
||||
@Transactional
|
||||
public interface LJUserService extends IService<LJUser> {
|
||||
/**
|
||||
* 根据条件分页查询会员信息
|
||||
|
BIN
fuintBackend/fuint-application/src/main/resources/font/msyh.ttc
Normal file
BIN
fuintBackend/fuint-application/src/main/resources/font/msyh.ttc
Normal file
Binary file not shown.
Binary file not shown.
BIN
fuintBackend/fuint-application/src/main/resources/font/msyhl.ttc
Normal file
BIN
fuintBackend/fuint-application/src/main/resources/font/msyhl.ttc
Normal file
Binary file not shown.
@ -43,6 +43,15 @@ export function getUserMobile(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 根据手机号查询会员详细
|
||||
export function getUserPhone(data) {
|
||||
return request({
|
||||
url: '/business/userManager/user/phone' ,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 新增会员
|
||||
export function addUser(data) {
|
||||
return request({
|
||||
|
@ -28,17 +28,30 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="时间">
|
||||
<!-- <el-date-picker-->
|
||||
<!-- v-model="dateRange"-->
|
||||
<!-- style="width: 240px"-->
|
||||
<!-- size="medium"-->
|
||||
<!-- value-format="yyyy-MM-dd"-->
|
||||
<!-- type="daterange"-->
|
||||
<!-- range-separator="-"-->
|
||||
<!-- clearable-->
|
||||
<!-- start-placeholder="开始日期"-->
|
||||
<!-- end-placeholder="结束日期"-->
|
||||
<!-- ></el-date-picker>-->
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
style="width: 240px"
|
||||
size="medium"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
clearable
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
v-model="beginTime"
|
||||
style="width: 160px"
|
||||
type="date"
|
||||
placeholder="开始日期">
|
||||
</el-date-picker>
|
||||
至
|
||||
<el-date-picker
|
||||
v-model="endTime"
|
||||
style="width: 160px"
|
||||
type="date"
|
||||
placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
@ -61,13 +74,13 @@
|
||||
<el-col :span="2.5">
|
||||
<div class="box">
|
||||
<span class="font-chinese">商品数量</span>
|
||||
<span class="font-number">{{statisticsForm.exchangeQuantity}}</span>
|
||||
<span class="font-number">{{statisticsForm.exchangeQuantity || 0}}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="2.5">
|
||||
<div class="box">
|
||||
<span class="font-chinese">积分</span>
|
||||
<span class="font-number">{{statisticsForm.integral}}</span>
|
||||
<span class="font-number">{{statisticsForm.integral || 0}}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
@ -78,7 +91,7 @@
|
||||
<i class="el-icon-info"></i>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
<span class="font-number">{{statisticsForm.amount}}</span>
|
||||
<span class="font-number">{{statisticsForm.amount || 0}}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -168,6 +181,8 @@ export default {
|
||||
},
|
||||
loading: false,
|
||||
dateRange: [],
|
||||
beginTime:"",
|
||||
endTime:"",
|
||||
defaultSort: {prop: 'createTime', order: 'descending'},
|
||||
|
||||
total: 0,
|
||||
@ -187,6 +202,11 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getList(){
|
||||
this.dateRange = []
|
||||
if (this.beginTime && this.endTime) {
|
||||
this.dateRange.push(this.beginTime.toLocaleDateString())
|
||||
this.dateRange.push(this.endTime.toLocaleDateString())
|
||||
}
|
||||
getOrderApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{
|
||||
this.dataList = res.data.records
|
||||
this.total = res.data.total
|
||||
@ -194,6 +214,11 @@ export default {
|
||||
})
|
||||
},
|
||||
getStatistics() {
|
||||
this.dateRange = []
|
||||
if (this.beginTime && this.endTime) {
|
||||
this.dateRange.push(this.beginTime.toLocaleDateString())
|
||||
this.dateRange.push(this.endTime.toLocaleDateString())
|
||||
}
|
||||
getStatisticsApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{
|
||||
this.statisticsForm = res.data
|
||||
})
|
||||
@ -223,6 +248,8 @@ export default {
|
||||
pageSize:10
|
||||
},
|
||||
this.dateRange = []
|
||||
this.beginTime = ""
|
||||
this.endTime = ""
|
||||
this.getList()
|
||||
this.getStatistics();
|
||||
|
||||
|
@ -452,7 +452,7 @@
|
||||
addUser,
|
||||
delUser,
|
||||
getUser,
|
||||
getUserMobile,
|
||||
getUserMobile, getUserPhone,
|
||||
listStatistic,
|
||||
listUserStatistic,
|
||||
updateUser
|
||||
@ -763,18 +763,16 @@
|
||||
}
|
||||
});
|
||||
} else {
|
||||
getUserMobile({mobile:this.form.mobile}).then( response => {
|
||||
getUserPhone({mobile:this.form.mobile}).then( response => {
|
||||
if(response.data!=null){
|
||||
this.$modal.msgError("手机号已存在");
|
||||
}else {
|
||||
addUser(this.form).then(res => {
|
||||
if (res.data==1) {
|
||||
this.$modal.msgSuccess("新增会员成功");
|
||||
this.open = false;
|
||||
this.openUser = false;
|
||||
this.getList();
|
||||
this.getUserList();
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user