zoujiajian %!s(int64=3) %!d(string=hai) anos
pai
achega
816593f084

+ 4 - 3
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonCommentServiceImpl.java

@@ -40,8 +40,8 @@ public class OrderDonCommentServiceImpl implements OrderDonCommentService {
 			throw BusinessRuntimeException.getInstance("审核参数错误");
 		}
 		OrderComment orderComment = orderCommentMapper.selectById(id);
-		OrderComment.VerifyStatus dbVerifyStatus = orderComment.getVerifyStatus();
 		if (orderComment == null) throw BusinessRuntimeException.getInstance("评价不存在");
+		OrderComment.VerifyStatus dbVerifyStatus = orderComment.getVerifyStatus();
 
 		if (OrderComment.VerifyStatus.verifying != orderComment.getVerifyStatus()) {
 			throw BusinessRuntimeException.getInstance("该评价已审核过");
@@ -64,8 +64,9 @@ public class OrderDonCommentServiceImpl implements OrderDonCommentService {
 					BigDecimal balance = orderCommentRewardConfig.getBalance();
 					userBenefitsService.addUserBalance(orderComment.getUserId(), balance);
 					log.info("审核订单:{}评价成功,发放余额:{}", orderComment.getOrderId(), balance.divide(BigDecimal.valueOf(100)));
-					orderComment.setBalance(balance);
-					orderCommentMapper.updateById(orderComment);
+					orderCommentMapper.update(null, Wrappers.lambdaUpdate(OrderComment.class)
+							.set(OrderComment::getBalance, balance)
+							.eq(OrderComment::getId, id));
 				}
 			}
 		}