diff --git a/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue b/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue index 48acd5ea0..7b9b57b2f 100644 --- a/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue +++ b/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue @@ -394,7 +394,7 @@ label="券详情" width="100"> - 满{{scope.row.fullDeduction}}减 {{scope.row.discountAmount}}元 + 满{{scope.row.satisfiedAmount}}减 {{scope.row.discountAmount}}元 - 领券后立即生效,有效期 + 领券后立即生效,有效期 天 @@ -193,64 +193,27 @@ - 固定有效周期,固定开始日期 + 固定有效周期,固定开始日期 - 有效期 + 有效期 天 - 领券后第 + 领券后第 天生效 - 有效期 天 + 有效期 天 - - - - - - - - - - - 满减活动 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 9a3fd1986..faf9b2080 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 @@ -103,7 +103,11 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl select(Page page, ActiveConsumption activeConsumption) { //所属店铺id - activeConsumption.setStoreId(TokenUtil.getNowAccountInfo().getStoreId()); + if (ObjectUtils.isNotEmpty(activeConsumption.getStoreId())){ + activeConsumption.setStoreId(activeConsumption.getStoreId()); + }else { + activeConsumption.setStoreId(TokenUtil.getNowAccountInfo().getStoreId()); + } //查询活动及其兑换券 IPage activeConsumptionVOSIPage = activeConsumptionMapper.selectConsumptions(page, activeConsumption); List records = activeConsumptionVOSIPage.getRecords(); 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 a1d0c58e7..f4c53f31b 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 @@ -113,7 +113,11 @@ public class ActiveDiscountServiceImpl extends ServiceImpl select(); + List select(ActiveExchangeRecordDTO activeExchangeRecordDTO); /** * 优惠活动接口 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java index a4a2771f4..7e1923370 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java @@ -288,10 +288,12 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { * @return */ @Override - public List select() { + public List select(ActiveExchangeRecordDTO activeExchangeRecordDTO) { ArrayList activeAppletVOS = new ArrayList<>(); //消费有礼活动 - List activeConsumptionAppletVOS = activeConsumptionService.selectAllApplet(new ActiveConsumption()); + ActiveConsumption consumption = new ActiveConsumption(); + consumption.setStoreId(activeExchangeRecordDTO.getStoreId()); + List activeConsumptionAppletVOS = activeConsumptionService.selectAllApplet(consumption); if (CollectionUtils.isNotEmpty(activeConsumptionAppletVOS)){ ActiveAppletVO activeAppletVO = new ActiveAppletVO(); activeAppletVO.setName("消费有礼活动"); @@ -305,7 +307,9 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { activeAppletVOS.add(activeAppletVO); } //折扣营销 - List activeDiscountAppletVOS = activeDiscountService.selectAllApplet(new ActiveDiscount()); + ActiveDiscount activeDiscount = new ActiveDiscount(); + activeDiscount.setStoreId(activeExchangeRecordDTO.getStoreId()); + List activeDiscountAppletVOS = activeDiscountService.selectAllApplet(activeDiscount); if (CollectionUtils.isNotEmpty(activeDiscountAppletVOS)){ ActiveAppletVO activeAppletVO = new ActiveAppletVO(); activeAppletVO.setName("折扣营销活动"); @@ -319,7 +323,9 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { activeAppletVOS.add(activeAppletVO); } //满减营销 - List activeFullminusAppletVOS = activeFullminusService.selectAllApplet(new ActiveFullminus()); + ActiveFullminus activeFullminus = new ActiveFullminus(); + activeFullminus.setStoreId(activeExchangeRecordDTO.getStoreId()); + List activeFullminusAppletVOS = activeFullminusService.selectAllApplet(activeFullminus); if (CollectionUtils.isNotEmpty(activeFullminusAppletVOS)){ ActiveAppletVO activeAppletVO = new ActiveAppletVO(); activeAppletVO.setName("满减营销活动"); @@ -333,7 +339,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { activeAppletVOS.add(activeAppletVO); } //新人有礼 - ActiveNewlywedsAppletVO activeNewlywedsAppletVO = activeNewlywedsService.selectApplet(); + ActiveNewlywedsAppletVO activeNewlywedsAppletVO = activeNewlywedsService.selectApplet(consumption); if (ObjectUtils.isNotEmpty(activeNewlywedsAppletVO)){ ActiveAppletVO activeAppletVO = new ActiveAppletVO(); activeAppletVO.setName("新人有礼活动"); @@ -347,7 +353,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { activeAppletVOS.add(activeAppletVO); } //推荐有礼 - ActiveRecommendAppletVO activeRecommendAppletVO = activeRecommendService.selectApplet(); + ActiveRecommendAppletVO activeRecommendAppletVO = activeRecommendService.selectApplet(consumption); if (ObjectUtils.isNotEmpty(activeRecommendAppletVO)){ ActiveAppletVO activeAppletVO = new ActiveAppletVO(); activeAppletVO.setName("推荐有礼活动"); @@ -361,7 +367,9 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { activeAppletVOS.add(activeAppletVO); } //充值有礼 - List cardValueAppletVOS = cardValueService.selectAllApplet(new CardValue()); + CardValue cardValue = new CardValue(); + cardValue.setStoreId(activeExchangeRecordDTO.getStoreId()); + List cardValueAppletVOS = cardValueService.selectAllApplet(cardValue); if (CollectionUtils.isNotEmpty(cardValueAppletVOS)){ ActiveAppletVO activeAppletVO = new ActiveAppletVO(); activeAppletVO.setName("储值卡充值活动"); @@ -385,9 +393,9 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { @Override public PaymentActiveVO paymentActive(PaymentActiveDTO paymentActiveDTO) { PaymentActiveVO paymentActiveVO = new PaymentActiveVO(); - AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); - Integer storeId = nowAccountInfo.getStoreId(); + Integer storeId = paymentActiveDTO.getStoreId(); double amount = 0.0; + double fullAmount = 0.0; //折扣 List activeDiscountVOList = oilOrderMapper.selectActiveDiscount(storeId,paymentActiveDTO.getAmount()); if (CollectionUtils.isNotEmpty(activeDiscountVOList)){ @@ -395,10 +403,10 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { if (activeDiscountPayVO.getOilId().contains(paymentActiveDTO.getOilId().toString()) && activeDiscountPayVO.getAdaptUser().contains(paymentActiveDTO.getMtUserLevel().toString())){ if (activeDiscountPayVO.getDiscount() * activeDiscountPayVO.getAmount() > amount){ - amount = paymentActiveDTO.getAmount() - (activeDiscountPayVO.getDiscount() * activeDiscountPayVO.getAmount()); + amount = paymentActiveDTO.getAmount() - ((10-activeDiscountPayVO.getDiscount()) * activeDiscountPayVO.getAmount() * 0.1); paymentActiveVO.setActiveId(activeDiscountPayVO.getActiveId()); paymentActiveVO.setAmount(amount); - paymentActiveVO.setFavorableAmount(activeDiscountPayVO.getAmount()); + paymentActiveVO.setFavorableAmount((10-activeDiscountPayVO.getDiscount()) * activeDiscountPayVO.getAmount() * 0.1); } } } @@ -409,11 +417,15 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { for (ActiveDiscountPayVO activeDiscountPayVO : activeFuletVOList) { if (activeDiscountPayVO.getOilId().contains(paymentActiveDTO.getOilId().toString()) && activeDiscountPayVO.getAdaptUser().contains(paymentActiveDTO.getMtUserLevel().toString())){ - if (activeDiscountPayVO.getAmount() > amount){ - amount = paymentActiveDTO.getAmount() - activeDiscountPayVO.getAmount(); + //如果满足条件 + if (paymentActiveDTO.getAmount() >= activeDiscountPayVO.getAmount()){ + fullAmount = paymentActiveDTO.getAmount() - activeDiscountPayVO.getDiscount(); + if (amount > fullAmount){ + amount = paymentActiveDTO.getAmount() - fullAmount; paymentActiveVO.setActiveId(activeDiscountPayVO.getActiveId()); paymentActiveVO.setAmount(amount); - paymentActiveVO.setFavorableAmount(activeDiscountPayVO.getAmount()); + paymentActiveVO.setFavorableAmount(paymentActiveDTO.getAmount() - activeDiscountPayVO.getDiscount()); + } } } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeFullminus/service/impl/ActiveFullminusServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeFullminus/service/impl/ActiveFullminusServiceImpl.java index f150597d3..72d78116d 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeFullminus/service/impl/ActiveFullminusServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeFullminus/service/impl/ActiveFullminusServiceImpl.java @@ -108,7 +108,11 @@ public class ActiveFullminusServiceImpl extends ServiceImpl { * @return */ ActiveNewlywedsVO getOneById(Serializable id); + ActiveNewlywedsVO getOneByIdApplet(ActiveConsumption activeConsumption); /** * 修改数据 @@ -51,6 +53,6 @@ public interface ActiveNewlywedsService extends IService { * 查询单条数据(小程序端) * @return */ - ActiveNewlywedsAppletVO selectApplet(); + ActiveNewlywedsAppletVO selectApplet(ActiveConsumption activeConsumption); } 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 8705e5b80..7d0b740ad 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 @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumption; import com.fuint.business.marketingActivity.activeNewlyweds.controller.vo.ActiveNewlywedsAppletVO; import com.fuint.business.marketingActivity.activeNewlyweds.controller.vo.ActiveNewlywedsVO; import com.fuint.business.marketingActivity.activeNewlyweds.dto.ActiveNewlywedsDTO; @@ -182,6 +183,44 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(ActiveNewlyweds::getStoreId,storeId); + ActiveNewlyweds activeNewlyweds = getOne(lambdaQueryWrapper); + //获取兑换物品信息 + if (ObjectUtils.isNotEmpty(activeNewlyweds)){ + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ActiveNewlywedsChild::getActiveNewlywedsId,activeNewlyweds.getId()); + queryWrapper.orderByDesc(ActiveNewlywedsChild::getCreateTime); + List activeNewlywedsChildList = activeNewlywedsChildService.list(queryWrapper); + BeanUtils.copyProperties(activeNewlyweds,activeNewlywedsVO); + //封装VO返回 + activeNewlywedsVO.setCourtesyReward(activeNewlyweds.getCourtesyReward().split(",")); + if (CollectionUtils.isNotEmpty(activeNewlywedsChildList)){ + activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList); + }else { + ArrayList activeNewlywedsChildLists = new ArrayList<>(); + activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildLists); + } + }else { + ArrayList activeNewlywedsChildList = new ArrayList<>(); + activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList); + } + } + return activeNewlywedsVO; + } + /** * 修改数据 * @param activeNewlywedsDTO @@ -217,10 +256,10 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl { * @return */ ActiveRecommendVO getOneById(Serializable id); + ActiveRecommendVO getOneByIdApplet(ActiveConsumption activeConsumption); /** * 修改数据 @@ -41,6 +43,6 @@ public interface ActiveRecommendService extends IService { * 查询单条数据(小程序端) * @return */ - ActiveRecommendAppletVO selectApplet(); + ActiveRecommendAppletVO selectApplet(ActiveConsumption activeConsumption); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/impl/ActiveRecommendServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/impl/ActiveRecommendServiceImpl.java index 073a350dc..dc38f495f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/impl/ActiveRecommendServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/impl/ActiveRecommendServiceImpl.java @@ -3,6 +3,7 @@ package com.fuint.business.marketingActivity.activeRecommend.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumption; import com.fuint.business.marketingActivity.activeRecommend.dto.ActiveRecommendDTO; import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendChild; import com.fuint.business.marketingActivity.activeRecommend.mapper.ActiveRecommendMapper; @@ -125,6 +126,44 @@ public class ActiveRecommendServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(ActiveRecommend::getStoreId,storeId); + ActiveRecommend activeRecommend = getOne(lambdaQueryWrapper); + //获取兑换物品信息 + if (ObjectUtils.isNotEmpty(activeRecommend)){ + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ActiveRecommendChild::getActiveRecommendId,activeRecommend.getId()); + queryWrapper.orderByDesc(ActiveRecommendChild::getCreateTime); + List activeRecommendChildList = activeRecommendChildService.list(queryWrapper); + BeanUtils.copyProperties(activeRecommend,activeRecommendVO); + activeRecommendVO.setInviterGiftType(activeRecommend.getInviterGiftType().split(",")); + if (CollectionUtils.isNotEmpty(activeRecommendChildList)){ + activeRecommendVO.setActiveRecommendChildList(activeRecommendChildList); + }else { + ArrayList activeRecommendChildren = new ArrayList<>(); + activeRecommendVO.setActiveRecommendChildList(activeRecommendChildren); + } + }else { + ArrayList activeRecommendChildren = new ArrayList<>(); + activeRecommendVO.setActiveRecommendChildList(activeRecommendChildren); + } + } + return activeRecommendVO; + } + /** * 修改数据 * @param activeRecommendDTO @@ -161,10 +200,10 @@ public class ActiveRecommendServiceImpl extends ServiceImpl - insert into card_fuel_record(mt_user_id, name, mobile, mt_staff_id, real_name, staff_mobile, card_fuel_id, recharge_balance, income_litres, payment_type, remark, points, growth_value, royalty_type, percentage_commissions, amount_commission, create_by, create_time, update_by, update_time, pay_status, store_id, payment_no, type, oil_type,chain_store_id) - values (#{mtUserId}, #{name}, #{mobile}, #{mtStaffId}, #{realName}, #{staffMobile}, #{cardFuelId}, #{rechargeBalance}, #{incomeLitres}, #{paymentType}, #{remark}, #{points}, #{growthValue}, #{royaltyType}, #{percentageCommissions}, #{amountCommission}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{payStatus}, #{storeId}, #{paymentNo}, #{type}, #{oilType}, #{chainStoreId}) + insert into card_fuel_record(mt_user_id, name, mobile, mt_staff_id, real_name, staff_mobile, card_fuel_id, recharge_balance,lockup_price, income_litres,pay_amount, payment_type, remark, points, growth_value, royalty_type, percentage_commissions, amount_commission, create_by, create_time, update_by, update_time, pay_status, store_id, payment_no, type, oil_type,oil_name,chain_store_id) + values (#{mtUserId}, #{name}, #{mobile}, #{mtStaffId}, #{realName}, #{staffMobile}, #{cardFuelId}, #{rechargeBalance}, #{lockupPrice}, #{incomeLitres}, #{payAmount}, #{paymentType}, #{remark}, #{points}, #{growthValue}, #{royaltyType}, #{percentageCommissions}, #{amountCommission}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{payStatus}, #{storeId}, #{paymentNo}, #{type}, #{oilType},#{oilName}, #{chainStoreId}) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/impl/CardFuelRecordServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/impl/CardFuelRecordServiceImpl.java index 7246cda4c..e04fa9dbe 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/impl/CardFuelRecordServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/impl/CardFuelRecordServiceImpl.java @@ -36,9 +36,11 @@ import com.fuint.business.marketingActivity.cardValue.vo.CardValueVO; import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrders; import com.fuint.business.member.entity.LJStaff; import com.fuint.business.member.service.ILJStaffService; +import com.fuint.business.oilDepotConfiguration.entity.OilDepotConfig; import com.fuint.business.order.entity.CardBalanceChange; import com.fuint.business.order.entity.OilBalanceChange; import com.fuint.business.order.service.OilBalanceChangeService; +import com.fuint.business.petrolStationManagement.service.OilNameService; import com.fuint.business.userManager.entity.UserBalance; import com.fuint.business.userManager.mapper.LJUserMapper; import com.fuint.business.userManager.service.UserBalanceService; @@ -87,6 +89,8 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService { private CardFuleOrdersService cardFuleOrdersService; @Resource private OilBalanceChangeService oilBalanceChangeService; + @Resource + private OilNameService oilNameService; /** * 通过ID查询单条数据 * @@ -391,6 +395,8 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService { cardFuleOrders.setOilType(cardFuelDiesel.getOilType()); cardFuleOrders.setIncomeLitres(cardFuelDiesel.getIncomeLitres()); cardFuleOrders.setLockupPrice(cardFuelDiesel.getLockupPrice()); + //油品名称 + cardFuleOrders.setOilName(oilNameService.getById(cardFuelDiesel.getOilType()).getOilName()); //订单号 SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); String timestamp = dateFormat.format(new Date()); @@ -401,6 +407,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService { cardFuleOrders.setPayType(cardFuelRecordDTO.getPayType()); //用户信息 cardFuleOrders.setStoreId(cardFuelRecordDTO.getStoreId()); + cardFuleOrders.setChainStoreId(cardFuelRecordDTO.getChainStoreId()); cardFuleOrders.setMtUserId(ljUserVo.getId()); cardFuleOrders.setName(ljUserVo.getName()); cardFuleOrders.setMobile(ljUserVo.getMobile()); @@ -469,7 +476,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService { cardFuleOrders.setPayTime(new Date()); cardFuleOrdersService.updateById(cardFuleOrders); //用户余额 - UserBalance userBalance = userBalanceService.selectUserBalanceByStorId(cardFuleOrders.getMtUserId(),cardFuleOrders.getStoreId()); + UserBalance userBalance = userBalanceService.selectUserBalance(cardFuleOrders.getMtUserId(),cardFuleOrders.getChainStoreId()); //用户 (新用户新建 老用户叠加) if (ObjectUtils.isNotEmpty(userBalance)){ //积分 @@ -478,21 +485,21 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService { } //屯油卡余油 if (ObjectUtils.isNotEmpty(cardFuleOrders.getIncomeLitres()) - && ObjectUtils.isNotEmpty(cardFuleOrders.getType()) && ObjectUtils.isNotEmpty(cardFuleOrders.getOilType())){ + && ObjectUtils.isNotEmpty(cardFuleOrders.getType()) && ObjectUtils.isNotEmpty(cardFuleOrders.getOilType())) { String refuelMoney = userBalance.getRefuelMoney(); - if (ObjectUtils.isNotEmpty(refuelMoney)){ + if (ObjectUtils.isNotEmpty(refuelMoney)) { List jsonObjectList = JSONArray.parseArray(refuelMoney, JSONObject.class); - ArrayList oilTypeList= new ArrayList<>(); + ArrayList oilTypeList = new ArrayList<>(); for (JSONObject jsonObject : jsonObjectList) { String oilType = jsonObject.getString("oilType"); - if (ObjectUtils.isNotEmpty(oilType)){ + if (ObjectUtils.isNotEmpty(oilType)) { oilTypeList.add(oilType); } } //如果油品类型包括所加的油品,叠加,不包括,新增 - if (oilTypeList.contains(cardFuleOrders.getOilType())){ + if (oilTypeList.contains(cardFuleOrders.getOilType())) { for (JSONObject jsonObject : jsonObjectList) { - if (cardFuleOrders.getOilType().equals(jsonObject.getString("oilType"))){ + if (cardFuleOrders.getOilType().equals(jsonObject.getString("oilType"))) { double incomeLitres = jsonObject.getDouble("incomeLitres"); incomeLitres = (cardFuleOrders.getIncomeLitres() + incomeLitres); jsonObject.put("incomeLitres", incomeLitres); @@ -500,28 +507,38 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService { userBalance.setRefuelMoney(userBnlancce); break; } - } - }else { + } + } else { JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("type",cardFuleOrders.getType()); - jsonObject1.put("oilType",cardFuleOrders.getOilType()); - jsonObject1.put("incomeLitres",cardFuleOrders.getIncomeLitres()); + jsonObject1.put("type", cardFuleOrders.getType()); + jsonObject1.put("oilType", cardFuleOrders.getOilType()); + jsonObject1.put("incomeLitres", cardFuleOrders.getIncomeLitres()); + jsonObject1.put("oilName", cardFuleOrders.getOilName()); jsonObjectList.add(jsonObject1); String userBnlancce = jsonObjectList.toString(); userBalance.setRefuelMoney(userBnlancce); } - } - }else { + } else { ArrayList jsonObjects = new ArrayList<>(); JSONObject jsonObject = new JSONObject(); - jsonObject.put("type",cardFuleOrders.getType()); - jsonObject.put("oilType",cardFuleOrders.getOilType()); - jsonObject.put("incomeLitres",cardFuleOrders.getIncomeLitres()); + jsonObject.put("type", cardFuleOrders.getType()); + jsonObject.put("oilType", cardFuleOrders.getOilType()); + jsonObject.put("incomeLitres", cardFuleOrders.getIncomeLitres()); + jsonObject.put("oilName", cardFuleOrders.getOilName()); jsonObjects.add(jsonObject); userBalance.setRefuelMoney(jsonObjects.toString()); } - userBalanceService.updateUserBalance(userBalance); + userBalanceService.updateUserBalance(userBalance); + } }else { + ArrayList jsonObjects = new ArrayList<>(); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("type",cardFuleOrders.getType()); + jsonObject.put("oilType",cardFuleOrders.getOilType()); + jsonObject.put("incomeLitres",cardFuleOrders.getIncomeLitres()); + jsonObject.put("oilName",cardFuleOrders.getOilName()); + jsonObjects.add(jsonObject); + userBalance1.setRefuelMoney(jsonObjects.toString()); userBalance1.setMtUserId(cardFuleOrders.getMtUserId()); userBalance1.setStoreId(cardFuleOrders.getStoreId()); //积分 @@ -536,8 +553,6 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService { oilBalanceChange.setChangeType("1"); oilBalanceChange.setFromType("囤油卡充值"); oilBalanceChange.setOilBalance(cardFuleOrders.getIncomeLitres()); - //变化之后的余油 - //oilBalanceChange.setAfterOilChange(cardFuleOrders.getIncomeLitres()); oilBalanceChange.setType(cardFuleOrders.getType()); oilBalanceChange.setOrderNo(cardFuleOrders.getOrderNo()); oilBalanceChange.setOilType(cardFuleOrders.getOilType()); @@ -552,6 +567,8 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService { cardFuelRecord.setCardFuelId(cardFuleOrders.getCardFuleId()); cardFuelRecord.setRechargeBalance(cardFuleOrders.getPayAmount()); cardFuelRecord.setIncomeLitres(cardFuleOrders.getIncomeLitres()); + cardFuelRecord.setLockupPrice(cardFuleOrders.getLockupPrice()); + cardFuelRecord.setPayAmount(cardFuleOrders.getPayAmount()); cardFuelRecord.setPaymentType(cardFuleOrders.getPaymentType()); cardFuelRecord.setPoints(cardFuleOrders.getPoints()); cardFuelRecord.setPayStatus("paid"); @@ -559,7 +576,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService { cardFuelRecord.setPaymentNo(cardFuleOrders.getOrderNo()); cardFuelRecord.setType(cardFuleOrders.getType()); cardFuelRecord.setOilType(cardFuleOrders.getOilType()); + cardFuelRecord.setOilName(cardFuleOrders.getOilName()); cardFuelRecordMapper.insert(cardFuelRecord); } - } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFuleOrders/entity/CardFuleOrders.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFuleOrders/entity/CardFuleOrders.java index 383d6693b..ef97d0abf 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFuleOrders/entity/CardFuleOrders.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFuleOrders/entity/CardFuleOrders.java @@ -28,6 +28,7 @@ public class CardFuleOrders extends Model { private String orderNo; //所属店铺ID private Integer storeId; + private Integer chainStoreId; //订单金额 private Double amount; //支付金额 @@ -42,6 +43,8 @@ public class CardFuleOrders extends Model { private String type; //油品类型:0:0# 1:-10# 2:京0# 3:92# 4:95# 98# 3:京92# 4:京95# private String oilType; + //油品名称 + private String oilName; //用户备注 private String remark; //订单状态 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/dto/CardValueRecordDTO.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/dto/CardValueRecordDTO.java index 5de30d8f0..cbd74144c 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/dto/CardValueRecordDTO.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/dto/CardValueRecordDTO.java @@ -14,6 +14,8 @@ public class CardValueRecordDTO extends CardValueRecord { private Double realyPayBills; //付款类型 1.微信 2.支付宝 private String payType; + private String oilName; + private String type; //优惠券id private Integer cardFavorableId; //卡券领取记录id diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/entity/CardValueRecord.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/entity/CardValueRecord.java index f79830b54..4a3543799 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/entity/CardValueRecord.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/entity/CardValueRecord.java @@ -6,9 +6,7 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.extension.activerecord.Model; import com.fasterxml.jackson.annotation.JsonFormat; - -import java.io.Serializable; - +import lombok.Data; /** * 储值充值表(CardValueRecord)表实体类 * @@ -16,6 +14,7 @@ import java.io.Serializable; * @since 2023-10-31 11:30:10 */ @SuppressWarnings("serial") +@Data public class CardValueRecord extends Model { //主键id @TableId(type = IdType.AUTO) @@ -69,257 +68,14 @@ public class CardValueRecord extends Model { //更新时间 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date updateTime; - - - // 支付状态 private String payStatus; // 支付方式 private String paymentType; // 支付编号 private String paymentNo; - - // + //连锁店id private Integer chainStoreId; - public Integer getChainStoreId() { - return chainStoreId; - } - - public void setChainStoreId(Integer chainStoreId) { - this.chainStoreId = chainStoreId; - } - public String getPaymentNo() { - return paymentNo; - } - - public void setPaymentNo(String paymentNo) { - this.paymentNo = paymentNo; - } - - public String getPaymentType() { - return paymentType; - } - - public void setPaymentType(String paymentType) { - this.paymentType = paymentType; - } - - public Integer getStoreId() { - return storeId; - } - - public void setStoreId(Integer storeId) { - this.storeId = storeId; - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public Integer getMtUserId() { - return mtUserId; - } - - public void setMtUserId(Integer mtUserId) { - this.mtUserId = mtUserId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getMobile() { - return mobile; - } - - public void setMobile(String mobile) { - this.mobile = mobile; - } - - public Integer getMtStaffId() { - return mtStaffId; - } - - public void setMtStaffId(Integer mtStaffId) { - this.mtStaffId = mtStaffId; - } - - public String getRealName() { - return realName; - } - - public void setRealName(String realName) { - this.realName = realName; - } - - public String getStaffMobile() { - return staffMobile; - } - - public void setStaffMobile(String staffMobile) { - this.staffMobile = staffMobile; - } - - public Integer getCardValueId() { - return cardValueId; - } - - public void setCardValueId(Integer cardValueId) { - this.cardValueId = cardValueId; - } - - public String getRechargeType() { - return rechargeType; - } - - public void setRechargeType(String rechargeType) { - this.rechargeType = rechargeType; - } - - public Double getAmount() { - return amount; - } - - public void setAmount(Double amount) { - this.amount = amount; - } - - public Double getBidBalance() { - return bidBalance; - } - - public void setBidBalance(Double bidBalance) { - this.bidBalance = bidBalance; - } - - public Double getRechargeBalance() { - return rechargeBalance; - } - - public void setRechargeBalance(Double rechargeBalance) { - this.rechargeBalance = rechargeBalance; - } - - public Double getGiftBalance() { - return giftBalance; - } - - public void setGiftBalance(Double giftBalance) { - this.giftBalance = giftBalance; - } - - public Integer getPoints() { - return points; - } - - public void setPoints(Integer points) { - this.points = points; - } - - public Integer getGrowthValue() { - return growthValue; - } - - public void setGrowthValue(Integer growthValue) { - this.growthValue = growthValue; - } - - public Integer getRefuelMoney() { - return refuelMoney; - } - - public void setRefuelMoney(Integer refuelMoney) { - this.refuelMoney = refuelMoney; - } - - public String getFringeBenefit() { - return fringeBenefit; - } - - public void setFringeBenefit(String fringeBenefit) { - this.fringeBenefit = fringeBenefit; - } - - public String getRoyaltyType() { - return royaltyType; - } - - public void setRoyaltyType(String royaltyType) { - this.royaltyType = royaltyType; - } - - public Double getPercentageCommissions() { - return percentageCommissions; - } - - public void setPercentageCommissions(Double percentageCommissions) { - this.percentageCommissions = percentageCommissions; - } - - public Double getAmountCommission() { - return amountCommission; - } - - public void setAmountCommission(Double amountCommission) { - this.amountCommission = amountCommission; - } - - public String getCreateBy() { - return createBy; - } - - public void setCreateBy(String createBy) { - this.createBy = createBy; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public String getUpdateBy() { - return updateBy; - } - - public void setUpdateBy(String updateBy) { - this.updateBy = updateBy; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - - public String getPayStatus() { - return payStatus; - } - - public void setPayStatus(String payStatus) { - this.payStatus = payStatus; - } - /** - * 获取主键值 - * - * @return 主键值 - */ - @Override - protected Serializable pkVal() { - return this.id; - } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml index 0b439705b..048282fc9 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml @@ -64,11 +64,13 @@ combined_result.createTime, combined_result.chainStoreId, combined_result.mtUserId, - combined_result.storeId + combined_result.storeId, + combined_result.OilName, + combined_result.type FROM - (SELECT '储值卡' AS recordName,mt_user_id mtUserId, recharge_balance rechargeBalance, gift_balance obtain, create_time createTime, chain_store_id chainStoreId, store_id storeId FROM card_value_record + (SELECT '储值卡' AS recordName,mt_user_id mtUserId, recharge_balance rechargeBalance, gift_balance obtain, fringe_benefit oilName,royalty_type type,create_time createTime, chain_store_id chainStoreId, store_id storeId FROM card_value_record UNION - SELECT '升数卡' AS recordName,mt_user_id mtUserId, recharge_balance rechargeBalance, income_litres obtain, create_time createTime, chain_store_id chainStoreId, store_id storeId FROM card_fuel_record) AS combined_result + SELECT '升数卡' AS recordName,mt_user_id mtUserId, recharge_balance rechargeBalance, income_litres obtain,oil_name oilName,type, create_time createTime, chain_store_id chainStoreId, store_id storeId FROM card_fuel_record) AS combined_result diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueRecordServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueRecordServiceImpl.java index 1fa733dc8..d3280652c 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueRecordServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueRecordServiceImpl.java @@ -154,6 +154,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); - lambdaQueryWrapper.eq(CardFavorableRecord::getId,cardValueOrders.getCardRecordId()); - lambdaQueryWrapper.eq(CardFavorableRecord::getStatus,"1");*/ cardFavorableRecordService.updateById(cardFavorableRecord); } //查询储值卡对应的优惠券列表 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueServiceImpl.java index c4b61c097..0af1c3bdd 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueServiceImpl.java @@ -150,7 +150,11 @@ public class CardValueServiceImpl extends ServiceImpl records = page1.getRecords(); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/entity/CardValueOrders.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/entity/CardValueOrders.java index a3e705b63..6cf9bfbec 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/entity/CardValueOrders.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueOrders/entity/CardValueOrders.java @@ -28,6 +28,8 @@ public class CardValueOrders extends Model { private String orderNo; //所属店铺ID private Integer storeId; + //连锁店id + private Integer chainStoreId; //订单金额 private Double amount; //支付金额 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/UserBalanceServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/UserBalanceServiceImpl.java index 92acad071..684073d98 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/UserBalanceServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/UserBalanceServiceImpl.java @@ -101,7 +101,7 @@ public class UserBalanceServiceImpl extends ServiceImpl(); queryWrapper.eq("mt_user_id",nowAccountInfo.getId()); - queryWrapper.eq("store_id",userBalance.getStoreId()); + queryWrapper.eq("chain_store_id",userBalance.getChainStoreId()); UserBalance balance = baseMapper.selectOne(queryWrapper); return balance; } diff --git a/gasStation-uni/config.js b/gasStation-uni/config.js index 489df866f..aa44da9d5 100644 --- a/gasStation-uni/config.js +++ b/gasStation-uni/config.js @@ -3,7 +3,7 @@ module.exports = { // baseUrl: 'https://vue.ruoyi.vip/prod-api', // baseUrl: 'http://192.168.0.196:8081/', // baseUrl: 'http://192.168.1.4:8080/', - baseUrl: 'http://192.168.0.178:8008/', + baseUrl: 'http://192.168.0.138:8080/', // baseUrl: 'http://192.168.1.5:8002/cdJdc', @@ -29,4 +29,4 @@ module.exports = { } ] } -} \ No newline at end of file +} diff --git a/gasStation-uni/package/cji/cji.vue b/gasStation-uni/package/cji/cji.vue index 79febaa74..4fa30a4bb 100644 --- a/gasStation-uni/package/cji/cji.vue +++ b/gasStation-uni/package/cji/cji.vue @@ -6,20 +6,46 @@ 样版页 - +