|
@@ -3,23 +3,20 @@ 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.dto.request.IndicatorDTO;
|
|
|
import com.ims.eval.entity.dto.request.IndicatorDictionaryDTO;
|
|
|
import com.ims.eval.entity.dto.result.R;
|
|
|
-import com.ims.eval.entity.Indicator;
|
|
|
import com.ims.eval.service.IIndicatorDictionaryService;
|
|
|
import com.ims.eval.service.IIndicatorService;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
-import lombok.extern.log4j.Log4j2;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import java.net.URLDecoder;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -66,11 +63,10 @@ public class IndicatorController {
|
|
|
@RequestParam(value = "dept", required = false) String dept,
|
|
|
@RequestParam(value = "company", required = false) String company,
|
|
|
@RequestParam(value = "evaluationCycle", required = false) String evaluationCycle) {
|
|
|
- IPage<Indicator> list = iIndicatorService.list2(pageNum, pageSize, id, indicatorName, indicatorCode, binSection, binStage, dept, company,evaluationCycle);
|
|
|
+ IPage<Indicator> list = iIndicatorService.list2(pageNum, pageSize, id, indicatorName, indicatorCode, binSection, binStage, dept, company, evaluationCycle);
|
|
|
return R.ok().data(list);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 查询所有数据
|
|
|
*
|
|
@@ -94,7 +90,7 @@ public class IndicatorController {
|
|
|
@RequestParam(value = "dept", required = false) String dept,
|
|
|
@RequestParam(value = "company", required = false) String company,
|
|
|
@RequestParam(value = "evaluationCycle", required = false) String evaluationCycle) {
|
|
|
- List<Indicator> list = iIndicatorService.listAll(id, indicatorName, indicatorCode, binSection, binStage, dept, company,evaluationCycle);
|
|
|
+ List<Indicator> list = iIndicatorService.listAll(id, indicatorName, indicatorCode, binSection, binStage, dept, company, evaluationCycle);
|
|
|
return R.ok().data(list);
|
|
|
}
|
|
|
|
|
@@ -107,17 +103,14 @@ public class IndicatorController {
|
|
|
@GetMapping(value = "selectByCode")
|
|
|
public R selectByCode(
|
|
|
@RequestParam(value = "indicatorCede", required = false) String indicatorCode) {
|
|
|
-
|
|
|
List<IndicatorDictionaryDTO> list = new ArrayList<>();
|
|
|
Indicator indicator = iIndicatorService.selectByCode(indicatorCode);
|
|
|
- if(indicator != null){
|
|
|
- list = indicatorDictionaryService.list(indicator.getId(),"","");
|
|
|
+ if (indicator != null) {
|
|
|
+ list = indicatorDictionaryService.list(indicator.getId(), "", "");
|
|
|
}
|
|
|
return R.ok().data(list);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 根据指标id获取主子指标
|
|
|
*
|
|
@@ -127,10 +120,8 @@ public class IndicatorController {
|
|
|
@GetMapping(value = "selectById")
|
|
|
public R selectById(
|
|
|
@RequestParam(value = "id", required = false) String id) {
|
|
|
-
|
|
|
List<IndicatorDictionaryDTO> list = new ArrayList<>();
|
|
|
IndicatorDTO indicator = iIndicatorService.getById(id);
|
|
|
-
|
|
|
return R.ok().data(indicator);
|
|
|
}
|
|
|
|
|
@@ -145,7 +136,6 @@ public class IndicatorController {
|
|
|
@PostMapping(value = "/save")
|
|
|
@ApiOperation(value = "新增(修改)", notes = "新增(修改)")
|
|
|
public R addAll(@RequestBody Indicator indicator) {
|
|
|
-
|
|
|
try {
|
|
|
boolean b = iIndicatorService.saveOrUpdate(indicator);
|
|
|
if (b) {
|
|
@@ -153,7 +143,7 @@ public class IndicatorController {
|
|
|
} else {
|
|
|
return R.error().data("保存失败!");
|
|
|
}
|
|
|
- } catch (CustomException e){
|
|
|
+ } catch (CustomException e) {
|
|
|
return R.customError(e.getMessage()).data("失败!");
|
|
|
}
|
|
|
}
|
|
@@ -169,9 +159,6 @@ public class IndicatorController {
|
|
|
@PostMapping(value = "/saveGroup")
|
|
|
@ApiOperation(value = "新增(修改)", notes = "新增(修改)")
|
|
|
public R saveGroup(@RequestBody IndicatorDTO indicator) {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
try {
|
|
|
boolean b = iIndicatorService.saveGroup(indicator);
|
|
|
if (b) {
|
|
@@ -179,18 +166,15 @@ public class IndicatorController {
|
|
|
} else {
|
|
|
return R.error().data("保存失败!");
|
|
|
}
|
|
|
- } catch (CustomException e){
|
|
|
- log.error("错误",e);
|
|
|
+ } catch (CustomException e) {
|
|
|
+ log.error("错误", e);
|
|
|
return R.customError(e.getMessage()).data("失败!");
|
|
|
- }catch (Exception e2){
|
|
|
- log.error("错误",e2);
|
|
|
+ } catch (Exception e2) {
|
|
|
+ log.error("错误", e2);
|
|
|
return R.customError(e2.getMessage()).data("失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 批量删除
|
|
|
*
|
|
@@ -209,6 +193,4 @@ public class IndicatorController {
|
|
|
return R.error().data("删除失败!");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|