|
@@ -2,16 +2,15 @@ package com.ims.eval.controller;
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.ims.eval.config.CustomException;
|
|
|
import com.ims.eval.entity.Indicator;
|
|
|
import com.ims.eval.entity.ResponsibilityIndicatorInfo;
|
|
|
+import com.ims.eval.entity.dto.request.ResponsibilityIndicatorInfoUpdateDTO;
|
|
|
import com.ims.eval.entity.dto.result.R;
|
|
|
import com.ims.eval.service.IResponsibilityIndicatorInfoService;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -49,4 +48,78 @@ public class ResponsibilityIndicatorInfoController {
|
|
|
return R.ok().data(list);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 添加
|
|
|
+ *
|
|
|
+ * @param indicatorInfo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+
|
|
|
+ //@ImsPreAuth("eval:responsibilityIndicatorInfo:edit")
|
|
|
+ @PostMapping(value = "/save")
|
|
|
+ @ApiOperation(value = "新增(修改)", notes = "新增(修改)")
|
|
|
+ public R add(@RequestBody ResponsibilityIndicatorInfo indicatorInfo) {
|
|
|
+
|
|
|
+ try {
|
|
|
+ boolean b = responsibilityIndicatorInfoService.saveOrUpdate(indicatorInfo);
|
|
|
+ if (b) {
|
|
|
+ return R.ok().data(b);
|
|
|
+ } else {
|
|
|
+ return R.error().data("保存失败!");
|
|
|
+ }
|
|
|
+ } catch (CustomException e){
|
|
|
+ return R.customError(e.getMessage()).data("失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改
|
|
|
+ *
|
|
|
+ * @param indicatorInfos
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+
|
|
|
+ //@ImsPreAuth("eval:responsibilityIndicatorInfo:edit")
|
|
|
+ @PostMapping(value = "/saveDto")
|
|
|
+ @ApiOperation(value = "新增(修改)", notes = "新增(修改)")
|
|
|
+ public R saveDto(@RequestBody ResponsibilityIndicatorInfoUpdateDTO indicatorInfos) {
|
|
|
+
|
|
|
+ try {
|
|
|
+ boolean b = responsibilityIndicatorInfoService.saveOrUpdateDto(indicatorInfos);
|
|
|
+ if (b) {
|
|
|
+ return R.ok().data(b);
|
|
|
+ } else {
|
|
|
+ return R.error().data("保存失败!");
|
|
|
+ }
|
|
|
+ } catch (CustomException e){
|
|
|
+ return R.customError(e.getMessage()).data("失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量修改
|
|
|
+ *
|
|
|
+ * @param indicatorInfos
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+
|
|
|
+ //@ImsPreAuth("eval:responsibilityIndicatorInfo:edit")
|
|
|
+ @PostMapping(value = "/saveBatchDto")
|
|
|
+ @ApiOperation(value = "批量新增(修改)", notes = "批量新增(修改)")
|
|
|
+ public R saveBatchDto(@RequestBody List<ResponsibilityIndicatorInfoUpdateDTO> indicatorInfos) {
|
|
|
+
|
|
|
+ try {
|
|
|
+ boolean b = responsibilityIndicatorInfoService.saveBatchDto(indicatorInfos);
|
|
|
+ if (b) {
|
|
|
+ return R.ok().data(b);
|
|
|
+ } else {
|
|
|
+ return R.error().data("保存失败!");
|
|
|
+ }
|
|
|
+ } catch (CustomException e){
|
|
|
+ return R.customError(e.getMessage()).data("失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|