From cabda12d788eeb6e056113ac8352dfaf972490d9 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期一, 20 十月 2025 17:10:44 +0800
Subject: [PATCH] bug修改,后台新增预约记录,玩湃惠民卡修改二维码参数规则,启动游戏取消校验是否订场校验
---
cloud-server-other/src/main/java/com/dsh/other/controller/TVipController.java | 41 ++++++++++++++++++++++++-----------------
1 files changed, 24 insertions(+), 17 deletions(-)
diff --git a/cloud-server-other/src/main/java/com/dsh/other/controller/TVipController.java b/cloud-server-other/src/main/java/com/dsh/other/controller/TVipController.java
index d1e0d3e..35c530b 100644
--- a/cloud-server-other/src/main/java/com/dsh/other/controller/TVipController.java
+++ b/cloud-server-other/src/main/java/com/dsh/other/controller/TVipController.java
@@ -58,13 +58,19 @@
List<TicketVipResp> ticketVipRespList = new ArrayList<>();
String couponJson = vip.getCouponJson();
JSONArray couponJsonArray = JSONArray.parseArray(couponJson);
+ if(couponJsonArray==null){
+ continue;
+ }
for (Object o : couponJsonArray) {
JSONObject couponJsonObject = (JSONObject) o;
// 优惠券id
Integer id = Integer.valueOf(couponJsonObject.getString("id"));
// 优惠券数量
Integer value = Integer.valueOf(couponJsonObject.getString("value"));
- Coupon coupon = coupons.stream().filter(e -> e.getId().equals(id)).findFirst().orElse(new Coupon());
+ Coupon coupon = coupons.stream().filter(e -> e.getId().equals(id)).findFirst().orElse(null);
+ if (coupon==null){
+ continue;
+ }
CouponVipResp couponVipResp = new CouponVipResp();
couponVipResp.setId(coupon.getId());
couponVipResp.setName(coupon.getName());
@@ -153,22 +159,23 @@
}
vip.setCouponList(couponVipRespList);
String ticketJson = vip.getTicketJson();
- JSONArray ticketJsonArray = JSONArray.parseArray(ticketJson);
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-
- for (Object o : ticketJsonArray) {
- JSONObject ticketJsonObject = (JSONObject) o;
- TicketVipResp ticketVipResp = new TicketVipResp();
- Integer count = ticketJsonObject.getInteger("count");
- ticketVipResp.setName(ticketJsonObject.getString("name"));
- ticketVipResp.setTime(ticketJsonObject.getInteger("time"));
- ticketVipResp.setCount(ticketJsonObject.getInteger("count"));
- ticketVipResp.setStartTime(simpleDateFormat.format(new Date()));
- Date date = new Date();
- // 给这个date加X天
- date.setTime(date.getTime() + ticketJsonObject.getInteger("time") * 24 * 60 * 60 * 1000);
- ticketVipResp.setEffectiveTime(simpleDateFormat.format(date));
- ticketVipRespList.add(ticketVipResp);
+ if(ticketJson!=null && !"".equals(ticketJson)){
+ JSONArray ticketJsonArray = JSONArray.parseArray(ticketJson);
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+ for (Object o : ticketJsonArray) {
+ JSONObject ticketJsonObject = (JSONObject) o;
+ TicketVipResp ticketVipResp = new TicketVipResp();
+ Integer count = ticketJsonObject.getInteger("count");
+ ticketVipResp.setName(ticketJsonObject.getString("name"));
+ ticketVipResp.setTime(ticketJsonObject.getInteger("time"));
+ ticketVipResp.setCount(ticketJsonObject.getInteger("count"));
+ ticketVipResp.setStartTime(simpleDateFormat.format(new Date()));
+ Date date = new Date();
+ // 给这个date加X天
+ date.setTime(date.getTime() + ticketJsonObject.getInteger("time") * 24 * 60 * 60 * 1000);
+ ticketVipResp.setEffectiveTime(simpleDateFormat.format(date));
+ ticketVipRespList.add(ticketVipResp);
+ }
}
vip.setTicketList(ticketVipRespList);
}
--
Gitblit v1.7.1