From 366089899bf7babed365fb7e9deace9c4b894adf Mon Sep 17 00:00:00 2001 From: yangman <15045099937@qq.com> Date: 星期一, 03 七月 2023 17:30:41 +0800 Subject: [PATCH] 修改扭矩配置管理2 --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcTorqueConfigController.java | 88 +++++++++++++++++++++++++++++-------------- 1 files changed, 59 insertions(+), 29 deletions(-) diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcTorqueConfigController.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcTorqueConfigController.java index c557d79..151f8ce 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcTorqueConfigController.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcTorqueConfigController.java @@ -1,5 +1,7 @@ package org.jeecg.modules.mdc.controller; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -33,104 +35,132 @@ /** * 鏍规嵁id鏌ヨ + * * @param id * @return */ @AutoLog(value = "鎵煩閰嶇疆绠$悊-鏍规嵁id鏌ヨ") - @ApiOperation(value = "鎵煩閰嶇疆绠$悊-鏍规嵁id鏌ヨ",notes = "鎵煩閰嶇疆绠$悊-鏍规嵁id鏌ヨ") + @ApiOperation(value = "鎵煩閰嶇疆绠$悊-鏍规嵁id鏌ヨ", notes = "鎵煩閰嶇疆绠$悊-鏍规嵁id鏌ヨ") @GetMapping("/queryById") - public Result<?> queryById(@RequestParam(required = true,name = "id") String id){ - MdcTorqueConfig mdcTorqueConfig=mdcTorqueConfigService.queryById(id); + public Result<?> queryById(@RequestParam(required = true, name = "id") String id) { + MdcTorqueConfig mdcTorqueConfig = mdcTorqueConfigService.queryById(id); //鏌ヨ涓嶄负绌哄垯杩斿洖鏁版嵁 - return null!=mdcTorqueConfig?Result.OK(mdcTorqueConfig):Result.error("鏈壘鍒板搴旀暟鎹�"); + return null != mdcTorqueConfig ? Result.OK(mdcTorqueConfig) : Result.error("鏈壘鍒板搴旀暟鎹�"); } /** * 鏂板 + * * @param mdcTorqueConfig * @return */ @AutoLog(value = "鎵煩閰嶇疆绠$悊-鏂板") - @ApiOperation(value = "鎵煩閰嶇疆绠$悊-鏂板",notes = "鎵煩閰嶇疆绠$悊-鏂板") + @ApiOperation(value = "鎵煩閰嶇疆绠$悊-鏂板", notes = "鎵煩閰嶇疆绠$悊-鏂板") @PostMapping("/addMdcTorqueConfig") - public Result<?> addMdcTorqueConfig(@RequestBody MdcTorqueConfig mdcTorqueConfig){ - boolean flag= mdcTorqueConfigService.addTorque(mdcTorqueConfig); - return flag?Result.ok("鏂板鎴愬姛"):Result.error("鏂板澶辫触"); + public Result<?> addMdcTorqueConfig(@RequestBody MdcTorqueConfig mdcTorqueConfig) { + boolean flag = mdcTorqueConfigService.addTorque(mdcTorqueConfig); + return flag ? Result.ok("鏂板鎴愬姛") : Result.error("鏂板澶辫触"); } /** * 淇敼 + * * @param mdcTorqueConfig * @return */ @AutoLog(value = "鎵煩閰嶇疆绠$悊-淇敼") - @ApiOperation(value = "鎵煩閰嶇疆绠$悊-淇敼",notes = "鎵煩閰嶇疆绠$悊-淇敼") + @ApiOperation(value = "鎵煩閰嶇疆绠$悊-淇敼", notes = "鎵煩閰嶇疆绠$悊-淇敼") @PutMapping("/editMdcTorqueConfig") - public Result<?> editMdcTorqueConfig(@RequestBody MdcTorqueConfig mdcTorqueConfig){ - boolean flag= mdcTorqueConfigService.editTorque(mdcTorqueConfig); - return flag?Result.ok("淇敼鎴愬姛"):Result.error("淇敼澶辫触"); + public Result<?> editMdcTorqueConfig(@RequestBody MdcTorqueConfig mdcTorqueConfig) { + boolean flag = mdcTorqueConfigService.editTorque(mdcTorqueConfig); + return flag ? Result.ok("淇敼鎴愬姛") : Result.error("淇敼澶辫触"); } /** * 鏍规嵁id鍒犻櫎鎵煩閰嶇疆 + * * @param id * @return */ @AutoLog(value = "鎵煩閰嶇疆绠$悊-鏍规嵁id鍒犻櫎鎵煩閰嶇疆") - @ApiOperation(value = "鎵煩閰嶇疆绠$悊-鏍规嵁id鍒犻櫎鎵煩閰嶇疆",notes = "鎵煩閰嶇疆绠$悊-鏍规嵁id鍒犻櫎鎵煩閰嶇疆") + @ApiOperation(value = "鎵煩閰嶇疆绠$悊-鏍规嵁id鍒犻櫎鎵煩閰嶇疆", notes = "鎵煩閰嶇疆绠$悊-鏍规嵁id鍒犻櫎鎵煩閰嶇疆") @DeleteMapping("/deleteMdcTorqueConfig") - public Result<?> deleteMdcTorqueConfig(@RequestParam(name = "id",required = true) String id){ - boolean flag= mdcTorqueConfigService.deleteTorque(id); - return flag?Result.ok("鍒犻櫎鎴愬姛"):Result.error("鍒犻櫎澶辫触"); + public Result<?> deleteMdcTorqueConfig(@RequestParam(name = "id", required = true) String id) { + boolean flag = mdcTorqueConfigService.deleteTorque(id); + return flag ? Result.ok("鍒犻櫎鎴愬姛") : Result.error("鍒犻櫎澶辫触"); } /** * 鎵归噺鍒犻櫎 + * * @param ids * @return */ @AutoLog(value = "鎵煩閰嶇疆绠$悊-鎵归噺鍒犻櫎") - @ApiOperation(value = "鎵煩閰嶇疆绠$悊-鎵归噺鍒犻櫎",notes = "鎵煩閰嶇疆绠$悊-鎵归噺鍒犻櫎") + @ApiOperation(value = "鎵煩閰嶇疆绠$悊-鎵归噺鍒犻櫎", notes = "鎵煩閰嶇疆绠$悊-鎵归噺鍒犻櫎") @DeleteMapping("/deleteBatchMdcTorqueConfig") - public Result<?> deleteBatchMdcTorqueConfig(@RequestParam(name = "ids",required = true) String ids){ - boolean flag= mdcTorqueConfigService.deleteBatchTorque(ids); - return flag?Result.ok("鎵归噺鍒犻櫎鎴愬姛"):Result.error("鍒犻櫎澶辫触"); + public Result<?> deleteBatchMdcTorqueConfig(@RequestParam(name = "ids", required = true) String ids) { + boolean flag = mdcTorqueConfigService.deleteBatchTorque(ids); + return flag ? Result.ok("鎵归噺鍒犻櫎鎴愬姛") : Result.error("鍒犻櫎澶辫触"); } /** * 瀵煎嚭excel + * * @param request * @param mdcTorqueConfig * @return */ @RequestMapping("/exportXls") - public ModelAndView exportXls(HttpServletRequest request,MdcTorqueConfig mdcTorqueConfig){ - return super.exportXls(request,mdcTorqueConfig,MdcTorqueConfig.class,"鎵煩閰嶇疆绠$悊瀵煎嚭"); + public ModelAndView exportXls(HttpServletRequest request, MdcTorqueConfig mdcTorqueConfig) { + return super.exportXls(request, mdcTorqueConfig, MdcTorqueConfig.class, "鎵煩閰嶇疆绠$悊瀵煎嚭"); } /** * 瀵煎叆excel + * * @param request * @param response * @return */ @RequestMapping("/importExcel") - public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response){ - return super.importExcel(request,response,MdcTorqueConfig.class); + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, MdcTorqueConfig.class); } /** - *鏍规嵁鎵煩鍊肩敓鎴愪富杞磋繍琛屾洸绾� + * 鏍规嵁鎵煩鍊肩敓鎴愪富杞磋繍琛屾洸绾� + * * @param torqueValue * @return */ @AutoLog(value = "鎵煩閰嶇疆绠$悊-鏍规嵁鎵煩鍊肩敓鎴愪富杞磋繍琛屾洸绾�") - @ApiOperation(value = "鎵煩閰嶇疆绠$悊-鏍规嵁鎵煩鍊肩敓鎴愪富杞磋繍琛屾洸绾�",notes = "鎵煩閰嶇疆绠$悊-鏍规嵁鎵煩鍊肩敓鎴愪富杞磋繍琛屾洸绾�") + @ApiOperation(value = "鎵煩閰嶇疆绠$悊-鏍规嵁鎵煩鍊肩敓鎴愪富杞磋繍琛屾洸绾�", notes = "鎵煩閰嶇疆绠$悊-鏍规嵁鎵煩鍊肩敓鎴愪富杞磋繍琛屾洸绾�") @GetMapping("/findSpindleRunningCurve") - public Result<List<MdcTorqueConfig>> findSpindleRunningCurve(@RequestParam(name = "torqueValue",required=true) float torqueValue, - @RequestParam(name = "equipmentId",required = true) String equipmentId){ - List<MdcTorqueConfig> list= mdcTorqueConfigService.findSpindleRunningCurve(torqueValue, equipmentId); + public Result<List<MdcTorqueConfig>> findSpindleRunningCurve(@RequestParam(name = "torqueValue", required = true) float torqueValue, + @RequestParam(name = "equipmentId", required = true) String equipmentId) { + List<MdcTorqueConfig> list = mdcTorqueConfigService.findSpindleRunningCurve(torqueValue, equipmentId); return Result.ok(list); } + + /** + * 鍒嗛〉鏌ヨ + * @param mdcTorqueConfig + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "鎵煩閰嶇疆绠$悊-鍒嗛〉鏌ヨ") + @ApiOperation(value = "鎵煩閰嶇疆绠$悊-鍒嗛〉鏌ヨ",notes = "鎵煩閰嶇疆绠$悊-鍒嗛〉鏌ヨ") + @GetMapping("/queryWrapper") + public Result<?> queryWrapper(MdcTorqueConfig mdcTorqueConfig, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + Page<MdcTorqueConfig> page=new Page<>(pageNo,pageSize); + IPage<MdcTorqueConfig> mdcTorqueConfigIPage= mdcTorqueConfigService.queryPageList(page,req); + return Result.ok(mdcTorqueConfigIPage); + } } -- Gitblit v1.9.3