OWbInveMngController.java 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. package com.emato.biz.controller.warehouse;
  2. import java.util.List;
  3. import com.emato.biz.domain.OutRequest;
  4. import com.emato.biz.domain.warehouse.PullInveQueryVO;
  5. import com.emato.biz.util.RoleUtils;
  6. import com.emato.common.annotation.AnonymousAccess;
  7. import com.emato.common.core.Result;
  8. import com.emato.common.core.domain.entity.SysDept;
  9. import com.emato.common.core.domain.entity.SysUser;
  10. import com.emato.common.core.domain.model.LoginUser;
  11. import com.emato.common.utils.ServletUtils;
  12. import com.emato.common.utils.spring.SpringUtils;
  13. import com.emato.framework.web.service.TokenService;
  14. import com.emato.system.service.ISysDeptService;
  15. import org.springframework.security.access.prepost.PreAuthorize;
  16. import org.springframework.beans.factory.annotation.Autowired;
  17. import org.springframework.web.bind.annotation.GetMapping;
  18. import org.springframework.web.bind.annotation.PostMapping;
  19. import org.springframework.web.bind.annotation.PutMapping;
  20. import org.springframework.web.bind.annotation.DeleteMapping;
  21. import org.springframework.web.bind.annotation.PathVariable;
  22. import org.springframework.web.bind.annotation.RequestBody;
  23. import org.springframework.web.bind.annotation.RequestMapping;
  24. import org.springframework.web.bind.annotation.RestController;
  25. import com.emato.common.annotation.Log;
  26. import com.emato.common.core.controller.BaseController;
  27. import com.emato.common.core.domain.AjaxResult;
  28. import com.emato.common.enums.BusinessType;
  29. import com.emato.biz.domain.warehouse.OWbInveMng;
  30. import com.emato.biz.service.warehouse.IOWbInveMngService;
  31. import com.emato.common.utils.poi.ExcelUtil;
  32. import com.emato.common.core.page.TableDataInfo;
  33. /**
  34. * 库存管理,wms入库回传时,增加库存数Controller
  35. *
  36. * @author scott
  37. * @date 2021-02-01
  38. */
  39. @RestController
  40. @RequestMapping("/biz/invemng")
  41. public class OWbInveMngController extends BaseController
  42. {
  43. @Autowired
  44. private IOWbInveMngService oWbInveMngService;
  45. @Autowired
  46. private ISysDeptService sysDeptService;
  47. /**
  48. * 查询库存管理,wms入库回传时,增加库存数列表
  49. */
  50. @PreAuthorize("@ss.hasPermi('biz:invemng:list')")
  51. @GetMapping("/list")
  52. public TableDataInfo list(OWbInveMng oWbInveMng)
  53. {
  54. startPage();
  55. List<OWbInveMng> list = oWbInveMngService.selectOWbInveMngList(oWbInveMng);
  56. return getDataTable(list);
  57. }
  58. /**
  59. * 导出库存管理,wms入库回传时,增加库存数列表
  60. */
  61. @PreAuthorize("@ss.hasPermi('biz:invemng:export')")
  62. @Log(title = "库存管理,wms入库回传时,增加库存数", businessType = BusinessType.EXPORT)
  63. @GetMapping("/export")
  64. public AjaxResult export(OWbInveMng oWbInveMng)
  65. {
  66. List<OWbInveMng> list = oWbInveMngService.selectOWbInveMngList(oWbInveMng);
  67. ExcelUtil<OWbInveMng> util = new ExcelUtil<OWbInveMng>(OWbInveMng.class);
  68. return util.exportExcel(list, "invemng");
  69. }
  70. /**
  71. * 获取库存管理,wms入库回传时,增加库存数详细信息
  72. */
  73. @PreAuthorize("@ss.hasPermi('biz:invemng:query')")
  74. @GetMapping(value = "/{inveSn}")
  75. public AjaxResult getInfo(@PathVariable("inveSn") String inveSn)
  76. {
  77. return AjaxResult.success(oWbInveMngService.selectOWbInveMngById(inveSn));
  78. }
  79. /**
  80. * 新增库存管理,wms入库回传时,增加库存数
  81. */
  82. @PreAuthorize("@ss.hasPermi('biz:invemng:add')")
  83. @Log(title = "库存管理,wms入库回传时,增加库存数", businessType = BusinessType.INSERT)
  84. @PostMapping
  85. public AjaxResult add(@RequestBody OWbInveMng oWbInveMng)
  86. {
  87. return toAjax(oWbInveMngService.insertOWbInveMng(oWbInveMng));
  88. }
  89. /**
  90. * 修改库存管理,wms入库回传时,增加库存数
  91. */
  92. @PreAuthorize("@ss.hasPermi('biz:invemng:edit')")
  93. @Log(title = "库存管理,wms入库回传时,增加库存数", businessType = BusinessType.UPDATE)
  94. @PutMapping
  95. public AjaxResult edit(@RequestBody OWbInveMng oWbInveMng)
  96. {
  97. return toAjax(oWbInveMngService.updateOWbInveMng(oWbInveMng));
  98. }
  99. /**
  100. * 删除库存管理,wms入库回传时,增加库存数
  101. */
  102. @PreAuthorize("@ss.hasPermi('biz:invemng:remove')")
  103. @Log(title = "库存管理,wms入库回传时,增加库存数", businessType = BusinessType.DELETE)
  104. @DeleteMapping("/{inveSns}")
  105. public AjaxResult remove(@PathVariable String[] inveSns)
  106. {
  107. return toAjax(oWbInveMngService.deleteOWbInveMngByIds(inveSns));
  108. }
  109. /**
  110. * 拉取库存数据
  111. *
  112. * @param queryVO
  113. * @return
  114. */
  115. @PreAuthorize("@ss.hasPermi('biz:invemng:pull')")
  116. @PostMapping("/pullInveMng")
  117. public AjaxResult pullInveMng(PullInveQueryVO queryVO)
  118. {
  119. return oWbInveMngService.pullInveMng(queryVO);
  120. }
  121. /**
  122. * 接收 OMS 仓库库存数据
  123. *
  124. * @param outRequest
  125. * @return
  126. */
  127. @AnonymousAccess
  128. @PostMapping("/receive")
  129. public Result receiveInveMng(@RequestBody OutRequest outRequest) {
  130. return oWbInveMngService.receiveInveMng(outRequest);
  131. }
  132. }