TmstrainLoadingResultController.java 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. package com.steerinfo.dil.controller;
  2. import com.alibaba.fastjson.JSON;
  3. import com.steerinfo.dil.feign.ColumnDataFeign;
  4. import com.steerinfo.dil.feign.ESFeign;
  5. import com.steerinfo.dil.model.TmstrainLoadingResult;
  6. import com.steerinfo.dil.service.ITmstrainLoadingResultService;
  7. import com.steerinfo.dil.util.ColumnDataUtil;
  8. import com.steerinfo.dil.util.BaseRESTfulController;
  9. import com.steerinfo.dil.util.PageListAdd;
  10. import com.steerinfo.framework.controller.RESTfulResult;
  11. import com.steerinfo.framework.service.pagehelper.PageHelper;
  12. import io.swagger.annotations.ApiImplicitParam;
  13. import io.swagger.annotations.ApiImplicitParams;
  14. import io.swagger.annotations.ApiOperation;
  15. import org.springframework.beans.factory.annotation.Autowired;
  16. import org.springframework.web.bind.annotation.*;
  17. import java.math.BigDecimal;
  18. import java.util.*;
  19. /**
  20. * TmstrainLoadingResult RESTful接口:
  21. *
  22. * @author generator
  23. * @version 1.0-SNAPSHORT 2021-08-30 02:23
  24. * 类描述
  25. * 修订历史:
  26. * 日期:2021-08-30
  27. * 作者:generator
  28. * 参考:
  29. * 描述:TmstrainLoadingResult RESTful接口
  30. * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
  31. * @see null
  32. */
  33. @RestController
  34. @RequestMapping("/${api.version}/tmstrainloadingresults")
  35. public class TmstrainLoadingResultController extends BaseRESTfulController {
  36. @Autowired
  37. ITmstrainLoadingResultService tmstrainLoadingResultService;
  38. @Autowired
  39. ColumnDataFeign columnDataFeign;
  40. @Autowired
  41. ESFeign esFeign;
  42. @Autowired
  43. ColumnDataUtil columnDataUtil;
  44. @ApiOperation(value = "查询装车作业信息")
  45. @ApiImplicitParams({
  46. @ApiImplicitParam(name = "apiId(58)", value = "表头", required = false, dataType = "Interger")
  47. })
  48. @PostMapping("/getTmstrainWagonLoad")
  49. public RESTfulResult getTmstrainWagonLoad(@RequestBody(required = false) Map<String, Object> mapValue,
  50. Integer apiId,
  51. Integer pageNum,
  52. Integer pageSize,
  53. Integer resultType,
  54. String con) {
  55. mapValue.put("resultType", resultType);
  56. PageHelper.startPage(pageNum, pageSize);
  57. List<Map<String, Object>> tmstrainWagonLoad1 = tmstrainLoadingResultService.getTmstrainWagonLoad(mapValue);
  58. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, tmstrainWagonLoad1);
  59. return success(pageList);
  60. }
  61. /**
  62. * 新增车皮装车作业实绩
  63. *
  64. * @param tmstrainLoadingResult
  65. * @return
  66. */
  67. @ApiOperation(value = "新增车皮装车作业实绩")
  68. @ApiImplicitParams({
  69. @ApiImplicitParam(name = "tmstrainLoadingResult", value = "车皮装车对象", required = false, dataType = "TmstrainLoadingResult")
  70. })
  71. @PostMapping(value = "/insertTmstrainLoadingResult")
  72. public RESTfulResult insertTmstrainLoadingResult(@RequestBody(required = false) TmstrainLoadingResult tmstrainLoadingResult) {
  73. int i = tmstrainLoadingResultService.addTmstrainLoadingResult(tmstrainLoadingResult);
  74. return success(i);
  75. }
  76. /**
  77. * 通过主键查询车皮装车作业信息
  78. *
  79. * @param resultId
  80. * @return
  81. */
  82. @ApiOperation(value = "通过主键查询车皮装车作业信息")
  83. @ApiImplicitParams({
  84. @ApiImplicitParam(name = "resultId", value = "车皮装车主键", required = false, dataType = "BigDecimal")
  85. })
  86. @PostMapping(value = "/getTmstrainLoadingResultByResultId/{resultId}")
  87. public RESTfulResult getTmstrainLoadingResultByResultId(@PathVariable("resultId") BigDecimal resultId) {
  88. List<Map<String, Object>> loadingResultByResultId = tmstrainLoadingResultService.getTmstrainLoadingResultByResultId(resultId);
  89. return success(loadingResultByResultId);
  90. }
  91. /**
  92. * 通过主键修改车皮装车作业实绩
  93. *
  94. * @param tmstrainLoadingResult
  95. * @return
  96. */
  97. @ApiOperation(value = "通过主键修改车皮装车作业实绩")
  98. @ApiImplicitParams({
  99. @ApiImplicitParam(name = "tmstrainLoadingResult", value = "修改车皮装车map", required = false, dataType = "TmstrainWagonLoadResult")
  100. })
  101. @PostMapping(value = "/upadteTmstrainLoadingResultByResultId")
  102. public RESTfulResult upadteTmstrainLoadingResultByResultId(@RequestBody(required = false) TmstrainLoadingResult tmstrainLoadingResult) {
  103. int i = tmstrainLoadingResultService.updateTmstrainLoadingResult(tmstrainLoadingResult);
  104. return success(i);
  105. }
  106. /**
  107. * 通过主键删除车皮装车作业实绩
  108. *
  109. * @param resultId
  110. * @return
  111. */
  112. @ApiOperation(value = "通过主键删除车皮装车作业实绩")
  113. @ApiImplicitParams({
  114. @ApiImplicitParam(name = "resultId", value = "主键ID", required = false, dataType = "BigDecimal")
  115. })
  116. @PostMapping(value = "/deleteTmstrainLoadingResultByResultId")
  117. public RESTfulResult deleteTmstrainLoadingResultByResultId(@RequestParam BigDecimal resultId) {
  118. int i = tmstrainLoadingResultService.deleteTmstrainLoadingResultByResultId(resultId);
  119. return success(i);
  120. }
  121. /**
  122. * 获取发站地点名称
  123. *
  124. * @param
  125. * @return
  126. */
  127. @ApiOperation(value = "获取发站地点名称")
  128. @ApiImplicitParams({
  129. })
  130. @GetMapping(value = "/getSendStationName")
  131. public RESTfulResult getSendStationName() {
  132. return success(tmstrainLoadingResultService.getSendStationName());
  133. }
  134. /**
  135. * 获取到站地点名称
  136. *
  137. * @param
  138. * @return
  139. */
  140. @ApiOperation(value = "获取到站地点名称")
  141. @GetMapping(value = "/getArrivalStationName")
  142. public RESTfulResult getArrivalStationName() {
  143. return success(tmstrainLoadingResultService.getArrivalStationName());
  144. }
  145. /**
  146. * 获取批次ID
  147. *
  148. * @param
  149. * @return
  150. */
  151. @ApiOperation(value = "获取批次ID")
  152. @GetMapping(value = "/getBatchId")
  153. public RESTfulResult getBatchId() {
  154. return success(tmstrainLoadingResultService.getBatchId());
  155. }
  156. /**
  157. * 获取装车车皮号
  158. *
  159. * @param
  160. * @return
  161. */
  162. @ApiOperation(value = "获取已装车还未卸车车皮")
  163. @ApiImplicitParams({
  164. @ApiImplicitParam(name = "apiId(213)", value = "表头", required = false, dataType = "Interger")
  165. })
  166. @PostMapping(value = "/getWagonNo/{resultType}")
  167. public RESTfulResult getWagonNo(@PathVariable("resultType") Integer resultType,
  168. @RequestBody(required = false) Map<String, Object> mapValue,
  169. Integer apiId,
  170. Integer pageNum,
  171. Integer pageSize) {
  172. mapValue.put("resultType", resultType);
  173. //不分页筛选数据
  174. PageHelper.startPage(pageNum, pageSize);
  175. //分页数据
  176. List<Map<String, Object>> wagonNo = tmstrainLoadingResultService.getWagonNo(mapValue);
  177. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, wagonNo);
  178. return success(pageList);
  179. }
  180. //内转物流新增装车
  181. @ApiOperation(value = "内转物流新增装车")
  182. @PostMapping(value = "/addTrainLoadResultForConverted")
  183. public RESTfulResult addTrainLoadResultForConverted(@RequestBody(required = false) Map<String, Object> map) {
  184. return success(tmstrainLoadingResultService.addTrainLoadResultForConverted(map));
  185. }
  186. /**
  187. * 内转物流通过主键查询车皮装车作业信息
  188. *
  189. * @param resultId
  190. * @return
  191. */
  192. @ApiOperation(value = "内转物流通过主键查询车皮装车作业信息")
  193. @ApiImplicitParams({
  194. @ApiImplicitParam(name = "resultId", value = "车皮装车主键", required = false, dataType = "BigDecimal")
  195. })
  196. @PostMapping(value = "/selectLoadByResultId/{resultId}")
  197. public RESTfulResult selectLoadByResultId(@PathVariable("resultId") BigDecimal resultId) {
  198. List<Map<String, Object>> loadingResultByResultId = tmstrainLoadingResultService.selectLoadByResultId(resultId);
  199. System.out.println(loadingResultByResultId);
  200. return success(loadingResultByResultId);
  201. }
  202. @ApiOperation(value = "查询车皮物资信息")
  203. @ApiImplicitParams({
  204. @ApiImplicitParam(name = "apiId(259)", value = "表头", required = false, dataType = "Interger")
  205. })
  206. @PostMapping(value = "/getMaterialAndCarByLoadingId")
  207. public RESTfulResult getMaterialAndCarByLoadingId(
  208. @RequestBody(required = false) Map<String, Object> mapValue,
  209. Integer apiId,
  210. Integer pageNum,
  211. Integer pageSize,
  212. Integer loadingId,
  213. Integer unloadingId) {
  214. if(loadingId != null){
  215. mapValue.put("resultId", loadingId);
  216. }
  217. if(unloadingId != null){
  218. mapValue.put("unloadingId", unloadingId);
  219. }
  220. //不分页筛选数据
  221. PageHelper.startPage(pageNum, pageSize);
  222. //分页数据
  223. List<Map<String, Object>> mes = tmstrainLoadingResultService.getMaterialAndCarByLoadingId(mapValue);
  224. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, mes);
  225. return success(pageList);
  226. }
  227. @ApiOperation(value = "国产矿物流新增装车")
  228. @PostMapping(value = "/addDomesticLoadResult")
  229. public RESTfulResult addDomesticLoadResult(@RequestBody(required = false) TmstrainLoadingResult tmstrainLoadingResult) {
  230. return success(tmstrainLoadingResultService.addDomesticLoadResult(tmstrainLoadingResult));
  231. }
  232. @ApiOperation(value = "国产矿物流补录装车信息")
  233. @PostMapping(value = "/updateDomesticLoadResult")
  234. public RESTfulResult updateDomesticLoadResult(@RequestBody(required = false) Map<String, Object> map) {
  235. return success(tmstrainLoadingResultService.updateDomesticLoadResult(map));
  236. }
  237. }