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.OWbInveWithdrawItem; import com.emato.biz.service.warehouse.IOWbInveWithdrawItemService; import com.emato.common.utils.poi.ExcelUtil; import com.emato.common.core.page.TableDataInfo; /** * 库存退港明细Controller * * @author scott * @date 2021-02-01 */ @RestController @RequestMapping("/biz/inveitem") public class OWbInveWithdrawItemController extends BaseController { @Autowired private IOWbInveWithdrawItemService oWbInveWithdrawItemService; /** * 查询库存退港明细列表 */ @PreAuthorize("@ss.hasPermi('biz:inveitem:list')") @GetMapping("/list") public TableDataInfo list(OWbInveWithdrawItem oWbInveWithdrawItem) { startPage(); List list = oWbInveWithdrawItemService.selectOWbInveWithdrawItemList(oWbInveWithdrawItem); return getDataTable(list); } /** * 导出库存退港明细列表 */ @PreAuthorize("@ss.hasPermi('biz:inveitem:export')") @Log(title = "库存退港明细", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(OWbInveWithdrawItem oWbInveWithdrawItem) { List list = oWbInveWithdrawItemService.selectOWbInveWithdrawItemList(oWbInveWithdrawItem); ExcelUtil util = new ExcelUtil(OWbInveWithdrawItem.class); return util.exportExcel(list, "inveitem"); } /** * 获取库存退港明细详细信息 */ @PreAuthorize("@ss.hasPermi('biz:inveitem:query')") @GetMapping(value = "/{iwItemSn}") public AjaxResult getInfo(@PathVariable("iwItemSn") String iwItemSn) { return AjaxResult.success(oWbInveWithdrawItemService.selectOWbInveWithdrawItemById(iwItemSn)); } /** * 新增库存退港明细 */ @PreAuthorize("@ss.hasPermi('biz:inveitem:add')") @Log(title = "库存退港明细", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody OWbInveWithdrawItem oWbInveWithdrawItem) { return toAjax(oWbInveWithdrawItemService.insertOWbInveWithdrawItem(oWbInveWithdrawItem)); } /** * 修改库存退港明细 */ @PreAuthorize("@ss.hasPermi('biz:inveitem:edit')") @Log(title = "库存退港明细", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody OWbInveWithdrawItem oWbInveWithdrawItem) { return toAjax(oWbInveWithdrawItemService.updateOWbInveWithdrawItem(oWbInveWithdrawItem)); } /** * 删除库存退港明细 */ @PreAuthorize("@ss.hasPermi('biz:inveitem:remove')") @Log(title = "库存退港明细", businessType = BusinessType.DELETE) @DeleteMapping("/{iwItemSns}") public AjaxResult remove(@PathVariable String[] iwItemSns) { return toAjax(oWbInveWithdrawItemService.deleteOWbInveWithdrawItemByIds(iwItemSns)); } }