| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | 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.modules.eam.constant.BusinessCodeConst; |
| | | import org.jeecg.modules.eam.constant.TechnicalStatusEvaluationStandardEnum; |
| | | import org.jeecg.modules.eam.entity.EamMaintenanceStandard; |
| | | import org.jeecg.modules.eam.entity.EamTechnicalStatusEvaluationStandard; |
| | | import org.jeecg.modules.eam.request.EamTechnicalStatusEvaluationStandardRequest; |
| | | import org.jeecg.modules.eam.service.IEamTechnicalStatusEvaluationStandardService; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * @Description: 技术状态鉴定规范 |
| | |
| | | if (CollectionUtil.isEmpty(request.getTableDetailList())) { |
| | | return Result.error("检查项不能为空!"); |
| | | } |
| | | String codeSeq = businessCodeRuleService.generateBusinessCodeSeq(BusinessCodeConst.MAINTENANCE_STANDARD_CODE_RULE); |
| | | String codeSeq = businessCodeRuleService.generateBusinessCodeSeq(BusinessCodeConst.TECHNICAL_STATUS_EVALUATION_STANDARD_CODE_RULE); |
| | | request.setStandardCode(codeSeq); |
| | | boolean b = eamTechnicalStatusEvaluationStandardService.addEamTechnicalStatusEvaluationStandard(request); |
| | | if (!b) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * 升版 |
| | | * |
| | | * @param id |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "技术状态鉴定规范-通过id删除") |
| | | @ApiOperation(value = "技术状态鉴定规范-通过id删除", notes = "技术状态鉴定规范-通过id删除") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<?> delete(@RequestParam(name = "id", required = true) String id) { |
| | | eamTechnicalStatusEvaluationStandardService.removeById(id); |
| | | return Result.OK("删除成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "技术状态鉴定规范-批量删除") |
| | | @ApiOperation(value = "技术状态鉴定规范-批量删除", notes = "技术状态鉴定规范-批量删除") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | this.eamTechnicalStatusEvaluationStandardService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("批量删除成功!"); |
| | | @AutoLog(value = "技术状态鉴定规范-升版") |
| | | @ApiOperation(value = "技术状态鉴定规范-升版", notes = "技术状态鉴定规范-升版") |
| | | @PutMapping(value = "/upgrade") |
| | | public Result<?> upgrade(@RequestBody EamTechnicalStatusEvaluationStandardRequest request) { |
| | | if (request == null) { |
| | | return Result.error("添加的对象不能为空!"); |
| | | } |
| | | if (CollectionUtil.isEmpty(request.getTableDetailList())) { |
| | | return Result.error("保养项不能为空!"); |
| | | } |
| | | String codeSeq = businessCodeRuleService.generateBusinessCodeSeq(BusinessCodeConst.TECHNICAL_STATUS_EVALUATION_STANDARD_CODE_RULE); |
| | | request.setStandardCode(codeSeq); |
| | | boolean b = eamTechnicalStatusEvaluationStandardService.upgrade(request); |
| | | if (!b) { |
| | | return Result.error("升版失败!"); |
| | | } |
| | | return Result.OK("升版成功!"); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 提交 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "技术状态鉴定规范-提交") |
| | | @ApiOperation(value = "技术状态鉴定规范-提交", notes = "技术状态鉴定规范-提交") |
| | | @GetMapping(value = "/submit") |
| | | public Result<?> submit(@RequestParam(name = "id", required = true) String id) { |
| | | EamTechnicalStatusEvaluationStandard entity = eamTechnicalStatusEvaluationStandardService.getById(id); |
| | | if (entity != null) { |
| | | entity.setStandardStatus(TechnicalStatusEvaluationStandardEnum.ENABLE.name()); |
| | | eamTechnicalStatusEvaluationStandardService.updateById(entity); |
| | | } |
| | | return Result.OK("删除成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 通过excel导入数据 |
| | | * |
| | | * @param request |