| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | 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.constant.CommonConstant; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.util.FileUtil; |
| | | import org.jeecg.modules.eam.constant.BusinessCodeConst; |
| | | import org.jeecg.modules.eam.constant.MaintenanceCategoryEnum; |
| | | import org.jeecg.modules.eam.constant.MaintenanceStandardStatusEnum; |
| | | import org.jeecg.modules.eam.dto.MaintenanceStandardImport; |
| | | import org.jeecg.modules.eam.dto.WeekMaintenanceStandardImport; |
| | | import org.jeecg.modules.eam.entity.EamEquipment; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 升版 |
| | | * |
| | | * @param standardRequest |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "保养标准-升版") |
| | | @ApiOperation(value = "保养标准-升版", notes = "保养标准-升版") |
| | | @RequestMapping(value = "/upgrade", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<?> upgrade(@RequestBody EamMaintenanceStandardRequest standardRequest) { |
| | | if (standardRequest == null) { |
| | | return Result.error("添加的对象不能为空!"); |
| | | } |
| | | if (CollectionUtil.isEmpty(standardRequest.getTableDetailList())) { |
| | | return Result.error("保养项不能为空!"); |
| | | } |
| | | String codeSeq = businessCodeRuleService.generateBusinessCodeSeq(BusinessCodeConst.MAINTENANCE_STANDARD_CODE_RULE); |
| | | standardRequest.setStandardCode(codeSeq); |
| | | boolean b = eamMaintenanceStandardService.upgradeMaintenanceStandard(standardRequest); |
| | | if (!b) { |
| | | return Result.error("升版失败!"); |
| | | } |
| | | return Result.OK("升版成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 查询标准列表-前端展示该用户拥有的标准 |
| | | * @param keyword 设备编号 |
| | | * @param maintenanceCategory 保养类型 |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "保养标准-查询标准列表-前端展示该用户拥有的标准") |
| | | @ApiOperation(value = "保养标准-查询标准列表-前端展示该用户拥有的标准", notes = "保养标准-查询标准列表-前端展示该用户拥有的标准") |
| | | @GetMapping(value = "/listByUser") |
| | | public Result<?> listByUser(@RequestParam(name = "keyword", required = false) String keyword, |
| | | @RequestParam(name = "maintenanceCategory", required = false) String maintenanceCategory) { |
| | | List<EamMaintenanceStandard> list = eamMaintenanceStandardService.queryListBykeywordAndCategory(keyword, maintenanceCategory); |
| | | return Result.OK(list); |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * |
| | | * @param id |
| | |
| | | } |
| | | |
| | | /** |
| | | * 通过id作废 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "保养标准-作废") |
| | | @ApiOperation(value = "保养标准-作废", notes = "保养标准-作废") |
| | | @DeleteMapping(value = "/abolish") |
| | | public Result<?> abolish(@RequestParam(name = "id", required = true) String id) { |
| | | EamMaintenanceStandard entity = eamMaintenanceStandardService.getById(id); |
| | | if (entity != null) { |
| | | entity.setStandardStatus(MaintenanceStandardStatusEnum.ABOLISH.name()); |
| | | eamMaintenanceStandardService.updateById(entity); |
| | | } |
| | | return Result.OK("作废成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |