ManualEntryController.java 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package com.jiayue.biz.controller;
  2. import com.jiayue.biz.domain.ProjectInfo;
  3. import com.jiayue.biz.domain.TotalityInfo;
  4. import com.jiayue.biz.service.ManualEntryService;
  5. import com.jiayue.biz.service.ProjectInfoService;
  6. import com.jiayue.biz.service.TotalityInfoService;
  7. import com.jiayue.common.core.controller.BaseController;
  8. import com.jiayue.common.core.domain.AjaxResult;
  9. import lombok.RequiredArgsConstructor;
  10. import org.springframework.beans.factory.annotation.Autowired;
  11. import org.springframework.web.bind.annotation.GetMapping;
  12. import org.springframework.web.bind.annotation.RequestMapping;
  13. import org.springframework.web.bind.annotation.RestController;
  14. import java.util.ArrayList;
  15. import java.util.HashMap;
  16. import java.util.List;
  17. import java.util.Map;
  18. /**
  19. * 人工录入Controller
  20. * @date 2023-05-9
  21. */
  22. @RequiredArgsConstructor(onConstructor_ = @Autowired)
  23. @RestController
  24. @RequestMapping("/manualEntry")
  25. public class ManualEntryController extends BaseController {
  26. private final ManualEntryService manualEntryService;
  27. private final TotalityInfoService totalityInfoService;
  28. private final ProjectInfoService projectInfoService;
  29. /*获取光伏站下拉框,风场站的下拉框*/
  30. @GetMapping("/stationInfo")
  31. public AjaxResult hauFuInfo() {
  32. return AjaxResult.success(manualEntryService.getStationInfo());
  33. }
  34. //获取华电以及全省资源概况
  35. @GetMapping("/getProvincialEnergyStations")
  36. public AjaxResult getProvincialEnergyStations() {
  37. return AjaxResult.success(manualEntryService.getProvincialEnergyStations());
  38. }
  39. //获取项目(场站)总体信息
  40. @GetMapping("/getTotalityInfo")
  41. public AjaxResult getTotalityInfo() {
  42. return AjaxResult.success(totalityInfoService.selectTotalityInfoList());
  43. }
  44. /**
  45. *项目进展获取项目名称+id
  46. */
  47. @GetMapping("/getProjectInfo")
  48. public AjaxResult getProjectInfo(){
  49. List<Map<String,String>> list = new ArrayList<>();
  50. List<ProjectInfo> projectInfoList = projectInfoService.getProjectInfoList();
  51. for(ProjectInfo projectInfo : projectInfoList){
  52. Map<String,String> map = new HashMap<>();
  53. map.put("id",projectInfo.getId());
  54. map.put("name",projectInfo.getProjectBasicInfo().getProjectName());
  55. list.add(map);
  56. }
  57. return AjaxResult.success(list);
  58. }
  59. }