TmstrainMeasureCommissionController.java 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. package com.steerinfo.dil.controller;
  2. import com.steerinfo.dil.service.ITmstrainMeasureCommissionService;
  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.List;
  14. import java.util.Map;
  15. /**
  16. * TmstrainMeasureCommission RESTful接口:
  17. * @author generator
  18. * @version 1.0-SNAPSHORT 2021-12-09 06:52
  19. * 类描述
  20. * 修订历史:
  21. * 日期:2021-12-09
  22. * 作者:generator
  23. * 参考:
  24. * 描述:TmstrainMeasureCommission RESTful接口
  25. * @see null
  26. * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
  27. */
  28. @RestController
  29. @RequestMapping("/${api.version}/tmstrainmeasurecommissions")
  30. public class TmstrainMeasureCommissionController extends BaseRESTfulController {
  31. @Autowired
  32. ITmstrainMeasureCommissionService tmstrainMeasureCommissionService;
  33. @Autowired
  34. ColumnDataUtil columnDataUtil;
  35. @ApiOperation(value = "查询待计量的计量委托并展示")
  36. @ApiImplicitParams({
  37. @ApiImplicitParam(name = "apiId(209)", value = "表头", required = false, dataType = "Interger")
  38. })
  39. @PostMapping(value = "/getLoadResultToSendMC")
  40. public RESTfulResult getLoadResultToSendMC(
  41. @RequestBody(required = false) Map<String, Object> mapValue,
  42. Integer apiId,
  43. Integer pageNum,
  44. Integer pageSize,
  45. Integer resultType,
  46. String startTime,
  47. String endTime,
  48. String con) {
  49. mapValue.put("resultType",resultType);
  50. mapValue.put("startTime",startTime);
  51. mapValue.put("endTime",endTime);
  52. mapValue.put("con",con);
  53. //不分页筛选数据
  54. PageHelper.startPage(pageNum, pageSize);
  55. //分页数据
  56. List<Map<String, Object>> mes = tmstrainMeasureCommissionService.getLoadResultToSendMC(mapValue);
  57. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, mes);
  58. return success(pageList);
  59. }
  60. @ApiOperation(value = "查询已计量的计量委托并展示")
  61. @ApiImplicitParams({
  62. @ApiImplicitParam(name = "apiId(209)", value = "表头", required = false, dataType = "Interger")
  63. })
  64. @PostMapping(value = "/getWeightResult")
  65. public RESTfulResult getWeightResult(
  66. @RequestBody(required = false) Map<String, Object> mapValue,
  67. Integer apiId,
  68. Integer pageNum,
  69. Integer pageSize,
  70. Integer resultType,
  71. String startTime,
  72. String endTime,
  73. String con) {
  74. mapValue.put("resultType",resultType);
  75. mapValue.put("startTime",startTime);
  76. mapValue.put("endTime",endTime);
  77. mapValue.put("con",con);
  78. //不分页筛选数据
  79. PageHelper.startPage(pageNum, pageSize);
  80. //分页数据
  81. List<Map<String, Object>> mes = tmstrainMeasureCommissionService.getWeightResult(mapValue);
  82. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, mes);
  83. return success(pageList);
  84. }
  85. @ApiOperation(value = "批量新增计量委托")
  86. @PostMapping(value = "/batchSendMeasureCommission")
  87. public RESTfulResult batchSendMeasureCommission(@RequestBody(required = false) Map<String, Object> map) {
  88. System.out.println(map);
  89. int i = tmstrainMeasureCommissionService.batchSendMeasureCommission(map);
  90. if (i==-1){
  91. return success("有委托发送失败,请联系技术人员");
  92. }
  93. return success("发送成功");
  94. }
  95. }