修改bug

This commit is contained in:
齐天大圣 2024-01-04 12:04:59 +08:00
parent 876c391ef8
commit 5b1c86be9b
21 changed files with 192 additions and 51 deletions

View File

@ -394,7 +394,7 @@
label="券详情" label="券详情"
width="100"> width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.fullDeduction}} {{scope.row.discountAmount}} </span> <span>{{scope.row.satisfiedAmount}} {{scope.row.discountAmount}} </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column

View File

@ -103,7 +103,11 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
@Override @Override
public IPage<ActiveConsumptionVOS> select(Page page, ActiveConsumption activeConsumption) { public IPage<ActiveConsumptionVOS> select(Page page, ActiveConsumption activeConsumption) {
//所属店铺id //所属店铺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); IPage activeConsumptionVOSIPage = activeConsumptionMapper.selectConsumptions(page, activeConsumption);
List<ActiveConsumptionVOS> records = activeConsumptionVOSIPage.getRecords(); List<ActiveConsumptionVOS> records = activeConsumptionVOSIPage.getRecords();

View File

@ -113,7 +113,11 @@ public class ActiveDiscountServiceImpl extends ServiceImpl<ActiveDiscountMapper,
if(ObjectUtils.isNotEmpty(activeDiscount.getIsonline())) { if(ObjectUtils.isNotEmpty(activeDiscount.getIsonline())) {
queryWrapper.eq(ActiveDiscount::getIsonline,activeDiscount.getIsonline()); queryWrapper.eq(ActiveDiscount::getIsonline,activeDiscount.getIsonline());
} }
queryWrapper.eq(ActiveDiscount::getStoreId,TokenUtil.getNowAccountInfo().getStoreId()); if (ObjectUtils.isNotEmpty(activeDiscount.getStoreId())){
queryWrapper.eq(ActiveDiscount::getStoreId,activeDiscount.getStoreId());
}else {
queryWrapper.eq(ActiveDiscount::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
}
queryWrapper.orderByDesc(ActiveDiscount::getCreateTime); queryWrapper.orderByDesc(ActiveDiscount::getCreateTime);
IPage page1 = page(page, queryWrapper); IPage page1 = page(page, queryWrapper);
//会员等级 //会员等级

View File

@ -87,8 +87,8 @@ public class ActiveExchangeController extends BaseController {
* @return * @return
*/ */
@GetMapping("applet") @GetMapping("applet")
public ResponseObject selectAll() { public ResponseObject selectAll(@Param("activeExchangeRecordDTO") ActiveExchangeRecordDTO activeExchangeRecordDTO) {
return getSuccessResult(this.activeExchangeService.select()); return getSuccessResult(this.activeExchangeService.select(activeExchangeRecordDTO));
} }

View File

@ -47,7 +47,7 @@ public interface ActiveExchangeService {
* 小程序活动列表 * 小程序活动列表
* @return * @return
*/ */
List<ActiveAppletVO> select(); List<ActiveAppletVO> select(ActiveExchangeRecordDTO activeExchangeRecordDTO);
/** /**
* 优惠活动接口 * 优惠活动接口

View File

@ -288,10 +288,12 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
* @return * @return
*/ */
@Override @Override
public List<ActiveAppletVO> select() { public List<ActiveAppletVO> select(ActiveExchangeRecordDTO activeExchangeRecordDTO) {
ArrayList<ActiveAppletVO> activeAppletVOS = new ArrayList<>(); ArrayList<ActiveAppletVO> activeAppletVOS = new ArrayList<>();
//消费有礼活动 //消费有礼活动
List<ActiveConsumptionAppletVO> activeConsumptionAppletVOS = activeConsumptionService.selectAllApplet(new ActiveConsumption()); ActiveConsumption consumption = new ActiveConsumption();
consumption.setStoreId(activeExchangeRecordDTO.getStoreId());
List<ActiveConsumptionAppletVO> activeConsumptionAppletVOS = activeConsumptionService.selectAllApplet(consumption);
if (CollectionUtils.isNotEmpty(activeConsumptionAppletVOS)){ if (CollectionUtils.isNotEmpty(activeConsumptionAppletVOS)){
ActiveAppletVO activeAppletVO = new ActiveAppletVO(); ActiveAppletVO activeAppletVO = new ActiveAppletVO();
activeAppletVO.setName("消费有礼活动"); activeAppletVO.setName("消费有礼活动");
@ -305,7 +307,9 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
activeAppletVOS.add(activeAppletVO); activeAppletVOS.add(activeAppletVO);
} }
//折扣营销 //折扣营销
List<ActiveDiscountAppletVO> activeDiscountAppletVOS = activeDiscountService.selectAllApplet(new ActiveDiscount()); ActiveDiscount activeDiscount = new ActiveDiscount();
activeDiscount.setStoreId(activeExchangeRecordDTO.getStoreId());
List<ActiveDiscountAppletVO> activeDiscountAppletVOS = activeDiscountService.selectAllApplet(activeDiscount);
if (CollectionUtils.isNotEmpty(activeDiscountAppletVOS)){ if (CollectionUtils.isNotEmpty(activeDiscountAppletVOS)){
ActiveAppletVO activeAppletVO = new ActiveAppletVO(); ActiveAppletVO activeAppletVO = new ActiveAppletVO();
activeAppletVO.setName("折扣营销活动"); activeAppletVO.setName("折扣营销活动");
@ -319,7 +323,9 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
activeAppletVOS.add(activeAppletVO); activeAppletVOS.add(activeAppletVO);
} }
//满减营销 //满减营销
List<ActiveFullminusAppletVO> activeFullminusAppletVOS = activeFullminusService.selectAllApplet(new ActiveFullminus()); ActiveFullminus activeFullminus = new ActiveFullminus();
activeFullminus.setStoreId(activeExchangeRecordDTO.getStoreId());
List<ActiveFullminusAppletVO> activeFullminusAppletVOS = activeFullminusService.selectAllApplet(activeFullminus);
if (CollectionUtils.isNotEmpty(activeFullminusAppletVOS)){ if (CollectionUtils.isNotEmpty(activeFullminusAppletVOS)){
ActiveAppletVO activeAppletVO = new ActiveAppletVO(); ActiveAppletVO activeAppletVO = new ActiveAppletVO();
activeAppletVO.setName("满减营销活动"); activeAppletVO.setName("满减营销活动");
@ -333,7 +339,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
activeAppletVOS.add(activeAppletVO); activeAppletVOS.add(activeAppletVO);
} }
//新人有礼 //新人有礼
ActiveNewlywedsAppletVO activeNewlywedsAppletVO = activeNewlywedsService.selectApplet(); ActiveNewlywedsAppletVO activeNewlywedsAppletVO = activeNewlywedsService.selectApplet(consumption);
if (ObjectUtils.isNotEmpty(activeNewlywedsAppletVO)){ if (ObjectUtils.isNotEmpty(activeNewlywedsAppletVO)){
ActiveAppletVO activeAppletVO = new ActiveAppletVO(); ActiveAppletVO activeAppletVO = new ActiveAppletVO();
activeAppletVO.setName("新人有礼活动"); activeAppletVO.setName("新人有礼活动");
@ -347,7 +353,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
activeAppletVOS.add(activeAppletVO); activeAppletVOS.add(activeAppletVO);
} }
//推荐有礼 //推荐有礼
ActiveRecommendAppletVO activeRecommendAppletVO = activeRecommendService.selectApplet(); ActiveRecommendAppletVO activeRecommendAppletVO = activeRecommendService.selectApplet(consumption);
if (ObjectUtils.isNotEmpty(activeRecommendAppletVO)){ if (ObjectUtils.isNotEmpty(activeRecommendAppletVO)){
ActiveAppletVO activeAppletVO = new ActiveAppletVO(); ActiveAppletVO activeAppletVO = new ActiveAppletVO();
activeAppletVO.setName("推荐有礼活动"); activeAppletVO.setName("推荐有礼活动");
@ -361,7 +367,9 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
activeAppletVOS.add(activeAppletVO); activeAppletVOS.add(activeAppletVO);
} }
//充值有礼 //充值有礼
List<CardValueAppletVO> cardValueAppletVOS = cardValueService.selectAllApplet(new CardValue()); CardValue cardValue = new CardValue();
cardValue.setStoreId(activeExchangeRecordDTO.getStoreId());
List<CardValueAppletVO> cardValueAppletVOS = cardValueService.selectAllApplet(cardValue);
if (CollectionUtils.isNotEmpty(cardValueAppletVOS)){ if (CollectionUtils.isNotEmpty(cardValueAppletVOS)){
ActiveAppletVO activeAppletVO = new ActiveAppletVO(); ActiveAppletVO activeAppletVO = new ActiveAppletVO();
activeAppletVO.setName("储值卡充值活动"); activeAppletVO.setName("储值卡充值活动");

View File

@ -108,7 +108,11 @@ public class ActiveFullminusServiceImpl extends ServiceImpl<ActiveFullminusMappe
if(ObjectUtils.isNotEmpty(activeFullminus.getIsonline())) { if(ObjectUtils.isNotEmpty(activeFullminus.getIsonline())) {
queryWrapper.eq(ActiveFullminus::getIsonline,activeFullminus.getIsonline()); queryWrapper.eq(ActiveFullminus::getIsonline,activeFullminus.getIsonline());
} }
queryWrapper.eq(ActiveFullminus::getStoreId,TokenUtil.getNowAccountInfo().getStoreId()); if (ObjectUtils.isNotEmpty(activeFullminus.getStoreId())){
queryWrapper.eq(ActiveFullminus::getStoreId,activeFullminus.getStoreId());
}else {
queryWrapper.eq(ActiveFullminus::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
}
queryWrapper.orderByDesc(ActiveFullminus::getCreateTime); queryWrapper.orderByDesc(ActiveFullminus::getCreateTime);
IPage page1 = page(page, queryWrapper); IPage page1 = page(page, queryWrapper);
//会员等级 //会员等级

View File

@ -3,6 +3,7 @@ package com.fuint.business.marketingActivity.activeNewlyweds.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumption;
import com.fuint.business.marketingActivity.activeNewlyweds.dto.ActiveNewlywedsDTO; import com.fuint.business.marketingActivity.activeNewlyweds.dto.ActiveNewlywedsDTO;
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlyweds; import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlyweds;
import com.fuint.business.marketingActivity.activeNewlyweds.service.ActiveNewlywedsChildService; import com.fuint.business.marketingActivity.activeNewlyweds.service.ActiveNewlywedsChildService;
@ -64,8 +65,8 @@ public class ActiveNewlywedsController extends BaseController {
* @return 单条数据 * @return 单条数据
*/ */
@GetMapping("applet") @GetMapping("applet")
public ResponseObject selectApplet() { public ResponseObject selectApplet(@Param("activeConsumption") ActiveConsumption activeConsumption) {
return getSuccessResult(this.activeNewlywedsService.selectApplet()); return getSuccessResult(this.activeNewlywedsService.selectApplet(activeConsumption));
} }
/** /**

View File

@ -3,6 +3,7 @@ package com.fuint.business.marketingActivity.activeNewlyweds.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
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.ActiveNewlywedsAppletVO;
import com.fuint.business.marketingActivity.activeNewlyweds.controller.vo.ActiveNewlywedsVO; import com.fuint.business.marketingActivity.activeNewlyweds.controller.vo.ActiveNewlywedsVO;
import com.fuint.business.marketingActivity.activeNewlyweds.dto.ActiveNewlywedsDTO; import com.fuint.business.marketingActivity.activeNewlyweds.dto.ActiveNewlywedsDTO;
@ -39,6 +40,7 @@ public interface ActiveNewlywedsService extends IService<ActiveNewlyweds> {
* @return * @return
*/ */
ActiveNewlywedsVO getOneById(Serializable id); ActiveNewlywedsVO getOneById(Serializable id);
ActiveNewlywedsVO getOneByIdApplet(ActiveConsumption activeConsumption);
/** /**
* 修改数据 * 修改数据
@ -51,6 +53,6 @@ public interface ActiveNewlywedsService extends IService<ActiveNewlyweds> {
* 查询单条数据(小程序端) * 查询单条数据(小程序端)
* @return * @return
*/ */
ActiveNewlywedsAppletVO selectApplet(); ActiveNewlywedsAppletVO selectApplet(ActiveConsumption activeConsumption);
} }

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.ActiveNewlywedsAppletVO;
import com.fuint.business.marketingActivity.activeNewlyweds.controller.vo.ActiveNewlywedsVO; import com.fuint.business.marketingActivity.activeNewlyweds.controller.vo.ActiveNewlywedsVO;
import com.fuint.business.marketingActivity.activeNewlyweds.dto.ActiveNewlywedsDTO; import com.fuint.business.marketingActivity.activeNewlyweds.dto.ActiveNewlywedsDTO;
@ -182,6 +183,44 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
return activeNewlywedsVO; return activeNewlywedsVO;
} }
/**
* 通过店铺查询单条数据(小程序端)
* @param activeConsumption
* @return
*/
@Override
public ActiveNewlywedsVO getOneByIdApplet(ActiveConsumption activeConsumption) {
Integer storeId = activeConsumption.getStoreId();
ActiveNewlywedsVO activeNewlywedsVO = new ActiveNewlywedsVO();
activeNewlywedsVO.setCourtesyReward(new String[0]);
if (ObjectUtils.isNotEmpty(storeId)){
//获取新人有礼活动信息
LambdaQueryWrapper<ActiveNewlyweds> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveNewlyweds::getStoreId,storeId);
ActiveNewlyweds activeNewlyweds = getOne(lambdaQueryWrapper);
//获取兑换物品信息
if (ObjectUtils.isNotEmpty(activeNewlyweds)){
LambdaQueryWrapper<ActiveNewlywedsChild> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveNewlywedsChild::getActiveNewlywedsId,activeNewlyweds.getId());
queryWrapper.orderByDesc(ActiveNewlywedsChild::getCreateTime);
List<ActiveNewlywedsChild> activeNewlywedsChildList = activeNewlywedsChildService.list(queryWrapper);
BeanUtils.copyProperties(activeNewlyweds,activeNewlywedsVO);
//封装VO返回
activeNewlywedsVO.setCourtesyReward(activeNewlyweds.getCourtesyReward().split(","));
if (CollectionUtils.isNotEmpty(activeNewlywedsChildList)){
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList);
}else {
ArrayList<ActiveNewlywedsChild> activeNewlywedsChildLists = new ArrayList<>();
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildLists);
}
}else {
ArrayList<ActiveNewlywedsChild> activeNewlywedsChildList = new ArrayList<>();
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList);
}
}
return activeNewlywedsVO;
}
/** /**
* 修改数据 * 修改数据
* @param activeNewlywedsDTO * @param activeNewlywedsDTO
@ -217,10 +256,10 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
} }
@Override @Override
public ActiveNewlywedsAppletVO selectApplet() { public ActiveNewlywedsAppletVO selectApplet(ActiveConsumption activeConsumption) {
ActiveNewlywedsAppletVO activeNewlywedsAppletVO = new ActiveNewlywedsAppletVO(); ActiveNewlywedsAppletVO activeNewlywedsAppletVO = new ActiveNewlywedsAppletVO();
//获取本店铺的推荐有礼活动 //获取本店铺的推荐有礼活动
ActiveNewlywedsVO activeNewlywedsVO = getOneById(1); ActiveNewlywedsVO activeNewlywedsVO = getOneByIdApplet(activeConsumption);
if (ObjectUtils.isNotEmpty(activeNewlywedsVO.getId())){ if (ObjectUtils.isNotEmpty(activeNewlywedsVO.getId())){
//活动时间 //活动时间
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd");

View File

@ -4,6 +4,7 @@ package com.fuint.business.marketingActivity.activeRecommend.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumption;
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlyweds; import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlyweds;
import com.fuint.business.marketingActivity.activeRecommend.dto.ActiveRecommendDTO; import com.fuint.business.marketingActivity.activeRecommend.dto.ActiveRecommendDTO;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommend; import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommend;
@ -68,8 +69,8 @@ public class ActiveRecommendController extends BaseController {
* @return 单条数据 * @return 单条数据
*/ */
@GetMapping("applet") @GetMapping("applet")
public ResponseObject selectApplet() { public ResponseObject selectApplet(@Param("activeConsumption") ActiveConsumption activeConsumption) {
return getSuccessResult(this.activeRecommendService.selectApplet()); return getSuccessResult(this.activeRecommendService.selectApplet(activeConsumption));
} }
/** /**

View File

@ -1,6 +1,7 @@
package com.fuint.business.marketingActivity.activeRecommend.service; package com.fuint.business.marketingActivity.activeRecommend.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumption;
import com.fuint.business.marketingActivity.activeRecommend.dto.ActiveRecommendDTO; import com.fuint.business.marketingActivity.activeRecommend.dto.ActiveRecommendDTO;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommend; import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommend;
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendAppletVO; import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendAppletVO;
@ -29,6 +30,7 @@ public interface ActiveRecommendService extends IService<ActiveRecommend> {
* @return * @return
*/ */
ActiveRecommendVO getOneById(Serializable id); ActiveRecommendVO getOneById(Serializable id);
ActiveRecommendVO getOneByIdApplet(ActiveConsumption activeConsumption);
/** /**
* 修改数据 * 修改数据
@ -41,6 +43,6 @@ public interface ActiveRecommendService extends IService<ActiveRecommend> {
* 查询单条数据(小程序端) * 查询单条数据(小程序端)
* @return * @return
*/ */
ActiveRecommendAppletVO selectApplet(); ActiveRecommendAppletVO selectApplet(ActiveConsumption activeConsumption);
} }

View File

@ -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.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.dto.ActiveRecommendDTO;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendChild; import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendChild;
import com.fuint.business.marketingActivity.activeRecommend.mapper.ActiveRecommendMapper; import com.fuint.business.marketingActivity.activeRecommend.mapper.ActiveRecommendMapper;
@ -125,6 +126,44 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
return activeRecommendVO; return activeRecommendVO;
} }
/**
* 通过店铺id查询单条数据(小程序端)
* @param id
* @return
*/
@Override
public ActiveRecommendVO getOneByIdApplet(ActiveConsumption activeConsumption) {
Integer storeId = activeConsumption.getStoreId();
ActiveRecommendVO activeRecommendVO = new ActiveRecommendVO();
activeRecommendVO.setInviterGiftType(new String[0]);
if (ObjectUtils.isNotEmpty(storeId)){
//获取新人有礼活动信息
LambdaQueryWrapper<ActiveRecommend> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveRecommend::getStoreId,storeId);
ActiveRecommend activeRecommend = getOne(lambdaQueryWrapper);
//获取兑换物品信息
if (ObjectUtils.isNotEmpty(activeRecommend)){
LambdaQueryWrapper<ActiveRecommendChild> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveRecommendChild::getActiveRecommendId,activeRecommend.getId());
queryWrapper.orderByDesc(ActiveRecommendChild::getCreateTime);
List<ActiveRecommendChild> activeRecommendChildList = activeRecommendChildService.list(queryWrapper);
BeanUtils.copyProperties(activeRecommend,activeRecommendVO);
activeRecommendVO.setInviterGiftType(activeRecommend.getInviterGiftType().split(","));
if (CollectionUtils.isNotEmpty(activeRecommendChildList)){
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildList);
}else {
ArrayList<ActiveRecommendChild> activeRecommendChildren = new ArrayList<>();
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildren);
}
}else {
ArrayList<ActiveRecommendChild> activeRecommendChildren = new ArrayList<>();
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildren);
}
}
return activeRecommendVO;
}
/** /**
* 修改数据 * 修改数据
* @param activeRecommendDTO * @param activeRecommendDTO
@ -161,10 +200,10 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
* @return * @return
*/ */
@Override @Override
public ActiveRecommendAppletVO selectApplet() { public ActiveRecommendAppletVO selectApplet(ActiveConsumption activeConsumption) {
ActiveRecommendAppletVO activeRecommendAppletVO = new ActiveRecommendAppletVO(); ActiveRecommendAppletVO activeRecommendAppletVO = new ActiveRecommendAppletVO();
//获取本店铺的推荐有礼活动 //获取本店铺的推荐有礼活动
ActiveRecommendVO activeRecommendVO = getOneById(1); ActiveRecommendVO activeRecommendVO = getOneByIdApplet(activeConsumption);
//邀请人获得 //邀请人获得
if (ObjectUtils.isNotEmpty(activeRecommendVO) && ObjectUtils.isNotEmpty(activeRecommendVO.getPoints())){ if (ObjectUtils.isNotEmpty(activeRecommendVO) && ObjectUtils.isNotEmpty(activeRecommendVO.getPoints())){
//积分 //积分

View File

@ -55,6 +55,14 @@ public class CardFuelRecord extends BaseEntity {
* 所得升数 * 所得升数
*/ */
private Double incomeLitres; private Double incomeLitres;
/**
* 锁价单价
*/
private Double payAmount;
/**
* 支付金额
*/
private Double lockupPrice;
/** /**
* 支付方式 0扫码支付 1现金支付 2pos刷卡 3微信....... * 支付方式 0扫码支付 1现金支付 2pos刷卡 3微信.......
*/ */
@ -120,6 +128,10 @@ public class CardFuelRecord extends BaseEntity {
* 油品类型00# 1-10# 2京0# 392# 495# 98# 3京92# 4京95# * 油品类型00# 1-10# 2京0# 392# 495# 98# 3京92# 4京95#
*/ */
private String oilType; private String oilType;
/*
油品名称
*/
private String oilName;

View File

@ -216,8 +216,8 @@
<!--新增所有列--> <!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true"> <insert id="insert" keyProperty="id" useGeneratedKeys="true">
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) 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}, #{incomeLitres}, #{paymentType}, #{remark}, #{points}, #{growthValue}, #{royaltyType}, #{percentageCommissions}, #{amountCommission}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{payStatus}, #{storeId}, #{paymentNo}, #{type}, #{oilType}, #{chainStoreId}) 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})
</insert> </insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true"> <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">

View File

@ -36,9 +36,11 @@ import com.fuint.business.marketingActivity.cardValue.vo.CardValueVO;
import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrders; import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrders;
import com.fuint.business.member.entity.LJStaff; import com.fuint.business.member.entity.LJStaff;
import com.fuint.business.member.service.ILJStaffService; 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.CardBalanceChange;
import com.fuint.business.order.entity.OilBalanceChange; import com.fuint.business.order.entity.OilBalanceChange;
import com.fuint.business.order.service.OilBalanceChangeService; 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.entity.UserBalance;
import com.fuint.business.userManager.mapper.LJUserMapper; import com.fuint.business.userManager.mapper.LJUserMapper;
import com.fuint.business.userManager.service.UserBalanceService; import com.fuint.business.userManager.service.UserBalanceService;
@ -87,6 +89,8 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
private CardFuleOrdersService cardFuleOrdersService; private CardFuleOrdersService cardFuleOrdersService;
@Resource @Resource
private OilBalanceChangeService oilBalanceChangeService; private OilBalanceChangeService oilBalanceChangeService;
@Resource
private OilNameService oilNameService;
/** /**
* 通过ID查询单条数据 * 通过ID查询单条数据
* *
@ -391,6 +395,8 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
cardFuleOrders.setOilType(cardFuelDiesel.getOilType()); cardFuleOrders.setOilType(cardFuelDiesel.getOilType());
cardFuleOrders.setIncomeLitres(cardFuelDiesel.getIncomeLitres()); cardFuleOrders.setIncomeLitres(cardFuelDiesel.getIncomeLitres());
cardFuleOrders.setLockupPrice(cardFuelDiesel.getLockupPrice()); cardFuleOrders.setLockupPrice(cardFuelDiesel.getLockupPrice());
//油品名称
cardFuleOrders.setOilName(oilNameService.getById(cardFuelDiesel.getOilType()).getOilName());
//订单号 //订单号
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String timestamp = dateFormat.format(new Date()); String timestamp = dateFormat.format(new Date());
@ -478,21 +484,21 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
} }
//屯油卡余油 //屯油卡余油
if (ObjectUtils.isNotEmpty(cardFuleOrders.getIncomeLitres()) 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(); String refuelMoney = userBalance.getRefuelMoney();
if (ObjectUtils.isNotEmpty(refuelMoney)){ if (ObjectUtils.isNotEmpty(refuelMoney)) {
List<JSONObject> jsonObjectList = JSONArray.parseArray(refuelMoney, JSONObject.class); List<JSONObject> jsonObjectList = JSONArray.parseArray(refuelMoney, JSONObject.class);
ArrayList<String> oilTypeList= new ArrayList<>(); ArrayList<String> oilTypeList = new ArrayList<>();
for (JSONObject jsonObject : jsonObjectList) { for (JSONObject jsonObject : jsonObjectList) {
String oilType = jsonObject.getString("oilType"); String oilType = jsonObject.getString("oilType");
if (ObjectUtils.isNotEmpty(oilType)){ if (ObjectUtils.isNotEmpty(oilType)) {
oilTypeList.add(oilType); oilTypeList.add(oilType);
} }
} }
//如果油品类型包括所加的油品,叠加不包括新增 //如果油品类型包括所加的油品,叠加不包括新增
if (oilTypeList.contains(cardFuleOrders.getOilType())){ if (oilTypeList.contains(cardFuleOrders.getOilType())) {
for (JSONObject jsonObject : jsonObjectList) { for (JSONObject jsonObject : jsonObjectList) {
if (cardFuleOrders.getOilType().equals(jsonObject.getString("oilType"))){ if (cardFuleOrders.getOilType().equals(jsonObject.getString("oilType"))) {
double incomeLitres = jsonObject.getDouble("incomeLitres"); double incomeLitres = jsonObject.getDouble("incomeLitres");
incomeLitres = (cardFuleOrders.getIncomeLitres() + incomeLitres); incomeLitres = (cardFuleOrders.getIncomeLitres() + incomeLitres);
jsonObject.put("incomeLitres", incomeLitres); jsonObject.put("incomeLitres", incomeLitres);
@ -500,28 +506,38 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
userBalance.setRefuelMoney(userBnlancce); userBalance.setRefuelMoney(userBnlancce);
break; break;
} }
} }
}else { } else {
JSONObject jsonObject1 = new JSONObject(); JSONObject jsonObject1 = new JSONObject();
jsonObject1.put("type",cardFuleOrders.getType()); jsonObject1.put("type", cardFuleOrders.getType());
jsonObject1.put("oilType",cardFuleOrders.getOilType()); jsonObject1.put("oilType", cardFuleOrders.getOilType());
jsonObject1.put("incomeLitres",cardFuleOrders.getIncomeLitres()); jsonObject1.put("incomeLitres", cardFuleOrders.getIncomeLitres());
jsonObject1.put("oilName", cardFuleOrders.getOilName());
jsonObjectList.add(jsonObject1); jsonObjectList.add(jsonObject1);
String userBnlancce = jsonObjectList.toString(); String userBnlancce = jsonObjectList.toString();
userBalance.setRefuelMoney(userBnlancce); userBalance.setRefuelMoney(userBnlancce);
} }
} } else {
}else {
ArrayList<JSONObject> jsonObjects = new ArrayList<>(); ArrayList<JSONObject> jsonObjects = new ArrayList<>();
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("type",cardFuleOrders.getType()); jsonObject.put("type", cardFuleOrders.getType());
jsonObject.put("oilType",cardFuleOrders.getOilType()); jsonObject.put("oilType", cardFuleOrders.getOilType());
jsonObject.put("incomeLitres",cardFuleOrders.getIncomeLitres()); jsonObject.put("incomeLitres", cardFuleOrders.getIncomeLitres());
jsonObject.put("oilName", cardFuleOrders.getOilName());
jsonObjects.add(jsonObject); jsonObjects.add(jsonObject);
userBalance.setRefuelMoney(jsonObjects.toString()); userBalance.setRefuelMoney(jsonObjects.toString());
} }
userBalanceService.updateUserBalance(userBalance); userBalanceService.updateUserBalance(userBalance);
}
}else { }else {
ArrayList<JSONObject> 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.setMtUserId(cardFuleOrders.getMtUserId());
userBalance1.setStoreId(cardFuleOrders.getStoreId()); userBalance1.setStoreId(cardFuleOrders.getStoreId());
//积分 //积分
@ -536,8 +552,6 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
oilBalanceChange.setChangeType("1"); oilBalanceChange.setChangeType("1");
oilBalanceChange.setFromType("囤油卡充值"); oilBalanceChange.setFromType("囤油卡充值");
oilBalanceChange.setOilBalance(cardFuleOrders.getIncomeLitres()); oilBalanceChange.setOilBalance(cardFuleOrders.getIncomeLitres());
//变化之后的余油
//oilBalanceChange.setAfterOilChange(cardFuleOrders.getIncomeLitres());
oilBalanceChange.setType(cardFuleOrders.getType()); oilBalanceChange.setType(cardFuleOrders.getType());
oilBalanceChange.setOrderNo(cardFuleOrders.getOrderNo()); oilBalanceChange.setOrderNo(cardFuleOrders.getOrderNo());
oilBalanceChange.setOilType(cardFuleOrders.getOilType()); oilBalanceChange.setOilType(cardFuleOrders.getOilType());
@ -552,6 +566,8 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
cardFuelRecord.setCardFuelId(cardFuleOrders.getCardFuleId()); cardFuelRecord.setCardFuelId(cardFuleOrders.getCardFuleId());
cardFuelRecord.setRechargeBalance(cardFuleOrders.getPayAmount()); cardFuelRecord.setRechargeBalance(cardFuleOrders.getPayAmount());
cardFuelRecord.setIncomeLitres(cardFuleOrders.getIncomeLitres()); cardFuelRecord.setIncomeLitres(cardFuleOrders.getIncomeLitres());
cardFuelRecord.setLockupPrice(cardFuleOrders.getLockupPrice());
cardFuelRecord.setPayAmount(cardFuleOrders.getPayAmount());
cardFuelRecord.setPaymentType(cardFuleOrders.getPaymentType()); cardFuelRecord.setPaymentType(cardFuleOrders.getPaymentType());
cardFuelRecord.setPoints(cardFuleOrders.getPoints()); cardFuelRecord.setPoints(cardFuleOrders.getPoints());
cardFuelRecord.setPayStatus("paid"); cardFuelRecord.setPayStatus("paid");
@ -559,7 +575,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
cardFuelRecord.setPaymentNo(cardFuleOrders.getOrderNo()); cardFuelRecord.setPaymentNo(cardFuleOrders.getOrderNo());
cardFuelRecord.setType(cardFuleOrders.getType()); cardFuelRecord.setType(cardFuleOrders.getType());
cardFuelRecord.setOilType(cardFuleOrders.getOilType()); cardFuelRecord.setOilType(cardFuleOrders.getOilType());
cardFuelRecord.setOilName(cardFuleOrders.getOilName());
cardFuelRecordMapper.insert(cardFuelRecord); cardFuelRecordMapper.insert(cardFuelRecord);
} }
} }

View File

@ -42,6 +42,8 @@ public class CardFuleOrders extends Model<CardFuleOrders> {
private String type; private String type;
//油品类型00# 1-10# 2京0# 392# 495# 98# 3京92# 4京95# //油品类型00# 1-10# 2京0# 392# 495# 98# 3京92# 4京95#
private String oilType; private String oilType;
//油品名称
private String oilName;
//用户备注 //用户备注
private String remark; private String remark;
//订单状态 //订单状态

View File

@ -14,6 +14,8 @@ public class CardValueRecordDTO extends CardValueRecord {
private Double realyPayBills; private Double realyPayBills;
//付款类型 1.微信 2.支付宝 //付款类型 1.微信 2.支付宝
private String payType; private String payType;
private String oilName;
private String type;
//优惠券id //优惠券id
private Integer cardFavorableId; private Integer cardFavorableId;
//卡券领取记录id //卡券领取记录id

View File

@ -64,11 +64,13 @@
combined_result.createTime, combined_result.createTime,
combined_result.chainStoreId, combined_result.chainStoreId,
combined_result.mtUserId, combined_result.mtUserId,
combined_result.storeId combined_result.storeId,
combined_result.OilName,
combined_result.type
FROM 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 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
<where> <where>
<if test="cardValueRecord.mtUserId != null"> <if test="cardValueRecord.mtUserId != null">

View File

@ -150,7 +150,11 @@ public class CardValueServiceImpl extends ServiceImpl<CardValueMapper, CardValue
if (ObjectUtils.isNotEmpty(cardValue.getActiveStatus())){ if (ObjectUtils.isNotEmpty(cardValue.getActiveStatus())){
queryWrapper.eq(CardValue::getActiveStatus,cardValue.getActiveStatus()); queryWrapper.eq(CardValue::getActiveStatus,cardValue.getActiveStatus());
} }
queryWrapper.eq(CardValue::getStoreId, TokenUtil.getNowAccountInfo().getStoreId()); if (ObjectUtils.isNotEmpty(cardValue.getStoreId())){
queryWrapper.eq(CardValue::getStoreId,cardValue.getStoreId());
}else {
queryWrapper.eq(CardValue::getStoreId, TokenUtil.getNowAccountInfo().getStoreId());
}
queryWrapper.orderByDesc(CardValue::getCreateTime); queryWrapper.orderByDesc(CardValue::getCreateTime);
IPage page1 = page(page, queryWrapper); IPage page1 = page(page, queryWrapper);
List<CardValue> records = page1.getRecords(); List<CardValue> records = page1.getRecords();

View File

@ -222,7 +222,6 @@
}) })
return return
} }
console.log("2222222222", this.carValueId)
if (this.carValueId == '') { if (this.carValueId == '') {
uni.showToast({ uni.showToast({
title: "囤油卡为必填项", title: "囤油卡为必填项",