| | |
| | | } |
| | | 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); |
| | | } |