package com.jcdm.main.da.cellData.controller; 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.jcdm.common.annotation.Log; import com.jcdm.common.core.controller.BaseController; import com.jcdm.common.core.domain.AjaxResult; import com.jcdm.common.enums.BusinessType; import com.jcdm.main.da.cellData.domain.DaCellData; import com.jcdm.main.da.cellData.service.IDaCellDataService; import com.jcdm.common.utils.poi.ExcelUtil; import com.jcdm.common.core.page.TableDataInfo; /** * 电芯数据Controller * * @author Yi * @date 2024-07-03 */ @RestController @RequestMapping("/da/cellData") public class DaCellDataController extends BaseController { @Autowired private IDaCellDataService daCellDataService; /** * 查询电芯数据列表 */ @PreAuthorize("@ss.hasPermi('da:cellData:list')") @GetMapping("/list") public TableDataInfo list(DaCellData daCellData) { startPage(); List list = daCellDataService.selectDaCellDataList(daCellData); return getDataTable(list); } /** * 导出电芯数据列表 */ @PreAuthorize("@ss.hasPermi('da:cellData:export')") @Log(title = "电芯数据", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DaCellData daCellData) { List list = daCellDataService.selectDaCellDataList(daCellData); ExcelUtil util = new ExcelUtil(DaCellData.class); util.exportExcel(response, list, "电芯数据数据"); } /** * 获取电芯数据详细信息 */ @PreAuthorize("@ss.hasPermi('da:cellData:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(daCellDataService.selectDaCellDataById(id)); } /** * 新增电芯数据 */ @PreAuthorize("@ss.hasPermi('da:cellData:add')") @Log(title = "电芯数据", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DaCellData daCellData) { return toAjax(daCellDataService.insertDaCellData(daCellData)); } /** * 修改电芯数据 */ @PreAuthorize("@ss.hasPermi('da:cellData:edit')") @Log(title = "电芯数据", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DaCellData daCellData) { return toAjax(daCellDataService.updateDaCellData(daCellData)); } /** * 删除电芯数据 */ @PreAuthorize("@ss.hasPermi('da:cellData:remove')") @Log(title = "电芯数据", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(daCellDataService.deleteDaCellDataByIds(ids)); } }