核销bug

This commit is contained in:
齐天大圣 2024-04-29 17:57:39 +08:00
parent a45fde5373
commit 382ac53cc1
6 changed files with 45 additions and 11 deletions

View File

@ -630,7 +630,7 @@ export default {
this.opendetails = true
let data = {
id:row.id,
exchangeFrom:"店铺一键送券"
exchangeFrom:"店铺一键送券"
}
await looklook(data).then(res=>{
if(res.data){

View File

@ -20,7 +20,7 @@ public interface ActiveConsumptionChildService extends IService<ActiveConsumptio
List<ActiveConsumptionChild> selectList(Serializable id);
List<CardFavorableRecord> detailRecord(ActiveConsumption activeConsumption);
List<Object> detailRecord(ActiveConsumption activeConsumption);
CardFavorableCountVO detailCount(Serializable id);
}

View File

@ -18,6 +18,8 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
@ -41,19 +43,45 @@ public class ActiveConsumptionChildServiceImpl extends ServiceImpl<ActiveConsump
}
@Override
public List<CardFavorableRecord> detailRecord(ActiveConsumption activeConsumption) {
public List<Object> detailRecord(ActiveConsumption activeConsumption) {
ArrayList<Object> objects = new ArrayList<>();
// 查询优惠券领取记录
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LambdaQueryWrapper<CardFavorableRecord> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CardFavorableRecord::getActiveId, activeConsumption.getId());
queryWrapper.eq(CardFavorableRecord::getExchangeFrom, activeConsumption.getExchangeFrom());
queryWrapper.eq(CardFavorableRecord::getStoreId, nowAccountInfo.getStoreId());
queryWrapper.like(CardFavorableRecord::getExchangeFrom, activeConsumption.getExchangeFrom());
if (ObjectUtils.isNotEmpty(activeConsumption.getActiveStartTime()) && ObjectUtils.isNotEmpty(activeConsumption.getActiveEndTime())){
queryWrapper.between(CardFavorableRecord::getCreateTime, activeConsumption.getActiveStartTime(), activeConsumption.getActiveEndTime());
}
queryWrapper.eq(CardFavorableRecord::getStoreId, nowAccountInfo.getStoreId());
List<CardFavorableRecord> favorableRecords = cardFavorableRecordService.list(queryWrapper);
return favorableRecords;
for (CardFavorableRecord favorableRecord : favorableRecords) {
HashMap<Object, Object> objectObjectHashMap = new HashMap<>();
objectObjectHashMap.put("name",favorableRecord.getName());
objectObjectHashMap.put("mobile",favorableRecord.getMobile());
objectObjectHashMap.put("createTime",favorableRecord.getCreateTime());
objectObjectHashMap.put("exchangeFrom",favorableRecord.getExchangeFrom());
objects.add(objectObjectHashMap);
}
LambdaQueryWrapper<CardExchangeRecord> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(CardExchangeRecord::getActiveId, activeConsumption.getId());
queryWrapper1.like(CardExchangeRecord::getExchangeFrom, activeConsumption.getExchangeFrom());
if (ObjectUtils.isNotEmpty(activeConsumption.getActiveStartTime()) && ObjectUtils.isNotEmpty(activeConsumption.getActiveEndTime())){
queryWrapper1.between(CardExchangeRecord::getCreateTime, activeConsumption.getActiveStartTime(), activeConsumption.getActiveEndTime());
}
queryWrapper1.eq(CardExchangeRecord::getStoreId, nowAccountInfo.getStoreId());
List<CardExchangeRecord> record1 = cardExchangeRecordService.list(queryWrapper1);
for (CardExchangeRecord cardExchangeRecord : record1) {
HashMap<Object, Object> objectObjectHashMap1 = new HashMap<>();
objectObjectHashMap1.put("name",cardExchangeRecord.getName());
objectObjectHashMap1.put("mobile",cardExchangeRecord.getMobile());
objectObjectHashMap1.put("createTime",cardExchangeRecord.getCreateTime());
objectObjectHashMap1.put("exchangeFrom",cardExchangeRecord.getExchangeFrom());
objects.add(objectObjectHashMap1);
}
return objects;
}
@Override

View File

@ -159,7 +159,7 @@ public class ActiveOneCouponServiceImpl extends ServiceImpl<ActiveOneCouponMappe
//优惠券
LambdaQueryWrapper<CardFavorableRecord> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(CardFavorableRecord::getExchangeFrom, "店铺一键送券");
queryWrapper1.eq(CardFavorableRecord::getExchangeFrom, "店铺一键送券");
queryWrapper1.eq(CardFavorableRecord::getActiveId, record.getId());
queryWrapper1.eq(CardFavorableRecord::getStoreId, record.getStoreId());
List<CardFavorableRecord> list = cardFavorableRecordService.list(queryWrapper1);
@ -170,7 +170,7 @@ public class ActiveOneCouponServiceImpl extends ServiceImpl<ActiveOneCouponMappe
//兑换券
LambdaQueryWrapper<CardExchangeRecord> queryWrapper2 = new LambdaQueryWrapper<>();
queryWrapper2.eq(CardExchangeRecord::getExchangeFrom, "店铺一键送券");
queryWrapper2.eq(CardExchangeRecord::getExchangeFrom, "店铺一键送券");
queryWrapper2.eq(CardExchangeRecord::getActiveId, record.getId());
queryWrapper2.eq(CardExchangeRecord::getStoreId, record.getStoreId());
List<CardExchangeRecord> list2 = cardExchangeRecordService.list(queryWrapper2);

View File

@ -443,7 +443,7 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
cardFavorableRecord.setMobile(userInfo.getMobile());
cardFavorableRecord.setMtUserId(userInfo.getId());
cardFavorableRecord.setStatus("0");
cardFavorableRecord.setExchangeFrom("店铺一键送券");
cardFavorableRecord.setExchangeFrom("店铺一键送券");
flag = addCardFavorableRecord(cardFavorableRecord);
}
}
@ -475,7 +475,7 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
cardExchangeRecord.setMobile(ljUserVo.getMobile());
cardExchangeRecord.setPhoto(ljUserVo.getAvatar());
cardExchangeRecord.setStatus("0");
cardExchangeRecord.setExchangeFrom("店铺一键送券");
cardExchangeRecord.setExchangeFrom("店铺一键送券");
flag = cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord);
}
}

View File

@ -253,6 +253,8 @@
memberFavorableAmount: "",
type: "",
},
levelAmount: 0,
activeAmount: 0,
//
isFixingLevel: false,
}
@ -321,7 +323,9 @@
type: this.preferentialData.type,
balanceAmountSale: this.balanceRedece,
oilCardAmountSale: this.oilCardRedece,
ifLogin: this.ifLogin
ifLogin: this.ifLogin,
levelAmount: this.levelAmount,
activeAmount: this.activeAmount
};
let _this = this;
request({
@ -895,12 +899,14 @@
this.preferentialData = res.data
if (res.data.memberFavorableAmount) {
this.gradeRedece = res.data.memberFavorableAmount
this.levelAmount = res.data.memberFavorableAmount
}
if (res.data.cardFavorableAmount) {
this.couponRedece = res.data.cardFavorableAmount
}
if (res.data.activeFavorableAmount) {
this.fullRedece = res.data.activeFavorableAmount
this.activeAmount = res.data.activeFavorableAmount
}
console.log(this.gradeRedece, this.couponRedece, this.fullRedece, res.data
.memberFavorableAmount, "2231");