TmstruckWeightResultController.java 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. package com.steerinfo.dil.controller;
  2. import com.steerinfo.dil.service.ITmstruckWeightResultService;
  3. import com.steerinfo.dil.util.BaseRESTfulController;
  4. import com.steerinfo.dil.util.ColumnDataUtil;
  5. import com.steerinfo.dil.util.PageListAdd;
  6. import com.steerinfo.framework.controller.RESTfulResult;
  7. import com.steerinfo.framework.service.pagehelper.PageHelper;
  8. import io.swagger.annotations.ApiImplicitParam;
  9. import io.swagger.annotations.ApiImplicitParams;
  10. import io.swagger.annotations.ApiOperation;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.web.bind.annotation.*;
  13. import java.util.HashMap;
  14. import java.util.List;
  15. import java.util.Map;
  16. /**
  17. * TmstruckWeightResult RESTful接口:
  18. * @author generator
  19. * @version 1.0-SNAPSHORT 2021-09-09 02:21
  20. * 类描述
  21. * 修订历史:
  22. * 日期:2021-09-09
  23. * 作者:generator
  24. * 参考:
  25. * 描述:TmstruckWeightResult RESTful接口
  26. * @see null
  27. * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
  28. */
  29. @RestController
  30. @RequestMapping("/${api.version}/tmstruckweightresults")
  31. public class TmstruckWeightResultController extends BaseRESTfulController {
  32. @Autowired
  33. ITmstruckWeightResultService tmstruckWeightResultService;
  34. @Autowired
  35. ColumnDataUtil columnDataUtil;
  36. @ApiOperation(value="新增计量实绩 ")
  37. @ApiImplicitParams({
  38. @ApiImplicitParam(name = "mapValue", value = "总实绩ID、计皮点、计毛点", required = false, dataType = "Map"),
  39. })
  40. @PostMapping("/addWeightResult")
  41. public RESTfulResult addWeightResult(@RequestBody Map<String, Object> mapValue){
  42. int i = tmstruckWeightResultService.addWeightResult(mapValue);
  43. return success(i);
  44. }
  45. @ApiOperation(value="查询计毛实绩")
  46. @ApiImplicitParams({
  47. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  48. @ApiImplicitParam(name = "apiId(102)", value = "动态表头", required = false, dataType = "Integer"),
  49. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  50. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  51. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  52. })
  53. @PostMapping("/getAllJiMaoResult")
  54. public RESTfulResult getAllJiMaoResult(@RequestBody(required=false) Map<String,Object> mapValue,
  55. Integer apiId,
  56. Integer pageNum,
  57. Integer pageSize,
  58. Integer orderType
  59. ){
  60. if (mapValue == null){
  61. mapValue = new HashMap<>();
  62. }
  63. if(orderType != null){
  64. mapValue.put("orderTypee", orderType);
  65. }
  66. //不分页筛选数据
  67. List<Map<String, Object>> allJiMaoResult = tmstruckWeightResultService.getAllJiMaoResult(mapValue);
  68. PageHelper.startPage(pageNum,pageSize);
  69. //分页数据
  70. List<Map<String, Object>> jiMaoResult = tmstruckWeightResultService.getAllJiMaoResult(mapValue);
  71. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allJiMaoResult,jiMaoResult);
  72. return success(pageList);
  73. }
  74. @ApiOperation(value="查询计皮实绩")
  75. @ApiImplicitParams({
  76. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  77. @ApiImplicitParam(name = "apiId(104)", value = "动态表头", required = false, dataType = "Integer"),
  78. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  79. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  80. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  81. })
  82. @PostMapping("/getAllJiPiResult")
  83. public RESTfulResult getAllJiPiResult(@RequestBody(required=false) Map<String,Object> mapValue,
  84. Integer apiId,
  85. Integer pageNum,
  86. Integer pageSize,
  87. Integer orderType
  88. ){
  89. if (mapValue == null){
  90. mapValue = new HashMap<>();
  91. }
  92. if(orderType != null){
  93. mapValue.put("orderTypee", orderType);
  94. }
  95. //不分页筛选数据
  96. List<Map<String, Object>> allJiMaoResult = tmstruckWeightResultService.getAllJiPiResult(mapValue);
  97. PageHelper.startPage(pageNum,pageSize);
  98. //分页数据
  99. List<Map<String, Object>> jiMaoResult = tmstruckWeightResultService.getAllJiPiResult(mapValue);
  100. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allJiMaoResult,jiMaoResult);
  101. return success(pageList);
  102. }
  103. @ApiOperation(value="采集新增计毛实绩 ")
  104. @ApiImplicitParams({
  105. @ApiImplicitParam(name = "mapValue", value = "采集的数据", required = false, dataType = "Map"),
  106. })
  107. @PostMapping("/addJiMaoResult")
  108. public RESTfulResult addJiMaoResult(@RequestBody Map<String, Object> mapValue){
  109. int i = tmstruckWeightResultService.addJiMaoResult(mapValue);
  110. return success(i);
  111. }
  112. @ApiOperation(value="采集新增计皮实绩 ")
  113. @ApiImplicitParams({
  114. @ApiImplicitParam(name = "mapValue", value = "采集的数据", required = false, dataType = "Map"),
  115. })
  116. @PostMapping("/addJiPiResult")
  117. public RESTfulResult addJiPiResult(@RequestBody Map<String, Object> mapValue){
  118. int i = tmstruckWeightResultService.addJiPiResult(mapValue);
  119. return success(i);
  120. }
  121. }