在OrderPayServiceImpl类中
修改商品额外赠送积分这里
修改为
int sumIntegral = 0;
for (StoreOrderInfo orderInfo : orderInfoList) {
StoreProduct product = storeProductService.getById(orderInfo.getProductId());
sumIntegral += product.getGiveIntegral() * orderInfo.getPayNum();
}
if (sumIntegral > 0) {
// 生成积分记录
UserIntegralRecord integralRecord = integralRecordInit(storeOrder, user.getIntegral(), sumIntegral, "product");
integralList.add(integralRecord);
}
如图所示: