zhangherong
2025-06-25 2fb6c67b2c0c72195eef6fe5f7904d739b46e2c0
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
package org.jeecg.modules.dnc.controller;
 
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.dnc.entity.Cutter;
import org.jeecg.modules.dnc.service.ICutterService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
 
@Slf4j
@Api(tags = "刀具信息")
@RestController
@RequestMapping("/nc/cutter")
public class CutterController extends JeecgController<Cutter, ICutterService> {
 
    /**
     * 查询刀具列表
     * @param cutter
     * @param pageNo
     * @param pageSize
     * @return
     */
    @AutoLog(value = "刀具信息-查询刀具列表")
    @ApiOperation(value = "刀具信息-查询刀具列表", notes = "刀具信息-查询刀具列表")
    @GetMapping("/getByBusinessId")
    public Result<?> getByBusinessId( Cutter cutter,Integer pageNo,Integer pageSize){
        return service.query(cutter,pageNo,pageSize);
    }
 
    /**
     * 查询刀具List
     * @param cutter
     * @return
     */
    @AutoLog(value = "刀具信息-查询刀具List")
    @ApiOperation(value = "刀具信息-查询刀具List", notes = "刀具信息-查询刀具List")
    @GetMapping("/getList")
    public Result<?> getList( Cutter cutter){
        QueryWrapper<Cutter> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq(StrUtil.isNotEmpty(cutter.getDocId()),"doc_id",cutter.getDocId());
        queryWrapper.like(StrUtil.isNotEmpty(cutter.getCutterName()),"cutter_name",cutter.getCutterName());
        queryWrapper.like(StrUtil.isNotEmpty(cutter.getCutterType()),"cutter_type",cutter.getCutterType());
        queryWrapper.like(StrUtil.isNotEmpty(cutter.getCutterSpacing()),"cutter_spacing",cutter.getCutterSpacing());
        queryWrapper.orderByDesc("create_time");
        List<Cutter> list = service.list(queryWrapper);
        return Result.OK(list);
    }
 
    /**
     * 新增刀具信息
     * @param cutter
     * @return
     */
    @AutoLog(value = "刀具信息-新增刀具信息")
    @ApiOperation(value = "刀具信息-新增刀具信息", notes = "刀具信息-新增刀具信息")
    @PostMapping("/add")
    public Result<?> add(@RequestBody Cutter cutter){
        return service.add(cutter);
    }
 
    /**
     * 编辑刀具信息
     * @param cutter
     * @return
     */
    @AutoLog(value = "刀具信息-编辑刀具信息")
    @ApiOperation(value = "刀具信息-编辑刀具信息", notes = "刀具信息-编辑刀具信息")
    @PutMapping("/edit")
    public Result<?> edit(@RequestBody Cutter cutter){
        return service.edit(cutter);
    }
 
    /**
     * 根据id删除刀具信息
     * @param id
     * @return
     */
    @AutoLog(value = "刀具信息-根据id删除刀具信息")
    @ApiOperation(value = "刀具信息-根据id删除刀具信息", notes = "刀具信息-根据id删除刀具信息")
    @DeleteMapping("/delete")
    public Result<?> delete(String id){
        return service.delete(id);
    }
 
    /**
     * 导出excel
     * @param request
     * @param cutter
     * @return
     */
    @AutoLog(value = "刀具信息-导出excel")
    @ApiOperation(value = "刀具信息-导出excel", notes = "刀具信息-导出excel")
    @RequestMapping(value = "/exportXls")
    public ModelAndView exportXls(HttpServletRequest request, Cutter cutter) {
        return super.exportXls(request, cutter, Cutter.class, "刀具信息");
    }
 
    /**
     * 导入excel
     * @param request
     * @param response
     * @return
     */
    @AutoLog(value = "刀具信息-导入excel")
    @ApiOperation(value = "刀具信息-导入excel", notes = "刀具信息-导入excel")
    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
        return super.importExcel(request, response, Cutter.class);
    }
 
    /**
     * 提取刀具
     * @param docId 文档Id
     * @return
     */
    @AutoLog(value = "刀具信息-提取刀具")
    @ApiOperation(value = "刀具信息-提取刀具", notes = "刀具信息-提取刀具")
    @GetMapping("/extractCutterInfo/{docId}/{attributionType}/{attributionId}")
    public Result<?> extractCutterInfo(@PathVariable("docId") String docId
            ,@PathVariable("attributionType") Integer attributionType
            ,@PathVariable("attributionId") String attributionId) {
        return service.extractAndSaveFromContent(docId,attributionId,attributionType);
    }
 
    /**
     * 发送刀具系统
     * @param docId 文档Id
     * @return
     */
    @AutoLog(value = "刀具信息-发送刀具系统")
    @ApiOperation(value = "刀具信息-发送刀具系统", notes = "刀具信息-发送刀具系统")
    @GetMapping("/sendCutterInfo/{docId}/{attributionType}/{attributionId}")
    public Result<?> sendCutterInfo(@PathVariable("docId") String docId
            ,@PathVariable("attributionType") Integer attributionType
            ,@PathVariable("attributionId") String attributionId) {
        return service.sendToCutterSystem(docId,attributionId,attributionType);
    }
}