package com.ltkj.web.controller.mall; import java.util.List; import javax.servlet.http.HttpServletResponse; 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.ltkj.common.annotation.Log; import com.ltkj.common.core.controller.BaseController; import com.ltkj.common.core.domain.AjaxResult; import com.ltkj.common.enums.BusinessType; import com.ltkj.mall.domain.MallCheckLog; import com.ltkj.mall.service.IMallCheckLogService; import com.ltkj.common.utils.poi.ExcelUtil; import com.ltkj.common.core.page.TableDataInfo; /** * 核销记录Controller * * @author ltkj_赵佳豪&李格 * @date 2023-07-14 */ @RestController @RequestMapping("/mall/checklog") public class MallCheckLogController extends BaseController { @Autowired private IMallCheckLogService mallCheckLogService; /** * 查询核销记录列表 */ @PreAuthorize("@ss.hasPermi('mall:checklog:list')") @GetMapping("/list") public TableDataInfo list(MallCheckLog mallCheckLog) { startPage(); List list = mallCheckLogService.selectMallCheckLogList(mallCheckLog); return getDataTable(list); } /** * 导出核销记录列表 */ @PreAuthorize("@ss.hasPermi('mall:checklog:export')") @Log(title = "核销记录", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, MallCheckLog mallCheckLog) { List list = mallCheckLogService.selectMallCheckLogList(mallCheckLog); ExcelUtil util = new ExcelUtil(MallCheckLog.class); util.exportExcel(response, list, "核销记录数据"); } /** * 获取核销记录详细信息 */ @PreAuthorize("@ss.hasPermi('mall:checklog:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(mallCheckLogService.selectMallCheckLogById(id)); } /** * 新增核销记录 */ @PreAuthorize("@ss.hasPermi('mall:checklog:add')") @Log(title = "核销记录", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody MallCheckLog mallCheckLog) { return toAjax(mallCheckLogService.insertMallCheckLog(mallCheckLog)); } /** * 修改核销记录 */ @PreAuthorize("@ss.hasPermi('mall:checklog:edit')") @Log(title = "核销记录", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody MallCheckLog mallCheckLog) { return toAjax(mallCheckLogService.updateMallCheckLog(mallCheckLog)); } /** * 删除核销记录 */ @PreAuthorize("@ss.hasPermi('mall:checklog:remove')") @Log(title = "核销记录", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(mallCheckLogService.deleteMallCheckLogByIds(ids)); } }