更新10.8

This commit is contained in:
许允枞 2024-10-08 14:09:45 +08:00
parent 23e9d78e8c
commit 95a0ce60f9
6 changed files with 55 additions and 26 deletions

View File

@ -310,6 +310,10 @@ public class FleetMemberServiceImpl extends ServiceImpl<FleetMemberMapper, Fleet
fleetMember.setSecondaryCardLimit(fleetMember1.getSecondaryCardLimit() + fleetMember.getAdjustLimit());
fleetMember.setRemainingCreditLimit(fleetMember1.getRemainingCreditLimit() + fleetMember.getAdjustLimit());
} else {
//判断被扣除的用户余额是否还够
if (fleetMember1.getRemainingCreditLimit() < fleetMember.getAdjustLimit()) {
return 5;
}
fleetLinesChange.setRemainingCreditLimit(fleetMember1.getRemainingCreditLimit() - fleetMember.getAdjustLimit());
fleetMember.setSecondaryCardLimit(fleetMember1.getSecondaryCardLimit() - fleetMember.getAdjustLimit());
fleetMember.setRemainingCreditLimit(fleetMember1.getRemainingCreditLimit() - fleetMember.getAdjustLimit());

View File

@ -16,6 +16,7 @@ import com.fuint.business.integral.mapper.IntegralGiftMapper;
import com.fuint.business.integral.service.IntegralGiftService;
import com.fuint.business.integral.service.IntegralOrdersService;
import com.fuint.business.integral.vo.IntegralGiftVO;
import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUniVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.RedisLock;
import com.fuint.common.util.TokenUtil;
@ -43,6 +44,7 @@ public class IntegralGiftServiceImpl implements IntegralGiftService {
@Autowired
@Lazy
private IntegralOrdersService integralOrdersService;
/**
* 通过ID查询单条数据
*
@ -55,7 +57,6 @@ public class IntegralGiftServiceImpl implements IntegralGiftService {
}
/**
* 分页查询
*
@ -71,17 +72,27 @@ public class IntegralGiftServiceImpl implements IntegralGiftService {
}
@Override
public IPage<IntegralGiftVO> queryByPageByStoreId(@Param("page") Page page, @Param("integralGiftCategory") IntegralGift integralGift) {
IPage<IntegralGiftVO> integralGiftVOIPage = integralGiftDao.queryAllByLimit(page, integralGift);
List<IntegralGiftVO> records = integralGiftVOIPage.getRecords();
for (IntegralGiftVO record : records) {
record.setIfRedemptionIsOnline(integralOrdersService.checkTheRedemptionLimit(record.getId()));
//计算优惠券的领取比例
extracted(record);
}
return integralGiftVOIPage;
}
private void extracted(IntegralGiftVO coupon) {
// 计算领取的比例并保留两位小数
double scale = (coupon.getUsedInventory() == null ? 0 : (coupon.getUsedInventory() * 1.0 / coupon.getTotalInventory())) * 100;
scale = Math.round(scale * 100.0) / 100.0; // 保留两位小数
//保留小数点两位
coupon.setReceiveRatio(scale + "%");
}
@Resource
LJGoodsService ljGoodsService;
@ -90,6 +101,7 @@ public class IntegralGiftServiceImpl implements IntegralGiftService {
private StockStatisticService stockService;
@Autowired
private StockTrackService trackService;
/**
* 新增数据
*
@ -116,6 +128,7 @@ public class IntegralGiftServiceImpl implements IntegralGiftService {
this.integralGiftDao.insert(integralGift);
return integralGift;
}
public boolean addStockStatistic(IntegralGift integralGift) {
StockStatistic stock = new StockStatistic();
stock.setGoodsId(integralGift.getGoodsId());
@ -139,6 +152,7 @@ public class IntegralGiftServiceImpl implements IntegralGiftService {
int i = trackService.insertStockTrack(stockTrack);
return i > 0;
}
/**
* 修改数据
*
@ -184,6 +198,7 @@ public class IntegralGiftServiceImpl implements IntegralGiftService {
/**
* 单独修改商品的库存
*
* @param id
* @param editInventory
* @return
@ -216,8 +231,10 @@ public class IntegralGiftServiceImpl implements IntegralGiftService {
return true;
}
@Resource
RedisLock redisLock;
/**
* 处理积分商品库存(库存减少)
*/

View File

@ -12,4 +12,6 @@ public class IntegralGiftVO extends IntegralGift {
private String storeName;
// 商品
// 优惠卷
//领取比例
private String receiveRatio;
}

View File

@ -97,8 +97,12 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
List<Integer> ids = new ArrayList<>();
//循环店铺优惠券
for (CardCouponUniVo coupon : cardCouponUniVos.getRecords()) {
Integer getNum = 0;
if (ObjectUtil.isNotEmpty(coupon.getTfGetNum())){
getNum = coupon.getTfGetNum();
}
//查询该优惠券是否已到达限制数量
if ((coupon.getTfGetNum() < coupon.getTfTotal())) {
if ((getNum < coupon.getTfTotal())) {
Integer count = 0;
if (ObjectUtil.isNotEmpty(cardCouponMap.get(coupon.getId()))){
count = cardCouponMap.get(coupon.getId());
@ -154,7 +158,7 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
private static void extracted(CardCouponUniVo coupon) {
//计算领取的比例
double scale = (coupon.getTfGetNum() * 1.0 / coupon.getTfTotal()) * 100;
double scale = (coupon.getTfGetNum() == null ? 0 : coupon.getTfGetNum() * 1.0 / coupon.getTfTotal()) * 100;
coupon.setScale(scale + "%");
}
}

View File

@ -24,7 +24,7 @@
</view>
<u-line-progress :percentage="50" :showText="false" height="6"
activeColor="#FA6400"></u-line-progress>
<view class="hui_">券已领70%</view>
<view class="hui_">券已领{{item.receiveRatio}}</view>
</view>
</view>

View File

@ -98,7 +98,9 @@
},
methods: {
submitFrom() {
if (this.memberInfo.adjustType == '') {
console.log('调整类型',this.memberInfo.adjustType);
console.log('判断',this.memberInfo.adjustType === '');
if (this.memberInfo.adjustType === '') {
uni.showToast({
title: '请选择调整类型',
icon: 'none'