package org.jeecg.modules.dnc.controller;
|
|
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;
|
|
@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);
|
}
|
|
/**
|
* 新增刀具信息
|
* @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);
|
}
|
|
}
|