| | |
| | | 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.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | 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.entity.MdcEquipmentOvertime; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentOvertimeService; |
| | |
| | | @ApiOperation(value = "设备加班管理-添加", notes = "设备加班管理-添加") |
| | | @PostMapping(value = "/add") |
| | | public Result<?> add(@RequestBody MdcEquipmentOvertime mdcEquipmentOvertime) { |
| | | mdcEquipmentOvertimeService.save(mdcEquipmentOvertime); |
| | | if (org.apache.commons.lang3.StringUtils.isBlank(mdcEquipmentOvertime.getEquipmentId())) { |
| | | return Result.error("未选择设备,请排查!"); |
| | | } |
| | | boolean result = mdcEquipmentOvertimeService.addOvertime(mdcEquipmentOvertime); |
| | | if (!result) { |
| | | return Result.error("添加失败!"); |
| | | } |
| | | return Result.OK("添加成功!"); |
| | | } |
| | | |
| | |
| | | */ |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, MdcEquipmentOvertime mdcEquipmentOvertime) { |
| | | return super.exportXls(request, mdcEquipmentOvertime, MdcEquipmentOvertime.class, "设备加班管理"); |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = user.getId(); |
| | | return mdcEquipmentOvertimeService.exportXls(userId, mdcEquipmentOvertime); |
| | | } |
| | | |
| | | /** |