|
|
@@ -9,6 +9,7 @@ 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.util.oConvertUtils;
|
|
|
@@ -37,125 +38,130 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
|
|
|
- /**
|
|
|
+/**
|
|
|
* @Description: event_attr
|
|
|
* @Author: jeecg-boot
|
|
|
- * @Date: 2023-04-23
|
|
|
+ * @Date: 2023-04-23
|
|
|
* @Version: V1.0
|
|
|
*/
|
|
|
-@Api(tags="event_attr")
|
|
|
+@Api(tags = "event_attr")
|
|
|
@RestController
|
|
|
@RequestMapping("/medical/eventAttr")
|
|
|
@Slf4j
|
|
|
public class EventAttrController extends JeecgController<EventAttr, IEventAttrService> {
|
|
|
- @Autowired
|
|
|
- private IEventAttrService eventAttrService;
|
|
|
-
|
|
|
- /**
|
|
|
- * 分页列表查询
|
|
|
- *
|
|
|
- * @param eventAttr
|
|
|
- * @param pageNo
|
|
|
- * @param pageSize
|
|
|
- * @param req
|
|
|
- * @return
|
|
|
- */
|
|
|
- //@AutoLog(value = "event_attr-分页列表查询")
|
|
|
- @ApiOperation(value="event_attr-分页列表查询", notes="event_attr-分页列表查询")
|
|
|
- @GetMapping(value = "/list")
|
|
|
- public Result<IPage<EventAttr>> queryPageList(EventAttr eventAttr,
|
|
|
- @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
- @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
- HttpServletRequest req) {
|
|
|
- QueryWrapper<EventAttr> queryWrapper = QueryGenerator.initQueryWrapper(eventAttr, req.getParameterMap());
|
|
|
- Page<EventAttr> page = new Page<EventAttr>(pageNo, pageSize);
|
|
|
- IPage<EventAttr> pageList = eventAttrService.page(page, queryWrapper);
|
|
|
- return Result.OK(pageList);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 添加
|
|
|
- *
|
|
|
- * @param eventAttr
|
|
|
- * @return
|
|
|
- */
|
|
|
- @AutoLog(value = "event_attr-添加")
|
|
|
- @ApiOperation(value="event_attr-添加", notes="event_attr-添加")
|
|
|
- @RequiresPermissions("medical:event_attr:add")
|
|
|
- @PostMapping(value = "/add")
|
|
|
- public Result<String> add(@RequestBody EventAttr eventAttr) {
|
|
|
- eventAttrService.save(eventAttr);
|
|
|
- return Result.OK("添加成功!");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 编辑
|
|
|
- *
|
|
|
- * @param eventAttr
|
|
|
- * @return
|
|
|
- */
|
|
|
- @AutoLog(value = "event_attr-编辑")
|
|
|
- @ApiOperation(value="event_attr-编辑", notes="event_attr-编辑")
|
|
|
- @RequiresPermissions("medical:event_attr:edit")
|
|
|
- @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
- public Result<String> edit(@RequestBody EventAttr eventAttr) {
|
|
|
- eventAttrService.updateById(eventAttr);
|
|
|
- return Result.OK("编辑成功!");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 通过id删除
|
|
|
- *
|
|
|
- * @param id
|
|
|
- * @return
|
|
|
- */
|
|
|
- @AutoLog(value = "event_attr-通过id删除")
|
|
|
- @ApiOperation(value="event_attr-通过id删除", notes="event_attr-通过id删除")
|
|
|
- @RequiresPermissions("medical:event_attr:delete")
|
|
|
- @DeleteMapping(value = "/delete")
|
|
|
- public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
|
|
- eventAttrService.removeById(id);
|
|
|
- return Result.OK("删除成功!");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 批量删除
|
|
|
- *
|
|
|
- * @param ids
|
|
|
- * @return
|
|
|
- */
|
|
|
- @AutoLog(value = "event_attr-批量删除")
|
|
|
- @ApiOperation(value="event_attr-批量删除", notes="event_attr-批量删除")
|
|
|
- @RequiresPermissions("medical:event_attr:deleteBatch")
|
|
|
- @DeleteMapping(value = "/deleteBatch")
|
|
|
- public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
|
- this.eventAttrService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
- return Result.OK("批量删除成功!");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 通过id查询
|
|
|
- *
|
|
|
- * @param id
|
|
|
- * @return
|
|
|
- */
|
|
|
- //@AutoLog(value = "event_attr-通过id查询")
|
|
|
- @ApiOperation(value="event_attr-通过id查询", notes="event_attr-通过id查询")
|
|
|
- @GetMapping(value = "/queryById")
|
|
|
- public Result<EventAttr> queryById(@RequestParam(name="id",required=true) String id) {
|
|
|
- EventAttr eventAttr = eventAttrService.getById(id);
|
|
|
- if(eventAttr==null) {
|
|
|
- return Result.error("未找到对应数据");
|
|
|
- }
|
|
|
- return Result.OK(eventAttr);
|
|
|
- }
|
|
|
+ @Autowired
|
|
|
+ private IEventAttrService eventAttrService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页列表查询
|
|
|
+ *
|
|
|
+ * @param eventAttr
|
|
|
+ * @param pageNo
|
|
|
+ * @param pageSize
|
|
|
+ * @param req
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ //@AutoLog(value = "event_attr-分页列表查询")
|
|
|
+ @ApiOperation(value = "event_attr-分页列表查询", notes = "event_attr-分页列表查询")
|
|
|
+ @GetMapping(value = "/list")
|
|
|
+ public Result<IPage<EventAttr>> queryPageList(EventAttr eventAttr,
|
|
|
+ @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
+ HttpServletRequest req) {
|
|
|
+ QueryWrapper<EventAttr> queryWrapper = QueryGenerator.initQueryWrapper(eventAttr, req.getParameterMap());
|
|
|
+ Page<EventAttr> page = new Page<EventAttr>(pageNo, pageSize);
|
|
|
+ IPage<EventAttr> pageList = eventAttrService.page(page, queryWrapper);
|
|
|
+ return Result.OK(pageList);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value = "/attrList")
|
|
|
+ public Result<List<EventAttr>> queryPageList(HttpServletRequest req) {
|
|
|
+ return Result.OK(eventAttrService.list());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加
|
|
|
+ *
|
|
|
+ * @param eventAttr
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "event_attr-添加")
|
|
|
+ @ApiOperation(value = "event_attr-添加", notes = "event_attr-添加")
|
|
|
+ @RequiresPermissions("medical:event_attr:add")
|
|
|
+ @PostMapping(value = "/add")
|
|
|
+ public Result<String> add(@RequestBody EventAttr eventAttr) {
|
|
|
+ eventAttrService.save(eventAttr);
|
|
|
+ return Result.OK("添加成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 编辑
|
|
|
+ *
|
|
|
+ * @param eventAttr
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "event_attr-编辑")
|
|
|
+ @ApiOperation(value = "event_attr-编辑", notes = "event_attr-编辑")
|
|
|
+ @RequiresPermissions("medical:event_attr:edit")
|
|
|
+ @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
|
|
+ public Result<String> edit(@RequestBody EventAttr eventAttr) {
|
|
|
+ eventAttrService.updateById(eventAttr);
|
|
|
+ return Result.OK("编辑成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过id删除
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "event_attr-通过id删除")
|
|
|
+ @ApiOperation(value = "event_attr-通过id删除", notes = "event_attr-通过id删除")
|
|
|
+ @RequiresPermissions("medical:event_attr:delete")
|
|
|
+ @DeleteMapping(value = "/delete")
|
|
|
+ public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
|
|
+ eventAttrService.removeById(id);
|
|
|
+ return Result.OK("删除成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量删除
|
|
|
+ *
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "event_attr-批量删除")
|
|
|
+ @ApiOperation(value = "event_attr-批量删除", notes = "event_attr-批量删除")
|
|
|
+ @RequiresPermissions("medical:event_attr:deleteBatch")
|
|
|
+ @DeleteMapping(value = "/deleteBatch")
|
|
|
+ public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
|
|
+ this.eventAttrService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
+ return Result.OK("批量删除成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过id查询
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ //@AutoLog(value = "event_attr-通过id查询")
|
|
|
+ @ApiOperation(value = "event_attr-通过id查询", notes = "event_attr-通过id查询")
|
|
|
+ @GetMapping(value = "/queryById")
|
|
|
+ public Result<EventAttr> queryById(@RequestParam(name = "id", required = true) String id) {
|
|
|
+ EventAttr eventAttr = eventAttrService.getById(id);
|
|
|
+ if (eventAttr == null) {
|
|
|
+ return Result.error("未找到对应数据");
|
|
|
+ }
|
|
|
+ return Result.OK(eventAttr);
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
- * 导出excel
|
|
|
- *
|
|
|
- * @param request
|
|
|
- * @param eventAttr
|
|
|
- */
|
|
|
+ * 导出excel
|
|
|
+ *
|
|
|
+ * @param request
|
|
|
+ * @param eventAttr
|
|
|
+ */
|
|
|
@RequiresPermissions("medical:event_attr:exportXls")
|
|
|
@RequestMapping(value = "/exportXls")
|
|
|
public ModelAndView exportXls(HttpServletRequest request, EventAttr eventAttr) {
|
|
|
@@ -163,12 +169,12 @@ public class EventAttrController extends JeecgController<EventAttr, IEventAttrSe
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 通过excel导入数据
|
|
|
- *
|
|
|
- * @param request
|
|
|
- * @param response
|
|
|
- * @return
|
|
|
- */
|
|
|
+ * 通过excel导入数据
|
|
|
+ *
|
|
|
+ * @param request
|
|
|
+ * @param response
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@RequiresPermissions("medical:event_attr:importExcel")
|
|
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
|
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|