예제 #1
0
 @RequestMapping("/saveOrUpdatePackageType")
 public String saveOrUpdatePackageType(
     @ModelAttribute("packageType") PackageType packageType, HttpSession session) {
   Boolean isContinue = packageType.getContinue();
   packageType = packageService.saveOrUpdatePackageType(packageType);
   if (isContinue) {
     return "redirect:/package/editPackageType/0";
   }
   return "redirect:/package/packageType";
 }
예제 #2
0
 @RequestMapping("/editPackageType/{id}")
 public String editPackageType(
     @PathVariable Integer id,
     @ModelAttribute PackageType packageType,
     HttpServletRequest request) {
   packageType.setId(null);
   if (id != 0) {
     PackageType tmp = packageService.findPackageTypeByPackageTypeId(id);
     BeanUtils.copyProperties(tmp, packageType);
   }
   return "packageType_edit";
 }
예제 #3
0
  @RequestMapping("/editPackages/{id}")
  public String editPackages(
      @PathVariable Integer id, @ModelAttribute Packages packages, HttpServletRequest request) {
    packages.setId(null);
    if (id != 0) {
      Packages tmp = packageService.findPackagesByPackageId(id);
      BeanUtils.copyProperties(tmp, packages);
    } else {
      packages.setPackageServicePrice((float) 0.0);
    }

    List<PackageType> list = packageService.findAllPackageTypes();
    request.setAttribute("packageTypeList", list);

    try {
      String uptoken = QiniuHelper.generateUpToken(QiniuHelper.QINIU_BUCKET_IMAGE);
      request.setAttribute("uptoken", uptoken);
    } catch (AuthException e) {
      e.printStackTrace();
    }

    return "packages_edit";
  }
예제 #4
0
 @RequestMapping("/deletePackageType/{id}")
 @ResponseBody
 public String deletePackageType(@PathVariable Integer id) {
   packageService.deletePackageType(id);
   return "success";
 }
예제 #5
0
 @RequestMapping("/loadPackageType")
 @ResponseBody
 public String loadPackageType() {
   List<PackageType> list = packageService.findAllPackageTypes();
   return JsonUtils.aaData(list);
 }