feat:1.完成关键件页面相关基础接口 2.完成维修项目页面相关基础接口 3.修改维修单页面相关接口
parent
43ae36a62f
commit
7342debc26
@ -0,0 +1,101 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.criticalcomponent;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.criticalcomponent.vo.*;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.criticalcomponent.CriticalComponentDO;
|
||||
import cn.iocoder.yudao.module.mes.service.criticalcomponent.CriticalComponentService;
|
||||
|
||||
@Tag(name = "管理后台 - 设备关键件")
|
||||
@RestController
|
||||
@RequestMapping("/mes/critical-component")
|
||||
@Validated
|
||||
public class CriticalComponentController {
|
||||
|
||||
@Resource
|
||||
private CriticalComponentService criticalComponentService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建设备关键件")
|
||||
@PreAuthorize("@ss.hasPermission('mes:critical-component:create')")
|
||||
public CommonResult<Long> createCriticalComponent(@Valid @RequestBody CriticalComponentSaveReqVO createReqVO) {
|
||||
return success(criticalComponentService.createCriticalComponent(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新设备关键件")
|
||||
@PreAuthorize("@ss.hasPermission('mes:critical-component:update')")
|
||||
public CommonResult<Boolean> updateCriticalComponent(@Valid @RequestBody CriticalComponentSaveReqVO updateReqVO) {
|
||||
criticalComponentService.updateCriticalComponent(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除设备关键件")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('mes:critical-component:delete')")
|
||||
public CommonResult<Boolean> deleteCriticalComponent(@RequestParam("ids") String ids) {
|
||||
// 将逗号分隔的字符串转换为Long类型的List
|
||||
List<Long> idList = Arrays.stream(ids.split(","))
|
||||
.map(String::trim) // 去除可能存在的空格
|
||||
.map(Long::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
criticalComponentService.deleteCriticalComponent(idList);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得设备关键件")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('mes:critical-component:query')")
|
||||
public CommonResult<CriticalComponentRespVO> getCriticalComponent(@RequestParam("id") Long id) {
|
||||
CriticalComponentDO criticalComponent = criticalComponentService.getCriticalComponent(id);
|
||||
return success(BeanUtils.toBean(criticalComponent, CriticalComponentRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得设备关键件分页")
|
||||
@PreAuthorize("@ss.hasPermission('mes:critical-component:query')")
|
||||
public CommonResult<PageResult<CriticalComponentRespVO>> getCriticalComponentPage(@Valid CriticalComponentPageReqVO pageReqVO) {
|
||||
PageResult<CriticalComponentDO> pageResult = criticalComponentService.getCriticalComponentPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, CriticalComponentRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出设备关键件 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('mes:critical-component:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportCriticalComponentExcel(@Valid CriticalComponentPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<CriticalComponentDO> list = criticalComponentService.getCriticalComponentPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "设备关键件.xls", "数据", CriticalComponentRespVO.class,
|
||||
BeanUtils.toBean(list, CriticalComponentRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.criticalcomponent.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 设备关键件分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CriticalComponentPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "编码(唯一标识)")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "描述", example = "你说的对")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "id集合导出用")
|
||||
private String ids;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.criticalcomponent.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 设备关键件 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class CriticalComponentRespVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14503")
|
||||
@ExcelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "编码(唯一标识)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("编码(唯一标识)")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "描述", example = "你说的对")
|
||||
@ExcelProperty("描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.criticalcomponent.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 设备关键件新增/修改 Request VO")
|
||||
@Data
|
||||
public class CriticalComponentSaveReqVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14503")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "编码(唯一标识)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "编码(唯一标识)不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotEmpty(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "描述", example = "你说的对")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.dvrepair.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 单据状态枚举
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum MoldRecordStatusEnum {
|
||||
|
||||
PENDING(0, "待完成"),
|
||||
COMPLETED(1, "已完成"),
|
||||
// 可以根据需要添加其他状态
|
||||
CANCELED(2, "已取消");
|
||||
|
||||
@JsonValue
|
||||
private final Integer code;
|
||||
private final String name;
|
||||
|
||||
@JsonCreator
|
||||
public static MoldRecordStatusEnum getByCode(Integer code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (MoldRecordStatusEnum status : MoldRecordStatusEnum.values()) {
|
||||
if (status.getCode().equals(code)) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,120 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.repairtems;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.repairtems.vo.*;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.repairtems.RepairTemsDO;
|
||||
import cn.iocoder.yudao.module.mes.service.repairtems.RepairTemsService;
|
||||
|
||||
@Tag(name = "管理后台 - 维修项目")
|
||||
@RestController
|
||||
@RequestMapping("/mes/repair-tems")
|
||||
@Validated
|
||||
public class RepairTemsController {
|
||||
|
||||
@Resource
|
||||
private RepairTemsService repairTemsService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建维修项目")
|
||||
@PreAuthorize("@ss.hasPermission('mes:repair-tems:create')")
|
||||
public CommonResult<Long> createRepairTems(@Valid @RequestBody RepairTemsSaveReqVO createReqVO) {
|
||||
return success(repairTemsService.createRepairTems(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新维修项目")
|
||||
@PreAuthorize("@ss.hasPermission('mes:repair-tems:update')")
|
||||
public CommonResult<Boolean> updateRepairTems(@Valid @RequestBody RepairTemsSaveReqVO updateReqVO) {
|
||||
repairTemsService.updateRepairTems(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除维修项目")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('mes:repair-tems:delete')")
|
||||
public CommonResult<Boolean> deleteRepairTems(@RequestParam("ids") String ids) {
|
||||
List<Long> idList = Arrays.stream(ids.split(","))
|
||||
.map(String::trim) // 去除可能存在的空格
|
||||
.map(Long::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
repairTemsService.deleteRepairTems(idList);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得维修项目")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('mes:repair-tems:query')")
|
||||
public CommonResult<RepairTemsRespVO> getRepairTems(@RequestParam("id") Long id) {
|
||||
RepairTemsDO repairTems = repairTemsService.getRepairTems(id);
|
||||
return success(BeanUtils.toBean(repairTems, RepairTemsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得维修项目分页")
|
||||
@PreAuthorize("@ss.hasPermission('mes:repair-tems:query')")
|
||||
public CommonResult<PageResult<RepairTemsRespVO>> getRepairTemsPage(@Valid RepairTemsPageReqVO pageReqVO) {
|
||||
PageResult<RepairTemsRespVO> pageResult = repairTemsService.getRepairTemsPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出维修项目 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('mes:repair-tems:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportRepairTemsExcel(@Valid RepairTemsPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<RepairTemsRespVO> list = repairTemsService.getRepairTemsPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "维修项目.xls", "数据", RepairTemsRespVO.class,list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/getDeviceOrComponent")
|
||||
@Operation(summary = "获得设备/关键件")
|
||||
@Parameter(name = "deviceType", description = "deviceType 1-设备 2-关键件", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('mes:repair-tems:query')")
|
||||
public CommonResult<List<RepairTemsRespVO>> getDeviceOrComponent(@RequestParam("deviceType") Integer deviceType) {
|
||||
return success( repairTemsService.getDeviceOrComponent(deviceType));
|
||||
}
|
||||
|
||||
@GetMapping("/getDeviceOrComponentList")
|
||||
@Operation(summary = "获得设备/关键件列表")
|
||||
@Parameter(name = "deviceType", description = "deviceType 1-设备 2-关键件", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('mes:repair-tems:query')")
|
||||
public CommonResult<List<RepairTemsRespVO>> getDeviceOrComponentList(
|
||||
@Parameter(name = "deviceId", description = "设备Id", required = true, example = "123")
|
||||
@RequestParam("deviceId") Long deviceId,
|
||||
@Parameter(name = "componentId", description = "关键件Id", required = true, example = "123")
|
||||
@RequestParam("componentId") Long componentId) {
|
||||
return success(repairTemsService.getDeviceOrComponentList(deviceId,componentId));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.repairtems.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 维修项目分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class RepairTemsPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "项目编码")
|
||||
private String subjectCode;
|
||||
|
||||
@Schema(description = "项目名称", example = "芋艿")
|
||||
private String subjectName;
|
||||
|
||||
@Schema(description = "设备类型", example = "1")
|
||||
private Integer deviceType;
|
||||
|
||||
@Schema(description = "设备id", example = "11632")
|
||||
private Long deviceId;
|
||||
|
||||
@Schema(description = "关键件id", example = "29557")
|
||||
private Long componentId;
|
||||
|
||||
@Schema(description = "检验方式")
|
||||
private String inspectionMethod;
|
||||
|
||||
@Schema(description = "值类型", example = "1")
|
||||
private String valueType;
|
||||
|
||||
@Schema(description = "判定基准")
|
||||
private String judgmentCriteria;
|
||||
|
||||
@Schema(description = "是否启用")
|
||||
private Boolean isEnable;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "项目内容")
|
||||
private String projectContent;
|
||||
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.repairtems.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 维修项目 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class RepairTemsRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15428")
|
||||
// @ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "项目编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("项目编码")
|
||||
private String subjectCode;
|
||||
|
||||
@Schema(description = "项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@ExcelProperty("项目名称")
|
||||
private String subjectName;
|
||||
|
||||
@Schema(description = "设备类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("设备类型")
|
||||
private Integer deviceType;
|
||||
|
||||
@Schema(description = "设备id", example = "11632")
|
||||
@ExcelProperty("设备id")
|
||||
private Long deviceId;
|
||||
|
||||
@Schema(description = "关键件id", example = "29557")
|
||||
@ExcelProperty("关键件id")
|
||||
private Long componentId;
|
||||
|
||||
@Schema(description = "检验方式")
|
||||
@ExcelProperty("检验方式")
|
||||
private String inspectionMethod;
|
||||
|
||||
@Schema(description = "值类型", example = "1")
|
||||
@ExcelProperty("值类型")
|
||||
private String valueType;
|
||||
|
||||
@Schema(description = "判定基准")
|
||||
@ExcelProperty("判定基准")
|
||||
private String judgmentCriteria;
|
||||
|
||||
@Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否启用")
|
||||
private Boolean isEnable;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "设备名称")
|
||||
@ExcelProperty("设备名称")
|
||||
private String deviceName;
|
||||
|
||||
|
||||
@Schema(description = "关键件名称")
|
||||
@ExcelProperty("关键件名称")
|
||||
private String componentName;
|
||||
|
||||
@Schema(description = "创建人名称")
|
||||
@ExcelProperty("创建人名称")
|
||||
private String creatroName;
|
||||
|
||||
@Schema(description = "项目内容")
|
||||
@ExcelProperty("项目内容")
|
||||
private String projectContent;
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.repairtems.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 维修项目新增/修改 Request VO")
|
||||
@Data
|
||||
public class RepairTemsSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15428")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "项目编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "项目编码不能为空")
|
||||
private String subjectCode;
|
||||
|
||||
@Schema(description = "项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "项目名称不能为空")
|
||||
private String subjectName;
|
||||
|
||||
@Schema(description = "设备类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "设备类型不能为空")
|
||||
private Boolean deviceType;
|
||||
|
||||
@Schema(description = "设备id", example = "11632")
|
||||
private Long deviceId;
|
||||
|
||||
@Schema(description = "关键件id", example = "29557")
|
||||
private Long componentId;
|
||||
|
||||
@Schema(description = "检验方式")
|
||||
private String inspectionMethod;
|
||||
|
||||
@Schema(description = "值类型", example = "1")
|
||||
private String valueType;
|
||||
|
||||
@Schema(description = "判定基准")
|
||||
private String judgmentCriteria;
|
||||
|
||||
@Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否启用不能为空")
|
||||
private Boolean isEnable;
|
||||
|
||||
@Schema(description = "设备名称")
|
||||
@ExcelProperty("设备名称")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "关键件名称")
|
||||
@ExcelProperty("关键件名称")
|
||||
private String componentName;
|
||||
|
||||
@Schema(description = "创建人名称")
|
||||
@ExcelProperty("创建人名称")
|
||||
private String creatroName;
|
||||
|
||||
@Schema(description = "项目内容")
|
||||
@ExcelProperty("项目内容")
|
||||
private String projectContent;
|
||||
}
|
||||
@ -0,0 +1,87 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.ticketmanagement.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 计划类型枚举
|
||||
* 1-点检 2-保养
|
||||
*/
|
||||
@Getter
|
||||
public enum PlanTypeEnum {
|
||||
|
||||
INSPECTION(1, "点检"),
|
||||
MAINTENANCE(2, "保养");
|
||||
|
||||
private final Integer code;
|
||||
private final String description;
|
||||
|
||||
PlanTypeEnum(Integer code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据code获取枚举
|
||||
*/
|
||||
public static PlanTypeEnum getByCode(Integer code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (PlanTypeEnum type : values()) {
|
||||
if (type.getCode().equals(code)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据code获取描述
|
||||
*/
|
||||
public static String getDescriptionByCode(Integer code) {
|
||||
PlanTypeEnum type = getByCode(code);
|
||||
return type != null ? type.getDescription() : "未知";
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查code是否有效
|
||||
*/
|
||||
public static boolean isValidCode(Integer code) {
|
||||
return getByCode(code) != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有code列表
|
||||
*/
|
||||
public static List<Integer> getAllCodes() {
|
||||
return Arrays.stream(values())
|
||||
.map(PlanTypeEnum::getCode)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有描述列表
|
||||
*/
|
||||
public static List<String> getAllDescriptions() {
|
||||
return Arrays.stream(values())
|
||||
.map(PlanTypeEnum::getDescription)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取code和描述的映射
|
||||
*/
|
||||
public static Map<Integer, String> getCodeDescriptionMap() {
|
||||
Map<Integer, String> map = new LinkedHashMap<>();
|
||||
for (PlanTypeEnum type : values()) {
|
||||
map.put(type.getCode(), type.getDescription());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.dataobject.repairtems;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 维修项目 DO
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@TableName("mes_repair_tems")
|
||||
@KeySequence("mes_repair_tems_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RepairTemsDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 项目编码
|
||||
*/
|
||||
private String subjectCode;
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
private String subjectName;
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
private Integer deviceType;
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
private Long deviceId;
|
||||
/**
|
||||
* 关键件id
|
||||
*/
|
||||
private Long componentId;
|
||||
/**
|
||||
* 检验方式
|
||||
*/
|
||||
private String inspectionMethod;
|
||||
/**
|
||||
* 值类型
|
||||
*/
|
||||
private String valueType;
|
||||
/**
|
||||
* 判定基准
|
||||
*/
|
||||
private String judgmentCriteria;
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private Boolean isEnable;
|
||||
/**
|
||||
* 项目内容
|
||||
*/
|
||||
private String projectContent;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.mysql.criticalcomponent;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.criticalcomponent.CriticalComponentDO;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.deviceledger.DeviceLedgerDO;
|
||||
import com.alibaba.excel.util.StringUtils;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.criticalcomponent.vo.*;
|
||||
|
||||
/**
|
||||
* 设备关键件 Mapper
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Mapper
|
||||
public interface CriticalComponentMapper extends BaseMapperX<CriticalComponentDO> {
|
||||
|
||||
default PageResult<CriticalComponentDO> selectPage(CriticalComponentPageReqVO reqVO) {
|
||||
|
||||
LambdaQueryWrapperX<CriticalComponentDO> criticalComponentDOLambdaQueryWrapperX = new LambdaQueryWrapperX<>();
|
||||
criticalComponentDOLambdaQueryWrapperX
|
||||
.eqIfPresent(CriticalComponentDO::getCode, reqVO.getCode())
|
||||
.likeIfPresent(CriticalComponentDO::getName, reqVO.getName())
|
||||
.eqIfPresent(CriticalComponentDO::getDescription, reqVO.getDescription())
|
||||
.eqIfPresent(CriticalComponentDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(CriticalComponentDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(CriticalComponentDO::getCreateTime);
|
||||
|
||||
// 单独处理 ids 条件
|
||||
if (StringUtils.isNotBlank(reqVO.getIds())) {
|
||||
List<Long> idList = Arrays.stream(reqVO.getIds().split(","))
|
||||
.map(String::trim)
|
||||
.map(Long::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
criticalComponentDOLambdaQueryWrapperX.in(CriticalComponentDO::getId, idList);
|
||||
}
|
||||
|
||||
return selectPage(reqVO, criticalComponentDOLambdaQueryWrapperX);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.mysql.repairtems;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.repairtems.RepairTemsDO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.repairtems.vo.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 维修项目 Mapper
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Mapper
|
||||
public interface RepairTemsMapper extends BaseMapperX<RepairTemsDO> {
|
||||
|
||||
default PageResult<RepairTemsDO> selectPage(RepairTemsPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<RepairTemsDO>()
|
||||
.eqIfPresent(RepairTemsDO::getSubjectCode, reqVO.getSubjectCode())
|
||||
.likeIfPresent(RepairTemsDO::getSubjectName, reqVO.getSubjectName())
|
||||
.eqIfPresent(RepairTemsDO::getDeviceType, reqVO.getDeviceType())
|
||||
.eqIfPresent(RepairTemsDO::getDeviceId, reqVO.getDeviceId())
|
||||
.eqIfPresent(RepairTemsDO::getComponentId, reqVO.getComponentId())
|
||||
.eqIfPresent(RepairTemsDO::getInspectionMethod, reqVO.getInspectionMethod())
|
||||
.eqIfPresent(RepairTemsDO::getValueType, reqVO.getValueType())
|
||||
.eqIfPresent(RepairTemsDO::getJudgmentCriteria, reqVO.getJudgmentCriteria())
|
||||
.eqIfPresent(RepairTemsDO::getIsEnable, reqVO.getIsEnable())
|
||||
.betweenIfPresent(RepairTemsDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(RepairTemsDO::getId));
|
||||
}
|
||||
|
||||
IPage<RepairTemsRespVO> getRepairTemsPage(Page<RepairTemsRespVO> page, @Param("pageReqVO") RepairTemsPageReqVO pageReqVO);
|
||||
|
||||
List<RepairTemsRespVO> getRepairTemsList( @Param("pageReqVO") RepairTemsPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.mes.service.criticalcomponent;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.criticalcomponent.vo.*;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.criticalcomponent.CriticalComponentDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 设备关键件 Service 接口
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
public interface CriticalComponentService {
|
||||
|
||||
/**
|
||||
* 创建设备关键件
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createCriticalComponent(@Valid CriticalComponentSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新设备关键件
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateCriticalComponent(@Valid CriticalComponentSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除设备关键件
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteCriticalComponent(List<Long> idList);
|
||||
|
||||
/**
|
||||
* 获得设备关键件
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 设备关键件
|
||||
*/
|
||||
CriticalComponentDO getCriticalComponent(Long id);
|
||||
|
||||
/**
|
||||
* 获得设备关键件分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 设备关键件分页
|
||||
*/
|
||||
PageResult<CriticalComponentDO> getCriticalComponentPage(CriticalComponentPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
package cn.iocoder.yudao.module.mes.service.criticalcomponent;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.criticalcomponent.vo.*;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.criticalcomponent.CriticalComponentDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.mes.dal.mysql.criticalcomponent.CriticalComponentMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 设备关键件 Service 实现类
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class CriticalComponentServiceImpl implements CriticalComponentService {
|
||||
|
||||
@Resource
|
||||
private CriticalComponentMapper criticalComponentMapper;
|
||||
|
||||
@Override
|
||||
public Long createCriticalComponent(CriticalComponentSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
CriticalComponentDO criticalComponent = BeanUtils.toBean(createReqVO, CriticalComponentDO.class);
|
||||
criticalComponentMapper.insert(criticalComponent);
|
||||
// 返回
|
||||
return criticalComponent.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCriticalComponent(CriticalComponentSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateCriticalComponentExists(updateReqVO.getId());
|
||||
// 更新
|
||||
CriticalComponentDO updateObj = BeanUtils.toBean(updateReqVO, CriticalComponentDO.class);
|
||||
criticalComponentMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteCriticalComponent(List<Long> idList) {
|
||||
for (Long id : idList) {
|
||||
// 校验存在
|
||||
validateCriticalComponentExists(id);
|
||||
}
|
||||
|
||||
// 删除
|
||||
criticalComponentMapper.deleteByIds(idList);
|
||||
}
|
||||
|
||||
private void validateCriticalComponentExists(Long id) {
|
||||
if (criticalComponentMapper.selectById(id) == null) {
|
||||
throw exception(CRITICAL_COMPONENT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CriticalComponentDO getCriticalComponent(Long id) {
|
||||
return criticalComponentMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<CriticalComponentDO> getCriticalComponentPage(CriticalComponentPageReqVO pageReqVO) {
|
||||
return criticalComponentMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package cn.iocoder.yudao.module.mes.service.repairtems;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.repairtems.vo.*;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.repairtems.RepairTemsDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 维修项目 Service 接口
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
public interface RepairTemsService {
|
||||
|
||||
/**
|
||||
* 创建维修项目
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createRepairTems(@Valid RepairTemsSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新维修项目
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateRepairTems(@Valid RepairTemsSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除维修项目
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteRepairTems( List<Long> idList);
|
||||
|
||||
/**
|
||||
* 获得维修项目
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 维修项目
|
||||
*/
|
||||
RepairTemsDO getRepairTems(Long id);
|
||||
|
||||
/**
|
||||
* 获得维修项目分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 维修项目分页
|
||||
*/
|
||||
PageResult<RepairTemsRespVO> getRepairTemsPage(RepairTemsPageReqVO pageReqVO);
|
||||
|
||||
List<RepairTemsRespVO> getDeviceOrComponent(Integer deviceType);
|
||||
|
||||
List<RepairTemsRespVO> getDeviceOrComponentList(Long deviceId, Long componentId);
|
||||
}
|
||||
@ -0,0 +1,93 @@
|
||||
package cn.iocoder.yudao.module.mes.service.repairtems;
|
||||
|
||||
import cn.iocoder.yudao.module.iot.controller.admin.device.vo.LineDeviceRespVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.repairtems.vo.*;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.repairtems.RepairTemsDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.mes.dal.mysql.repairtems.RepairTemsMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 维修项目 Service 实现类
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class RepairTemsServiceImpl implements RepairTemsService {
|
||||
|
||||
@Resource
|
||||
private RepairTemsMapper repairTemsMapper;
|
||||
|
||||
@Override
|
||||
public Long createRepairTems(RepairTemsSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
RepairTemsDO repairTems = BeanUtils.toBean(createReqVO, RepairTemsDO.class);
|
||||
repairTemsMapper.insert(repairTems);
|
||||
// 返回
|
||||
return repairTems.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRepairTems(RepairTemsSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateRepairTemsExists(updateReqVO.getId());
|
||||
// 更新
|
||||
RepairTemsDO updateObj = BeanUtils.toBean(updateReqVO, RepairTemsDO.class);
|
||||
repairTemsMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRepairTems( List<Long> idList) {
|
||||
for (Long id : idList) {
|
||||
// 校验存在
|
||||
validateRepairTemsExists(id);
|
||||
}
|
||||
|
||||
// 删除
|
||||
repairTemsMapper.deleteByIds(idList);
|
||||
}
|
||||
|
||||
private void validateRepairTemsExists(Long id) {
|
||||
if (repairTemsMapper.selectById(id) == null) {
|
||||
throw exception(REPAIR_TEMS_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RepairTemsDO getRepairTems(Long id) {
|
||||
return repairTemsMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<RepairTemsRespVO> getRepairTemsPage(RepairTemsPageReqVO pageReqVO) {
|
||||
Page<RepairTemsRespVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
IPage<RepairTemsRespVO> repairTemsDOIPage = repairTemsMapper.getRepairTemsPage(page,pageReqVO);
|
||||
PageResult<RepairTemsRespVO> repairTemsDOPageResult = new PageResult<>(repairTemsDOIPage.getRecords(), repairTemsDOIPage.getTotal());
|
||||
return repairTemsDOPageResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RepairTemsRespVO> getDeviceOrComponent(Integer deviceType) {
|
||||
return repairTemsMapper.getRepairTemsList(new RepairTemsPageReqVO().setDeviceType(deviceType));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RepairTemsRespVO> getDeviceOrComponentList(Long deviceId, Long componentId) {
|
||||
return repairTemsMapper.getRepairTemsList(new RepairTemsPageReqVO().setDeviceId(deviceId).setComponentId(componentId));
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue