|
@@ -0,0 +1,86 @@
|
|
|
+package com.ims.eval.controller;
|
|
|
+
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.ims.eval.config.CustomException;
|
|
|
+import com.ims.eval.entity.OrganizationRating;
|
|
|
+import com.ims.eval.entity.dto.result.R;
|
|
|
+import com.ims.eval.service.IOrganizationRatingService;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 年度评级 前端控制器
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author wang
|
|
|
+ * @since 2023-06-20
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("//organization-rating")
|
|
|
+public class OrganizationRatingController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IOrganizationRatingService organizationRatingService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询
|
|
|
+ * @param pageNum
|
|
|
+ * @param pageSize
|
|
|
+ * @param id
|
|
|
+ * @param binSection
|
|
|
+ * @param year
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping(value = "list")
|
|
|
+ public R list(@RequestParam(value = "pageNum") Integer pageNum,
|
|
|
+ @RequestParam(value = "pageSize") Integer pageSize,
|
|
|
+ @RequestParam(value = "id", required = false) String id,
|
|
|
+ @RequestParam(value = "binSection", required = false) String binSection,
|
|
|
+ @RequestParam(value = "year", required = false) String year) {
|
|
|
+ IPage<OrganizationRating> list = organizationRatingService.list(pageNum, pageSize, id, binSection, year);
|
|
|
+ return R.ok().data(null);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping(value = "/save")
|
|
|
+ @ApiOperation(value = "新增(修改)", notes = "新增(修改)")
|
|
|
+ public R addAll(@RequestBody OrganizationRating organizationRating) {
|
|
|
+
|
|
|
+ try {
|
|
|
+ boolean b = organizationRatingService.saveOrUpdate(organizationRating);
|
|
|
+ if (b) {
|
|
|
+ return R.ok().data(b);
|
|
|
+ } else {
|
|
|
+ return R.error().data("保存失败!");
|
|
|
+ }
|
|
|
+ } catch (CustomException e) {
|
|
|
+ return R.customError(e.getMessage()).data("失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量删除
|
|
|
+ *
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/remove/{ids}")
|
|
|
+ @ApiOperation(value = "删除", notes = "删除")
|
|
|
+ public R deleteAll(@PathVariable("ids") String ids) {
|
|
|
+ String[] strings = ids.split(",");
|
|
|
+ boolean b = organizationRatingService.removeByIds(Arrays.asList(strings));
|
|
|
+ if (b) {
|
|
|
+ return R.ok().data(b);
|
|
|
+ } else {
|
|
|
+ return R.error().data("删除失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|