# Conflicts:
#	gasStation-uni/pages/index/index.vue
This commit is contained in:
wangh 2024-01-04 15:55:48 +08:00
commit 302c39b3dc
38 changed files with 450 additions and 397 deletions

View File

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

View File

@ -184,7 +184,7 @@
<el-radio-group v-model="form.timeType">
<!-- 0 -->
<el-radio label="0" style="display: flex;align-items: center" >
<div class="h-box"> <span>领券后立即生效有效期</span> <el-input placeholder="有效天数" type="number" style="width: 200px" v-model="form.validityZero">
<div class="h-box"> <span style="margin-right: 5px">领券后立即生效有效期 </span> <el-input placeholder="有效天数" type="number" style="width: 200px" v-model="form.validityZero">
<template slot="append"></template>
</el-input> </div>
@ -193,64 +193,27 @@
<!-- 1 -->
<el-radio label="1" style="display: flex;align-items: center" >
<div class="h-box">
<span> 固定有效周期固定开始日期</span>
<span style="margin-right: 5px"> 固定有效周期固定开始日期 </span>
<el-date-picker
v-model="form.effectiveDate"
type="date"
placeholder="选择日期">
</el-date-picker>
<span>有效期</span>
<span style="margin-right: 5px; margin-left: 5px">有效期</span>
<el-input type="number" placeholder="有效天数" style="width: 200px" v-model="form.validityOne"><template slot="append"></template></el-input>
</div>
</el-radio>
<!-- 2-->
<el-radio label="2" style="display: flex;align-items: center">
<div class="h-box">
领券后第 <el-input style="width: 200px" placeholder="1" v-model="form.validityDay">
<span style="margin-right: 5px">领券后第</span> <el-input style="width: 200px" placeholder="1" v-model="form.validityDay">
<template slot="append">天生效</template>
</el-input> <el-input type="number" placeholder="" style="width: 200px" v-model="form.validityTwo"><template slot="append"></template></el-input>
</el-input> <span style="margin-right: 5px; margin-left: 5px"></span> <el-input type="number" placeholder="" style="width: 200px" v-model="form.validityTwo"><template slot="append"></template></el-input>
</div>
</el-radio>
</el-radio-group>
</el-form-item>
<!-- <el-form-item label="可用时段" prop="availablePeriod">
<el-checkbox-group v-model="form.availablePeriod" size="mini" >
<el-checkbox-button v-for="city in cities" :label="city" :key="city">{{city}}</el-checkbox-button>
&lt;!&ndash; <el-checkbox-button v-for="(item,index) in cities" :key="index" :label="index">{{item}}</el-checkbox-button>&ndash;&gt;
</el-checkbox-group>
</el-form-item>
<el-form-item label="可用周期" prop="checkDateType">
<el-radio-group v-model="form.checkDateType">
<el-radio label="day">每天都可以使用</el-radio>
<el-radio label="week">每周都可以使用</el-radio>
<el-radio label="month">每月都可以使用</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="每周可用时段" prop="checkTime" v-if="form.checkDateType == 'week' ">
<el-checkbox-group v-model="form.checkTime" size="mini" >
<el-checkbox-button v-for="city in zhou" :label="city" :key="city">{{city}}</el-checkbox-button>
&lt;!&ndash; <el-checkbox-button v-for="(item,index) in cities" :key="index" :label="index">{{item}}</el-checkbox-button>&ndash;&gt;
</el-checkbox-group>
</el-form-item>
<el-form-item label="每月可用时段" prop="checkTime" v-if="form.checkDateType == 'month' " >
<el-checkbox-group v-model="form.checkTime" size="mini" @input="yueinput" >
<el-checkbox-button v-for="city in yue" :label="city" :key="city">{{city}}</el-checkbox-button>
&lt;!&ndash; <el-checkbox-button v-for="(item,index) in cities" :key="index" :label="index">{{item}}</el-checkbox-button>&ndash;&gt;
</el-checkbox-group>
<div>每个月的 <span style="color: red;" v-for="(item,index) in lookyue " :key="index">{{item }},</span> </div>
</el-form-item>-->
<!-- <el-form-item label="排除日期" prop="checkOutTime">-->
<!-- <el-date-picker clearable-->
<!-- v-model="form.checkOutTime"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择排除日期">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item label="互斥功能" prop="exclusiveFunction">
<el-radio-group v-model="form.exclusiveFunction">
<el-radio label="0">满减活动</el-radio>

View File

@ -103,7 +103,11 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
@Override
public IPage<ActiveConsumptionVOS> 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<ActiveConsumptionVOS> records = activeConsumptionVOSIPage.getRecords();

View File

@ -113,7 +113,11 @@ public class ActiveDiscountServiceImpl extends ServiceImpl<ActiveDiscountMapper,
if(ObjectUtils.isNotEmpty(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);
IPage page1 = page(page, queryWrapper);
//会员等级

View File

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

View File

@ -12,6 +12,8 @@ public class PaymentActiveDTO implements Serializable {
private double amount;
//可用油品Id
private Integer oilId;
//店铺id
private Integer storeId;
//会员等级
private Integer mtUserLevel;
}

View File

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

View File

@ -288,10 +288,12 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
* @return
*/
@Override
public List<ActiveAppletVO> select() {
public List<ActiveAppletVO> select(ActiveExchangeRecordDTO activeExchangeRecordDTO) {
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)){
ActiveAppletVO activeAppletVO = new ActiveAppletVO();
activeAppletVO.setName("消费有礼活动");
@ -305,7 +307,9 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
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)){
ActiveAppletVO activeAppletVO = new ActiveAppletVO();
activeAppletVO.setName("折扣营销活动");
@ -319,7 +323,9 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
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)){
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<CardValueAppletVO> cardValueAppletVOS = cardValueService.selectAllApplet(new CardValue());
CardValue cardValue = new CardValue();
cardValue.setStoreId(activeExchangeRecordDTO.getStoreId());
List<CardValueAppletVO> 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<ActiveDiscountPayVO> 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());
}
}
}
}

View File

@ -108,7 +108,11 @@ public class ActiveFullminusServiceImpl extends ServiceImpl<ActiveFullminusMappe
if(ObjectUtils.isNotEmpty(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);
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.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumption;
import com.fuint.business.marketingActivity.activeNewlyweds.dto.ActiveNewlywedsDTO;
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlyweds;
import com.fuint.business.marketingActivity.activeNewlyweds.service.ActiveNewlywedsChildService;
@ -64,8 +65,8 @@ public class ActiveNewlywedsController extends BaseController {
* @return 单条数据
*/
@GetMapping("applet")
public ResponseObject selectApplet() {
return getSuccessResult(this.activeNewlywedsService.selectApplet());
public ResponseObject selectApplet(@Param("activeConsumption") ActiveConsumption activeConsumption) {
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.extension.plugins.pagination.Page;
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.ActiveNewlywedsVO;
import com.fuint.business.marketingActivity.activeNewlyweds.dto.ActiveNewlywedsDTO;
@ -39,6 +40,7 @@ public interface ActiveNewlywedsService extends IService<ActiveNewlyweds> {
* @return
*/
ActiveNewlywedsVO getOneById(Serializable id);
ActiveNewlywedsVO getOneByIdApplet(ActiveConsumption activeConsumption);
/**
* 修改数据
@ -51,6 +53,6 @@ public interface ActiveNewlywedsService extends IService<ActiveNewlyweds> {
* 查询单条数据(小程序端)
* @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.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<ActiveNewlywedsMappe
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
@ -217,10 +256,10 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
}
@Override
public ActiveNewlywedsAppletVO selectApplet() {
public ActiveNewlywedsAppletVO selectApplet(ActiveConsumption activeConsumption) {
ActiveNewlywedsAppletVO activeNewlywedsAppletVO = new ActiveNewlywedsAppletVO();
//获取本店铺的推荐有礼活动
ActiveNewlywedsVO activeNewlywedsVO = getOneById(1);
ActiveNewlywedsVO activeNewlywedsVO = getOneByIdApplet(activeConsumption);
if (ObjectUtils.isNotEmpty(activeNewlywedsVO.getId())){
//活动时间
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.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.activeRecommend.dto.ActiveRecommendDTO;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommend;
@ -68,8 +69,8 @@ public class ActiveRecommendController extends BaseController {
* @return 单条数据
*/
@GetMapping("applet")
public ResponseObject selectApplet() {
return getSuccessResult(this.activeRecommendService.selectApplet());
public ResponseObject selectApplet(@Param("activeConsumption") ActiveConsumption activeConsumption) {
return getSuccessResult(this.activeRecommendService.selectApplet(activeConsumption));
}
/**

View File

@ -1,6 +1,7 @@
package com.fuint.business.marketingActivity.activeRecommend.service;
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.entity.ActiveRecommend;
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendAppletVO;
@ -29,6 +30,7 @@ public interface ActiveRecommendService extends IService<ActiveRecommend> {
* @return
*/
ActiveRecommendVO getOneById(Serializable id);
ActiveRecommendVO getOneByIdApplet(ActiveConsumption activeConsumption);
/**
* 修改数据
@ -41,6 +43,6 @@ public interface ActiveRecommendService extends IService<ActiveRecommend> {
* 查询单条数据(小程序端)
* @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.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<ActiveRecommendMappe
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
@ -161,10 +200,10 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
* @return
*/
@Override
public ActiveRecommendAppletVO selectApplet() {
public ActiveRecommendAppletVO selectApplet(ActiveConsumption activeConsumption) {
ActiveRecommendAppletVO activeRecommendAppletVO = new ActiveRecommendAppletVO();
//获取本店铺的推荐有礼活动
ActiveRecommendVO activeRecommendVO = getOneById(1);
ActiveRecommendVO activeRecommendVO = getOneByIdApplet(activeConsumption);
//邀请人获得
if (ObjectUtils.isNotEmpty(activeRecommendVO) && ObjectUtils.isNotEmpty(activeRecommendVO.getPoints())){
//积分

View File

@ -55,6 +55,14 @@ public class CardFuelRecord extends BaseEntity {
* 所得升数
*/
private Double incomeLitres;
/**
* 锁价单价
*/
private Double payAmount;
/**
* 支付金额
*/
private Double lockupPrice;
/**
* 支付方式 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#
*/
private String oilType;
/*
油品名称
*/
private String oilName;

View File

@ -216,8 +216,8 @@
<!--新增所有列-->
<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)
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})
</insert>
<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.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<JSONObject> jsonObjectList = JSONArray.parseArray(refuelMoney, JSONObject.class);
ArrayList<String> oilTypeList= new ArrayList<>();
ArrayList<String> 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<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("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<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.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);
}
}

View File

@ -28,6 +28,7 @@ public class CardFuleOrders extends Model<CardFuleOrders> {
private String orderNo;
//所属店铺ID
private Integer storeId;
private Integer chainStoreId;
//订单金额
private Double amount;
//支付金额
@ -42,6 +43,8 @@ public class CardFuleOrders extends Model<CardFuleOrders> {
private String type;
//油品类型00# 1-10# 2京0# 392# 495# 98# 3京92# 4京95#
private String oilType;
//油品名称
private String oilName;
//用户备注
private String remark;
//订单状态

View File

@ -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

View File

@ -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<CardValueRecord> {
//主键id
@TableId(type = IdType.AUTO)
@ -69,257 +68,14 @@ public class CardValueRecord extends Model<CardValueRecord> {
//更新时间
@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;
}
}

View File

@ -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
<where>
<if test="cardValueRecord.mtUserId != null">

View File

@ -154,6 +154,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
cardValueOrders.setPayType(cardValueRecordDTO.getPayType());
//用户信息
cardValueOrders.setStoreId(cardValueRecordDTO.getStoreId());
cardValueOrders.setChainStoreId(cardValueRecordDTO.getChainStoreId());
cardValueOrders.setMtUserId(ljUserVo.getId());
cardValueOrders.setName(ljUserVo.getName());
cardValueOrders.setMobile(ljUserVo.getMobile());
@ -601,7 +602,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
cardValueOrders.setPayTime(new Date());
cardValueOrdersService.updateById(cardValueOrders);
//用户余额
UserBalance userBalance = userBalanceService.selectUserBalanceByStorId(cardValueOrders.getMtUserId(),cardValueOrders.getStoreId());
UserBalance userBalance = userBalanceService.selectUserBalance(cardValueOrders.getMtUserId(),cardValueOrders.getChainStoreId());
//用户 (新用户新建 老用户叠加)
if (ObjectUtils.isNotEmpty(userBalance)){
//积分
@ -620,7 +621,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
userBalanceService.updateUserBalance(userBalance);
}else {
userBalance1.setMtUserId(cardValueOrders.getMtUserId());
userBalance1.setStoreId(cardValueOrders.getStoreId());
userBalance1.setChainStoreId(cardValueOrders.getChainStoreId());
//积分
if (ObjectUtils.isNotEmpty(cardValueOrders.getPoints())){
userBalance1.setPoints(cardValueOrders.getPoints());
@ -652,9 +653,6 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
cardFavorableRecord.setId(cardValueOrders.getCardRecordId());
cardFavorableRecord.setStatus("1");
/*LambdaQueryWrapper<CardFavorableRecord> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(CardFavorableRecord::getId,cardValueOrders.getCardRecordId());
lambdaQueryWrapper.eq(CardFavorableRecord::getStatus,"1");*/
cardFavorableRecordService.updateById(cardFavorableRecord);
}
//查询储值卡对应的优惠券列表

View File

@ -150,7 +150,11 @@ public class CardValueServiceImpl extends ServiceImpl<CardValueMapper, CardValue
if (ObjectUtils.isNotEmpty(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);
IPage page1 = page(page, queryWrapper);
List<CardValue> records = page1.getRecords();

View File

@ -28,6 +28,8 @@ public class CardValueOrders extends Model<CardValueOrders> {
private String orderNo;
//所属店铺ID
private Integer storeId;
//连锁店id
private Integer chainStoreId;
//订单金额
private Double amount;
//支付金额

View File

@ -101,7 +101,7 @@ public class UserBalanceServiceImpl extends ServiceImpl<UserBalanceMapper, UserB
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
QueryWrapper queryWrapper = new QueryWrapper<>();
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;
}

View File

@ -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 = {
}
]
}
}
}

View File

@ -6,20 +6,46 @@
<view class="my-text">样版页</view>
<view class="my-icons"></view>
</view>
<!-- 顶部区域 -->
</view>
</view>
</template>
<script>
import request from '../../utils/request';
export default {
data() {
return {
title: '',
List: [],
pageNo: 1,
pageSize: 10,
totalPage: '',
}
},
onLoad() {
this.resetting() //
this.getList() //
},
onPullDownRefresh() {
//
this.resetting() //
this.getList() //
uni.stopPullDownRefresh()
},
onReachBottom() {
//
if (this.pageNo >= this.totalPage) {
uni.showToast({
title: '没有下一页数据',
icon: 'none'
})
} else {
this.pageNo++
this.getList()
}
},
@ -27,6 +53,36 @@
},
methods: {
//
resetting() {
this.pageNo = 1
this.pageSize = 10
this.totalPage = ''
this.List = []
},
//
async getList() {
uni.showLoading({
title: '加载中'
});
let res = await request({
url: '网络请求',
method: 'get',
data: {
pageNo: this.pageNo,
pageSize: this.pageSize,
}
})
if (res.code == 200) {
uni.hideLoading(); //
if (this.pageNo != 1) {
this.List = this.ruleList.concat(res.result.records)
} else {
this.List = res.result.records
}
this.totalPage = res.result.pages
}
},
goback() {
uni.navigateBack()
}
@ -57,6 +113,7 @@
box-sizing: border-box;
padding: 0px 15px;
padding-top: 40px;
z-index: 99999;
.my-icons {
width: 20px;

View File

@ -181,6 +181,16 @@
}
},
onLoad(query) {
if (query.storeId) {
uni.setStorageSync("y_storeId", query.storeId)
}
if (query.type) {
uni.setStorageSync("y_type", query.type)
}
if (query.userId) {
uni.setStorageSync("y_userId", query.userId)
}
const q = decodeURIComponent(query.q) //
if (query.q) {
let str = q.split("?")[1];
@ -204,7 +214,9 @@
if (uni.getStorageSync("storeId")) {
this.storeId = uni.getStorageSync("storeId")
} else {
let storeId = "21";
uni.setStorageSync("storeId", storeId)
}
}
@ -783,4 +795,4 @@
color: white;
margin: 0 auto;
}
</style>
</style>

View File

@ -30,7 +30,7 @@
<text style="color: #999999;">|</text>
<view class="jg-box" @click="goOil()">
<view class="jg-box-title">囤油升数</view>
<view class="jg-box-nmb">{{refuelMoney[0].refuelMoney || 0 }}L</view>
<view class="jg-box-nmb">{{refuelMoney[0].incomeLitres || 0 }}L</view>
</view>
<text style="color: #999999;">|</text>
@ -167,12 +167,12 @@
return {
query: {
storeId: '',
chainStoreId: '',
couponType: '',
useStatus: 0,
pageNo: 1,
pageSize: 10
},
chainStoreId: uni.getStorageSync('chainStoreId'),
myPoints: 0,
cardsList: [],
refuelMoney: [],
@ -190,6 +190,7 @@
},
onShow() {
this.query.storeId = uni.getStorageSync("storeId")
this.query.chainStoreId = uni.getStorageSync('chainStoreId')
this.getUserBalance();
this.getGiftRecords();
this.getUserInfoList();
@ -204,6 +205,7 @@
}).then(res => {
if (res.data != null && res.data != "" && res.data != undefined) {
this.user = res.data
uni.setStorageSync('userId', res.data.id)
this.user.mobile = res.data.mobile.slice(0, 3) + "****" + res.data.mobile.slice(res.data
.mobile.length - 5, res.data.mobile.length - 1)
}
@ -292,10 +294,12 @@
}).then(res => {
if (res.data) {
this.cardBalance = res.data.cardBalance,
this.myPoints = res.data.points,
/* if (res.data.refuelMoney!=null && res.data.refuelMoney!=""){
this.refuelMoney = JSON.parse(res.data.refuelMoney);
} */
this.refuelMoney = JSON.parse(res.data.refuelMoney);
this.refuelMoney = JSON.parse(res.data.refuelMoney);
console.log("333333333333333", this.refuelMoney);
}
})
},
@ -311,19 +315,6 @@
})
},
//
getUserInfoList() {
request({
url: 'business/userManager/user/getByUniApp',
method: 'get',
params: {
chainStoreId: this.chainStoreId
}
}).then((res) => {
if (res.code == 200 && res.data != null) {
this.myPoints = res.data.points
}
})
},
toCoupons() {
uni.navigateTo({
url: '/pagesMy/Coupons/Coupons'

View File

@ -52,6 +52,9 @@
export default {
data() {
return {
query: {
storeId: ''
},
title: '',
activityList: [],
}
@ -60,6 +63,7 @@
},
onShow() {
this.query.storeId = uni.getStorageSync("storeId");
this.getData();
},
methods: {
@ -75,6 +79,7 @@
request({
url: 'business/marketingActivity/activeExchange/applet',
method: 'get',
params: this.query
}).then(res => {
console.log(res);
if (res.code == 200) {

View File

@ -56,8 +56,9 @@
<view style="width: 100%;display: flex;align-items: center;justify-content: space-between; ">
<view class="bai-box">
<view class="title-card">囤油卡</view>
<view class="">{{cardsList[cardsIndex].type || '暂无囤油'}}:{{cardsList[cardsIndex].oilType || '0'}}
<view class="">{{cardsList[cardsIndex].type || '暂无囤油'}}:{{cardsList[cardsIndex].oilName || '0'}}
</view>
<view>剩余油量{{cardsList[cardsIndex].incomeLitres}}L</view>
<!-- <view style="lins"> **** **** **** 970 </view> -->
</view>
<!-- <view class="">
@ -117,7 +118,7 @@
data() {
return {
query: {
storeId: '',
chainStoreId: '',
couponType: '',
useStatus: 0,
pageNo: 1,
@ -134,8 +135,8 @@
},
onShow() {
this.query.storeId = uni.getStorageSync("storeId")
this.getCardFuleRecords();
this.query.chainStoreId = uni.getStorageSync('chainStoreId');
// this.getCardFuleRecords();
this.getUserBalance()
},
methods: {
@ -176,12 +177,7 @@
if (res.code == 200) {
this.cardsList = res.data.records
if (this.cardsList.length != 0) {
this.toil = this.cardsList.length - 1
} else {
this.toil = this.cardsList.length
}
console.log(this.toil);
}
})
@ -195,6 +191,13 @@
console.log(res)
if (res.code == 200) {
this.cardBalance = res.data.cardBalance
this.cardsList = JSON.parse(res.data.refuelMoney)
if (this.cardsList.length != 0) {
this.toil = this.cardsList.length - 1
} else {
this.toil = this.cardsList.length
}
}
})
},

View File

@ -190,6 +190,9 @@
export default {
data() {
return {
query: {
storeId: ''
},
oilName: [],
title: '',
datas: [],
@ -200,6 +203,7 @@
},
onLoad(option) {
this.query.storeId = uni.getStorageSync("storeId");
this.title = option.name
console.log(option.name);
this.getData(option.name);
@ -212,9 +216,34 @@
url: '/pagesMy/invite/invite'
})
}
uni.navigateTo({
if (this.title == '消费有礼活动') {
uni.navigateTo({
url: '/pages/refuel/refuel'
})
}
if (this.title == '折扣营销活动') {
uni.navigateTo({
url: '/pages/refuel/refuel'
})
}
if (this.title == '满减营销活动') {
uni.navigateTo({
url: '/pages/refuel/refuel'
})
}
if (this.title == '储值卡充值活动') {
uni.navigateTo({
url: '/pagesHome/oilRecharge/oilRecharge'
})
}
if (this.title == '新人有礼活动') {
uni.navigateTo({
url: '/pagesMy/invite/invite'
})
}
/* uni.navigateTo({
url: '/pagesHome/oilRecharge/oilRecharge'
})
}) */
},
getData(name) {
uni.showLoading({
@ -224,6 +253,7 @@
request({
url: '/business/marketingActivity/activeConsumption/appletList',
method: 'get',
params: this.query
}).then(res => {
if (res.code == 200) {
this.datas = res.data,
@ -236,6 +266,7 @@
request({
url: '/business/marketingActivity/activeDiscount/appletList',
method: 'get',
params: this.query
}).then(res => {
if (res.code == 200) {
this.datas = res.data
@ -247,6 +278,7 @@
request({
url: '/business/marketingActivity/activeRecommend/applet',
method: 'get',
params: this.query
}).then(res => {
if (res.code == 200) {
this.datas = res.data
@ -258,6 +290,7 @@
request({
url: '/business/marketingActivity/activeNewlyweds/applet',
method: 'get',
params: this.query
}).then(res => {
if (res.code == 200) {
this.datas = res.data
@ -269,6 +302,7 @@
request({
url: '/business/marketingActivity/activeFullminus/appletList',
method: 'get',
params: this.query
}).then(res => {
if (res.code == 200) {
this.datas = res.data
@ -280,6 +314,7 @@
request({
url: '/business/marketingActivity/cardValue/appletList',
method: 'get',
params: this.query
}).then(res => {
if (res.code == 200) {
this.datas = res.data

View File

@ -149,6 +149,7 @@
export default {
data() {
return {
chainStoreId: '',
cardRecordId: '',
cardFavorableId: '',
storeId: '',
@ -197,7 +198,9 @@
},
components: {},
onLoad(option) {
this.storeId = uni.getStorageSync("storeId")
this.storeId = uni.getStorageSync("storeId");
this.chainStoreId = uni.getStorageSync('chainStoreId');
console.log("66666666666", this.chainStoreId);
this.actinput = option.id
this.cardFavorableId = option.cardFavorableId
this.cardRecordId = option.cardRecordId
@ -222,7 +225,6 @@
})
return
}
console.log("2222222222", this.carValueId)
if (this.carValueId == '') {
uni.showToast({
title: "囤油卡为必填项",
@ -240,6 +242,7 @@
mtStaffId: this.staffId,
id: this.carValueId,
storeId: this.storeId,
chainStoreId: this.chainStoreId,
cardFavorableId: this.cardFavorableId,
cardRecordId: this.cardRecordId
},
@ -295,6 +298,7 @@
mtStaffId: this.staffId,
id: this.carValueId,
storeId: this.storeId,
chainStoreId: this.chainStoreId,
cardFavorableId: this.cardFavorableId,
cardRecordId: this.cardRecordId
},

View File

@ -138,6 +138,11 @@
},
success: (rex) => {
console.log('请求成功', rex)
if (uni.getStorageSync("y_type") ==
'yaoqingyouli') {
this.activeRecommendRecords()
}
if (rex.data.code == 200) {
uni.setStorageSync('App-Token', rex.data.data
@ -174,6 +179,18 @@
}
})
},
async activeRecommendRecords() {
let res = await request({
url: "clientApi/sign/alipayLogin/getUserid",
method: 'post',
data: {
storeId: uni.getStorageSync("y_storeId"),
type: uni.getStorageSync("y_type"),
userId: uni.getStorageSync("y_userId"),
},
})
},
goback() {
uni.navigateBack()
}
@ -330,4 +347,4 @@
border: 1px solid #0078FF;
color: white;
}
</style>
</style>

View File

@ -23,7 +23,7 @@
</view>
</view>
<view class="x-box">
<view class="l-naniu">
<view class="l-naniu" @click="show = true">
<u-icon name="grid" color="#FCDB5A" size="18"></u-icon>
<text>面对面邀请</text>
</view>
@ -60,6 +60,11 @@
</view>
</view>
</view>
<u-popup :show="show" mode="center" :round="10" @close="close" @open="open">
<view class="popup_box">
<w-qrcode :options="options"></w-qrcode>
</view>
</u-popup>
</view>
</view>
@ -73,18 +78,34 @@
allAmount: 0.0,
activeRecommendRecordsList: [],
title: '',
userId: '',
storeId: '',
show: false,
options: {
code: 'https://www.tuofeng.cc/oilStation?storeId=' + uni.getStorageSync('storeId') + '&staffId=' + uni
.getStorageSync('storeId'),
// code: 'https://www.tuofeng.cc/oily?storeId=' + uni.getStorageSync('storeId') + ' &userId=' + uni
// .getStorageSync('userId'), //
size: 460, // 460460rpx
},
}
},
onLoad() {
console.log(uni.getStorageSync('userId'));
console.log(uni.getStorageSync('storeId'));
},
components: {
},
onShareAppMessage() {
return {
title: '来个油惠',
path: '/pages/index/index?userId=' + uni.getStorageSync('userId') + '&storeId=' + uni.getStorageSync(
'storeId') + '&type=yaoqingyouli',
success() {
console.log('分享成功');
},
@ -98,7 +119,13 @@
this.getActiveRecommendRecords();
},
methods: {
// https://www.tuofeng.cc/oilStation?storeId=19&staffId=45
close() {
this.show = false
},
open() {
},
getAllAmount() {
request({
url: 'business/marketingActivity/activeRecommendRecords/selectAllAmount',
@ -332,4 +359,19 @@
border: none;
box-shadow: 0px
}
</style>
.popup_box {
box-sizing: border-box;
padding: 15px;
}
button {
/* 清除默认边框 */
border: 0;
outline: none;
/*清除默认背景 */
margin: 0px;
padding: 0px !important;
background-color: transparent;
}
</style>

View File

@ -60,8 +60,9 @@
totalDetail: '',
show: false,
query: {
mtUserId: '',
storeId: '',
mtUserId: '',
chainStoreId: '',
recordName: '储值卡',
pageNo: 1,
pageSize: 10
@ -77,6 +78,8 @@
},
onShow() {
this.query.storeId = uni.getStorageSync("storeId")
this.query.chainStoreId = uni.getStorageSync('chainStoreId')
this.list = []
this.getUserBalance();
this.getAllOrderList();
@ -109,12 +112,18 @@
},
getUserBalance() {
request({
url: '/business/userManager/user/getUserBalance',
url: '/business/userManager/user/getUserBalanceApplet',
method: 'get',
params: this.query
}).then(res => {
console.log(res)
if (res.code == 200) {
this.cardBalance = res.data.cardBalance
if (res.data) {
this.cardBalance = res.data.cardBalance,
this.myPoints = res.data.points,
/* if (res.data.refuelMoney!=null && res.data.refuelMoney!=""){
this.refuelMoney = JSON.parse(res.data.refuelMoney);
} */
this.refuelMoney = JSON.parse(res.data.refuelMoney);
console.log("333333333333333", this.refuelMoney);
}
})
},

View File

@ -28,6 +28,14 @@
<view class="box-name">加油站名称</view>
<view class="moneyname">充值成功</view>
</view>
<view class="y-bt">
<view class="sizehui">油品类型</view>
<view class="sizehei">{{item.type}}</view>
</view>
<view class="y-bt">
<view class="sizehui">油品名称</view>
<view class="sizehei">{{item.oilName}}</view>
</view>
<view class="y-bt">
<view class="sizehui">订单金额</view>
<view class="sizehei">{{item.rechargeBalance}}</view>
@ -78,6 +86,7 @@
},
onShow() {
this.storeId = uni.getStorageSync("storeId");
this.list = []
this.getAllOrderList();
this.getUserBalance()