MallInveMngController.java 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. package com.emato.biz.controller.mall;
  2. import java.util.List;
  3. import com.emato.biz.domain.mall.MallGoodsVO;
  4. import org.springframework.security.access.prepost.PreAuthorize;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.web.bind.annotation.GetMapping;
  7. import org.springframework.web.bind.annotation.PostMapping;
  8. import org.springframework.web.bind.annotation.PutMapping;
  9. import org.springframework.web.bind.annotation.DeleteMapping;
  10. import org.springframework.web.bind.annotation.PathVariable;
  11. import org.springframework.web.bind.annotation.RequestBody;
  12. import org.springframework.web.bind.annotation.RequestMapping;
  13. import org.springframework.web.bind.annotation.RestController;
  14. import com.emato.common.annotation.Log;
  15. import com.emato.common.core.controller.BaseController;
  16. import com.emato.common.core.domain.AjaxResult;
  17. import com.emato.common.enums.BusinessType;
  18. import com.emato.biz.domain.mall.MallInveMng;
  19. import com.emato.biz.service.mall.IMallInveMngService;
  20. import com.emato.common.utils.poi.ExcelUtil;
  21. import com.emato.common.core.page.TableDataInfo;
  22. /**
  23. * 库存管理,wms入库回传时,增加库存数Controller
  24. *
  25. * @author scott
  26. * @date 2021-02-01
  27. */
  28. @RestController
  29. @RequestMapping("/biz/mallinvemng")
  30. public class MallInveMngController extends BaseController
  31. {
  32. @Autowired
  33. private IMallInveMngService mallInveMngService;
  34. /**
  35. * 查询库存管理,wms入库回传时,增加库存数列表
  36. */
  37. @PreAuthorize("@ss.hasPermi('biz:mallinvemng:list')")
  38. @GetMapping("/list")
  39. public TableDataInfo list(MallInveMng mallInveMng)
  40. {
  41. startPage();
  42. //List<MallInveMng> list = mallInveMngService.selectMallInveMngList(mallInveMng);
  43. List<MallGoodsVO> list = mallInveMngService.getMalGoodsVOList(mallInveMng);
  44. return getDataTable(list);
  45. }
  46. /**
  47. * 导出库存管理,wms入库回传时,增加库存数列表
  48. */
  49. @PreAuthorize("@ss.hasPermi('biz:mallinvemng:export')")
  50. @Log(title = "库存管理,wms入库回传时,增加库存数", businessType = BusinessType.EXPORT)
  51. @GetMapping("/export")
  52. public AjaxResult export(MallInveMng mallInveMng)
  53. {
  54. //List<MallInveMng> list = mallInveMngService.selectMallInveMngList(mallInveMng);
  55. List<MallGoodsVO> list = mallInveMngService.getMalGoodsVOList(mallInveMng);
  56. ExcelUtil<MallGoodsVO> util = new ExcelUtil<MallGoodsVO>(MallGoodsVO.class);
  57. return util.exportExcel(list, "mallinvemng");
  58. }
  59. /**
  60. * 获取库存管理,wms入库回传时,增加库存数详细信息
  61. */
  62. @PreAuthorize("@ss.hasPermi('biz:mallinvemng:query')")
  63. @GetMapping(value = "/{inveSn}")
  64. public AjaxResult getInfo(@PathVariable("inveSn") String inveSn)
  65. {
  66. return AjaxResult.success(mallInveMngService.selectMallInveMngById(inveSn));
  67. }
  68. /**
  69. * 新增库存管理,wms入库回传时,增加库存数
  70. */
  71. @PreAuthorize("@ss.hasPermi('biz:mallinvemng:add')")
  72. @Log(title = "库存管理,wms入库回传时,增加库存数", businessType = BusinessType.INSERT)
  73. @PostMapping
  74. public AjaxResult add(@RequestBody MallInveMng mallInveMng)
  75. {
  76. return toAjax(mallInveMngService.insertMallInveMng(mallInveMng));
  77. }
  78. /**
  79. * 修改库存管理,wms入库回传时,增加库存数
  80. */
  81. @PreAuthorize("@ss.hasPermi('biz:mallinvemng:edit')")
  82. @Log(title = "库存管理,wms入库回传时,增加库存数", businessType = BusinessType.UPDATE)
  83. @PutMapping
  84. public AjaxResult edit(@RequestBody MallInveMng mallInveMng)
  85. {
  86. return toAjax(mallInveMngService.updateMallInveMng(mallInveMng));
  87. }
  88. /**
  89. * 删除库存管理,wms入库回传时,增加库存数
  90. */
  91. @PreAuthorize("@ss.hasPermi('biz:mallinvemng:remove')")
  92. @Log(title = "库存管理,wms入库回传时,增加库存数", businessType = BusinessType.DELETE)
  93. @DeleteMapping("/{inveSns}")
  94. public AjaxResult remove(@PathVariable String[] inveSns)
  95. {
  96. return toAjax(mallInveMngService.deleteMallInveMngByIds(inveSns));
  97. }
  98. @PreAuthorize("@ss.hasPermi('biz:shopinvemng:pull')")
  99. @PostMapping("/pullKmallInveMng")
  100. public AjaxResult pullKmallInveMng()
  101. {
  102. // return toAjax(1);
  103. return toAjax(mallInveMngService.pullKmallInveMng());
  104. }
  105. }