From 7b2edd89c5cca462455d68c849ade49000f6d158 Mon Sep 17 00:00:00 2001 From: zhangjunwen Date: Wed, 19 Jun 2024 11:54:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=B7=A5=E6=8E=A7=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=B8=8A=E5=B1=82=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equip/IpcEquipCategoryController.java | 2 +- .../equip/IpcEquipInfoController.java | 6 +- .../IpcMaintenanceRecordController.java | 124 ++ .../IpcEquipScrappingRecordController.java | 98 ++ .../equip/mapper/IpcEquipInfoMapper.java | 5 + .../equip/service/IIpcEquipInfoService.java | 2 +- .../service/impl/IpcEquipInfoServiceImpl.java | 9 +- .../domain/IpcMaintenanceRecord.java | 264 +++ .../mapper/IpcMaintenanceRecordMapper.java | 62 + .../service/IIpcMaintenanceRecordService.java | 72 + .../impl/IpcMaintenanceRecordServiceImpl.java | 161 ++ .../scrap/domain/IpcEquipScrappingRecord.java | 211 +++ .../mapper/IpcEquipScrappingRecordMapper.java | 62 + .../IIpcEquipScrappingRecordService.java | 62 + .../IpcEquipScrappingRecordServiceImpl.java | 99 ++ .../mapper/equip/IpcEquipInfoMapper.xml | 7 + .../IpcMaintenanceRecordMapper.xml | 124 ++ .../scrap/IpcEquipScrappingRecordMapper.xml | 103 ++ zfipc-ui/src/api/maintenance/record.js | 61 + zfipc-ui/src/api/scrap/record.js | 44 + zfipc-ui/src/api/upkeep/record.js | 2 +- .../src/views/eqmanagement/eqinfo/index.vue | 1049 +++++++++--- .../views/eqmanagement/sensorinfo/index.vue | 6 +- .../src/views/maintenance/record/index.vue | 1487 +++++++++++++++++ zfipc-ui/src/views/scrap/record/index.vue | 660 ++++++++ zfipc-ui/src/views/upkeep/plan/index.vue | 5 +- zfipc-ui/src/views/upkeep/record/index.vue | 8 +- 27 files changed, 4543 insertions(+), 252 deletions(-) create mode 100644 zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/maintenance/IpcMaintenanceRecordController.java create mode 100644 zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/scrap/IpcEquipScrappingRecordController.java create mode 100644 zfipc-server/zfipc-system/src/main/java/com/inspur/maintenance/domain/IpcMaintenanceRecord.java create mode 100644 zfipc-server/zfipc-system/src/main/java/com/inspur/maintenance/mapper/IpcMaintenanceRecordMapper.java create mode 100644 zfipc-server/zfipc-system/src/main/java/com/inspur/maintenance/service/IIpcMaintenanceRecordService.java create mode 100644 zfipc-server/zfipc-system/src/main/java/com/inspur/maintenance/service/impl/IpcMaintenanceRecordServiceImpl.java create mode 100644 zfipc-server/zfipc-system/src/main/java/com/inspur/scrap/domain/IpcEquipScrappingRecord.java create mode 100644 zfipc-server/zfipc-system/src/main/java/com/inspur/scrap/mapper/IpcEquipScrappingRecordMapper.java create mode 100644 zfipc-server/zfipc-system/src/main/java/com/inspur/scrap/service/IIpcEquipScrappingRecordService.java create mode 100644 zfipc-server/zfipc-system/src/main/java/com/inspur/scrap/service/impl/IpcEquipScrappingRecordServiceImpl.java create mode 100644 zfipc-server/zfipc-system/src/main/resources/mapper/maintenance/IpcMaintenanceRecordMapper.xml create mode 100644 zfipc-server/zfipc-system/src/main/resources/mapper/scrap/IpcEquipScrappingRecordMapper.xml create mode 100644 zfipc-ui/src/api/maintenance/record.js create mode 100644 zfipc-ui/src/api/scrap/record.js create mode 100644 zfipc-ui/src/views/maintenance/record/index.vue create mode 100644 zfipc-ui/src/views/scrap/record/index.vue diff --git a/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/equip/IpcEquipCategoryController.java b/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/equip/IpcEquipCategoryController.java index 0b34502..adbbc5b 100644 --- a/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/equip/IpcEquipCategoryController.java +++ b/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/equip/IpcEquipCategoryController.java @@ -105,7 +105,7 @@ public class IpcEquipCategoryController extends BaseController /** * 改变设备分类状态 */ - @PreAuthorize("@ss.hasPermi('equip:category:changeStatus')") + @Log(title = "设备分类", businessType = BusinessType.UPDATE) @PutMapping("/{categoryId}") public AjaxResult changeStatus(@PathVariable Long categoryId, @RequestParam Long changeStatus) diff --git a/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/equip/IpcEquipInfoController.java b/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/equip/IpcEquipInfoController.java index 14da8fc..caa9575 100644 --- a/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/equip/IpcEquipInfoController.java +++ b/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/equip/IpcEquipInfoController.java @@ -69,9 +69,9 @@ public class IpcEquipInfoController extends BaseController } @GetMapping("/getInfoByParentId") - public AjaxResult getInfoByParentId(@RequestParam String parentEquipId) + public AjaxResult getInfoByParentId(@RequestParam String parentEquipId,String type) { - return AjaxResult.success(ipcEquipInfoService.selectIpcEquipInfoListByParentId(parentEquipId)); + return AjaxResult.success(ipcEquipInfoService.selectIpcEquipInfoListByParentId(parentEquipId,type)); } /** @@ -161,9 +161,11 @@ public class IpcEquipInfoController extends BaseController } } + /** * 设备信息上传文件接口 */ + @PreAuthorize("@ss.hasPermi('equip:info:fileUpload')") @PostMapping("/filesUploads") public AjaxResult uploadFiles(List files) { diff --git a/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/maintenance/IpcMaintenanceRecordController.java b/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/maintenance/IpcMaintenanceRecordController.java new file mode 100644 index 0000000..b4d6498 --- /dev/null +++ b/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/maintenance/IpcMaintenanceRecordController.java @@ -0,0 +1,124 @@ +package com.inspur.web.controller.maintenance; + +import com.inspur.common.annotation.Log; +import com.inspur.common.core.controller.BaseController; +import com.inspur.common.core.domain.AjaxResult; +import com.inspur.common.core.page.TableDataInfo; +import com.inspur.common.enums.BusinessType; +import com.inspur.common.utils.poi.ExcelUtil; +import com.inspur.maintenance.domain.IpcMaintenanceRecord; +import com.inspur.maintenance.service.IIpcMaintenanceRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 设备维修记录Controller + * + * @author inspur + * @date 2024-06-13 + */ +@RestController +@RequestMapping("/maintenance/record") +public class IpcMaintenanceRecordController extends BaseController +{ + @Autowired + private IIpcMaintenanceRecordService ipcMaintenanceRecordService; + + /** + * 查询设备维修记录列表 + */ + @PreAuthorize("@ss.hasPermi('maintenance:record:list')") + @GetMapping("/list") + public TableDataInfo list(IpcMaintenanceRecord ipcMaintenanceRecord) + { + startPage(); + List list = ipcMaintenanceRecordService.selectIpcMaintenanceRecordList(ipcMaintenanceRecord); + return getDataTable(list); + } + + /** + * 导出设备维修记录列表 + */ + @PreAuthorize("@ss.hasPermi('maintenance:record:export')") + @Log(title = "设备维修记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, IpcMaintenanceRecord ipcMaintenanceRecord) + { + List list = ipcMaintenanceRecordService.selectIpcMaintenanceRecordList(ipcMaintenanceRecord); + ExcelUtil util = new ExcelUtil(IpcMaintenanceRecord.class); + util.exportExcel(response, list, "设备维修记录数据"); + } + + /** + * 获取设备维修记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('maintenance:record:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) + { + return AjaxResult.success(ipcMaintenanceRecordService.selectIpcMaintenanceRecordById(id)); + } + + /** + * 新增设备维修记录 + */ + @PreAuthorize("@ss.hasPermi('maintenance:record:add')") + @Log(title = "设备维修记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody IpcMaintenanceRecord ipcMaintenanceRecord) + { + int rows = ipcMaintenanceRecordService.insertIpcMaintenanceRecord(ipcMaintenanceRecord); + if(rows == 0){ + return AjaxResult.success("插入失败!",rows); + } + if(rows == -1){ + return AjaxResult.success("存在重复的未完成维修记录,无法新增!",rows); + } + return AjaxResult.success("插入成功!",rows); + } + + /** + * 修改设备维修记录 + */ + @PreAuthorize("@ss.hasPermi('maintenance:record:edit')") + @Log(title = "设备维修记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody IpcMaintenanceRecord ipcMaintenanceRecord) + { + return toAjax(ipcMaintenanceRecordService.updateIpcMaintenanceRecord(ipcMaintenanceRecord)); + } + + /** + * 提交维修记录 + */ + @PreAuthorize("@ss.hasPermi('maintenance:record:submit')") + @Log(title = "设备维修记录", businessType = BusinessType.UPDATE) + @PutMapping("/{id}") + public AjaxResult submit(@PathVariable String id) + { + return toAjax(ipcMaintenanceRecordService.submitIpcMaintenanceRecord(id)); + } + + @PreAuthorize("@ss.hasPermi('maintenance:record:complete')") + @Log(title = "设备维修记录", businessType = BusinessType.UPDATE) + @PutMapping("/complete") + public AjaxResult complete(@RequestBody IpcMaintenanceRecord ipcMaintenanceRecord) + { + return toAjax(ipcMaintenanceRecordService.completeIpcMaintenanceRecord(ipcMaintenanceRecord)); + } + + /** + * 删除设备维修记录 + */ + @PreAuthorize("@ss.hasPermi('maintenance:record:remove')") + @Log(title = "设备维修记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) + { + return toAjax(ipcMaintenanceRecordService.deleteIpcMaintenanceRecordByIds(ids)); + } +} diff --git a/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/scrap/IpcEquipScrappingRecordController.java b/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/scrap/IpcEquipScrappingRecordController.java new file mode 100644 index 0000000..d7d4d75 --- /dev/null +++ b/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/scrap/IpcEquipScrappingRecordController.java @@ -0,0 +1,98 @@ +package com.inspur.web.controller.scrap; + +import com.inspur.common.annotation.Log; +import com.inspur.common.core.controller.BaseController; +import com.inspur.common.core.domain.AjaxResult; +import com.inspur.common.core.page.TableDataInfo; +import com.inspur.common.enums.BusinessType; +import com.inspur.common.utils.poi.ExcelUtil; +import com.inspur.scrap.domain.IpcEquipScrappingRecord; +import com.inspur.scrap.service.IIpcEquipScrappingRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 设备报废记录Controller + * + * @author inspur + * @date 2024-06-13 + */ +@RestController +@RequestMapping("/scrap/record") +public class IpcEquipScrappingRecordController extends BaseController +{ + @Autowired + private IIpcEquipScrappingRecordService ipcEquipScrappingRecordService; + + /** + * 查询设备报废记录列表 + */ + @PreAuthorize("@ss.hasPermi('scrap:record:list')") + @GetMapping("/list") + public TableDataInfo list(IpcEquipScrappingRecord ipcEquipScrappingRecord) + { + startPage(); + List list = ipcEquipScrappingRecordService.selectIpcEquipScrappingRecordList(ipcEquipScrappingRecord); + return getDataTable(list); + } + + /** + * 导出设备报废记录列表 + */ + @PreAuthorize("@ss.hasPermi('scrap:record:export')") + @Log(title = "设备报废记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, IpcEquipScrappingRecord ipcEquipScrappingRecord) + { + List list = ipcEquipScrappingRecordService.selectIpcEquipScrappingRecordList(ipcEquipScrappingRecord); + ExcelUtil util = new ExcelUtil(IpcEquipScrappingRecord.class); + util.exportExcel(response, list, "设备报废记录数据"); + } + + /** + * 获取设备报废记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('scrap:record:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) + { + return AjaxResult.success(ipcEquipScrappingRecordService.selectIpcEquipScrappingRecordById(id)); + } + + /** + * 新增设备报废记录 + */ + @PreAuthorize("@ss.hasPermi('scrap:record:add')") + @Log(title = "设备报废记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody IpcEquipScrappingRecord ipcEquipScrappingRecord) + { + return toAjax(ipcEquipScrappingRecordService.insertIpcEquipScrappingRecord(ipcEquipScrappingRecord)); + } + + /** + * 修改设备报废记录 + */ + @PreAuthorize("@ss.hasPermi('scrap:record:edit')") + @Log(title = "设备报废记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody IpcEquipScrappingRecord ipcEquipScrappingRecord) + { + return toAjax(ipcEquipScrappingRecordService.updateIpcEquipScrappingRecord(ipcEquipScrappingRecord)); + } + + /** + * 删除设备报废记录 + */ + @PreAuthorize("@ss.hasPermi('scrap:record:remove')") + @Log(title = "设备报废记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) + { + return toAjax(ipcEquipScrappingRecordService.deleteIpcEquipScrappingRecordByIds(ids)); + } +} diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/equip/mapper/IpcEquipInfoMapper.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/equip/mapper/IpcEquipInfoMapper.java index ca72fa7..e8a4e21 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/equip/mapper/IpcEquipInfoMapper.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/equip/mapper/IpcEquipInfoMapper.java @@ -48,6 +48,11 @@ public interface IpcEquipInfoMapper */ public List selectIpcEquipInfoListByParentId(String parentEquipId); + /** + * 查询正常运行设备 + */ + public List selectRunningIpcEquipInfoListByParentId(String parentEquipId); + /** * 新增设备信息 * diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/equip/service/IIpcEquipInfoService.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/equip/service/IIpcEquipInfoService.java index 23e39d6..2866129 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/equip/service/IIpcEquipInfoService.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/equip/service/IIpcEquipInfoService.java @@ -42,7 +42,7 @@ public interface IIpcEquipInfoService /** * 通过父节点id获取设备信息 */ - public List selectIpcEquipInfoListByParentId(String parentEquipId); + public List selectIpcEquipInfoListByParentId(String parentEquipId,String type); /** * 新增设备信息 diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/equip/service/impl/IpcEquipInfoServiceImpl.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/equip/service/impl/IpcEquipInfoServiceImpl.java index 5b60a05..b0356d5 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/equip/service/impl/IpcEquipInfoServiceImpl.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/equip/service/impl/IpcEquipInfoServiceImpl.java @@ -78,8 +78,13 @@ public class IpcEquipInfoServiceImpl implements IIpcEquipInfoService /** * 通过父节点id获取设备信息 */ - public List selectIpcEquipInfoListByParentId(String parentEquipId){ - return ipcEquipInfoMapper.selectIpcEquipInfoListByParentId(parentEquipId); + public List selectIpcEquipInfoListByParentId(String parentEquipId,String type){ + if(type == null){ + return ipcEquipInfoMapper.selectIpcEquipInfoListByParentId(parentEquipId); + }else { + return ipcEquipInfoMapper.selectRunningIpcEquipInfoListByParentId(parentEquipId); + } + } /** diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/maintenance/domain/IpcMaintenanceRecord.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/maintenance/domain/IpcMaintenanceRecord.java new file mode 100644 index 0000000..af3568c --- /dev/null +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/maintenance/domain/IpcMaintenanceRecord.java @@ -0,0 +1,264 @@ +package com.inspur.maintenance.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.inspur.common.annotation.Excel; +import com.inspur.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * 设备维修记录对象 ipc_maintenance_record + * + * @author inspur + * @date 2024-06-13 + */ +public class IpcMaintenanceRecord extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 维修记录表主键id */ + private String id; + + /** 维修工单编号 */ + @Excel(name = "维修工单编号") + private String maintenanceOrderNum; + + /** 设备id */ + @Excel(name = "设备id") + private String equipId; + + /** 维修设备名称 */ + private String equipName; + + /** 维修人id */ + @Excel(name = "维修人id") + private Integer executorId; + + /** 维修人名 */ + private String executorName; + + /** 设备组件名称 */ + @Excel(name = "设备组件名称") + private String maintenanceComponent; + + /** 维修内容 */ + @Excel(name = "维修内容") + private String maintenanceContent; + + /** 维修开始时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @Excel(name = "维修开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date maintenanceStartTime; + + /** 状态(0:维修中,1:已完成) */ + @Excel(name = "状态", readConverterExp = "0=:维修中,1:已完成") + private String status; + + /** 维修结束时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @Excel(name = "维修结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date maintenanceEndTime; + + /** 所属部门id */ + @Excel(name = "所属部门id") + private Long deptId; + + /** 备件出库单id */ + @Excel(name = "备件出库单id") + private String sparePartsOutboundId; + + /** 设备报废记录id */ + @Excel(name = "设备报废记录id") + private String scrappingRecordId; + + /** + * 设备报废单号 + */ + private String scrappingRecordNum; + + /** + * 报废时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + private String scrappingTime; + + /** 备件id */ + @Excel(name = "备件id") + private String sparePartsId; + + public void setId(String id) + { + this.id = id; + } + + public String getId() + { + return id; + } + public void setMaintenanceOrderNum(String maintenanceOrderNum) + { + this.maintenanceOrderNum = maintenanceOrderNum; + } + + public String getMaintenanceOrderNum() + { + return maintenanceOrderNum; + } + public void setEquipId(String equipId) + { + this.equipId = equipId; + } + + public String getEquipId() + { + return equipId; + } + public void setEquipName(String equipName) + { + this.equipName = equipName; + } + + public String getEquipName() + { + return equipName; + } + public void setExecutorId(Integer executorId) + { + this.executorId = executorId; + } + + public Integer getExecutorId() + { + return executorId; + } + public void setExecutorName(String executorName) + { + this.executorName = executorName; + } + + public String getExecutorName() + { + return executorName; + } + public void setMaintenanceComponent(String maintenanceComponent) + { + this.maintenanceComponent = maintenanceComponent; + } + + public String getMaintenanceComponent() + { + return maintenanceComponent; + } + public void setMaintenanceContent(String maintenanceContent) + { + this.maintenanceContent = maintenanceContent; + } + + public String getMaintenanceContent() + { + return maintenanceContent; + } + public void setMaintenanceStartTime(Date maintenanceStartTime) + { + this.maintenanceStartTime = maintenanceStartTime; + } + + public Date getMaintenanceStartTime() + { + return maintenanceStartTime; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setMaintenanceEndTime(Date maintenanceEndTime) + { + this.maintenanceEndTime = maintenanceEndTime; + } + + public Date getMaintenanceEndTime() + { + return maintenanceEndTime; + } + public void setDeptId(Long deptId) + { + this.deptId = deptId; + } + + public Long getDeptId() + { + return deptId; + } + public void setSparePartsOutboundId(String sparePartsOutboundId) + { + this.sparePartsOutboundId = sparePartsOutboundId; + } + + public String getSparePartsOutboundId() + { + return sparePartsOutboundId; + } + public void setScrappingRecordId(String scrappingRecordId) + { + this.scrappingRecordId = scrappingRecordId; + } + + public String getScrappingRecordId() + { + return scrappingRecordId; + } + + public String getScrappingRecordNum() { + return scrappingRecordNum; + } + + public void setScrappingRecordNum(String scrappingRecordNum) { + this.scrappingRecordNum = scrappingRecordNum; + } + + public String getScrappingTime() { + return scrappingTime; + } + + public void setScrappingTime(String scrappingTime) { + this.scrappingTime = scrappingTime; + } + + public void setSparePartsId(String sparePartsId) + { + this.sparePartsId = sparePartsId; + } + + public String getSparePartsId() + { + return sparePartsId; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("maintenanceOrderNum", getMaintenanceOrderNum()) + .append("equipId", getEquipId()) + .append("equipName", getEquipName()) + .append("executorId", getExecutorId()) + .append("executorName", getExecutorName()) + .append("maintenanceComponent", getMaintenanceComponent()) + .append("maintenanceContent", getMaintenanceContent()) + .append("maintenanceStartTime", getMaintenanceStartTime()) + .append("status", getStatus()) + .append("maintenanceEndTime", getMaintenanceEndTime()) + .append("deptId", getDeptId()) + .append("sparePartsOutboundId", getSparePartsOutboundId()) + .append("scrappingRecordId", getScrappingRecordId()) + .append("sparePartsId", getSparePartsId()) + .toString(); + } +} diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/maintenance/mapper/IpcMaintenanceRecordMapper.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/maintenance/mapper/IpcMaintenanceRecordMapper.java new file mode 100644 index 0000000..5c58481 --- /dev/null +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/maintenance/mapper/IpcMaintenanceRecordMapper.java @@ -0,0 +1,62 @@ +package com.inspur.maintenance.mapper; + +import com.inspur.maintenance.domain.IpcMaintenanceRecord; + +import java.util.List; + +/** + * 设备维修记录Mapper接口 + * + * @author inspur + * @date 2024-06-13 + */ +public interface IpcMaintenanceRecordMapper +{ + /** + * 查询设备维修记录 + * + * @param id 设备维修记录主键 + * @return 设备维修记录 + */ + public IpcMaintenanceRecord selectIpcMaintenanceRecordById(String id); + + /** + * 查询设备维修记录列表 + * + * @param ipcMaintenanceRecord 设备维修记录 + * @return 设备维修记录集合 + */ + public List selectIpcMaintenanceRecordList(IpcMaintenanceRecord ipcMaintenanceRecord); + + /** + * 新增设备维修记录 + * + * @param ipcMaintenanceRecord 设备维修记录 + * @return 结果 + */ + public int insertIpcMaintenanceRecord(IpcMaintenanceRecord ipcMaintenanceRecord); + + /** + * 修改设备维修记录 + * + * @param ipcMaintenanceRecord 设备维修记录 + * @return 结果 + */ + public int updateIpcMaintenanceRecord(IpcMaintenanceRecord ipcMaintenanceRecord); + + /** + * 删除设备维修记录 + * + * @param id 设备维修记录主键 + * @return 结果 + */ + public int deleteIpcMaintenanceRecordById(String id); + + /** + * 批量删除设备维修记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteIpcMaintenanceRecordByIds(String[] ids); +} diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/maintenance/service/IIpcMaintenanceRecordService.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/maintenance/service/IIpcMaintenanceRecordService.java new file mode 100644 index 0000000..2b00363 --- /dev/null +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/maintenance/service/IIpcMaintenanceRecordService.java @@ -0,0 +1,72 @@ +package com.inspur.maintenance.service; + +import com.inspur.maintenance.domain.IpcMaintenanceRecord; + +import java.util.List; + +/** + * 设备维修记录Service接口 + * + * @author inspur + * @date 2024-06-13 + */ +public interface IIpcMaintenanceRecordService +{ + /** + * 查询设备维修记录 + * + * @param id 设备维修记录主键 + * @return 设备维修记录 + */ + public IpcMaintenanceRecord selectIpcMaintenanceRecordById(String id); + + /** + * 查询设备维修记录列表 + * + * @param ipcMaintenanceRecord 设备维修记录 + * @return 设备维修记录集合 + */ + public List selectIpcMaintenanceRecordList(IpcMaintenanceRecord ipcMaintenanceRecord); + + /** + * 新增设备维修记录 + * + * @param ipcMaintenanceRecord 设备维修记录 + * @return 结果 + */ + public int insertIpcMaintenanceRecord(IpcMaintenanceRecord ipcMaintenanceRecord); + + /** + * 修改设备维修记录 + * + * @param ipcMaintenanceRecord 设备维修记录 + * @return 结果 + */ + public int updateIpcMaintenanceRecord(IpcMaintenanceRecord ipcMaintenanceRecord); + + /** + * 维修单提交 + */ + public int submitIpcMaintenanceRecord(String id); + + /** + * 维修单完成 + */ + public int completeIpcMaintenanceRecord(IpcMaintenanceRecord ipcMaintenanceRecord); + + /** + * 批量删除设备维修记录 + * + * @param ids 需要删除的设备维修记录主键集合 + * @return 结果 + */ + public int deleteIpcMaintenanceRecordByIds(String[] ids); + + /** + * 删除设备维修记录信息 + * + * @param id 设备维修记录主键 + * @return 结果 + */ + public int deleteIpcMaintenanceRecordById(String id); +} diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/maintenance/service/impl/IpcMaintenanceRecordServiceImpl.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/maintenance/service/impl/IpcMaintenanceRecordServiceImpl.java new file mode 100644 index 0000000..6abf7c5 --- /dev/null +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/maintenance/service/impl/IpcMaintenanceRecordServiceImpl.java @@ -0,0 +1,161 @@ +package com.inspur.maintenance.service.impl; + +import com.inspur.common.utils.uuid.IdUtils; +import com.inspur.maintenance.domain.IpcMaintenanceRecord; +import com.inspur.maintenance.mapper.IpcMaintenanceRecordMapper; +import com.inspur.maintenance.service.IIpcMaintenanceRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDate; +import java.time.LocalTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.List; + +/** + * 设备维修记录Service业务层处理 + * + * @author inspur + * @date 2024-06-13 + */ +@Service +public class IpcMaintenanceRecordServiceImpl implements IIpcMaintenanceRecordService +{ + @Autowired + private IpcMaintenanceRecordMapper ipcMaintenanceRecordMapper; + + /** + * 查询设备维修记录 + * + * @param id 设备维修记录主键 + * @return 设备维修记录 + */ + @Override + public IpcMaintenanceRecord selectIpcMaintenanceRecordById(String id) + { + return ipcMaintenanceRecordMapper.selectIpcMaintenanceRecordById(id); + } + + /** + * 查询设备维修记录列表 + * + * @param ipcMaintenanceRecord 设备维修记录 + * @return 设备维修记录 + */ + @Override + public List selectIpcMaintenanceRecordList(IpcMaintenanceRecord ipcMaintenanceRecord) + { + return ipcMaintenanceRecordMapper.selectIpcMaintenanceRecordList(ipcMaintenanceRecord); + } + + /** + * 新增设备维修记录 + * + * @param ipcMaintenanceRecord 设备维修记录 + * @return 结果 + */ + @Override + public int insertIpcMaintenanceRecord(IpcMaintenanceRecord ipcMaintenanceRecord) + { + //先通过设备id和开始时间查询是否有重复维修记录 + IpcMaintenanceRecord query = new IpcMaintenanceRecord(); + query.setEquipId(ipcMaintenanceRecord.getEquipId()); +// Date startTime = ipcMaintenanceRecord.getMaintenanceStartTime(); +// Map params = new HashMap<>(); +// params.put("beginMaintenanceStartTime", getStartofDay(startTime)); +// params.put("endMaintenanceStartTime", getEndofDay(startTime)); +// query.setParams(params); + query.setStatus("0"); + List existData = ipcMaintenanceRecordMapper.selectIpcMaintenanceRecordList(query); + if(existData.size() > 0){ + return -1; + } + ipcMaintenanceRecord.setId(IdUtils.simpleUUID()); + ipcMaintenanceRecord.setStatus("2");//未提交 + ipcMaintenanceRecord.setMaintenanceOrderNum("WX" + System.currentTimeMillis() + IdUtils.randomUUID().substring(0, 5)); + return ipcMaintenanceRecordMapper.insertIpcMaintenanceRecord(ipcMaintenanceRecord); + } + + /** + * 修改设备维修记录 + * + * @param ipcMaintenanceRecord 设备维修记录 + * @return 结果 + */ + @Override + public int updateIpcMaintenanceRecord(IpcMaintenanceRecord ipcMaintenanceRecord) + { + return ipcMaintenanceRecordMapper.updateIpcMaintenanceRecord(ipcMaintenanceRecord); + } + + /** + * 维修单提交 + */ + public int submitIpcMaintenanceRecord(String id){ + IpcMaintenanceRecord data = new IpcMaintenanceRecord(); + data.setId(id); + data.setStatus("0"); + return ipcMaintenanceRecordMapper.updateIpcMaintenanceRecord(data); + } + + /** + * 维修单完成 + */ + public int completeIpcMaintenanceRecord(IpcMaintenanceRecord ipcMaintenanceRecord){ + ipcMaintenanceRecord.setStatus("1"); + ipcMaintenanceRecord.setMaintenanceEndTime(new Date()); + return ipcMaintenanceRecordMapper.updateIpcMaintenanceRecord(ipcMaintenanceRecord); + } + + /** + * 批量删除设备维修记录 + * + * @param ids 需要删除的设备维修记录主键 + * @return 结果 + */ + @Override + public int deleteIpcMaintenanceRecordByIds(String[] ids) + { + return ipcMaintenanceRecordMapper.deleteIpcMaintenanceRecordByIds(ids); + } + + /** + * 删除设备维修记录信息 + * + * @param id 设备维修记录主键 + * @return 结果 + */ + @Override + public int deleteIpcMaintenanceRecordById(String id) + { + return ipcMaintenanceRecordMapper.deleteIpcMaintenanceRecordById(id); + } + + /** + * 获取给定日期开始时间 + * @param date 给定日期 + * @return 开始时间 + */ + private String getStartofDay(Date date) { + LocalDate localDate = date.toInstant() + .atZone(ZoneId.systemDefault()) // 使用系统默认时区 + .toLocalDate(); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + return formatter.format(localDate.atStartOfDay(ZoneId.systemDefault())); + } + + /** + * 获取给定时间的结束时间 + * @param date 给定日期 + * @return 结束时间 + */ + private String getEndofDay(Date date) { + LocalDate localDate = date.toInstant() + .atZone(ZoneId.systemDefault()) // 使用系统默认时区 + .toLocalDate(); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + return formatter.format(localDate.atTime(LocalTime.MAX).atZone(ZoneId.systemDefault())); + } +} diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/scrap/domain/IpcEquipScrappingRecord.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/scrap/domain/IpcEquipScrappingRecord.java new file mode 100644 index 0000000..8a74185 --- /dev/null +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/scrap/domain/IpcEquipScrappingRecord.java @@ -0,0 +1,211 @@ +package com.inspur.scrap.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.inspur.common.annotation.Excel; +import com.inspur.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * 设备报废记录对象 ipc_equip_scrapping_record + * + * @author inspur + * @date 2024-06-13 + */ +public class IpcEquipScrappingRecord extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 设备报废记录id */ + private String id; + + /** 报废设备id */ + + private String equipId; + + /** + * 设备名 + */ + @Excel(name = "报废设备") + private String equipName; + + /** + * 报废记录单号 + */ + @Excel(name = "报废记录单号") + private String scrappingRecordNum; + + /** 报废时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "报废时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date scrappingTime; + + /** 报废原因 */ + @Excel(name = "报废原因") + private String scrappingReason; + + /** 报废处理方式 */ + @Excel(name = "报废处理方式") + private String scrappingTreatment; + + /** 报废记录人id */ + + private Long creatorId; + + /** + * 报废记录人名称 + */ + @Excel(name = "报废记录人") + private String creatorName; + + /** 报废处理人id */ + private Long handlerId; + + /** + * 报废处理人名 + */ + @Excel(name = "报废处理人") + private String handlerName; + /** 报废设备照片路径 */ + @Excel(name = "报废设备照片",cellType = Excel.ColumnType.IMAGE) + private String equipPicPath; + + /** 所属部门id */ + + private Long deptId; + + public void setId(String id) + { + this.id = id; + } + + public String getId() + { + return id; + } + public void setEquipId(String equipId) + { + this.equipId = equipId; + } + + public String getEquipId() + { + return equipId; + } + + public String getEquipName() { + return equipName; + } + + public void setEquipName(String equipName) { + this.equipName = equipName; + } + + public String getScrappingRecordNum() { + return scrappingRecordNum; + } + + public void setScrappingRecordNum(String scrappingRecordNum) { + this.scrappingRecordNum = scrappingRecordNum; + } + + public void setScrappingTime(Date scrappingTime) + { + this.scrappingTime = scrappingTime; + } + + public Date getScrappingTime() + { + return scrappingTime; + } + public void setScrappingReason(String scrappingReason) + { + this.scrappingReason = scrappingReason; + } + + public String getScrappingReason() + { + return scrappingReason; + } + public void setScrappingTreatment(String scrappingTreatment) + { + this.scrappingTreatment = scrappingTreatment; + } + + public String getScrappingTreatment() + { + return scrappingTreatment; + } + public void setCreatorId(Long creatorId) + { + this.creatorId = creatorId; + } + + public Long getCreatorId() + { + return creatorId; + } + + public String getCreatorName() { + return creatorName; + } + + public void setCreatorName(String creatorName) { + this.creatorName = creatorName; + } + + public void setHandlerId(Long handlerId) + { + this.handlerId = handlerId; + } + + public Long getHandlerId() + { + return handlerId; + } + + public String getHandlerName() { + return handlerName; + } + + public void setHandlerName(String handlerName) { + this.handlerName = handlerName; + } + + public void setEquipPicPath(String equipPicPath) + { + this.equipPicPath = equipPicPath; + } + + public String getEquipPicPath() + { + return equipPicPath; + } + public void setDeptId(Long deptId) + { + this.deptId = deptId; + } + + public Long getDeptId() + { + return deptId; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("equipId", getEquipId()) + .append("scrappingTime", getScrappingTime()) + .append("scrappingReason", getScrappingReason()) + .append("scrappingTreatment", getScrappingTreatment()) + .append("creatorId", getCreatorId()) + .append("handlerId", getHandlerId()) + .append("equipPicPath", getEquipPicPath()) + .append("deptId", getDeptId()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/scrap/mapper/IpcEquipScrappingRecordMapper.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/scrap/mapper/IpcEquipScrappingRecordMapper.java new file mode 100644 index 0000000..81e6a15 --- /dev/null +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/scrap/mapper/IpcEquipScrappingRecordMapper.java @@ -0,0 +1,62 @@ +package com.inspur.scrap.mapper; + +import com.inspur.scrap.domain.IpcEquipScrappingRecord; + +import java.util.List; + +/** + * 设备报废记录Mapper接口 + * + * @author inspur + * @date 2024-06-13 + */ +public interface IpcEquipScrappingRecordMapper +{ + /** + * 查询设备报废记录 + * + * @param id 设备报废记录主键 + * @return 设备报废记录 + */ + public IpcEquipScrappingRecord selectIpcEquipScrappingRecordById(String id); + + /** + * 查询设备报废记录列表 + * + * @param ipcEquipScrappingRecord 设备报废记录 + * @return 设备报废记录集合 + */ + public List selectIpcEquipScrappingRecordList(IpcEquipScrappingRecord ipcEquipScrappingRecord); + + /** + * 新增设备报废记录 + * + * @param ipcEquipScrappingRecord 设备报废记录 + * @return 结果 + */ + public int insertIpcEquipScrappingRecord(IpcEquipScrappingRecord ipcEquipScrappingRecord); + + /** + * 修改设备报废记录 + * + * @param ipcEquipScrappingRecord 设备报废记录 + * @return 结果 + */ + public int updateIpcEquipScrappingRecord(IpcEquipScrappingRecord ipcEquipScrappingRecord); + + /** + * 删除设备报废记录 + * + * @param id 设备报废记录主键 + * @return 结果 + */ + public int deleteIpcEquipScrappingRecordById(String id); + + /** + * 批量删除设备报废记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteIpcEquipScrappingRecordByIds(String[] ids); +} diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/scrap/service/IIpcEquipScrappingRecordService.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/scrap/service/IIpcEquipScrappingRecordService.java new file mode 100644 index 0000000..4045cc0 --- /dev/null +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/scrap/service/IIpcEquipScrappingRecordService.java @@ -0,0 +1,62 @@ +package com.inspur.scrap.service; + +import com.inspur.scrap.domain.IpcEquipScrappingRecord; + +import java.util.List; + +/** + * 设备报废记录Service接口 + * + * @author inspur + * @date 2024-06-13 + */ +public interface IIpcEquipScrappingRecordService +{ + /** + * 查询设备报废记录 + * + * @param id 设备报废记录主键 + * @return 设备报废记录 + */ + public IpcEquipScrappingRecord selectIpcEquipScrappingRecordById(String id); + + /** + * 查询设备报废记录列表 + * + * @param ipcEquipScrappingRecord 设备报废记录 + * @return 设备报废记录集合 + */ + public List selectIpcEquipScrappingRecordList(IpcEquipScrappingRecord ipcEquipScrappingRecord); + + /** + * 新增设备报废记录 + * + * @param ipcEquipScrappingRecord 设备报废记录 + * @return 结果 + */ + public int insertIpcEquipScrappingRecord(IpcEquipScrappingRecord ipcEquipScrappingRecord); + + /** + * 修改设备报废记录 + * + * @param ipcEquipScrappingRecord 设备报废记录 + * @return 结果 + */ + public int updateIpcEquipScrappingRecord(IpcEquipScrappingRecord ipcEquipScrappingRecord); + + /** + * 批量删除设备报废记录 + * + * @param ids 需要删除的设备报废记录主键集合 + * @return 结果 + */ + public int deleteIpcEquipScrappingRecordByIds(String[] ids); + + /** + * 删除设备报废记录信息 + * + * @param id 设备报废记录主键 + * @return 结果 + */ + public int deleteIpcEquipScrappingRecordById(String id); +} diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/scrap/service/impl/IpcEquipScrappingRecordServiceImpl.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/scrap/service/impl/IpcEquipScrappingRecordServiceImpl.java new file mode 100644 index 0000000..a031c19 --- /dev/null +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/scrap/service/impl/IpcEquipScrappingRecordServiceImpl.java @@ -0,0 +1,99 @@ +package com.inspur.scrap.service.impl; + +import com.inspur.common.utils.SecurityUtils; +import com.inspur.common.utils.uuid.IdUtils; +import com.inspur.scrap.domain.IpcEquipScrappingRecord; +import com.inspur.scrap.mapper.IpcEquipScrappingRecordMapper; +import com.inspur.scrap.service.IIpcEquipScrappingRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 设备报废记录Service业务层处理 + * + * @author inspur + * @date 2024-06-13 + */ +@Service +public class IpcEquipScrappingRecordServiceImpl implements IIpcEquipScrappingRecordService +{ + @Autowired + private IpcEquipScrappingRecordMapper ipcEquipScrappingRecordMapper; + + /** + * 查询设备报废记录 + * + * @param id 设备报废记录主键 + * @return 设备报废记录 + */ + @Override + public IpcEquipScrappingRecord selectIpcEquipScrappingRecordById(String id) + { + return ipcEquipScrappingRecordMapper.selectIpcEquipScrappingRecordById(id); + } + + /** + * 查询设备报废记录列表 + * + * @param ipcEquipScrappingRecord 设备报废记录 + * @return 设备报废记录 + */ + @Override + public List selectIpcEquipScrappingRecordList(IpcEquipScrappingRecord ipcEquipScrappingRecord) + { + return ipcEquipScrappingRecordMapper.selectIpcEquipScrappingRecordList(ipcEquipScrappingRecord); + } + + /** + * 新增设备报废记录 + * + * @param ipcEquipScrappingRecord 设备报废记录 + * @return 结果 + */ + @Override + public int insertIpcEquipScrappingRecord(IpcEquipScrappingRecord ipcEquipScrappingRecord) + { + ipcEquipScrappingRecord.setId(IdUtils.simpleUUID()); + ipcEquipScrappingRecord.setCreatorId(SecurityUtils.getLoginUser().getUserId()); + ipcEquipScrappingRecord.setScrappingRecordNum("BF" + System.currentTimeMillis() + IdUtils.randomUUID().substring(0, 5)); + return ipcEquipScrappingRecordMapper.insertIpcEquipScrappingRecord(ipcEquipScrappingRecord); + } + + /** + * 修改设备报废记录 + * + * @param ipcEquipScrappingRecord 设备报废记录 + * @return 结果 + */ + @Override + public int updateIpcEquipScrappingRecord(IpcEquipScrappingRecord ipcEquipScrappingRecord) + { + return ipcEquipScrappingRecordMapper.updateIpcEquipScrappingRecord(ipcEquipScrappingRecord); + } + + /** + * 批量删除设备报废记录 + * + * @param ids 需要删除的设备报废记录主键 + * @return 结果 + */ + @Override + public int deleteIpcEquipScrappingRecordByIds(String[] ids) + { + return ipcEquipScrappingRecordMapper.deleteIpcEquipScrappingRecordByIds(ids); + } + + /** + * 删除设备报废记录信息 + * + * @param id 设备报废记录主键 + * @return 结果 + */ + @Override + public int deleteIpcEquipScrappingRecordById(String id) + { + return ipcEquipScrappingRecordMapper.deleteIpcEquipScrappingRecordById(id); + } +} diff --git a/zfipc-server/zfipc-system/src/main/resources/mapper/equip/IpcEquipInfoMapper.xml b/zfipc-server/zfipc-system/src/main/resources/mapper/equip/IpcEquipInfoMapper.xml index 59f7469..91cef83 100644 --- a/zfipc-server/zfipc-system/src/main/resources/mapper/equip/IpcEquipInfoMapper.xml +++ b/zfipc-server/zfipc-system/src/main/resources/mapper/equip/IpcEquipInfoMapper.xml @@ -138,6 +138,13 @@ WHERE parent_equip_id = #{parentEquipId} + + + insert into ipc_equip_info diff --git a/zfipc-server/zfipc-system/src/main/resources/mapper/maintenance/IpcMaintenanceRecordMapper.xml b/zfipc-server/zfipc-system/src/main/resources/mapper/maintenance/IpcMaintenanceRecordMapper.xml new file mode 100644 index 0000000..d163c9f --- /dev/null +++ b/zfipc-server/zfipc-system/src/main/resources/mapper/maintenance/IpcMaintenanceRecordMapper.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select a.id, a.maintenance_order_num, a.equip_id, b.equip_name, a.executor_id, c.nick_name as executor_name, a.maintenance_component, a.maintenance_content, a.maintenance_start_time, a.status, a.maintenance_end_time, a.dept_id, a.spare_parts_outbound_id, a.scrapping_record_id,d.scrapping_record_num,d.scrapping_time,a.spare_parts_id from ipc_maintenance_record a + left join ipc_equip_info b on a.equip_id = b.id + left join sys_user c on a.executor_id = c.user_id + left join ipc_equip_scrapping_record d on a.scrapping_record_id = d.id + + + + + + + + insert into ipc_maintenance_record + + id, + maintenance_order_num, + equip_id, + equip_name, + executor_id, + executor_name, + maintenance_component, + maintenance_content, + maintenance_start_time, + status, + maintenance_end_time, + dept_id, + spare_parts_outbound_id, + scrapping_record_id, + spare_parts_id, + + + #{id}, + #{maintenanceOrderNum}, + #{equipId}, + #{equipName}, + #{executorId}, + #{executorName}, + #{maintenanceComponent}, + #{maintenanceContent}, + #{maintenanceStartTime}, + #{status}, + #{maintenanceEndTime}, + #{deptId}, + #{sparePartsOutboundId}, + #{scrappingRecordId}, + #{sparePartsId}, + + + + + update ipc_maintenance_record + + maintenance_order_num = #{maintenanceOrderNum}, + equip_id = #{equipId}, + equip_name = #{equipName}, + executor_id = #{executorId}, + executor_name = #{executorName}, + maintenance_component = #{maintenanceComponent}, + maintenance_content = #{maintenanceContent}, + maintenance_start_time = #{maintenanceStartTime}, + status = #{status}, + maintenance_end_time = #{maintenanceEndTime}, + dept_id = #{deptId}, + spare_parts_outbound_id = #{sparePartsOutboundId}, + scrapping_record_id = #{scrappingRecordId}, + spare_parts_id = #{sparePartsId}, + + where id = #{id} + + + + delete from ipc_maintenance_record where id = #{id} + + + + delete from ipc_maintenance_record where id in + + #{id} + + + \ No newline at end of file diff --git a/zfipc-server/zfipc-system/src/main/resources/mapper/scrap/IpcEquipScrappingRecordMapper.xml b/zfipc-server/zfipc-system/src/main/resources/mapper/scrap/IpcEquipScrappingRecordMapper.xml new file mode 100644 index 0000000..1fc1b08 --- /dev/null +++ b/zfipc-server/zfipc-system/src/main/resources/mapper/scrap/IpcEquipScrappingRecordMapper.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + select a.id, a.equip_id,b.equip_name,a.scrapping_record_num, a.scrapping_time, a.scrapping_reason, a.scrapping_treatment, a.creator_id,c.nick_name as creator_name, d.nick_name as handler_name, a.handler_id, a.equip_pic_path, a.dept_id, a.remark from ipc_equip_scrapping_record a + left join ipc_equip_info b on a.equip_id = b.id + left join sys_user c on a.creator_id = c.user_id + left join sys_user d on a.handler_id = d.user_id + + + + + + + + insert into ipc_equip_scrapping_record + + id, + equip_id, + scrapping_record_num, + scrapping_time, + scrapping_reason, + scrapping_treatment, + creator_id, + handler_id, + equip_pic_path, + dept_id, + remark, + + + #{id}, + #{equipId}, + #{scrappingRecordNum}, + #{scrappingTime}, + #{scrappingReason}, + #{scrappingTreatment}, + #{creatorId}, + #{handlerId}, + #{equipPicPath}, + #{deptId}, + #{remark}, + + + + + update ipc_equip_scrapping_record + + equip_id = #{equipId}, + scrapping_time = #{scrappingTime}, + scrapping_reason = #{scrappingReason}, + scrapping_treatment = #{scrappingTreatment}, + creator_id = #{creatorId}, + handler_id = #{handlerId}, + equip_pic_path = #{equipPicPath}, + dept_id = #{deptId}, + remark = #{remark}, + + where id = #{id} + + + + delete from ipc_equip_scrapping_record where id = #{id} + + + + delete from ipc_equip_scrapping_record where id in + + #{id} + + + \ No newline at end of file diff --git a/zfipc-ui/src/api/maintenance/record.js b/zfipc-ui/src/api/maintenance/record.js new file mode 100644 index 0000000..31b249e --- /dev/null +++ b/zfipc-ui/src/api/maintenance/record.js @@ -0,0 +1,61 @@ +import request from "@/utils/request"; + +// 查询设备维修记录列表 +export function listMaintRecord(query) { + return request({ + url: "/maintenance/record/list", + method: "get", + params: query, + }); +} + +// 查询设备维修记录详细 +export function getMaintRecord(id) { + return request({ + url: "/maintenance/record/" + id, + method: "get", + }); +} + +// 新增设备维修记录 +export function addMaintRecord(data) { + return request({ + url: "/maintenance/record", + method: "post", + data: data, + }); +} + +// 修改设备维修记录 +export function updateMaintRecord(data) { + return request({ + url: "/maintenance/record", + method: "put", + data: data, + }); +} + +// 提交设备维修记录 +export function submitMaintRecord(id) { + return request({ + url: "/maintenance/record/" + id, + method: "put", + }); +} + +// 修改设备维修记录 +export function completeMaintRecord(data) { + return request({ + url: "/maintenance/record/complete", + method: "put", + data: data, + }); +} + +// 删除设备维修记录 +export function delMaintRecord(id) { + return request({ + url: "/maintenance/record/" + id, + method: "delete", + }); +} diff --git a/zfipc-ui/src/api/scrap/record.js b/zfipc-ui/src/api/scrap/record.js new file mode 100644 index 0000000..b20a708 --- /dev/null +++ b/zfipc-ui/src/api/scrap/record.js @@ -0,0 +1,44 @@ +import request from "@/utils/request"; + +// 查询设备报废记录列表 +export function listScrapRecord(query) { + return request({ + url: "/scrap/record/list", + method: "get", + params: query, + }); +} + +// 查询设备报废记录详细 +export function getScrapRecord(id) { + return request({ + url: "/scrap/record/" + id, + method: "get", + }); +} + +// 新增设备报废记录 +export function addScrapRecord(data) { + return request({ + url: "/scrap/record", + method: "post", + data: data, + }); +} + +// 修改设备报废记录 +export function updateScrapRecord(data) { + return request({ + url: "/scrap/record", + method: "put", + data: data, + }); +} + +// 删除设备报废记录 +export function delScrapRecord(id) { + return request({ + url: "/scrap/record/" + id, + method: "delete", + }); +} diff --git a/zfipc-ui/src/api/upkeep/record.js b/zfipc-ui/src/api/upkeep/record.js index 88cb429..882e76e 100644 --- a/zfipc-ui/src/api/upkeep/record.js +++ b/zfipc-ui/src/api/upkeep/record.js @@ -1,7 +1,7 @@ import request from "@/utils/request"; // 查询保养计划列表 -export function listRecord(query) { +export function listUpkeepRecord(query) { return request({ url: "/upkeep/record/list", method: "get", diff --git a/zfipc-ui/src/views/eqmanagement/eqinfo/index.vue b/zfipc-ui/src/views/eqmanagement/eqinfo/index.vue index 14c6946..a42efed 100644 --- a/zfipc-ui/src/views/eqmanagement/eqinfo/index.vue +++ b/zfipc-ui/src/views/eqmanagement/eqinfo/index.vue @@ -1,87 +1,121 @@ @@ -827,6 +867,442 @@ --> + + + + + + + 设备维保详情 + + + + {{ this.detailsForm.equipNum }} + + + + + {{ this.detailsForm.equipName }} + + + + + + {{ this.detailsForm.equipCategoryName ? this.detailsForm.equipCategoryName : "无"}} + + + + + {{ this.detailsForm.parentEquipName ? this.detailsForm.parentEquipName : "无" }} + + + + + {{ this.detailsForm.equipProductionDate ? this.detailsForm.equipProductionDate : "无"}} + + + + + {{ this.detailsForm.equipManufacturer ? this.detailsForm.equipManufacturer : "无"}} + + + + + + {{ this.detailsForm.equipSerialNum ? this.detailsForm.equipSerialNum : "无"}} + + + + + + {{ this.detailsForm.equipInstallationLocation ? this.detailsForm.equipInstallationLocation : "无"}} + + + + + {{ this.detailsForm.equipPurchaseDate ? this.detailsForm.equipPurchaseDate : "无"}} + + + + + {{ this.detailsForm.equipPrice > 0.0 ? this.detailsForm.equipPurchaseDate : "无"}} + + + + + + + + + + + + + + + + + + {{ this.detailsForm.deptName }} + + + + + + + + + + + {{ this.detailsForm.equipTechnicalSpecifications ? this.detailsForm.equipTechnicalSpecifications : "无" }} + + + + + + + + + + + + {{ this.detailsForm.remark ? this.detailsForm.remark : "无"}} + + + + + + + + + + + +
+ 维修信息 +
+ + + + + + + + + + + + + + + +
+ +
+ 保养信息 +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
@@ -856,13 +1332,22 @@ import { Loading } from "element-ui"; import ElImageViewer from "element-ui/packages/image/src/image-viewer"; import { deptTreeSelect } from "@/api/system/user"; import _ from "lodash"; +import { listUpkeepRecord } from "@/api/upkeep/record"; +import { listMaintRecord } from "@/api/maintenance/record"; export default { name: "Info", components: { Treeselect, ElImageViewer, }, - dicts: ["equip_level", "equip_danger_level", "equip_status"], + dicts: [ + "equip_level", + "equip_danger_level", + "equip_status", + "upkeep_priority", + "upkeep_plan_complete_status", + "maintenance_status", + ], data() { return { // 遮罩层 @@ -1114,8 +1599,46 @@ export default { label: "label", children: "children", }, + //设备台账详情 + selectedEquipId: null, + detailsTitle: "设备台账详情", + detailsOpen: false, + detailsForm: {}, + //设备维保 + upkeepTitle: "设备维保信息", + upkeepOpen: false, + //维修信息 + maintLoading: false, + maintList: [], + maintTotal: 0, + queryParamsMaint: { + pageNum: 1, + pageSize: 10, + }, + //保养信息 + upkeepLoading: false, + upkeepList: [], + upkeepTotal: 0, + queryParamsUpkeep: { + pageNum: 1, + pageSize: 10, + }, + // 部门名称 + deptName: undefined, + // 部门树选项 + deptOptions: undefined, + defaultProps: { + children: "children", + label: "label", + }, }; }, + watch: { + // 根据名称筛选部门树 + deptName(val) { + this.$refs.tree.filter(val); + }, + }, created() { this.getList(); // this.getCategoryTree(); @@ -1123,10 +1646,69 @@ export default { this.getDeptTree(); }, methods: { + // 筛选节点 + filterNode(value, data) { + if (!value) return true; + return data.label.indexOf(value) !== -1; + }, + // 节点单击事件 + handleNodeClick(data) { + this.queryParams.deptId = data.id; + this.handleQuery(); + }, + upkeepCancel() { + this.upkeepOpen = false; + this.maintList = []; + this.maintTotal = 0; + this.upkeepList = []; + this.upkeepTotal = 0; + }, + //维修信息 + getUpkeepList() { + this.queryParamsUpkeep.equipId = this.selectedEquipId; + this.upkeepLoading = true; + listUpkeepRecord(this.queryParamsUpkeep).then((response) => { + this.upkeepList = response.rows; + this.upkeepTotal = response.total; + this.upkeepLoading = false; + }); + }, + //维修信息 + getMaintList() { + this.queryParamsMaint.equipId = this.selectedEquipId; + this.maintLoading = true; + listMaintRecord(this.queryParamsMaint).then((response) => { + this.maintList = response.rows; + this.maintTotal = response.total; + this.maintLoading = false; + }); + }, + //设备维保详情 + upkeepClick() { + //获取维修保养信息 + this.getMaintList(); + this.getUpkeepList(); + this.upkeepOpen = true; + }, + /**详情按钮 */ + handleDetails(row) { + this.selectedEquipId = row.id; + this.detailsForm = {}; + getInfo(row.id).then((response) => { + this.detailsForm = response.data; + this.detailsOpen = true; + }); + }, + detailsClose() { + this.detailsOpen = false; + this.selectedEquipId = null; + this.detailsForm = {}; + }, /** 查询部门下拉树结构 */ getDeptTree() { deptTreeSelect().then((response) => { this.deptTree = response.data; + this.deptOptions = response.data; }); }, cancelUpload() { @@ -1407,10 +1989,10 @@ export default { this.queryParams.equipCategoryId == null ? null : _.last(this.queryParams.equipCategoryId); - this.queryParams.deptId = - this.queryParams.deptId == null - ? null - : _.last(this.queryParams.deptId); + // this.queryParams.deptId = + // this.queryParams.deptId == null + // ? null + // : _.last(this.queryParams.deptId); queryInfo(this.queryParams).then((res) => { this.infoList = this.handleTree(res.rows, "id", "parentEquipId"); this.total = res.total; @@ -1426,6 +2008,7 @@ export default { resetQuery() { this.resetForm("queryForm"); this.queryParams.equipCategoryId = []; + this.queryParams.deptId = null; this.queryParams.pageNum = 1; this.getList(); }, diff --git a/zfipc-ui/src/views/eqmanagement/sensorinfo/index.vue b/zfipc-ui/src/views/eqmanagement/sensorinfo/index.vue index ae1940a..a5b92c0 100644 --- a/zfipc-ui/src/views/eqmanagement/sensorinfo/index.vue +++ b/zfipc-ui/src/views/eqmanagement/sensorinfo/index.vue @@ -413,7 +413,7 @@ placeholder="请输入传感器描述" /> - + - + - \ No newline at end of file diff --git a/zfipc-ui/src/views/maintenance/record/index.vue b/zfipc-ui/src/views/maintenance/record/index.vue new file mode 100644 index 0000000..b5c2bc6 --- /dev/null +++ b/zfipc-ui/src/views/maintenance/record/index.vue @@ -0,0 +1,1487 @@ + + + + + \ No newline at end of file diff --git a/zfipc-ui/src/views/scrap/record/index.vue b/zfipc-ui/src/views/scrap/record/index.vue new file mode 100644 index 0000000..0cbbcf5 --- /dev/null +++ b/zfipc-ui/src/views/scrap/record/index.vue @@ -0,0 +1,660 @@ + + + + \ No newline at end of file diff --git a/zfipc-ui/src/views/upkeep/plan/index.vue b/zfipc-ui/src/views/upkeep/plan/index.vue index e9c235b..acd1738 100644 --- a/zfipc-ui/src/views/upkeep/plan/index.vue +++ b/zfipc-ui/src/views/upkeep/plan/index.vue @@ -325,7 +325,7 @@ > - +