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.OWbInveShipmentGoods; import com.emato.biz.service.warehouse.IOWbInveShipmentGoodsService; import com.emato.common.utils.poi.ExcelUtil; import com.emato.common.core.page.TableDataInfo; /** * 库存发货货品Controller * * @author yangbo * @date 2021-02-01 */ @RestController @RequestMapping("/biz/inveshipmentgoods") public class OWbInveShipmentGoodsController extends BaseController { @Autowired private IOWbInveShipmentGoodsService oWbInveShipmentGoodsService; /** * 查询库存发货货品列表 */ @PreAuthorize("@ss.hasPermi('biz:inveshipmentgoods:list')") @GetMapping("/list") public TableDataInfo list(OWbInveShipmentGoods oWbInveShipmentGoods) { startPage(); List list = oWbInveShipmentGoodsService.selectOWbInveShipmentGoodsList(oWbInveShipmentGoods); return getDataTable(list); } /** * 导出库存发货货品列表 */ @PreAuthorize("@ss.hasPermi('biz:inveshipmentgoods:export')") @Log(title = "库存发货货品", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(OWbInveShipmentGoods oWbInveShipmentGoods) { List list = oWbInveShipmentGoodsService.selectOWbInveShipmentGoodsList(oWbInveShipmentGoods); ExcelUtil util = new ExcelUtil(OWbInveShipmentGoods.class); return util.exportExcel(list, "inveshipmentgoods"); } /** * 获取库存发货货品详细信息 */ @PreAuthorize("@ss.hasPermi('biz:inveshipmentgoods:query')") @GetMapping(value = "/{shipmentGoodsSn}") public AjaxResult getInfo(@PathVariable("shipmentGoodsSn") String shipmentGoodsSn) { return AjaxResult.success(oWbInveShipmentGoodsService.selectOWbInveShipmentGoodsById(shipmentGoodsSn)); } /** * 新增库存发货货品 */ @PreAuthorize("@ss.hasPermi('biz:inveshipmentgoods:add')") @Log(title = "库存发货货品", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody OWbInveShipmentGoods oWbInveShipmentGoods) { return toAjax(oWbInveShipmentGoodsService.insertOWbInveShipmentGoods(oWbInveShipmentGoods)); } /** * 修改库存发货货品 */ @PreAuthorize("@ss.hasPermi('biz:inveshipmentgoods:edit')") @Log(title = "库存发货货品", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody OWbInveShipmentGoods oWbInveShipmentGoods) { return toAjax(oWbInveShipmentGoodsService.updateOWbInveShipmentGoods(oWbInveShipmentGoods)); } /** * 删除库存发货货品 */ @PreAuthorize("@ss.hasPermi('biz:inveshipmentgoods:remove')") @Log(title = "库存发货货品", businessType = BusinessType.DELETE) @DeleteMapping("/{shipmentGoodsSns}") public AjaxResult remove(@PathVariable String[] shipmentGoodsSns) { return toAjax(oWbInveShipmentGoodsService.deleteOWbInveShipmentGoodsByIds(shipmentGoodsSns)); } }