|
@@ -0,0 +1,91 @@
|
|
|
+package com.ims.eval.controller;
|
|
|
+
|
|
|
+
|
|
|
+import com.ims.eval.config.CustomException;
|
|
|
+import com.ims.eval.entity.EvaluationScoreCount;
|
|
|
+import com.ims.eval.entity.dto.result.R;
|
|
|
+import com.ims.eval.service.IEvaluationScoreCountService;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 考评得分统计 前端控制器
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author xugp
|
|
|
+ * @since 2023-03-30
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("//score_count")
|
|
|
+public class EvaluationScoreCountController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IEvaluationScoreCountService iEvaluationScoreCountService;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询
|
|
|
+ *
|
|
|
+ * @param organizationEvaluationId 考评记录id
|
|
|
+ * @param organizationEvaluationRuleId 考评规则id
|
|
|
+ * @param binStage code
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping(value = "list")
|
|
|
+ public R list(@RequestParam(value = "organizationEvaluationId", required = false) String organizationEvaluationId,
|
|
|
+ @RequestParam(value = "organizationEvaluationRuleId", required = false) String organizationEvaluationRuleId,
|
|
|
+ @RequestParam(value = "binStage", required = false) String binStage) {
|
|
|
+ List<EvaluationScoreCount> list = iEvaluationScoreCountService.getListByEvaluationRuleId(organizationEvaluationId,organizationEvaluationRuleId,binStage);
|
|
|
+ return R.ok().data(list);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加
|
|
|
+ *
|
|
|
+ * @param evaluationScoreCount
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+
|
|
|
+ @PostMapping(value = "/save")
|
|
|
+ @ApiOperation(value = "新增(修改)", notes = "新增(修改)")
|
|
|
+ public R addAll(@RequestBody EvaluationScoreCount evaluationScoreCount) {
|
|
|
+
|
|
|
+ try {
|
|
|
+ boolean b = iEvaluationScoreCountService.saveOrUpdate(evaluationScoreCount);
|
|
|
+ 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 = iEvaluationScoreCountService.removeByIds(Arrays.asList(strings));
|
|
|
+ if (b) {
|
|
|
+ return R.ok().data(b);
|
|
|
+ } else {
|
|
|
+ return R.error().data("删除失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|