ReportManageController.java 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. package jnpf.controller;
  2. import io.swagger.v3.oas.annotations.Operation;
  3. import io.swagger.v3.oas.annotations.tags.Tag;
  4. import jnpf.base.ActionResult;
  5. import jnpf.model.ReportManageModel;
  6. import jnpf.util.JsonUtil;
  7. import jnpf.util.PinYinUtil;
  8. import org.springframework.web.bind.annotation.GetMapping;
  9. import org.springframework.web.bind.annotation.RequestMapping;
  10. import org.springframework.web.bind.annotation.RestController;
  11. import java.util.ArrayList;
  12. import java.util.List;
  13. /**
  14. * 专业报表
  15. *
  16. * @author JNPF开发平台组
  17. * @version 版 本:V3.0.0
  18. * @copyright 引迈信息技术有限公司
  19. * @date 日 期:2020.01.30
  20. */
  21. @Tag(name = "专业报表", description = "获取专业报表列表")
  22. @RestController
  23. @RequestMapping("/api/extend/ReportManage")
  24. public class ReportManageController {
  25. /**
  26. * 列表
  27. *
  28. * @return
  29. */
  30. @Operation(summary = "获取专业报表列表")
  31. @GetMapping
  32. public ActionResult list() {
  33. List<ReportManageModel> data = new ArrayList<>();
  34. int num = 1000000000;
  35. for (int i = 0; i < fullNameList().length; i++) {
  36. ReportManageModel model = new ReportManageModel();
  37. model.setId(String.valueOf(num+i+1));
  38. model.setFullName(fullNameList()[i]);
  39. model.setUrlAddress(PinYinUtil.getFullSpell(fullNameList()[i]));
  40. if (i < 8) {
  41. model.setCategory(categoryList()[0]);
  42. }else if(i>=8 && i<=12){
  43. model.setCategory(categoryList()[1]);
  44. }else if(i>=13 && i<=14){
  45. model.setCategory(categoryList()[2]);
  46. }else if(i>=15 && i<=17){
  47. model.setCategory(categoryList()[3]);
  48. }else if(i>=18 && i<=20){
  49. model.setCategory(categoryList()[4]);
  50. }else if(i>=21 && i<=23){
  51. model.setCategory(categoryList()[5]);
  52. }else if(i>23){
  53. model.setCategory(categoryList()[6]);
  54. }
  55. data.add(model);
  56. }
  57. return ActionResult.success(JsonUtil.listToJsonField(data));
  58. }
  59. private String[] categoryList() {
  60. String[] category = {"报表示例", "Excel表格类", "Word文档类", "分栏与分组", "报表套打", "图表类", "其他示例"};
  61. return category;
  62. }
  63. private String[] fullNameList() {
  64. String[] fullName = {"房地产驾驶舱", "数字化营销", "市场营销", "SMT车间看板", "学校综合业绩表", "热线机器人数据分析", "渠道零售",
  65. "承包方调查表", "多维透视表", "复杂交叉表", "煤矿三量基础表", "土地资源", "小学课程表", "销售合同模板", "干部任免审批表",
  66. "单级分组", "多级分组", "分栏报表", "国航机票", "客户订单套打", "快递单套打", "常规图表", "人员离职分析", "销售分析趋势",
  67. "标签打印", "报表水印", "文档目录"};
  68. return fullName;
  69. }
  70. }