diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/controller/EqpEquipmentChecklistController.java b/klp-mes/src/main/java/com/klp/mes/eqp/controller/EqpEquipmentChecklistController.java new file mode 100644 index 00000000..f6828641 --- /dev/null +++ b/klp-mes/src/main/java/com/klp/mes/eqp/controller/EqpEquipmentChecklistController.java @@ -0,0 +1,99 @@ +package com.klp.mes.eqp.controller; + +import java.util.List; +import java.util.Arrays; + +import lombok.RequiredArgsConstructor; +import javax.servlet.http.HttpServletResponse; +import javax.validation.constraints.*; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import com.klp.common.annotation.RepeatSubmit; +import com.klp.common.annotation.Log; +import com.klp.common.core.controller.BaseController; +import com.klp.common.core.domain.PageQuery; +import com.klp.common.core.domain.R; +import com.klp.common.core.validate.AddGroup; +import com.klp.common.core.validate.EditGroup; +import com.klp.common.enums.BusinessType; +import com.klp.common.utils.poi.ExcelUtil; +import com.klp.mes.eqp.domain.vo.EqpEquipmentChecklistVo; +import com.klp.mes.eqp.domain.bo.EqpEquipmentChecklistBo; +import com.klp.mes.eqp.service.IEqpEquipmentChecklistService; +import com.klp.common.core.page.TableDataInfo; + +/** + * 设备检验清单 + * + * @author klp + * @date 2026-05-21 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/eqp/equipmentChecklist") +public class EqpEquipmentChecklistController extends BaseController { + + private final IEqpEquipmentChecklistService iEqpEquipmentChecklistService; + + /** + * 查询设备检验清单列表 + */ + @GetMapping("/list") + public TableDataInfo list(EqpEquipmentChecklistBo bo, PageQuery pageQuery) { + return iEqpEquipmentChecklistService.queryPageList(bo, pageQuery); + } + + /** + * 导出设备检验清单列表 + */ + @Log(title = "设备检验清单", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(EqpEquipmentChecklistBo bo, HttpServletResponse response) { + List list = iEqpEquipmentChecklistService.queryList(bo); + ExcelUtil.exportExcel(list, "设备检验清单", EqpEquipmentChecklistVo.class, response); + } + + /** + * 获取设备检验清单详细信息 + * + * @param checkId 主键 + */ + @GetMapping("/{checkId}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long checkId) { + return R.ok(iEqpEquipmentChecklistService.queryById(checkId)); + } + + /** + * 新增设备检验清单 + */ + @Log(title = "设备检验清单", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody EqpEquipmentChecklistBo bo) { + return toAjax(iEqpEquipmentChecklistService.insertByBo(bo)); + } + + /** + * 修改设备检验清单 + */ + @Log(title = "设备检验清单", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody EqpEquipmentChecklistBo bo) { + return toAjax(iEqpEquipmentChecklistService.updateByBo(bo)); + } + + /** + * 删除设备检验清单 + * + * @param checkIds 主键串 + */ + @Log(title = "设备检验清单", businessType = BusinessType.DELETE) + @DeleteMapping("/{checkIds}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] checkIds) { + return toAjax(iEqpEquipmentChecklistService.deleteWithValidByIds(Arrays.asList(checkIds), true)); + } +} diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/controller/EqpEquipmentInspectionRecordController.java b/klp-mes/src/main/java/com/klp/mes/eqp/controller/EqpEquipmentInspectionRecordController.java new file mode 100644 index 00000000..08d43c2c --- /dev/null +++ b/klp-mes/src/main/java/com/klp/mes/eqp/controller/EqpEquipmentInspectionRecordController.java @@ -0,0 +1,99 @@ +package com.klp.mes.eqp.controller; + +import java.util.List; +import java.util.Arrays; + +import lombok.RequiredArgsConstructor; +import javax.servlet.http.HttpServletResponse; +import javax.validation.constraints.*; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import com.klp.common.annotation.RepeatSubmit; +import com.klp.common.annotation.Log; +import com.klp.common.core.controller.BaseController; +import com.klp.common.core.domain.PageQuery; +import com.klp.common.core.domain.R; +import com.klp.common.core.validate.AddGroup; +import com.klp.common.core.validate.EditGroup; +import com.klp.common.enums.BusinessType; +import com.klp.common.utils.poi.ExcelUtil; +import com.klp.mes.eqp.domain.vo.EqpEquipmentInspectionRecordVo; +import com.klp.mes.eqp.domain.bo.EqpEquipmentInspectionRecordBo; +import com.klp.mes.eqp.service.IEqpEquipmentInspectionRecordService; +import com.klp.common.core.page.TableDataInfo; + +/** + * 设备巡检记录 + * + * @author klp + * @date 2026-05-21 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/eqp/equipmentInspectionRecord") +public class EqpEquipmentInspectionRecordController extends BaseController { + + private final IEqpEquipmentInspectionRecordService iEqpEquipmentInspectionRecordService; + + /** + * 查询设备巡检记录列表 + */ + @GetMapping("/list") + public TableDataInfo list(EqpEquipmentInspectionRecordBo bo, PageQuery pageQuery) { + return iEqpEquipmentInspectionRecordService.queryPageList(bo, pageQuery); + } + + /** + * 导出设备巡检记录列表 + */ + @Log(title = "设备巡检记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(EqpEquipmentInspectionRecordBo bo, HttpServletResponse response) { + List list = iEqpEquipmentInspectionRecordService.queryList(bo); + ExcelUtil.exportExcel(list, "设备巡检记录", EqpEquipmentInspectionRecordVo.class, response); + } + + /** + * 获取设备巡检记录详细信息 + * + * @param recordId 主键 + */ + @GetMapping("/{recordId}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long recordId) { + return R.ok(iEqpEquipmentInspectionRecordService.queryById(recordId)); + } + + /** + * 新增设备巡检记录 + */ + @Log(title = "设备巡检记录", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody EqpEquipmentInspectionRecordBo bo) { + return toAjax(iEqpEquipmentInspectionRecordService.insertByBo(bo)); + } + + /** + * 修改设备巡检记录 + */ + @Log(title = "设备巡检记录", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody EqpEquipmentInspectionRecordBo bo) { + return toAjax(iEqpEquipmentInspectionRecordService.updateByBo(bo)); + } + + /** + * 删除设备巡检记录 + * + * @param recordIds 主键串 + */ + @Log(title = "设备巡检记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{recordIds}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] recordIds) { + return toAjax(iEqpEquipmentInspectionRecordService.deleteWithValidByIds(Arrays.asList(recordIds), true)); + } +} diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/controller/EqpEquipmentPartController.java b/klp-mes/src/main/java/com/klp/mes/eqp/controller/EqpEquipmentPartController.java new file mode 100644 index 00000000..5326a3d6 --- /dev/null +++ b/klp-mes/src/main/java/com/klp/mes/eqp/controller/EqpEquipmentPartController.java @@ -0,0 +1,99 @@ +package com.klp.mes.eqp.controller; + +import java.util.List; +import java.util.Arrays; + +import lombok.RequiredArgsConstructor; +import javax.servlet.http.HttpServletResponse; +import javax.validation.constraints.*; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import com.klp.common.annotation.RepeatSubmit; +import com.klp.common.annotation.Log; +import com.klp.common.core.controller.BaseController; +import com.klp.common.core.domain.PageQuery; +import com.klp.common.core.domain.R; +import com.klp.common.core.validate.AddGroup; +import com.klp.common.core.validate.EditGroup; +import com.klp.common.enums.BusinessType; +import com.klp.common.utils.poi.ExcelUtil; +import com.klp.mes.eqp.domain.vo.EqpEquipmentPartVo; +import com.klp.mes.eqp.domain.bo.EqpEquipmentPartBo; +import com.klp.mes.eqp.service.IEqpEquipmentPartService; +import com.klp.common.core.page.TableDataInfo; + +/** + * 检验部位 + * + * @author klp + * @date 2026-05-21 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/eqp/equipmentPart") +public class EqpEquipmentPartController extends BaseController { + + private final IEqpEquipmentPartService iEqpEquipmentPartService; + + /** + * 查询检验部位列表 + */ + @GetMapping("/list") + public TableDataInfo list(EqpEquipmentPartBo bo, PageQuery pageQuery) { + return iEqpEquipmentPartService.queryPageList(bo, pageQuery); + } + + /** + * 导出检验部位列表 + */ + @Log(title = "检验部位", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(EqpEquipmentPartBo bo, HttpServletResponse response) { + List list = iEqpEquipmentPartService.queryList(bo); + ExcelUtil.exportExcel(list, "检验部位", EqpEquipmentPartVo.class, response); + } + + /** + * 获取检验部位详细信息 + * + * @param partId 主键 + */ + @GetMapping("/{partId}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long partId) { + return R.ok(iEqpEquipmentPartService.queryById(partId)); + } + + /** + * 新增检验部位 + */ + @Log(title = "检验部位", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody EqpEquipmentPartBo bo) { + return toAjax(iEqpEquipmentPartService.insertByBo(bo)); + } + + /** + * 修改检验部位 + */ + @Log(title = "检验部位", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody EqpEquipmentPartBo bo) { + return toAjax(iEqpEquipmentPartService.updateByBo(bo)); + } + + /** + * 删除检验部位 + * + * @param partIds 主键串 + */ + @Log(title = "检验部位", businessType = BusinessType.DELETE) + @DeleteMapping("/{partIds}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] partIds) { + return toAjax(iEqpEquipmentPartService.deleteWithValidByIds(Arrays.asList(partIds), true)); + } +} diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/domain/EqpEquipmentChecklist.java b/klp-mes/src/main/java/com/klp/mes/eqp/domain/EqpEquipmentChecklist.java new file mode 100644 index 00000000..fcfb654d --- /dev/null +++ b/klp-mes/src/main/java/com/klp/mes/eqp/domain/EqpEquipmentChecklist.java @@ -0,0 +1,65 @@ +package com.klp.mes.eqp.domain; + +import com.baomidou.mybatisplus.annotation.*; +import com.klp.common.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +/** + * 设备检验清单对象 eqp_equipment_checklist + * + * @author klp + * @date 2026-05-21 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("eqp_equipment_checklist") +public class EqpEquipmentChecklist extends BaseEntity { + + private static final long serialVersionUID=1L; + + /** + * 检验清单ID + */ + @TableId(value = "check_id") + private Long checkId; + /** + * 检验编号 + */ + private String checkNo; + /** + * 检验部位表 + */ + private Long partId; + /** + * 设备部件名称 + */ + private String partName; + /** + * 检验内容 + */ + private String checkContent; + /** + * 设备状态 运行/停止 + */ + private String equipmentState; + /** + * 检验标准 + */ + private String checkStandard; + /** + * 责任人 + */ + private String responsiblePerson; + /** + * 备注 + */ + private String remark; + /** + * 删除标识 0正常 2删除 + */ + @TableLogic + private Long delFlag; + +} diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/domain/EqpEquipmentInspectionRecord.java b/klp-mes/src/main/java/com/klp/mes/eqp/domain/EqpEquipmentInspectionRecord.java new file mode 100644 index 00000000..6ee806d3 --- /dev/null +++ b/klp-mes/src/main/java/com/klp/mes/eqp/domain/EqpEquipmentInspectionRecord.java @@ -0,0 +1,63 @@ +package com.klp.mes.eqp.domain; + +import com.baomidou.mybatisplus.annotation.*; +import com.klp.common.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + +/** + * 设备巡检记录对象 eqp_equipment_inspection_record + * + * @author klp + * @date 2026-05-21 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("eqp_equipment_inspection_record") +public class EqpEquipmentInspectionRecord extends BaseEntity { + + private static final long serialVersionUID=1L; + + /** + * 巡检记录ID + */ + @TableId(value = "record_id") + private Long recordId; + /** + * 检验清单ID + */ + private Long checkId; + /** + * 班次 1白班 2夜班 + */ + private Integer shift; + /** + * 巡检时间 + */ + private Date inspectTime; + /** + * 运行状态 1正常 2故障 + */ + private Integer runStatus; + /** + * 巡检人 + */ + private String inspector; + /** + * 异常描述 + */ + private String abnormalDesc; + /** + * 备注 + */ + private String remark; + /** + * 删除标识 0正常 2删除 + */ + @TableLogic + private Long delFlag; + +} diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/domain/EqpEquipmentPart.java b/klp-mes/src/main/java/com/klp/mes/eqp/domain/EqpEquipmentPart.java new file mode 100644 index 00000000..bbb17378 --- /dev/null +++ b/klp-mes/src/main/java/com/klp/mes/eqp/domain/EqpEquipmentPart.java @@ -0,0 +1,41 @@ +package com.klp.mes.eqp.domain; + +import com.baomidou.mybatisplus.annotation.*; +import com.klp.common.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +/** + * 检验部位对象 eqp_equipment_part + * + * @author klp + * @date 2026-05-21 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("eqp_equipment_part") +public class EqpEquipmentPart extends BaseEntity { + + private static final long serialVersionUID=1L; + + /** + * 巡检记录ID + */ + @TableId(value = "part_id") + private Long partId; + /** + * 巡检部位 + */ + private String inspectPart; + /** + * 备注 + */ + private String remark; + /** + * 删除标识 0正常 2删除 + */ + @TableLogic + private Long delFlag; + +} diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/domain/bo/EqpEquipmentChecklistBo.java b/klp-mes/src/main/java/com/klp/mes/eqp/domain/bo/EqpEquipmentChecklistBo.java new file mode 100644 index 00000000..0d34d6b3 --- /dev/null +++ b/klp-mes/src/main/java/com/klp/mes/eqp/domain/bo/EqpEquipmentChecklistBo.java @@ -0,0 +1,66 @@ +package com.klp.mes.eqp.domain.bo; + +import com.klp.common.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import javax.validation.constraints.*; + + +/** + * 设备检验清单业务对象 eqp_equipment_checklist + * + * @author klp + * @date 2026-05-21 + */ + +@Data +@EqualsAndHashCode(callSuper = true) +public class EqpEquipmentChecklistBo extends BaseEntity { + + /** + * 检验清单ID + */ + private Long checkId; + + /** + * 检验编号 + */ + private String checkNo; + + /** + * 检验部位表 + */ + private Long partId; + + /** + * 设备部件名称 + */ + private String partName; + + /** + * 检验内容 + */ + private String checkContent; + + /** + * 设备状态 运行/停止 + */ + private String equipmentState; + + /** + * 检验标准 + */ + private String checkStandard; + + /** + * 责任人 + */ + private String responsiblePerson; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/domain/bo/EqpEquipmentInspectionRecordBo.java b/klp-mes/src/main/java/com/klp/mes/eqp/domain/bo/EqpEquipmentInspectionRecordBo.java new file mode 100644 index 00000000..7b447f2a --- /dev/null +++ b/klp-mes/src/main/java/com/klp/mes/eqp/domain/bo/EqpEquipmentInspectionRecordBo.java @@ -0,0 +1,63 @@ +package com.klp.mes.eqp.domain.bo; + +import com.klp.common.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import javax.validation.constraints.*; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + +/** + * 设备巡检记录业务对象 eqp_equipment_inspection_record + * + * @author klp + * @date 2026-05-21 + */ + +@Data +@EqualsAndHashCode(callSuper = true) +public class EqpEquipmentInspectionRecordBo extends BaseEntity { + + /** + * 巡检记录ID + */ + private Long recordId; + + /** + * 检验清单ID + */ + private Long checkId; + + /** + * 班次 1白班 2夜班 + */ + private Integer shift; + + /** + * 巡检时间 + */ + private Date inspectTime; + + /** + * 运行状态 1正常 2故障 + */ + private Integer runStatus; + + /** + * 巡检人 + */ + private String inspector; + + /** + * 异常描述 + */ + private String abnormalDesc; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/domain/bo/EqpEquipmentPartBo.java b/klp-mes/src/main/java/com/klp/mes/eqp/domain/bo/EqpEquipmentPartBo.java new file mode 100644 index 00000000..d0d93cc6 --- /dev/null +++ b/klp-mes/src/main/java/com/klp/mes/eqp/domain/bo/EqpEquipmentPartBo.java @@ -0,0 +1,36 @@ +package com.klp.mes.eqp.domain.bo; + +import com.klp.common.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import javax.validation.constraints.*; + + +/** + * 检验部位业务对象 eqp_equipment_part + * + * @author klp + * @date 2026-05-21 + */ + +@Data +@EqualsAndHashCode(callSuper = true) +public class EqpEquipmentPartBo extends BaseEntity { + + /** + * 巡检记录ID + */ + private Long partId; + + /** + * 巡检部位 + */ + private String inspectPart; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/domain/vo/EqpEquipmentChecklistVo.java b/klp-mes/src/main/java/com/klp/mes/eqp/domain/vo/EqpEquipmentChecklistVo.java new file mode 100644 index 00000000..35f1701e --- /dev/null +++ b/klp-mes/src/main/java/com/klp/mes/eqp/domain/vo/EqpEquipmentChecklistVo.java @@ -0,0 +1,77 @@ +package com.klp.mes.eqp.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.klp.common.annotation.ExcelDictFormat; +import com.klp.common.convert.ExcelDictConvert; +import lombok.Data; + + +/** + * 设备检验清单视图对象 eqp_equipment_checklist + * + * @author klp + * @date 2026-05-21 + */ +@Data +@ExcelIgnoreUnannotated +public class EqpEquipmentChecklistVo { + + private static final long serialVersionUID = 1L; + + /** + * 检验清单ID + */ + @ExcelProperty(value = "检验清单ID") + private Long checkId; + + /** + * 检验编号 + */ + @ExcelProperty(value = "检验编号") + private String checkNo; + + /** + * 检验部位表 + */ + @ExcelProperty(value = "检验部位表") + private Long partId; + + /** + * 设备部件名称 + */ + @ExcelProperty(value = "设备部件名称") + private String partName; + + /** + * 检验内容 + */ + @ExcelProperty(value = "检验内容") + private String checkContent; + + /** + * 设备状态 运行/停止 + */ + @ExcelProperty(value = "设备状态 运行/停止") + private String equipmentState; + + /** + * 检验标准 + */ + @ExcelProperty(value = "检验标准") + private String checkStandard; + + /** + * 责任人 + */ + @ExcelProperty(value = "责任人") + private String responsiblePerson; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + +} diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/domain/vo/EqpEquipmentInspectionRecordVo.java b/klp-mes/src/main/java/com/klp/mes/eqp/domain/vo/EqpEquipmentInspectionRecordVo.java new file mode 100644 index 00000000..ef7b09de --- /dev/null +++ b/klp-mes/src/main/java/com/klp/mes/eqp/domain/vo/EqpEquipmentInspectionRecordVo.java @@ -0,0 +1,73 @@ +package com.klp.mes.eqp.domain.vo; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.klp.common.annotation.ExcelDictFormat; +import com.klp.common.convert.ExcelDictConvert; +import lombok.Data; + + +/** + * 设备巡检记录视图对象 eqp_equipment_inspection_record + * + * @author klp + * @date 2026-05-21 + */ +@Data +@ExcelIgnoreUnannotated +public class EqpEquipmentInspectionRecordVo { + + private static final long serialVersionUID = 1L; + + /** + * 巡检记录ID + */ + @ExcelProperty(value = "巡检记录ID") + private Long recordId; + + /** + * 检验清单ID + */ + @ExcelProperty(value = "检验清单ID") + private Long checkId; + + /** + * 班次 1白班 2夜班 + */ + @ExcelProperty(value = "班次 1白班 2夜班") + private Integer shift; + + /** + * 巡检时间 + */ + @ExcelProperty(value = "巡检时间") + private Date inspectTime; + + /** + * 运行状态 1正常 2故障 + */ + @ExcelProperty(value = "运行状态 1正常 2故障") + private Integer runStatus; + + /** + * 巡检人 + */ + @ExcelProperty(value = "巡检人") + private String inspector; + + /** + * 异常描述 + */ + @ExcelProperty(value = "异常描述") + private String abnormalDesc; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + +} diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/domain/vo/EqpEquipmentPartVo.java b/klp-mes/src/main/java/com/klp/mes/eqp/domain/vo/EqpEquipmentPartVo.java new file mode 100644 index 00000000..298f91a4 --- /dev/null +++ b/klp-mes/src/main/java/com/klp/mes/eqp/domain/vo/EqpEquipmentPartVo.java @@ -0,0 +1,41 @@ +package com.klp.mes.eqp.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.klp.common.annotation.ExcelDictFormat; +import com.klp.common.convert.ExcelDictConvert; +import lombok.Data; + + +/** + * 检验部位视图对象 eqp_equipment_part + * + * @author klp + * @date 2026-05-21 + */ +@Data +@ExcelIgnoreUnannotated +public class EqpEquipmentPartVo { + + private static final long serialVersionUID = 1L; + + /** + * 巡检记录ID + */ + @ExcelProperty(value = "巡检记录ID") + private Long partId; + + /** + * 巡检部位 + */ + @ExcelProperty(value = "巡检部位") + private String inspectPart; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + +} diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/mapper/EqpEquipmentChecklistMapper.java b/klp-mes/src/main/java/com/klp/mes/eqp/mapper/EqpEquipmentChecklistMapper.java new file mode 100644 index 00000000..eba62bda --- /dev/null +++ b/klp-mes/src/main/java/com/klp/mes/eqp/mapper/EqpEquipmentChecklistMapper.java @@ -0,0 +1,15 @@ +package com.klp.mes.eqp.mapper; + +import com.klp.mes.eqp.domain.EqpEquipmentChecklist; +import com.klp.mes.eqp.domain.vo.EqpEquipmentChecklistVo; +import com.klp.common.core.mapper.BaseMapperPlus; + +/** + * 设备检验清单Mapper接口 + * + * @author klp + * @date 2026-05-21 + */ +public interface EqpEquipmentChecklistMapper extends BaseMapperPlus { + +} diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/mapper/EqpEquipmentInspectionRecordMapper.java b/klp-mes/src/main/java/com/klp/mes/eqp/mapper/EqpEquipmentInspectionRecordMapper.java new file mode 100644 index 00000000..64fab8d4 --- /dev/null +++ b/klp-mes/src/main/java/com/klp/mes/eqp/mapper/EqpEquipmentInspectionRecordMapper.java @@ -0,0 +1,15 @@ +package com.klp.mes.eqp.mapper; + +import com.klp.mes.eqp.domain.EqpEquipmentInspectionRecord; +import com.klp.mes.eqp.domain.vo.EqpEquipmentInspectionRecordVo; +import com.klp.common.core.mapper.BaseMapperPlus; + +/** + * 设备巡检记录Mapper接口 + * + * @author klp + * @date 2026-05-21 + */ +public interface EqpEquipmentInspectionRecordMapper extends BaseMapperPlus { + +} diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/mapper/EqpEquipmentPartMapper.java b/klp-mes/src/main/java/com/klp/mes/eqp/mapper/EqpEquipmentPartMapper.java new file mode 100644 index 00000000..dc2c8aab --- /dev/null +++ b/klp-mes/src/main/java/com/klp/mes/eqp/mapper/EqpEquipmentPartMapper.java @@ -0,0 +1,15 @@ +package com.klp.mes.eqp.mapper; + +import com.klp.mes.eqp.domain.EqpEquipmentPart; +import com.klp.mes.eqp.domain.vo.EqpEquipmentPartVo; +import com.klp.common.core.mapper.BaseMapperPlus; + +/** + * 检验部位Mapper接口 + * + * @author klp + * @date 2026-05-21 + */ +public interface EqpEquipmentPartMapper extends BaseMapperPlus { + +} diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/service/IEqpEquipmentChecklistService.java b/klp-mes/src/main/java/com/klp/mes/eqp/service/IEqpEquipmentChecklistService.java new file mode 100644 index 00000000..a234b9ea --- /dev/null +++ b/klp-mes/src/main/java/com/klp/mes/eqp/service/IEqpEquipmentChecklistService.java @@ -0,0 +1,49 @@ +package com.klp.mes.eqp.service; + +import com.klp.mes.eqp.domain.EqpEquipmentChecklist; +import com.klp.mes.eqp.domain.vo.EqpEquipmentChecklistVo; +import com.klp.mes.eqp.domain.bo.EqpEquipmentChecklistBo; +import com.klp.common.core.page.TableDataInfo; +import com.klp.common.core.domain.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 设备检验清单Service接口 + * + * @author klp + * @date 2026-05-21 + */ +public interface IEqpEquipmentChecklistService { + + /** + * 查询设备检验清单 + */ + EqpEquipmentChecklistVo queryById(Long checkId); + + /** + * 查询设备检验清单列表 + */ + TableDataInfo queryPageList(EqpEquipmentChecklistBo bo, PageQuery pageQuery); + + /** + * 查询设备检验清单列表 + */ + List queryList(EqpEquipmentChecklistBo bo); + + /** + * 新增设备检验清单 + */ + Boolean insertByBo(EqpEquipmentChecklistBo bo); + + /** + * 修改设备检验清单 + */ + Boolean updateByBo(EqpEquipmentChecklistBo bo); + + /** + * 校验并批量删除设备检验清单信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/service/IEqpEquipmentInspectionRecordService.java b/klp-mes/src/main/java/com/klp/mes/eqp/service/IEqpEquipmentInspectionRecordService.java new file mode 100644 index 00000000..adc97ea2 --- /dev/null +++ b/klp-mes/src/main/java/com/klp/mes/eqp/service/IEqpEquipmentInspectionRecordService.java @@ -0,0 +1,49 @@ +package com.klp.mes.eqp.service; + +import com.klp.mes.eqp.domain.EqpEquipmentInspectionRecord; +import com.klp.mes.eqp.domain.vo.EqpEquipmentInspectionRecordVo; +import com.klp.mes.eqp.domain.bo.EqpEquipmentInspectionRecordBo; +import com.klp.common.core.page.TableDataInfo; +import com.klp.common.core.domain.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 设备巡检记录Service接口 + * + * @author klp + * @date 2026-05-21 + */ +public interface IEqpEquipmentInspectionRecordService { + + /** + * 查询设备巡检记录 + */ + EqpEquipmentInspectionRecordVo queryById(Long recordId); + + /** + * 查询设备巡检记录列表 + */ + TableDataInfo queryPageList(EqpEquipmentInspectionRecordBo bo, PageQuery pageQuery); + + /** + * 查询设备巡检记录列表 + */ + List queryList(EqpEquipmentInspectionRecordBo bo); + + /** + * 新增设备巡检记录 + */ + Boolean insertByBo(EqpEquipmentInspectionRecordBo bo); + + /** + * 修改设备巡检记录 + */ + Boolean updateByBo(EqpEquipmentInspectionRecordBo bo); + + /** + * 校验并批量删除设备巡检记录信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/service/IEqpEquipmentPartService.java b/klp-mes/src/main/java/com/klp/mes/eqp/service/IEqpEquipmentPartService.java new file mode 100644 index 00000000..cce60bb1 --- /dev/null +++ b/klp-mes/src/main/java/com/klp/mes/eqp/service/IEqpEquipmentPartService.java @@ -0,0 +1,49 @@ +package com.klp.mes.eqp.service; + +import com.klp.mes.eqp.domain.EqpEquipmentPart; +import com.klp.mes.eqp.domain.vo.EqpEquipmentPartVo; +import com.klp.mes.eqp.domain.bo.EqpEquipmentPartBo; +import com.klp.common.core.page.TableDataInfo; +import com.klp.common.core.domain.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 检验部位Service接口 + * + * @author klp + * @date 2026-05-21 + */ +public interface IEqpEquipmentPartService { + + /** + * 查询检验部位 + */ + EqpEquipmentPartVo queryById(Long partId); + + /** + * 查询检验部位列表 + */ + TableDataInfo queryPageList(EqpEquipmentPartBo bo, PageQuery pageQuery); + + /** + * 查询检验部位列表 + */ + List queryList(EqpEquipmentPartBo bo); + + /** + * 新增检验部位 + */ + Boolean insertByBo(EqpEquipmentPartBo bo); + + /** + * 修改检验部位 + */ + Boolean updateByBo(EqpEquipmentPartBo bo); + + /** + * 校验并批量删除检验部位信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/service/impl/EqpEquipmentChecklistServiceImpl.java b/klp-mes/src/main/java/com/klp/mes/eqp/service/impl/EqpEquipmentChecklistServiceImpl.java new file mode 100644 index 00000000..2535a45a --- /dev/null +++ b/klp-mes/src/main/java/com/klp/mes/eqp/service/impl/EqpEquipmentChecklistServiceImpl.java @@ -0,0 +1,115 @@ +package com.klp.mes.eqp.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.klp.common.core.page.TableDataInfo; +import com.klp.common.core.domain.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.klp.common.utils.StringUtils; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import com.klp.mes.eqp.domain.bo.EqpEquipmentChecklistBo; +import com.klp.mes.eqp.domain.vo.EqpEquipmentChecklistVo; +import com.klp.mes.eqp.domain.EqpEquipmentChecklist; +import com.klp.mes.eqp.mapper.EqpEquipmentChecklistMapper; +import com.klp.mes.eqp.service.IEqpEquipmentChecklistService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 设备检验清单Service业务层处理 + * + * @author klp + * @date 2026-05-21 + */ +@RequiredArgsConstructor +@Service +public class EqpEquipmentChecklistServiceImpl implements IEqpEquipmentChecklistService { + + private final EqpEquipmentChecklistMapper baseMapper; + + /** + * 查询设备检验清单 + */ + @Override + public EqpEquipmentChecklistVo queryById(Long checkId){ + return baseMapper.selectVoById(checkId); + } + + /** + * 查询设备检验清单列表 + */ + @Override + public TableDataInfo queryPageList(EqpEquipmentChecklistBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询设备检验清单列表 + */ + @Override + public List queryList(EqpEquipmentChecklistBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(EqpEquipmentChecklistBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(StringUtils.isNotBlank(bo.getCheckNo()), EqpEquipmentChecklist::getCheckNo, bo.getCheckNo()); + lqw.eq(bo.getPartId() != null, EqpEquipmentChecklist::getPartId, bo.getPartId()); + lqw.like(StringUtils.isNotBlank(bo.getPartName()), EqpEquipmentChecklist::getPartName, bo.getPartName()); + lqw.eq(StringUtils.isNotBlank(bo.getCheckContent()), EqpEquipmentChecklist::getCheckContent, bo.getCheckContent()); + lqw.eq(StringUtils.isNotBlank(bo.getEquipmentState()), EqpEquipmentChecklist::getEquipmentState, bo.getEquipmentState()); + lqw.eq(StringUtils.isNotBlank(bo.getCheckStandard()), EqpEquipmentChecklist::getCheckStandard, bo.getCheckStandard()); + lqw.eq(StringUtils.isNotBlank(bo.getResponsiblePerson()), EqpEquipmentChecklist::getResponsiblePerson, bo.getResponsiblePerson()); + return lqw; + } + + /** + * 新增设备检验清单 + */ + @Override + public Boolean insertByBo(EqpEquipmentChecklistBo bo) { + EqpEquipmentChecklist add = BeanUtil.toBean(bo, EqpEquipmentChecklist.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setCheckId(add.getCheckId()); + } + return flag; + } + + /** + * 修改设备检验清单 + */ + @Override + public Boolean updateByBo(EqpEquipmentChecklistBo bo) { + EqpEquipmentChecklist update = BeanUtil.toBean(bo, EqpEquipmentChecklist.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(EqpEquipmentChecklist entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除设备检验清单 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } +} diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/service/impl/EqpEquipmentInspectionRecordServiceImpl.java b/klp-mes/src/main/java/com/klp/mes/eqp/service/impl/EqpEquipmentInspectionRecordServiceImpl.java new file mode 100644 index 00000000..00ad8094 --- /dev/null +++ b/klp-mes/src/main/java/com/klp/mes/eqp/service/impl/EqpEquipmentInspectionRecordServiceImpl.java @@ -0,0 +1,114 @@ +package com.klp.mes.eqp.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.klp.common.core.page.TableDataInfo; +import com.klp.common.core.domain.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.klp.common.utils.StringUtils; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import com.klp.mes.eqp.domain.bo.EqpEquipmentInspectionRecordBo; +import com.klp.mes.eqp.domain.vo.EqpEquipmentInspectionRecordVo; +import com.klp.mes.eqp.domain.EqpEquipmentInspectionRecord; +import com.klp.mes.eqp.mapper.EqpEquipmentInspectionRecordMapper; +import com.klp.mes.eqp.service.IEqpEquipmentInspectionRecordService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 设备巡检记录Service业务层处理 + * + * @author klp + * @date 2026-05-21 + */ +@RequiredArgsConstructor +@Service +public class EqpEquipmentInspectionRecordServiceImpl implements IEqpEquipmentInspectionRecordService { + + private final EqpEquipmentInspectionRecordMapper baseMapper; + + /** + * 查询设备巡检记录 + */ + @Override + public EqpEquipmentInspectionRecordVo queryById(Long recordId){ + return baseMapper.selectVoById(recordId); + } + + /** + * 查询设备巡检记录列表 + */ + @Override + public TableDataInfo queryPageList(EqpEquipmentInspectionRecordBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询设备巡检记录列表 + */ + @Override + public List queryList(EqpEquipmentInspectionRecordBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(EqpEquipmentInspectionRecordBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(bo.getCheckId() != null, EqpEquipmentInspectionRecord::getCheckId, bo.getCheckId()); + lqw.eq(bo.getShift() != null, EqpEquipmentInspectionRecord::getShift, bo.getShift()); + lqw.eq(bo.getInspectTime() != null, EqpEquipmentInspectionRecord::getInspectTime, bo.getInspectTime()); + lqw.eq(bo.getRunStatus() != null, EqpEquipmentInspectionRecord::getRunStatus, bo.getRunStatus()); + lqw.eq(StringUtils.isNotBlank(bo.getInspector()), EqpEquipmentInspectionRecord::getInspector, bo.getInspector()); + lqw.eq(StringUtils.isNotBlank(bo.getAbnormalDesc()), EqpEquipmentInspectionRecord::getAbnormalDesc, bo.getAbnormalDesc()); + return lqw; + } + + /** + * 新增设备巡检记录 + */ + @Override + public Boolean insertByBo(EqpEquipmentInspectionRecordBo bo) { + EqpEquipmentInspectionRecord add = BeanUtil.toBean(bo, EqpEquipmentInspectionRecord.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setRecordId(add.getRecordId()); + } + return flag; + } + + /** + * 修改设备巡检记录 + */ + @Override + public Boolean updateByBo(EqpEquipmentInspectionRecordBo bo) { + EqpEquipmentInspectionRecord update = BeanUtil.toBean(bo, EqpEquipmentInspectionRecord.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(EqpEquipmentInspectionRecord entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除设备巡检记录 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } +} diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/service/impl/EqpEquipmentPartServiceImpl.java b/klp-mes/src/main/java/com/klp/mes/eqp/service/impl/EqpEquipmentPartServiceImpl.java new file mode 100644 index 00000000..52d5a985 --- /dev/null +++ b/klp-mes/src/main/java/com/klp/mes/eqp/service/impl/EqpEquipmentPartServiceImpl.java @@ -0,0 +1,111 @@ +package com.klp.mes.eqp.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.klp.common.core.page.TableDataInfo; +import com.klp.common.core.domain.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.klp.common.utils.StringUtils; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import com.klp.mes.eqp.domain.bo.EqpEquipmentPartBo; +import com.klp.mes.eqp.domain.vo.EqpEquipmentPartVo; +import com.klp.mes.eqp.domain.EqpEquipmentPart; +import com.klp.mes.eqp.mapper.EqpEquipmentPartMapper; +import com.klp.mes.eqp.service.IEqpEquipmentPartService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; +import java.util.stream.Collectors; + +/** + * 检验部位Service业务层处理 + * + * @author klp + * @date 2026-05-21 + */ +@RequiredArgsConstructor +@Service +public class EqpEquipmentPartServiceImpl implements IEqpEquipmentPartService { + + private final EqpEquipmentPartMapper baseMapper; + + /** + * 查询检验部位 + */ + @Override + public EqpEquipmentPartVo queryById(Long partId){ + return baseMapper.selectVoById(partId); + } + + /** + * 查询检验部位列表 + */ + @Override + public TableDataInfo queryPageList(EqpEquipmentPartBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + result.getRecords().stream().map(EqpEquipmentPartVo::getPartId).collect(Collectors.toList()); + return TableDataInfo.build(result); + } + + /** + * 查询检验部位列表 + */ + @Override + public List queryList(EqpEquipmentPartBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(EqpEquipmentPartBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(StringUtils.isNotBlank(bo.getInspectPart()), EqpEquipmentPart::getInspectPart, bo.getInspectPart()); + return lqw; + } + + /** + * 新增检验部位 + */ + @Override + public Boolean insertByBo(EqpEquipmentPartBo bo) { + EqpEquipmentPart add = BeanUtil.toBean(bo, EqpEquipmentPart.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setPartId(add.getPartId()); + } + return flag; + } + + /** + * 修改检验部位 + */ + @Override + public Boolean updateByBo(EqpEquipmentPartBo bo) { + EqpEquipmentPart update = BeanUtil.toBean(bo, EqpEquipmentPart.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(EqpEquipmentPart entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除检验部位 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } +} diff --git a/klp-mes/src/main/resources/mapper/eqp/EqpEquipmentChecklistMapper.xml b/klp-mes/src/main/resources/mapper/eqp/EqpEquipmentChecklistMapper.xml new file mode 100644 index 00000000..c85914b9 --- /dev/null +++ b/klp-mes/src/main/resources/mapper/eqp/EqpEquipmentChecklistMapper.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/klp-mes/src/main/resources/mapper/eqp/EqpEquipmentInspectionRecordMapper.xml b/klp-mes/src/main/resources/mapper/eqp/EqpEquipmentInspectionRecordMapper.xml new file mode 100644 index 00000000..a7714b48 --- /dev/null +++ b/klp-mes/src/main/resources/mapper/eqp/EqpEquipmentInspectionRecordMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/klp-mes/src/main/resources/mapper/eqp/EqpEquipmentPartMapper.xml b/klp-mes/src/main/resources/mapper/eqp/EqpEquipmentPartMapper.xml new file mode 100644 index 00000000..cba59428 --- /dev/null +++ b/klp-mes/src/main/resources/mapper/eqp/EqpEquipmentPartMapper.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + +