From c560f1a14ae1fc468d90e50e6a32d805295875da Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期一, 01 九月 2025 15:35:59 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/2.0' into 2.0
---
cloud-server-other/src/main/java/com/dsh/other/controller/TVipController.java | 33 +++++++++++++++++----------------
1 files changed, 17 insertions(+), 16 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..32a68ca 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
@@ -153,22 +153,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