diff --git a/fuintAdmin/src/api/EventMarketing/activeConsumption.js b/fuintAdmin/src/api/EventMarketing/activeConsumption.js index 4d257ea8d..d3a17a9e0 100644 --- a/fuintAdmin/src/api/EventMarketing/activeConsumption.js +++ b/fuintAdmin/src/api/EventMarketing/activeConsumption.js @@ -106,3 +106,19 @@ export function looklooklook(id) { }) } + +export function getInfoActivity() { + return request({ + url: 'business/marketingActivity/activeConsumption/getInfo', + method: 'get', + + }) +} + +export function addActivity(data) { + return request({ + url: 'business/marketingActivity/activeConsumption/add', + method: 'post', + data:data + }) +} diff --git a/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue b/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue index e761738c2..d3171ada7 100644 --- a/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue +++ b/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue @@ -1,646 +1,821 @@ @@ -662,61 +837,60 @@ import { } from "@/api/EventMarketing/activeConsumption"; import {listUserGrade} from "@/api/staff/user/usergrade"; import {getOilNameList} from "@/api/order/oilnumgun"; -import {updateExchange} from "@/api/EventMarketing/cardExchange"; export default { name: "ActiveConsumption", data() { return { - opendetails:false, - looklist:[], - statisticsyou:{}, - moneyList:[ - {name:'订单金额',id:'1'}, - {name:'实付金额',id:'2'} + opendetails: false, + looklist: [], + statisticsyou: {}, + moneyList: [ + {name: '订单金额', id: '1'}, + {name: '实付金额', id: '2'} ], - labelPosition:'left', - userGradeList:[], + labelPosition: 'left', + userGradeList: [], // 油号列表 - oilNameList:[], - pdidlist:[],//判断优惠券id - pddhidlist:[],//判断兑换券id - pdswidlist:[],//判断实物id - dialogTableVisible:false,//优惠券 - dialogTableVisibledh:false,//兑换券 - dialogTableVisiblesw:false,//实物 + oilNameList: [], + pdidlist: [],//判断优惠券id + pddhidlist: [],//判断兑换券id + pdswidlist: [],//判断实物id + dialogTableVisible: false,//优惠券 + dialogTableVisibledh: false,//兑换券 + dialogTableVisiblesw: false,//实物 tableData: [],//优惠券 - tableDatadh:[],//兑换券 - tableDatasw:[],//实物 - tableDatas:[],//公共选择区域 - tableData1:[],//公共选择区域 + tableDatadh: [],//兑换券 + tableDatasw: [],//实物 + tableDatas: [],//公共选择区域 + tableData1: [],//公共选择区域 //请求优惠券列表时的参数 - youhuiquan:{ - name:'', + youhuiquan: { + name: '', pageNum: 1, pageSize: 10, }, - ytotal:0, + ytotal: 0, //请求兑换券列表时的参数 - duihuanquan:{ - name:'', + duihuanquan: { + name: '', pageNum: 1, pageSize: 10, - total:0 + total: 0 }, - dtotal:0, + dtotal: 0, //请求实物列表时的参数 - shiwu:{ - isRecovery:0, + shiwu: { + isRecovery: 0, page: 1, pageSize: 10, }, - stotal:0, - shopdata:{ - goodsId:'', - count:0, + stotal: 0, + shopdata: { + goodsId: '', + count: 0, }, - oillist:['92#','95#','98#','0#','-10#','LNG','CNG','京92#','京95#','京0#',], + oillist: ['92#', '95#', '98#', '0#', '-10#', 'LNG', 'CNG', '京92#', '京95#', '京0#',], // 遮罩层 loading: true, // 选中数组 @@ -736,12 +910,12 @@ export default { // 是否显示弹出层 open: false, // 查询参数 - listFavorable:{ + listFavorable: { pageNum: 1, pageSize: 10, }, - listFavorablesw:{ - isRecovery:0, + listFavorablesw: { + isRecovery: 0, page: 1, pageSize: 10, }, @@ -772,57 +946,82 @@ export default { }, // 表单参数 form: { - tableDatas:[], - shiwudata:[], + tableDatas: [], + shiwudata: [], }, + + + ruleForm: { + name: '', + region: '', + date1: '', + date2: '', + delivery: false, + type: [], + resource: '', + desc: '' + }, + ifWrite: true, + tindex1: 0, + activityTimeTypeList: [ + "永久有效", "自定义" + ], + weekMonthTypeList: ["每周", "每月"], + tindex3: 0, + weekList: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"], + weekDay: [], + monthDay: [], + pointList: [], + growthValueList: [], + couponList: [], // 表单校验 rules: { adaptOil: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], - moneyType:[ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + moneyType: [ + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], name: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], participationConditionMoney: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], activeStartTime: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], activeEndTime: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], adaptUserType: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], dieselUserLevel: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], gasolineUserLevel: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], naturalUserLevel: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], participationCondition: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], participationAcount: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], limitAcount: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], activeGift: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], status: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], isonline: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], points: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], activeConsumptionChildList: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], } }; @@ -834,6 +1033,63 @@ export default { this.listUserGrade() }, methods: { + addPoints(orderType) { + let data = { + activeGift: 0, + orderType: orderType, + consumeAmount: "", + givePoints: "", + } + this.pointList.push(data) + }, + deletePoints(index) { + this.pointList.splice(index, 1); + }, + addGrowthValues(orderType) { + let data = { + activeGift: 3, + orderType: orderType, + consumeAmount: "", + giveGrowthValue: "", + } + this.growthValueList.push(data) + }, + deleteGrowthValues(index) { + this.growthValueList.splice(index, 1); + }, + addCoupons(orderType) { + let data = { + activeGift: 1, + orderType: orderType, + vouchersId: "", + giftCardTotal: "", + } + this.couponList.push(data) + }, + deleteCoupons(index) { + this.couponList.splice(index, 1); + }, + Typeindex1(index) { + this.tindex1 = index + this.ruleForm.activityTimeType = index + }, + Typeindex3(index) { + this.tindex3 = index + this.ruleForm.suitTimeSlotType = index + }, + submitRuleForm(formName) { + this.$refs[formName].validate((valid) => { + if (valid) { + alert('submit!'); + } else { + console.log('error submit!!'); + return false; + } + }); + }, + resetForm(formName) { + this.$refs[formName].resetFields(); + }, indexMethod(index) { return index * 2; }, @@ -847,43 +1103,43 @@ export default { }); }, // - lookDetail(row){ + lookDetail(row) { this.opendetails = true let data = { - id:row.id, - exchangeFrom:"消费有礼" + id: row.id, + exchangeFrom: "消费有礼" } - looklook(data).then(res=>{ - if(res.data){ + looklook(data).then(res => { + if (res.data) { this.looklist = res.data } - console.log('详情',res) + console.log('详情', res) }) - looklooklook(row.id).then(resp=>{ - if( resp.data){ + looklooklook(row.id).then(resp => { + if (resp.data) { this.statisticsyou = resp.data } - console.log('优惠券详情统计',resp) + console.log('优惠券详情统计', resp) }) }, - listUserGrade(){ - listUserGrade().then(res=>{ - if(res.code == 200){ + listUserGrade() { + listUserGrade().then(res => { + if (res.code == 200) { this.userGradeList = res.data.records } }) }, // 获取油号名称 - getName(oilNameList,ids){ + getName(oilNameList, ids) { let name = "" let _this = this; ids.forEach(i => { oilNameList.forEach(item => { - if (item.id == i){ + if (item.id == i) { name += item.oilName + ","; } }) @@ -891,34 +1147,34 @@ export default { return name; }, // 查询油类 - getoiltypeliet(){ - getoiltype().then(res=>{ + getoiltypeliet() { + getoiltype().then(res => { console.log(res) }) }, // - getoilName(){ - getoilName().then(res=>{ + getoilName() { + getoilName().then(res => { console.log(res) this.oillist = res.data }) - getOilNameList().then( response => { + getOilNameList().then(response => { this.oilNameList = response.data; }) }, - swchange(e){ + swchange(e) { console.log(this.shopdata) }, // 请求实物 - getlistLJGoods(){ + getlistLJGoods() { this.tableDatasw = [] - listLJGoods(this.shiwu).then(res=>{ - if(res.code==200){ - console.log( res) + listLJGoods(this.shiwu).then(res => { + if (res.code == 200) { + console.log(res) this.dialogTableVisiblesw = true - this.tableDatasw = res.data.records + this.tableDatasw = res.data.records this.stotal = res.data.total @@ -926,71 +1182,71 @@ export default { }) }, // 请求兑换券 - getlistExchange(){ + getlistExchange() { this.tableDatadh = [] - listExchange(this.duihuanquan).then(res=>{ - if(res.code==200){ + listExchange(this.duihuanquan).then(res => { + if (res.code == 200) { this.dialogTableVisibledh = true - this.tableDatadh = res.data.records + this.tableDatadh = res.data.records this.dtotal = res.data.total } }) }, // 请求优惠券 - getlistFavorable(){ - this.tableData = [] - listFavorable(this.youhuiquan).then(res=>{ - if(res.code == 200){ + getlistFavorable() { + this.tableData = [] + listFavorable(this.youhuiquan).then(res => { + if (res.code == 200) { this.dialogTableVisible = true - this.tableData = res.data.records + this.tableData = res.data.records this.ytotal = res.data.total } }) }, // 实物选择处理 - shwdata(){ + shwdata() { this.dialogTableVisiblesw = false - if(this.pdswidlist.indexOf( this.shopdata.goodsId.id)>-1 ){ + if (this.pdswidlist.indexOf(this.shopdata.goodsId.id) > -1) { this.$message.error("该商品已存在") return } - this.pdswidlist.push( this.shopdata.goodsId.id,) + this.pdswidlist.push(this.shopdata.goodsId.id,) let data = { activeGift: 4, - goodsIds : this.shopdata.goodsId.id, + goodsIds: this.shopdata.goodsId.id, goodsName: this.shopdata.goodsId.name, - goodsTotal:this.shopdata.count + goodsTotal: this.shopdata.count } this.form.shiwudata.push(data) - console.log( this.form.shiwudata) + console.log(this.form.shiwudata) this.shopdata = [] }, // 兑换券券列表选择 - Favorabledata(row){ + Favorabledata(row) { this.dialogTableVisibledh = false - if(this.pddhidlist.indexOf(row.id)>-1 ){ + if (this.pddhidlist.indexOf(row.id) > -1) { this.$message.error("该兑换卡券已存在") return } this.pddhidlist.push(row.id) console.log(row) - let data ={ + let data = { activeGift: 2, //活动奖品 0:赠送积分1:赠送优惠券 2. 赠送兑换券 3:赠送成长值 4. 赠送实物 goodsIds: "", //商品id - goodsName:"" , //商品名称 + goodsName: "", //商品名称 goodsTotal: "", //商品数量 - vouchersId:row.id, //券id - giftCardName:row.name, //赠送卡券名称 + vouchersId: row.id, //券id + giftCardName: row.name, //赠送卡券名称 giftCardType: row.type, //券类型 validityZero: null, validityOne: null, - validityTwo:null, - validity:row.validity, + validityTwo: null, + validity: row.validity, giftCardDetail: row.cardDetail, //券详情 giftCardTime: row.validity, //券有效期 giftCardTotal: 1, //券数量 @@ -1001,27 +1257,27 @@ export default { this.$message.success("新增成功") }, // 优惠券列表选择 - chosedata(row){ + chosedata(row) { this.dialogTableVisible = false - if(this.pdidlist.indexOf(row.id)>-1 ){ + if (this.pdidlist.indexOf(row.id) > -1) { this.$message.error("该优惠卡券已存在") return } this.pdidlist.push(row.id) - let data ={ + let data = { activeGift: 1, //活动奖品 0:赠送积分1:赠送优惠券 2. 赠送兑换券 3:赠送成长值 4. 赠送实物 goodsIds: "", //商品id - goodsName:"" , //商品名称 + goodsName: "", //商品名称 goodsTotal: "", //商品数量 - vouchersId:row.id, //券id - giftCardName:row.name, //赠送卡券名称 + vouchersId: row.id, //券id + giftCardName: row.name, //赠送卡券名称 giftCardType: row.discountType, //券类型 timeType: row.timeType, validityZero: row.validityZero, validityOne: row.validityOne, - validityTwo:row.validityTwo, + validityTwo: row.validityTwo, giftCardDetail: row.cardDetail, //券详情 giftCardTime: "", //券有效期 giftCardTotal: 1,//券数量 @@ -1035,50 +1291,50 @@ export default { }, // 优惠券删除 - deletedata(row){ - if(this.tableData1&&this.tableData1.length>0){ - let delIdx=-1; - for ( let item of this.tableData1) { - delIdx++; - if (item.id===row.id){ + deletedata(row) { + if (this.tableData1 && this.tableData1.length > 0) { + let delIdx = -1; + for (let item of this.tableData1) { + delIdx++; + if (item.id === row.id) { break } } - this.pdidlist.splice(delIdx,1); - this.tableData1.splice(delIdx,1); + this.pdidlist.splice(delIdx, 1); + this.tableData1.splice(delIdx, 1); } }, // 兑换券删除 - deletedhdata(row){ - if(this.tableDatas&&this.tableDatas.length>0){ - let delIdx=-1; - for ( let item of this.tableDatas) { + deletedhdata(row) { + if (this.tableDatas && this.tableDatas.length > 0) { + let delIdx = -1; + for (let item of this.tableDatas) { delIdx++; - if (item.id===row.id){ + if (item.id === row.id) { break } } - this.pddhidlist.splice(delIdx,1); - this.tableDatas.splice(delIdx,1); + this.pddhidlist.splice(delIdx, 1); + this.tableDatas.splice(delIdx, 1); } }, // 实物删除 - deleteswdata(row){ + deleteswdata(row) { - if( this.form.shiwudata&& this.form.shiwudata.length>0){ - let delIdx=-1; - for ( let item of this.form.shiwudata) { + if (this.form.shiwudata && this.form.shiwudata.length > 0) { + let delIdx = -1; + for (let item of this.form.shiwudata) { delIdx++; - if (item.id===row.id){ + if (item.id === row.id) { break } } - this.pdswidlist.splice(delIdx,1); - this.form.shiwudata.splice(delIdx,1); + this.pdswidlist.splice(delIdx, 1); + this.form.shiwudata.splice(delIdx, 1); } @@ -1086,11 +1342,11 @@ export default { // 取消按钮 cancel() { this.pdswidlist = [] - this.form.shiwudata= [] - this.pddhidlist= [] - this.tableDatas= [] - this.pdidlist= [] - this.form.tableDatas= [] + this.form.shiwudata = [] + this.pddhidlist = [] + this.tableDatas = [] + this.pdidlist = [] + this.form.tableDatas = [] this.open = false; this.reset(); }, @@ -1121,17 +1377,17 @@ export default { createBy: null, createTime: null, updateBy: null, - tableDatas:[], - shiwudata:[], + tableDatas: [], + shiwudata: [], updateTime: null, - activeConsumptionChildList:[] + activeConsumptionChildList: [] }; this.pdswidlist = [] - this.form.shiwudata= [] - this.pddhidlist= [] - this.tableDatas= [] - this.pdidlist= [] - this.form.tableDatas= [] + this.form.shiwudata = [] + this.pddhidlist = [] + this.tableDatas = [] + this.pdidlist = [] + this.form.tableDatas = [] this.resetForm("form"); }, /** 搜索按钮操作 */ @@ -1143,27 +1399,27 @@ export default { resetQuery() { this.queryParams = { pageNum: 1, - pageSize: 10, - chainStorId: null, - storeId: null, - name: null, - participationConditionMoney: null, - activeStartTime: null, - activeEndTime: null, - adaptOil: [], - adaptUserType: null, - memberType: null, - dieselUserLevel: null, - gasolineUserLevel: null, - naturalUserLevel: null, - paymentType: null, - participationCondition: null, - participationAcount: null, - limitAcount: null, - activeGift: [], - points: null, - status: null, - isonline: null, + pageSize: 10, + chainStorId: null, + storeId: null, + name: null, + participationConditionMoney: null, + activeStartTime: null, + activeEndTime: null, + adaptOil: [], + adaptUserType: null, + memberType: null, + dieselUserLevel: null, + gasolineUserLevel: null, + naturalUserLevel: null, + paymentType: null, + participationCondition: null, + participationAcount: null, + limitAcount: null, + activeGift: [], + points: null, + status: null, + isonline: null, } this.resetForm("queryForm"); this.handleQuery(); @@ -1171,7 +1427,7 @@ export default { // 多选框选中数据 handleSelectionChange(selection) { this.ids = selection.map(item => item.id) - this.single = selection.length!==1 + this.single = selection.length !== 1 this.multiple = !selection.length }, /** 新增按钮操作 */ @@ -1190,7 +1446,7 @@ export default { getActiveConsumption(id).then(response => { this.form = response.data; if (!response.data.activeGift) this.form.activeGift = "" - if(response.data.activeConsumptionChildList && response.data.activeConsumptionChildList.length >0){ + if (response.data.activeConsumptionChildList && response.data.activeConsumptionChildList.length > 0) { this.form.tableDatas = response.data.activeConsumptionChildList.filter(item => item.activeGift == '1') this.tableData1 = response.data.activeConsumptionChildList.filter(item => item.activeGift == '1') this.tableDatas = response.data.activeConsumptionChildList.filter(item => item.activeGift == '2') @@ -1201,7 +1457,7 @@ export default { this.title = "修改消费有礼活动"; }); }, - handleDeletexia(row){ + handleDeletexia(row) { // getActiveConsumption(row.id).then(response => { // // this.form = response.data; // let data = response.data @@ -1214,16 +1470,17 @@ export default { // // }); - this.$modal.confirm('确定下线此条修改消费有礼活动信息?').then(function() { - return editActiveConsumption({id:row.id,isonline:1}); + this.$modal.confirm('确定下线此条修改消费有礼活动信息?').then(function () { + return editActiveConsumption({id: row.id, isonline: 1}); }).then(() => { this.$modal.msgSuccess("下线成功"); this.open = false; this.getList(); - }).catch(() => {}); + }).catch(() => { + }); }, - qiyong(row){ - if(row.isonline == 1){ + qiyong(row) { + if (row.isonline == 1) { this.$message.error("下线不可进行操作") return } @@ -1239,8 +1496,8 @@ export default { }); }, - jinyong(row){ - if(row.isonline == 1){ + jinyong(row) { + if (row.isonline == 1) { this.$message.error("下线不可进行操作") return } @@ -1286,15 +1543,16 @@ export default { } }); }, - Deleteshan(row){ + Deleteshan(row) { - const ids = row.id || this.ids; - this.$modal.confirm('是否确认删除此项消费有礼活动?').then(function() { - return delActiveConsumption(ids); - }).then(() => { - this.getList(); - this.$modal.msgSuccess("删除成功"); - }).catch(() => {}); + const ids = row.id || this.ids; + this.$modal.confirm('是否确认删除此项消费有礼活动?').then(function () { + return delActiveConsumption(ids); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("删除成功"); + }).catch(() => { + }); }, /** 删除按钮操作 */ @@ -1309,18 +1567,48 @@ export default { }; diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/controller/ActiveConsumptionController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/controller/ActiveConsumptionController.java index 8edf9843f..4b60ef6fe 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/controller/ActiveConsumptionController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/controller/ActiveConsumptionController.java @@ -110,6 +110,25 @@ public class ActiveConsumptionController extends BaseController { return getSuccessResult(this.activeConsumptionService.add(activeConsumptionDTO)); } + /** + * 新增数据 + * + * @param activeConsumption 实体对象 + * @return 新增结果 + */ + @PostMapping("add") + public ResponseObject add(@RequestBody ActiveConsumption activeConsumption) { + try { + SysLog sysLog =new SysLog(); + sysLog.setSystemName("2"); + sysLog.setMoudle("营销中心"); + sysLog.setContent("新增名称为"+activeConsumption.getName()+"消费有礼活动"); + sysLogService.saveVo(sysLog); + }catch (Exception ignored){} + + return getSuccessResult(this.activeConsumptionService.insertActiveConsumption(activeConsumption)); + } + /** * 修改数据 * @@ -219,5 +238,15 @@ public class ActiveConsumptionController extends BaseController { return getSuccessResult(this.activeConsumptionChildService.detailCount(id)); } + /** + * 统计 + * + * @return 单条数据 + */ + @GetMapping("/getInfo") + public ResponseObject selectByStoreId() { + return getSuccessResult(this.activeConsumptionService.selectByStoreId()); + } + } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumption.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumption.java index c39afdc2e..e56f749e5 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumption.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumption.java @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; +import java.util.List; /** * 消费有礼活动(ActiveConsumption)表实体类 @@ -36,10 +37,10 @@ public class ActiveConsumption extends Model { //满足金额 private Double participationConditionMoney; //活动开始时间 - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date activeStartTime; //活动结束时间 - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date activeEndTime; //适用油品0:92# 1: 95# 2:98# 3:0# 4:-10# 5: LNG 6;CNG 7:京92# 8:京95# 9:京0# private String adaptOil; @@ -72,15 +73,76 @@ public class ActiveConsumption extends Model { //创建者 private String createBy; //创建时间 - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createTime; //更新者 private String updateBy; //更新时间 - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date updateTime; //描述信息 @TableField(exist = false) private String exchangeFrom; - } + /** + *活动时间类型:0永久有效;1自定义 + */ + private String activityTimeType; + /** + *活动时间前 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date activityTimeFront; + /** + *活动时间后 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date activityTimeAfter; + /** + *适用时间段类型:0每周、1每月 + */ + private String suitTimeSlotType; + /** + *适用时间段:周/月 + */ + private String suitDate; + /** + *适用时间段前 + */ + @JsonFormat(pattern = "HH:mm", timezone = "GMT+8") + private Date suitTimeSlotFront; + /** + *适用时间段后 + */ + @JsonFormat(pattern = "HH:mm", timezone = "GMT+8") + private Date suitTimeSlotAfter; + /** + *会员标签id + */ + private String userLabelIds; + /** + *每人每天参与上限 + */ + private String everyDayCeiling; + /** + *每人每月参与上限 + */ + private Integer monthlyCeiling; + /** + *每人累计参与上限 + */ + private Integer accumulateCeiling; + /** + *通知内容 + */ + private String noticeContent; + /** + *活动详情 + */ + private String activityDetails; + /** + * 活动奖品子表信息 + */ + @TableField(exist = false) + private List activityPrize; +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumptionChild.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumptionChild.java index a3da2c07c..369f0370f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumptionChild.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumptionChild.java @@ -86,4 +86,20 @@ public class ActiveConsumptionChild { */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") private Date updateTime; + /** + *订单类型:0订单金额、1实收金额、3加油升数 + */ + private String orderType; + /** + *消费金额 + */ + private String consumeAmount; + /** + *赠送积分 + */ + private String givePoints; + /** + *赠送成长值 + */ + private String giveGrowthValue; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/ActiveConsumptionService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/ActiveConsumptionService.java index 4d35a1e1c..d2c049180 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/ActiveConsumptionService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/ActiveConsumptionService.java @@ -63,5 +63,13 @@ public interface ActiveConsumptionService extends IService { * @return */ List selectAllApplet(ActiveConsumption activeConsumption); + + /** + * 根据storeId查询消费有礼信息 + * @return + */ + ActiveConsumption selectByStoreId(); + + int insertActiveConsumption(ActiveConsumption activeConsumption); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionServiceImpl.java index 427f4ab1c..38b921c4c 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionServiceImpl.java @@ -2,6 +2,7 @@ package com.fuint.business.marketingActivity.activeConsumption.service.impl; import cn.hutool.core.util.ObjectUtil; 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; @@ -109,6 +110,9 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl(); + queryWrapper.eq("store_id",nowAccountInfo.getStoreId()); + ActiveConsumption activeConsumption = baseMapper.selectOne(queryWrapper); + List activeConsumptionChildren = activeConsumptionChildService.selectList(activeConsumption.getId()); + activeConsumption.setActivityPrize(activeConsumptionChildren); + return activeConsumption; + } + + @Override + public int insertActiveConsumption(ActiveConsumption activeConsumption) { + ActiveConsumption activeConsumption1 = selectByStoreId(); + if (ObjectUtil.isNotEmpty(activeConsumption1)){ + return 0; + } + int row = baseMapper.insert(activeConsumption); + activeConsumption1 = selectByStoreId(); + if (ObjectUtil.isNotEmpty(activeConsumption.getActivityPrize())){ + for (ActiveConsumptionChild activeConsumptionChild : activeConsumption.getActivityPrize()) { + activeConsumptionChild.setActiveConsumptionId(activeConsumption1.getId()); + activeConsumptionChildService.save(activeConsumptionChild); + } + } + return row; + } + /** * 数组转字符串 * @param array diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/controller/ActiveNewlywedsController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/controller/ActiveNewlywedsController.java index 1b6462744..de2ac2323 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/controller/ActiveNewlywedsController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/controller/ActiveNewlywedsController.java @@ -194,5 +194,10 @@ public class ActiveNewlywedsController extends BaseController { }catch (Exception ignored){} return getSuccessResult(activeNewlywedsChildService.removeByIds(idList)); } + + @GetMapping("getInfo") + public ResponseObject selectByStoreId(){ + return getSuccessResult(activeNewlywedsService.selectByStoreId()); + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/entity/ActiveNewlyweds.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/entity/ActiveNewlyweds.java index 036fe30a2..b1aafcb19 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/entity/ActiveNewlyweds.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/entity/ActiveNewlyweds.java @@ -3,11 +3,15 @@ package com.fuint.business.marketingActivity.activeNewlyweds.entity; import java.util.Date; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.activerecord.Model; import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; import java.io.Serializable; +import java.util.List; /** * 新人有礼活动(ActiveNewlyweds)表实体类 @@ -16,6 +20,8 @@ import java.io.Serializable; * @since 2023-11-13 13:15:58 */ @SuppressWarnings("serial") +@Data +@TableName("active_newlyweds") public class ActiveNewlyweds extends Model { //主键id @TableId(type = IdType.AUTO) @@ -26,11 +32,13 @@ public class ActiveNewlyweds extends Model { private Integer storeId; //活动名称 private String name; + //活动时间类型:0永久有效;1自定义 + private String activeTimeType; //活动开始时间 - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date activeStartTime; //活动结束时间 - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date activeEndTime; //有礼奖励 0:优惠券 1:兑换券 2:成长值 3:积分 private String courtesyReward; @@ -51,13 +59,23 @@ public class ActiveNewlyweds extends Model { //创建者 private String createBy; //创建时间 - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createTime; //更新者 private String updateBy; //更新时间 - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date updateTime; + //通知内容 + private String noticeContent; + //活动详情 + private String activityDetails; + + /** + * 优惠券列表信息 + */ + @TableField(exist = false) + private List couponList; public String getActiveCode() { return activeCode; @@ -212,5 +230,5 @@ public class ActiveNewlyweds extends Model { protected Serializable pkVal() { return this.id; } - } +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/entity/ActiveNewlywedsChild.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/entity/ActiveNewlywedsChild.java index 43495c3a5..f71b29383 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/entity/ActiveNewlywedsChild.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/entity/ActiveNewlywedsChild.java @@ -4,6 +4,7 @@ import java.util.Date; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.activerecord.Model; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; @@ -18,6 +19,7 @@ import java.io.Serializable; */ @SuppressWarnings("serial") @Data +@TableName("active_newlyweds_child") public class ActiveNewlywedsChild extends Model { //主键id @TableId(type = IdType.AUTO) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/ActiveNewlywedsChildService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/ActiveNewlywedsChildService.java index 6ce345953..ac5111770 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/ActiveNewlywedsChildService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/ActiveNewlywedsChildService.java @@ -3,6 +3,8 @@ package com.fuint.business.marketingActivity.activeNewlyweds.service; import com.baomidou.mybatisplus.extension.service.IService; import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlywedsChild; +import java.util.List; + /** * 新人有礼活动子表(ActiveNewlywedsChild)表服务接口 * @@ -10,6 +12,11 @@ import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlywe * @since 2023-11-13 13:17:14 */ public interface ActiveNewlywedsChildService extends IService { - + /** + * 根据新人有礼id查询子表列表信息 + * @param activeNewlywedsId + * @return + */ + List selectByActiveId(Integer activeNewlywedsId); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/ActiveNewlywedsService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/ActiveNewlywedsService.java index ab91bc2e0..a5094e2c2 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/ActiveNewlywedsService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/ActiveNewlywedsService.java @@ -64,5 +64,11 @@ public interface ActiveNewlywedsService extends IService { * @return */ List selectApplet(ActiveConsumption activeConsumption); + + /** + * 根据店铺id查询新人有礼信息 + * @return + */ + ActiveNewlyweds selectByStoreId(); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsChildServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsChildServiceImpl.java index deac2b1cd..cb9f16c72 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsChildServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsChildServiceImpl.java @@ -1,12 +1,15 @@ package com.fuint.business.marketingActivity.activeNewlyweds.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlywedsChild; import com.fuint.business.marketingActivity.activeNewlyweds.mapper.ActiveNewlywedsChildMapper; import com.fuint.business.marketingActivity.activeNewlyweds.service.ActiveNewlywedsChildService; import org.springframework.stereotype.Service; +import java.util.List; + /** * 新人有礼活动子表(ActiveNewlywedsChild)表服务实现类 * @@ -16,5 +19,11 @@ import org.springframework.stereotype.Service; @Service("activeNewlywedsChildService") public class ActiveNewlywedsChildServiceImpl extends ServiceImpl implements ActiveNewlywedsChildService { + @Override + public List selectByActiveId(Integer activeNewlywedsId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("active_newlyweds_id",activeNewlywedsId); + return baseMapper.selectList(queryWrapper); + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsServiceImpl.java index d8004d83e..d54c128a0 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsServiceImpl.java @@ -2,6 +2,7 @@ package com.fuint.business.marketingActivity.activeNewlyweds.service.impl; import cn.hutool.core.util.ObjectUtil; 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; @@ -81,6 +82,10 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl(); + queryWrapper.eq("store_id",TokenUtil.getNowAccountInfo().getStoreId()); + ActiveNewlyweds activeNewlyweds = baseMapper.selectOne(queryWrapper); + if (ObjectUtil.isNotEmpty(activeNewlyweds)) { + List activeNewlywedsChildren = activeNewlywedsChildService.selectByActiveId(activeNewlyweds.getId()); + activeNewlyweds.setCouponList(activeNewlywedsChildren); + } + return activeNewlyweds; + } + /** * 数组转字符串 * @param array