| | |
| | | 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.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 = "刀具信息") |
| | |
| | | @RequestMapping("/nc/cutter") |
| | | public class CutterController extends JeecgController<Cutter, ICutterService> { |
| | | |
| | | // /** |
| | | // * 根据业务id查询刀具列表 |
| | | // * @param businessId |
| | | // * @param pageNo |
| | | // * @param pageSize |
| | | // * @return |
| | | // */ |
| | | // @GetMapping("/getByBusinessId") |
| | | // public Result<?> getByBusinessId(String businessId,Integer pageNo,Integer pageSize){ |
| | | // return Result.OK(service.getByBusinessId(businessId,pageNo,pageSize)); |
| | | // } |
| | | /** |
| | | * 查询刀具列表 |
| | | * @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); |
| | | } |
| | | |
| | | /** |
| | | * 新增刀具信息 |
| | |
| | | @ApiOperation(value = "刀具信息-新增刀具信息", notes = "刀具信息-新增刀具信息") |
| | | @PostMapping("/add") |
| | | public Result<?> add(@RequestBody Cutter cutter){ |
| | | return Result.OK(service.add(cutter)); |
| | | return service.add(cutter); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "刀具信息-编辑刀具信息", notes = "刀具信息-编辑刀具信息") |
| | | @PutMapping("/edit") |
| | | public Result<?> edit(@RequestBody Cutter cutter){ |
| | | return Result.OK(service.edit(cutter)); |
| | | return service.edit(cutter); |
| | | } |
| | | |
| | | /** |
| | |
| | | @AutoLog(value = "刀具信息-根据id删除刀具信息") |
| | | @ApiOperation(value = "刀具信息-根据id删除刀具信息", notes = "刀具信息-根据id删除刀具信息") |
| | | @DeleteMapping("/delete") |
| | | public Result<?> delete(@RequestBody String id){ |
| | | return Result.OK(service.delete(id)); |
| | | 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); |
| | | } |
| | | } |