ManualEntryController.java 2.7 KB

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