OWbInveShipmentGoodsController.java 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. package com.emato.biz.controller.warehouse;
  2. import java.util.List;
  3. import org.springframework.security.access.prepost.PreAuthorize;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.web.bind.annotation.GetMapping;
  6. import org.springframework.web.bind.annotation.PostMapping;
  7. import org.springframework.web.bind.annotation.PutMapping;
  8. import org.springframework.web.bind.annotation.DeleteMapping;
  9. import org.springframework.web.bind.annotation.PathVariable;
  10. import org.springframework.web.bind.annotation.RequestBody;
  11. import org.springframework.web.bind.annotation.RequestMapping;
  12. import org.springframework.web.bind.annotation.RestController;
  13. import com.emato.common.annotation.Log;
  14. import com.emato.common.core.controller.BaseController;
  15. import com.emato.common.core.domain.AjaxResult;
  16. import com.emato.common.enums.BusinessType;
  17. import com.emato.biz.domain.warehouse.OWbInveShipmentGoods;
  18. import com.emato.biz.service.warehouse.IOWbInveShipmentGoodsService;
  19. import com.emato.common.utils.poi.ExcelUtil;
  20. import com.emato.common.core.page.TableDataInfo;
  21. /**
  22. * 库存发货货品Controller
  23. *
  24. * @author yangbo
  25. * @date 2021-02-01
  26. */
  27. @RestController
  28. @RequestMapping("/biz/inveshipmentgoods")
  29. public class OWbInveShipmentGoodsController extends BaseController
  30. {
  31. @Autowired
  32. private IOWbInveShipmentGoodsService oWbInveShipmentGoodsService;
  33. /**
  34. * 查询库存发货货品列表
  35. */
  36. @PreAuthorize("@ss.hasPermi('biz:inveshipmentgoods:list')")
  37. @GetMapping("/list")
  38. public TableDataInfo list(OWbInveShipmentGoods oWbInveShipmentGoods)
  39. {
  40. startPage();
  41. List<OWbInveShipmentGoods> list = oWbInveShipmentGoodsService.selectOWbInveShipmentGoodsList(oWbInveShipmentGoods);
  42. return getDataTable(list);
  43. }
  44. /**
  45. * 导出库存发货货品列表
  46. */
  47. @PreAuthorize("@ss.hasPermi('biz:inveshipmentgoods:export')")
  48. @Log(title = "库存发货货品", businessType = BusinessType.EXPORT)
  49. @GetMapping("/export")
  50. public AjaxResult export(OWbInveShipmentGoods oWbInveShipmentGoods)
  51. {
  52. List<OWbInveShipmentGoods> list = oWbInveShipmentGoodsService.selectOWbInveShipmentGoodsList(oWbInveShipmentGoods);
  53. ExcelUtil<OWbInveShipmentGoods> util = new ExcelUtil<OWbInveShipmentGoods>(OWbInveShipmentGoods.class);
  54. return util.exportExcel(list, "inveshipmentgoods");
  55. }
  56. /**
  57. * 获取库存发货货品详细信息
  58. */
  59. @PreAuthorize("@ss.hasPermi('biz:inveshipmentgoods:query')")
  60. @GetMapping(value = "/{shipmentGoodsSn}")
  61. public AjaxResult getInfo(@PathVariable("shipmentGoodsSn") String shipmentGoodsSn)
  62. {
  63. return AjaxResult.success(oWbInveShipmentGoodsService.selectOWbInveShipmentGoodsById(shipmentGoodsSn));
  64. }
  65. /**
  66. * 新增库存发货货品
  67. */
  68. @PreAuthorize("@ss.hasPermi('biz:inveshipmentgoods:add')")
  69. @Log(title = "库存发货货品", businessType = BusinessType.INSERT)
  70. @PostMapping
  71. public AjaxResult add(@RequestBody OWbInveShipmentGoods oWbInveShipmentGoods)
  72. {
  73. return toAjax(oWbInveShipmentGoodsService.insertOWbInveShipmentGoods(oWbInveShipmentGoods));
  74. }
  75. /**
  76. * 修改库存发货货品
  77. */
  78. @PreAuthorize("@ss.hasPermi('biz:inveshipmentgoods:edit')")
  79. @Log(title = "库存发货货品", businessType = BusinessType.UPDATE)
  80. @PutMapping
  81. public AjaxResult edit(@RequestBody OWbInveShipmentGoods oWbInveShipmentGoods)
  82. {
  83. return toAjax(oWbInveShipmentGoodsService.updateOWbInveShipmentGoods(oWbInveShipmentGoods));
  84. }
  85. /**
  86. * 删除库存发货货品
  87. */
  88. @PreAuthorize("@ss.hasPermi('biz:inveshipmentgoods:remove')")
  89. @Log(title = "库存发货货品", businessType = BusinessType.DELETE)
  90. @DeleteMapping("/{shipmentGoodsSns}")
  91. public AjaxResult remove(@PathVariable String[] shipmentGoodsSns)
  92. {
  93. return toAjax(oWbInveShipmentGoodsService.deleteOWbInveShipmentGoodsByIds(shipmentGoodsSns));
  94. }
  95. }