package com.jcdm.main.bs.batchInfo.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.bs.batchInfo.domain.BsBatchInfo;
|
import com.jcdm.main.bs.batchInfo.service.IBsBatchInfoService;
|
import com.jcdm.common.utils.poi.ExcelUtil;
|
import com.jcdm.common.core.page.TableDataInfo;
|
|
/**
|
* 批次信息录入Controller
|
*
|
* @author Yi
|
* @date 2024-10-15
|
*/
|
@RestController
|
@RequestMapping("/bs/batchInfo")
|
public class BsBatchInfoController extends BaseController
|
{
|
@Autowired
|
private IBsBatchInfoService bsBatchInfoService;
|
|
/**
|
* 查询批次信息录入列表
|
*/
|
@PreAuthorize("@ss.hasPermi('bs:batchInfo:list')")
|
@GetMapping("/list")
|
public TableDataInfo list(BsBatchInfo bsBatchInfo)
|
{
|
startPage();
|
List<BsBatchInfo> list = bsBatchInfoService.selectBsBatchInfoList(bsBatchInfo);
|
return getDataTable(list);
|
}
|
|
/**
|
* 导出批次信息录入列表
|
*/
|
@PreAuthorize("@ss.hasPermi('bs:batchInfo:export')")
|
@Log(title = "批次信息录入", businessType = BusinessType.EXPORT)
|
@PostMapping("/export")
|
public void export(HttpServletResponse response, BsBatchInfo bsBatchInfo)
|
{
|
List<BsBatchInfo> list = bsBatchInfoService.selectBsBatchInfoList(bsBatchInfo);
|
ExcelUtil<BsBatchInfo> util = new ExcelUtil<BsBatchInfo>(BsBatchInfo.class);
|
util.exportExcel(response, list, "批次信息录入数据");
|
}
|
|
/**
|
* 获取批次信息录入详细信息
|
*/
|
@PreAuthorize("@ss.hasPermi('bs:batchInfo:query')")
|
@GetMapping(value = "/{id}")
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
{
|
return success(bsBatchInfoService.selectBsBatchInfoById(id));
|
}
|
|
/**
|
* 新增批次信息录入
|
*/
|
@PreAuthorize("@ss.hasPermi('bs:batchInfo:add')")
|
@Log(title = "批次信息录入", businessType = BusinessType.INSERT)
|
@PostMapping
|
public AjaxResult add(@RequestBody BsBatchInfo bsBatchInfo)
|
{
|
return toAjax(bsBatchInfoService.insertBsBatchInfo(bsBatchInfo));
|
}
|
|
/**
|
* 修改批次信息录入
|
*/
|
@PreAuthorize("@ss.hasPermi('bs:batchInfo:edit')")
|
@Log(title = "批次信息录入", businessType = BusinessType.UPDATE)
|
@PutMapping
|
public AjaxResult edit(@RequestBody BsBatchInfo bsBatchInfo)
|
{
|
return toAjax(bsBatchInfoService.updateBsBatchInfo(bsBatchInfo));
|
}
|
|
/**
|
* 删除批次信息录入
|
*/
|
@PreAuthorize("@ss.hasPermi('bs:batchInfo:remove')")
|
@Log(title = "批次信息录入", businessType = BusinessType.DELETE)
|
@DeleteMapping("/{ids}")
|
public AjaxResult remove(@PathVariable Long[] ids)
|
{
|
return toAjax(bsBatchInfoService.deleteBsBatchInfoByIds(ids));
|
}
|
|
@DeleteMapping("/bacthInput/{ids}")
|
public AjaxResult bacthInput(@PathVariable Long[] ids)
|
{
|
return toAjax(bsBatchInfoService.bacthInput(ids));
|
}
|
}
|