无关风月
2 天以前 538d011bfe8c57c756c32695c88e07b595d76434
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TVipController.java
@@ -107,6 +107,9 @@
                        case 3:
                            coupon.setTypeValue("体验券");
                            break;
                            case 4:
                            coupon.setTypeValue("抵扣券");
                            break;
                    }
                    switch (coupon.getUserPopulation()){
                        case 1:
@@ -125,6 +128,11 @@
                model.addAttribute("couponList", new ArrayList<Coupon>());
            }
        }
            else{
                model.addAttribute("ticketList", new ArrayList<Coupon>());
            }
        if (vip.getTicketJson() != null && !vip.getTicketJson().isEmpty()){
            String ticketJson = vip.getTicketJson();
            // 转化为jsonArray
@@ -141,18 +149,23 @@
                ticketDetailVOS.add(ticketDetailVO);
            }
            model.addAttribute("ticketList", ticketDetailVOS);
        }else{
            model.addAttribute("ticketList", new ArrayList<TicketDetailVO>());
        }
        return PREFIX + "vip_edit.html";
    }
    public static void main(String[] args) {
        String temp = "[{\"id\":\"36\",\"value\":\"1\"}]";
        JSONArray couponJsonArray = JSONArray.parseArray(temp);
        for (Object o : couponJsonArray) {
            JSONObject couponJsonObject = (JSONObject) o;
            Integer couponId = couponJsonObject.getInteger("id");
        }
    }
//    public static void main(String[] args) {
//        String temp = "[{\"id\":\"36\",\"value\":\"1\"}]";
//        JSONArray couponJsonArray = JSONArray.parseArray(temp);
//        for (Object o : couponJsonArray) {
//            JSONObject couponJsonObject = (JSONObject) o;
//            Integer couponId = couponJsonObject.getInteger("id");
//        }
//    }
    @RequestMapping("/detail/{id}")
    public String detail(@PathVariable("id")Integer id, Model model) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -204,6 +217,9 @@
                        case 3:
                            coupon.setTypeValue("体验券");
                            break;
                        case 4:
                            coupon.setTypeValue("抵扣券");
                            break;
                    }
                    switch (coupon.getUserPopulation()){
                        case 1: