RmsPortStorageYard.java 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. package com.steerinfo.dil.controller;
  2. import com.steerinfo.dil.feign.ESFeign;
  3. import com.steerinfo.dil.model.RmsWarehouse;
  4. import com.steerinfo.dil.service.impl.RmsPortStorageYardService;
  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. * @author luobang
  21. * @create 2021-11-15 15:14
  22. */
  23. @RestController
  24. @RequestMapping("/${api.version}/rmsPortYard")
  25. public class RmsPortStorageYard extends BaseRESTfulController {
  26. @Autowired
  27. RmsPortStorageYardService rmsPortStorageYardService;
  28. @Autowired
  29. ColumnDataUtil columnDataUtil;
  30. @Autowired
  31. ESFeign esFeign;
  32. //港存堆场增删改查
  33. /**
  34. * 新增港存堆场
  35. * @param
  36. * @return
  37. */
  38. @PostMapping("/insertPortYard")
  39. public RESTfulResult insertPortYard(@RequestBody(required = true) RmsWarehouse rmsWarehouse){
  40. Integer integer = rmsPortStorageYardService.insertPortYard(rmsWarehouse);
  41. if (
  42. integer!=1
  43. ){
  44. return failed();
  45. }
  46. else{
  47. return success();
  48. }
  49. }
  50. /**
  51. * 修改港存堆场
  52. * @param
  53. * @return
  54. */
  55. @PostMapping("/editPortYard")
  56. public RESTfulResult editPortYard(@RequestBody(required = true)RmsWarehouse rmsWarehouse){
  57. Integer integer = rmsPortStorageYardService.updatePortYard(rmsWarehouse);
  58. if (
  59. integer!=1
  60. ){
  61. return failed();
  62. }
  63. else{
  64. return success();
  65. }
  66. }
  67. /**
  68. * 删除港口
  69. * @param
  70. * @return
  71. */
  72. @PostMapping("/deletePortYard/{warehouseId}")
  73. public RESTfulResult deletePort(@PathVariable("warehouseId") BigDecimal warehouseId){
  74. Integer integer = rmsPortStorageYardService.deletePortYard(warehouseId);
  75. if (
  76. integer!=1
  77. ){
  78. return failed();
  79. }
  80. else{
  81. return success();
  82. }
  83. }
  84. @ApiOperation(value="展示港存堆场信息", notes="分页查询")
  85. @ApiImplicitParams({
  86. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  87. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  88. @ApiImplicitParam(name = "apiId", value = "196", required = false, dataType = "BigDecimal"),
  89. })
  90. @PostMapping(value = "/getPortYard")
  91. public RESTfulResult getPortYard(@RequestBody(required = false) Map<String,Object> mapVal,
  92. Integer pageNum,
  93. Integer pageSize,
  94. Integer apiId,
  95. String con){
  96. PageHelper.startPage(pageNum, pageSize);
  97. //分页查询数据
  98. List<Map<String, Object>> columnList = rmsPortStorageYardService.getPortYard(mapVal);
  99. PageListAdd data = columnDataUtil.tableColumnData(apiId, null, columnList);
  100. return success(data);
  101. }
  102. }