推荐有礼
This commit is contained in:
parent
1c844fd619
commit
50acf879a1
@ -47,10 +47,9 @@
|
||||
<el-table-column
|
||||
type="index"
|
||||
align="center"
|
||||
label="排序"
|
||||
label="序号"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="活动编号" align="center" prop="id" />
|
||||
|
||||
<el-table-column label="活动名称" align="center" prop="name" />
|
||||
<el-table-column label="满足金额" align="center" prop="participationConditionMoney" >
|
||||
@ -126,7 +125,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="适用用户" prop="adaptUserType">
|
||||
<el-radio-group v-model="form.adaptUserType">
|
||||
<el-radio label="0">全部用户</el-radio>
|
||||
<!-- <el-radio label="0">全部用户</el-radio>-->
|
||||
<el-radio label="1">全部会员</el-radio>
|
||||
<el-radio label="2">等级会员</el-radio>
|
||||
</el-radio-group>
|
||||
@ -340,12 +339,12 @@
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-form-item label="参与条件" prop="participationCondition">
|
||||
<!-- <el-form-item label="参与条件" prop="participationCondition">
|
||||
<el-select v-model="form.participationCondition" clearable placeholder="请选择天参与条件">
|
||||
<el-option label="不限制" value="0"></el-option>
|
||||
<el-option label="优惠订单不参与" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="参与次数类别" prop="participationAcount">
|
||||
<el-select v-model="form.participationAcount" clearable placeholder="请选择参与次数类别">
|
||||
<el-option label="不限制" value="0"></el-option>
|
||||
|
@ -120,5 +120,28 @@ public class ActiveConsumptionController extends BaseController {
|
||||
public ResponseObject del(@RequestParam("ids") List<Long> ids) {
|
||||
return getSuccessResult(activeConsumptionChildService.removeByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 优惠券、兑换券使用详情
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("/detailRecord/{id}")
|
||||
public ResponseObject detail(@PathVariable Serializable id) {
|
||||
return getSuccessResult(this.activeConsumptionChildService.detailRecord(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("/detailCount/{id}")
|
||||
public ResponseObject detailCount(@PathVariable Serializable id) {
|
||||
return getSuccessResult(this.activeConsumptionChildService.detailCount(id));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -30,6 +30,8 @@ public class ActiveConsumption extends Model<ActiveConsumption> {
|
||||
private Integer storeId;
|
||||
//活动名称
|
||||
private String name;
|
||||
//满足金额类型 1:订单金额 2:实付金额
|
||||
private String moneyType;
|
||||
//满足金额
|
||||
private Double participationConditionMoney;
|
||||
//活动开始时间
|
||||
|
@ -53,4 +53,4 @@
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
@ -2,6 +2,8 @@ package com.fuint.business.marketingActivity.activeConsumption.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumptionChild;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableCountVO;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
@ -16,4 +18,8 @@ public interface ActiveConsumptionChildService extends IService<ActiveConsumptio
|
||||
|
||||
|
||||
List<ActiveConsumptionChild> selectList(Serializable id);
|
||||
|
||||
List<CardFavorableRecord> detailRecord(Serializable id);
|
||||
|
||||
CardFavorableCountVO detailCount(Serializable id);
|
||||
}
|
||||
|
@ -1,9 +1,15 @@
|
||||
package com.fuint.business.marketingActivity.activeConsumption.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumptionChild;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.mapper.ActiveConsumptionChildMapper;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.service.ActiveConsumptionChildService;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableCountVO;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -21,8 +27,45 @@ public class ActiveConsumptionChildServiceImpl extends ServiceImpl<ActiveConsump
|
||||
|
||||
@Resource
|
||||
private ActiveConsumptionChildMapper activeConsumptionChildMapper;
|
||||
@Resource
|
||||
private CardFavorableRecordService cardFavorableRecordService;
|
||||
@Override
|
||||
public List<ActiveConsumptionChild> selectList(Serializable id) {
|
||||
return activeConsumptionChildMapper.selectConsumptionChilds(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CardFavorableRecord> detailRecord(Serializable id) {
|
||||
// 查询优惠券领取记录
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
LambdaQueryWrapper<CardFavorableRecord> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(CardFavorableRecord::getActiveId, id);
|
||||
queryWrapper.eq(CardFavorableRecord::getStoreId, nowAccountInfo.getStoreId());
|
||||
List<CardFavorableRecord> favorableRecords = cardFavorableRecordService.list(queryWrapper);
|
||||
return favorableRecords;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CardFavorableCountVO detailCount(Serializable id) {
|
||||
// 查询优惠券领取记录
|
||||
int a = 0;
|
||||
int b = 0;
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
CardFavorableCountVO cardFavorableCountVO = new CardFavorableCountVO();
|
||||
LambdaQueryWrapper<CardFavorableRecord> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(CardFavorableRecord::getActiveId, id);
|
||||
queryWrapper.eq(CardFavorableRecord::getStoreId, nowAccountInfo.getStoreId());
|
||||
List<CardFavorableRecord> favorableRecords = cardFavorableRecordService.list(queryWrapper);
|
||||
for (CardFavorableRecord favorableRecord : favorableRecords) {
|
||||
if (favorableRecord.getStatus().equals("0")){
|
||||
a+=1;
|
||||
}else {
|
||||
b+=1;
|
||||
}
|
||||
}
|
||||
cardFavorableCountVO.setCount(favorableRecords.size());
|
||||
cardFavorableCountVO.setCountEd(b);
|
||||
cardFavorableCountVO.setCountLd(a);
|
||||
return cardFavorableCountVO;
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,10 @@ import com.fuint.business.marketingActivity.activeConsumption.service.ActiveCons
|
||||
import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionAppletVO;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionVO;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionVOS;
|
||||
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
|
||||
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
|
||||
import com.fuint.business.petrolStationManagement.service.OilNameService;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.business.userManager.entity.LJUserGrade;
|
||||
@ -53,6 +57,10 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
|
||||
private OilNameService oilNameService;
|
||||
@Resource
|
||||
private ActiveConsumptionMapper activeConsumptionMapper;
|
||||
@Resource
|
||||
private CardFavorableRecordService cardFavorableRecordService;
|
||||
@Resource
|
||||
private CardExchangeRecordService cardExchangeRecordService;
|
||||
/**
|
||||
* 新增数据
|
||||
* @param activeConsumptionDTO
|
||||
@ -133,6 +141,39 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
|
||||
}
|
||||
activeConsumptionVO.setDieselUserLevel(str.split(","));
|
||||
}
|
||||
List<ActiveConsumptionChild> activeConsumptionChildList = activeConsumptionChildService.selectList(s.getId());
|
||||
int youhuiTed = 0;
|
||||
int duihuanTed = 0;
|
||||
for (ActiveConsumptionChild activeConsumptionChild : activeConsumptionChildList) {
|
||||
//优惠券
|
||||
if (activeConsumptionChild.getActiveGift().equals("1")){
|
||||
LambdaQueryWrapper<CardFavorableRecord> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(CardFavorableRecord::getActiveId,activeConsumptionChild.getActiveConsumptionId());
|
||||
queryWrapper.eq(CardFavorableRecord::getCardFavorableId,activeConsumptionChild.getVouchersId());
|
||||
List<CardFavorableRecord> list = cardFavorableRecordService.list(queryWrapper);
|
||||
activeConsumptionVO.setYouhuiTotal(list.size());
|
||||
for (CardFavorableRecord cardFavorableRecord : list) {
|
||||
if (cardFavorableRecord.getStatus().equals("1")){
|
||||
youhuiTed+=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
//兑换券
|
||||
if (activeConsumptionChild.getActiveGift().equals("2")){
|
||||
LambdaQueryWrapper<CardExchangeRecord> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(CardExchangeRecord::getActiveId,activeConsumptionChild.getActiveConsumptionId());
|
||||
queryWrapper.eq(CardExchangeRecord::getCardExchangeId,activeConsumptionChild.getVouchersId());
|
||||
List<CardExchangeRecord> list = cardExchangeRecordService.list(queryWrapper);
|
||||
activeConsumptionVO.setDuihuanTotal(list.size());
|
||||
for (CardExchangeRecord cardExchangeRecord : list) {
|
||||
if (cardExchangeRecord.getStatus().equals("1")){
|
||||
duihuanTed+=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
activeConsumptionVO.setDuihuanTotaled(youhuiTed);
|
||||
activeConsumptionVO.setDuihuanTotaled(duihuanTed);
|
||||
return activeConsumptionVO;
|
||||
}).collect(Collectors.toList());
|
||||
activeConsumptionVOSIPage.setRecords(activeConsumptionVOList);
|
||||
|
@ -3,6 +3,7 @@ package com.fuint.business.marketingActivity.activeConsumption.vo;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumptionChild;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
@ -15,6 +16,7 @@ import java.util.List;
|
||||
* @since 2023-11-10 10:44:58
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class ActiveConsumptionVO extends Model<ActiveConsumptionVO> {
|
||||
//主键id
|
||||
private Integer id;
|
||||
@ -79,6 +81,10 @@ public class ActiveConsumptionVO extends Model<ActiveConsumptionVO> {
|
||||
private String status;
|
||||
//是否在线 0:在线 1: 下线
|
||||
private String isonline;
|
||||
private Integer youhuiTotal;
|
||||
private Integer duihuanTotal;
|
||||
private Integer youhuiTotaled;
|
||||
private Integer duihuanTotaled;
|
||||
|
||||
private List<ActiveConsumptionChild> activeConsumptionChildList;
|
||||
//创建者
|
||||
@ -108,277 +114,6 @@ public class ActiveConsumptionVO extends Model<ActiveConsumptionVO> {
|
||||
this.activeConsumptionChildList = activeConsumptionChildList;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getChainStoreId() {
|
||||
return chainStoreId;
|
||||
}
|
||||
|
||||
public void setChainStoreId(Integer chainStoreId) {
|
||||
this.chainStoreId = chainStoreId;
|
||||
}
|
||||
|
||||
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 Date getActiveStartTime() {
|
||||
return activeStartTime;
|
||||
}
|
||||
|
||||
public void setActiveStartTime(Date activeStartTime) {
|
||||
this.activeStartTime = activeStartTime;
|
||||
}
|
||||
|
||||
public Date getActiveEndTime() {
|
||||
return activeEndTime;
|
||||
}
|
||||
|
||||
public void setActiveEndTime(Date activeEndTime) {
|
||||
this.activeEndTime = activeEndTime;
|
||||
}
|
||||
|
||||
public String[] getAdaptOils() {
|
||||
return adaptOils;
|
||||
}
|
||||
|
||||
public void setAdaptOils(String[] adaptOils) {
|
||||
this.adaptOils = adaptOils;
|
||||
}
|
||||
|
||||
public Integer[] getAdaptOil() {
|
||||
return adaptOil;
|
||||
}
|
||||
|
||||
public void setAdaptOil(Integer[] adaptOil) {
|
||||
this.adaptOil = adaptOil;
|
||||
}
|
||||
|
||||
public String getAdaptUserType() {
|
||||
return adaptUserType;
|
||||
}
|
||||
|
||||
public void setAdaptUserType(String adaptUserType) {
|
||||
this.adaptUserType = adaptUserType;
|
||||
}
|
||||
|
||||
public String getMember_type() {
|
||||
return member_type;
|
||||
}
|
||||
|
||||
public void setMember_type(String member_type) {
|
||||
this.member_type = member_type;
|
||||
}
|
||||
|
||||
public String[] getDieselUserLevel() {
|
||||
return dieselUserLevel;
|
||||
}
|
||||
|
||||
public void setDieselUserLevel(String[] dieselUserLevel) {
|
||||
this.dieselUserLevel = dieselUserLevel;
|
||||
}
|
||||
|
||||
public String[] getGasolineUserLevel() {
|
||||
return gasolineUserLevel;
|
||||
}
|
||||
|
||||
public void setGasolineUserLevel(String[] gasolineUserLevel) {
|
||||
this.gasolineUserLevel = gasolineUserLevel;
|
||||
}
|
||||
|
||||
public String[] getNaturalUserLevel() {
|
||||
return naturalUserLevel;
|
||||
}
|
||||
|
||||
public void setNaturalUserLevel(String[] naturalUserLevel) {
|
||||
this.naturalUserLevel = naturalUserLevel;
|
||||
}
|
||||
|
||||
public String getPaymentType() {
|
||||
return paymentType;
|
||||
}
|
||||
|
||||
public void setPaymentType(String paymentType) {
|
||||
this.paymentType = paymentType;
|
||||
}
|
||||
|
||||
public String getParticipationCondition() {
|
||||
return participationCondition;
|
||||
}
|
||||
|
||||
public void setParticipationCondition(String participationCondition) {
|
||||
this.participationCondition = participationCondition;
|
||||
}
|
||||
|
||||
public String getParticipationAcount() {
|
||||
return participationAcount;
|
||||
}
|
||||
|
||||
public void setParticipationAcount(String participationAcount) {
|
||||
this.participationAcount = participationAcount;
|
||||
}
|
||||
|
||||
public Integer getLimitAcount() {
|
||||
return limitAcount;
|
||||
}
|
||||
|
||||
public void setLimitAcount(Integer limitAcount) {
|
||||
this.limitAcount = limitAcount;
|
||||
}
|
||||
|
||||
public String[] getActiveGift() {
|
||||
return activeGift;
|
||||
}
|
||||
|
||||
public void setActiveGift(String[] activeGift) {
|
||||
this.activeGift = activeGift;
|
||||
}
|
||||
|
||||
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 Integer getPoints() {
|
||||
return points;
|
||||
}
|
||||
|
||||
public void setPoints(Integer points) {
|
||||
this.points = points;
|
||||
}
|
||||
|
||||
public Integer getGoodsId() {
|
||||
return goodsId;
|
||||
}
|
||||
|
||||
public void setGoodsId(Integer goodsId) {
|
||||
this.goodsId = goodsId;
|
||||
}
|
||||
|
||||
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 String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getIsonline() {
|
||||
return isonline;
|
||||
}
|
||||
|
||||
public void setIsonline(String isonline) {
|
||||
this.isonline = isonline;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取主键值
|
||||
|
@ -11,6 +11,8 @@ public class ActiveConsumptionVO implements Serializable {
|
||||
private Integer activeId;
|
||||
//活动名称
|
||||
private String activeName;
|
||||
//满足金额类型 1:订单金额 2:实付金额
|
||||
private String moneyType;
|
||||
//适用会员类型 0:全部用户 1:全部会员 2:等级会员
|
||||
private String adaptUserType;
|
||||
//适用会员
|
||||
|
@ -11,6 +11,8 @@ public class PaymentActiveDTO implements Serializable {
|
||||
private String type;
|
||||
//支付金额
|
||||
private BigDecimal amount;
|
||||
//订单金额
|
||||
private Double orderAmount;
|
||||
//可用油品Id
|
||||
private Integer oilId;
|
||||
//店铺id
|
||||
|
@ -833,7 +833,19 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
|
||||
@Override
|
||||
public void activeConsumption(PaymentActiveDTO paymentActiveDTO) {
|
||||
//消费有礼
|
||||
ArrayList<ActiveConsumptionVO> activeConsumptionVOS1 = new ArrayList<>();
|
||||
List<ActiveConsumptionVO> activeConsumptionVOS = oilOrderMapper.selectActiveConsumption(paymentActiveDTO.getStoreId(), paymentActiveDTO.getAmount());
|
||||
if (CollectionUtils.isNotEmpty(activeConsumptionVOS)){
|
||||
for (ActiveConsumptionVO activeConsumptionVO : activeConsumptionVOS) {
|
||||
BigDecimal amount = new BigDecimal(activeConsumptionVO.getAmount());
|
||||
if (activeConsumptionVO.getMoneyType().equals("1") && paymentActiveDTO.getOrderAmount()>=activeConsumptionVO.getAmount()){
|
||||
activeConsumptionVOS1.add(activeConsumptionVO);
|
||||
}
|
||||
if (activeConsumptionVO.getMoneyType().equals("2") && paymentActiveDTO.getAmount().compareTo(amount)>0){
|
||||
activeConsumptionVOS1.add(activeConsumptionVO);
|
||||
}
|
||||
}
|
||||
}
|
||||
//连锁店信息
|
||||
// if (paymentActiveDTO.getUserId()==null){
|
||||
// paymentActiveDTO.setUserId(TokenUtil.getNowAccountInfo().getId());
|
||||
@ -844,8 +856,8 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
|
||||
//用户余额
|
||||
UserBalance userBalance = userBalanceService.selectUserBalance(paymentActiveDTO.getUserId(),chainStoreId);
|
||||
UserBalance userBalance1 = new UserBalance();
|
||||
if (CollectionUtils.isNotEmpty(activeConsumptionVOS)){
|
||||
for (ActiveConsumptionVO activeConsumptionVO : activeConsumptionVOS) {
|
||||
if (CollectionUtils.isNotEmpty(activeConsumptionVOS1)){
|
||||
for (ActiveConsumptionVO activeConsumptionVO : activeConsumptionVOS1) {
|
||||
if (activeConsumptionVO.getAdaptUserType().equals("2") && activeConsumptionVO.getOilId().contains(paymentActiveDTO.getOilId().toString()) &&
|
||||
StringUtils.isNotEmpty(activeConsumptionVO.getAdaptUser()) && activeConsumptionVO.getAdaptUser().contains(paymentActiveDTO.getMtUserLevel().toString()) || activeConsumptionVO.getAdaptUserType().equals("0") && activeConsumptionVO.getOilId().contains(paymentActiveDTO.getOilId().toString())
|
||||
|| activeConsumptionVO.getAdaptUserType().equals("1") && activeConsumptionVO.getOilId().contains(paymentActiveDTO.getOilId().toString()) && StringUtils.isNotEmpty(paymentActiveDTO.getMtUserLevel().toString())){
|
||||
@ -881,7 +893,8 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
|
||||
cardFavorableRecord.setName(ljUserVo.getName());
|
||||
cardFavorableRecord.setMobile(ljUserVo.getMobile());
|
||||
cardFavorableRecord.setStatus("0");
|
||||
cardFavorableRecord.setExchangeFrom("充值送券");
|
||||
cardFavorableRecord.setExchangeFrom("消费有礼");
|
||||
cardFavorableRecord.setActiveId(activeConsumptionChild.getActiveConsumptionId());
|
||||
cardFavorableRecordService.addCardFavorableRecord(cardFavorableRecord);
|
||||
//兑换券
|
||||
}else if (ObjectUtils.isNotEmpty(activeConsumptionChild) && activeConsumptionChild.getActiveGift().equals("2")){
|
||||
@ -893,7 +906,8 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
|
||||
cardExchangeRecord.setMobile(ljUserVo.getMobile());
|
||||
cardExchangeRecord.setPhoto(ljUserVo.getAvatar());
|
||||
cardExchangeRecord.setStatus("0");
|
||||
cardExchangeRecord.setExchangeFrom("充值送券");
|
||||
cardExchangeRecord.setExchangeFrom("消费有礼");
|
||||
cardExchangeRecord.setActiveId(activeConsumptionChild.getActiveConsumptionId());
|
||||
cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord);
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,8 @@ public class ActiveNewlywedsRecordsServiceImpl extends ServiceImpl<ActiveNewlywe
|
||||
cardFavorableRecord.setName(ljUserVo.getName());
|
||||
cardFavorableRecord.setMobile(ljUserVo.getMobile());
|
||||
cardFavorableRecord.setStatus("0");
|
||||
cardFavorableRecord.setExchangeFrom("新人发券");
|
||||
cardFavorableRecord.setExchangeFrom("新人有礼");
|
||||
cardFavorableRecord.setActiveId(activeNewlywedsChild.getActiveNewlywedsId());
|
||||
save = cardFavorableRecordService.addCardFavorableRecord(cardFavorableRecord);
|
||||
}else {
|
||||
//兑换券
|
||||
@ -92,7 +93,8 @@ public class ActiveNewlywedsRecordsServiceImpl extends ServiceImpl<ActiveNewlywe
|
||||
cardExchangeRecord.setMobile(ljUserVo.getMobile());
|
||||
cardExchangeRecord.setPhoto(ljUserVo.getAvatar());
|
||||
cardExchangeRecord.setStatus("0");
|
||||
cardExchangeRecord.setExchangeFrom("新人领券");
|
||||
cardExchangeRecord.setExchangeFrom("新人有礼");
|
||||
cardExchangeRecord.setActiveId(activeNewlywedsChild.getActiveNewlywedsId());
|
||||
save = cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord);
|
||||
}
|
||||
}
|
||||
|
@ -185,7 +185,8 @@ public class ActiveRecommendRecordsServiceImpl extends ServiceImpl<ActiveRecomme
|
||||
cardFavorableRecord.setName(ljUser1.getName());
|
||||
cardFavorableRecord.setMobile(ljUser1.getMobile());
|
||||
cardFavorableRecord.setStatus("0");
|
||||
cardFavorableRecord.setExchangeFrom("邀请新人送券");
|
||||
cardFavorableRecord.setExchangeFrom("推荐有礼");
|
||||
cardFavorableRecord.setActiveId(activeRecommendChild.getActiveRecommendId());
|
||||
cardFavorableRecordService.addCardFavorableRecord(cardFavorableRecord);
|
||||
}
|
||||
//兑换券
|
||||
@ -198,7 +199,8 @@ public class ActiveRecommendRecordsServiceImpl extends ServiceImpl<ActiveRecomme
|
||||
cardExchangeRecord.setMobile(ljUser1.getMobile());
|
||||
cardExchangeRecord.setPhoto(ljUser1.getAvatar());
|
||||
cardExchangeRecord.setStatus("0");
|
||||
cardExchangeRecord.setExchangeFrom("邀请新人送券");
|
||||
cardExchangeRecord.setExchangeFrom("推荐有礼");
|
||||
cardExchangeRecord.setActiveId(activeRecommendChild.getActiveRecommendId());
|
||||
cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord);
|
||||
}
|
||||
//被邀请人优惠券
|
||||
|
@ -24,6 +24,8 @@ public class CardExchangeRecord extends Model<CardExchangeRecord> {
|
||||
private Integer id;
|
||||
//兑换券id
|
||||
private Integer cardExchangeId;
|
||||
//优惠券id
|
||||
private Integer activeId;
|
||||
//所属连锁店id
|
||||
private Integer chainStorId;
|
||||
//所属店铺id
|
||||
|
@ -28,6 +28,8 @@ public class CardFavorableRecord extends Model<CardFavorableRecord> {
|
||||
private Integer chainStorId;
|
||||
//优惠券id
|
||||
private Integer cardFavorableId;
|
||||
//活动id
|
||||
private Integer activeId;
|
||||
//所属店铺id
|
||||
private Integer storeId;
|
||||
//会员名字
|
||||
|
@ -0,0 +1,16 @@
|
||||
package com.fuint.business.marketingActivity.cardFavorable.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class CardFavorableCountVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 优惠券数量
|
||||
*/
|
||||
private Integer count;
|
||||
private Integer countEd;
|
||||
private Integer countLd;
|
||||
}
|
@ -5,7 +5,6 @@ import com.alibaba.excel.EasyExcel;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.marketingActivity.cardGift.entity.CardGift;
|
||||
import com.fuint.business.marketingActivity.cardGift.service.CardGiftService;
|
||||
import com.fuint.business.userManager.vo.LJUserVo;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -166,12 +165,12 @@ public class CardGiftController extends BaseController {
|
||||
/**
|
||||
* 礼品卡模板导入
|
||||
*
|
||||
* @param multipartFile excel文件
|
||||
* @param file excel文件
|
||||
* @return 修改结果
|
||||
*/
|
||||
@RequestMapping("exchangeImport")
|
||||
public ResponseObject exchangeImport(MultipartFile multipartFile) throws IOException {
|
||||
return getSuccessResult(this.cardGiftService.exchangeImport(multipartFile));
|
||||
@RequestMapping("/exchangeImport")
|
||||
public ResponseObject exchangeImport(MultipartFile file) throws IOException {
|
||||
return getSuccessResult(this.cardGiftService.exchangeImport(file));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -61,7 +61,7 @@ public interface CardGiftService extends IService<CardGift> {
|
||||
* @param multipartFile
|
||||
* @return
|
||||
*/
|
||||
Map<String,Integer> exchangeImport(MultipartFile multipartFile) throws IOException;
|
||||
Map<String,Integer> exchangeImport(MultipartFile file) throws IOException;
|
||||
|
||||
List<CardGift> selectGiftValue(CardGift cardGift);
|
||||
|
||||
|
@ -227,11 +227,11 @@ public class CardGiftServiceImpl extends ServiceImpl<CardGiftMapper, CardGift> i
|
||||
|
||||
/**
|
||||
* 礼品卡模板导入
|
||||
* @param multipartFile
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Integer> exchangeImport(MultipartFile multipartFile) throws IOException {
|
||||
public Map<String, Integer> exchangeImport(MultipartFile file) throws IOException {
|
||||
Map<String,Integer> map = new HashMap<>();
|
||||
int success = 0;
|
||||
int error = 0;
|
||||
@ -240,7 +240,7 @@ public class CardGiftServiceImpl extends ServiceImpl<CardGiftMapper, CardGift> i
|
||||
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
//获取文件流
|
||||
InputStream inputStream = multipartFile.getInputStream();
|
||||
InputStream inputStream = file.getInputStream();
|
||||
//实例化实现了AnalysisEventListener接口的类
|
||||
EasyExcelListener listener = new EasyExcelListener();
|
||||
|
||||
|
@ -463,6 +463,7 @@
|
||||
ac.points points,
|
||||
ac.participation_condition_money amount,
|
||||
ac.adapt_user_type adaptUserType,
|
||||
ac.money_type moneyType,
|
||||
acc.active_gift activeGift,
|
||||
acc.vouchers_id vouchersId
|
||||
FROM
|
||||
|
Loading…
Reference in New Issue
Block a user