修改bug

This commit is contained in:
齐天大圣 2024-01-03 09:11:56 +08:00
parent ba0c5935ac
commit 5d2b98d6fa
21 changed files with 214 additions and 785 deletions

View File

@ -61,9 +61,9 @@
</template>
</el-table-column>
<el-table-column label="满减金额" align="center" prop="fullDeduction" >
<el-table-column label="满减金额" align="center" prop="satisfiedAmount" >
<template slot-scope="scope">
<el-tag effect="plain" type="success" >{{scope.row.fullDeduction}}</el-tag>
<el-tag effect="plain" type="success" >{{scope.row.satisfiedAmount}}</el-tag>
</template>
</el-table-column>
<el-table-column label="优惠金额" align="center" prop="discountAmount" >
@ -215,10 +215,10 @@
</el-radio-group>
</el-form-item>
<el-form-item label="可用时段" prop="availablePeriod">
<!-- <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>
<!-- <el-checkbox-button v-for="(item,index) in cities" :key="index" :label="index">{{item}}</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">
@ -231,17 +231,17 @@
<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>
<!-- <el-checkbox-button v-for="(item,index) in cities" :key="index" :label="index">{{item}}</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>
<!-- <el-checkbox-button v-for="(item,index) in cities" :key="index" :label="index">{{item}}</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>-->
<!-- <el-form-item label="排除日期" prop="checkOutTime">-->
<!-- <el-date-picker clearable-->

View File

@ -73,7 +73,7 @@ public class CardFavorableController extends BaseController {
}
/**
* 增数据
* 建优惠券
*
* @param cardFavorableDTO 实体对象
* @return 新增结果

View File

@ -100,8 +100,8 @@ public class CardFavorableRecordController extends BaseController {
* @return 新增结果
*/
@GetMapping("isDrawDown")
public ResponseObject isDrawDown() {
return getSuccessResult(this.cardFavorableRecordService.isDrawDown());
public ResponseObject isDrawDown(CardFavorableRecord cardFavorableRecord) {
return getSuccessResult(this.cardFavorableRecordService.isDrawDown(cardFavorableRecord));
}
/**

View File

@ -6,8 +6,8 @@ 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 lombok.Data;
import java.io.Serializable;
/**
* (CardFavorable)表实体类
@ -16,6 +16,7 @@ import java.io.Serializable;
* @since 2023-11-07 11:02:06
*/
@SuppressWarnings("serial")
@Data
public class CardFavorable extends Model<CardFavorable> {
//主键id
@TableId(type = IdType.AUTO)
@ -91,289 +92,5 @@ public class CardFavorable extends Model<CardFavorable> {
//更新时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getChainStorId() {
return chainStorId;
}
public void setChainStorId(Integer chainStorId) {
this.chainStorId = chainStorId;
}
public Integer getStoreId() {
return storeId;
}
public void setStoreId(Integer storeId) {
this.storeId = storeId;
}
public String getEffectiveDateType() {
return effectiveDateType;
}
public void setEffectiveDateType(String effectiveDateType) {
this.effectiveDateType = effectiveDateType;
}
public Date getEffectiveDateStart() {
return effectiveDateStart;
}
public void setEffectiveDateStart(Date effectiveDateStart) {
this.effectiveDateStart = effectiveDateStart;
}
public String getIsonline() {
return isonline;
}
public void setIsonline(String isonline) {
this.isonline = isonline;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getDiscountType() {
return discountType;
}
public void setDiscountType(String discountType) {
this.discountType = discountType;
}
public String getOilType() {
return oilType;
}
public void setOilType(String oilType) {
this.oilType = oilType;
}
public Double getFullDeduction() {
return fullDeduction;
}
public void setFullDeduction(Double fullDeduction) {
this.fullDeduction = fullDeduction;
}
public Double getDiscountAmount() {
return discountAmount;
}
public void setDiscountAmount(Double discountAmount) {
this.discountAmount = discountAmount;
}
public Double getSatisfiedAmount() {
return satisfiedAmount;
}
public void setSatisfiedAmount(Double satisfiedAmount) {
this.satisfiedAmount = satisfiedAmount;
}
public Double getSpecialDiscount() {
return specialDiscount;
}
public void setSpecialDiscount(Double specialDiscount) {
this.specialDiscount = specialDiscount;
}
public Double getDiscountOffset() {
return discountOffset;
}
public void setDiscountOffset(Double discountOffset) {
this.discountOffset = discountOffset;
}
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 Date getEffectiveDate() {
return effectiveDate;
}
public void setEffectiveDate(Date effectiveDate) {
this.effectiveDate = effectiveDate;
}
public String getValidityDay() {
return validityDay;
}
public void setValidityDay(String validityDay) {
this.validityDay = validityDay;
}
public String getAvailablePeriod() {
return availablePeriod;
}
public void setAvailablePeriod(String availablePeriod) {
this.availablePeriod = availablePeriod;
}
public String getCheckDateType() {
return checkDateType;
}
public void setCheckDateType(String checkDateType) {
this.checkDateType = checkDateType;
}
public String getCheckTime() {
return checkTime;
}
public void setCheckTime(String checkTime) {
this.checkTime = checkTime;
}
public Date getCheckOutTime() {
return checkOutTime;
}
public void setCheckOutTime(Date checkOutTime) {
this.checkOutTime = checkOutTime;
}
public String getExclusiveFunction() {
return exclusiveFunction;
}
public void setExclusiveFunction(String exclusiveFunction) {
this.exclusiveFunction = exclusiveFunction;
}
public String getClaimRule() {
return claimRule;
}
public void setClaimRule(String claimRule) {
this.claimRule = claimRule;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public String getQrCodeLink() {
return qrCodeLink;
}
public void setQrCodeLink(String qrCodeLink) {
this.qrCodeLink = qrCodeLink;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
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;
}
/**
* 获取主键值
*
* @return 主键值
*/
@Override
protected Serializable pkVal() {
return this.id;
}
}

View File

@ -6,6 +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 lombok.Data;
import java.io.Serializable;
@ -16,6 +17,7 @@ import java.io.Serializable;
* @since 2023-11-07 11:02:58
*/
@SuppressWarnings("serial")
@Data
public class CardFavorableRecord extends Model<CardFavorableRecord> {
//主键id
@TableId(type = IdType.AUTO)
@ -53,145 +55,5 @@ public class CardFavorableRecord extends Model<CardFavorableRecord> {
private String updateBy;
//更新时间
private Date updateTime;
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 Integer getChainStorId() {
return chainStorId;
}
public void setChainStorId(Integer chainStorId) {
this.chainStorId = chainStorId;
}
public Integer getCardFavorableId() {
return cardFavorableId;
}
public void setCardFavorableId(Integer cardFavorableId) {
this.cardFavorableId = cardFavorableId;
}
public Integer getStoreId() {
return storeId;
}
public void setStoreId(Integer storeId) {
this.storeId = storeId;
}
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 String getTicketCode() {
return ticketCode;
}
public void setTicketCode(String ticketCode) {
this.ticketCode = ticketCode;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public String getExchangeFrom() {
return exchangeFrom;
}
public void setExchangeFrom(String exchangeFrom) {
this.exchangeFrom = exchangeFrom;
}
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;
}
/**
* 获取主键值
*
* @return 主键值
*/
@Override
protected Serializable pkVal() {
return this.id;
}
}

View File

@ -71,7 +71,8 @@
LEFT JOIN card_favorable_record cfr ON cf.id = cfr.card_favorable_id
WHERE
cfr.mt_user_id = #{cardFavorableDTOS.id}
and cfr.status = #{cardFavorableDTOS.useStatus} UNION ALL
and cfr.status = #{cardFavorableDTOS.useStatus}
and cfr.store_id = #{cardFavorableDTOS.storeId} UNION ALL
SELECT
'兑换券' AS couponType,
ce.NAME couponName, ce.id id, ce.count couponAmount, ce.use_instructions couponContent
@ -81,7 +82,8 @@
WHERE
cer.mt_user_id = #{cardFavorableDTOS.id}
and ce.type = 0
and cer.status = #{cardFavorableDTOS.useStatus} UNION ALL
and cer.status = #{cardFavorableDTOS.useStatus}
and cer.store_id = #{cardFavorableDTOS.storeId} UNION ALL
SELECT
'洗车券' AS couponType,
ce.NAME couponName, ce.id id, ce.count couponAmount, ce.use_instructions couponContent
@ -91,7 +93,8 @@
WHERE
cer.mt_user_id = #{cardFavorableDTOS.id}
and ce.type = 1
and cer.status = #{cardFavorableDTOS.useStatus} UNION ALL
and cer.status = #{cardFavorableDTOS.useStatus}
and cer.store_id = #{cardFavorableDTOS.storeId} UNION ALL
SELECT
'洗车卡' AS couponType,
ce.NAME couponName, ce.id id, ce.count couponAmount, ce.use_instructions couponContent
@ -101,7 +104,8 @@
WHERE
cer.mt_user_id = #{cardFavorableDTOS.id}
and ce.type = 2
and cer.status = #{cardFavorableDTOS.useStatus}) AS card_favorables
and cer.status = #{cardFavorableDTOS.useStatus}
and cer.store_id = #{cardFavorableDTOS.storeId}) AS card_favorables
<where>
<if test="cardFavorableDTOS.couponType != null">
and card_favorables.couponType = #{cardFavorableDTOS.couponType}

View File

@ -47,6 +47,6 @@ public interface CardFavorableRecordService extends IService<CardFavorableRecord
* 小程序端判断是否领取优惠券
* @return
*/
boolean isDrawDown();
boolean isDrawDown(CardFavorableRecord cardFavorableRecord);
}

View File

@ -20,7 +20,7 @@ public interface CardFavorableService extends IService<CardFavorable> {
/**
* 新增数据
* @param cardFavorable
* @param cardFavorableDTO
* @return
*/
Boolean add(CardFavorableDTO cardFavorableDTO);
@ -50,7 +50,7 @@ public interface CardFavorableService extends IService<CardFavorable> {
/**
* 修改数据
* @param cardFavorable
* @param cardFavorableDTO
* @return
*/
Boolean updateOneById(CardFavorableDTO cardFavorableDTO);

View File

@ -10,6 +10,7 @@ import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable;
import com.fuint.business.marketingActivity.cardFavorable.mapper.CardFavorableRecordMapper;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService;
import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableRecordVO;
import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.vo.LJUserVo;
@ -37,6 +38,8 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
private CardFavorableRecordMapper cardFavorableRecordMapper;
@Resource
private LJUserService userService;
@Resource
private CardFavorableService cardFavorableService;
/**
* 分页查询所有数据
* @param page
@ -102,19 +105,36 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer userId = nowAccountInfo.getId();
LJUserVo ljUserVo = userService.selectUserById(userId);
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
//优惠券
for (Integer id : idList.getIdList()) {
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
CardFavorable cardFavorable = cardFavorableService.getById(id);
if (ObjectUtils.isNotEmpty(cardFavorable) && ObjectUtils.isNotEmpty(cardFavorable.getTimeType())){
if (cardFavorable.getTimeType().equals("0")){
cardFavorableRecord.setStartTime(new Date());
long endTimeL = new Date().getTime() + cardFavorable.getValidityZero() * 86400000;
cardFavorableRecord.setEndTime(new Date(endTimeL));
}else if (cardFavorable.getTimeType().equals("1")){
cardFavorableRecord.setStartTime(cardFavorable.getEffectiveDate());
long endTimeM = cardFavorable.getEffectiveDate().getTime() + cardFavorable.getValidityOne() * 86400000;
cardFavorableRecord.setEndTime(new Date(endTimeM));
}else {
long startTimeN = new Date().getTime() + Integer.parseInt(cardFavorable.getValidityDay()) * 86400000L;
long endTimeN = startTimeN + cardFavorable.getValidityTwo() * 86400000L;
cardFavorableRecord.setStartTime(new Date(startTimeN));
cardFavorableRecord.setEndTime(new Date(endTimeN));
}
cardFavorableRecord.setCardFavorableId(id);
cardFavorableRecord.setChainStorId(nowAccountInfo.getChainStoreId());
cardFavorableRecord.setStoreId(nowAccountInfo.getStoreId());
cardFavorableRecord.setStoreId(cardFavorable.getStoreId());
cardFavorableRecord.setMtUserId(userId);
cardFavorableRecord.setName(ljUserVo.getName());
cardFavorableRecord.setMobile(ljUserVo.getMobile());
cardFavorableRecord.setName(nowAccountInfo.getRealName());
cardFavorableRecord.setExchangeFrom("店铺发券");
cardFavorableRecord.setStatus("0");
save = save(cardFavorableRecord);
}
}
return save;
}
@ -123,13 +143,13 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
* @return
*/
@Override
public boolean isDrawDown() {
public boolean isDrawDown(CardFavorableRecord cardFavorableRecord) {
boolean isDrawDown = false;
//登录用户信息
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LambdaQueryWrapper<CardFavorableRecord> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CardFavorableRecord::getMtUserId,nowAccountInfo.getId());
queryWrapper.eq(CardFavorableRecord::getStoreId,nowAccountInfo.getStoreId());
queryWrapper.eq(CardFavorableRecord::getStoreId,cardFavorableRecord.getStoreId());
//如果领过券 就不让领了
List<CardFavorableRecord> list = list(queryWrapper);
if (CollectionUtils.isEmpty(list)){

View File

@ -21,6 +21,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
/**
@ -53,21 +54,11 @@ public class CardFavorableServiceImpl extends ServiceImpl<CardFavorableMapper, C
}
//转换油品类型格式
String oil = "";
String period = "";
String checkTime = "";
for (String s : cardFavorableDTO.getOilType()) {
oil += s + ",";
}
cardFavorable.setOilType(oil);
//转换可用时段类型
for (String s : cardFavorableDTO.getAvailablePeriod()) {
period += s + ",";
}
cardFavorable.setAvailablePeriod(period);
for (String s : cardFavorableDTO.getCheckTime()) {
period += s + ",";
}
cardFavorable.setCheckTime(checkTime);
return save(cardFavorable);
}
@ -79,7 +70,7 @@ public class CardFavorableServiceImpl extends ServiceImpl<CardFavorableMapper, C
*/
@Override
public IPage selectAllApplet(Page page, CardFavorable cardFavorable) {
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
Integer storeId = cardFavorable.getStoreId();
//构建查询条件
LambdaQueryWrapper<CardFavorable> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CardFavorable::getStoreId,storeId);
@ -98,7 +89,7 @@ public class CardFavorableServiceImpl extends ServiceImpl<CardFavorableMapper, C
if(ObjectUtils.isNotEmpty(cardFavorable.getIsonline())) {
queryWrapper.eq(CardFavorable::getIsonline,cardFavorable.getIsonline());
}
queryWrapper.eq(CardFavorable::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
queryWrapper.eq(CardFavorable::getStoreId,storeId);
queryWrapper.orderByDesc(CardFavorable::getCreateTime);
IPage page1 = page(page, queryWrapper);
List<CardFavorable> records = page1.getRecords();
@ -152,10 +143,9 @@ public class CardFavorableServiceImpl extends ServiceImpl<CardFavorableMapper, C
CardFavorable favorable = getById(id);
BeanUtils.copyProperties(favorable,cardFavorableVO);
//获取油号
cardFavorableVO.setOilType(favorable.getOilType().split(","));
//获取时间段
cardFavorableVO.setAvailablePeriod(favorable.getAvailablePeriod().split(","));
cardFavorableVO.setCheckTime(favorable.getCheckTime().split(","));
cardFavorableVO.setOilType(Arrays.stream(favorable.getOilType().split(","))
.map(Integer::valueOf)
.toArray(Integer[]::new));
return cardFavorableVO;
}
@ -170,21 +160,10 @@ public class CardFavorableServiceImpl extends ServiceImpl<CardFavorableMapper, C
BeanUtils.copyProperties(cardFavorableDTO,cardFavorable);
//转换油品类型格式
String oil = "";
String period = "";
String checkTime = "";
for (String s : cardFavorableDTO.getOilType()) {
oil += s + ",";
}
cardFavorable.setOilType(oil);
//转换可用时段类型
for (String s : cardFavorableDTO.getAvailablePeriod()) {
period += s + ",";
}
cardFavorable.setAvailablePeriod(period);
for (String s : cardFavorableDTO.getCheckTime()) {
checkTime += s + ",";
}
cardFavorable.setCheckTime(checkTime);
if (cardFavorableDTO.getIsonline().equals("1")){
cardFavorable.setStatus("1");
}

View File

@ -3,6 +3,7 @@ package com.fuint.business.marketingActivity.cardFavorable.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@ -14,6 +15,7 @@ import java.util.Date;
* @since 2023-11-07 11:02:06
*/
@SuppressWarnings("serial")
@Data
public class CardFavorableVO extends Model<CardFavorableVO> {
//主键id
@TableId(type = IdType.AUTO)
@ -31,7 +33,7 @@ public class CardFavorableVO extends Model<CardFavorableVO> {
//优惠类型 0满减券 1折扣券
private String discountType;
//可用油品 092# 1: 95# 298# 30# 4-10# 5 LNG 6CNG 7京92# 8京95# 9京0#
private String[] oilType;
private Integer[] oilType;
private String oilTypes;
//满减金额
private Double fullDeduction;
@ -86,296 +88,5 @@ public class CardFavorableVO extends Model<CardFavorableVO> {
//更新时间
private Date updateTime;
public String[] getOilType() {
return oilType;
}
public void setOilType(String[] oilType) {
this.oilType = oilType;
}
public String getOilTypes() {
return oilTypes;
}
public void setOilTypes(String oilTypes) {
this.oilTypes = oilTypes;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getChainStorId() {
return chainStorId;
}
public void setChainStorId(Integer chainStorId) {
this.chainStorId = chainStorId;
}
public Integer getStoreId() {
return storeId;
}
public void setStoreId(Integer storeId) {
this.storeId = storeId;
}
public String getEffectiveDateType() {
return effectiveDateType;
}
public void setEffectiveDateType(String effectiveDateType) {
this.effectiveDateType = effectiveDateType;
}
public Date getEffectiveDateStart() {
return effectiveDateStart;
}
public void setEffectiveDateStart(Date effectiveDateStart) {
this.effectiveDateStart = effectiveDateStart;
}
public String getIsonline() {
return isonline;
}
public void setIsonline(String isonline) {
this.isonline = isonline;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getDiscountType() {
return discountType;
}
public void setDiscountType(String discountType) {
this.discountType = discountType;
}
public Double getFullDeduction() {
return fullDeduction;
}
public void setFullDeduction(Double fullDeduction) {
this.fullDeduction = fullDeduction;
}
public Double getDiscountAmount() {
return discountAmount;
}
public void setDiscountAmount(Double discountAmount) {
this.discountAmount = discountAmount;
}
public Double getSatisfiedAmount() {
return satisfiedAmount;
}
public void setSatisfiedAmount(Double satisfiedAmount) {
this.satisfiedAmount = satisfiedAmount;
}
public Double getSpecialDiscount() {
return specialDiscount;
}
public void setSpecialDiscount(Double specialDiscount) {
this.specialDiscount = specialDiscount;
}
public Double getDiscountOffset() {
return discountOffset;
}
public void setDiscountOffset(Double discountOffset) {
this.discountOffset = discountOffset;
}
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 Date getEffectiveDate() {
return effectiveDate;
}
public void setEffectiveDate(Date effectiveDate) {
this.effectiveDate = effectiveDate;
}
public String getValidityDay() {
return validityDay;
}
public void setValidityDay(String validityDay) {
this.validityDay = validityDay;
}
public String[] getAvailablePeriod() {
return availablePeriod;
}
public void setAvailablePeriod(String[] availablePeriod) {
this.availablePeriod = availablePeriod;
}
public String getCheckDateType() {
return checkDateType;
}
public void setCheckDateType(String checkDateType) {
this.checkDateType = checkDateType;
}
public String[] getCheckTime() {
return checkTime;
}
public void setCheckTime(String[] checkTime) {
this.checkTime = checkTime;
}
public Date getCheckOutTime() {
return checkOutTime;
}
public void setCheckOutTime(Date checkOutTime) {
this.checkOutTime = checkOutTime;
}
public String getExclusiveFunction() {
return exclusiveFunction;
}
public void setExclusiveFunction(String exclusiveFunction) {
this.exclusiveFunction = exclusiveFunction;
}
public String getClaimRule() {
return claimRule;
}
public void setClaimRule(String claimRule) {
this.claimRule = claimRule;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public String getQrCodeLink() {
return qrCodeLink;
}
public void setQrCodeLink(String qrCodeLink) {
this.qrCodeLink = qrCodeLink;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
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;
}
/**
* 获取主键值
*
* @return 主键值
*/
@Override
protected Serializable pkVal() {
return this.id;
}
}

View File

@ -45,6 +45,21 @@ public class CardValueController extends BaseController {
return getSuccessResult(this.cardValueService.select(page, cardValue));
}
/**
* 分页查询所有数据(小程序端)
* @param pageNo
* @param pageSize
* @param cardValue
* @return
*/
@GetMapping("appletL")
public ResponseObject selectAllApplet(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
@Param("cardValue") CardValue cardValue) {
Page page = new Page(pageNo, pageSize);
return getSuccessResult(this.cardValueService.selectAllApplet(page, cardValue));
}
/**
* 查询所有数据(小程序端)
* @param cardValue

View File

@ -27,6 +27,14 @@ public interface CardValueService extends IService<CardValue> {
*/
IPage select(Page page, CardValue cardValue);
/**
* 小程序端
* @param page
* @param cardValue
* @return
*/
IPage selectAllApplet(Page page, CardValue cardValue);
/**
* 通过主键查询单条数据(充值)
* @param id

View File

@ -18,8 +18,11 @@ import com.fuint.business.commission.service.CommissionRecordService;
import com.fuint.business.integral.entity.IntegralDetail;
import com.fuint.business.integral.service.IntegralDetailService;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchange;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeService;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService;
import com.fuint.business.marketingActivity.cardValue.dto.CardValueRecordDTO;
import com.fuint.business.marketingActivity.cardValue.entity.CardValueChild;
@ -97,6 +100,8 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
private CardFavorableService cardFavorableService;
@Resource
private CardExchangeService cardExchangeService;
@Resource
private CardFavorableRecordService cardFavorableRecordService;
/**
* 储值卡充值新增
* @param cardValueRecordDTO
@ -134,16 +139,43 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
if (CollectionUtils.isNotEmpty(cardValueVouchers)) {
for (CardFavorable cardValueVoucher : cardValueVouchers) {
cardValueOrders.setCardFavorableId(cardValueVoucher.getId());
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
cardFavorableRecord.setCardFavorableId(cardValueVoucher.getId());
cardFavorableRecord.setStoreId(nowAccountInfo.getStoreId());
cardFavorableRecord.setMtUserId(nowAccountInfo.getId());
cardFavorableRecord.setName(nowAccountInfo.getRealName());
cardFavorableRecord.setMobile(ljUserVo.getMobile());
cardFavorableRecord.setStatus("0");
cardFavorableRecord.setExchangeFrom("充值送券");
cardFavorableRecordService.save(cardFavorableRecord);
/*
if (cardValue.getRechargeBalance() >= cardValueVoucher.getSatisfiedAmount()) {
cardFavorableValue += cardValueVoucher.getDiscountAmount();
}
}*/
}
}
//查询储值卡对应的兑换券列表
List<CardExchange> cardExchangeVouchers = getCardExchangeVouchers(cardValue);
if (CollectionUtils.isNotEmpty(cardExchangeVouchers)){
for (CardExchange cardExchangeVoucher : cardExchangeVouchers) {
CardExchangeRecord cardExchangeRecord = new CardExchangeRecord();
cardValueOrders.setCardExchangeId(cardExchangeVoucher.getId());
cardExchangeRecord.setCardExchangeId(cardExchangeVoucher.getId());
cardExchangeRecord.setStoreId(ljUserVo.getStoreId());
cardExchangeRecord.setMtUserId(ljUserVo.getId());
cardExchangeRecord.setName(ljUserVo.getName());
cardExchangeRecord.setMobile(ljUserVo.getMobile());
cardExchangeRecord.setPhoto(ljUserVo.getAvatar());
cardExchangeRecord.setMtStaffId(ljStaff.getId());
cardExchangeRecord.setRealName(ljStaff.getRealName());
cardExchangeRecord.setStaffMobile(ljStaff.getMobile());
cardExchangeRecord.setExchangeName(cardExchangeVoucher.getName());
cardExchangeRecord.setExchangeFrom("充值送券");
cardExchangeRecord.setGiftName(cardExchangeVoucher.getGiftName());
cardExchangeRecord.setDescription(cardExchangeVoucher.getUseInstructions());
cardExchangeRecord.setStatus("0");
cardExchangeRecord.setStartTime(cardExchangeVoucher.getCreateTime());
cardExchangeRecord.setEndTime(cardExchangeVoucher.getOutTime());
}
}
//订单号

View File

@ -19,6 +19,7 @@ import com.fuint.business.marketingActivity.cardValue.service.CardValueChildServ
import com.fuint.business.marketingActivity.cardValue.service.CardValueService;
import com.fuint.business.marketingActivity.cardValue.vo.CardValueAppletVO;
import com.fuint.business.marketingActivity.cardValue.vo.CardValueVO;
import com.fuint.business.marketingActivity.cardValue.vo.CardValueVOs;
import com.fuint.business.store.service.StoreService;
import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.common.util.TokenUtil;
@ -88,6 +89,56 @@ public class CardValueServiceImpl extends ServiceImpl<CardValueMapper, CardValue
return page1;
}
/**
* 分页查询所有数据(小程序端)
* @param page
* @param cardValue
* @return
*/
@Override
public IPage selectAllApplet(Page page, CardValue cardValue) {
LambdaQueryWrapper<CardValue> queryWrapper = new LambdaQueryWrapper<>();
//构建查询条件
if (ObjectUtils.isNotEmpty(cardValue.getIsonline())){
queryWrapper.eq(CardValue::getIsonline,cardValue.getIsonline());
}
if (ObjectUtils.isNotEmpty(cardValue.getActiveStatus())){
queryWrapper.eq(CardValue::getActiveStatus,cardValue.getActiveStatus());
}
queryWrapper.eq(CardValue::getStoreId, TokenUtil.getNowAccountInfo().getStoreId());
queryWrapper.orderByDesc(CardValue::getCreateTime);
IPage page1 = page(page, queryWrapper);
List<CardValue> records = page1.getRecords();
CardValueVOs cardValueVO = new CardValueVOs();
ArrayList<CardValueVOs> cardValueVOs = new ArrayList<>();
//返回储值卡活动进度状态
for (CardValue record : records) {
if (ObjectUtils.isNotEmpty(record)){
LambdaQueryWrapper<CardValueChild> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(CardValueChild::getCardValueId,record.getId());
List<CardValueChild> list = cardValueChildService.list(lambdaQueryWrapper);
if (CollectionUtils.isNotEmpty(list)){
cardValueVO.setCount(list.size());
}
}
if(ObjectUtils.isNotEmpty(record.getActiveTime()) && record.getActiveTime().equals("1")){
record.setActivityProgress("1");
}
if (ObjectUtils.isNotEmpty(record.getStartTime()) &&
ObjectUtils.isNotEmpty(record.getEndTime()) &&
record.getActiveTime().equals("2")){
record.setActivityProgress(record.getStartTime().getTime() > new Date().getTime() ? "0" : "");
if(ObjectUtils.isEmpty(record.getActivityProgress())){
record.setActivityProgress(record.getEndTime().getTime() > new Date().getTime() ? "1" : "2");
}
}
BeanUtils.copyProperties(record,cardValueVO);
cardValueVOs.add(cardValueVO);
}
page1.setRecords(cardValueVOs);
return page1;
}
public IPage selectAll(Page page, CardValue cardValue) {
LambdaQueryWrapper<CardValue> queryWrapper = new LambdaQueryWrapper<>();
//构建查询条件

View File

@ -0,0 +1,12 @@
package com.fuint.business.marketingActivity.cardValue.vo;
import com.fuint.business.marketingActivity.cardValue.entity.CardValue;
import lombok.Data;
import java.io.Serializable;
@Data
public class CardValueVOs extends CardValue implements Serializable {
//卡券数量
private Integer count;
}

View File

@ -165,6 +165,13 @@
export default {
data() {
return {
query: {
storeId: '',
couponType: '',
useStatus: 0,
pageNo: 1,
pageSize: 10
},
chainStoreId: uni.getStorageSync('chainStoreId'),
myPoints: 0,
cardsList: [],
@ -182,6 +189,7 @@
tabbar
},
onShow() {
this.query.storeId = uni.getStorageSync("storeId")
this.getUserBalance();
this.getGiftRecords();
this.getUserInfoList();

View File

@ -19,7 +19,7 @@
<view class="box-cz">
<view class="box-jg" :class="{ 'actbox' : actindex == index }" v-for="(item,index) in cardValueList"
:key="index"
@click="xzindex(index,item.rechargeBalance,item.fringeBenefit,item.giftBalance,item.points,item.growthValue)">
@click="xzindex(index,item.rechargeBalance,item.fringeBenefit,item.giftBalance,item.points,item.growthValue,item.count)">
<view class="s-title" :class="{ 'actsize' : actindex == index }"> <text
style="font-weight: bold;"></text>{{item.rechargeBalance}}</view>
<view class="min-size" :class="{ 'actsize' : actindex == index }">售价{{item.rechargeBalance}}
@ -272,7 +272,7 @@
cancel() {
this.show = false
},
xzindex(index, text, fringeBenefit, giftBalance, points, growthValue) {
xzindex(index, text, fringeBenefit, giftBalance, points, growthValue, count) {
this.shuomingList = []
console.log(this.shuomingList);
if (text) {
@ -290,6 +290,9 @@
if (growthValue) {
this.shuomingList.push('赠送' + growthValue + '成长值')
}
if (count) {
this.shuomingList.push('赠送卡券:' + count + '张')
}
this.actindex = index
},
fuleindex(index, text, points, ) {
@ -318,7 +321,7 @@
//
getValueCars() {
request({
url: 'business/marketingActivity/cardValue',
url: 'business/marketingActivity/cardValue/appletL',
method: 'get',
data: {
activeStatus: '1'
@ -329,9 +332,9 @@
this.cardValueList = res.data.records
this.xzindex(0, res.data.records[0].rechargeBalance, res.data.records[0].fringeBenefit,
res.data.records[0].giftBalance, res.data.records[0].points, res.data.records[0]
.growthValue)
.growthValue, res.data.records[0]
.count)
}
})
},
//

View File

@ -63,8 +63,9 @@
idList: [],
cardFavorableList: [],
cardsList: [],
shows: true,
shows: false,
query: {
storeId: '',
couponType: '',
useStatus: 0,
pageNo: 1,
@ -101,10 +102,12 @@
},
onShow() {
this.getGiftRecords();
this.getAllCardFavorables();
this.query.storeId = uni.getStorageSync("storeId")
this.isDrawDown();
console.log(this.query);
},
methods: {
getAllCardFavorables() {
request({
@ -149,12 +152,16 @@
request({
url: 'business/marketingActivity/cardFavorableRecord/isDrawDown',
method: 'get',
params: this.query
}).then(res => {
if (res.code == 200 && res.data == true) {
this.shows = true
} else {
this.shows = false
}
this.getGiftRecords();
this.getAllCardFavorables();
})
},
goRecharge() {

View File

@ -8,7 +8,7 @@
</view>
<!-- 顶部区域 -->
<view class="top-box">
<view class="kuangbox">使用规则 </view>
<!-- <view class="kuangbox">使用规则 </view> -->
<view class="box-title">储值余额</view>
<view class="box-nmb">{{cardBalance}}</view>
<!-- <view class="dis-bt">

View File

@ -8,7 +8,7 @@
</view>
<!-- 顶部区域 -->
<view class="top-box" v-for="(item,index) in refuelMoney" :key="index">
<view class="kuangbox">使用规则 </view>
<!-- <view class="kuangbox">使用规则 </view> -->
<view class="box-title">囤油升数</view>
<view class="box-nmb">{{item.type}} : {{item.oilType}}</view>
<view class="box-nmb">剩余升数: {{item.refuelMoney}}</view>