package com.emato.biz.controller.warehouse; 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.warehouse.OWbInveMngAdjust; import com.emato.biz.service.warehouse.IOWbInveMngAdjustService; import com.emato.common.utils.poi.ExcelUtil; import com.emato.common.core.page.TableDataInfo; /** * 库存调整记录.Controller * * @author scott * @date 2021-02-01 */ @RestController @RequestMapping("/biz/inveadjust") public class OWbInveMngAdjustController extends BaseController { @Autowired private IOWbInveMngAdjustService oWbInveMngAdjustService; /** * 查询库存调整记录.列表 */ @PreAuthorize("@ss.hasPermi('biz:inveadjust:list')") @GetMapping("/list") public TableDataInfo list(OWbInveMngAdjust oWbInveMngAdjust) { startPage(); List list = oWbInveMngAdjustService.selectOWbInveMngAdjustList(oWbInveMngAdjust); return getDataTable(list); } /** * 导出库存调整记录.列表 */ @PreAuthorize("@ss.hasPermi('biz:inveadjust:export')") @Log(title = "库存调整记录.", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(OWbInveMngAdjust oWbInveMngAdjust) { List list = oWbInveMngAdjustService.selectOWbInveMngAdjustList(oWbInveMngAdjust); ExcelUtil util = new ExcelUtil(OWbInveMngAdjust.class); return util.exportExcel(list, "inveadjust"); } /** * 获取库存调整记录.详细信息 */ @PreAuthorize("@ss.hasPermi('biz:inveadjust:query')") @GetMapping(value = "/{adjustSn}") public AjaxResult getInfo(@PathVariable("adjustSn") String adjustSn) { return AjaxResult.success(oWbInveMngAdjustService.selectOWbInveMngAdjustById(adjustSn)); } /** * 新增库存调整记录. */ @PreAuthorize("@ss.hasPermi('biz:inveadjust:add')") @Log(title = "库存调整记录.", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody OWbInveMngAdjust oWbInveMngAdjust) { return toAjax(oWbInveMngAdjustService.insertOWbInveMngAdjust(oWbInveMngAdjust)); } /** * 修改库存调整记录. */ @PreAuthorize("@ss.hasPermi('biz:inveadjust:edit')") @Log(title = "库存调整记录.", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody OWbInveMngAdjust oWbInveMngAdjust) { return toAjax(oWbInveMngAdjustService.updateOWbInveMngAdjust(oWbInveMngAdjust)); } /** * 删除库存调整记录. */ @PreAuthorize("@ss.hasPermi('biz:inveadjust:remove')") @Log(title = "库存调整记录.", businessType = BusinessType.DELETE) @DeleteMapping("/{adjustSns}") public AjaxResult remove(@PathVariable String[] adjustSns) { return toAjax(oWbInveMngAdjustService.deleteOWbInveMngAdjustByIds(adjustSns)); } }