|
@@ -12,6 +12,7 @@ import com.energy.manage.service.domain.vo.windfield.WindFieldNameVo;
|
|
import com.energy.manage.service.domain.vo.windfield.WindFieldPageVo;
|
|
import com.energy.manage.service.domain.vo.windfield.WindFieldPageVo;
|
|
import com.energy.manage.service.domain.vo.windfield.WindFieldVo;
|
|
import com.energy.manage.service.domain.vo.windfield.WindFieldVo;
|
|
import com.energy.manage.service.domain.vo.windrelation.WindRelationVo;
|
|
import com.energy.manage.service.domain.vo.windrelation.WindRelationVo;
|
|
|
|
+import com.energy.manage.service.service.windenginegroup.WindEngineGroupService;
|
|
import com.energy.manage.service.service.windfield.WindFieldResourceService;
|
|
import com.energy.manage.service.service.windfield.WindFieldResourceService;
|
|
import com.energy.manage.service.service.windfield.WindFieldService;
|
|
import com.energy.manage.service.service.windfield.WindFieldService;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
@@ -36,6 +37,9 @@ public class WindFieldController {
|
|
private WindFieldService windFieldService;
|
|
private WindFieldService windFieldService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private WindEngineGroupService windEngineGroupService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
private WindFieldResourceService windFieldResourceService;
|
|
private WindFieldResourceService windFieldResourceService;
|
|
|
|
|
|
|
|
|
|
@@ -64,7 +68,7 @@ public class WindFieldController {
|
|
WindFieldImportDataDto windFieldImportDataDto = new WindFieldImportDataDto();
|
|
WindFieldImportDataDto windFieldImportDataDto = new WindFieldImportDataDto();
|
|
windFieldImportDataDto.setCompanyCode(companyCode);
|
|
windFieldImportDataDto.setCompanyCode(companyCode);
|
|
|
|
|
|
- return windFieldService.windFieldImportData(file, windFieldImportDataDto);
|
|
|
|
|
|
+ return windFieldService.windFieldImportData(file, windFieldImportDataDto);
|
|
}
|
|
}
|
|
|
|
|
|
@Deprecated
|
|
@Deprecated
|
|
@@ -90,7 +94,9 @@ public class WindFieldController {
|
|
@PostMapping(value = "/delWindFieldById")
|
|
@PostMapping(value = "/delWindFieldById")
|
|
@ApiOperation(value = "删除风场")
|
|
@ApiOperation(value = "删除风场")
|
|
public ResultResp delWindFieldById(@RequestBody @Valid WindFieldCodeDto windFieldCodeDto) {
|
|
public ResultResp delWindFieldById(@RequestBody @Valid WindFieldCodeDto windFieldCodeDto) {
|
|
-
|
|
|
|
|
|
+ if (windEngineGroupService.getWindEngineGroupCountByField(windFieldCodeDto.getFieldCode()) <= 0) {
|
|
|
|
+ return ResultResp.FAIL("风场下有绑定风机,不可删除!");
|
|
|
|
+ }
|
|
boolean flg = windFieldService.delWindFieldById(windFieldCodeDto.getFieldCode());
|
|
boolean flg = windFieldService.delWindFieldById(windFieldCodeDto.getFieldCode());
|
|
return flg ? ResultResp.SUCCESS() : ResultResp.FAIL();
|
|
return flg ? ResultResp.SUCCESS() : ResultResp.FAIL();
|
|
}
|
|
}
|
|
@@ -100,7 +106,7 @@ public class WindFieldController {
|
|
@ApiOperation(value = "通过企业编号查询关联风场")
|
|
@ApiOperation(value = "通过企业编号查询关联风场")
|
|
public ResultResp<List<WindFieldVo>> getWindFieldVos(@RequestParam(required = true) String companyCode) {
|
|
public ResultResp<List<WindFieldVo>> getWindFieldVos(@RequestParam(required = true) String companyCode) {
|
|
|
|
|
|
- List<WindFieldVo> list = windFieldService.getWindFieldVos(companyCode);
|
|
|
|
|
|
+ List<WindFieldVo> list = windFieldService.getWindFieldVos(companyCode);
|
|
return ResultResp.SUCCESS(list);
|
|
return ResultResp.SUCCESS(list);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -132,7 +138,7 @@ public class WindFieldController {
|
|
@UserLoginToken
|
|
@UserLoginToken
|
|
@PostMapping(value = "/getWindFieldTree")
|
|
@PostMapping(value = "/getWindFieldTree")
|
|
@ApiOperation(value = "查询风场树")
|
|
@ApiOperation(value = "查询风场树")
|
|
- public ResultResp< List<Map<String, Object>>> getWindFieldTree() {
|
|
|
|
|
|
+ public ResultResp<List<Map<String, Object>>> getWindFieldTree() {
|
|
List<Map<String, Object>> list = windFieldService.getWindFieldTree();
|
|
List<Map<String, Object>> list = windFieldService.getWindFieldTree();
|
|
return ResultResp.SUCCESS(list);
|
|
return ResultResp.SUCCESS(list);
|
|
}
|
|
}
|
|
@@ -160,12 +166,9 @@ public class WindFieldController {
|
|
@PostMapping(value = "/getWindFieldNames")
|
|
@PostMapping(value = "/getWindFieldNames")
|
|
@ApiOperation(value = "查询风场集合")
|
|
@ApiOperation(value = "查询风场集合")
|
|
public ResultResp<List<WindFieldNameVo>> getWindFieldNames() {
|
|
public ResultResp<List<WindFieldNameVo>> getWindFieldNames() {
|
|
- List<WindFieldNameVo> list = windFieldService.getWindFieldNames();
|
|
|
|
- return ResultResp.SUCCESS(list);
|
|
|
|
|
|
+ List<WindFieldNameVo> list = windFieldService.getWindFieldNames();
|
|
|
|
+ return ResultResp.SUCCESS(list);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|