| | |
| | | package org.jeecg.modules.mdc.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.mdc.entity.MdcTorqueConfig; |
| | | import org.jeecg.modules.mdc.service.IMdcTorqueConfigService; |
| | | import org.jeecg.modules.mdc.service.impl.MdcTorqueConfigServiceImpl; |
| | | import org.jeecg.modules.mdc.vo.MdcTorqueConfigVo; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | |
| | | |
| | | /** |
| | | * 根据id查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param mdcTorqueConfig |
| | | * 扭矩配置管理-新增 |
| | | * |
| | | * @param torqueVo |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "扭矩配置管理-新增") |
| | | @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 MdcTorqueConfigVo torqueVo) { |
| | | if (StringUtils.isBlank(torqueVo.getEquipmentIds())) { |
| | | return Result.error("未选择设备,请排查"); |
| | | } |
| | | boolean result = mdcTorqueConfigService.addTorque(torqueVo); |
| | | if (!result) { |
| | | return Result.error("时间段数据已存在,请排查"); |
| | | } |
| | | return Result.OK("新增成功"); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * |
| | | * @param mdcTorqueConfig |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据id删除扭矩配置 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 导出excel |
| | | * |
| | | * @param request |
| | | * @param mdcTorqueConfig |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "扭矩配置管理-导出") |
| | | @ApiOperation(value = "扭矩配置管理-导出",notes = "扭矩配置管理-导出") |
| | | @ApiOperation(value = "扭矩配置管理-导出", notes = "扭矩配置管理-导出") |
| | | @RequestMapping("/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, MdcTorqueConfig mdcTorqueConfig) { |
| | | return super.exportXls(request, mdcTorqueConfig, MdcTorqueConfig.class, "扭矩配置管理导出"); |
| | |
| | | |
| | | /** |
| | | * 导入excel |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "扭矩配置管理-导入") |
| | | @ApiOperation(value = "扭矩配置管理-导入",notes = "扭矩配置管理-导入") |
| | | @ApiOperation(value = "扭矩配置管理-导入", notes = "扭矩配置管理-导入") |
| | | @RequestMapping("/importExcel") |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, MdcTorqueConfig.class); |
| | |
| | | |
| | | /** |
| | | * 根据扭矩值生成主轴运行曲线 |
| | | * |
| | | * @param torqueValue |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param mdcTorqueConfig |
| | | * @param pageNo |
| | | * @param pageSize |