From d233efcb55c95ca8032cb0b448e99600774cc72f Mon Sep 17 00:00:00 2001 From: 79493 <794930212@qq.com> Date: Fri, 28 Oct 2022 17:31:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E7=AB=AF=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=A8=A1=E5=9D=97->=E6=93=8D=E4=BD=9C=E8=A7=84=E7=A8=8B?= =?UTF-8?q?=EF=BC=8C=E6=8A=A5=E4=BF=AE=E8=AE=B0=E5=BD=95=EF=BC=8C=E7=BB=B4?= =?UTF-8?q?=E4=BF=AE=E8=AE=B0=E5=BD=95=EF=BC=8C=E7=BB=B4=E4=BF=AE=E8=AE=A1?= =?UTF-8?q?=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/EntOperatingInstructionMapper.java | 37 +++ .../rzyc/mapper/EntRepairRecordMapper.java | 26 ++ .../rzyc/mapper/EntReportRepairMapper.java | 35 +++ .../com/rzyc/mapper/OrgBookTypeMapper.java | 2 - .../rzyc/model/EntOperatingInstruction.java | 110 ++++++++ .../java/com/rzyc/model/EntRepairRecord.java | 267 ++++++++++++++++++ .../java/com/rzyc/model/EntReportRepair.java | 146 ++++++++++ .../model/dto/OperatingInstructionDto.java | 33 +++ .../model/dto/OperatingInstructionsDto.java | 48 ++++ .../com/rzyc/model/dto/ReportRecordDto.java | 81 ++++++ .../mapper/EntOperatingInstructionMapper.xml | 32 +++ .../mapper/EntRepairRecordMapper.xml | 38 +++ .../mapper/EntReportRepairMapper.xml | 36 +++ .../main/java/com/rzyc/advice/PageAspect.java | 6 +- .../java/com/rzyc/advice/PageOperation.java | 6 +- .../main/java/com/rzyc/config/PageAspect.java | 119 ++++++++ .../com/rzyc/controller/BaseController.java | 21 +- .../EnterpriseEquipmentController.java | 95 +++++-- .../com/rzyc/service/PcBusinessService.java | 108 ++++--- utils/pom.xml | 10 + .../common/utils/pager}/PageOperation.java | 2 +- .../java/com/common/utils/pager/Pager.java | 147 ++++++++++ .../common/utils/pager/PagerSerializer.java | 43 +++ 23 files changed, 1375 insertions(+), 73 deletions(-) create mode 100644 inventory-dao/src/main/java/com/rzyc/mapper/EntOperatingInstructionMapper.java create mode 100644 inventory-dao/src/main/java/com/rzyc/mapper/EntRepairRecordMapper.java create mode 100644 inventory-dao/src/main/java/com/rzyc/mapper/EntReportRepairMapper.java create mode 100644 inventory-dao/src/main/java/com/rzyc/model/EntOperatingInstruction.java create mode 100644 inventory-dao/src/main/java/com/rzyc/model/EntRepairRecord.java create mode 100644 inventory-dao/src/main/java/com/rzyc/model/EntReportRepair.java create mode 100644 inventory-dao/src/main/java/com/rzyc/model/dto/OperatingInstructionDto.java create mode 100644 inventory-dao/src/main/java/com/rzyc/model/dto/OperatingInstructionsDto.java create mode 100644 inventory-dao/src/main/java/com/rzyc/model/dto/ReportRecordDto.java create mode 100644 inventory-dao/src/main/resources/mapper/EntOperatingInstructionMapper.xml create mode 100644 inventory-dao/src/main/resources/mapper/EntRepairRecordMapper.xml create mode 100644 inventory-dao/src/main/resources/mapper/EntReportRepairMapper.xml create mode 100644 inventory-ent/src/main/java/com/rzyc/config/PageAspect.java rename {inventory-dao/src/main/java/com/rzyc/config => utils/src/main/java/com/common/utils/pager}/PageOperation.java (89%) create mode 100644 utils/src/main/java/com/common/utils/pager/Pager.java create mode 100644 utils/src/main/java/com/common/utils/pager/PagerSerializer.java diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntOperatingInstructionMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntOperatingInstructionMapper.java new file mode 100644 index 0000000..99a175a --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntOperatingInstructionMapper.java @@ -0,0 +1,37 @@ +package com.rzyc.mapper; + +import com.rzyc.model.EntOperatingInstruction; +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-28 + */ +@Repository +public interface EntOperatingInstructionMapper extends BaseMapper { + + + /** + * 查询操作规程 + * @param name 规程名 + * @return list + * */ + ListselectOperatingInstructions(String name); + + + /** + * 修改企业操作规程 + * @param entOperatingInstruction 操作规程对象 + * @return int + * */ + int updateEntOperatingInstruction(@Param("data") EntOperatingInstruction entOperatingInstruction); + +} diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntRepairRecordMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntRepairRecordMapper.java new file mode 100644 index 0000000..166698c --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntRepairRecordMapper.java @@ -0,0 +1,26 @@ +package com.rzyc.mapper; + +import com.rzyc.model.EntRepairRecord; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * Mapper 接口 + *

+ * + * @author + * @since 2022-10-28 + */ +@Repository +public interface EntRepairRecordMapper extends BaseMapper { + + /** + * 查询维修记录 + * @return List + * */ + ListrepairRecord(); + +} diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntReportRepairMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntReportRepairMapper.java new file mode 100644 index 0000000..77c8a93 --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntReportRepairMapper.java @@ -0,0 +1,35 @@ +package com.rzyc.mapper; + +import com.rzyc.model.EntReportRepair; +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-28 + */ +@Repository +public interface EntReportRepairMapper extends BaseMapper { + + /** + * 查询报修列表 + * @return list + * */ + ListreportRecord(); + + /** + * 修改报修列表 + * @return int + * @param entReportRepair 报修对象 + * */ + int updateReportRecord(@Param("data") EntReportRepair entReportRepair); + + +} diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/OrgBookTypeMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/OrgBookTypeMapper.java index 7764552..89bbd45 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/OrgBookTypeMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/OrgBookTypeMapper.java @@ -4,7 +4,6 @@ import com.github.pagehelper.Page; import com.rzyc.bean.organization.dto.OrgBookTypesDto; import com.rzyc.bean.organization.vo.BookTypesVo; import com.rzyc.bean.organization.vo.OrgBookTypesVo; -import com.rzyc.config.PageOperation; import com.rzyc.model.organization.OrgBookType; import com.rzyc.model.organization.OrgBookTypeExample; import org.apache.ibatis.annotations.Param; @@ -39,7 +38,6 @@ public interface OrgBookTypeMapper { * @param orgBookTypesDto * @return */ - @PageOperation public Page orgBookTypesManager(@Param("orgBookTypesDto") OrgBookTypesDto orgBookTypesDto); /** diff --git a/inventory-dao/src/main/java/com/rzyc/model/EntOperatingInstruction.java b/inventory-dao/src/main/java/com/rzyc/model/EntOperatingInstruction.java new file mode 100644 index 0000000..6fed688 --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/model/EntOperatingInstruction.java @@ -0,0 +1,110 @@ +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-28 + */ +@TableName("ent_operating_instruction") +@ApiModel(value="EntOperatingInstruction对象", description="操作规程") +public class EntOperatingInstruction implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "操作规程id") + @TableField("op_instruction_id") + private String opInstructionId; + + @ApiModelProperty(value = "操作规程名字") + @TableField("op_instruction_name") + private String opInstructionName; + + @ApiModelProperty(value = "操作规程描述") + @TableField("op_instruction_description") + private String opInstructionDescription; + + @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 getOpInstructionId() { + return opInstructionId; + } + + public void setOpInstructionId(String opInstructionId) { + this.opInstructionId = opInstructionId; + } + public String getOpInstructionName() { + return opInstructionName; + } + + public void setOpInstructionName(String opInstructionName) { + this.opInstructionName = opInstructionName; + } + public String getOpInstructionDescription() { + return opInstructionDescription; + } + + public void setOpInstructionDescription(String opInstructionDescription) { + this.opInstructionDescription = opInstructionDescription; + } + 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 "EntOperatingInstruction{" + + "opInstructionId=" + opInstructionId + + ", opInstructionName=" + opInstructionName + + ", opInstructionDescription=" + opInstructionDescription + + ", createBy=" + createBy + + ", createTime=" + createTime + + ", modifyBy=" + modifyBy + + ", modifyTime=" + modifyTime + + "}"; + } +} diff --git a/inventory-dao/src/main/java/com/rzyc/model/EntRepairRecord.java b/inventory-dao/src/main/java/com/rzyc/model/EntRepairRecord.java new file mode 100644 index 0000000..a8b7934 --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/model/EntRepairRecord.java @@ -0,0 +1,267 @@ +package com.rzyc.model; + +import java.math.BigDecimal; +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-28 + */ +@TableName("ent_repair_record") +@ApiModel(value="EntRepairRecord对象", description="") +public class EntRepairRecord implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "维修记录") + @TableId("repair_record_id") + private String repairRecordId; + + @TableField("device_id") + private String deviceId; + + @ApiModelProperty(value = "维修Code") + @TableField("repair_code") + private String repairCode; + + @ApiModelProperty(value = "送修时间") + @TableField("repair_time") + private Date repairTime; + + @ApiModelProperty(value = "故障原因 1.自然磨损 2.违章操作 3.配件质量差 4.维护保养不到位 5.其他") + @TableField("cause_of_failure") + private Integer causeOfFailure; + + @ApiModelProperty(value = "外委维修单位") + @TableField("external_maintenance_unit") + private String externalMaintenanceUnit; + + @ApiModelProperty(value = "外委维修单位人员名称") + @TableField("external_maintenance_person_name") + private String externalMaintenancePersonName; + + @ApiModelProperty(value = "1.正在维修 2.待采购件 3.待加工件 4.待停机维修 5.停机维修 6.无法修复 7.待转外委维修 8.已完成") + @TableField("repair_state") + private Integer repairState; + + @ApiModelProperty(value = "维修开始时间") + @TableField("repair_start_time") + private Date repairStartTime; + + @ApiModelProperty(value = "维修结束时间") + @TableField("repair_end_time") + private Date repairEndTime; + + @ApiModelProperty(value = "1.常见故障维修 2.突发性故障维修 3.计划项目维修 4.不正当使用维修") + @TableField("repair_level") + private Integer repairLevel; + + @ApiModelProperty(value = "1. 否 2.是") + @TableField("shutdown") + private Integer shutdown; + + @ApiModelProperty(value = "停机时间") + @TableField("down_time") + private Double downTime; + + @ApiModelProperty(value = "1.否 2.是") + @TableField("affected_generation") + private Integer affectedGeneration; + + @ApiModelProperty(value = "维修花费") + @TableField("repair_cost") + private BigDecimal repairCost; + + @ApiModelProperty(value = "工作描述") + @TableField("work_description") + private String workDescription; + + @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 getRepairRecordId() { + return repairRecordId; + } + + public void setRepairRecordId(String repairRecordId) { + this.repairRecordId = repairRecordId; + } + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + public String getRepairCode() { + return repairCode; + } + + public void setRepairCode(String repairCode) { + this.repairCode = repairCode; + } + public Date getRepairTime() { + return repairTime; + } + + public void setRepairTime(Date repairTime) { + this.repairTime = repairTime; + } + public Integer getCauseOfFailure() { + return causeOfFailure; + } + + public void setCauseOfFailure(Integer causeOfFailure) { + this.causeOfFailure = causeOfFailure; + } + public String getExternalMaintenanceUnit() { + return externalMaintenanceUnit; + } + + public void setExternalMaintenanceUnit(String externalMaintenanceUnit) { + this.externalMaintenanceUnit = externalMaintenanceUnit; + } + public String getExternalMaintenancePersonName() { + return externalMaintenancePersonName; + } + + public void setExternalMaintenancePersonName(String externalMaintenancePersonName) { + this.externalMaintenancePersonName = externalMaintenancePersonName; + } + public Integer getRepairState() { + return repairState; + } + + public void setRepairState(Integer repairState) { + this.repairState = repairState; + } + public Date getRepairStartTime() { + return repairStartTime; + } + + public void setRepairStartTime(Date repairStartTime) { + this.repairStartTime = repairStartTime; + } + public Date getRepairEndTime() { + return repairEndTime; + } + + public void setRepairEndTime(Date repairEndTime) { + this.repairEndTime = repairEndTime; + } + public Integer getRepairLevel() { + return repairLevel; + } + + public void setRepairLevel(Integer repairLevel) { + this.repairLevel = repairLevel; + } + public Integer getShutdown() { + return shutdown; + } + + public void setShutdown(Integer shutdown) { + this.shutdown = shutdown; + } + public Double getDownTime() { + return downTime; + } + + public void setDownTime(Double downTime) { + this.downTime = downTime; + } + public Integer getAffectedGeneration() { + return affectedGeneration; + } + + public void setAffectedGeneration(Integer affectedGeneration) { + this.affectedGeneration = affectedGeneration; + } + public BigDecimal getRepairCost() { + return repairCost; + } + + public void setRepairCost(BigDecimal repairCost) { + this.repairCost = repairCost; + } + public String getWorkDescription() { + return workDescription; + } + + public void setWorkDescription(String workDescription) { + this.workDescription = workDescription; + } + 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 "EntRepairRecord{" + + "repairRecordId=" + repairRecordId + + ", deviceId=" + deviceId + + ", repairCode=" + repairCode + + ", repairTime=" + repairTime + + ", causeOfFailure=" + causeOfFailure + + ", externalMaintenanceUnit=" + externalMaintenanceUnit + + ", externalMaintenancePersonName=" + externalMaintenancePersonName + + ", repairState=" + repairState + + ", repairStartTime=" + repairStartTime + + ", repairEndTime=" + repairEndTime + + ", repairLevel=" + repairLevel + + ", shutdown=" + shutdown + + ", downTime=" + downTime + + ", affectedGeneration=" + affectedGeneration + + ", repairCost=" + repairCost + + ", workDescription=" + workDescription + + ", createBy=" + createBy + + ", createTime=" + createTime + + ", modifyBy=" + modifyBy + + ", modifyTime=" + modifyTime + + "}"; + } +} diff --git a/inventory-dao/src/main/java/com/rzyc/model/EntReportRepair.java b/inventory-dao/src/main/java/com/rzyc/model/EntReportRepair.java new file mode 100644 index 0000000..503ddf3 --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/model/EntReportRepair.java @@ -0,0 +1,146 @@ +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-28 + */ +@TableName("ent_report_repair") +@ApiModel(value="EntReportRepair对象", description="") +public class EntReportRepair implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId("report_repair_id") + private String reportRepairId; + + @ApiModelProperty(value = "设备id") + @TableField("device_id") + private String deviceId; + + @ApiModelProperty(value = "1.紧急 2.一般 3.其它") + @TableField("fault_level") + private Integer faultLevel; + + @ApiModelProperty(value = "1.停机 2.带病运行 3.其它") + @TableField("device_state") + private Integer deviceState; + + @ApiModelProperty(value = "报修人") + @TableField("report_repair_person") + private String reportRepairPerson; + + @ApiModelProperty(value = "故障描述") + @TableField("report_description") + private String reportDescription; + + @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 getReportRepairId() { + return reportRepairId; + } + + public void setReportRepairId(String reportRepairId) { + this.reportRepairId = reportRepairId; + } + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + public Integer getFaultLevel() { + return faultLevel; + } + + public void setFaultLevel(Integer faultLevel) { + this.faultLevel = faultLevel; + } + public Integer getDeviceState() { + return deviceState; + } + + public void setDeviceState(Integer deviceState) { + this.deviceState = deviceState; + } + public String getReportRepairPerson() { + return reportRepairPerson; + } + + public void setReportRepairPerson(String reportRepairPerson) { + this.reportRepairPerson = reportRepairPerson; + } + public String getReportDescription() { + return reportDescription; + } + + public void setReportDescription(String reportDescription) { + this.reportDescription = reportDescription; + } + 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 "EntReportRepair{" + + "reportRepairId=" + reportRepairId + + ", deviceId=" + deviceId + + ", faultLevel=" + faultLevel + + ", deviceState=" + deviceState + + ", reportRepairPerson=" + reportRepairPerson + + ", reportDescription=" + reportDescription + + ", createBy=" + createBy + + ", createTime=" + createTime + + ", modifyBy=" + modifyBy + + ", modifyTime=" + modifyTime + + "}"; + } +} diff --git a/inventory-dao/src/main/java/com/rzyc/model/dto/OperatingInstructionDto.java b/inventory-dao/src/main/java/com/rzyc/model/dto/OperatingInstructionDto.java new file mode 100644 index 0000000..df03e3c --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/model/dto/OperatingInstructionDto.java @@ -0,0 +1,33 @@ +package com.rzyc.model.dto; + +public class OperatingInstructionDto { + private String name; + + private Integer page; + + private Integer pageSize; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getPage() { + return page; + } + + public void setPage(Integer page) { + this.page = page; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } +} diff --git a/inventory-dao/src/main/java/com/rzyc/model/dto/OperatingInstructionsDto.java b/inventory-dao/src/main/java/com/rzyc/model/dto/OperatingInstructionsDto.java new file mode 100644 index 0000000..ea27a5a --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/model/dto/OperatingInstructionsDto.java @@ -0,0 +1,48 @@ +package com.rzyc.model.dto; + + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * 操作规程Dto + * @author Xuwanxin + * @date 2022/10/28 + * */ +@ApiModel(value="操作规程Dto", description="操作规程Dto") +public class OperatingInstructionsDto { + + @ApiModelProperty(value = "操作规程id") + private String opInstructionId; + + @ApiModelProperty(value = "操作规程名字") + private String opInstructionName; + + @ApiModelProperty(value = "操作规程描述") + private String opInstructionDescription; + + public String getOpInstructionId() { + return opInstructionId; + } + + public void setOpInstructionId(String opInstructionId) { + this.opInstructionId = opInstructionId; + } + + public String getOpInstructionName() { + return opInstructionName; + } + + public void setOpInstructionName(String opInstructionName) { + this.opInstructionName = opInstructionName; + } + + public String getOpInstructionDescription() { + return opInstructionDescription; + } + + public void setOpInstructionDescription(String opInstructionDescription) { + this.opInstructionDescription = opInstructionDescription; + } +} diff --git a/inventory-dao/src/main/java/com/rzyc/model/dto/ReportRecordDto.java b/inventory-dao/src/main/java/com/rzyc/model/dto/ReportRecordDto.java new file mode 100644 index 0000000..cc8a9fd --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/model/dto/ReportRecordDto.java @@ -0,0 +1,81 @@ +package com.rzyc.model.dto; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * 报修记录 + * @author Xuwanxin + * @date 2022/10/28 + * */ +@ApiModel(value="报修记录Dto", description="报修记录Dto") +public class ReportRecordDto { + + @ApiModelProperty(value = "主键") + private String reportRepairId; + + @ApiModelProperty(value = "设备id") + private String deviceId; + + @ApiModelProperty(value = "1.紧急 2.一般 3.其它") + private Integer faultLevel; + + @ApiModelProperty(value = "1.停机 2.带病运行 3.其它") + private Integer deviceState; + + @ApiModelProperty(value = "报修人") + private String reportRepairPerson; + + @ApiModelProperty(value = "故障描述") + private String reportDescription; + + public String getReportRepairId() { + return reportRepairId; + } + + public void setReportRepairId(String reportRepairId) { + this.reportRepairId = reportRepairId; + } + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + public Integer getFaultLevel() { + return faultLevel; + } + + public void setFaultLevel(Integer faultLevel) { + this.faultLevel = faultLevel; + } + + public Integer getDeviceState() { + return deviceState; + } + + public void setDeviceState(Integer deviceState) { + this.deviceState = deviceState; + } + + public String getReportRepairPerson() { + return reportRepairPerson; + } + + public void setReportRepairPerson(String reportRepairPerson) { + this.reportRepairPerson = reportRepairPerson; + } + + public String getReportDescription() { + return reportDescription; + } + + public void setReportDescription(String reportDescription) { + this.reportDescription = reportDescription; + } +} diff --git a/inventory-dao/src/main/resources/mapper/EntOperatingInstructionMapper.xml b/inventory-dao/src/main/resources/mapper/EntOperatingInstructionMapper.xml new file mode 100644 index 0000000..cf126f7 --- /dev/null +++ b/inventory-dao/src/main/resources/mapper/EntOperatingInstructionMapper.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + op_instruction_id, op_instruction_name, op_instruction_description, create_by, create_time, modify_by, modify_time + + + + + + update ent_operating_instruction set op_instruction_name = #{data.opInstructionName},op_instruction_description = #{data.opInstructionDescription},modify_time = #{data.modifyTime},modify_by = #{data.modifyBy} + + + diff --git a/inventory-dao/src/main/resources/mapper/EntRepairRecordMapper.xml b/inventory-dao/src/main/resources/mapper/EntRepairRecordMapper.xml new file mode 100644 index 0000000..445ee22 --- /dev/null +++ b/inventory-dao/src/main/resources/mapper/EntRepairRecordMapper.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + repair_record_id, device_id, repair_code, repair_time, cause_of_failure, external_maintenance_unit, external_maintenance_person_name, repair_state, repair_start_time, repair_end_time, repair_level, shutdown, down_time, affected_generation, repair_cost, work_description, create_by, create_time, modify_by, modify_time + + + + + diff --git a/inventory-dao/src/main/resources/mapper/EntReportRepairMapper.xml b/inventory-dao/src/main/resources/mapper/EntReportRepairMapper.xml new file mode 100644 index 0000000..47748bf --- /dev/null +++ b/inventory-dao/src/main/resources/mapper/EntReportRepairMapper.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + report_repair_id, device_id, fault_level, device_state, report_repair_person, report_description, create_by, create_time, modify_by, modify_time + + + + + + + update ent_report_repair + set fault_level = #{data.faultLevel},device_state = #{data.deviceState},report_repair_person = #{data.report_repair_person} , + report_description = #{data.reportDescription},modify_by = #{data.modifyBy},modify_time = #{data.modifyTime} + where report_repair_id = #{data.reportRepairId} + + + diff --git a/inventory-ent/src/main/java/com/rzyc/advice/PageAspect.java b/inventory-ent/src/main/java/com/rzyc/advice/PageAspect.java index 8ea56d8..38d2583 100644 --- a/inventory-ent/src/main/java/com/rzyc/advice/PageAspect.java +++ b/inventory-ent/src/main/java/com/rzyc/advice/PageAspect.java @@ -1,3 +1,4 @@ +/* package com.rzyc.advice; import com.github.pagehelper.PageHelper; @@ -9,12 +10,14 @@ import org.springframework.stereotype.Component; import java.lang.reflect.Field; +*/ /** * @Author jilin * @Date 2021/11/09 11:57 * 分页aop * 注解写在mapper上,aop代理方式需为jdk代理,cglib代理无法aop mapper - **/ + **//* + @Aspect @Component public class PageAspect { @@ -32,3 +35,4 @@ public class PageAspect { PageHelper.startPage((Integer) page.get(args[0]),(Integer) pageSize.get(args[0])); } } +*/ diff --git a/inventory-ent/src/main/java/com/rzyc/advice/PageOperation.java b/inventory-ent/src/main/java/com/rzyc/advice/PageOperation.java index bd45848..ff16371 100644 --- a/inventory-ent/src/main/java/com/rzyc/advice/PageOperation.java +++ b/inventory-ent/src/main/java/com/rzyc/advice/PageOperation.java @@ -1,15 +1,19 @@ +/* package com.rzyc.advice; import java.lang.annotation.*; +*/ /** * @Author jilin * @Date 2021/11/09 11:59 * 分页aop - **/ + **//* + @Target({ElementType.PARAMETER, ElementType.METHOD}) @Retention(RetentionPolicy.CLASS) @Documented public @interface PageOperation { String content() default ""; } +*/ diff --git a/inventory-ent/src/main/java/com/rzyc/config/PageAspect.java b/inventory-ent/src/main/java/com/rzyc/config/PageAspect.java new file mode 100644 index 0000000..2cb904e --- /dev/null +++ b/inventory-ent/src/main/java/com/rzyc/config/PageAspect.java @@ -0,0 +1,119 @@ +package com.rzyc.config; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.common.utils.model.Pager; +import com.common.utils.model.SingleResult; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Author jilin + * @Date 2021/11/09 11:57 + * 分页aop + * 注解写在mapper上,aop代理方式需为jdk代理,cglib代理无法aop mapper + **/ +@Aspect +@Component +public class PageAspect { + @Pointcut("@annotation(com.common.utils.pager.PageOperation)execution(* com.rzyc..*.*(..))") + public void page() {} + + @Around("page()") + public Object pageOperation(ProceedingJoinPoint joinPoint) throws Throwable { + MethodSignature signature = (MethodSignature) joinPoint.getSignature(); + Object[] args = joinPoint.getArgs(); + String[] paramNames = signature.getParameterNames(); + //搜寻参数,设置分页参数 + boolean isPage = setPageParams(args, paramNames); + Object proceed = joinPoint.proceed(); + if (isPage){ + Page page = (Page) proceed; + Pager pager = new Pager(); + pager.setRows(page.getResult()); + pager.setTotal(page.getTotal()); + return packageData(pager); + } + return proceed; + } + + private SingleResult packageData( Pager pager){ + SingleResult singleResult = new SingleResult(); + singleResult.setData(pager); + return singleResult; + } + + /** + * 设置参数,返回是否分页 + * @param args + * @param paramNames + * @throws Exception + */ + public boolean setPageParams(Object[] args,String[] paramNames) throws Exception { + Integer pageValue = null; + Integer pageSizeValue = null; + for (int i = 0; i < args.length; i++) { + Object arg = args[i]; + //自定义对象 + if (arg.getClass().getClassLoader()!=null){ + if (List.class.isAssignableFrom(arg.getClass())||arg instanceof List){ + continue; + } + JSONObject jsonObject = (JSONObject) JSON.toJSON(arg); + //获取page + pageValue= this.getPage(jsonObject); + //获取PageSize + pageSizeValue = this.getPageSize(jsonObject); + }else{ + String paramName = paramNames[i]; + if ("page".equals(paramName)){ + if (arg instanceof Integer){ + pageValue = (Integer) arg; + }else{ + throw new Exception("page参数类型为:"+arg.getClass().getName()); + } + } + if ("pageSize".equals(paramName)){ + if (arg instanceof Integer){ + pageSizeValue = (Integer) arg; + }else{ + throw new Exception("page参数类型为:"+arg.getClass().getName()); + } + } + } + } + if (pageValue!=null&&pageValue!=0&&pageSizeValue!=null&&pageSizeValue!=0){ + PageHelper.startPage(pageValue,pageSizeValue); + return true; + } + return false; + } + + public Integer getPage(JSONObject arg) throws Exception { + Integer page = null; + try{ + page = arg.getInteger("page"); + }catch (Exception e){ + throw new Exception("page参数类型需为 Integer"); + } + return page; + } + + public Integer getPageSize(JSONObject arg) throws Exception { + Integer pageSize = null; + try{ + pageSize = arg.getInteger("pageSize"); + }catch (Exception e){ + throw new Exception("pageSize参数类型需为 Integer"); + } + return pageSize; + } +} 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 df4512e..7c93cdd 100644 --- a/inventory-ent/src/main/java/com/rzyc/controller/BaseController.java +++ b/inventory-ent/src/main/java/com/rzyc/controller/BaseController.java @@ -484,7 +484,7 @@ public class BaseController { @Autowired protected SparePartMapper sparePartMapper; - //企业巡查记录 + //企业设备巡查记录 @Autowired protected EntInsRecordMapper entInsRecordMapper; @@ -492,7 +492,7 @@ public class BaseController { @Autowired protected EntDeviceMaintenancePlanMapper entDeviceMaintenancePlanMapper; - //企业周期巡检 + //企业设备周期巡检 @Autowired protected EntDeviceInsCycleMapper entDeviceInsCycleMapper; @@ -501,15 +501,28 @@ public class BaseController { protected EntDeviceMaintenanceRecordMapper entDeviceMaintenanceRecordMapper; - //企业送检记录 + //企业设备送检记录 @Autowired protected EntInspectionRecordMapper entInspectionRecordMapper; - //企业维修计划 + //企业设备维修计划 @Autowired protected EntRepairPlanMapper entRepairPlanMapper; + //企业设备维修记录 + @Autowired + protected EntRepairRecordMapper entRepairRecordMapper; + + + //企业设备故障报修 + @Autowired + protected EntReportRepairMapper entReportRepairMapper; + + //企业设备操作规程 + @Autowired + protected EntOperatingInstructionMapper entOperatingInstructionMapper; + /** 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 21048eb..9aca86c 100644 --- a/inventory-ent/src/main/java/com/rzyc/controller/EnterpriseEquipmentController.java +++ b/inventory-ent/src/main/java/com/rzyc/controller/EnterpriseEquipmentController.java @@ -1,10 +1,14 @@ package com.rzyc.controller; +import com.common.utils.model.Pager; import com.common.utils.model.SingleResult; +import com.common.utils.pager.PageOperation; +import com.github.pagehelper.Page; import com.rzyc.config.MethodAnnotation; import com.rzyc.model.EntDevice; import com.rzyc.model.EntDeviceType; +import com.rzyc.model.EntOperatingInstruction; import com.rzyc.model.dto.*; import com.rzyc.service.PcBusinessService; import io.swagger.annotations.Api; @@ -73,8 +77,8 @@ public class EnterpriseEquipmentController extends BaseController { @PreAuthorize("hasAnyAuthority('entEquipmentList','entEquipmentList:update')") @MethodAnnotation(authorizations = {"entEquipmentList","entEquipmentList:update"},name = "企业设备列表") @ResponseBody - public SingleResult> entEquipmentList(@NotNull(message = "公司id不能为null") String enterpriseId, String typeId)throws Exception{ - return pcBusinessService.entEquipmentList(enterpriseId,typeId); + public Object entEquipmentList(@NotNull(message = "公司id不能为null") String enterpriseId, String typeId,Integer page,Integer pageSize)throws Exception{ + return pcBusinessService.entEquipmentList(enterpriseId,typeId,page,pageSize); } @@ -134,13 +138,13 @@ public class EnterpriseEquipmentController extends BaseController { @ApiOperation(value = "设备周期巡检", notes = "设备周期巡检") @GetMapping(value = "/deviceInspectionCycle") @PreAuthorize("hasAnyAuthority('deviceInspectionCycle','deviceInspectionCycle:update')") - @MethodAnnotation(authorizations = {"deviceInspectionCycle","deviceInspectionCycle:update'"},name = "设备维护周期") + @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); + public Object deviceInspectionCycle(String inspectionName,Integer page,Integer pageSize)throws Exception{ + return pcBusinessService.deviceInspectionCycle(inspectionName,page,pageSize); } @@ -182,8 +186,8 @@ public class EnterpriseEquipmentController extends BaseController { @PreAuthorize("hasAnyAuthority('inspectionRecord','inspectionRecord:update')") @MethodAnnotation(authorizations = {"inspectionRecord","inspectionRecord:update"},name = "设备巡检记录") @ResponseBody - public SingleResult inspectionRecord(String inspectionRecordName)throws Exception{ - return pcBusinessService.selectInspectionRecord(inspectionRecordName); + public Object inspectionRecord(String inspectionRecordName,Integer page,Integer pageSize)throws Exception{ + return pcBusinessService.selectInspectionRecord(inspectionRecordName,page,pageSize); } @@ -198,8 +202,8 @@ public class EnterpriseEquipmentController extends BaseController { @PreAuthorize("hasAnyAuthority('sparePartList','sparePartList:update')") @MethodAnnotation(authorizations = {"sparePartList","sparePartList:update"},name = "备件列表") @ResponseBody - public SingleResult sparePartList(String name)throws Exception{ - return pcBusinessService.sparePartList(name); + public Object sparePartList(String name,Integer page,Integer pageSize)throws Exception{ + return pcBusinessService.sparePartList(name,page,pageSize); } @@ -243,8 +247,8 @@ public class EnterpriseEquipmentController extends BaseController { @PreAuthorize("hasAnyAuthority('entDeviceMaintenancePlan','entDeviceMaintenancePlan:update')") @MethodAnnotation(authorizations = {"entDeviceMaintenancePlan","entDeviceMaintenancePlan:update"},name = "保养计划列表") @ResponseBody - public SingleResult entDeviceMaintenancePlan()throws Exception{ - return pcBusinessService.entDeviceMaintenancePlan(); + public Object entDeviceMaintenancePlan(Integer page,Integer pageSize)throws Exception{ + return pcBusinessService.entDeviceMaintenancePlan(page,pageSize); } @@ -276,8 +280,8 @@ public class EnterpriseEquipmentController extends BaseController { @PreAuthorize("hasAnyAuthority('entDeviceMaintenanceRecord','entDeviceMaintenanceRecord:update')") @MethodAnnotation(authorizations = {"entDeviceMaintenanceRecord","entDeviceMaintenanceRecord:update"},name = "保养记录") @ResponseBody - public SingleResult entDeviceMaintenanceRecord()throws Exception{ - return pcBusinessService.entDeviceMaintenanceRecord(); + public SingleResult entDeviceMaintenanceRecord(Integer page,Integer pageSize)throws Exception{ + return pcBusinessService.entDeviceMaintenanceRecord(page,pageSize); } @@ -292,8 +296,8 @@ public class EnterpriseEquipmentController extends BaseController { @PreAuthorize("hasAnyAuthority('inspectionRecord','inspectionRecord:update')") @MethodAnnotation(authorizations = {"inspectionRecord","inspectionRecord:update"},name = "送检记录") @ResponseBody - public SingleResult inspectionRecord(@Param("startTime") String startTime, @Param("endTime")String endTime)throws Exception{ - return pcBusinessService.inspectionRecord(startTime,endTime); + public Object inspectionRecord(@Param("startTime") String startTime, @Param("endTime")String endTime,Integer page,Integer pageSize)throws Exception{ + return pcBusinessService.inspectionRecord(startTime,endTime,page,pageSize); } @@ -323,8 +327,8 @@ public class EnterpriseEquipmentController extends BaseController { @PreAuthorize("hasAnyAuthority('repairPlan','repairPlan:update')") @MethodAnnotation(authorizations = {"repairPlan","repairPlan:update"},name = "维修计划") @ResponseBody - public SingleResult repairPlan()throws Exception{ - return pcBusinessService.repairPlan(); + public Object repairPlan(Integer page,Integer pageSize)throws Exception{ + return pcBusinessService.repairPlan(page,pageSize); } /** @@ -354,8 +358,8 @@ public class EnterpriseEquipmentController extends BaseController { @PreAuthorize("hasAnyAuthority('repairRecord','repairRecord:update')") @MethodAnnotation(authorizations = {"repairRecord","repairRecord:update"},name = "维修记录") @ResponseBody - public SingleResult repairRecord()throws Exception{ - return pcBusinessService.repairRecord(); + public Object repairRecord(Integer page,Integer pageSize)throws Exception{ + return pcBusinessService.repairRecord(page,pageSize); } /** @@ -368,14 +372,55 @@ public class EnterpriseEquipmentController extends BaseController { @PreAuthorize("hasAnyAuthority('reportRecord','reportRecord:update')") @MethodAnnotation(authorizations = {"reportRecord","reportRecord:update"},name = "报修记录") @ResponseBody - public SingleResult reportRecord()throws Exception{ - return pcBusinessService.reportRecord(); + public Object reportRecord(Integer page,Integer pageSize)throws Exception{ + return pcBusinessService.reportRecord(page,pageSize); + } + + /** + * 新增报修 + * @throws Exception + **/ + @ApiOperation(value = "新增报修", notes = "新增报修") + @PostMapping(value = "/addOrUpdateReportRecord") + @PreAuthorize("hasAnyAuthority('reportRecord:update')") + @MethodAnnotation(authorizations = {"reportRecord:update"},name = "新增报修") + @ResponseBody + public SingleResult addOrUpdateReportRecord(@RequestBody ReportRecordDto reportRecordDto)throws Exception{ + return pcBusinessService.addOrUpdateReportRecord(reportRecordDto); + } + + /** + * 设备安标 + * + * */ + + + /** + * 操作规程 + * + * */ + @ApiOperation(value = "操作规程", notes = "操作规程") + @GetMapping(value = "/operatingInstructions") + @PreAuthorize("hasAnyAuthority('operatingInstructions','operatingInstructions:update')") + @MethodAnnotation(authorizations = {"operatingInstructions","operatingInstructions:update"},name = "操作规程") + @ResponseBody + public Object operatingInstructions(@RequestBody OperatingInstructionDto operatingInstructionDto)throws Exception{ + return pcBusinessService.operatingInstructions(operatingInstructionDto); + } + + /** + * 新增,修改操作规程 + * + * */ + @ApiOperation(value = "新增,修改操作规程", notes = "新增,修改操作规程") + @PostMapping(value = "/operatingInstructionsAddOrUpdate") + @PreAuthorize("hasAnyAuthority('operatingInstructions:update')") + @MethodAnnotation(authorizations = {"operatingInstructions:update"},name = "新增,修改操作规程") + @ResponseBody + public SingleResult operatingInstructionsAddOrUpdate(@RequestBody OperatingInstructionsDto operatingInstructionsDto)throws Exception{ + return pcBusinessService.operatingInstructionsAddOrUpdate(operatingInstructionsDto); } - - - - } 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 8623ae7..584abd6 100644 --- a/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java +++ b/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java @@ -6,7 +6,10 @@ import com.common.utils.*; import com.common.utils.encryption.MD5; import com.common.utils.model.Code; import com.common.utils.model.Message; +import com.common.utils.model.Pager; import com.common.utils.model.SingleResult; +import com.common.utils.pager.PageOperation; +import com.github.pagehelper.Page; import com.rzyc.config.RedisUtil; import com.rzyc.controller.BaseController; import com.rzyc.enums.RedisKeys; @@ -301,11 +304,9 @@ public class PcBusinessService extends BaseController { } - public SingleResult entEquipmentList(String enterpriseId, String typeId){ - SingleResult singleResult = new SingleResult(); - List devices = entDeviceMapper.selectEntEquipmentList(enterpriseId,typeId); - singleResult.setData(devices); - return singleResult; + public Object entEquipmentList(String enterpriseId, String typeId,Integer page,Integer pageSize){ + Page devices = (Page) entDeviceMapper.selectEntEquipmentList(enterpriseId,typeId); + return devices; } public SingleResult entEquipmentStatistic(String enterpriseId, String deviceId){ @@ -392,11 +393,9 @@ 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 Object deviceInspectionCycle(String inspectionName,Integer page,Integer pageSize){ + Pagelist = (Page) entDeviceInsCycleMapper.deviceInspectionCycle(inspectionName); + return list; } public SingleResult addOrUpdateDeviceInspectionCycle(AddOrUpdateDeviceInspectionCycleDto addOrUpdateDeviceInspectionCycleDto){ @@ -433,18 +432,14 @@ public class PcBusinessService extends BaseController { return singleResult; } - public SingleResult selectInspectionRecord(String inspectionRecordName){ - SingleResult singleResult = new SingleResult(); - List entInsRecords = entInsRecordMapper.selectInspectionRecord(inspectionRecordName); - singleResult.setData(entInsRecords); - return singleResult; + public Object selectInspectionRecord(String inspectionRecordName,Integer page,Integer pageSize){ + Page entInsRecords = (Page) entInsRecordMapper.selectInspectionRecord(inspectionRecordName); + return entInsRecords; } - public SingleResult sparePartList(String name){ - SingleResult singleResult = new SingleResult(); - ListsparePartList = sparePartMapper.sparePartList(name); - singleResult.setData(sparePartList); - return singleResult; + public Object sparePartList(String name,Integer page,Integer pageSize){ + PagesparePartList = (Page) sparePartMapper.sparePartList(name); + return sparePartList; } public SingleResult sparePartUpdate(SparePartDto sparePartDto){ @@ -481,11 +476,9 @@ public class PcBusinessService extends BaseController { return singleResult; } - public SingleResult entDeviceMaintenancePlan(){ - SingleResult singleResult = new SingleResult(); - List list = entDeviceMaintenancePlanMapper.selectEntDeviceMaintenancePlanList(); - singleResult.setData(list); - return singleResult; + public Object entDeviceMaintenancePlan(Integer page,Integer pageSize){ + Page list = (Page) entDeviceMaintenancePlanMapper.selectEntDeviceMaintenancePlanList(); + return list; } public SingleResult entDeviceMaintenanceRecordUpdate(EntDeviceMaintenanceRecordDto entDeviceMaintenanceRecordDto){ @@ -505,24 +498,20 @@ public class PcBusinessService extends BaseController { return singleResult; } - public SingleResult entDeviceMaintenanceRecord(){ + public SingleResult entDeviceMaintenanceRecord(Integer page,Integer pageSize){ SingleResult singleResult = new SingleResult(); Listlist = entDeviceMaintenanceRecordMapper.selectEntDeviceMaintenanceRecord(); singleResult.setData(list); return singleResult; } - public SingleResult inspectionRecord(String startTime,String endTime){ - SingleResult singleResult = new SingleResult(); - ListinspectionRecords = entInspectionRecordMapper.selectInspectionRecord(startTime,endTime); - singleResult.setData(inspectionRecords); - return singleResult; + public Object inspectionRecord(String startTime,String endTime,Integer page,Integer pageSize){ + PageinspectionRecords = (Page) entInspectionRecordMapper.selectInspectionRecord(startTime,endTime); + return inspectionRecords; } - public SingleResult repairPlan(){ - SingleResult singleResult = new SingleResult(); - ListentRepairPlans = entRepairPlanMapper.selectRepairPlan(); - singleResult.setData(entRepairPlans); - return singleResult; + public Object repairPlan(Integer page,Integer pageSize){ + PageentRepairPlans = (Page) entRepairPlanMapper.selectRepairPlan(); + return entRepairPlans; } public SingleResult repairPlanUpdate(EntRepairPlanDto entRepairPlanDto){ @@ -559,15 +548,56 @@ public class PcBusinessService extends BaseController { return singleResult; } - public SingleResult repairRecord(){ + @PageOperation + public Object repairRecord(Integer page,Integer pageSize){ + Page repairRecords = (Page) entRepairRecordMapper.repairRecord(); + return repairRecords; + } + + @PageOperation + public Object reportRecord(Integer page,Integer pageSize){ + PagereportRepairs = (Page) entReportRepairMapper.reportRecord(); + return reportRepairs; + } + + public SingleResult addOrUpdateReportRecord(ReportRecordDto reportRecordDto){ SingleResult singleResult = new SingleResult(); - //ent_repair_record + EntReportRepair entReportRepair = new EntReportRepair(); + BeanUtils.copyProperties(reportRecordDto,entReportRepair); + int result = 0; + if (null != reportRecordDto && null != entReportRepair.getReportRepairId()){ + entReportRepairMapper.updateReportRecord(entReportRepair); + }else { + entReportRepairMapper.insert(entReportRepair); + } + if (result != 1 ){ + singleResult.setCode(Code.ERROR.getCode()); + singleResult.setMessage(Message.ERROR); + } return singleResult; } + @PageOperation + public Object operatingInstructions(OperatingInstructionDto operatingInstructionDto){ + Page page = (Page) entOperatingInstructionMapper.selectOperatingInstructions(operatingInstructionDto.getName()); + return page; + } - public SingleResult reportRecord(){ + + public SingleResult operatingInstructionsAddOrUpdate(OperatingInstructionsDto operatingInstructionsDto){ SingleResult singleResult = new SingleResult(); + EntOperatingInstruction entOperatingInstruction = new EntOperatingInstruction(); + BeanUtils.copyProperties(operatingInstructionsDto,entOperatingInstruction); + int result = 0; + if (null != operatingInstructionsDto && null != entOperatingInstruction.getOpInstructionId()){ + result = entOperatingInstructionMapper.updateEntOperatingInstruction(entOperatingInstruction); + }else { + result = entOperatingInstructionMapper.insert(entOperatingInstruction); + } + if (result != 1 ){ + singleResult.setCode(Code.ERROR.getCode()); + singleResult.setMessage(Message.ERROR); + } return singleResult; } diff --git a/utils/pom.xml b/utils/pom.xml index e3cce88..488bf46 100644 --- a/utils/pom.xml +++ b/utils/pom.xml @@ -302,8 +302,18 @@ ooxml-schemas 1.4 + + + + com.fasterxml.jackson.core + jackson-databind + 2.10.2 + compile + + + diff --git a/inventory-dao/src/main/java/com/rzyc/config/PageOperation.java b/utils/src/main/java/com/common/utils/pager/PageOperation.java similarity index 89% rename from inventory-dao/src/main/java/com/rzyc/config/PageOperation.java rename to utils/src/main/java/com/common/utils/pager/PageOperation.java index 3f8c88c..dacee97 100644 --- a/inventory-dao/src/main/java/com/rzyc/config/PageOperation.java +++ b/utils/src/main/java/com/common/utils/pager/PageOperation.java @@ -1,4 +1,4 @@ -package com.rzyc.config; +package com.common.utils.pager; import java.lang.annotation.*; diff --git a/utils/src/main/java/com/common/utils/pager/Pager.java b/utils/src/main/java/com/common/utils/pager/Pager.java new file mode 100644 index 0000000..f85615e --- /dev/null +++ b/utils/src/main/java/com/common/utils/pager/Pager.java @@ -0,0 +1,147 @@ +package com.common.utils.pager; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +import java.util.ArrayList; +import java.util.List; + +/** + * 后台easyui要求格式 + * @author hp + * + * @param + */ +@JsonSerialize(using = PagerSerializer.class) +public class Pager extends ArrayList{ + + private Integer pageSize = 10;//每页显示多少条 + + private Integer page = 1;//当前页 + + private Long total = 0L; + + private Integer redlevel; //红色企业数 + + private Integer orangelevel; //橙色企业数 + + private Integer yellowlevel; //黄色企业数 + + private Integer bluelevel; //蓝色企业数 + + private Integer totalDanger = 0;//总数 + private Integer notRectify = 0;//未整改 + private Integer rectify = 0;//整改中 + private Integer rectifyComplete = 0;//已整改 + private Integer unCheck = 0;//审核中 + + public Integer getUnCheck() { + return unCheck; + } + + public void setUnCheck(Integer unCheck) { + this.unCheck = unCheck; + } + + public Integer getTotalDanger() { + return totalDanger; + } + + public void setTotalDanger(Integer totalDanger) { + this.totalDanger = totalDanger; + } + + public Integer getNotRectify() { + return notRectify; + } + + public void setNotRectify(Integer notRectify) { + this.notRectify = notRectify; + } + + public Integer getRectify() { + return rectify; + } + + public void setRectify(Integer rectify) { + this.rectify = rectify; + } + + public Integer getRectifyComplete() { + return rectifyComplete; + } + + public void setRectifyComplete(Integer rectifyComplete) { + this.rectifyComplete = rectifyComplete; + } + + public Long getTotal() { + return total; + } + + public void setTotal(Long total) { + this.total = total; + } + + public Integer getPageSize() { + return pageSize==null?10:pageSize; + } + + public void setPageSize(Integer pageSize) { + if(pageSize!=null&&pageSize>0){ + this.pageSize = pageSize; + } + } + + public Integer getPage() { + return page==null?1:page; + } + + public void setPage(Integer page) { + if(page!=null&&page>0){ + this.page = page; + } + } + + public List getRows() { + List result = new ArrayList<>(); + result.addAll(this); + return result; + } + + public void setRows(List rows) { + this.clear(); + this.addAll(rows); + } + + public Integer getRedlevel() { + return redlevel; + } + + public void setRedlevel(Integer redlevel) { + this.redlevel = redlevel; + } + + public Integer getOrangelevel() { + return orangelevel; + } + + public void setOrangelevel(Integer orangelevel) { + this.orangelevel = orangelevel; + } + + public Integer getYellowlevel() { + return yellowlevel; + } + + public void setYellowlevel(Integer yellowlevel) { + this.yellowlevel = yellowlevel; + } + + public Integer getBluelevel() { + return bluelevel; + } + + public void setBluelevel(Integer bluelevel) { + this.bluelevel = bluelevel; + } +} diff --git a/utils/src/main/java/com/common/utils/pager/PagerSerializer.java b/utils/src/main/java/com/common/utils/pager/PagerSerializer.java new file mode 100644 index 0000000..764184c --- /dev/null +++ b/utils/src/main/java/com/common/utils/pager/PagerSerializer.java @@ -0,0 +1,43 @@ +package com.common.utils.pager; + + +import com.alibaba.fastjson.JSONArray; +import com.common.utils.model.Pager; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import org.apache.poi.ss.formula.functions.T; + +import java.io.IOException; +import java.lang.reflect.Field; + +/** + * @author by jilin + * @version 1.0 + * @date 2022-10-10-14:58 + */ +public class PagerSerializer extends JsonSerializer> { + @Override + public void serialize(Pager pager, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { + Class clazz = pager.getClass(); + jsonGenerator.writeStartObject(); + for (Field field:clazz.getDeclaredFields()){ + field.setAccessible(true); + Class type = field.getType(); + Object o = null; + try { + o = field.get(pager); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + ClassLoader classLoader = type.getClassLoader(); + if (classLoader==null){ + jsonGenerator.writeObjectField(field.getName(),o); + }else{ + jsonGenerator.writeStringField(field.getName(), JSONArray.toJSONString(pager.getRows())); + } + } + jsonGenerator.writeObjectField("rows", pager.getRows()); + jsonGenerator.writeEndObject(); + } +}