|  |  |  | 
|---|
|  |  |  | model.addAttribute("item", tCoursePackage); | 
|---|
|  |  |  | List<CoursePackagePaymentConfig> list4 = coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList(id); | 
|---|
|  |  |  | List<Map<String, Object>> list = new ArrayList<>(); | 
|---|
|  |  |  | for (CoursePackagePaymentConfig coursePackagePaymentConfig : list4) { | 
|---|
|  |  |  | if(coursePackagePaymentConfig.getCashPayment() == 0){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Map<String, Object> map = new HashMap<>(); | 
|---|
|  |  |  | map.put("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()); | 
|---|
|  |  |  | map.put("classHours", coursePackagePaymentConfig.getClassHours()); | 
|---|
|  |  |  | String payment = ""; | 
|---|
|  |  |  | if(coursePackagePaymentConfig.getCashPayment() > 0){ | 
|---|
|  |  |  | payment += "现金支付"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(coursePackagePaymentConfig.getPlayPaiCoin() > 0){ | 
|---|
|  |  |  | payment += (ToolUtil.isNotEmpty(payment) ? "、" : "") + "玩湃币支付"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | map.put("payment",  payment); | 
|---|
|  |  |  | map.put("cashPayment", coursePackagePaymentConfig.getCashPayment()); | 
|---|
|  |  |  | List<TCoursePackageDiscount> tCoursePackageDiscounts = coursePackageDiscountClient.queryCoursePackageDiscount(coursePackagePaymentConfig.getId()); | 
|---|
|  |  |  | map.put("coursePackageDiscount", tCoursePackageDiscounts); | 
|---|
|  |  |  | list.add(map); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | model.addAttribute("role",UserExt.getUser().getObjectType()); | 
|---|
|  |  |  | model.addAttribute("type",tCoursePackage.getType()); | 
|---|
|  |  |  | model.addAttribute("coursePackagePaymentConfig", JSON.toJSONString(list)); | 
|---|
|  |  |  | return PREFIX + "coursePackageDiscount.html"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @RequestMapping("/infoOne") | 
|---|
|  |  |  | public String infoOne( Integer id, Model model) { | 
|---|
|  |  |  | TCoursePackage tCoursePackage = coursePackageService.queryById(id); | 
|---|
|  |  |  | model.addAttribute("item", tCoursePackage); | 
|---|
|  |  |  | List<CoursePackagePaymentConfig> list4 = coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList(id); | 
|---|
|  |  |  | List<Map<String, Object>> list = new ArrayList<>(); | 
|---|
|  |  |  | // 拒绝理由 | 
|---|
|  |  |  | StringBuilder reasons = new StringBuilder(""); | 
|---|
|  |  |  | int a =0; | 
|---|
|  |  |  | for (CoursePackagePaymentConfig coursePackagePaymentConfig : list4) { | 
|---|
|  |  |  | if(coursePackagePaymentConfig.getCashPayment() == 0){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | map.put("payment",  payment); | 
|---|
|  |  |  | map.put("cashPayment", coursePackagePaymentConfig.getCashPayment()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<TCoursePackageDiscount> tCoursePackageDiscounts = coursePackageDiscountClient.queryCoursePackageDiscount(coursePackagePaymentConfig.getId()); | 
|---|
|  |  |  | for (TCoursePackageDiscount tCoursePackageDiscount : tCoursePackageDiscounts) { | 
|---|
|  |  |  | if (tCoursePackageDiscount.getAuditStatus()==3){ | 
|---|
|  |  |  | reasons.append(tCoursePackageDiscount.getAuditRemark()+","); | 
|---|
|  |  |  | a = 3; | 
|---|
|  |  |  | model.addAttribute("type1",3); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | }else if (tCoursePackageDiscount.getAuditStatus()==2){ | 
|---|
|  |  |  | a=2; | 
|---|
|  |  |  | model.addAttribute("type1",-1); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | a=1; | 
|---|
|  |  |  | model.addAttribute("type1",-1); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | for (TCoursePackageDiscount tCoursePackageDiscount : tCoursePackageDiscounts) { | 
|---|
|  |  |  | if (tCoursePackageDiscount.getAuditStatus()==3){ | 
|---|
|  |  |  | reasons.append(tCoursePackageDiscount.getAuditRemark()+","); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | map.put("coursePackageDiscount", tCoursePackageDiscounts); | 
|---|
|  |  |  | 
|---|
|  |  |  | // 审核状态 | 
|---|
|  |  |  | StringBuilder stringBuilder = new StringBuilder(""); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | switch (type1){ | 
|---|
|  |  |  | switch (a){ | 
|---|
|  |  |  | case 1: | 
|---|
|  |  |  | stringBuilder.append("待审核"); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | String string = reasons.toString(); | 
|---|
|  |  |  | if (!string.equals("")){ | 
|---|
|  |  |  | String substring = string.substring(0, string.length() - 1); | 
|---|
|  |  |  | model.addAttribute("reasons", substring); | 
|---|
|  |  |  | int index = string.indexOf(","); | 
|---|
|  |  |  | String result = string.substring(0, index); | 
|---|
|  |  |  | model.addAttribute("reasons", result); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | model.addAttribute("reasons", ""); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | model.addAttribute("coursePackagePaymentConfig", JSON.toJSONString(list)); | 
|---|
|  |  |  | model.addAttribute("type2",tCoursePackage.getType()); | 
|---|
|  |  |  | return PREFIX + "coursePackageDiscount.html"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @RequestMapping("/infoOne") | 
|---|
|  |  |  | public String infoOne( Integer id, Model model) { | 
|---|
|  |  |  | TCoursePackage tCoursePackage = coursePackageService.queryById(id); | 
|---|
|  |  |  | model.addAttribute("item", tCoursePackage); | 
|---|
|  |  |  | List<CoursePackagePaymentConfig> list4 = coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList(id); | 
|---|
|  |  |  | List<Map<String, Object>> list = new ArrayList<>(); | 
|---|
|  |  |  | // 拒绝理由 | 
|---|
|  |  |  | StringBuilder reasons = new StringBuilder(""); | 
|---|
|  |  |  | int a =0; | 
|---|
|  |  |  | for (CoursePackagePaymentConfig coursePackagePaymentConfig : list4) { | 
|---|
|  |  |  | if(coursePackagePaymentConfig.getCashPayment() == 0){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Map<String, Object> map = new HashMap<>(); | 
|---|
|  |  |  | map.put("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()); | 
|---|
|  |  |  | map.put("classHours", coursePackagePaymentConfig.getClassHours()); | 
|---|
|  |  |  | String payment = ""; | 
|---|
|  |  |  | if(coursePackagePaymentConfig.getCashPayment() > 0){ | 
|---|
|  |  |  | payment += "现金支付"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(coursePackagePaymentConfig.getPlayPaiCoin() > 0){ | 
|---|
|  |  |  | payment += (ToolUtil.isNotEmpty(payment) ? "、" : "") + "玩湃币支付"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | map.put("payment",  payment); | 
|---|
|  |  |  | map.put("cashPayment", coursePackagePaymentConfig.getCashPayment()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<TCoursePackageDiscount> tCoursePackageDiscounts = coursePackageDiscountClient.queryCoursePackageDiscount(coursePackagePaymentConfig.getId()); | 
|---|
|  |  |  | for (TCoursePackageDiscount tCoursePackageDiscount : tCoursePackageDiscounts) { | 
|---|
|  |  |  | if (tCoursePackageDiscount.getAuditStatus()==3){ | 
|---|
|  |  |  | a = 3; | 
|---|
|  |  |  | model.addAttribute("type1",3); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | }else if (tCoursePackageDiscount.getAuditStatus()==2){ | 
|---|
|  |  |  | a=2; | 
|---|
|  |  |  | model.addAttribute("type1",-1); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | a=1; | 
|---|
|  |  |  | model.addAttribute("type1",-1); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | for (TCoursePackageDiscount tCoursePackageDiscount : tCoursePackageDiscounts) { | 
|---|
|  |  |  | if (tCoursePackageDiscount.getAuditStatus()==3){ | 
|---|
|  |  |  | reasons.append(tCoursePackageDiscount.getAuditRemark()+","); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | map.put("coursePackageDiscount", tCoursePackageDiscounts); | 
|---|
|  |  |  | list.add(map); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | model.addAttribute("role",UserExt.getUser().getObjectType()); | 
|---|
|  |  |  | Integer type1 = tCoursePackage.getType(); | 
|---|
|  |  |  | // 审核状态 | 
|---|
|  |  |  | StringBuilder stringBuilder = new StringBuilder(""); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | switch (a){ | 
|---|
|  |  |  | case 1: | 
|---|
|  |  |  | stringBuilder.append("待审核"); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case 2: | 
|---|
|  |  |  | stringBuilder.append("已通过"); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case 3: | 
|---|
|  |  |  | stringBuilder.append("未通过"); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | model.addAttribute("type",stringBuilder); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | String string = reasons.toString(); | 
|---|
|  |  |  | if (!string.equals("")){ | 
|---|
|  |  |  | int index = string.indexOf(","); | 
|---|
|  |  |  | String result = string.substring(0, index); | 
|---|
|  |  |  | model.addAttribute("reasons", result); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | model.addAttribute("reasons", ""); | 
|---|
|  |  |  | } | 
|---|