| | |
| | | package org.jeecg.modules.mdc.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | 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.vo.MdcTorqueConfigVo; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | |
| | | /** |
| | | * 扭矩配置管理-新增 |
| | | * |
| | | * @param torqueVo |
| | | * @param mdcTorqueConfig |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "扭矩配置管理-新增") |
| | | @ApiOperation(value = "扭矩配置管理-新增", notes = "扭矩配置管理-新增") |
| | | @PostMapping("/addMdcTorqueConfig") |
| | | public Result addMdcTorqueConfig(@RequestBody MdcTorqueConfigVo torqueVo) { |
| | | if (StringUtils.isBlank(torqueVo.getEquipmentIds())) { |
| | | public Result addMdcTorqueConfig(@RequestBody MdcTorqueConfig mdcTorqueConfig) { |
| | | if (StringUtils.isBlank(mdcTorqueConfig.getEquipmentIds())) { |
| | | return Result.error("未选择设备,请排查"); |
| | | } |
| | | boolean result = mdcTorqueConfigService.addTorque(torqueVo); |
| | | boolean result = mdcTorqueConfigService.addTorque(mdcTorqueConfig); |
| | | if (!result) { |
| | | return Result.error("时间段数据已存在,请排查"); |
| | | } |
| | |
| | | @ApiOperation(value = "扭矩配置管理-导出", notes = "扭矩配置管理-导出") |
| | | @RequestMapping("/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, MdcTorqueConfig mdcTorqueConfig) { |
| | | return super.exportXls(request, mdcTorqueConfig, MdcTorqueConfig.class, "扭矩配置管理导出"); |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = user.getId(); |
| | | return this.mdcTorqueConfigService.exportXls(userId, mdcTorqueConfig); |
| | | } |
| | | |
| | | /** |