TmsshipTotalResultController.java 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. package com.steerinfo.dil.controller;
  2. import com.steerinfo.dil.feign.ColumnDataFeign;
  3. import com.steerinfo.dil.feign.ESFeign;
  4. import com.steerinfo.dil.service.impl.TmsshipTotalResultServiceImpl;
  5. import com.steerinfo.dil.util.BaseRESTfulController;
  6. import com.steerinfo.dil.util.ColumnDataUtil;
  7. import com.steerinfo.dil.util.DataChange;
  8. import com.steerinfo.dil.util.PageListAdd;
  9. import com.steerinfo.framework.controller.RESTfulResult;
  10. import com.steerinfo.framework.service.pagehelper.PageHelper;
  11. import io.swagger.annotations.ApiImplicitParam;
  12. import io.swagger.annotations.ApiImplicitParams;
  13. import io.swagger.annotations.ApiOperation;
  14. import org.springframework.beans.factory.annotation.Autowired;
  15. import org.springframework.web.bind.annotation.*;
  16. import java.math.BigDecimal;
  17. import java.text.SimpleDateFormat;
  18. import java.util.*;
  19. /**
  20. * TmsshipTotalResult RESTful接口:
  21. * @author generator
  22. * @version 1.0-SNAPSHORT 2021-08-19 08:55
  23. * 类描述
  24. * 修订历史:
  25. * 日期:2021-08-19
  26. * 作者:generator
  27. * 参考:
  28. * 描述:TmsshipTotalResult RESTful接口
  29. * @see null
  30. * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
  31. */
  32. @RestController
  33. @RequestMapping("/${api.version}/tmsshiptotalresults")
  34. public class TmsshipTotalResultController extends BaseRESTfulController {
  35. @Autowired
  36. TmsshipTotalResultServiceImpl tmsshipTotalResultService;
  37. @Autowired
  38. ColumnDataFeign columnDataFeign;
  39. @Autowired
  40. ColumnDataUtil columnDataUtil;
  41. @Autowired
  42. ESFeign esFeign;
  43. private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  44. /**
  45. * 展示水路货物运单列表
  46. * @param mapVal
  47. * @param pageNum
  48. * @param pageSize
  49. * @param apiId
  50. * @return
  51. */
  52. @ApiOperation(value="展示水路货物运单", notes="分页查询")
  53. @ApiImplicitParams({
  54. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  55. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  56. @ApiImplicitParam(name = "apiId", value = "56", required = false, dataType = "BigDecimal"),
  57. })
  58. @PostMapping(value = "/listAllOrders")
  59. public RESTfulResult listAllOrders(@RequestBody(required = false) Map<String,Object> mapVal,
  60. Integer pageNum,
  61. Integer pageSize,
  62. Integer apiId){
  63. List<Map<String, Object>> detailListTotal = tmsshipTotalResultService.getOrderList(mapVal);
  64. PageHelper.startPage(pageNum, pageSize);
  65. //分页查询数据
  66. List<Map<String, Object>> columnList = tmsshipTotalResultService.getOrderList(mapVal);
  67. PageListAdd data = columnDataUtil.tableColumnData(apiId, detailListTotal, columnList);
  68. return success(data);
  69. }
  70. /**
  71. * 展示船只信息
  72. * @param mapVal
  73. * @param pageNum
  74. * @param pageSize
  75. * @param apiId
  76. * @return
  77. */
  78. @ApiOperation(value="展示船只信息", notes="分页查询")
  79. @ApiImplicitParams({
  80. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  81. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  82. @ApiImplicitParam(name = "apiId", value = "138", required = false, dataType = "BigDecimal"),
  83. })
  84. @PostMapping(value = "/getCapacityList")
  85. public RESTfulResult getCapacityList(@RequestBody(required = false) Map<String,Object> mapVal,
  86. Integer pageNum,
  87. Integer pageSize,
  88. Integer apiId,
  89. String con){
  90. if (mapVal == null) {
  91. mapVal = new HashMap<>();
  92. }
  93. mapVal.put("con",con);
  94. List<Map<String, Object>> detailListTotal = tmsshipTotalResultService.getCapacity(mapVal);
  95. PageHelper.startPage(pageNum, pageSize);
  96. //分页查询数据
  97. List<Map<String, Object>> columnList = tmsshipTotalResultService.getCapacity(mapVal);
  98. PageListAdd data = columnDataUtil.tableColumnData(apiId, detailListTotal, columnList);
  99. return success(data);
  100. }
  101. //批复车皮
  102. @PostMapping("/addPleaseResult")
  103. public RESTfulResult addPleaseResult(@RequestBody(required = false) Map<String, Object> mapVal){
  104. if (mapVal == null) {
  105. mapVal = new HashMap<>();
  106. }
  107. return success(tmsshipTotalResultService.addPleaseResult(mapVal));
  108. }
  109. @PostMapping("/editPleaseResult")
  110. public RESTfulResult editPleaseResult(@RequestBody(required = false) Map<String, Object> mapVal){
  111. if (mapVal == null) {
  112. mapVal = new HashMap<>();
  113. }
  114. return success(tmsshipTotalResultService.editPleaseResult(mapVal));
  115. }
  116. @PostMapping("/getAllPleaseResult")
  117. public RESTfulResult getAllPleaseResult(@RequestBody(required = false) Map<String, Object> mapVal,
  118. Integer pageNum,
  119. Integer pageSize,
  120. Integer apiId,
  121. String con,
  122. String startTime,
  123. String endTime){
  124. if (mapVal == null) {
  125. mapVal = new HashMap<>();
  126. }
  127. mapVal.put("con",con);
  128. if(startTime!=null && endTime!=null){
  129. DataChange.queryDataByDateTime(startTime,endTime,mapVal,sdfDateTime);
  130. }
  131. List<Map<String, Object>> detailListTotal = tmsshipTotalResultService.getCapacity(mapVal);
  132. PageHelper.startPage(pageNum, pageSize);
  133. //分页查询数据
  134. List<Map<String, Object>> columnList = tmsshipTotalResultService.getAllPleaseResult(mapVal);
  135. PageListAdd data = columnDataUtil.tableColumnData(apiId, detailListTotal, columnList);
  136. return success(data);
  137. }
  138. @PostMapping("/getPleaseResult/{resultId}")
  139. public RESTfulResult getPleaseResult(@PathVariable("resultId") BigDecimal resultId){
  140. return success(tmsshipTotalResultService.getPleaseResult(resultId));
  141. }
  142. @PostMapping("/getRealNumber")
  143. public RESTfulResult getRealNumber(@RequestBody(required = false) Map<String, Object> map){
  144. DataChange.queryDataByDateTime(map.get("resultDate")+"",null,map,sdfDateTime);
  145. return success(tmsshipTotalResultService.getRealNumber(map));
  146. }
  147. }