Merge branch '0.8.X' of http://49.232.154.205:10100/DeXun/klp-oa into 0.8.X
This commit is contained in:
@@ -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<EqpEquipmentChecklistVo> 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<EqpEquipmentChecklistVo> list = iEqpEquipmentChecklistService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "设备检验清单", EqpEquipmentChecklistVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备检验清单详细信息
|
||||
*
|
||||
* @param checkId 主键
|
||||
*/
|
||||
@GetMapping("/{checkId}")
|
||||
public R<EqpEquipmentChecklistVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long checkId) {
|
||||
return R.ok(iEqpEquipmentChecklistService.queryById(checkId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备检验清单
|
||||
*/
|
||||
@Log(title = "设备检验清单", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody EqpEquipmentChecklistBo bo) {
|
||||
return toAjax(iEqpEquipmentChecklistService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备检验清单
|
||||
*/
|
||||
@Log(title = "设备检验清单", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody EqpEquipmentChecklistBo bo) {
|
||||
return toAjax(iEqpEquipmentChecklistService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备检验清单
|
||||
*
|
||||
* @param checkIds 主键串
|
||||
*/
|
||||
@Log(title = "设备检验清单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{checkIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] checkIds) {
|
||||
return toAjax(iEqpEquipmentChecklistService.deleteWithValidByIds(Arrays.asList(checkIds), true));
|
||||
}
|
||||
}
|
||||
@@ -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<EqpEquipmentInspectionRecordVo> 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<EqpEquipmentInspectionRecordVo> list = iEqpEquipmentInspectionRecordService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "设备巡检记录", EqpEquipmentInspectionRecordVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备巡检记录详细信息
|
||||
*
|
||||
* @param recordId 主键
|
||||
*/
|
||||
@GetMapping("/{recordId}")
|
||||
public R<EqpEquipmentInspectionRecordVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long recordId) {
|
||||
return R.ok(iEqpEquipmentInspectionRecordService.queryById(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备巡检记录
|
||||
*/
|
||||
@Log(title = "设备巡检记录", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody EqpEquipmentInspectionRecordBo bo) {
|
||||
return toAjax(iEqpEquipmentInspectionRecordService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备巡检记录
|
||||
*/
|
||||
@Log(title = "设备巡检记录", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody EqpEquipmentInspectionRecordBo bo) {
|
||||
return toAjax(iEqpEquipmentInspectionRecordService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备巡检记录
|
||||
*
|
||||
* @param recordIds 主键串
|
||||
*/
|
||||
@Log(title = "设备巡检记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] recordIds) {
|
||||
return toAjax(iEqpEquipmentInspectionRecordService.deleteWithValidByIds(Arrays.asList(recordIds), true));
|
||||
}
|
||||
}
|
||||
@@ -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<EqpEquipmentPartVo> 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<EqpEquipmentPartVo> list = iEqpEquipmentPartService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "检验部位", EqpEquipmentPartVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取检验部位详细信息
|
||||
*
|
||||
* @param partId 主键
|
||||
*/
|
||||
@GetMapping("/{partId}")
|
||||
public R<EqpEquipmentPartVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long partId) {
|
||||
return R.ok(iEqpEquipmentPartService.queryById(partId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增检验部位
|
||||
*/
|
||||
@Log(title = "检验部位", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody EqpEquipmentPartBo bo) {
|
||||
return toAjax(iEqpEquipmentPartService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改检验部位
|
||||
*/
|
||||
@Log(title = "检验部位", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody EqpEquipmentPartBo bo) {
|
||||
return toAjax(iEqpEquipmentPartService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除检验部位
|
||||
*
|
||||
* @param partIds 主键串
|
||||
*/
|
||||
@Log(title = "检验部位", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{partIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] partIds) {
|
||||
return toAjax(iEqpEquipmentPartService.deleteWithValidByIds(Arrays.asList(partIds), true));
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
@@ -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<EqpEquipmentChecklistMapper, EqpEquipmentChecklist, EqpEquipmentChecklistVo> {
|
||||
|
||||
}
|
||||
@@ -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<EqpEquipmentInspectionRecordMapper, EqpEquipmentInspectionRecord, EqpEquipmentInspectionRecordVo> {
|
||||
|
||||
}
|
||||
@@ -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<EqpEquipmentPartMapper, EqpEquipmentPart, EqpEquipmentPartVo> {
|
||||
|
||||
}
|
||||
@@ -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<EqpEquipmentChecklistVo> queryPageList(EqpEquipmentChecklistBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询设备检验清单列表
|
||||
*/
|
||||
List<EqpEquipmentChecklistVo> queryList(EqpEquipmentChecklistBo bo);
|
||||
|
||||
/**
|
||||
* 新增设备检验清单
|
||||
*/
|
||||
Boolean insertByBo(EqpEquipmentChecklistBo bo);
|
||||
|
||||
/**
|
||||
* 修改设备检验清单
|
||||
*/
|
||||
Boolean updateByBo(EqpEquipmentChecklistBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除设备检验清单信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -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<EqpEquipmentInspectionRecordVo> queryPageList(EqpEquipmentInspectionRecordBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询设备巡检记录列表
|
||||
*/
|
||||
List<EqpEquipmentInspectionRecordVo> queryList(EqpEquipmentInspectionRecordBo bo);
|
||||
|
||||
/**
|
||||
* 新增设备巡检记录
|
||||
*/
|
||||
Boolean insertByBo(EqpEquipmentInspectionRecordBo bo);
|
||||
|
||||
/**
|
||||
* 修改设备巡检记录
|
||||
*/
|
||||
Boolean updateByBo(EqpEquipmentInspectionRecordBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除设备巡检记录信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -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<EqpEquipmentPartVo> queryPageList(EqpEquipmentPartBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询检验部位列表
|
||||
*/
|
||||
List<EqpEquipmentPartVo> queryList(EqpEquipmentPartBo bo);
|
||||
|
||||
/**
|
||||
* 新增检验部位
|
||||
*/
|
||||
Boolean insertByBo(EqpEquipmentPartBo bo);
|
||||
|
||||
/**
|
||||
* 修改检验部位
|
||||
*/
|
||||
Boolean updateByBo(EqpEquipmentPartBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除检验部位信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -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<EqpEquipmentChecklistVo> queryPageList(EqpEquipmentChecklistBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<EqpEquipmentChecklist> lqw = buildQueryWrapper(bo);
|
||||
Page<EqpEquipmentChecklistVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备检验清单列表
|
||||
*/
|
||||
@Override
|
||||
public List<EqpEquipmentChecklistVo> queryList(EqpEquipmentChecklistBo bo) {
|
||||
LambdaQueryWrapper<EqpEquipmentChecklist> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<EqpEquipmentChecklist> buildQueryWrapper(EqpEquipmentChecklistBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<EqpEquipmentChecklist> 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<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -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<EqpEquipmentInspectionRecordVo> queryPageList(EqpEquipmentInspectionRecordBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<EqpEquipmentInspectionRecord> lqw = buildQueryWrapper(bo);
|
||||
Page<EqpEquipmentInspectionRecordVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备巡检记录列表
|
||||
*/
|
||||
@Override
|
||||
public List<EqpEquipmentInspectionRecordVo> queryList(EqpEquipmentInspectionRecordBo bo) {
|
||||
LambdaQueryWrapper<EqpEquipmentInspectionRecord> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<EqpEquipmentInspectionRecord> buildQueryWrapper(EqpEquipmentInspectionRecordBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<EqpEquipmentInspectionRecord> 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<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -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<EqpEquipmentPartVo> queryPageList(EqpEquipmentPartBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<EqpEquipmentPart> lqw = buildQueryWrapper(bo);
|
||||
Page<EqpEquipmentPartVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
result.getRecords().stream().map(EqpEquipmentPartVo::getPartId).collect(Collectors.toList());
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询检验部位列表
|
||||
*/
|
||||
@Override
|
||||
public List<EqpEquipmentPartVo> queryList(EqpEquipmentPartBo bo) {
|
||||
LambdaQueryWrapper<EqpEquipmentPart> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<EqpEquipmentPart> buildQueryWrapper(EqpEquipmentPartBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<EqpEquipmentPart> 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<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.klp.mes.eqp.mapper.EqpEquipmentChecklistMapper">
|
||||
|
||||
<resultMap type="com.klp.mes.eqp.domain.EqpEquipmentChecklist" id="EqpEquipmentChecklistResult">
|
||||
<result property="checkId" column="check_id"/>
|
||||
<result property="checkNo" column="check_no"/>
|
||||
<result property="partId" column="part_id"/>
|
||||
<result property="partName" column="part_name"/>
|
||||
<result property="checkContent" column="check_content"/>
|
||||
<result property="equipmentState" column="equipment_state"/>
|
||||
<result property="checkStandard" column="check_standard"/>
|
||||
<result property="responsiblePerson" column="responsible_person"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.klp.mes.eqp.mapper.EqpEquipmentInspectionRecordMapper">
|
||||
|
||||
<resultMap type="com.klp.mes.eqp.domain.EqpEquipmentInspectionRecord" id="EqpEquipmentInspectionRecordResult">
|
||||
<result property="recordId" column="record_id"/>
|
||||
<result property="checkId" column="check_id"/>
|
||||
<result property="shift" column="shift"/>
|
||||
<result property="inspectTime" column="inspect_time"/>
|
||||
<result property="runStatus" column="run_status"/>
|
||||
<result property="inspector" column="inspector"/>
|
||||
<result property="abnormalDesc" column="abnormal_desc"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.klp.mes.eqp.mapper.EqpEquipmentPartMapper">
|
||||
|
||||
<resultMap type="com.klp.mes.eqp.domain.EqpEquipmentPart" id="EqpEquipmentPartResult">
|
||||
<result property="partId" column="part_id"/>
|
||||
<result property="inspectPart" column="inspect_part"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user