From 09fd7d1e0491207600ac7f3d6fe781b7ac30e4e0 Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Thu, 7 Mar 2024 09:31:51 +0800 Subject: [PATCH] bug --- .../activeConsumption/index.vue | 21 ++++++++++++------- .../impl/ActiveConsumptionServiceImpl.java | 7 +++++-- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue b/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue index 82d54afc1..e5cbaba60 100644 --- a/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue +++ b/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue @@ -217,7 +217,7 @@
赠送卡券
新增
{ this.form = response.data; if(response.data.activeConsumptionChildList&&response.data.activeConsumptionChildList.length >1){ 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') this.form.shiwudata = response.data.activeConsumptionChildList.filter(item => item.activeGift == '4') } - this.open = true; this.title = "修改消费有礼活动"; }); @@ -1173,10 +1176,14 @@ export default { }, /** 提交按钮 */ submitForm() { - if (!this.form.tableDatas || this.form.tableDatas.length==0){ - this.form.tableDatas = [] - } - this.form.activeConsumptionChildList = this.form.tableDatas.concat(this.tableDatas, this.form.shiwudata); + // if (!this.form.tableDatas || this.form.tableDatas.length==0){ + // this.form.tableDatas = [] + // } + // if (this.tableDatas && this.tableDatas.length>0 || this.form.shiwudata && this.form.shiwudata.length>0 ) + // this.form.activeConsumptionChildList = this.form.tableDatas.concat(this.tableDatas, this.form.shiwudata); + + // if (this.tableDatas && this.tableDatas.length>0 || this.form.shiwudata && this.form.shiwudata.length>0 ) + this.form.activeConsumptionChildList = this.tableData1.concat(this.tableDatas); console.log(this.form.activeConsumptionChildList) this.$refs["form"].validate(valid => { 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 0c1509303..9845b8ea9 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 @@ -125,6 +125,7 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl activeConsumptionChildList1 = activeConsumptionDTO.getActiveConsumptionChildList(); if (CollectionUtils.isNotEmpty(activeConsumptionChildList1)){ activeConsumptionChildList1.stream().map(s ->{ - s.setActiveConsumptionId(activeConsumption.getId()); + if (ObjectUtil.isNotEmpty(s)) s.setActiveConsumptionId(activeConsumption.getId()); return s; }).collect(Collectors.toList()); - update = activeConsumptionChildService.saveBatch(activeConsumptionChildList1); + if (ObjectUtil.isNotEmpty(activeConsumptionChildList1)) + update = activeConsumptionChildService.saveBatch(activeConsumptionChildList1); } return update; }