package com.emato.biz.controller.mall; import java.util.List; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.emato.common.annotation.Log; import com.emato.common.core.controller.BaseController; import com.emato.common.core.domain.AjaxResult; import com.emato.common.enums.BusinessType; import com.emato.biz.domain.mall.MallInveMng; import com.emato.biz.service.mall.IMallInveMngService; import com.emato.common.utils.poi.ExcelUtil; import com.emato.common.core.page.TableDataInfo; /** * 库存管理,wms入库回传时,增加库存数Controller * * @author yangbo * @date 2021-02-01 */ @RestController @RequestMapping("/biz/mallinvemng") public class MallInveMngController extends BaseController { @Autowired private IMallInveMngService mallInveMngService; /** * 查询库存管理,wms入库回传时,增加库存数列表 */ @PreAuthorize("@ss.hasPermi('biz:mallinvemng:list')") @GetMapping("/list") public TableDataInfo list(MallInveMng mallInveMng) { startPage(); List list = mallInveMngService.selectMallInveMngList(mallInveMng); return getDataTable(list); } /** * 导出库存管理,wms入库回传时,增加库存数列表 */ @PreAuthorize("@ss.hasPermi('biz:mallinvemng:export')") @Log(title = "库存管理,wms入库回传时,增加库存数", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(MallInveMng mallInveMng) { List list = mallInveMngService.selectMallInveMngList(mallInveMng); ExcelUtil util = new ExcelUtil(MallInveMng.class); return util.exportExcel(list, "mallinvemng"); } /** * 获取库存管理,wms入库回传时,增加库存数详细信息 */ @PreAuthorize("@ss.hasPermi('biz:mallinvemng:query')") @GetMapping(value = "/{inveSn}") public AjaxResult getInfo(@PathVariable("inveSn") String inveSn) { return AjaxResult.success(mallInveMngService.selectMallInveMngById(inveSn)); } /** * 新增库存管理,wms入库回传时,增加库存数 */ @PreAuthorize("@ss.hasPermi('biz:mallinvemng:add')") @Log(title = "库存管理,wms入库回传时,增加库存数", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody MallInveMng mallInveMng) { return toAjax(mallInveMngService.insertMallInveMng(mallInveMng)); } /** * 修改库存管理,wms入库回传时,增加库存数 */ @PreAuthorize("@ss.hasPermi('biz:mallinvemng:edit')") @Log(title = "库存管理,wms入库回传时,增加库存数", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody MallInveMng mallInveMng) { return toAjax(mallInveMngService.updateMallInveMng(mallInveMng)); } /** * 删除库存管理,wms入库回传时,增加库存数 */ @PreAuthorize("@ss.hasPermi('biz:mallinvemng:remove')") @Log(title = "库存管理,wms入库回传时,增加库存数", businessType = BusinessType.DELETE) @DeleteMapping("/{inveSns}") public AjaxResult remove(@PathVariable String[] inveSns) { return toAjax(mallInveMngService.deleteMallInveMngByIds(inveSns)); } @PreAuthorize("@ss.hasPermi('biz:shopinvemng:pull')") @PostMapping("/pullKmallInveMng") public AjaxResult pullKmallInveMng() { // return toAjax(1); return toAjax(mallInveMngService.pullKmallInveMng()); } }