领券bug

This commit is contained in:
齐天大圣 2024-01-27 15:45:10 +08:00
parent 9d96f86dd6
commit d42435fe24
7 changed files with 64 additions and 172 deletions

View File

@ -62,10 +62,14 @@
<!-- <el-table-column label="员工id" align="center" prop="mtStaffId" />-->
<!-- <el-table-column label="兑换券id" align="center" prop="cardExchangeId" />-->
<el-table-column label="序号" align="center" prop="mtUserId" />
<!-- <el-table-column label="序号" align="center" prop="mtUserId" />-->
<el-table-column
type="index"
width="50">
</el-table-column>
<el-table-column label="手机号码" align="center" prop="mobile" />
<el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="头像" align="center" prop="photo" />
<!-- <el-table-column label="头像" align="center" prop="photo" />-->
<el-table-column label="核销人手机号" align="center" prop="staffMobile" />
<el-table-column label="核销人姓名" align="center" prop="realName" />
<el-table-column label="开始时间" align="center" prop="startTime" width="180">

View File

@ -269,20 +269,20 @@
<el-radio label="1">参数二维码</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="奖励显示" prop="rewardDisplay">
<!-- <el-form-item label="奖励显示" prop="rewardDisplay">
<el-radio-group v-model="ruleForm.rewardDisplay">
<el-radio label="0">优惠券总额</el-radio>
<el-radio label="1">成长值总额</el-radio>
<el-radio label="2">积分总额</el-radio>
</el-radio-group>
</el-form-item>
</el-form-item>-->
<el-form-item label="活动规则" prop="activeRule">
<el-input type="textarea" v-model="ruleForm.activeRule"></el-input>
</el-form-item>
<el-form-item label="活动状态" prop="status">
<el-radio-group v-model="ruleForm.status">
<el-radio label="0">进行中</el-radio>
<el-radio label="1">待生效</el-radio>
<!-- <el-radio label="1">待生效</el-radio>-->
<el-radio label="2">已结束</el-radio>
</el-radio-group>
</el-form-item>

View File

@ -49,16 +49,19 @@
<!-- </el-row>-->
<el-table v-loading="loading" :data="recordList" @selection-change="handleSelectionChange">
<el-table-column label="序号" align="center" prop="mtUserId" />
<el-table-column
type="index"
width="50">
</el-table-column>
<el-table-column label="手机号码" align="center" prop="mobile" />
<el-table-column label="名字" align="center" prop="name" />
<el-table-column label="头像" align="center" prop="photo" >
<!-- <el-table-column label="头像" align="center" prop="photo" >
<template slot-scope="scope">
<el-avatar size="medium" :src="imgUrl + scope.row.photo"></el-avatar>
</template>
</el-table-column>
</el-table-column>-->
<el-table-column label="开始时间" align="center" prop="startTime" width="180">
<template slot-scope="scope">

View File

@ -3,9 +3,11 @@ package com.fuint.business.marketingActivity.activeConsumption.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
@Data
public class ActiveConsumptionChild {
private static final long serialVersionUID = 231279479087493223L;
/**
@ -83,164 +85,4 @@ public class ActiveConsumptionChild {
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Date updateTime;
public String getTimeType() {
return timeType;
}
public void setTimeType(String timeType) {
this.timeType = timeType;
}
public Integer getValidityZero() {
return validityZero;
}
public void setValidityZero(Integer validityZero) {
this.validityZero = validityZero;
}
public Integer getValidityOne() {
return validityOne;
}
public void setValidityOne(Integer validityOne) {
this.validityOne = validityOne;
}
public Integer getValidityTwo() {
return validityTwo;
}
public void setValidityTwo(Integer validityTwo) {
this.validityTwo = validityTwo;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getActiveConsumptionId() {
return activeConsumptionId;
}
public void setActiveConsumptionId(Integer activeConsumptionId) {
this.activeConsumptionId = activeConsumptionId;
}
public String getActiveGift() {
return activeGift;
}
public void setActiveGift(String activeGift) {
this.activeGift = activeGift;
}
public Integer getGoodsIds() {
return goodsIds;
}
public void setGoodsIds(Integer goodsIds) {
this.goodsIds = goodsIds;
}
public String getGoodsName() {
return goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
public Integer getGoodsTotal() {
return goodsTotal;
}
public void setGoodsTotal(Integer goodsTotal) {
this.goodsTotal = goodsTotal;
}
public Integer getVouchersId() {
return vouchersId;
}
public void setVouchersId(Integer vouchersId) {
this.vouchersId = vouchersId;
}
public String getGiftCardName() {
return giftCardName;
}
public void setGiftCardName(String giftCardName) {
this.giftCardName = giftCardName;
}
public String getGiftCardType() {
return giftCardType;
}
public void setGiftCardType(String giftCardType) {
this.giftCardType = giftCardType;
}
public String getGiftCardDetail() {
return giftCardDetail;
}
public void setGiftCardDetail(String giftCardDetail) {
this.giftCardDetail = giftCardDetail;
}
public Integer getGiftCardTime() {
return giftCardTime;
}
public void setGiftCardTime(Integer giftCardTime) {
this.giftCardTime = giftCardTime;
}
public Integer getGiftCardTotal() {
return giftCardTotal;
}
public void setGiftCardTotal(Integer giftCardTotal) {
this.giftCardTotal = giftCardTotal;
}
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;
}
}

View File

@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumption;
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumptionChild;
import com.fuint.business.marketingActivity.activeConsumption.service.ActiveConsumptionChildService;
import com.fuint.business.marketingActivity.activeConsumption.service.ActiveConsumptionService;
import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionAppletVO;
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscount;
@ -123,6 +125,8 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
@Autowired
@Lazy
private ChainStoreConfigService chainStoreConfigService;
@Resource
private ActiveConsumptionChildService activeConsumptionChildService;
/**
* 分页查询所有
* @param
@ -861,8 +865,42 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
}
userBalanceService.save(userBalance1);
}
//查询改活动下的卡券列表
LambdaQueryWrapper<ActiveConsumptionChild> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveConsumptionChild::getActiveConsumptionId,activeConsumptionVO.getActiveId());
List<ActiveConsumptionChild> list = activeConsumptionChildService.list(queryWrapper);
if (ObjectUtils.isNotEmpty(list)){
for (ActiveConsumptionChild activeConsumptionChild : list) {
if (ObjectUtils.isNotEmpty(activeConsumptionChild) && activeConsumptionChild.getActiveGift().equals("1")){
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
cardFavorableRecord.setCardFavorableId(activeConsumptionChild.getVouchersId());
cardFavorableRecord.setStoreId(storeId1);
cardFavorableRecord.setMtUserId(TokenUtil.getNowAccountInfo().getId());
cardFavorableRecord.setName(ljUserVo.getName());
cardFavorableRecord.setMobile(ljUserVo.getMobile());
cardFavorableRecord.setStatus("0");
cardFavorableRecord.setExchangeFrom("充值送券");
cardFavorableRecordService.addCardFavorableRecord(cardFavorableRecord);
//兑换券
}else if (ObjectUtils.isNotEmpty(activeConsumptionChild) && activeConsumptionChild.getActiveGift().equals("2")){
CardExchangeRecord cardExchangeRecord = new CardExchangeRecord();
cardExchangeRecord.setCardExchangeId(activeConsumptionChild.getVouchersId());
cardExchangeRecord.setStoreId(storeId1);
cardExchangeRecord.setMtUserId(ljUserVo.getId());
cardExchangeRecord.setName(ljUserVo.getName());
cardExchangeRecord.setMobile(ljUserVo.getMobile());
cardExchangeRecord.setPhoto(ljUserVo.getAvatar());
cardExchangeRecord.setStatus("0");
cardExchangeRecord.setExchangeFrom("充值送券");
cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord);
}
}
}
//优惠券
if (StringUtils.isNotEmpty(activeConsumptionVO.getActiveGift()) && activeConsumptionVO.getActiveGift().equals("1")){
//if (StringUtils.isNotEmpty(activeConsumptionVO.getActiveGift()) && activeConsumptionVO.getActiveGift().equals("1")){
/*if (ObjectUtils.isNotEmpty(list) && activeConsumptionVO.getActiveGift().equals("1")){
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
cardFavorableRecord.setCardFavorableId(activeConsumptionVO.getVouchersId());
cardFavorableRecord.setStoreId(storeId1);
@ -884,7 +922,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
cardExchangeRecord.setStatus("0");
cardExchangeRecord.setExchangeFrom("充值送券");
cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord);
}
}*/
}
}
}

View File

@ -97,7 +97,7 @@ public class ActiveNewlywedsRecordsServiceImpl extends ServiceImpl<ActiveNewlywe
}
}
//用户余额
UserBalance userBalance = userBalanceService.selectUserBalance(userId,ljUserVo.getChainStoreId());
UserBalance userBalance = userBalanceService.selectUserBalance(userId,nowAccountInfo.getChainStoreId());
//积分
if (ObjectUtils.isNotEmpty(userBalance.getPoints()) && ObjectUtils.isNotEmpty(activeNewlyweds.getPoints())){
userBalance.setPoints(userBalance.getPoints() + activeNewlyweds.getPoints());

View File

@ -17,6 +17,8 @@ import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.Date;
import java.util.List;
@ -126,7 +128,10 @@ public class CardExchangeRecordServiceImpl extends ServiceImpl<CardExchangeRecor
cardExchangeRecord.setGiftName(cardExchange.getGiftName());
cardExchangeRecord.setDescription(cardExchange.getUseInstructions());
cardExchangeRecord.setStartTime(new Date());
cardExchangeRecord.setOutTime(new Date(new Date().getTime() + cardExchange.getValidity() * 86400000));
LocalDate today = LocalDate.now();
LocalDate localDate = today.plusDays(cardExchange.getValidity());
Date from = Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
cardExchangeRecord.setOutTime(from);
return save(cardExchangeRecord);
}
}