123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- package com.tour.web.controller;
- import java.util.List;
- import java.util.Arrays;
- import lombok.RequiredArgsConstructor;
- import com.tour.common.annotation.Log;
- import com.tour.common.core.controller.BaseController;
- import com.tour.common.core.domain.Result;
- import com.tour.common.core.page.TableDataInfo;
- import com.tour.common.enums.BusinessType;
- import com.tour.common.utils.poi.ExcelUtil;
- 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.tour.module.domain.MakeCardAllocation;
- import com.tour.module.service.IMakeCardAllocationService;
- /**
- * 制卡分配情况Controller
- *
- * @author zoe
- * @date 2023-06-02
- */
- @RequiredArgsConstructor(onConstructor_ = @Autowired)
- @RestController
- @RequestMapping("/module/MakeCardAllocation" )
- public class MakeCardAllocationController extends BaseController {
- private final IMakeCardAllocationService iMakeCardAllocationService;
- /**
- * 查询制卡分配情况列表
- */
- @PreAuthorize("@ss.hasPermi('module:MakeCardAllocation:list')")
- @GetMapping("/list")
- public TableDataInfo list(MakeCardAllocation MakeCardAllocation) {
- startPage();
- List<MakeCardAllocation> list = iMakeCardAllocationService.queryList(MakeCardAllocation);
- return getDataTable(list);
- }
- /**
- * 导出制卡分配情况列表
- */
- @PreAuthorize("@ss.hasPermi('module:MakeCardAllocation:export')" )
- @Log(title = "制卡分配情况" , businessType = BusinessType.EXPORT)
- @GetMapping("/export" )
- public Result export(MakeCardAllocation MakeCardAllocation) {
- List<MakeCardAllocation> list = iMakeCardAllocationService.queryList(MakeCardAllocation);
- ExcelUtil<MakeCardAllocation> util = new ExcelUtil<MakeCardAllocation>(MakeCardAllocation.class);
- return util.exportExcel(list, "MakeCardAllocation" );
- }
- /**
- * 获取制卡分配情况详细信息
- */
- @PreAuthorize("@ss.hasPermi('module:MakeCardAllocation:query')" )
- @GetMapping(value = "/{id}" )
- public Result getInfo(@PathVariable("id" ) Long id) {
- return Result.success(iMakeCardAllocationService.getById(id));
- }
- /**
- * 新增制卡分配情况
- */
- @PreAuthorize("@ss.hasPermi('module:MakeCardAllocation:add')" )
- @Log(title = "制卡分配情况" , businessType = BusinessType.INSERT)
- @PostMapping
- public Result add(@RequestBody List<MakeCardAllocation> list) {
- return toAjax(iMakeCardAllocationService.saveBatch(list) ? 1 : 0);
- }
- /**
- * 修改制卡分配情况
- */
- @PreAuthorize("@ss.hasPermi('module:MakeCardAllocation:edit')" )
- @Log(title = "制卡分配情况" , businessType = BusinessType.UPDATE)
- @PutMapping
- public Result edit(@RequestBody MakeCardAllocation MakeCardAllocation) {
- return toAjax(iMakeCardAllocationService.updateById(MakeCardAllocation) ? 1 : 0);
- }
- /**
- * 删除制卡分配情况
- */
- @PreAuthorize("@ss.hasPermi('module:MakeCardAllocation:remove')" )
- @Log(title = "制卡分配情况" , businessType = BusinessType.DELETE)
- @DeleteMapping("/{ids}" )
- public Result remove(@PathVariable Long[] ids) {
- return toAjax(iMakeCardAllocationService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
- }
- }
|