This commit is contained in:
cun-nan 2024-09-12 15:44:25 +08:00
parent 490ac37b45
commit f13606857d
40 changed files with 710 additions and 187 deletions

View File

@ -1,8 +1,8 @@
import request from '@/utils/request'
export function getActiveBirthday() {
export function getActiveBirthday(id) {
return request({
url: 'activeBirthday/getInfo',
url: 'activeBirthday/getInfoById/'+id,
method: 'get',
})
}

View File

@ -107,9 +107,9 @@ export function looklooklook(id) {
})
}
export function getInfoActivity() {
export function getInfoActivity(id) {
return request({
url: 'business/marketingActivity/activeConsumption/getInfo',
url: 'business/marketingActivity/activeConsumption/selectById/'+id,
method: 'get',
})

View File

@ -69,15 +69,15 @@ export function delActiveNewlyweds(id) {
})
}
// 删除新人有礼活动
export function getInfoActiveNewlyweds() {
// 根据id查询开卡有礼信息
export function getInfoActiveNewlyweds(id) {
return request({
url: '/business/marketingActivity/activeNewlyweds/getInfo',
url: '/business/marketingActivity/activeNewlyweds/getInfoById/'+id,
method: 'get'
})
}
// 删除新人有礼活动
// 添加开卡有礼信息
export function insertActiveNewlyweds(data) {
return request({
url: '/business/marketingActivity/activeNewlyweds/add',
@ -85,7 +85,7 @@ export function insertActiveNewlyweds(data) {
data:data
})
}
// 删除新人有礼活动
// 修改开卡有礼信息
export function editActiveNewlyweds1(data) {
return request({
url: '/business/marketingActivity/activeNewlyweds/update',

View File

@ -1,8 +1,8 @@
import request from '@/utils/request'
export function getActivePopUp() {
export function getActivePopUp(id) {
return request({
url: 'activePopUp/getInfo',
url: 'activePopUp/'+id,
method: 'get',
})
}

View File

@ -75,9 +75,9 @@ export function delActiveRecommend(id) {
}
//
export function getActiveRecommendInfo() {
export function getActiveRecommendInfo(id) {
return request({
url: '/business/marketingActivity/activeRecommend/getInfo' ,
url: '/business/marketingActivity/activeRecommend/getInfoById/'+id ,
method: 'get'
})
}

View File

@ -1,8 +1,8 @@
import request from '@/utils/request'
export function getActiveSubPrice() {
export function getActiveSubPrice(id) {
return request({
url: 'business/activeSubPrice/getInfo',
url: 'business/activeSubPrice/'+id,
method: 'get',
})
}

View File

@ -1,8 +1,8 @@
import request from '@/utils/request'
export function getActiveUserConsume() {
export function getActiveUserConsume(id) {
return request({
url: 'activeUserConsume/getInfo',
url: 'activeUserConsume/'+id,
method: 'get',
})
}

View File

@ -1,8 +1,8 @@
import request from '@/utils/request'
export function getActiveUserRecharge() {
export function getActiveUserRecharge(id) {
return request({
url: 'activeUserRecharge/getInfo',
url: 'activeUserRecharge/'+id,
method: 'get',
})
}

View File

@ -8,3 +8,19 @@ export function pageActive(data) {
params: data
})
}
// 删除活动信息
export function deleteActive(id) {
return request({
url: 'business/marketingActivity/activeApplet/delete/'+id,
method: 'delete',
})
}
// 修改活动状态
export function editActiveStatus(id) {
return request({
url: 'business/marketingActivity/activeApplet/editStatus/'+id,
method: 'get',
})
}

View File

@ -127,9 +127,9 @@
<el-input type="textarea" v-model="ruleForm.activityDetails" placeholder="请输入活动详情"></el-input>
</el-form-item>
<el-form-item label="活动奖品" prop="activeGift">
<el-checkbox-group v-model="ruleForm.activeGift" @change="changes" >
<el-checkbox-group v-model="ruleForm.activeGift" @change="changes">
<div style="display: flex;font-size: 14px;margin: 15px 0">
<el-checkbox label="选项一" key="0" name="type"><!--积分--></el-checkbox>
<el-checkbox label="选项一" key="0" name="type"><!--积分--></el-checkbox>
<div style="margin-left: 10px"></div>
<el-select v-model="pointOrderType" style="margin: 0 10px" placeholder="请选择">
<el-option label="订单金额" value="0"></el-option>
@ -156,7 +156,7 @@
</div>
<div style="display: flex;font-size: 14px;margin: 15px 0">
<el-checkbox label="选项二" key="3" name="type"><!--成长值--></el-checkbox>
<el-checkbox label="选项二" key="3" name="type"><!--成长值--></el-checkbox>
<div style="margin-left: 10px"></div>
<el-select v-model="growthValueOrderType" style="margin: 0 10px" placeholder="请选择">
<el-option label="订单金额" value="0"></el-option>
@ -255,10 +255,11 @@ import {listUserLabel} from "@/api/staff/user/userlabel";
export default {
name: "ActiveConsumption",
dicts: ['payment_type'],
props: ['activeId'],
data() {
return {
checkedCities:[],
cityOptions:['上海', '北京', '广州', '深圳'],
checkedCities: [],
cityOptions: ['上海', '北京', '广州', '深圳'],
opendetails: false,
looklist: [],
statisticsyou: {},
@ -268,7 +269,7 @@ export default {
],
labelPosition: 'left',
userGradeList: [],
userLabelList:[],
userLabelList: [],
//
oilNameList: [],
pdidlist: [],//id
@ -370,10 +371,10 @@ export default {
ruleForm: {
paymentType:[],
activeGift:[],
activityTimeType:0,
suitTimeSlotType:0,
paymentType: [],
activeGift: [],
activityTimeType: 0,
suitTimeSlotType: 0,
},
ifWrite: true,
tindex1: 0,
@ -429,63 +430,60 @@ export default {
};
},
created() {
// this.getList();
// this.getoiltypeliet()
// this.getoilName()
this.listUserGrade()
if (this.activeId) {
this.getInfo()
}
// this.getInfo()
this.listUserGrade()
this.getCardCoupon()
this.getUserLabelList()
},
methods: {
handleCheckedCitiesChange(e){
console.log(e,this.checkedCities)
handleCheckedCitiesChange(e) {
console.log(e, this.checkedCities)
},
changes(e){
console.log('1098',e)
changes(e) {
console.log('1098', e)
},
getUserLabelList(){
listUserLabel({page:1,pageSize:10000}).then(res => {
getUserLabelList() {
listUserLabel({page: 1, pageSize: 10000}).then(res => {
this.userLabelList = res.data.records
})
},
getInfo(){
getInfoActivity().then(res => {
getInfo() {
getInfoActivity(this.activeId).then(res => {
if (res.data) {
this.ruleForm = res.data
console.log(res.data,'1109')
if (res.data.activityTimeType) this.tindex1 = res.data.activityTimeType
if (res.data.suitTimeSlotType) this.tindex3 = res.data.suitTimeSlotType
if (res.data.paymentType) this.ruleForm.paymentType = res.data.paymentType.split(",")
if (res.data.dieselUserLevel) this.ruleForm.dieselUserLevel = res.data.dieselUserLevel.split(",")
if (res.data.userLabelIds) this.ruleForm.userLabelIds = res.data.userLabelIds.split(",")
if( res.data.activeGift){
console.log( '198', this.ruleForm.activeGift)
if (res.data.activeGift) {
this.ruleForm.activeGift = res.data.activeGift.split(",")
for (let i = 0; i < this.ruleForm.activeGift.length; i++) {
if(this.ruleForm.activeGift[i] == '0'){
if (this.ruleForm.activeGift[i] == '0') {
this.ruleForm.activeGift[i] = '选项一'
}
if(this.ruleForm.activeGift[i] == '3' ){
if (this.ruleForm.activeGift[i] == '3') {
this.ruleForm.activeGift[i] = '选项二'
}
if(this.ruleForm.activeGift[i] == '1'){
if (this.ruleForm.activeGift[i] == '1') {
this.ruleForm.activeGift[i] = '选项三'
}
}
}else {
} else {
this.ruleForm.activeGift = []
}
if (res.data.suitDate){
if (res.data.suitTimeSlotType == 0){
if (res.data.suitDate) {
if (res.data.suitTimeSlotType == 0) {
this.weekDay = res.data.suitDate.split(",")
}else {
} else {
this.monthDay = res.data.suitDate.split(",")
}
}else {
} else {
this.weekDay = []
this.monthDay = []
}
@ -501,12 +499,12 @@ export default {
this.couponList = res.data.couponList
this.couponOrderType = res.data.couponList[0].orderType
}
}else {
} else {
this.ruleForm = {
paymentType:[],
activeGift:[],
activityTimeType:0,
suitTimeSlotType:0,
paymentType: [],
activeGift: [],
activityTimeType: 0,
suitTimeSlotType: 0,
}
this.tindex1 = 0
this.tindex3 = 0
@ -517,7 +515,7 @@ export default {
this.growthValueOrderType = ''
this.couponOrderType = ''
}
console.log( '1147', this.ruleForm.activeGift)
console.log('1147', this.ruleForm.activeGift)
})
},
@ -572,18 +570,18 @@ export default {
},
submitRuleForm(formName) {
for (let i = 0; i < this.ruleForm.activeGift.length; i++) {
if(this.ruleForm.activeGift[i] == '选项一'){
if (this.ruleForm.activeGift[i] == '选项一') {
this.ruleForm.activeGift[i] = 0
}
if(this.ruleForm.activeGift[i] == '选项二'){
if (this.ruleForm.activeGift[i] == '选项二') {
this.ruleForm.activeGift[i] = 3
}
if(this.ruleForm.activeGift[i] == '选项三'){
if (this.ruleForm.activeGift[i] == '选项三') {
this.ruleForm.activeGift[i] = 1
}
}
if (this.tindex1 == 1){
if (!this.ruleForm.activeStartTime || !this.ruleForm.activeEndTime){
if (this.tindex1 == 1) {
if (!this.ruleForm.activeStartTime || !this.ruleForm.activeEndTime) {
this.$message.error("请选择活动开始时间")
return
}
@ -591,9 +589,9 @@ export default {
this.$refs[formName].validate((valid) => {
if (valid) {
// 使
if (this.ruleForm.suitTimeSlotType==0){
if (this.ruleForm.suitTimeSlotType == 0) {
this.ruleForm.suitDate = this.weekDay.toString()
}else if (this.ruleForm.suitTimeSlotType==1){
} else if (this.ruleForm.suitTimeSlotType == 1) {
this.ruleForm.suitDate = this.monthDay.toString()
}
//
@ -618,13 +616,13 @@ export default {
editActivity(this.ruleForm).then(response => {
this.$modal.msgSuccess("修改成功");
// this.getInfo();
this.$router.push({path:"/EventMarketing/center/index",query:{id:'5'}})
this.$router.push({path: "/EventMarketing/center/index", query: {id: '5'}})
});
} else {
addActivity(this.ruleForm).then(response => {
this.$modal.msgSuccess("新增成功");
// this.getInfo();
this.$router.push({path:"/EventMarketing/center/index",query:{id:'5'}})
this.$router.push({path: "/EventMarketing/center/index", query: {id: '5'}})
});
}
}
@ -633,7 +631,7 @@ export default {
resetForm(formName) {
this.$refs[formName].resetFields();
// this.getInfo()
this.$router.push({path:"/EventMarketing/center/index"})
this.$router.push({path: "/EventMarketing/center/index"})
},
indexMethod(index) {
return index * 2;
@ -671,7 +669,7 @@ export default {
})
},
listUserGrade() {
listUserGrade({page:1,pageSize:1000}).then(res => {
listUserGrade({page: 1, pageSize: 1000}).then(res => {
if (res.code == 200) {
this.userGradeList = res.data.records
}

View File

@ -58,7 +58,7 @@
</div>
</el-checkbox-group>
</div>
<div style="width: 100%" >
<div style="width: 100%">
<div style="display: flex;font-size: 14px;">
<div style="width: 10%">赠送</div>
<el-input placeholder="请输入赠送的积分数量" style="width: 100%;"
@ -75,16 +75,16 @@
</el-input>
</div>
<div v-for="(item,index) in couponList" :key="index" style="font-size: 14px;margin: 15px 0">
<span>赠送</span>
<el-select v-model="item.vouchersId" style="margin-left: 10px;width: 30%" placeholder="请选择">
<div v-for="(item,index) in couponList" :key="index" style="display: flex;font-size: 14px;margin: 15px 0">
<div style="width: 9.5%">赠送</div>
<el-select v-model="item.vouchersId" style="width: 45%" placeholder="请选择">
<el-option
v-for="(item1,index1) in cardCouponList"
:key="index1"
:label="item1.name"
:value="item1.id"></el-option>
</el-select>
<el-input style="width: 30%;margin-left: 10px" v-model="item.giftCardTotal">
<el-input style="width: 45%;margin-left: 10px" v-model="item.giftCardTotal">
<template slot="append"></template>
</el-input>
<img src="@/assets/images/ljt.png" style="width: 25px;height: 25px;margin-left: 10px"
@ -125,6 +125,7 @@ import {listCardCoupon} from "@/api/EventMarketing/cardCoupon";
export default {
name: "ActiveNewlyweds",
props: ['activeId'],
data() {
return {
opendetails: false,
@ -200,8 +201,8 @@ export default {
},
ruleForm: {
activeTimeType:0,
courtesyReward:[]
activeTimeType: 0,
courtesyReward: []
},
ifWrite: true,
tindex1: 0,
@ -210,7 +211,7 @@ export default {
],
couponList: [],
//
cardCouponList:[],
cardCouponList: [],
//
rules: {
name: [
@ -232,26 +233,28 @@ export default {
};
},
created() {
// this.getInfo()
if (this.activeId) {
this.getInfo()
}
this.getCardCoupon()
},
methods: {
getCardCoupon(){
listCardCoupon({status:1,putType:1}).then(res => {
getCardCoupon() {
listCardCoupon({status: 1, putType: 1}).then(res => {
this.cardCouponList = res.data.records
})
},
getInfo(){
getInfoActiveNewlyweds().then(res => {
getInfo() {
getInfoActiveNewlyweds(this.activeId).then(res => {
if (res.data) {
this.ruleForm = res.data
if (res.data.courtesyReward) this.ruleForm.courtesyReward = res.data.courtesyReward.split(",")
if (res.data.activeTimeType) this.tindex1 = res.data.activeTimeType
if (res.data.couponList) this.couponList = res.data.couponList
}else {
} else {
this.ruleForm = {
activeTimeType:0,
courtesyReward:[]
activeTimeType: 0,
courtesyReward: []
}
this.tindex1 = 0
}
@ -273,8 +276,8 @@ export default {
this.ruleForm.activeTimeType = index
},
submitRuleForm(formName) {
if (this.tindex1 == 1){
if (!this.ruleForm.activeStartTime || !this.ruleForm.activeEndTime){
if (this.tindex1 == 1) {
if (!this.ruleForm.activeStartTime || !this.ruleForm.activeEndTime) {
this.$message.error("请选择活动开始时间")
return
}
@ -287,15 +290,15 @@ export default {
editActiveNewlyweds1(this.ruleForm).then(response => {
this.$modal.msgSuccess("修改成功");
// this.getInfo()
this.$router.push({path:"/EventMarketing/center/index",query:{id:'6'}})
this.$router.push({path: "/EventMarketing/center/index", query: {id: '6'}})
});
}else {
} else {
insertActiveNewlyweds(this.ruleForm).then(response => {
if (response.data==1){
if (response.data == 1) {
this.$modal.msgSuccess("新增成功");
// this.getInfo()
this.$router.push({path:"/EventMarketing/center/index",query:{id:'6'}})
}else {
this.$router.push({path: "/EventMarketing/center/index", query: {id: '6'}})
} else {
this.$modal.msgError("新增失败");
}
});
@ -307,7 +310,7 @@ export default {
this.$refs[formName].resetFields();
this.ifWrite = true
// this.getInfo()
this.$router.push({path:"/EventMarketing/center/index"})
this.$router.push({path: "/EventMarketing/center/index"})
},
/** 查询新人有礼活动列表 */
getList() {

View File

@ -26,7 +26,7 @@
<div class="nr-bottom">
<div class="left-bt" @click="indexType('6')">进行中1个</div>
|
<div class="right-bt" @click="routerPush(1)">创建活动</div>
<div class="right-bt" @click="routerPush(1,'add')">创建活动</div>
</div>
</div>
@ -55,7 +55,7 @@
<div class="nr-bottom">
<div class="left-bt" @click="indexType('5')">进行中1个</div>
|
<div class="right-bt" @click="routerPush(3)">创建活动</div>
<div class="right-bt" @click="routerPush(3,'add')">创建活动</div>
</div>
</div>
<div class="nr-box">
@ -69,7 +69,7 @@
<div class="nr-bottom">
<div class="left-bt">进行中1个</div>
|
<div class="right-bt" @click="routerPush(4)">创建活动</div>
<div class="right-bt" @click="routerPush(4,'add')">创建活动</div>
</div>
</div>
<div class="nr-box">
@ -83,7 +83,7 @@
<div class="nr-bottom">
<div class="left-bt" @click="indexType('4')">进行中1个</div>
|
<div class="right-bt" @click="routerPush(5)">创建活动</div>
<div class="right-bt" @click="routerPush(5,'add')">创建活动</div>
</div>
</div>
@ -98,7 +98,7 @@
<div class="nr-bottom">
<div class="left-bt" @click="indexType('8')">进行中1个</div>
|
<div class="right-bt" @click="routerPush(6)">创建活动</div>
<div class="right-bt" @click="routerPush(6,'add')">创建活动</div>
</div>
</div>
<div class="nr-box">
@ -112,7 +112,7 @@
<div class="nr-bottom">
<div class="left-bt" @click="indexType('9')">进行中1个</div>
|
<div class="right-bt" @click="routerPush(7)">创建活动</div>
<div class="right-bt" @click="routerPush(7,'add')">创建活动</div>
</div>
</div>
<div class="nr-box">
@ -126,7 +126,7 @@
<div class="nr-bottom">
<div class="left-bt" @click="indexType('10')">进行中1个</div>
|
<div class="right-bt" @click="routerPush(8)">创建活动</div>
<div class="right-bt" @click="routerPush(8,'add')">创建活动</div>
</div>
</div>
@ -145,9 +145,9 @@
</div>
</div>
<div class="nr-bottom">
<div class="left-bt" @click="routerPush(9)">进行中1个</div>
<div class="left-bt" @click="routerPush(9,'add')">进行中1个</div>
|
<div class="right-bt" @click="routerPush(9)">创建活动</div>
<div class="right-bt" @click="routerPush(9,'add')">创建活动</div>
</div>
</div>
<div class="nr-box">
@ -159,9 +159,9 @@
</div>
</div>
<div class="nr-bottom">
<div class="left-bt" @click="routerPush(10)">进行中1个</div>
<div class="left-bt" @click="routerPush(10,'add')">进行中1个</div>
|
<div class="right-bt" @click="routerPush(10)">创建活动</div>
<div class="right-bt" @click="routerPush(10,'add')">创建活动</div>
</div>
</div>
@ -176,7 +176,7 @@
<div class="nr-bottom">
<div class="left-bt" @click="indexType('3')">进行中1个</div>
|
<div class="right-bt" @click="routerPush(11)">创建活动</div>
<div class="right-bt" @click="routerPush(11,'add')">创建活动</div>
</div>
</div>
<div class="nr-box">
@ -256,18 +256,20 @@
<el-button
size="mini"
type="text"
@click="routerPush(scope.row.type)"
@click="routerPush(scope.row.type,'edit',scope.row)"
>修改
</el-button>
<el-button
size="mini"
type="text"
slot="reference"
@click="deleteActive(scope.row)"
>删除
</el-button>
<el-button
size="mini"
type="text"
@click="editStatus(scope.row)"
>停用
</el-button>
</template>
@ -348,19 +350,21 @@
<el-button
size="mini"
type="text"
@click="routerPush(scope.row.type)"
@click="routerPush(scope.row.type,'edit',scope.row)"
>修改
</el-button>
<el-button
size="mini"
type="text"
slot="reference"
@click="deleteActive(scope.row)"
>删除
</el-button>
<el-button
size="mini"
type="text"
>停用
@click="editStatus(scope.row)"
>启用
</el-button>
</template>
@ -385,7 +389,7 @@ import activeNewlyweds from '../activeNewlyweds/index'
import activeConsumption from '../activeConsumption/index'
import activeFullminus from '../activeFullminus/index'
import activeRecommend from '../activeRecommend/index'
import {pageActive} from "@/api/active/active";
import {deleteActive, editActiveStatus, pageActive} from "@/api/active/active";
export default {
name: 'Exchange',
@ -480,9 +484,9 @@ export default {
if (index == 1) {
this.queryParams.type = ""
this.handleQuery()
} else {
} else if (index == 2) {
this.queryParams.type = ""
this.getOldList()
this.handleOldQuery()
}
},
indexType(id) {
@ -537,17 +541,49 @@ export default {
this.queryParams.type = null
this.getOldList()
},
routerPush(id) {
//
deleteActive(data) {
this.$modal.confirm('是否删除本条数据,删除后无法恢复!').then(function () {
return deleteActive(data.id);
}).then(() => {
this.handleQuery()
this.handleOldQuery()
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
//
editStatus(data) {
let str = data.activeStatus=='1' ? "停用" : "启用"
this.$modal.confirm('是否'+str+'本条数据!').then(function () {
return editActiveStatus(data.id);
}).then(() => {
this.handleQuery()
this.handleOldQuery()
this.$modal.msgSuccess(str+"成功");
}).catch(() => {
});
},
routerPush(id,type,data) {
let activeId = ""
if (data){
if (data.type=='3') id = 11
if (data.type=='4') id = 5
if (data.type=='5') id = 3
if (data.type=='6') id = 1
if (data.type=='7') id = 4
if (data.type=='8') id = 6
if (data.type=='9') id = 7
if (data.type=='10') id = 8
activeId = data.activeId
}
this.$router.push({
path: '/EventMarketing/openCardGift/index',
query: {
id: id,
activeId:activeId
}
});
// this.$router.push('/EventMarketing/openCardGift/index')
},
//
goOtherPage(id, type) {

View File

@ -343,6 +343,7 @@ import {addActiveSubPrice, editActiveSubPrice, getActiveSubPrice} from "@/api/Ev
export default {
name: "LiJianMarketing",
dicts: ['payment_type'],
props:['activeId'],
data() {
return {
ruleForm: {
@ -412,8 +413,10 @@ export default {
}
},
created() {
//
// this.getInfo()
if (this.activeId) {
//
this.getInfo()
}
this.listUserGrade()
this.getUserLabelList()
this.getOilList()
@ -453,7 +456,7 @@ export default {
})
},
getInfo() {
getActiveSubPrice().then(res => {
getActiveSubPrice(this.activeId).then(res => {
if (res.data) {
this.ruleForm = res.data
if (res.data.timeSlots) {

View File

@ -34,7 +34,8 @@
<el-form-item label="提前赠送天数" prop="advanceGiveDay">
<el-input v-model="ruleForm.advanceGiveDay"
placeholder="请输入赠送天数"></el-input>
<span style="font-size: 12px;color: grey">设置生日有礼赠送时间:0表示会员生日当天赠送1表示提前1天赠送2表示提前2天赠送以此类推最多提前30天</span>
<span
style="font-size: 12px;color: grey">设置生日有礼赠送时间:0表示会员生日当天赠送1表示提前1天赠送2表示提前2天赠送以此类推最多提前30天</span>
</el-form-item>
<el-form-item label="通知内容" prop="noticeContent">
<div>
@ -135,6 +136,7 @@ import {addActiveBirthday, editActiveBirthday, getActiveBirthday} from "@/api/Ev
export default {
name: "ActiveNewlyweds",
props: ["activeId"],
data() {
return {
opendetails: false,
@ -210,8 +212,8 @@ export default {
},
ruleForm: {
activeTimeType:0,
courtesyReward:[]
activeTimeType: 0,
courtesyReward: []
},
ifWrite: true,
tindex1: 0,
@ -220,7 +222,7 @@ export default {
],
couponList: [],
//
cardCouponList:[],
cardCouponList: [],
userGradeList: [],
//
rules: {
@ -249,35 +251,36 @@ export default {
};
},
created() {
// this.getList()
// this.getInfo()
if (this.activeId) {
this.getInfo()
}
this.getCardCoupon()
this.listUserGrade()
},
methods: {
listUserGrade() {
listUserGrade({page:1,pageSize:1000}).then(res => {
listUserGrade({page: 1, pageSize: 1000}).then(res => {
if (res.code == 200) {
this.userGradeList = res.data.records
}
})
},
getCardCoupon(){
listCardCoupon({status:1,putType:1}).then(res => {
getCardCoupon() {
listCardCoupon({status: 1, putType: 1}).then(res => {
this.cardCouponList = res.data.records
})
},
getInfo(){
getActiveBirthday().then(res => {
getInfo() {
getActiveBirthday(this.activeId).then(res => {
if (res.data) {
this.ruleForm = res.data
if (res.data.courtesyReward) this.ruleForm.courtesyReward = res.data.courtesyReward.split(",")
if (res.data.activeTimeType) this.tindex1 = res.data.activeTimeType
if (res.data.couponList) this.couponList = res.data.couponList
}else {
} else {
this.ruleForm = {
activeTimeType:0,
courtesyReward:[]
activeTimeType: 0,
courtesyReward: []
}
this.tindex1 = 0
}
@ -299,8 +302,8 @@ export default {
this.ruleForm.activeTimeType = index
},
submitRuleForm(formName) {
if (this.tindex1 == 1){
if (!this.ruleForm.activeStartTime || !this.ruleForm.activeEndTime){
if (this.tindex1 == 1) {
if (!this.ruleForm.activeStartTime || !this.ruleForm.activeEndTime) {
this.$message.error("请选择活动开始时间")
return
}
@ -315,7 +318,7 @@ export default {
// this.getInfo()
this.$router.push({path: "/EventMarketing/center/index", query: {id: '4'}})
});
}else {
} else {
addActiveBirthday(this.ruleForm).then(response => {
this.$modal.msgSuccess("新增成功");
// this.getInfo()

View File

@ -7,16 +7,16 @@
{{ title }}
</div>
<!---->
<activeNewlyweds v-if="id == 1"></activeNewlyweds>
<activeConsumption v-if="id == 3"></activeConsumption>
<invite v-if="id == 4"></invite>
<birthday v-if="id == 5"></birthday>
<activeNewlyweds v-if="id == 1" :activeId="activeId"></activeNewlyweds>
<activeConsumption v-if="id == 3" :activeId="activeId"></activeConsumption>
<invite v-if="id == 4" :activeId="activeId"></invite>
<birthday v-if="id == 5" :activeId="activeId"></birthday>
<separate v-if="id == 9"></separate>
<TimeLimited v-if="id == 10"></TimeLimited>
<liJianMarketing v-if="id == 11"></liJianMarketing>
<userRecharge v-if="id == 6"></userRecharge>
<userConsume v-if="id == 7"></userConsume>
<popUp v-if="id == 8"></popUp>
<liJianMarketing v-if="id == 11" :activeId="activeId"></liJianMarketing>
<userRecharge v-if="id == 6" :activeId="activeId"></userRecharge>
<userConsume v-if="id == 7" :activeId="activeId"></userConsume>
<popUp v-if="id == 8" :activeId="activeId"></popUp>
</div>
</template>
@ -46,10 +46,14 @@ export default {
data() {
return {
id: '',
title: ""
title: "",
activeId:"",
}
},
created() {
if (this.$route.query.activeId) {
this.activeId = this.$route.query.activeId
}
this.id = this.$route.query.id
if (this.id == 1) {
if (this.$route.query.type && this.$route.query.type == "edit") {

View File

@ -124,6 +124,7 @@ import {
export default {
name: "ActiveNewlyweds",
props: ['activeId'],
data() {
return {
opendetails: false,
@ -231,8 +232,9 @@ export default {
};
},
created() {
// this.getList()
// this.getInfo()
if (this.activeId) {
this.getInfo()
}
this.getCardCoupon()
},
methods: {
@ -242,7 +244,7 @@ export default {
})
},
getInfo() {
getActiveRecommendInfo().then(res => {
getActiveRecommendInfo(this.activeId).then(res => {
if (res.data) {
this.ruleForm = res.data
if (res.data.rewardDisplay) {

View File

@ -161,6 +161,7 @@ import {addActivePopUp, editActivePopUp, getActivePopUp} from "@/api/EventMarket
export default {
name: "ActiveNewlyweds",
dicts: ['payment_type'],
props:['activeId'],
data() {
return {
opendetails: false,
@ -290,8 +291,9 @@ export default {
};
},
created() {
// this.getList()
// this.getInfo()
if (this.activeId) {
this.getInfo()
}
this.getCardCoupon()
this.listUserGrade()
},
@ -322,7 +324,7 @@ export default {
})
},
getInfo(){
getActivePopUp().then(res => {
getActivePopUp(this.activeId).then(res => {
if (res.data) {
this.ruleForm = res.data
if (res.data.courtesyReward) this.ruleForm.courtesyReward = res.data.courtesyReward.split(",")

View File

@ -155,6 +155,7 @@ import {
export default {
name: "ActiveNewlyweds",
dicts: ['payment_type'],
props:['activeId'],
data() {
return {
opendetails: false,
@ -276,8 +277,9 @@ export default {
};
},
created() {
// this.getList()
// this.getInfo()
if (this.activeId) {
this.getInfo()
}
this.getCardCoupon()
this.listUserGrade()
this.getOilList()
@ -319,7 +321,7 @@ export default {
})
},
getInfo(){
getActiveUserConsume().then(res => {
getActiveUserConsume(this.activeId).then(res => {
if (res.data) {
this.ruleForm = res.data
if (res.data.paymentType) this.ruleForm.paymentType = res.data.paymentType.split(",")

View File

@ -140,6 +140,7 @@ import {
export default {
name: "ActiveNewlyweds",
dicts: ['payment_type'],
props:['activeId'],
data() {
return {
opendetails: false,
@ -252,8 +253,9 @@ export default {
};
},
created() {
// this.getList()
// this.getInfo()
if (this.activeId) {
this.getInfo()
}
this.getCardCoupon()
this.listUserGrade()
},
@ -271,7 +273,7 @@ export default {
})
},
getInfo(){
getActiveUserRecharge().then(res => {
getActiveUserRecharge(this.activeId).then(res => {
if (res.data) {
this.ruleForm = res.data
if (res.data.courtesyReward) this.ruleForm.courtesyReward = res.data.courtesyReward.split(",")

View File

@ -48,7 +48,7 @@ public class ActiveAppletController extends BaseController {
/**
* 分页查询主表信息
*
* @param pageNo 分页参数
* @param page 分页参数
* @param pageSize 分页参数
* @param activeApplet ActiveApplet实体
* @return com.fuint.framework.web.ResponseObject
@ -145,5 +145,35 @@ public class ActiveAppletController extends BaseController {
return getSuccessResult(this.activeAppletService.removeByIds(idList));
}
/**
* 删除数据
*
* @param id 主键结合
* @return 删除结果
*/
@DeleteMapping("delete/{id}")
public ResponseObject deleteById(@PathVariable Integer id) {
try {
SysLog sysLog = new SysLog();
sysLog.setSystemName("2");
sysLog.setMoudle("营销中心");
sysLog.setContent("删除油站活动");
sysLogService.saveVo(sysLog);
} catch (Exception ignored) {
}
return getSuccessResult(this.activeAppletService.deleteById(id));
}
/**
* 修改状态信息
* @param id
* @return
*/
@GetMapping("editStatus/{id}")
public ResponseObject editStatus(@PathVariable Integer id) {
return getSuccessResult(activeAppletService.updateActiveStatus(id));
}
}

View File

@ -40,5 +40,26 @@ public interface ActiveAppletService extends IService<ActiveApplet> {
* @return
*/
int insertActiveApplet(ActiveApplet activeApplet);
/**
* 根据id删除信息
* @param id
* @return
*/
int deleteById(Integer id);
/**
* 修改启用状态
* @param id
* @return
*/
int updateActiveStatus(Integer id);
/**
* 根据活动id查询信息
* @param activeId
* @return
*/
ActiveApplet selectByActiveId(Integer activeId,String type);
}

View File

@ -8,12 +8,20 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.activeApplet.mapper.ActiveAppletMapper;
import com.fuint.business.marketingActivity.activeApplet.entity.ActiveApplet;
import com.fuint.business.marketingActivity.activeApplet.service.ActiveAppletService;
import com.fuint.business.marketingActivity.activeBirthday.service.ActiveBirthdayService;
import com.fuint.business.marketingActivity.activeConsumption.service.ActiveConsumptionService;
import com.fuint.business.marketingActivity.activeNewlyweds.service.ActiveNewlywedsService;
import com.fuint.business.marketingActivity.activePopUp.service.ActivePopUpService;
import com.fuint.business.marketingActivity.activePrice.service.ActiveSubPriceService;
import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecommendService;
import com.fuint.business.marketingActivity.activeUserConsume.service.ActiveUserConsumeService;
import com.fuint.business.marketingActivity.activeUserRecharge.service.ActiveUserRechargeService;
import com.fuint.business.userManager.entity.LJUserGrade;
import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.fuint.utils.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -30,8 +38,41 @@ public class ActiveAppletServiceImpl extends ServiceImpl<ActiveAppletMapper, Act
@Resource
private ActiveAppletMapper activeAppletMapper;
@Autowired
// 会员等级
@Resource
private LJUserGradeService userGradeService;
// 立减营销
@Resource
@Lazy
private ActiveSubPriceService activeSubPriceService;
// 生日有礼
@Resource
@Lazy
private ActiveBirthdayService activeBirthdayService;
// 消费有礼
@Resource
@Lazy
private ActiveConsumptionService activeConsumptionService;
// 开卡有礼
@Resource
@Lazy
private ActiveNewlywedsService activeNewlywedsService;
// 邀请有礼
@Resource
@Lazy
private ActiveRecommendService activeRecommendService;
// 推荐会员充值有礼
@Resource
@Lazy
private ActiveUserRechargeService activeUserRechargeService;
// 推荐会员消费有礼
@Resource
@Lazy
private ActiveUserConsumeService activeUserConsumeService;
// 弹窗营销
@Resource
@Lazy
private ActivePopUpService activePopUpService;
@Override
public List<ActiveApplet> applet(ActiveApplet activeApplet) {
@ -46,11 +87,11 @@ public class ActiveAppletServiceImpl extends ServiceImpl<ActiveAppletMapper, Act
@Override
public void updateIsonline(Integer storeId, String type, Integer activeId, String isonline) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("store_id",storeId);
queryWrapper.eq("type",type);
queryWrapper.eq("active_id",activeId);
queryWrapper.eq("store_id", storeId);
queryWrapper.eq("type", type);
queryWrapper.eq("active_id", activeId);
ActiveApplet activeApplet = baseMapper.selectOne(queryWrapper);
if (ObjectUtil.isNotEmpty(activeApplet)){
if (ObjectUtil.isNotEmpty(activeApplet)) {
if (isonline.equals("1")) activeApplet.setActiveStatus("2");
if (isonline.equals("0")) activeApplet.setActiveStatus("1");
activeApplet.setIsonline(isonline);
@ -69,17 +110,17 @@ public class ActiveAppletServiceImpl extends ServiceImpl<ActiveAppletMapper, Act
**/
@Override
public IPage<ActiveApplet> pageActive(Page<ActiveApplet> page, ActiveApplet activeApplet) {
IPage<ActiveApplet> result = activeAppletMapper.pageActive(page,activeApplet);
IPage<ActiveApplet> result = activeAppletMapper.pageActive(page, activeApplet);
// 查询用户等级信息
List<LJUserGrade> ljUserGrades = userGradeService.selectUserGradeAll(TokenUtil.getNowAccountInfo().getStoreId());
result.getRecords().forEach(item -> {
item.setTypeText(replaceType(item.getType()));
String userGradeName = "";
if (ObjectUtil.isNotEmpty(item.getAdaptUserType())){
if (ObjectUtil.isNotEmpty(item.getAdaptUserType())) {
String[] gradeIds = item.getAdaptUserType().split(",");
for (String gradeId : gradeIds) {
for (LJUserGrade ljUserGrade : ljUserGrades) {
if (gradeId.equals(ljUserGrade.getId().toString())){
if (gradeId.equals(ljUserGrade.getId().toString())) {
userGradeName += ljUserGrade.getName() + ",";
}
}
@ -98,13 +139,74 @@ public class ActiveAppletServiceImpl extends ServiceImpl<ActiveAppletMapper, Act
return baseMapper.insert(activeApplet);
}
@Override
public int deleteById(Integer id) {
ActiveApplet activeApplet = baseMapper.selectById(id);
if (activeApplet.getType().equals("3")) {
// 立减营销
activeSubPriceService.deleteActiveSubPriceById(activeApplet.getActiveId());
} else if (activeApplet.getType().equals("4")) {
// 生日有礼
activeBirthdayService.deleteById(activeApplet.getActiveId());
} else if (activeApplet.getType().equals("5")) {
// 消费有礼
activeConsumptionService.deleteById(activeApplet.getActiveId());
} else if (activeApplet.getType().equals("6")) {
// 开卡有礼
activeNewlywedsService.deleteById(activeApplet.getActiveId());
} else if (activeApplet.getType().equals("7")) {
// 邀请有礼
activeRecommendService.deleteById(activeApplet.getActiveId());
} else if (activeApplet.getType().equals("8")) {
// 推荐会员充值有礼
activeUserRechargeService.deleteById(activeApplet.getActiveId());
} else if (activeApplet.getType().equals("9")) {
// 推荐会员消费有礼
activeUserConsumeService.deleteById(activeApplet.getActiveId());
} else if (activeApplet.getType().equals("10")) {
// 弹窗营销
activePopUpService.deleteById(activeApplet.getActiveId());
}
return baseMapper.deleteById(id);
}
@Override
public int updateActiveStatus(Integer id) {
ActiveApplet activeApplet = baseMapper.selectById(id);
// 如果是启用则先把将单个进行中的所有存储信息全部修改为停用
if (activeApplet.getActiveStatus().equals("2") && activeApplet.getType().equals("6")
|| activeApplet.getActiveStatus().equals("2") && activeApplet.getType().equals("7")) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("type", activeApplet.getType());
queryWrapper.eq("store_id", TokenUtil.getNowAccountInfo().getStoreId());
List<ActiveApplet> list = baseMapper.selectList(queryWrapper);
for (ActiveApplet applet : list) {
applet.setActiveStatus("2");
baseMapper.updateById(applet);
}
}
activeApplet.setActiveStatus(activeApplet.getActiveStatus().equals("1") ? "2" : "1");
activeApplet.setIsonline(activeApplet.getActiveStatus().equals("1") ? "1" : "0");
return baseMapper.updateById(activeApplet);
}
@Override
public ActiveApplet selectByActiveId(Integer activeId,String type) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("active_id", activeId);
queryWrapper.eq("type",type);
queryWrapper.eq("store_id", TokenUtil.getNowAccountInfo().getStoreId());
return baseMapper.selectOne(queryWrapper);
}
/**
* 类型转换
* @author PQZ
* @date 22:34 2024/9/9
*
* @param type 活动类型
* @return java.lang.String
**/
* @author PQZ
* @date 22:34 2024/9/9
**/
public String replaceType(String type) {
if (StringUtil.isNotBlank(type)) {
type = type.replace("10", "弹窗营销");

View File

@ -76,6 +76,5 @@ public class ActiveBirthdayController extends BaseController {
public ResponseObject deleteById(@PathVariable Integer id) {
return getSuccessResult(activeBirthdayService.deleteById(id));
}
}

View File

@ -40,7 +40,10 @@ public class ActiveBirthdayServiceImpl extends ServiceImpl<ActiveBirthdayMapper,
*/
@Override
public ActiveBirthday queryById(Integer id) {
return baseMapper.selectById(id);
ActiveBirthday activeBirthday = baseMapper.selectById(id);
List<ActiveBirthdayChild> activeBirthdayChildren = activeBirthdayChildService.queryByActiveId(activeBirthday.getId());
activeBirthday.setCouponList(activeBirthdayChildren);
return activeBirthday;
}
@Override
@ -105,9 +108,9 @@ public class ActiveBirthdayServiceImpl extends ServiceImpl<ActiveBirthdayMapper,
activeApplet.setTime(activeBirthday.getActiveTimeType());
activeApplet.setActiveStartTime(activeBirthday.getActiveStartTime());
activeApplet.setActiveEndTime(activeBirthday.getActiveEndTime());
activeApplet.setName(activeBirthday.getName());
activeApplet.setType("4");
activeApplet.setActiveId(activeBirthday.getId());
activeApplet.setName(activeBirthday.getName());
activeApplet.setIsonline(activeBirthday.getIsonline());
activeApplet.setActiveStatus(activeBirthday.getIsonline().equals("0") ? "1":"2");
activeAppletService.insertActiveApplet(activeApplet);
@ -123,6 +126,7 @@ public class ActiveBirthdayServiceImpl extends ServiceImpl<ActiveBirthdayMapper,
@Override
public int update(ActiveBirthday activeBirthday) {
int row = baseMapper.updateById(activeBirthday);
// 修改子表信息
activeBirthdayChildService.deleteByActiveId(activeBirthday.getId());
if (ObjectUtil.isNotEmpty(activeBirthday.getCouponList())){
for (ActiveBirthdayChild activeBirthdayChild : activeBirthday.getCouponList()) {
@ -130,6 +134,25 @@ public class ActiveBirthdayServiceImpl extends ServiceImpl<ActiveBirthdayMapper,
activeBirthdayChildService.insert(activeBirthdayChild);
}
}
// 修改总表信息
ActiveApplet activeApplet = activeAppletService.selectByActiveId(activeBirthday.getId(),"4");
String discountActiveDescribe = "";
if (activeBirthday.getCourtesyReward().contains("0")) {
discountActiveDescribe += "赠送优惠券,";
}
if (activeBirthday.getCourtesyReward().contains("2")) {
discountActiveDescribe += "赠送成长值,";
}
if (activeBirthday.getCourtesyReward().contains("3")) {
discountActiveDescribe += "赠送积分,";
}
activeApplet.setDiscountActiveDescribe(discountActiveDescribe);
activeApplet.setTime(activeBirthday.getActiveTimeType());
activeApplet.setActiveStartTime(activeBirthday.getActiveStartTime());
activeApplet.setActiveEndTime(activeBirthday.getActiveEndTime());
activeApplet.setName(activeBirthday.getName());
activeAppletService.updateById(activeApplet);
return row;
}
@ -141,6 +164,7 @@ public class ActiveBirthdayServiceImpl extends ServiceImpl<ActiveBirthdayMapper,
*/
@Override
public int deleteById(Integer id) {
activeBirthdayChildService.deleteByActiveId(id);
return baseMapper.deleteById(id);
}
}

View File

@ -266,5 +266,15 @@ public class ActiveConsumptionController extends BaseController {
return getSuccessResult(this.activeConsumptionService.selectByStoreId());
}
/**
* 根据id查询
*
* @return 单条数据
*/
@GetMapping("/selectById/{id}")
public ResponseObject selectById(@PathVariable Integer id) {
return getSuccessResult(this.activeConsumptionService.selectById(id));
}
}

View File

@ -83,5 +83,19 @@ public interface ActiveConsumptionService extends IService<ActiveConsumption> {
* @return
*/
int updateActiveConsumption(ActiveConsumption activeConsumption);
/**
* 根据id删除信息
* @param id
* @return
*/
int deleteById(Integer id);
/**
* 根据id查询信息
* @param id
* @return
*/
ActiveConsumption selectById(Integer id);
}

View File

@ -647,6 +647,8 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
@Override
public int updateActiveConsumption(ActiveConsumption activeConsumption) {
int row = baseMapper.updateById(activeConsumption);
// 修改子表信息
activeConsumptionChildService.deleteByActiveId(activeConsumption.getId());
if (ObjectUtil.isNotEmpty(activeConsumption.getPointList())){
for (ActiveConsumptionChild activeConsumptionChild : activeConsumption.getPointList()) {
@ -666,9 +668,47 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
activeConsumptionChildService.save(activeConsumptionChild);
}
}
// 修改总表信息
ActiveApplet activeApplet = activeAppletService.selectByActiveId(activeConsumption.getId(),"5");
String discountActiveDescribe = "";
if (activeConsumption.getActiveGift().contains("1")) {
discountActiveDescribe += "赠送优惠券,";
}
if (activeConsumption.getActiveGift().contains("3")) {
discountActiveDescribe += "赠送成长值,";
}
if (activeConsumption.getActiveGift().contains("0")) {
discountActiveDescribe += "赠送积分,";
}
activeApplet.setDiscountActiveDescribe(discountActiveDescribe);
activeApplet.setTime(activeConsumption.getActivityTimeType());
activeApplet.setActiveStartTime(activeConsumption.getActiveStartTime());
activeApplet.setActiveEndTime(activeConsumption.getActiveEndTime());
activeApplet.setAdaptUserType(activeConsumption.getDieselUserLevel());
activeApplet.setName(activeConsumption.getName());
activeAppletService.updateById(activeApplet);
return row;
}
@Override
public int deleteById(Integer id) {
activeConsumptionChildService.deleteByActiveId(id);
return baseMapper.deleteById(id);
}
@Override
public ActiveConsumption selectById(Integer id) {
ActiveConsumption activeConsumption = baseMapper.selectById(id);
List<ActiveConsumptionChild> activeConsumptionChildren = activeConsumptionChildService.selectByActiveId(activeConsumption.getId(), "0");
activeConsumption.setPointList(activeConsumptionChildren);
List<ActiveConsumptionChild> activeConsumptionChildren1 = activeConsumptionChildService.selectByActiveId(activeConsumption.getId(), "3");
activeConsumption.setGrowthValueList(activeConsumptionChildren1);
List<ActiveConsumptionChild> activeConsumptionChildren2 = activeConsumptionChildService.selectByActiveId(activeConsumption.getId(), "1");
activeConsumption.setCouponList(activeConsumptionChildren2);
return activeConsumption;
}
/**
* 数组转字符串
* @param array

View File

@ -209,5 +209,10 @@ public class ActiveNewlywedsController extends BaseController {
public ResponseObject edit(@RequestBody ActiveNewlyweds activeNewlyweds){
return getSuccessResult(activeNewlywedsService.updateActiveNewlyweds(activeNewlyweds));
}
@GetMapping("getInfoById/{id}")
public ResponseObject getInfoById(@PathVariable Integer id){
return getSuccessResult(activeNewlywedsService.getInfoById(id));
}
}

View File

@ -84,5 +84,19 @@ public interface ActiveNewlywedsService extends IService<ActiveNewlyweds> {
* @return
*/
int updateActiveNewlyweds(ActiveNewlyweds activeNewlyweds);
/**
* 根据id删除信息
* @param id
* @return
*/
int deleteById(Integer id);
/**
* 根据id查询
* @param id
* @return
*/
ActiveNewlyweds getInfoById(Integer id);
}

View File

@ -641,6 +641,7 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
public int updateActiveNewlyweds(ActiveNewlyweds activeNewlyweds) {
int row = baseMapper.updateById(activeNewlyweds);
// 修改子表信息
activeNewlywedsChildService.deleteByActiveId(activeNewlyweds.getId());
if (ObjectUtil.isNotEmpty(activeNewlyweds.getCouponList())) {
for (ActiveNewlywedsChild activeNewlywedsChild : activeNewlyweds.getCouponList()) {
@ -648,9 +649,42 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
activeNewlywedsChildService.save(activeNewlywedsChild);
}
}
// 修改总表信息
ActiveApplet activeApplet = activeAppletService.selectByActiveId(activeNewlyweds.getId(),"6");
String discountActiveDescribe = "";
if (activeNewlyweds.getCourtesyReward().contains("0")) {
discountActiveDescribe += "赠送优惠券,";
}
if (activeNewlyweds.getCourtesyReward().contains("2")) {
discountActiveDescribe += "赠送成长值,";
}
if (activeNewlyweds.getCourtesyReward().contains("3")) {
discountActiveDescribe += "赠送积分,";
}
activeApplet.setDiscountActiveDescribe(discountActiveDescribe);
activeApplet.setTime(activeNewlyweds.getActiveTimeType());
activeApplet.setActiveStartTime(activeNewlyweds.getActiveStartTime());
activeApplet.setActiveEndTime(activeNewlyweds.getActiveEndTime());
activeApplet.setName(activeNewlyweds.getName());
activeAppletService.updateById(activeApplet);
return row;
}
@Override
public int deleteById(Integer id) {
activeNewlywedsChildService.deleteByActiveId(id);
return baseMapper.deleteById(id);
}
@Override
public ActiveNewlyweds getInfoById(Integer id) {
ActiveNewlyweds activeNewlyweds = baseMapper.selectById(id);
List<ActiveNewlywedsChild> activeNewlywedsChildren = activeNewlywedsChildService.selectByActiveId(id);
activeNewlyweds.setCouponList(activeNewlywedsChildren);
return activeNewlyweds;
}
/**
* 数组转字符串
*

View File

@ -40,7 +40,10 @@ public class ActivePopUpServiceImpl extends ServiceImpl<ActivePopUpMapper,Active
*/
@Override
public ActivePopUp queryById(Integer id) {
return baseMapper.selectById(id);
ActivePopUp activePopUp = baseMapper.selectById(id);
List<ActivePopUpChild> activePopUpChildren = activePopUpChildService.selectByActivePopUpId(activePopUp.getId());
activePopUp.setCouponList(activePopUpChildren);
return activePopUp;
}
/**
@ -80,10 +83,10 @@ public class ActivePopUpServiceImpl extends ServiceImpl<ActivePopUpMapper,Active
activeApplet.setTime(activePopUp.getActiveTimeType());
activeApplet.setActiveStartTime(activePopUp.getActiveStartTime());
activeApplet.setActiveEndTime(activePopUp.getActiveEndTime());
activeApplet.setType("10");
activeApplet.setAdaptUserType(activePopUp.getUserGradeIds());
activeApplet.setActiveId(activePopUp.getId());
activeApplet.setName(activePopUp.getName());
activeApplet.setType("10");
activeApplet.setActiveId(activePopUp.getId());
activeApplet.setIsonline(activePopUp.getIsonline());
activeApplet.setActiveStatus(activePopUp.getIsonline().equals("0") ? "1":"2");
activeAppletService.insertActiveApplet(activeApplet);
@ -99,6 +102,7 @@ public class ActivePopUpServiceImpl extends ServiceImpl<ActivePopUpMapper,Active
@Override
public int update(ActivePopUp activePopUp) {
int row = baseMapper.updateById(activePopUp);
// 修改子表信息
activePopUpChildService.deleteByActivePopUpId(activePopUp.getId());
if (ObjectUtil.isNotEmpty(activePopUp.getCouponList())){
for (ActivePopUpChild activePopUpChild : activePopUp.getCouponList()) {
@ -106,6 +110,26 @@ public class ActivePopUpServiceImpl extends ServiceImpl<ActivePopUpMapper,Active
activePopUpChildService.insert(activePopUpChild);
}
}
// 修改总表信息
ActiveApplet activeApplet = activeAppletService.selectByActiveId(activePopUp.getId(), "10");
String discountActiveDescribe = "";
if (activePopUp.getCourtesyReward().contains("0")) {
discountActiveDescribe += "赠送优惠券,";
}
if (activePopUp.getCourtesyReward().contains("2")) {
discountActiveDescribe += "赠送成长值,";
}
if (activePopUp.getCourtesyReward().contains("3")) {
discountActiveDescribe += "赠送积分,";
}
activeApplet.setDiscountActiveDescribe(discountActiveDescribe);
activeApplet.setTime(activePopUp.getActiveTimeType());
activeApplet.setActiveStartTime(activePopUp.getActiveStartTime());
activeApplet.setActiveEndTime(activePopUp.getActiveEndTime());
activeApplet.setAdaptUserType(activePopUp.getUserGradeIds());
activeApplet.setName(activePopUp.getName());
activeAppletService.updateById(activeApplet);
return row;
}
@ -117,6 +141,7 @@ public class ActivePopUpServiceImpl extends ServiceImpl<ActivePopUpMapper,Active
*/
@Override
public int deleteById(Integer id) {
activePopUpChildService.deleteByActivePopUpId(id);
return baseMapper.deleteById(id);
}

View File

@ -39,5 +39,12 @@ public interface ActiveSubPriceService extends IService<ActiveSubPrice> {
*/
ActiveSubPrice selectByStoreId();
/***
* 根据id删除立减营销信息
* @param id
* @return
*/
int deleteActiveSubPriceById(Integer id);
}

View File

@ -19,6 +19,7 @@ import com.fuint.quartz.util.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -54,6 +55,11 @@ public class ActiveSubPriceServiceImpl extends ServiceImpl<ActiveSubPriceMapper,
ActiveSubPrice activeSubPrice = getById(id);
BeanUtils.copyProperties(activeSubPrice, result);
result.setRuleList(activeSubPriceRuleService.listByActId(id));
List<ActiveSubPriceRule> activeSubPriceRules = activeSubPriceRuleService.listByActSubId(activeSubPrice.getId(),"0");
result.setOrderList(activeSubPriceRules);
List<ActiveSubPriceRule> activeSubPriceRules1 = activeSubPriceRuleService.listByActSubId(activeSubPrice.getId(),"1");
result.setRefuelList(activeSubPriceRules1);
return result;
}
@ -83,8 +89,10 @@ public class ActiveSubPriceServiceImpl extends ServiceImpl<ActiveSubPriceMapper,
boolean row = saveOrUpdate(activeSubPrice);
activeSubPrice = this.selectByStoreId();
//保存子表信息
activeSubPriceRuleService.saveActiveSubPriceRule(activeSubPrice.getId(),saveVO.getOrderList());
activeSubPriceRuleService.saveActiveSubPriceRule(activeSubPrice.getId(),saveVO.getRefuelList());
List<ActiveSubPriceRule> activeSubPriceRules = new ArrayList<>();
activeSubPriceRules.addAll(saveVO.getOrderList());
activeSubPriceRules.addAll(saveVO.getRefuelList());
activeSubPriceRuleService.saveActiveSubPriceRule(activeSubPrice.getId(),activeSubPriceRules);
if (isAdd){
// 往总表插入信息
@ -142,5 +150,12 @@ public class ActiveSubPriceServiceImpl extends ServiceImpl<ActiveSubPriceMapper,
}
return activeSubPrice;
}
@Override
public int deleteActiveSubPriceById(Integer id) {
int row = baseMapper.deleteById(id);
activeSubPriceRuleService.removeByActId(id);
return row;
}
}

View File

@ -225,5 +225,10 @@ public class ActiveRecommendController extends BaseController {
public ResponseObject edit(@RequestBody ActiveRecommend activeRecommend) {
return getSuccessResult(activeRecommendService.updateActiveRecommend(activeRecommend));
}
@GetMapping("getInfoById/{id}")
public ResponseObject getInfoById(@PathVariable Integer id){
return getSuccessResult(activeRecommendService.selectById(id));
}
}

View File

@ -63,8 +63,32 @@ public interface ActiveRecommendService extends IService<ActiveRecommend> {
*/
ActiveRecommend selectByStoreId();
/**
* 添加信息
* @param activeRecommend
* @return
*/
int insertActiveRecommend(ActiveRecommend activeRecommend);
/**
* 修改信息
* @param activeRecommend
* @return
*/
int updateActiveRecommend(ActiveRecommend activeRecommend);
/**
* 根据id删除信息
* @param id
* @return
*/
int deleteById(Integer id);
/**
* 根据id查询
* @param id
* @return
*/
ActiveRecommend selectById(Integer id);
}

View File

@ -632,6 +632,8 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
@Override
public int updateActiveRecommend(ActiveRecommend activeRecommend) {
int row = baseMapper.updateById(activeRecommend);
// 修改子表信息
activeRecommendChildService.deleteByRecommendId(activeRecommend.getId());
if (ObjectUtil.isNotEmpty(activeRecommend.getCouponList())){
for (ActiveRecommendChild activeRecommendChild : activeRecommend.getCouponList()) {
@ -639,9 +641,42 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
activeRecommendChildService.save(activeRecommendChild);
}
}
// 修改总表信息
ActiveApplet activeApplet = activeAppletService.selectByActiveId(activeRecommend.getId(),"7");
String discountActiveDescribe = "";
if (activeRecommend.getRewardDisplay().contains("0")) {
discountActiveDescribe += "赠送优惠券,";
}
if (activeRecommend.getRewardDisplay().contains("2")) {
discountActiveDescribe += "赠送成长值,";
}
if (activeRecommend.getRewardDisplay().contains("3")) {
discountActiveDescribe += "赠送积分,";
}
activeApplet.setDiscountActiveDescribe(discountActiveDescribe);
activeApplet.setTime(activeRecommend.getActiveTimeType());
activeApplet.setActiveStartTime(activeRecommend.getActiveStartTime());
activeApplet.setActiveEndTime(activeRecommend.getActiveEndTime());
activeApplet.setName(activeRecommend.getActiveName());
activeAppletService.updateById(activeApplet);
return row;
}
@Override
public int deleteById(Integer id) {
activeRecommendChildService.deleteByRecommendId(id);
return baseMapper.deleteById(id);
}
@Override
public ActiveRecommend selectById(Integer id) {
ActiveRecommend activeRecommend = baseMapper.selectById(id);
List<ActiveRecommendChild> activeRecommendChildren = activeRecommendChildService.selectList(id);
activeRecommend.setCouponList(activeRecommendChildren);
return activeRecommend;
}
/**
* 数组转字符串
* @param array

View File

@ -40,7 +40,10 @@ public class ActiveUserConsumeServiceImpl extends ServiceImpl<ActiveUserConsumeM
*/
@Override
public ActiveUserConsume queryById(Integer id) {
return baseMapper.selectById(id);
ActiveUserConsume activeUserConsume = baseMapper.selectById(id);
List<ActiveUserConsumeChild> activeUserConsumeChildren = activeUserConsumeChildService.selectByActiveUserConsumeId(id);
activeUserConsume.setCouponList(activeUserConsumeChildren);
return activeUserConsume;
}
/**
@ -80,10 +83,10 @@ public class ActiveUserConsumeServiceImpl extends ServiceImpl<ActiveUserConsumeM
activeApplet.setTime(activeUserConsume.getActiveTimeType());
activeApplet.setActiveStartTime(activeUserConsume.getActiveStartTime());
activeApplet.setActiveEndTime(activeUserConsume.getActiveEndTime());
activeApplet.setType("9");
activeApplet.setAdaptUserType(activeUserConsume.getUserGradeIds());
activeApplet.setActiveId(activeUserConsume.getId());
activeApplet.setName(activeUserConsume.getName());
activeApplet.setType("9");
activeApplet.setActiveId(activeUserConsume.getId());
activeApplet.setIsonline(activeUserConsume.getIsonline());
activeApplet.setActiveStatus(activeUserConsume.getIsonline().equals("0") ? "1":"2");
activeAppletService.insertActiveApplet(activeApplet);
@ -99,6 +102,7 @@ public class ActiveUserConsumeServiceImpl extends ServiceImpl<ActiveUserConsumeM
@Override
public int update(ActiveUserConsume activeUserConsume) {
int row = baseMapper.updateById(activeUserConsume);
// 修改子表信息
activeUserConsumeChildService.deleteByActiveUserConsumeId(activeUserConsume.getId());
if (ObjectUtil.isNotEmpty(activeUserConsume) && ObjectUtil.isNotEmpty(activeUserConsume.getCouponList())) {
for (ActiveUserConsumeChild activeUserConsumeChild : activeUserConsume.getCouponList()) {
@ -106,6 +110,26 @@ public class ActiveUserConsumeServiceImpl extends ServiceImpl<ActiveUserConsumeM
activeUserConsumeChildService.insert(activeUserConsumeChild);
}
}
// 修改总表信息
ActiveApplet activeApplet = activeAppletService.selectByActiveId(activeUserConsume.getId(),"9");
String discountActiveDescribe = "";
if (activeUserConsume.getCourtesyReward().contains("0")) {
discountActiveDescribe += "赠送优惠券,";
}
if (activeUserConsume.getCourtesyReward().contains("2")) {
discountActiveDescribe += "赠送成长值,";
}
if (activeUserConsume.getCourtesyReward().contains("3")) {
discountActiveDescribe += "赠送积分,";
}
activeApplet.setDiscountActiveDescribe(discountActiveDescribe);
activeApplet.setTime(activeUserConsume.getActiveTimeType());
activeApplet.setActiveStartTime(activeUserConsume.getActiveStartTime());
activeApplet.setActiveEndTime(activeUserConsume.getActiveEndTime());
activeApplet.setAdaptUserType(activeUserConsume.getUserGradeIds());
activeApplet.setName(activeUserConsume.getName());
activeAppletService.updateById(activeApplet);
return row;
}
@ -117,6 +141,7 @@ public class ActiveUserConsumeServiceImpl extends ServiceImpl<ActiveUserConsumeM
*/
@Override
public int deleteById(Integer id) {
activeUserConsumeChildService.deleteByActiveUserConsumeId(id);
return baseMapper.deleteById(id);
}

View File

@ -76,6 +76,5 @@ public class ActiveUserRechargeController extends BaseController {
public ResponseObject deleteById(@PathVariable Integer id) {
return getSuccessResult(activeUserRechargeService.deleteById(id));
}
}

View File

@ -49,5 +49,4 @@ public interface ActiveUserRechargeService {
* @return
*/
ActiveUserRecharge selectByStoreId();
}

View File

@ -40,7 +40,10 @@ public class ActiveUserRechargeServiceImpl extends ServiceImpl<ActiveUserRecharg
*/
@Override
public ActiveUserRecharge queryById(Integer id) {
return baseMapper.selectById(id);
ActiveUserRecharge activeUserRecharge = baseMapper.selectById(id);
List<ActiveUserRechargeChild> activeUserRechargeChildren = activeUserRechargeChildService.selectByUserRechargeId(id);
activeUserRecharge.setCouponList(activeUserRechargeChildren);
return activeUserRecharge;
}
/**
@ -82,10 +85,10 @@ public class ActiveUserRechargeServiceImpl extends ServiceImpl<ActiveUserRecharg
activeApplet.setTime(activeUserRecharge.getActiveTimeType());
activeApplet.setActiveStartTime(activeUserRecharge.getActiveStartTime());
activeApplet.setActiveEndTime(activeUserRecharge.getActiveEndTime());
activeApplet.setType("8");
activeApplet.setAdaptUserType(activeUserRecharge.getUserGradeIds());
activeApplet.setActiveId(activeUserRecharge.getId());
activeApplet.setName(activeUserRecharge.getName());
activeApplet.setType("8");
activeApplet.setActiveId(activeUserRecharge.getId());
activeApplet.setIsonline(activeUserRecharge.getIsonline());
activeApplet.setActiveStatus(activeUserRecharge.getIsonline().equals("0") ? "1":"2");
activeAppletService.insertActiveApplet(activeApplet);
@ -101,6 +104,7 @@ public class ActiveUserRechargeServiceImpl extends ServiceImpl<ActiveUserRecharg
@Override
public int update(ActiveUserRecharge activeUserRecharge) {
int row = baseMapper.updateById(activeUserRecharge);
// 修改子表信息
activeUserRechargeChildService.deleteByUserRechargeId(activeUserRecharge.getId());
if (ObjectUtil.isNotEmpty(activeUserRecharge.getCouponList())) {
for (ActiveUserRechargeChild activeUserRechargeChild : activeUserRecharge.getCouponList()) {
@ -108,6 +112,26 @@ public class ActiveUserRechargeServiceImpl extends ServiceImpl<ActiveUserRecharg
activeUserRechargeChildService.insert(activeUserRechargeChild);
}
}
// 修改总表信息
ActiveApplet activeApplet = activeAppletService.selectByActiveId(activeUserRecharge.getId(),"8");
String discountActiveDescribe = "";
if (activeUserRecharge.getCourtesyReward().contains("0")) {
discountActiveDescribe += "赠送优惠券,";
}
if (activeUserRecharge.getCourtesyReward().contains("2")) {
discountActiveDescribe += "赠送成长值,";
}
if (activeUserRecharge.getCourtesyReward().contains("3")) {
discountActiveDescribe += "赠送积分,";
}
activeApplet.setDiscountActiveDescribe(discountActiveDescribe);
activeApplet.setTime(activeUserRecharge.getActiveTimeType());
activeApplet.setActiveStartTime(activeUserRecharge.getActiveStartTime());
activeApplet.setActiveEndTime(activeUserRecharge.getActiveEndTime());
activeApplet.setAdaptUserType(activeUserRecharge.getUserGradeIds());
activeApplet.setName(activeUserRecharge.getName());
activeAppletService.updateById(activeApplet);
return row;
}
@ -119,6 +143,7 @@ public class ActiveUserRechargeServiceImpl extends ServiceImpl<ActiveUserRecharg
*/
@Override
public int deleteById(Integer id) {
activeUserRechargeChildService.deleteByUserRechargeId(id);
return baseMapper.deleteById(id);
}