liusuyi
2026-05-18 b5cd784d0cde5b7c82ea78aef4ac0e5a161d8c5d
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
package com.ard.work.location_note.controller;
 
import java.util.List;
import java.io.IOException;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
 
import com.ard.common.core.utils.uuid.IdUtils;
import com.ard.common.security.service.TokenService;
import com.ard.system.api.model.LoginUser;
import com.ard.work.location_note.domain.ArdLocationNote;
import com.ard.work.location_note.service.IArdLocationNoteService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
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.ard.common.log.annotation.Log;
import com.ard.common.log.enums.BusinessType;
import com.ard.common.security.annotation.RequiresPermissions;
import com.ard.common.core.web.controller.BaseController;
import com.ard.common.core.web.domain.AjaxResult;
import com.ard.common.core.utils.poi.ExcelUtil;
import com.ard.common.core.web.page.TableDataInfo;
 
/**
 * 注记Controller
 * 
 * @author ruoyi
 * @date 2025-03-25
 */
@Tag(name = "注记")
@RestController
@RequestMapping("/locationNote")
public class ArdLocationNoteController extends BaseController
{
    @Autowired
    private IArdLocationNoteService ardLocationNoteService;
 
    @Resource
    private TokenService tokenService;
    /**
     * 查询注记列表
     */
    @Operation(summary = "查询注记列表")
    @RequiresPermissions("location_note:locationNote:list")
    @GetMapping("/list")
    public TableDataInfo list(ArdLocationNote ardLocationNote)
    {
        LoginUser loginUser = tokenService.getLoginUser();
        ardLocationNote.setCreatorDeptId(loginUser.getSysUser().getDeptId().toString());
        startPage();
        List<ArdLocationNote> list = ardLocationNoteService.selectArdLocationNoteList(ardLocationNote);
        return getDataTable(list);
    }
 
    /**
     * 导出注记列表
     */
    @Operation(summary = "导出注记列表")
    @RequiresPermissions("location_note:locationNote:export")
    @Log(title = "注记", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ArdLocationNote ardLocationNote)
    {
        List<ArdLocationNote> list = ardLocationNoteService.selectArdLocationNoteList(ardLocationNote);
        ExcelUtil<ArdLocationNote> util = new ExcelUtil<ArdLocationNote>(ArdLocationNote.class);
        util.exportExcel(response, list, "注记数据");
    }
 
    /**
     * 获取注记详细信息
     */
    @Operation(summary = "获取注记详细信息")
    @RequiresPermissions("location_note:locationNote:query")
    @GetMapping(value = "/{areaId}")
    public AjaxResult getInfo(@PathVariable("areaId") String areaId)
    {
        return success(ardLocationNoteService.selectArdLocationNoteByAreaId(areaId));
    }
 
    /**
     * 新增注记
     */
    @Operation(summary = "新增注记")
    @RequiresPermissions("location_note:locationNote:add")
    @Log(title = "注记", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ArdLocationNote ardLocationNote)
    {
        LoginUser loginUser = tokenService.getLoginUser();
        ardLocationNote.setCreatorDeptId(loginUser.getSysUser().getDeptId().toString());
        ardLocationNote.setAreaId(IdUtils.simpleUUID());
        ardLocationNote.setCreateBy(loginUser.getSysUser().getNickName());
        return toAjax(ardLocationNoteService.insertArdLocationNote(ardLocationNote));
    }
 
    /**
     * 修改注记
     */
    @Operation(summary = "修改注记")
    @RequiresPermissions("location_note:locationNote:edit")
    @Log(title = "注记", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ArdLocationNote ardLocationNote)
    {
        LoginUser loginUser = tokenService.getLoginUser();
        ardLocationNote.setUpdateBy(loginUser.getSysUser().getNickName());
        return toAjax(ardLocationNoteService.updateArdLocationNote(ardLocationNote));
    }
 
    /**
     * 删除注记
     */
    @Operation(summary = "删除注记")
    @RequiresPermissions("location_note:locationNote:remove")
    @Log(title = "注记", businessType = BusinessType.DELETE)
    @DeleteMapping("/{areaIds}")
    public AjaxResult remove(@PathVariable String[] areaIds)
    {
        return toAjax(ardLocationNoteService.deleteArdLocationNoteByAreaIds(areaIds));
    }
}