| | |
| | | package org.jeecg.modules.mdc.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | 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.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.mdc.dto.MdcDowntimeDto; |
| | | import org.jeecg.modules.mdc.entity.MdcDowntime; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentOvertime; |
| | | import org.jeecg.modules.mdc.service.IMdcDowntimeService; |
| | | import org.jeecg.modules.mdc.vo.MdcDowntimeVo; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @ApiOperation(value = "待机停机表-添加", notes = "待机停机表-添加") |
| | | @PostMapping(value = "/add") |
| | | public Result<?> add(@RequestBody MdcDowntime mdcDowntime) { |
| | | mdcDowntimeService.save(mdcDowntime); |
| | | return Result.OK("添加成功!"); |
| | | if (StringUtils.isBlank(mdcDowntime.getEquipmentIds())) { |
| | | return Result.error("未选择设备,请排查"); |
| | | } |
| | | boolean flag = mdcDowntimeService.saveDowntime(mdcDowntime); |
| | | return flag ? Result.ok("添加成功") : Result.error("添加失败"); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "待机停机表-编辑", notes = "待机停机表-编辑") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<?> edit(@RequestBody MdcDowntime mdcDowntime) { |
| | | if (mdcDowntime.getReasonId() != null) { |
| | | mdcDowntime.setStatus(CommonConstant.DOWNTIME_STATUS_1); |
| | | } |
| | | // if (mdcDowntime.getReasonId() != null) { |
| | | // mdcDowntime.setStatus(CommonConstant.DOWNTIME_STATUS_1); |
| | | // } |
| | | mdcDowntimeService.updateById(mdcDowntime); |
| | | return Result.OK("编辑成功!"); |
| | | } |