From 08a619ea54dd50168e59f8ee7b08f96341683787 Mon Sep 17 00:00:00 2001 From: 79493 <794930212@qq.com> Date: Fri, 21 Oct 2022 17:32:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E7=AB=AF,=E5=91=A8=E6=9C=9F?= =?UTF-8?q?=E5=B7=A1=E6=A3=80=EF=BC=8C=E5=B7=A1=E6=A3=80=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=EF=BC=8C=E4=BF=9D=E5=85=BB=E8=AE=A1=E5=88=92=EF=BC=8C=E4=BF=9D?= =?UTF-8?q?=E5=85=BB=E8=AE=B0=E5=BD=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rzyc/mapper/EntDeviceInsCycleMapper.java | 39 +++ .../EntDeviceMaintenancePlanMapper.java | 18 ++ .../com/rzyc/mapper/EntInsRecordMapper.java | 38 +++ .../java/com/rzyc/mapper/SparePartMapper.java | 18 ++ .../com/rzyc/model/EntDeviceInsCycle.java | 231 ++++++++++++++++++ .../rzyc/model/EntDeviceMaintenancePlan.java | 195 +++++++++++++++ .../java/com/rzyc/model/EntInsRecord.java | 184 ++++++++++++++ .../main/java/com/rzyc/model/SparePart.java | 133 ++++++++++ .../AddOrUpdateDeviceInspectionCycleDto.java | 145 +++++++++++ .../dto/AddOrUpdateInspectionRecordDto.java | 111 +++++++++ .../mapper/EntDeviceInsCycleMapper.xml | 44 ++++ .../mapper/EntDeviceMaintenancePlanMapper.xml | 28 +++ .../resources/mapper/EntInsRecordMapper.xml | 39 +++ .../main/resources/mapper/SparePartMapper.xml | 23 ++ .../com/rzyc/controller/BaseController.java | 16 ++ .../EnterpriseEquipmentController.java | 113 ++++++++- .../com/rzyc/service/PcBusinessService.java | 50 +++- 17 files changed, 1420 insertions(+), 5 deletions(-) create mode 100644 inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceInsCycleMapper.java create mode 100644 inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMaintenancePlanMapper.java create mode 100644 inventory-dao/src/main/java/com/rzyc/mapper/EntInsRecordMapper.java create mode 100644 inventory-dao/src/main/java/com/rzyc/mapper/SparePartMapper.java create mode 100644 inventory-dao/src/main/java/com/rzyc/model/EntDeviceInsCycle.java create mode 100644 inventory-dao/src/main/java/com/rzyc/model/EntDeviceMaintenancePlan.java create mode 100644 inventory-dao/src/main/java/com/rzyc/model/EntInsRecord.java create mode 100644 inventory-dao/src/main/java/com/rzyc/model/SparePart.java create mode 100644 inventory-dao/src/main/java/com/rzyc/model/dto/AddOrUpdateDeviceInspectionCycleDto.java create mode 100644 inventory-dao/src/main/java/com/rzyc/model/dto/AddOrUpdateInspectionRecordDto.java create mode 100644 inventory-dao/src/main/resources/mapper/EntDeviceInsCycleMapper.xml create mode 100644 inventory-dao/src/main/resources/mapper/EntDeviceMaintenancePlanMapper.xml create mode 100644 inventory-dao/src/main/resources/mapper/EntInsRecordMapper.xml create mode 100644 inventory-dao/src/main/resources/mapper/SparePartMapper.xml diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceInsCycleMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceInsCycleMapper.java new file mode 100644 index 0000000..1208bc0 --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceInsCycleMapper.java @@ -0,0 +1,39 @@ +package com.rzyc.mapper; + +import com.rzyc.model.EntDeviceInsCycle; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.rzyc.model.dto.AddOrUpdateDeviceInspectionCycleDto; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + +/** + *

+ * Mapper 接口 + *

+ * + * @author + * @since 2022-10-21 + */ +@Repository +public interface EntDeviceInsCycleMapper extends BaseMapper { + + + /** + * 查询周期巡检 + * @param inspectionName 巡检名 + * @return list + * */ + ListdeviceInspectionCycle(String inspectionName); + + + + /** + * 修改周期巡检 + * @param entDeviceInsCycle 周期巡检 + * @return list + * */ + int updateDeviceInspectionCycle(@Param("data") EntDeviceInsCycle entDeviceInsCycle); +} diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMaintenancePlanMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMaintenancePlanMapper.java new file mode 100644 index 0000000..59dc11c --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMaintenancePlanMapper.java @@ -0,0 +1,18 @@ +package com.rzyc.mapper; + +import com.rzyc.model.EntDeviceMaintenancePlan; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * Mapper 接口 + *

+ * + * @author + * @since 2022-10-21 + */ +@Repository +public interface EntDeviceMaintenancePlanMapper extends BaseMapper { + +} diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntInsRecordMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntInsRecordMapper.java new file mode 100644 index 0000000..db0098b --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntInsRecordMapper.java @@ -0,0 +1,38 @@ +package com.rzyc.mapper; + +import com.rzyc.model.EntInsRecord; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * Mapper 接口 + *

+ * + * @author + * @since 2022-10-21 + */ +@Repository +public interface EntInsRecordMapper extends BaseMapper { + + /** + * 修改巡检计划 + * @param entInsRecord 巡检记录对象 + * @return int + * */ + int updateInspectionRecord(@Param("entInsRecord") EntInsRecord entInsRecord); + + + + /** + * 查询巡检记录 + * @param inspectionRecordName 巡检记录对象 + * @return int + * */ + List selectInspectionRecord(@Param("inspectionRecordName") String inspectionRecordName); + + +} diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/SparePartMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/SparePartMapper.java new file mode 100644 index 0000000..e7d1922 --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/mapper/SparePartMapper.java @@ -0,0 +1,18 @@ +package com.rzyc.mapper; + +import com.rzyc.model.SparePart; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * Mapper 接口 + *

+ * + * @author + * @since 2022-10-21 + */ +@Repository +public interface SparePartMapper extends BaseMapper { + +} diff --git a/inventory-dao/src/main/java/com/rzyc/model/EntDeviceInsCycle.java b/inventory-dao/src/main/java/com/rzyc/model/EntDeviceInsCycle.java new file mode 100644 index 0000000..029a659 --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/model/EntDeviceInsCycle.java @@ -0,0 +1,231 @@ +package com.rzyc.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + *

+ * + *

+ * + * @author + * @since 2022-10-21 + */ +@TableName("ent_device_ins_cycle") +@ApiModel(value="EntDeviceInsCycle对象", description="") +public class EntDeviceInsCycle implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "周期巡检") + @TableId("inspection_id") + private String inspectionId; + + @ApiModelProperty(value = "公司id") + @TableField("enterprise_id") + private String enterpriseId; + + @ApiModelProperty(value = "设备id") + @TableField("device_id") + private String deviceId; + + @ApiModelProperty(value = "巡检名字") + @TableField("inspection_name") + private String inspectionName; + + @ApiModelProperty(value = "巡检位置") + @TableField("inspection_position") + private String inspectionPosition; + + @ApiModelProperty(value = "单位 天") + @TableField("inspection_cycle") + private Integer inspectionCycle; + + @ApiModelProperty(value = "巡检级别 1.一般 2.重大 3.紧急巡检") + @TableField("inspection_state") + private Integer inspectionState; + + @ApiModelProperty(value = "负责人") + @TableField("inspection_charge_person") + private String inspectionChargePerson; + + @ApiModelProperty(value = "最后巡检日期") + @TableField("last_inspection_date") + private Date lastInspectionDate; + + @ApiModelProperty(value = "一级预警天数") + @TableField("level_first_warning") + private Integer levelFirstWarning; + + @ApiModelProperty(value = "二级预警天数") + @TableField("level_second_warning") + private Integer levelSecondWarning; + + @ApiModelProperty(value = "三级预警天数") + @TableField("level_third_warning") + private Integer levelThirdWarning; + + @ApiModelProperty(value = "技术措施") + @TableField("technical_measures") + private String technicalMeasures; + + @TableField("create_by") + private String createBy; + + @TableField("create_time") + private Date createTime; + + @TableField("modify_by") + private String modifyBy; + + @TableField("modify_time") + private Date modifyTime; + + public String getInspectionId() { + return inspectionId; + } + + public void setInspectionId(String inspectionId) { + this.inspectionId = inspectionId; + } + public String getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(String enterpriseId) { + this.enterpriseId = enterpriseId; + } + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + public String getInspectionName() { + return inspectionName; + } + + public void setInspectionName(String inspectionName) { + this.inspectionName = inspectionName; + } + public String getInspectionPosition() { + return inspectionPosition; + } + + public void setInspectionPosition(String inspectionPosition) { + this.inspectionPosition = inspectionPosition; + } + public Integer getInspectionCycle() { + return inspectionCycle; + } + + public void setInspectionCycle(Integer inspectionCycle) { + this.inspectionCycle = inspectionCycle; + } + public Integer getInspectionState() { + return inspectionState; + } + + public void setInspectionState(Integer inspectionState) { + this.inspectionState = inspectionState; + } + public String getInspectionChargePerson() { + return inspectionChargePerson; + } + + public void setInspectionChargePerson(String inspectionChargePerson) { + this.inspectionChargePerson = inspectionChargePerson; + } + public Date getLastInspectionDate() { + return lastInspectionDate; + } + + public void setLastInspectionDate(Date lastInspectionDate) { + this.lastInspectionDate = lastInspectionDate; + } + public Integer getLevelFirstWarning() { + return levelFirstWarning; + } + + public void setLevelFirstWarning(Integer levelFirstWarning) { + this.levelFirstWarning = levelFirstWarning; + } + public Integer getLevelSecondWarning() { + return levelSecondWarning; + } + + public void setLevelSecondWarning(Integer levelSecondWarning) { + this.levelSecondWarning = levelSecondWarning; + } + public Integer getLevelThirdWarning() { + return levelThirdWarning; + } + + public void setLevelThirdWarning(Integer levelThirdWarning) { + this.levelThirdWarning = levelThirdWarning; + } + public String getTechnicalMeasures() { + return technicalMeasures; + } + + public void setTechnicalMeasures(String technicalMeasures) { + this.technicalMeasures = technicalMeasures; + } + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + public String getModifyBy() { + return modifyBy; + } + + public void setModifyBy(String modifyBy) { + this.modifyBy = modifyBy; + } + public Date getModifyTime() { + return modifyTime; + } + + public void setModifyTime(Date modifyTime) { + this.modifyTime = modifyTime; + } + + @Override + public String toString() { + return "EntDeviceInsCycle{" + + "inspectionId=" + inspectionId + + ", enterpriseId=" + enterpriseId + + ", deviceId=" + deviceId + + ", inspectionName=" + inspectionName + + ", inspectionPosition=" + inspectionPosition + + ", inspectionCycle=" + inspectionCycle + + ", inspectionState=" + inspectionState + + ", inspectionChargePerson=" + inspectionChargePerson + + ", lastInspectionDate=" + lastInspectionDate + + ", levelFirstWarning=" + levelFirstWarning + + ", levelSecondWarning=" + levelSecondWarning + + ", levelThirdWarning=" + levelThirdWarning + + ", technicalMeasures=" + technicalMeasures + + ", createBy=" + createBy + + ", createTime=" + createTime + + ", modifyBy=" + modifyBy + + ", modifyTime=" + modifyTime + + "}"; + } +} diff --git a/inventory-dao/src/main/java/com/rzyc/model/EntDeviceMaintenancePlan.java b/inventory-dao/src/main/java/com/rzyc/model/EntDeviceMaintenancePlan.java new file mode 100644 index 0000000..0ecb59d --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/model/EntDeviceMaintenancePlan.java @@ -0,0 +1,195 @@ +package com.rzyc.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + *

+ * + *

+ * + * @author + * @since 2022-10-21 + */ +@TableName("ent_device_maintenance_plan") +@ApiModel(value="EntDeviceMaintenancePlan对象", description="") +public class EntDeviceMaintenancePlan implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "保养计划") + @TableId("maintenance_plan_id") + private Integer maintenancePlanId; + + @ApiModelProperty(value = "1.日常保养 2.常规润滑 3.二级检修保养 4.三级检修保养 5.项目检修保养 6.年度检修保养") + @TableField("maintenance_plan_level") + private Integer maintenancePlanLevel; + + @ApiModelProperty(value = "计划开始时间") + @TableField("maintenance_plan_start_time") + private Date maintenancePlanStartTime; + + @ApiModelProperty(value = "计划结束时间") + @TableField("maintenance_plan_end_time") + private Date maintenancePlanEndTime; + + @ApiModelProperty(value = "1.单次 2.多次") + @TableField("circulation_mode") + private Integer circulationMode; + + @ApiModelProperty(value = "循环周期") + @TableField("cycle_number") + private Integer cycleNumber; + + @ApiModelProperty(value = "1.天 2.月 3.季 4.年") + @TableField("cycle_unit") + private Integer cycleUnit; + + @ApiModelProperty(value = "保养负责人id") + @TableField("maintenance_people_id") + private String maintenancePeopleId; + + @ApiModelProperty(value = "备件id") + @TableField("spare_part_id") + private String sparePartId; + + @ApiModelProperty(value = "计划描述") + @TableField("maintenance_description") + private String maintenanceDescription; + + @TableField("create_by") + private String createBy; + + @TableField("create_time") + private Date createTime; + + @TableField("modify_by") + private String modifyBy; + + @TableField("modify_time") + private Date modifyTime; + + public Integer getMaintenancePlanId() { + return maintenancePlanId; + } + + public void setMaintenancePlanId(Integer maintenancePlanId) { + this.maintenancePlanId = maintenancePlanId; + } + public Integer getMaintenancePlanLevel() { + return maintenancePlanLevel; + } + + public void setMaintenancePlanLevel(Integer maintenancePlanLevel) { + this.maintenancePlanLevel = maintenancePlanLevel; + } + public Date getMaintenancePlanStartTime() { + return maintenancePlanStartTime; + } + + public void setMaintenancePlanStartTime(Date maintenancePlanStartTime) { + this.maintenancePlanStartTime = maintenancePlanStartTime; + } + public Date getMaintenancePlanEndTime() { + return maintenancePlanEndTime; + } + + public void setMaintenancePlanEndTime(Date maintenancePlanEndTime) { + this.maintenancePlanEndTime = maintenancePlanEndTime; + } + public Integer getCirculationMode() { + return circulationMode; + } + + public void setCirculationMode(Integer circulationMode) { + this.circulationMode = circulationMode; + } + public Integer getCycleNumber() { + return cycleNumber; + } + + public void setCycleNumber(Integer cycleNumber) { + this.cycleNumber = cycleNumber; + } + public Integer getCycleUnit() { + return cycleUnit; + } + + public void setCycleUnit(Integer cycleUnit) { + this.cycleUnit = cycleUnit; + } + public String getMaintenancePeopleId() { + return maintenancePeopleId; + } + + public void setMaintenancePeopleId(String maintenancePeopleId) { + this.maintenancePeopleId = maintenancePeopleId; + } + public String getSparePartId() { + return sparePartId; + } + + public void setSparePartId(String sparePartId) { + this.sparePartId = sparePartId; + } + public String getMaintenanceDescription() { + return maintenanceDescription; + } + + public void setMaintenanceDescription(String maintenanceDescription) { + this.maintenanceDescription = maintenanceDescription; + } + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + public String getModifyBy() { + return modifyBy; + } + + public void setModifyBy(String modifyBy) { + this.modifyBy = modifyBy; + } + public Date getModifyTime() { + return modifyTime; + } + + public void setModifyTime(Date modifyTime) { + this.modifyTime = modifyTime; + } + + @Override + public String toString() { + return "EntDeviceMaintenancePlan{" + + "maintenancePlanId=" + maintenancePlanId + + ", maintenancePlanLevel=" + maintenancePlanLevel + + ", maintenancePlanStartTime=" + maintenancePlanStartTime + + ", maintenancePlanEndTime=" + maintenancePlanEndTime + + ", circulationMode=" + circulationMode + + ", cycleNumber=" + cycleNumber + + ", cycleUnit=" + cycleUnit + + ", maintenancePeopleId=" + maintenancePeopleId + + ", sparePartId=" + sparePartId + + ", maintenanceDescription=" + maintenanceDescription + + ", createBy=" + createBy + + ", createTime=" + createTime + + ", modifyBy=" + modifyBy + + ", modifyTime=" + modifyTime + + "}"; + } +} diff --git a/inventory-dao/src/main/java/com/rzyc/model/EntInsRecord.java b/inventory-dao/src/main/java/com/rzyc/model/EntInsRecord.java new file mode 100644 index 0000000..6880a36 --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/model/EntInsRecord.java @@ -0,0 +1,184 @@ +package com.rzyc.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + *

+ * + *

+ * + * @author + * @since 2022-10-21 + */ +@TableName("ent_ins_record") +@ApiModel(value="EntInsRecord对象", description="") +public class EntInsRecord implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "巡检记录") + @TableField("ins_record_id") + private String insRecordId; + + @ApiModelProperty(value = "巡检日期") + @TableField("ins_record_date") + private Date insRecordDate; + + @ApiModelProperty(value = "巡检记录工时") + @TableField("ins_record_working_hour") + private Integer insRecordWorkingHour; + + @ApiModelProperty(value = "巡检记录人") + @TableField("ins_record_person") + private String insRecordPerson; + + @ApiModelProperty(value = "巡检情况") + @TableField("ins_record_situation") + private String insRecordSituation; + + @ApiModelProperty(value = "设备id") + @TableField("device_id") + private String deviceId; + + @ApiModelProperty(value = "公司id") + @TableField("enterprise_id") + private String enterpriseId; + + @ApiModelProperty(value = "备件id") + @TableField("spare_part_id") + private String sparePartId; + + @ApiModelProperty(value = "周期巡检id") + @TableField("cycle_id") + private String cycleId; + + @TableField("modify_time") + private Date modifyTime; + + @TableField("modify_by") + private String modifyBy; + + @TableField("create_time") + private Date createTime; + + @TableField("create_by") + private String createBy; + + + + public String getCycleId() { + return cycleId; + } + + public void setCycleId(String cycleId) { + this.cycleId = cycleId; + } + + public String getInsRecordId() { + return insRecordId; + } + + public void setInsRecordId(String insRecordId) { + this.insRecordId = insRecordId; + } + public Date getInsRecordDate() { + return insRecordDate; + } + + public void setInsRecordDate(Date insRecordDate) { + this.insRecordDate = insRecordDate; + } + public Integer getInsRecordWorkingHour() { + return insRecordWorkingHour; + } + + public void setInsRecordWorkingHour(Integer insRecordWorkingHour) { + this.insRecordWorkingHour = insRecordWorkingHour; + } + public String getInsRecordPerson() { + return insRecordPerson; + } + + public void setInsRecordPerson(String insRecordPerson) { + this.insRecordPerson = insRecordPerson; + } + public String getInsRecordSituation() { + return insRecordSituation; + } + + public void setInsRecordSituation(String insRecordSituation) { + this.insRecordSituation = insRecordSituation; + } + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + public String getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(String enterpriseId) { + this.enterpriseId = enterpriseId; + } + public String getSparePartId() { + return sparePartId; + } + + public void setSparePartId(String sparePartId) { + this.sparePartId = sparePartId; + } + public Date getModifyTime() { + return modifyTime; + } + + public void setModifyTime(Date modifyTime) { + this.modifyTime = modifyTime; + } + public String getModifyBy() { + return modifyBy; + } + + public void setModifyBy(String modifyBy) { + this.modifyBy = modifyBy; + } + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + @Override + public String toString() { + return "EntInsRecord{" + + "insRecordId=" + insRecordId + + ", insRecordDate=" + insRecordDate + + ", insRecordWorkingHour=" + insRecordWorkingHour + + ", insRecordPerson=" + insRecordPerson + + ", insRecordSituation=" + insRecordSituation + + ", deviceId=" + deviceId + + ", enterpriseId=" + enterpriseId + + ", sparePartId=" + sparePartId + + ", modifyTime=" + modifyTime + + ", modifyBy=" + modifyBy + + ", createTime=" + createTime + + ", createBy=" + createBy + + "}"; + } +} diff --git a/inventory-dao/src/main/java/com/rzyc/model/SparePart.java b/inventory-dao/src/main/java/com/rzyc/model/SparePart.java new file mode 100644 index 0000000..9216750 --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/model/SparePart.java @@ -0,0 +1,133 @@ +package com.rzyc.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + *

+ * + *

+ * + * @author + * @since 2022-10-21 + */ +@TableName("spare_part") +@ApiModel(value="SparePart对象", description="") +public class SparePart implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId("spare_part_id") + private String sparePartId; + + @TableField("used_id") + private String usedId; + + @ApiModelProperty(value = "备件名") + @TableField("name") + private String name; + + @ApiModelProperty(value = "规格型号") + @TableField("specification_model") + private String specificationModel; + + @ApiModelProperty(value = "备件编码") + @TableField("spare_part_number") + private String sparePartNumber; + + @TableField("create_time") + private Date createTime; + + @TableField("create_by") + private String createBy; + + @TableField("modify_by") + private String modifyBy; + + @TableField("modify_time") + private Date modifyTime; + + public String getSparePartId() { + return sparePartId; + } + + public void setSparePartId(String sparePartId) { + this.sparePartId = sparePartId; + } + public String getUsedId() { + return usedId; + } + + public void setUsedId(String usedId) { + this.usedId = usedId; + } + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + public String getSpecificationModel() { + return specificationModel; + } + + public void setSpecificationModel(String specificationModel) { + this.specificationModel = specificationModel; + } + public String getSparePartNumber() { + return sparePartNumber; + } + + public void setSparePartNumber(String sparePartNumber) { + this.sparePartNumber = sparePartNumber; + } + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + public String getModifyBy() { + return modifyBy; + } + + public void setModifyBy(String modifyBy) { + this.modifyBy = modifyBy; + } + public Date getModifyTime() { + return modifyTime; + } + + public void setModifyTime(Date modifyTime) { + this.modifyTime = modifyTime; + } + + @Override + public String toString() { + return "SparePart{" + + "sparePartId=" + sparePartId + + ", usedId=" + usedId + + ", name=" + name + + ", specificationModel=" + specificationModel + + ", sparePartNumber=" + sparePartNumber + + ", createTime=" + createTime + + ", createBy=" + createBy + + ", modifyBy=" + modifyBy + + ", modifyTime=" + modifyTime + + "}"; + } +} diff --git a/inventory-dao/src/main/java/com/rzyc/model/dto/AddOrUpdateDeviceInspectionCycleDto.java b/inventory-dao/src/main/java/com/rzyc/model/dto/AddOrUpdateDeviceInspectionCycleDto.java new file mode 100644 index 0000000..45bc3d0 --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/model/dto/AddOrUpdateDeviceInspectionCycleDto.java @@ -0,0 +1,145 @@ +package com.rzyc.model.dto; + +import io.swagger.annotations.ApiModelProperty; + +import java.util.Date; + +/** + * 企业设备周期维护 + * @author Xuwanxin + * @date 2022/10/21 + * */ +public class AddOrUpdateDeviceInspectionCycleDto { + + @ApiModelProperty("周期巡检id") + private String inspectionId; + + @ApiModelProperty("企业名") + private String enterpriseId; + + @ApiModelProperty("设备id") + private String deviceId; + + @ApiModelProperty("巡检名称") + private String inspectionName; + + @ApiModelProperty("巡检位置") + private String inspectionPosition; + + @ApiModelProperty("巡检周期") + private Integer inspectionCycle; + + @ApiModelProperty("巡检负责人") + private String inspectionChargePerson; + + @ApiModelProperty("最后巡检日期") + private Date lastInspectionDate; + + @ApiModelProperty("一级警报天数") + private Integer levelFirstWarning; + + @ApiModelProperty("二级警报天数") + private Integer levelSecondWarning; + + @ApiModelProperty("三级警报天数") + private Integer levelThirdWarning; + + @ApiModelProperty("技术措施") + private String technicalMeasures; + + public String getInspectionId() { + return inspectionId; + } + + public void setInspectionId(String inspectionId) { + this.inspectionId = inspectionId; + } + + public String getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(String enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + public String getInspectionName() { + return inspectionName; + } + + public void setInspectionName(String inspectionName) { + this.inspectionName = inspectionName; + } + + public String getInspectionPosition() { + return inspectionPosition; + } + + public void setInspectionPosition(String inspectionPosition) { + this.inspectionPosition = inspectionPosition; + } + + public Integer getInspectionCycle() { + return inspectionCycle; + } + + public void setInspectionCycle(Integer inspectionCycle) { + this.inspectionCycle = inspectionCycle; + } + + public String getInspectionChargePerson() { + return inspectionChargePerson; + } + + public void setInspectionChargePerson(String inspectionChargePerson) { + this.inspectionChargePerson = inspectionChargePerson; + } + + public Date getLastInspectionDate() { + return lastInspectionDate; + } + + public void setLastInspectionDate(Date lastInspectionDate) { + this.lastInspectionDate = lastInspectionDate; + } + + public Integer getLevelFirstWarning() { + return levelFirstWarning; + } + + public void setLevelFirstWarning(Integer levelFirstWarning) { + this.levelFirstWarning = levelFirstWarning; + } + + public Integer getLevelSecondWarning() { + return levelSecondWarning; + } + + public void setLevelSecondWarning(Integer levelSecondWarning) { + this.levelSecondWarning = levelSecondWarning; + } + + public Integer getLevelThirdWarning() { + return levelThirdWarning; + } + + public void setLevelThirdWarning(Integer levelThirdWarning) { + this.levelThirdWarning = levelThirdWarning; + } + + public String getTechnicalMeasures() { + return technicalMeasures; + } + + public void setTechnicalMeasures(String technicalMeasures) { + this.technicalMeasures = technicalMeasures; + } +} diff --git a/inventory-dao/src/main/java/com/rzyc/model/dto/AddOrUpdateInspectionRecordDto.java b/inventory-dao/src/main/java/com/rzyc/model/dto/AddOrUpdateInspectionRecordDto.java new file mode 100644 index 0000000..f7203e1 --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/model/dto/AddOrUpdateInspectionRecordDto.java @@ -0,0 +1,111 @@ +package com.rzyc.model.dto; + + +import io.swagger.annotations.ApiModelProperty; + +/** + * 企业设备巡检记录 + * @author Xuwanxin + * @date 2022/10/21 + * */ +public class AddOrUpdateInspectionRecordDto { + + @ApiModelProperty(value = "巡检记录id") + private String insRecordId; + + @ApiModelProperty(value = "巡检日期") + private String insRecordDate; + + @ApiModelProperty(value = "巡检记录工时") + private Integer insRecordWorkingHour; + + @ApiModelProperty(value = "巡检记录人") + private String insRecordPerson; + + @ApiModelProperty(value = "巡检记录情况") + private String insRecordSituation; + + @ApiModelProperty(value = "设备id") + private String deviceId; + + @ApiModelProperty(value = "企业id") + private String enterpriseId; + + @ApiModelProperty(value = "备件id") + private String sparePartId; + + @ApiModelProperty(value = "周期计划id") + private String cycleId; + + public String getCycleId() { + return cycleId; + } + + public void setCycleId(String cycleId) { + this.cycleId = cycleId; + } + + public String getInsRecordId() { + return insRecordId; + } + + public void setInsRecordId(String insRecordId) { + this.insRecordId = insRecordId; + } + + public String getInsRecordDate() { + return insRecordDate; + } + + public void setInsRecordDate(String insRecordDate) { + this.insRecordDate = insRecordDate; + } + + public Integer getInsRecordWorkingHour() { + return insRecordWorkingHour; + } + + public void setInsRecordWorkingHour(Integer insRecordWorkingHour) { + this.insRecordWorkingHour = insRecordWorkingHour; + } + + public String getInsRecordPerson() { + return insRecordPerson; + } + + public void setInsRecordPerson(String insRecordPerson) { + this.insRecordPerson = insRecordPerson; + } + + public String getInsRecordSituation() { + return insRecordSituation; + } + + public void setInsRecordSituation(String insRecordSituation) { + this.insRecordSituation = insRecordSituation; + } + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + public String getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(String enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getSparePartId() { + return sparePartId; + } + + public void setSparePartId(String sparePartId) { + this.sparePartId = sparePartId; + } +} diff --git a/inventory-dao/src/main/resources/mapper/EntDeviceInsCycleMapper.xml b/inventory-dao/src/main/resources/mapper/EntDeviceInsCycleMapper.xml new file mode 100644 index 0000000..2e3c7e1 --- /dev/null +++ b/inventory-dao/src/main/resources/mapper/EntDeviceInsCycleMapper.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + inspection_id, enterprise_id, device_id, inspection_name, inspection_position, inspection_cycle, inspection_state, inspection_charge_person, last_inspection_date, level_first_warning, level_second_warning, level_third_warning, technical_measures, create_by, create_time, modify_by, modify_time + + + + + + update ent_device_ins_cycle set inspection_name = #{data.inspectionName},inspection_position = #{data.inspectionPosition},inspection_cycle = #{data.inspectionCycle},inspection_state = #{data.inspectionState}, + inspection_charge_person = #{data.inspectionChargePerson},last_inspection_date = #{data.lastLnspectionDate},level_second_warning = #{data.levelLastLnspecitonDate},level_third_warning = #{data.levelThirdWarning}, + technical_measures = #{data.technicalMeasures} where inspection_id = #{data.inspectionId} + + + diff --git a/inventory-dao/src/main/resources/mapper/EntDeviceMaintenancePlanMapper.xml b/inventory-dao/src/main/resources/mapper/EntDeviceMaintenancePlanMapper.xml new file mode 100644 index 0000000..ba64b68 --- /dev/null +++ b/inventory-dao/src/main/resources/mapper/EntDeviceMaintenancePlanMapper.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + maintenance_plan_id, maintenance_plan_level, maintenance_plan_start_time, maintenance_plan_end_time, circulation_mode, cycle_number, cycle_unit, maintenance_people_id, spare_part_id, maintenance_description, create_by, create_time, modify_by, modify_time + + + diff --git a/inventory-dao/src/main/resources/mapper/EntInsRecordMapper.xml b/inventory-dao/src/main/resources/mapper/EntInsRecordMapper.xml new file mode 100644 index 0000000..2e43b7a --- /dev/null +++ b/inventory-dao/src/main/resources/mapper/EntInsRecordMapper.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + ins_record_id, ins_record_date, ins_record_working_hour, ins_record_person, ins_record_situation, device_id, enterprise_id, spare_part_id, modify_time, modify_by, create_time, create_by + + + + + update ent_ins_record set ins_record_date = #{entInsRecord.insRecordDate},ins_record_working_hour = #{entInsRecord.insRecordWorkingHour}, ins_record_person = #{entInsRecord.insRecordPerson},ins_record_situation = #{entInsRecord.insRecordSituation}, + device_id = #{entInsRecord.deviceId},spare_part_id = #{entInsRecord.spare_part_id} ,cycle_id = #{entInsRecord.cycleId} where ins_record_id = #{insRecordId} + + + + + diff --git a/inventory-dao/src/main/resources/mapper/SparePartMapper.xml b/inventory-dao/src/main/resources/mapper/SparePartMapper.xml new file mode 100644 index 0000000..bbc6495 --- /dev/null +++ b/inventory-dao/src/main/resources/mapper/SparePartMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + spare_part_id, used_id, name, specification_model, spare_part_number, create_time, create_by, modify_by, modify_time + + + diff --git a/inventory-ent/src/main/java/com/rzyc/controller/BaseController.java b/inventory-ent/src/main/java/com/rzyc/controller/BaseController.java index c50fbf1..72f8b50 100644 --- a/inventory-ent/src/main/java/com/rzyc/controller/BaseController.java +++ b/inventory-ent/src/main/java/com/rzyc/controller/BaseController.java @@ -480,6 +480,22 @@ public class BaseController { @Autowired protected EntDeviceTypeMapper entDeviceTypeMapper; + //企业共享备用设备 + @Autowired + protected SparePartMapper sparePartMapper; + + //企业巡查记录 + @Autowired + protected EntInsRecordMapper entInsRecordMapper; + + //企业设备维护记录 + @Autowired + protected EntDeviceMaintenancePlanMapper entDeviceMaintenancePlanMapper; + + //企业周期巡检 + @Autowired + protected EntDeviceInsCycleMapper entDeviceInsCycleMapper; + diff --git a/inventory-ent/src/main/java/com/rzyc/controller/EnterpriseEquipmentController.java b/inventory-ent/src/main/java/com/rzyc/controller/EnterpriseEquipmentController.java index 4df82c7..b90c72a 100644 --- a/inventory-ent/src/main/java/com/rzyc/controller/EnterpriseEquipmentController.java +++ b/inventory-ent/src/main/java/com/rzyc/controller/EnterpriseEquipmentController.java @@ -5,8 +5,10 @@ import com.common.utils.model.SingleResult; import com.rzyc.config.MethodAnnotation; import com.rzyc.model.EntDevice; import com.rzyc.model.EntDeviceType; +import com.rzyc.model.dto.AddOrUpdateDeviceInspectionCycleDto; import com.rzyc.model.dto.AddOrUpdateEntEquipmentDto; import com.rzyc.model.dto.AddOrUpdateEntEquipmentTypeDto; +import com.rzyc.model.dto.AddOrUpdateInspectionRecordDto; import com.rzyc.service.PcBusinessService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -105,8 +107,8 @@ public class EnterpriseEquipmentController extends BaseController { */ @ApiOperation(value = "新增设备类型,修改设备类型", notes = "新增设备类型,修改设备类型") @PostMapping(value = "/addOrUpdateEntEquipmentType") - @PreAuthorize("hasAnyAuthority('addOrUpdateEntEquipmentType')") - @MethodAnnotation(authorizations = {"addOrUpdateEntEquipmentType"},name = "新增设备类型,修改设备类型") + @PreAuthorize("hasAnyAuthority('entEquipmentType:update')") + @MethodAnnotation(authorizations = {"entEquipmentType:update"},name = "新增设备类型,修改设备类型") @ResponseBody public SingleResult addOrUpdateEntEquipmentType(@RequestBody AddOrUpdateEntEquipmentTypeDto addOrUpdateEntEquipmentTypeDto)throws Exception{ return pcBusinessService.addOrUpdateEntEquipmentType(addOrUpdateEntEquipmentTypeDto); @@ -119,13 +121,116 @@ public class EnterpriseEquipmentController extends BaseController { */ @ApiOperation(value = "新增设备,修改设备", notes = "新增设备,修改设备") @PostMapping(value = "/addOrUpdateEntEquipment") - @PreAuthorize("hasAnyAuthority('addOrUpdateEntEquipment')") - @MethodAnnotation(authorizations = {"addOrUpdateEntEquipment"},name = "新增设备,修改设备") + @PreAuthorize("hasAnyAuthority('entEquipment:update')") + @MethodAnnotation(authorizations = {"entEquipment:update"},name = "新增设备,修改设备") @ResponseBody public SingleResult addOrUpdateEntEquipment(@RequestBody AddOrUpdateEntEquipmentDto addOrUpdateEntEquipmentDto)throws Exception{ return pcBusinessService.addOrUpdateEntEquipment(addOrUpdateEntEquipmentDto); } + /** + * 设备周期巡检 + * @return 设备周期巡检 + * @throws Exception + */ + @ApiOperation(value = "设备周期巡检", notes = "设备周期巡检") + @GetMapping(value = "/deviceInspectionCycle") + @PreAuthorize("hasAnyAuthority('deviceInspectionCycle','deviceInspectionCycle:update')") + @MethodAnnotation(authorizations = {"deviceInspectionCycle","deviceInspectionCycle:update'"},name = "设备维护周期") + @ApiImplicitParams({ + @ApiImplicitParam(name = "inspectionName", value = "巡检名", required = false, dataType = "string") + }) + @ResponseBody + public SingleResult deviceInspectionCycle(String inspectionName)throws Exception{ + return pcBusinessService.deviceInspectionCycle(inspectionName); + } + + + /** + * 设备周期巡检-添加和修巡检项目 + * @return 设备周期巡检-添加和修巡检项目 + * @throws Exception + */ + @ApiOperation(value = "设备周期巡检-添加和修改巡检项目", notes = "设备周期巡检-添加和修巡检项目") + @PostMapping(value = "/addOrUpdateDeviceInspectionCycle") + @PreAuthorize("hasAnyAuthority('deviceInspectionCycle:update')") + @MethodAnnotation(authorizations = {"deviceInspectionCycle:update"},name = "设备周期巡检-添加和修巡检项目") + @ResponseBody + public SingleResult addOrUpdateDeviceInspectionCycle(@RequestBody AddOrUpdateDeviceInspectionCycleDto addOrUpdateDeviceInspectionCycleDto)throws Exception{ + return pcBusinessService.addOrUpdateDeviceInspectionCycle(addOrUpdateDeviceInspectionCycleDto); + } + + /** + * 设备巡检记录-添加和修改巡检记录 + * @return 设备巡检记录-添加和修改巡检记录 + * @throws Exception + */ + @ApiOperation(value = "设备巡检记录-添加和修改巡检记录", notes = "设备巡检记录-添加和修改巡检记录") + @PostMapping(value = "/addOrUpdateInspectionRecord") + @PreAuthorize("hasAnyAuthority('addOrUpdateInspectionRecord:update')") + @MethodAnnotation(authorizations = {"addOrUpdateInspectionRecord:update"},name = "设备巡检记录-添加和修改巡检记录") + @ResponseBody + public SingleResult addOrUpdateInspectionRecord(@RequestBody AddOrUpdateInspectionRecordDto addOrUpdateInspectionRecordDto)throws Exception{ + return pcBusinessService.addOrUpdateInspectionRecord(addOrUpdateInspectionRecordDto); + } + + /** + * 设备巡检记录 + * @return 设备巡检记录 + * @throws Exception + */ + @ApiOperation(value = "设备巡检记录", notes = "设备巡检记录") + @PostMapping(value = "/inspectionRecord") + @PreAuthorize("hasAnyAuthority('inspectionRecord,inspectionRecord:update')") + @MethodAnnotation(authorizations = {"inspectionRecord,inspectionRecord:update"},name = "设备巡检记录") + @ResponseBody + public SingleResult inspectionRecord(String inspectionRecordName)throws Exception{ + return pcBusinessService.selectInspectionRecord(inspectionRecordName); + } + + + + /** + * 备件列表 + * @return 备件列表 + * @throws Exception + * + **/ + + + + /** + * 备件列表-新增和修改 + * @return 备件列表-新增和修改 + * @throws Exception + * + **/ + + + /** + * 保养计划 + * @return 保养计划-新增和修改 + * @throws Exception + * + **/ + + + + /** + * 保养计划列表 + * @return 保养计划列表 + * @throws Exception + * + **/ + + + + + + + + + } diff --git a/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java b/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java index 25d80c9..d290aba 100644 --- a/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java +++ b/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java @@ -262,7 +262,7 @@ public class PcBusinessService extends BaseController { return singleResult; } - /*public SingleResult entEquipmentTypeList(String enterpriseId){ + public SingleResult entEquipmentTypeList(String enterpriseId){ SingleResult singleResult = new SingleResult(); List redisEntDeviceTypes =(List) redisUtil.get(redisUtil.appendSymbol(RedisKeys.DEVICE.getKey(),enterpriseId)); if (null != redisEntDeviceTypes && redisEntDeviceTypes.size()>0){ @@ -391,6 +391,54 @@ public class PcBusinessService extends BaseController { return singleResult; } + public SingleResult deviceInspectionCycle(String inspectionName){ + SingleResult singleResult = new SingleResult(); + Listlist = entDeviceInsCycleMapper.deviceInspectionCycle(inspectionName); + singleResult.setData(list); + return singleResult; + } + + public SingleResult addOrUpdateDeviceInspectionCycle(AddOrUpdateDeviceInspectionCycleDto addOrUpdateDeviceInspectionCycleDto){ + SingleResult singleResult = new SingleResult(); + Integer result = 0; + EntDeviceInsCycle entDeviceInsCycle = new EntDeviceInsCycle(); + BeanUtils.copyProperties(addOrUpdateDeviceInspectionCycleDto,entDeviceInsCycle); + if (null != addOrUpdateDeviceInspectionCycleDto && null != addOrUpdateDeviceInspectionCycleDto.getInspectionId()){ + result = entDeviceInsCycleMapper.updateDeviceInspectionCycle(entDeviceInsCycle); + }else { + result = entDeviceInsCycleMapper.insert(entDeviceInsCycle); + } + if (result != 1 ){ + singleResult.setCode(Code.ERROR.getCode()); + singleResult.setMessage(Message.ERROR); + } + return singleResult; + } + + public SingleResult addOrUpdateInspectionRecord(AddOrUpdateInspectionRecordDto addOrUpdateInspectionRecordDto){ + SingleResult singleResult = new SingleResult(); + EntInsRecord entInsRecord = new EntInsRecord(); + BeanUtils.copyProperties(addOrUpdateInspectionRecordDto,entInsRecord); + int result = 0; + if (null != addOrUpdateInspectionRecordDto && null != addOrUpdateInspectionRecordDto.getInsRecordId()){ + result = entInsRecordMapper.updateInspectionRecord(entInsRecord); + }else { + result = entInsRecordMapper.insert(entInsRecord); + } + if (result != 1 ){ + singleResult.setCode(Code.ERROR.getCode()); + singleResult.setMessage(Message.ERROR); + } + return singleResult; + } + + public SingleResult selectInspectionRecord(String inspectionRecordName){ + SingleResult singleResult = new SingleResult(); + List entInsRecords = entInsRecordMapper.selectInspectionRecord(inspectionRecordName); + singleResult.setData(entInsRecords); + return singleResult; + } +