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.MallMngChange; import com.emato.biz.service.mall.IMallMngChangeService; import com.emato.common.utils.poi.ExcelUtil; import com.emato.common.core.page.TableDataInfo; /** * 电商库存变化记录表Controller * * @author scott * @date 2021-02-01 */ @RestController @RequestMapping("/biz/mallmngchange") public class MallMngChangeController extends BaseController { @Autowired private IMallMngChangeService mallMngChangeService; /** * 查询电商库存变化记录表列表 */ @PreAuthorize("@ss.hasPermi('biz:mallmngchange:list')") @GetMapping("/list") public TableDataInfo list(MallMngChange mallMngChange) { startPage(); List list = mallMngChangeService.selectMallMngChangeList(mallMngChange); return getDataTable(list); } /** * 导出电商库存变化记录表列表 */ @PreAuthorize("@ss.hasPermi('biz:mallmngchange:export')") @Log(title = "电商库存变化记录表", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(MallMngChange mallMngChange) { List list = mallMngChangeService.selectMallMngChangeList(mallMngChange); ExcelUtil util = new ExcelUtil(MallMngChange.class); return util.exportExcel(list, "mallmngchange"); } /** * 获取电商库存变化记录表详细信息 */ @PreAuthorize("@ss.hasPermi('biz:mallmngchange:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return AjaxResult.success(mallMngChangeService.selectMallMngChangeById(id)); } /** * 新增电商库存变化记录表 */ @PreAuthorize("@ss.hasPermi('biz:mallmngchange:add')") @Log(title = "电商库存变化记录表", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody MallMngChange mallMngChange) { return toAjax(mallMngChangeService.insertMallMngChange(mallMngChange)); } /** * 修改电商库存变化记录表 */ @PreAuthorize("@ss.hasPermi('biz:mallmngchange:edit')") @Log(title = "电商库存变化记录表", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody MallMngChange mallMngChange) { return toAjax(mallMngChangeService.updateMallMngChange(mallMngChange)); } /** * 删除电商库存变化记录表 */ @PreAuthorize("@ss.hasPermi('biz:mallmngchange:remove')") @Log(title = "电商库存变化记录表", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(mallMngChangeService.deleteMallMngChangeByIds(ids)); } }