zjh
2024-07-15 a9e42bd044e835f49a08b9d5852ef10e669cd153
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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));
    }
}