From c71ddb7e82b7069787b0fa2b56cd235158438e75 Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Thu, 29 Feb 2024 18:06:34 +0800 Subject: [PATCH 01/13] bug --- .../fuyou/service/impl/FyPayServiceImpl.java | 19 +++-- .../service/IntegralSettingsService.java | 6 ++ .../impl/IntegralSettingsServiceImpl.java | 65 ++++++++++++++++ .../business/member/utils/QrCodeUtils.java | 4 +- .../business/order/entity/CashierOrder.java | 4 + .../order/mapper/xml/OilOrderMapper.xml | 7 +- .../service/impl/OilOrderServiceImpl.java | 8 +- .../views/cashier/NewComponents/homeindex.vue | 75 ++++++++++--------- .../cashier/orderComponents/order_Cashier.vue | 1 + gasStation-uni/pagesMy/VIP/vip.vue | 60 ++++++++------- 10 files changed, 172 insertions(+), 77 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java index 96ffdcdac..4429da76e 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java @@ -13,6 +13,7 @@ import com.fuint.api.fuyou.util.Utils; import com.fuint.business.commission.service.StaffCommissionService; import com.fuint.business.integral.entity.IntegralOrders; import com.fuint.business.integral.service.IntegralOrdersService; +import com.fuint.business.integral.service.IntegralSettingsService; import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord; import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService; import com.fuint.business.marketingActivity.cardFule.entity.CardFuelRecord; @@ -51,6 +52,8 @@ public class FyPayServiceImpl implements FyPayService { private StaffCommissionService staffCommissionService; @Autowired private MerchantConfigRecordService merchantConfigRecordService; + @Resource + private IntegralSettingsService integralSettingsService; /** * 条码支付 @@ -194,14 +197,16 @@ public class FyPayServiceImpl implements FyPayService { oilOrder.setTankId(tankId); oilOrderService.addOilTracks(oilOrder, oilOrder.getStoreId()); } + + if (ObjectUtil.isNotEmpty(oilOrder.getUserId())) integralSettingsService.refuelPoints(oilOrder); // 修改优惠券使用状态 - if (oilOrder.getCouponId()!=null){ - CardFavorableRecord byId = cardFavorableRecordService.getById(oilOrder.getCouponId()); - if (!ObjectUtil.isEmpty(byId)){ - byId.setStatus("1"); - cardFavorableRecordService.updateById(byId); - } - } +// if (oilOrder.getCouponId()!=null){ +// CardFavorableRecord byId = cardFavorableRecordService.getById(oilOrder.getCouponId()); +// if (!ObjectUtil.isEmpty(byId)){ +// byId.setStatus("1"); +// cardFavorableRecordService.updateById(byId); +// } +// } } if (!ObjectUtil.isEmpty(goodsOrder)){ // 商品订单 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/IntegralSettingsService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/IntegralSettingsService.java index d36e7cd1b..bb070f50e 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/IntegralSettingsService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/IntegralSettingsService.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.integral.entity.IntegralGift; import com.fuint.business.integral.entity.IntegralSettings; +import com.fuint.business.order.entity.OilOrder; import io.lettuce.core.dynamic.annotation.Param; @@ -69,4 +70,9 @@ public interface IntegralSettingsService { IntegralSettings signInFunction(IntegralSettings integralSettings); + /** + * 加油赠送积分 + * @param order + */ + void refuelPoints(OilOrder order); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralSettingsServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralSettingsServiceImpl.java index 2f2a74022..7debd205d 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralSettingsServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralSettingsServiceImpl.java @@ -15,6 +15,7 @@ import com.fuint.business.integral.mapper.IntegralDetailMapper; import com.fuint.business.integral.mapper.IntegralSettingsMapper; import com.fuint.business.integral.service.IntegralDetailService; import com.fuint.business.integral.service.IntegralSettingsService; +import com.fuint.business.order.entity.OilOrder; import com.fuint.business.petrolStationManagement.entity.OilNumber; import com.fuint.business.petrolStationManagement.mapper.OilNumberMapper; import com.fuint.business.storeInformation.entity.LJStore; @@ -107,6 +108,7 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService { refuelConsumptionAmountMap.put("oilName", oilNumber.getOilName() + oilNumber.getOilType()); refuelConsumptionAmountMap.put("amount", 0); refuelConsumptionAmountMap.put("integral", 0); + refuelConsumptionAmountMap.put("oilNameId", oilNumber.getId()); refuelConsumptionAmountList.add(refuelConsumptionAmountMap); } String refuelConsumptionAmount = JSON.toJSONString(refuelConsumptionAmountList); @@ -299,6 +301,69 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService { return null; } + @Override + public void refuelPoints(OilOrder order) { + IntegralSettings integralSettings = integralSettingsMapper.getByStoreId(order.getStoreId()); + if (ObjectUtil.isNotEmpty(integralSettings) && integralSettings.getRefuelPointsRules()==0 + && integralSettings.getRefuelPointsFunction() ==0){ + if (integralSettings.getRefuelSceneType()==0){ +// 按金额 + if (integralSettings.getRefuelAmountType()==0){ +// 按订单金额 + countPoints(integralSettings,order.getOils(),order.getOrderAmount(),order.getUserId()); + }else { +// 按实付金额 + if (integralSettings.getRefuelValueParticipation()==0){ +// 储值金额不参与 + countPoints(integralSettings,order.getOils(),order.getPayAmount(),order.getUserId()); + }else { +// 储值金额参与 + countPoints(integralSettings,order.getOils(),order.getPayAmount()+order.getBalanceAmount(),order.getUserId()); + } + } + }else if (integralSettings.getRefuelSceneType()==1){ +// 按实付金额 + countPoints(integralSettings,order.getOils(),order.getPayAmount()+order.getBalanceAmount(),order.getUserId()); + } + } + } + + /** + * 计算赠送积分 + * @param integralSettings + * @param oilId 油品id + * @param amount 消费金额 + * @param userId 用户id + */ + private void countPoints(IntegralSettings integralSettings,String oilId,Double amount,Integer userId){ + LJStore store = iljStoreService.selectStoreByStoreId(integralSettings.getStoreId()); + UserBalance balance = userBalanceService.selectUserBalance(userId, store.getChainStoreId()); + if (ObjectUtil.isNotEmpty(balance)) { + if (integralSettings.getRefuelSceneRules()==0) { +// 通用规则 + if (integralSettings.getRefuelFuelAmount() <= amount) { + Integer points = balance.getPoints(); + balance.setPoints(points+integralSettings.getRefuelPoints()); + } + } else { +// 油品区分 + JSONArray jsonArray = JSONArray.parseArray(integralSettings.getRefuelConsumptionAmount()); + for (int i = 0;i and order_status = #{order.orderStatus} - - and order_status = 'paid' and remark is null or remark = '' and order_status = 'paid' - and pay_type = #{order.payType} + + and order_status = 'paid' and remark is null and store_id = #{order.storeId} + or remark = '' and order_status = 'paid' and store_id = #{order.storeId} + order by create_time desc diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java index 2afe2deb1..b5e5041b8 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java @@ -18,6 +18,7 @@ import com.fuint.business.convenienceSore.entity.LJGoods; import com.fuint.business.convenienceSore.entity.SaleDetail; import com.fuint.business.convenienceSore.service.LJGoodsService; import com.fuint.business.convenienceSore.service.SaleDetailService; +import com.fuint.business.integral.service.IntegralSettingsService; import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscountChild; import com.fuint.business.marketingActivity.activeDiscount.service.ActiveDiscountService; import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountVO; @@ -114,6 +115,8 @@ public class OilOrderServiceImpl extends ServiceImpl i private ActiveFullminusService activeFullminusService; @Resource private ActiveDiscountService activeDiscountService; + @Resource + private IntegralSettingsService integralSettingsService; @Override public IPage selectOilOrderList(Page page, OilOrder order) { @@ -487,6 +490,7 @@ public class OilOrderServiceImpl extends ServiceImpl i cashierOrder.setOilDiscountAmount(oilDiscount); cashierOrder.setTerminal(terminal); cashierOrder.setPayType(payType); + cashierOrder.setAfterDiscountAmount(oilAmount+goodsAmount-oilDiscount-goodsDiscount); // 如果金额不等于0调用第三方支付接口 if (!map.get("allAmount").equals("0") && !map.get("payType").equals("CASH")){ @@ -521,7 +525,6 @@ public class OilOrderServiceImpl extends ServiceImpl i // throw new RuntimeException("支付失败"); } }else { - cashierOrder.setPayAmount(oilAmount+goodsAmount-oilDiscount-goodsDiscount); this.insertAllOrderInfo(orderNo,storeId,oilAmount+goodsAmount,Double.valueOf(map.get("allAmount")),payType,userId,"PC","6","paid"); } @@ -531,6 +534,7 @@ public class OilOrderServiceImpl extends ServiceImpl i orders.put("oilOrder",oilOrder2); if (oilOrder2.getOrderStatus().equals("paid")){ cashierOrder.setPayTime(new Date()); + if (ObjectUtil.isNotEmpty(oilOrder2.getUserId())) integralSettingsService.refuelPoints(oilOrder2); } cashierOrder.setOilOrderId(oilOrder2.getId()); } @@ -1221,6 +1225,7 @@ public class OilOrderServiceImpl extends ServiceImpl i } this.updateOilOrder(oilOrder); if (oilOrder.getOrderStatus().equals("paid")) { + if (ObjectUtil.isNotEmpty(oilOrder.getUserId())) integralSettingsService.refuelPoints(oilOrder); this.updateCardAndActiveById(oilOrder.getStoreId(), oilOrder.getUserId(), oilOrder.getActiveId(), oilOrder.getCouponId(), oilOrder.getActiveType(), oilOrder.getOrderAmount(), Integer.valueOf(oilOrder.getOils())); } @@ -1268,6 +1273,7 @@ public class OilOrderServiceImpl extends ServiceImpl i // oilOrder.setPayAmount(oilOrder.getOrderAmount()-oilOrder.getDiscountAmount()); oilOrder.setOrderStatus(status); if (status.equals("paid")){ + if (ObjectUtil.isNotEmpty(oilOrder.getUserId())) integralSettingsService.refuelPoints(oilOrder); oilOrder.setPayTime(new Date()); CardValueChildOrder cardValueChildOrder = cardValueChildOrderService.selectCardValueChildOrderByOrderNo(orderNo); if (ObjectUtil.isNotEmpty(cardValueChildOrder)){ diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue index 9e8d5e687..a149b325a 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue @@ -120,17 +120,17 @@
-¥{{ oilDiscount.toFixed(2) }}
-
+
囤油卡 -
+
({{ item.type }}卡 - 余额:{{ item.refuelMoney }}L) + 余额:{{ item.refuelMoney ? item.refuelMoney : 0.00 }}L)
- {{ consumeRefuelMoney.toFixed(2) }}L
@@ -573,7 +573,7 @@
{{ item.type }}卡 - 余额:{{ item.refuelMoney }}L; + 余额:{{ item.refuelMoney ? item.refuelMoney : 0.00 }}L;
@@ -918,11 +918,7 @@ - +
已选油品 {{ getName(oilNameList,form.oilName) }} @@ -1427,7 +1423,7 @@ {value:"¥300"}, ], // 会员信息 - member:{}, + member:{id:""}, // 会员等级信息 grade:{}, // 会员列表信息 @@ -1631,7 +1627,7 @@ this.getStaff(); this.getList(); this.getCouponList(); - this.getUnitList(); + // this.getUnitList(); }, directives: { // 注册一个局部的自定义指令 v-focus @@ -1673,7 +1669,6 @@ // realName: data.realName, // staffMobile: data.staffMobile, // }, - // console.log('Received data in parent:', data); this.cardFuelDieselForm.mtStaffId = data.mtStaffId this.cardFuelDieselForm.realName = data.realName @@ -1706,9 +1701,7 @@ await getCardValueListApi(quy).then(res => { this.cardValueList = res.data.records; this.cardValueList.sort((a, b) => a.rechargeBalance - b.rechargeBalance); - // console.log("this.grade.name",this.grade) }) - // console.log("this.cardValueList", this.grade) if (this.cardValueList.length > 0) { // 过滤 @@ -1761,7 +1754,6 @@ }, selectOilType(status, oilType) { this.tabOilType = oilType; - // console.log("453",oilType) this.tabOilTypeClick(oilType); }, // 会员充值 @@ -1788,7 +1780,6 @@ // this.cardValueForm.amount = null this.$set(this.cardValueForm, 'amount', data); - // console.log("data17.16", this.cardValueForm.amount) if (!data) { this.cardValueForm.amount = '' @@ -1936,7 +1927,6 @@ this_.isPay = false; this_.isPaySuccess = false; this_.isAwait = true; - console.log("t3") }, 15000) } else if (this.flag === 2) { @@ -1955,7 +1945,6 @@ actualPayment = this.authCode makeChange = this.seekZero } - // console.log("cardFuelDieselForm",this.cardFuelDieselForm) this.cardFuelDieselForm.mtUserId = userForm.id this.cardFuelDieselForm.name = userForm.name this.cardFuelDieselForm.mobile = userForm.mobile @@ -1963,7 +1952,6 @@ this.cardFuelDieselForm.actualPayment = actualPayment this.cardFuelDieselForm.makeChange = makeChange - // console.log("this.cardFuelDieselForm",this.cardFuelDieselForm) let id; @@ -2027,7 +2015,6 @@ }, // 选择余额充值金额 rechargeCard(index, item) { - // console.log("index", index) // this.cardValueForm.amount = null, this.cardValueForm.rechargeType = 0 @@ -2061,7 +2048,6 @@ this.cardValueForm.percentageCommissions = file.percentageCommissions this.cardValueForm.amountCommission = file.amountCommission - // console.log("file.royaltyType ", file.royaltyType ) // 计算员工提成金额 if (file.royaltyType === "3") { @@ -2077,7 +2063,6 @@ }, // 根据油品过滤查询存油卡 async tabOilTypeClick(data) { - // console.log("aaaaaaaaaaaaaa",data) await this.getCardFuelDieselList() this.cardFuelDieselList = this.sourceCardFuelDieselList.filter(item => { @@ -2145,7 +2130,6 @@ let file = {} // 拿到金额 file = this.cardFuelDieselList[index] - // console.log("file",file) this.cardFuelDieselForm.points = file.points this.cardFuelDieselForm.rechargeBalance = file.rechargeBalance this.cardFuelDieselForm.oilType = file.oilType @@ -2276,7 +2260,6 @@ // LODOP.ADD_PRINT_BARCODE(10,40,100,100,'QRCode','123456789'); // let preview = LODOP.PREVIEW(); - // console.log("preview",preview); LODOP.PRINT(); } }catch (e){ @@ -2290,7 +2273,6 @@ } //初始化打印函数 let LODOP = getLodop(); // 初始化打印 - console.log(LODOP) if (LODOP) { LODOP.PRINT_INIT(); var bodyStyle = ` diff --git a/fuintAdmin/src/api/EventMarketing/activeConsumption.js b/fuintAdmin/src/api/EventMarketing/activeConsumption.js index e6f22c120..9d8f1ae2d 100644 --- a/fuintAdmin/src/api/EventMarketing/activeConsumption.js +++ b/fuintAdmin/src/api/EventMarketing/activeConsumption.js @@ -78,7 +78,7 @@ export function updateActiveConsumption(data) { // 删除消费有礼活动 export function delActiveConsumption(id) { return request({ - url: '/business/marketingActivity/activeConsumption/' + id, + url: 'business/marketingActivity/activeConsumption/delById/' + id, method: 'delete' }) } diff --git a/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue b/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue index 9c5a34e8f..f478f9c63 100644 --- a/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue +++ b/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue @@ -71,18 +71,24 @@ @@ -98,11 +104,11 @@ - - - + + + + + + @@ -151,7 +165,7 @@ - + { this.form = response.data; - this.form.tableDatas = 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') + if(response.data.activeConsumptionChildList&&response.data.activeConsumptionChildList.length >1){ + this.form.tableDatas = 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 = "修改消费有礼活动"; }); @@ -1099,16 +1117,19 @@ export default { } }); }, - /** 删除按钮操作 */ - handleDelete(row) { - const ids = row.id || this.ids; - this.$modal.confirm('是否确认删除消费有礼活动编号为"' + ids + '"的数据项?').then(function() { - return delActiveConsumption(ids); - }).then(() => { - this.getList(); - this.$modal.msgSuccess("删除成功"); - }).catch(() => {}); + Deleteshan(row){ + + const ids = row.id || this.ids; + this.$modal.confirm('是否确认删除消费有礼活动编号为"' + ids + '"的数据项?').then(function() { + return delActiveConsumption(ids); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("删除成功"); + }).catch(() => {}); + }, + /** 删除按钮操作 */ + /** 导出按钮操作 */ handleExport() { this.download('business/marketingActivity/activeConsumption/export', { diff --git a/fuintAdmin/src/views/EventMarketing/activeNewlyweds/index.vue b/fuintAdmin/src/views/EventMarketing/activeNewlyweds/index.vue index bc56750d4..5834fabb6 100644 --- a/fuintAdmin/src/views/EventMarketing/activeNewlyweds/index.vue +++ b/fuintAdmin/src/views/EventMarketing/activeNewlyweds/index.vue @@ -181,78 +181,66 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -474,6 +462,7 @@ export default { points: null, growthValue: null, }, + activeFullminusList: [], // 表单参数 form: { id:1, @@ -508,11 +497,19 @@ export default { }; }, created() { + this.getList() // this.handleUpdate(); }, methods: { /** 查询新人有礼活动列表 */ getList() { + this.loading = true; + getActiveNewlyweds(1).then(res=>{ + this.activeFullminusList = res.data; + this.total = res.data.total; + console.log(res) + this.loading = false; + }) // this.loading = true; // listActiveNewlyweds(this.queryParams).then(response => { // this.activeNewlywedsList = response.data.records; From 223a1908f3d3f17a1dde8d160334750d266f32ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BD=90=E5=A4=A9=E5=A4=A7=E5=9C=A3?= <17615834396@163.com> Date: Fri, 1 Mar 2024 14:16:48 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E6=8E=A8=E8=8D=90=E6=9C=89=E7=A4=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ActiveConsumptionController.java | 14 ++++++++-- .../ActiveConsumptionChildServiceImpl.java | 22 ++++++++++++++++ .../impl/ActiveConsumptionServiceImpl.java | 2 +- .../impl/ActiveDiscountServiceImpl.java | 11 ++++++++ .../activeDiscount/vo/ActiveDiscountVO.java | 3 +++ .../impl/ActiveFullminusServiceImpl.java | 11 ++++++++ .../activeFullminus/vo/ActiveFullminusVO.java | 3 +++ .../CardExchangeRecordController.java | 12 ++++++--- .../CardFavorableRecordController.java | 9 +++++++ .../service/CardFavorableRecordService.java | 9 +++++++ .../impl/CardFavorableRecordServiceImpl.java | 26 +++++++++++++++++++ .../vo/CardFavorableCountVO.java | 7 +++++ .../userManager/mapper/LJUserMapper.java | 1 + .../userManager/mapper/xml/LJUserMapper.xml | 12 ++++++++- .../userManager/service/LJUserService.java | 1 + .../service/impl/LJUserServiceImpl.java | 11 ++++++++ .../business/userManager/vo/LJUserVo.java | 2 ++ 17 files changed, 149 insertions(+), 7 deletions(-) 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 60a4b32d7..46a4d68b7 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 @@ -111,14 +111,24 @@ public class ActiveConsumptionController extends BaseController { return getSuccessResult(this.activeConsumptionService.removeByIds(ids)); } + /** + * 删除数据 + * @param ids + * @return + */ + @DeleteMapping("delById/{ids}") + public ResponseObject delete(@PathVariable Long ids) { + return getSuccessResult(this.activeConsumptionService.removeById(ids)); + } + /** * 删除数据 * @param ids * @return */ @DeleteMapping("del") - public ResponseObject del(@RequestParam("ids") List ids) { - return getSuccessResult(activeConsumptionChildService.removeByIds(ids)); + public ResponseObject del(@RequestParam("ids") Long ids) { + return getSuccessResult(activeConsumptionChildService.removeById(ids)); } /** diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionChildServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionChildServiceImpl.java index 12896b250..a38d10b5f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionChildServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionChildServiceImpl.java @@ -6,6 +6,8 @@ import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsu import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumptionChild; import com.fuint.business.marketingActivity.activeConsumption.mapper.ActiveConsumptionChildMapper; import com.fuint.business.marketingActivity.activeConsumption.service.ActiveConsumptionChildService; +import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord; +import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService; import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord; import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService; import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableCountVO; @@ -31,6 +33,8 @@ public class ActiveConsumptionChildServiceImpl extends ServiceImpl selectList(Serializable id) { return activeConsumptionChildMapper.selectConsumptionChilds(id); @@ -72,6 +76,24 @@ public class ActiveConsumptionChildServiceImpl extends ServiceImpl queryWrappers = new LambdaQueryWrapper<>(); + queryWrappers.eq(CardExchangeRecord::getActiveId, id); + queryWrappers.eq(CardExchangeRecord::getStoreId, nowAccountInfo.getStoreId()); + List list = cardExchangeRecordService.list(queryWrappers); + for (CardExchangeRecord cardExchangeRecord : list) { + if (cardExchangeRecord.getStatus().equals("0")){ + as+=1; + }else { + bs+=1; + } + } + cardFavorableCountVO.setCounts(favorableRecords.size()); + cardFavorableCountVO.setCountEds(b); + cardFavorableCountVO.setCountLds(a); return cardFavorableCountVO; } } 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 e3adbedea..d70d1439e 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 @@ -197,9 +197,9 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl activeConsumptionChildList = activeConsumptionChildService.list(queryWrapper); + BeanUtils.copyProperties(consumption,activeConsumptionVO); if (CollectionUtils.isNotEmpty(activeConsumptionChildList)){ //封装VO返回 - BeanUtils.copyProperties(consumption,activeConsumptionVO); activeConsumptionVO.setParticipationConditionMoney(consumption.getParticipationConditionMoney().toString()); activeConsumptionVO.setDieselUserLevel(consumption.getDieselUserLevel().split(",")); activeConsumptionVO.setGasolineUserLevel(consumption.getGasolineUserLevel().split(",")); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeDiscount/service/impl/ActiveDiscountServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeDiscount/service/impl/ActiveDiscountServiceImpl.java index f4c53f31b..cfd8936a8 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeDiscount/service/impl/ActiveDiscountServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeDiscount/service/impl/ActiveDiscountServiceImpl.java @@ -17,6 +17,7 @@ import com.fuint.business.marketingActivity.activeDiscount.service.ActiveDiscoun import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountAppletVO; import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountPayVO; import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountVO; +import com.fuint.business.petrolStationManagement.entity.OilName; import com.fuint.business.petrolStationManagement.service.OilNameService; import com.fuint.business.store.service.StoreService; import com.fuint.business.userManager.service.LJUserGradeService; @@ -134,6 +135,16 @@ public class ActiveDiscountServiceImpl extends ServiceImpl getAdaptUserList(CardFavorableAdnUserDTO cardFavorableAdnUserDTO); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java index 44b1b4c03..5828c9b4f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java @@ -22,6 +22,7 @@ import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRe import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService; import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService; import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableRecordVO; +import com.fuint.business.marketingActivity.cardFavorable.vo.LJUserVos; import com.fuint.business.petrolStationManagement.service.OilNameService; import com.fuint.business.userManager.entity.LJUser; import com.fuint.business.userManager.service.LJUserService; @@ -366,5 +367,30 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl getAdaptUserList(CardFavorableAdnUserDTO cardFavorableAdnUserDTO) { + ArrayList ljUserVosList = new ArrayList<>(); + List gradeIds = cardFavorableAdnUserDTO.getGradeIds(); + for (Integer gradeId : gradeIds) { + LJUserVo ljUserVo = new LJUserVo(); + LJUserVos ljUserVos = new LJUserVos(); + ljUserVo.setGradeId(gradeId); + List userLists = userService.getUserCountList(ljUserVo); + if (CollectionUtils.isNotEmpty(userLists)){ + ljUserVos.setGradeName(userLists.get(0).getGradeName()); + ljUserVos.setCountAll(userLists.size()); + } + ljUserVo.setDays(cardFavorableAdnUserDTO.getDays()); + List userListss = userService.getUserLists(ljUserVo); + ljUserVos.setCount(userListss.size()); + + if (ObjectUtils.isNotEmpty(ljUserVos.getCountAll()) && ObjectUtils.isNotEmpty(ljUserVos.getCount()) && ljUserVos.getCountAll()!=0){ + ljUserVos.setRate(ljUserVos.getCount()/ljUserVos.getCountAll() + "%"); + } + ljUserVosList.add(ljUserVos); + } + return ljUserVosList; + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/vo/CardFavorableCountVO.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/vo/CardFavorableCountVO.java index fd31b433a..99525bfa2 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/vo/CardFavorableCountVO.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/vo/CardFavorableCountVO.java @@ -13,4 +13,11 @@ public class CardFavorableCountVO implements Serializable { private Integer count; private Integer countEd; private Integer countLd; + + /** + * 兑换券数量 + */ + private Integer counts; + private Integer countEds; + private Integer countLds; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/LJUserMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/LJUserMapper.java index 0441b1d42..636b9953c 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/LJUserMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/LJUserMapper.java @@ -93,4 +93,5 @@ public interface LJUserMapper extends BaseMapper { Integer userNum(Integer storeId); + List getUserCountList(LJUserVo user); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/LJUserMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/LJUserMapper.xml index cf2b354b5..24c6d2516 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/LJUserMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/LJUserMapper.xml @@ -86,7 +86,9 @@ LEFT JOIN mt_user_balance mub ON mu.id = mub.mt_user_id left join oil_order oo on mu.id = oo.user_id - oo.create_time <= DATE_SUB(NOW(), INTERVAL ${user.days} DAY) + + oo.create_time <= DATE_SUB(NOW(), INTERVAL ${user.days} DAY) + and mub.chain_store_id = #{user.chainStoreId} @@ -286,6 +288,14 @@ limit 1 + +