package com.ltkj.web.controller.system;
|
|
import com.ltkj.common.annotation.Log;
|
import com.ltkj.common.core.controller.BaseController;
|
import com.ltkj.common.core.domain.AjaxResult;
|
import com.ltkj.common.core.page.TableDataInfo;
|
import com.ltkj.common.enums.BusinessType;
|
import com.ltkj.common.utils.poi.ExcelUtil;
|
import com.ltkj.hosp.domain.TjCatering;
|
import com.ltkj.hosp.service.ITjCateringService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.servlet.http.HttpServletResponse;
|
import java.util.List;
|
|
/**
|
* 体检配餐
|
* Controller
|
*
|
* @author ltkj_赵佳豪&李格
|
* @date 2023-02-17
|
*/
|
@RestController
|
@RequestMapping("/catering/catering")
|
public class TjCateringController extends BaseController {
|
@Autowired
|
private ITjCateringService tjCateringService;
|
|
/**
|
* 查询体检配餐
|
* 列表
|
*/
|
@PreAuthorize("@ss.hasPermi('catering:catering:list')")
|
@GetMapping("/list")
|
public TableDataInfo list(TjCatering tjCatering) {
|
startPage();
|
List<TjCatering> list = tjCateringService.selectTjCateringList(tjCatering);
|
return getDataTable(list);
|
}
|
|
/**
|
* 导出体检配餐
|
列表
|
*/
|
@PreAuthorize("@ss.hasPermi('catering:catering:export')")
|
@Log(title = "体检配餐", businessType = BusinessType.EXPORT)
|
@PostMapping("/export")
|
public void export(HttpServletResponse response, TjCatering tjCatering) {
|
List<TjCatering> list = tjCateringService.selectTjCateringList(tjCatering);
|
ExcelUtil<TjCatering> util = new ExcelUtil<TjCatering>(TjCatering.class);
|
util.exportExcel(response, list, "体检配餐数据");
|
}
|
|
/**
|
* 获取体检配餐
|
* 详细信息
|
*/
|
@PreAuthorize("@ss.hasPermi('catering:catering:query')")
|
@GetMapping(value = "/{id}")
|
public AjaxResult getInfo(@PathVariable("id") String id) {
|
return success(tjCateringService.selectTjCateringById(id));
|
}
|
|
/**
|
* 新增体检配餐
|
|
*/
|
@PreAuthorize("@ss.hasPermi('catering:catering:add')")
|
@Log(title = "体检配餐", businessType = BusinessType.INSERT)
|
@PostMapping
|
public AjaxResult add(@RequestBody TjCatering tjCatering){
|
return toAjax(tjCateringService.save(tjCatering));
|
}
|
|
/**
|
* 修改体检配餐
|
*/
|
@PreAuthorize("@ss.hasPermi('catering:catering:edit')")
|
@Log(title = "体检配餐", businessType = BusinessType.UPDATE)
|
@PutMapping
|
public AjaxResult edit(@RequestBody TjCatering tjCatering){
|
return toAjax(tjCateringService.updateById(tjCatering));
|
}
|
|
/**
|
* 删除体检配餐
|
*/
|
@PreAuthorize("@ss.hasPermi('catering:catering:remove')")
|
@Log(title = "体检配餐", businessType = BusinessType.DELETE)
|
@DeleteMapping("/{ids}")
|
public AjaxResult remove(@PathVariable String[]ids) {
|
return toAjax(tjCateringService.deleteTjCateringByIds(ids));
|
}
|
}
|