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.OWbInveFreeze; import com.emato.biz.service.warehouse.IOWbInveFreezeService; import com.emato.common.utils.poi.ExcelUtil; import com.emato.common.core.page.TableDataInfo; /** * 库存冻结记录,记录订单商品冻结Controller * * @author yangbo * @date 2021-02-01 */ @RestController @RequestMapping("/biz/invefreeze") public class OWbInveFreezeController extends BaseController { @Autowired private IOWbInveFreezeService oWbInveFreezeService; /** * 查询库存冻结记录,记录订单商品冻结列表 */ @PreAuthorize("@ss.hasPermi('biz:invefreeze:list')") @GetMapping("/list") public TableDataInfo list(OWbInveFreeze oWbInveFreeze) { startPage(); List list = oWbInveFreezeService.selectOWbInveFreezeList(oWbInveFreeze); return getDataTable(list); } /** * 导出库存冻结记录,记录订单商品冻结列表 */ @PreAuthorize("@ss.hasPermi('biz:invefreeze:export')") @Log(title = "库存冻结记录,记录订单商品冻结", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(OWbInveFreeze oWbInveFreeze) { List list = oWbInveFreezeService.selectOWbInveFreezeList(oWbInveFreeze); ExcelUtil util = new ExcelUtil(OWbInveFreeze.class); return util.exportExcel(list, "invefreeze"); } /** * 获取库存冻结记录,记录订单商品冻结详细信息 */ @PreAuthorize("@ss.hasPermi('biz:invefreeze:query')") @GetMapping(value = "/{inveFzeSn}") public AjaxResult getInfo(@PathVariable("inveFzeSn") String inveFzeSn) { return AjaxResult.success(oWbInveFreezeService.selectOWbInveFreezeById(inveFzeSn)); } /** * 新增库存冻结记录,记录订单商品冻结 */ @PreAuthorize("@ss.hasPermi('biz:invefreeze:add')") @Log(title = "库存冻结记录,记录订单商品冻结", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody OWbInveFreeze oWbInveFreeze) { return toAjax(oWbInveFreezeService.insertOWbInveFreeze(oWbInveFreeze)); } /** * 修改库存冻结记录,记录订单商品冻结 */ @PreAuthorize("@ss.hasPermi('biz:invefreeze:edit')") @Log(title = "库存冻结记录,记录订单商品冻结", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody OWbInveFreeze oWbInveFreeze) { return toAjax(oWbInveFreezeService.updateOWbInveFreeze(oWbInveFreeze)); } /** * 删除库存冻结记录,记录订单商品冻结 */ @PreAuthorize("@ss.hasPermi('biz:invefreeze:remove')") @Log(title = "库存冻结记录,记录订单商品冻结", businessType = BusinessType.DELETE) @DeleteMapping("/{inveFzeSns}") public AjaxResult remove(@PathVariable String[] inveFzeSns) { return toAjax(oWbInveFreezeService.deleteOWbInveFreezeByIds(inveFzeSns)); } }