- 在 PayOrderVo 中添加 createTime 字段,用于记录创建时间 - 修改 PlayerItemsMapper.xml,限制查询结果为三湘杯资格卡(item_id in (1001)) - 在 UserCheckRecordServiceImpl 中增加非三湘杯资格卡核销的异常处理
@@ -151,4 +151,9 @@ public class PayOrderVo implements Serializable {
private String nickName;
+ /**
+ * 创建时间
+ */
+ private String createTime;
+
}
@@ -150,6 +150,10 @@ public class UserCheckRecordServiceImpl implements IUserCheckRecordService {
Long userId = bo.getUserId();
Long num = bo.getNum();
+ if(bo.getItemId()!=null && bo.getItemId()!=1001L){
+ throw new RuntimeException("非三湘杯资格卡,不可核销!!!");
+ }
PlayerItemsVo playerItemsVo = playerItemsMapper.selectPlayerItemsInfo(userId, bo.getItemId());
if(playerItemsVo.getQuantity()<0 || playerItemsVo.getQuantity()<num){
throw new RuntimeException("数量不足!!!");
@@ -68,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectPlayerItemsListByUser" resultType="org.dromara.business.domain.vo.PlayerItemsVo">
SELECT a.*,c.name as itemName, b.phone,b.nick_name, b.id as userId FROM player_items a left join user b on a.player_id=b.id
left join items c on a.item_id=c.id
- WHERE 1=1 and (b.phone = #{userIds} or b.nick_name = #{userIds})
+ WHERE 1=1 and (b.phone = #{userIds} or b.nick_name = #{userIds}) and a.item_id in (1001)
</select>