|
@@ -1,9 +1,16 @@
|
|
|
package com.ims.eval.controller;
|
|
|
|
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.ims.eval.config.CustomException;
|
|
|
+import com.ims.eval.entity.OrganizationYearRating;
|
|
|
+import com.ims.eval.entity.dto.result.R;
|
|
|
+import com.ims.eval.service.IOrganizationYearRatingService;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import java.util.Arrays;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -17,4 +24,69 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
@RequestMapping("//organization-year-rating")
|
|
|
public class OrganizationYearRatingController {
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IOrganizationYearRatingService organizationYearRatingService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询
|
|
|
+ * @param pageNum
|
|
|
+ * @param pageSize
|
|
|
+
|
|
|
+ * @param yearRatingCode
|
|
|
+ * @param year
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping(value = "list")
|
|
|
+ public R list(@RequestParam(value = "pageNum") Integer pageNum,
|
|
|
+ @RequestParam(value = "pageSize") Integer pageSize,
|
|
|
+ @RequestParam(value = "yearRatingCode", required = false) String yearRatingCode,
|
|
|
+ @RequestParam(value = "year", required = false) String year,
|
|
|
+ @RequestParam(value = "des", required = false) String des) {
|
|
|
+ IPage<OrganizationYearRating> list = organizationYearRatingService.list(pageNum, pageSize, yearRatingCode, year, des);
|
|
|
+ return R.ok().data(list);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping(value = "/save")
|
|
|
+ @ApiOperation(value = "新增(修改)", notes = "新增(修改)")
|
|
|
+ public R addAll(@RequestBody OrganizationYearRating organizationYearRating) {
|
|
|
+
|
|
|
+ try {
|
|
|
+ boolean b = organizationYearRatingService.saveOrUpdate(organizationYearRating);
|
|
|
+ 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 = organizationYearRatingService.removeByIds(Arrays.asList(strings));
|
|
|
+ if (b) {
|
|
|
+ return R.ok().data(b);
|
|
|
+ } else {
|
|
|
+ return R.error().data("删除失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|