|
@@ -1,20 +1,12 @@
|
|
|
package org.jeecg.modules.system.app.controller;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-import java.io.IOException;
|
|
|
-import java.io.UnsupportedEncodingException;
|
|
|
-import java.net.URLDecoder;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
-import org.jeecg.common.system.query.QueryRuleEnum;
|
|
|
-import org.jeecg.common.util.oConvertUtils;
|
|
|
-import org.jeecg.modules.system.app.entity.AppCourese;
|
|
|
+import org.jeecg.modules.system.app.dto.AppCoursesDTO;
|
|
|
+import org.jeecg.modules.system.app.entity.AppCourses;
|
|
|
import org.jeecg.modules.system.app.service.IAppCoureseService;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -22,18 +14,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
-import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
|
-import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
|
-import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
|
-import org.jeecgframework.poi.excel.entity.ImportParams;
|
|
|
-import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
-import org.springframework.web.multipart.MultipartHttpServletRequest;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
@@ -48,7 +32,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
@RestController
|
|
|
@RequestMapping("/org/jeecg/modules/app/appCourese")
|
|
|
@Slf4j
|
|
|
-public class AppCoureseController extends JeecgController<AppCourese, IAppCoureseService> {
|
|
|
+public class AppCoureseController extends JeecgController<AppCourses, IAppCoureseService> {
|
|
|
@Autowired
|
|
|
private IAppCoureseService appCoureseService;
|
|
|
|
|
@@ -64,30 +48,30 @@ public class AppCoureseController extends JeecgController<AppCourese, IAppCoures
|
|
|
//@AutoLog(value = "课程/培训表-分页列表查询")
|
|
|
@Operation(summary="课程/培训表-分页列表查询")
|
|
|
@GetMapping(value = "/list")
|
|
|
- public Result<IPage<AppCourese>> queryPageList(AppCourese appCourese,
|
|
|
- @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
- @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
- HttpServletRequest req) {
|
|
|
+ public Result<IPage<AppCourses>> queryPageList(AppCourses appCourese,
|
|
|
+ @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
+ @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
+ HttpServletRequest req) {
|
|
|
|
|
|
|
|
|
- QueryWrapper<AppCourese> queryWrapper = QueryGenerator.initQueryWrapper(appCourese, req.getParameterMap());
|
|
|
- Page<AppCourese> page = new Page<AppCourese>(pageNo, pageSize);
|
|
|
- IPage<AppCourese> pageList = appCoureseService.page(page, queryWrapper);
|
|
|
+ QueryWrapper<AppCourses> queryWrapper = QueryGenerator.initQueryWrapper(appCourese, req.getParameterMap());
|
|
|
+ Page<AppCourses> page = new Page<AppCourses>(pageNo, pageSize);
|
|
|
+ IPage<AppCourses> pageList = appCoureseService.page(page, queryWrapper);
|
|
|
return Result.OK(pageList);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 添加
|
|
|
*
|
|
|
- * @param appCourese
|
|
|
+ * @param appCoursesDTO
|
|
|
* @return
|
|
|
*/
|
|
|
@AutoLog(value = "课程/培训表-添加")
|
|
|
@Operation(summary="课程/培训表-添加")
|
|
|
@RequiresPermissions("org.jeecg.modules.app:nm_courese:add")
|
|
|
@PostMapping(value = "/add")
|
|
|
- public Result<String> add(@RequestBody AppCourese appCourese) {
|
|
|
- appCoureseService.save(appCourese);
|
|
|
+ public Result<String> add(@RequestBody AppCoursesDTO appCoursesDTO) {
|
|
|
+
|
|
|
|
|
|
return Result.OK("添加成功!");
|
|
|
}
|
|
@@ -95,15 +79,15 @@ public class AppCoureseController extends JeecgController<AppCourese, IAppCoures
|
|
|
/**
|
|
|
* 编辑
|
|
|
*
|
|
|
- * @param appCourese
|
|
|
+ * @param appCoursesDTO
|
|
|
* @return
|
|
|
*/
|
|
|
@AutoLog(value = "课程/培训表-编辑")
|
|
|
@Operation(summary="课程/培训表-编辑")
|
|
|
@RequiresPermissions("org.jeecg.modules.app:nm_courese:edit")
|
|
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
- public Result<String> edit(@RequestBody AppCourese appCourese) {
|
|
|
- appCoureseService.updateById(appCourese);
|
|
|
+ public Result<String> edit(@RequestBody AppCoursesDTO appCoursesDTO) {
|
|
|
+ appCoureseService.editWitchPriceRules(appCoursesDTO);
|
|
|
return Result.OK("编辑成功!");
|
|
|
}
|
|
|
|
|
@@ -146,8 +130,8 @@ public class AppCoureseController extends JeecgController<AppCourese, IAppCoures
|
|
|
//@AutoLog(value = "课程/培训表-通过id查询")
|
|
|
@Operation(summary="课程/培训表-通过id查询")
|
|
|
@GetMapping(value = "/queryById")
|
|
|
- public Result<AppCourese> queryById(@RequestParam(name="id",required=true) String id) {
|
|
|
- AppCourese appCourese = appCoureseService.getById(id);
|
|
|
+ public Result<AppCourses> queryById(@RequestParam(name="id",required=true) String id) {
|
|
|
+ AppCourses appCourese = appCoureseService.getById(id);
|
|
|
if(appCourese==null) {
|
|
|
return Result.error("未找到对应数据");
|
|
|
}
|
|
@@ -162,8 +146,8 @@ public class AppCoureseController extends JeecgController<AppCourese, IAppCoures
|
|
|
*/
|
|
|
@RequiresPermissions("org.jeecg.modules.app:nm_courese:exportXls")
|
|
|
@RequestMapping(value = "/exportXls")
|
|
|
- public ModelAndView exportXls(HttpServletRequest request, AppCourese appCourese) {
|
|
|
- return super.exportXls(request, appCourese, AppCourese.class, "课程/培训表");
|
|
|
+ public ModelAndView exportXls(HttpServletRequest request, AppCourses appCourese) {
|
|
|
+ return super.exportXls(request, appCourese, AppCourses.class, "课程/培训表");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -176,7 +160,7 @@ public class AppCoureseController extends JeecgController<AppCourese, IAppCoures
|
|
|
@RequiresPermissions("org.jeecg.modules.app:nm_courese:importExcel")
|
|
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
|
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
|
|
- return super.importExcel(request, response, AppCourese.class);
|
|
|
+ return super.importExcel(request, response, AppCourses.class);
|
|
|
}
|
|
|
|
|
|
}
|