TmstruckWeightResultController.java 6.0 KB

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