diff --git a/inventory-dao/src/main/java/com/rzyc/enums/RedisKeys.java b/inventory-dao/src/main/java/com/rzyc/enums/RedisKeys.java
new file mode 100644
index 0000000..f8397aa
--- /dev/null
+++ b/inventory-dao/src/main/java/com/rzyc/enums/RedisKeys.java
@@ -0,0 +1,32 @@
+package com.rzyc.enums;
+
+
+/**
+ * Redis key 分类包
+ * @author Xuwanxin
+ * @date 2022/10/18
+ * */
+
+public enum RedisKeys {
+ //企业岗位
+ POST("entPost"),
+
+ //企业设备
+ DEVICE("entDevice");
+
+ /*******分界线********/
+
+ private String key;
+
+ RedisKeys(String key) {
+ this.key = key;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+}
diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMapper.java
new file mode 100644
index 0000000..246b391
--- /dev/null
+++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMapper.java
@@ -0,0 +1,38 @@
+package com.rzyc.mapper;
+
+import com.rzyc.model.EntDevice;
+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-18
+ */
+@Repository
+public interface EntDeviceMapper extends BaseMapper {
+
+ /**
+ * 查询企业设备表
+ * @param enterpriseId 企业id
+ * @param typeId 设备类型id
+ * @return list
+ * */
+ ListselectEntEquipmentList(@Param("enterpriseId") String enterpriseId,@Param("typeId") String typeId);
+
+
+ /**
+ * 企业设备保养和维修检查记录统计
+ * @param enterpriseId 企业id
+ * @param deviceId 设备id
+ * @return EntDevice
+ * */
+ EntDevice entEquipmentStatistic(String enterpriseId, String deviceId);
+
+}
diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceTypeMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceTypeMapper.java
new file mode 100644
index 0000000..2197358
--- /dev/null
+++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceTypeMapper.java
@@ -0,0 +1,28 @@
+package com.rzyc.mapper;
+
+import com.rzyc.model.EntDeviceType;
+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-18
+ */
+@Repository
+public interface EntDeviceTypeMapper extends BaseMapper {
+
+ /**
+ * 查询企业设备类型表
+ * @param enterpriseId
+ * @return list
+ * */
+ ListselectEntEquipmentTypeList(@Param("enterpriseId") String enterpriseId);
+
+}
diff --git a/inventory-dao/src/main/java/com/rzyc/model/EntDevice.java b/inventory-dao/src/main/java/com/rzyc/model/EntDevice.java
new file mode 100644
index 0000000..22f097d
--- /dev/null
+++ b/inventory-dao/src/main/java/com/rzyc/model/EntDevice.java
@@ -0,0 +1,259 @@
+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-18
+ */
+@TableName("ent_device")
+@ApiModel(value="EntDevice对象", description="设备")
+public class EntDevice implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @ApiModelProperty(value = "设备id")
+ @TableId("device_id")
+ private String deviceId;
+
+ @ApiModelProperty(value = "设备名称")
+ @TableField("name")
+ private String name;
+
+ @ApiModelProperty(value = "设备编号")
+ @TableField("number")
+ private String number;
+
+ @ApiModelProperty(value = "规格型号")
+ @TableField("model_num")
+ private String modelNum;
+
+ @ApiModelProperty(value = "设备状态")
+ @TableField("model_state")
+ private Integer modelState;
+
+ @ApiModelProperty(value = "购买时间")
+ @TableField("buy_time")
+ private Date buyTime;
+
+ @ApiModelProperty(value = "出厂日期")
+ @TableField("date_production")
+ private Date dateProduction;
+
+ @ApiModelProperty(value = "安装时间")
+ @TableField("installation_production")
+ private Date installationTime;
+
+ @ApiModelProperty(value = "启用时间")
+ @TableField("enable_time")
+ private Date enableTime;
+
+ @ApiModelProperty(value = "报废时间")
+ @TableField("scrap_time")
+ private Date scrapTime;
+
+ @ApiModelProperty(value = "设备分类id")
+ @TableField("type_id")
+ private String typeId;
+
+ @ApiModelProperty(value = "设备分类路径")
+ @TableField("type_path")
+ private String typePath;
+
+ @ApiModelProperty(value = "企业id")
+ @TableField("enterprise_id")
+ private String enterpriseId;
+
+ @ApiModelProperty(value = "二维码地址")
+ @TableField("qr_code")
+ private String qrCode;
+
+ @ApiModelProperty(value = "删除状态 1:正常 2:已删除")
+ @TableField("del_state")
+ private Integer delState;
+
+ @ApiModelProperty(value = "创建时间")
+ @TableField("create_time")
+ private Date createTime;
+
+ @ApiModelProperty(value = "创建人")
+ @TableField("create_by")
+ private String createBy;
+
+ @ApiModelProperty(value = "修改时间")
+ @TableField("modify_time")
+ private Date modifyTime;
+
+ @ApiModelProperty(value = "修改人")
+ @TableField("modify_by")
+ private String modifyBy;
+
+ public Date getInstallationTime() {
+ return installationTime;
+ }
+
+ public void setInstallationTime(Date installationTime) {
+ this.installationTime = installationTime;
+ }
+
+ public Date getEnableTime() {
+ return enableTime;
+ }
+
+ public void setEnableTime(Date enableTime) {
+ this.enableTime = enableTime;
+ }
+
+ public Date getScrapTime() {
+ return scrapTime;
+ }
+
+ public void setScrapTime(Date scrapTime) {
+ this.scrapTime = scrapTime;
+ }
+
+ public Date getDateProduction() {
+ return dateProduction;
+ }
+
+ public void setDateProduction(Date dateProduction) {
+ this.dateProduction = dateProduction;
+ }
+
+ public String getDeviceId() {
+ return deviceId;
+ }
+
+ public void setDeviceId(String deviceId) {
+ this.deviceId = deviceId;
+ }
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+ public String getNumber() {
+ return number;
+ }
+
+ public void setNumber(String number) {
+ this.number = number;
+ }
+ public String getModelNum() {
+ return modelNum;
+ }
+
+ public void setModelNum(String modelNum) {
+ this.modelNum = modelNum;
+ }
+ public Integer getModelState() {
+ return modelState;
+ }
+
+ public void setModelState(Integer modelState) {
+ this.modelState = modelState;
+ }
+ public Date getBuyTime() {
+ return buyTime;
+ }
+
+ public void setBuyTime(Date buyTime) {
+ this.buyTime = buyTime;
+ }
+ public String getTypeId() {
+ return typeId;
+ }
+
+ public void setTypeId(String typeId) {
+ this.typeId = typeId;
+ }
+ public String getTypePath() {
+ return typePath;
+ }
+
+ public void setTypePath(String typePath) {
+ this.typePath = typePath;
+ }
+ public String getEnterpriseId() {
+ return enterpriseId;
+ }
+
+ public void setEnterpriseId(String enterpriseId) {
+ this.enterpriseId = enterpriseId;
+ }
+ public String getQrCode() {
+ return qrCode;
+ }
+
+ public void setQrCode(String qrCode) {
+ this.qrCode = qrCode;
+ }
+ public Integer getDelState() {
+ return delState;
+ }
+
+ public void setDelState(Integer delState) {
+ this.delState = delState;
+ }
+ 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 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;
+ }
+
+ @Override
+ public String toString() {
+ return "EntDevice{" +
+ "deviceId=" + deviceId +
+ ", name=" + name +
+ ", number=" + number +
+ ", modelNum=" + modelNum +
+ ", modelState=" + modelState +
+ ", buyTime=" + buyTime +
+ ", typeId=" + typeId +
+ ", typePath=" + typePath +
+ ", enterpriseId=" + enterpriseId +
+ ", qrCode=" + qrCode +
+ ", delState=" + delState +
+ ", createTime=" + createTime +
+ ", createBy=" + createBy +
+ ", modifyTime=" + modifyTime +
+ ", modifyBy=" + modifyBy +
+ "}";
+ }
+}
diff --git a/inventory-dao/src/main/java/com/rzyc/model/EntDeviceType.java b/inventory-dao/src/main/java/com/rzyc/model/EntDeviceType.java
new file mode 100644
index 0000000..89878de
--- /dev/null
+++ b/inventory-dao/src/main/java/com/rzyc/model/EntDeviceType.java
@@ -0,0 +1,187 @@
+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-18
+ */
+@TableName("ent_device_type")
+@ApiModel(value="EntDeviceType对象", description="设备分类")
+public class EntDeviceType implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @ApiModelProperty(value = "设备分类id")
+ @TableId("type_id")
+ private String typeId;
+
+ @ApiModelProperty(value = "企业id")
+ @TableField("enterprise_id")
+ private String enterpriseId;
+
+ @ApiModelProperty(value = "分类名")
+ @TableField("name")
+ private String name;
+
+ @ApiModelProperty(value = "分类logo")
+ @TableField("logo")
+ private String logo;
+
+ @ApiModelProperty(value = "父级分类")
+ @TableField("parent_id")
+ private String parentId;
+
+ @ApiModelProperty(value = "所有父级分类")
+ @TableField("parent_path")
+ private String parentPath;
+
+ @ApiModelProperty(value = "父级分类名")
+ @TableField("parent_name")
+ private String parentName;
+
+ @ApiModelProperty(value = "排序")
+ @TableField("sort_id")
+ private Integer sortId;
+
+ @ApiModelProperty(value = "删除状态 1:正常 2:已删除")
+ @TableField("del_state")
+ private Integer delState;
+
+ @ApiModelProperty(value = "创建时间")
+ @TableField("create_time")
+ private Date createTime;
+
+ @ApiModelProperty(value = "创建人")
+ @TableField("create_by")
+ private String createBy;
+
+ @ApiModelProperty(value = "修改时间")
+ @TableField("modify_time")
+ private Date modifyTime;
+
+ @ApiModelProperty(value = "修改人")
+ @TableField("modify_by")
+ private String modifyBy;
+
+ public String getTypeId() {
+ return typeId;
+ }
+
+ public void setTypeId(String typeId) {
+ this.typeId = typeId;
+ }
+ public String getEnterpriseId() {
+ return enterpriseId;
+ }
+
+ public void setEnterpriseId(String enterpriseId) {
+ this.enterpriseId = enterpriseId;
+ }
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+ public String getLogo() {
+ return logo;
+ }
+
+ public void setLogo(String logo) {
+ this.logo = logo;
+ }
+ public String getParentId() {
+ return parentId;
+ }
+
+ public void setParentId(String parentId) {
+ this.parentId = parentId;
+ }
+ public String getParentPath() {
+ return parentPath;
+ }
+
+ public void setParentPath(String parentPath) {
+ this.parentPath = parentPath;
+ }
+ public String getParentName() {
+ return parentName;
+ }
+
+ public void setParentName(String parentName) {
+ this.parentName = parentName;
+ }
+ public Integer getSortId() {
+ return sortId;
+ }
+
+ public void setSortId(Integer sortId) {
+ this.sortId = sortId;
+ }
+ public Integer getDelState() {
+ return delState;
+ }
+
+ public void setDelState(Integer delState) {
+ this.delState = delState;
+ }
+ 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 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;
+ }
+
+ @Override
+ public String toString() {
+ return "EntDeviceType{" +
+ "typeId=" + typeId +
+ ", enterpriseId=" + enterpriseId +
+ ", name=" + name +
+ ", logo=" + logo +
+ ", parentId=" + parentId +
+ ", parentPath=" + parentPath +
+ ", parentName=" + parentName +
+ ", sortId=" + sortId +
+ ", delState=" + delState +
+ ", createTime=" + createTime +
+ ", createBy=" + createBy +
+ ", modifyTime=" + modifyTime +
+ ", modifyBy=" + modifyBy +
+ "}";
+ }
+}
diff --git a/inventory-dao/src/main/resources/mapper/EntDeviceMapper.xml b/inventory-dao/src/main/resources/mapper/EntDeviceMapper.xml
new file mode 100644
index 0000000..7aeded4
--- /dev/null
+++ b/inventory-dao/src/main/resources/mapper/EntDeviceMapper.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ device_id, name, number, model_num, model_state, buy_time, type_id, type_path, enterprise_id, qr_code, del_state, create_time, create_by, modify_time, modify_by
+
+
+
+
+
+
+
+
diff --git a/inventory-dao/src/main/resources/mapper/EntDeviceTypeMapper.xml b/inventory-dao/src/main/resources/mapper/EntDeviceTypeMapper.xml
new file mode 100644
index 0000000..a60d26e
--- /dev/null
+++ b/inventory-dao/src/main/resources/mapper/EntDeviceTypeMapper.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ type_id, enterprise_id, name, logo, parent_id, parent_path, parent_name, sort_id, del_state, create_time, create_by, modify_time, modify_by
+
+
+
+
+
diff --git a/inventory-ent/src/main/java/com/rzyc/controller/EnterpriseEquipmentController.java b/inventory-ent/src/main/java/com/rzyc/controller/EnterpriseEquipmentController.java
new file mode 100644
index 0000000..e91f974
--- /dev/null
+++ b/inventory-ent/src/main/java/com/rzyc/controller/EnterpriseEquipmentController.java
@@ -0,0 +1,105 @@
+package com.rzyc.controller;
+
+
+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.ent.EntUser;
+import com.rzyc.service.PcBusinessService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.stereotype.Controller;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @author Xuwanxin
+ * @date 2022/10/18
+ */
+@Api(tags = "企业端设备模块接口")
+@CrossOrigin("*")
+@RequestMapping("equipment")
+@Controller
+@Validated
+public class EnterpriseEquipmentController extends BaseController {
+
+
+ PcBusinessService pcBusinessService;
+
+ public EnterpriseEquipmentController(PcBusinessService pcBusinessService) {
+ this.pcBusinessService = pcBusinessService;
+ }
+
+ /**
+ * 企业设备类型列表
+ * @param enterpriseId 企业id
+ * @return 企业设备类型列表
+ * @throws Exception
+ */
+ @ApiOperation(value = "企业设备类型列表", notes = "企业设备类型列表")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "enterpriseId", value = "公司id", required = true, dataType = "string")
+ })
+ @GetMapping(value = "/entEquipmentTypeList")
+ @PreAuthorize("hasAnyAuthority('entEquipmentTypeList','entEquipmentList:update')")
+ @MethodAnnotation(authorizations = {"entEquipmentTypeList","entEquipmentList:update"},name = "企业设备类型列表")
+ @ResponseBody
+ public SingleResult> entEquipmentTypeList(@NotNull(message = "公司id不能为null") String enterpriseId)throws Exception{
+ return pcBusinessService.entEquipmentTypeList(enterpriseId);
+ }
+
+
+ /**
+ * 企业设备列表
+ * @param enterpriseId 企业id
+ * @param typeId 设备类型id
+ * @return 企业设备列表
+ * @throws Exception
+ */
+ @ApiOperation(value = "企业设备列表", notes = "企业设备列表")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "enterpriseId", value = "公司id", required = true, dataType = "string"),
+ @ApiImplicitParam(name = "typeId", value = "设备类型id", required = false, dataType = "string")
+ })
+ @GetMapping(value = "/entEquipmentList")
+ @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);
+ }
+
+
+ /**
+ * 企业设备保养和维修检查记录统计
+ * @param enterpriseId 企业id
+ * @param deviceId 设备id
+ * @return 企业设备列表
+ * @throws Exception
+ */
+ @ApiOperation(value = "企业设备保养和维修检查记录统计", notes = "企业设备保养和维修检查记录统计")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "enterpriseId", value = "公司id", required = true, dataType = "string"),
+ @ApiImplicitParam(name = "deviceId", value = "设备id", required = true, dataType = "string")
+ })
+ @GetMapping(value = "/entEquipmentStatistic")
+ @PreAuthorize("hasAnyAuthority('entEquipmentStatistic')")
+ @MethodAnnotation(authorizations = {"entEquipmentStatistic"},name = "企业设备保养和维修检查记录统计")
+ @ResponseBody
+ public SingleResult> entEquipmentStatistic(@NotNull(message = "公司id不能为null") String enterpriseId, String deviceId)throws Exception{
+ return pcBusinessService.entEquipmentStatistic(enterpriseId,deviceId);
+ }
+
+
+}
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 f0b3029..5bd72ed 100644
--- a/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java
+++ b/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java
@@ -11,11 +11,9 @@ import com.common.utils.model.SingleResult;
import com.rzyc.bean.emergency.PlanList;
import com.rzyc.config.RedisUtil;
import com.rzyc.controller.BaseController;
+import com.rzyc.enums.RedisKeys;
import com.rzyc.mapper.EntPostTaskMapper;
-import com.rzyc.model.EntPostDuty;
-import com.rzyc.model.EntPostList;
-import com.rzyc.model.EntPostTask;
-import com.rzyc.model.EntUserCredential;
+import com.rzyc.model.*;
import com.rzyc.model.dto.*;
import com.rzyc.model.ent.EntPost;
import com.rzyc.model.ent.EntUser;
@@ -50,13 +48,13 @@ public class PcBusinessService extends BaseController {
SingleResult singleResult = new SingleResult();
//读缓存,get时候如果多级用:进行分隔
if (null != enterpriseId && postId == null){
- List