diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/redpacket/GrabRoomRedPacketCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/redpacket/GrabRoomRedPacketCmdExe.java index e67d3d8a..ea9842e9 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/redpacket/GrabRoomRedPacketCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/redpacket/GrabRoomRedPacketCmdExe.java @@ -106,15 +106,9 @@ public class GrabRoomRedPacketCmdExe { * 检查红包状态 */ private void checkRedPacketStatus(RoomRedPacket redPacket) { - if (RoomRedPacketStatus.FINISHED.getCode().equals(redPacket.getStatus())) { - throw new RuntimeException(OtherErrorCode.RED_PACKET_FINISHED.getMessage()); - } - if (RoomRedPacketStatus.EXPIRED.getCode().equals(redPacket.getStatus())) { - throw new RuntimeException(OtherErrorCode.RED_PACKET_EXPIRED.getMessage()); - } - if (LocalDateTime.now().isAfter(redPacket.getExpireTime())) { - throw new RuntimeException(OtherErrorCode.RED_PACKET_EXPIRED.getMessage()); - } + ResponseAssert.isFalse(OtherErrorCode.RED_PACKET_FINISHED, RoomRedPacketStatus.FINISHED.getCode().equals(redPacket.getStatus())); + ResponseAssert.isFalse(OtherErrorCode.RED_PACKET_EXPIRED, RoomRedPacketStatus.EXPIRED.getCode().equals(redPacket.getStatus())); + ResponseAssert.isFalse(OtherErrorCode.RED_PACKET_EXPIRED, LocalDateTime.now().isAfter(redPacket.getExpireTime())); } /** diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/redpacket/RoomRedPacketDAO.xml b/rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/redpacket/RoomRedPacketDAO.xml index c25ac7ad..ba08c484 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/redpacket/RoomRedPacketDAO.xml +++ b/rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/redpacket/RoomRedPacketDAO.xml @@ -90,7 +90,7 @@ SELECT FROM room_red_packet - WHERE room_id = #{roomId} AND status != 3 + WHERE room_id = #{roomId} AND status = 1 ORDER BY create_time DESC LIMIT #{offset}, #{size}