无关风月
1 天以前 cfa7d0a90e7da9b52606ab8fca364fa5bddddcd4
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){
                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);
        }