|
@@ -0,0 +1,63 @@
|
|
|
+package com.ims.eval.controller;
|
|
|
+
|
|
|
+
|
|
|
+import com.ims.eval.config.CustomException;
|
|
|
+import com.ims.eval.entity.dto.result.R;
|
|
|
+import com.ims.eval.entity.EvaluationPersonnel;
|
|
|
+import com.ims.eval.service.IEvaluationPersonnelService;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 考评人员 前端控制器
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author wang
|
|
|
+ * @since 2023-03-06
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("//evaluation-personnel")
|
|
|
+public class EvaluationPersonnelController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IEvaluationPersonnelService evaluationPersonnelService;
|
|
|
+
|
|
|
+
|
|
|
+ //@ImsPreAuth("eval:evaluationPersonnel:view")
|
|
|
+ @GetMapping(value = "listAll")
|
|
|
+ public R listAll(
|
|
|
+ @RequestParam(value = "id", required = false) String id,
|
|
|
+ @RequestParam(value = "enable", required = false) boolean enable) {
|
|
|
+ List<EvaluationPersonnel> list = evaluationPersonnelService.listAll(id, enable);
|
|
|
+ return R.ok().data(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加
|
|
|
+ *
|
|
|
+ * @param personnels
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+
|
|
|
+ //@ImsPreAuth("eval:dataDictionary:edit")
|
|
|
+ @PostMapping(value = "/save")
|
|
|
+ @ApiOperation(value = "新增(修改)", notes = "新增(修改)")
|
|
|
+ public R addAll(@RequestBody List<EvaluationPersonnel> personnels) {
|
|
|
+
|
|
|
+ try {
|
|
|
+ boolean b = evaluationPersonnelService.saveBatch(personnels);
|
|
|
+ if (b) {
|
|
|
+ return R.ok().data(b);
|
|
|
+ } else {
|
|
|
+ return R.error().data("保存失败!");
|
|
|
+ }
|
|
|
+ } catch (CustomException e){
|
|
|
+ return R.customError(e.getMessage()).data("失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|