浏览代码

设备台账

lipenghui 5 月之前
父节点
当前提交
97883847b6
共有 15 个文件被更改,包括 768 次插入7 次删除
  1. 1 0
      yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/enums/ErrorCodeConstant.java
  2. 97 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/IotDeviceController.java
  3. 5 5
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/IotProductClassifyController.java
  4. 103 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/vo/IotDevicePageReqVO.java
  5. 127 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/vo/IotDeviceRespVO.java
  6. 106 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/vo/IotDeviceSaveReqVO.java
  7. 1 1
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/vo/IotProductClassifyPageReqVO.java
  8. 1 1
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/vo/IotProductClassifyRespVO.java
  9. 1 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/vo/IotProductClassifySaveReqVO.java
  10. 139 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/IotDeviceDO.java
  11. 2 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/IotProductClassifyDO.java
  12. 52 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/IotDeviceMapper.java
  13. 1 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/IotProductClassifyMapper.java
  14. 57 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/IotDeviceService.java
  15. 75 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/IotDeviceServiceImpl.java

+ 1 - 0
yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/enums/ErrorCodeConstant.java

@@ -4,4 +4,5 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode;
 
 public interface ErrorCodeConstant{
     ErrorCode IOT_PRODUCT_CLASSIFY_NOT_EXISTS = new ErrorCode(100, "设备分类不存在");
+    ErrorCode IOT_DEVICE_NOT_EXISTS = new ErrorCode(101, "设备台账不存在");
 }

+ 97 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/IotDeviceController.java

@@ -0,0 +1,97 @@
+package cn.iocoder.yudao.module.pms.controller.admin;
+
+import cn.iocoder.yudao.module.pms.controller.admin.vo.IotDevicePageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.vo.IotDeviceRespVO;
+import cn.iocoder.yudao.module.pms.controller.admin.vo.IotDeviceSaveReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.IotDeviceDO;
+import cn.iocoder.yudao.module.pms.service.IotDeviceService;
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.constraints.*;
+import javax.validation.*;
+import javax.servlet.http.*;
+import java.util.*;
+import java.io.IOException;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
+
+
+@Tag(name = "管理后台 - 设备台账")
+@RestController
+@RequestMapping("/rq/iot-device")
+@Validated
+public class IotDeviceController {
+
+    @Resource
+    private IotDeviceService iotDeviceService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建设备台账")
+    @PreAuthorize("@ss.hasPermission('rq:iot-device:create')")
+    public CommonResult<Long> createIotDevice(@Valid @RequestBody IotDeviceSaveReqVO createReqVO) {
+        return success(iotDeviceService.createIotDevice(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新设备台账")
+    @PreAuthorize("@ss.hasPermission('rq:iot-device:update')")
+    public CommonResult<Boolean> updateIotDevice(@Valid @RequestBody IotDeviceSaveReqVO updateReqVO) {
+        iotDeviceService.updateIotDevice(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除设备台账")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('rq:iot-device:delete')")
+    public CommonResult<Boolean> deleteIotDevice(@RequestParam("id") Long id) {
+        iotDeviceService.deleteIotDevice(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得设备台账")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('rq:iot-device:query')")
+    public CommonResult<IotDeviceRespVO> getIotDevice(@RequestParam("id") Long id) {
+        IotDeviceDO iotDevice = iotDeviceService.getIotDevice(id);
+        return success(BeanUtils.toBean(iotDevice, IotDeviceRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得设备台账分页")
+    @PreAuthorize("@ss.hasPermission('rq:iot-device:query')")
+    public CommonResult<PageResult<IotDeviceRespVO>> getIotDevicePage(@Valid IotDevicePageReqVO pageReqVO) {
+        PageResult<IotDeviceDO> pageResult = iotDeviceService.getIotDevicePage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, IotDeviceRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出设备台账 Excel")
+    @PreAuthorize("@ss.hasPermission('rq:iot-device:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportIotDeviceExcel(@Valid IotDevicePageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<IotDeviceDO> list = iotDeviceService.getIotDevicePage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "设备台账.xls", "数据", IotDeviceRespVO.class,
+                        BeanUtils.toBean(list, IotDeviceRespVO.class));
+    }
+
+}

+ 5 - 5
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/IotProductClassifyController.java

@@ -33,7 +33,7 @@ public class IotProductClassifyController {
 
     @PostMapping("create")
     @Operation(summary = "创建产品分类")
-    @PreAuthorize("@ss.hasPermission('system:product-classify:create')")
+    @PreAuthorize("@ss.hasPermission('iot:product-classify:create')")
     public CommonResult<Long> createIotProductClassify(@Valid @RequestBody IotProductClassifySaveReqVO createReqVO) {
         Long deptId = iotProductClassifyService.createIotProductClassify(createReqVO);
         return success(deptId);
@@ -41,7 +41,7 @@ public class IotProductClassifyController {
 
     @PutMapping("update")
     @Operation(summary = "更新产品分类")
-    @PreAuthorize("@ss.hasPermission('system:product-classify:update')")
+    @PreAuthorize("@ss.hasPermission('iot:product-classify:update')")
     public CommonResult<Boolean> updateIotProductClassify(@Valid @RequestBody IotProductClassifySaveReqVO updateReqVO) {
         iotProductClassifyService.updateIotProductClassify(updateReqVO);
         return success(true);
@@ -50,7 +50,7 @@ public class IotProductClassifyController {
     @DeleteMapping("delete")
     @Operation(summary = "删除产品分类")
     @Parameter(name = "id", description = "编号", required = true, example = "1024")
-    @PreAuthorize("@ss.hasPermission('system:product-classify:delete')")
+    @PreAuthorize("@ss.hasPermission('iot:product-classify:delete')")
     public CommonResult<Boolean> deleteIotProductClassify(@RequestParam("id") Long id) {
         iotProductClassifyService.deleteIotProductClassify(id);
         return success(true);
@@ -58,7 +58,7 @@ public class IotProductClassifyController {
 
     @GetMapping("/list")
     @Operation(summary = "获取产品分类列表")
-    @PreAuthorize("@ss.hasPermission('system:product-classify:query')")
+    @PreAuthorize("@ss.hasPermission('iot:product-classify:query')")
     public CommonResult<List<IotProductClassifyRespVO>> getIotProductClassifyList(IotProductClassifyListReqVO reqVO) {
         List<IotProductClassifyDO> list = iotProductClassifyService.getIotProductClassifyList(reqVO);
         return success(BeanUtils.toBean(list, IotProductClassifyRespVO.class));
@@ -75,7 +75,7 @@ public class IotProductClassifyController {
     @GetMapping("/get")
     @Operation(summary = "获得产品分类信息")
     @Parameter(name = "id", description = "编号", required = true, example = "1024")
-    @PreAuthorize("@ss.hasPermission('system:product-classify:query')")
+    @PreAuthorize("@ss.hasPermission('iot:product-classify:query')")
     public CommonResult<IotProductClassifyRespVO> getIotProductClassify(@RequestParam("id") Long id) {
         IotProductClassifyDO dept = iotProductClassifyService.getIotProductClassify(id);
         return success(BeanUtils.toBean(dept, IotProductClassifyRespVO.class));

+ 103 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/vo/IotDevicePageReqVO.java

@@ -0,0 +1,103 @@
+package cn.iocoder.yudao.module.pms.controller.admin.vo;
+
+import lombok.*;
+
+import java.time.LocalDate;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 设备台账分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class IotDevicePageReqVO extends PageParam {
+
+    @Schema(description = "资产编码")
+    private String deviceCode;
+
+    @Schema(description = "设备名称", example = "芋艿")
+    private String deivceName;
+
+    @Schema(description = "品牌")
+    private Long brand;
+
+    @Schema(description = "规格型号")
+    private Long model;
+
+    @Schema(description = "所在部门", example = "8581")
+    private Long orgId;
+
+    @Schema(description = "设备状态", example = "2")
+    private String deviceStatus;
+
+    @Schema(description = "资产性质")
+    private String assetProperty;
+
+    @Schema(description = "图片", example = "https://www.iocoder.cn")
+    private String picUrl;
+
+    @Schema(description = "备注", example = "你说的对")
+    private String remark;
+
+    @Schema(description = "制造商id", example = "1695")
+    private Long manufacturerId;
+
+    @Schema(description = "供应商id", example = "18330")
+    private Long supplierId;
+
+    @Schema(description = "生产日期")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDate[] manDate;
+
+    @Schema(description = "铭牌信息")
+    private String nameplate;
+
+    @Schema(description = "质保到期")
+    private Integer expires;
+
+    @Schema(description = "采购/租赁价格", example = "14766")
+    private Integer plPrice;
+
+    @Schema(description = "采购/租赁日期")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDate[] plDate;
+
+    @Schema(description = "折旧年限")
+    private Integer plYear;
+
+    @Schema(description = "折旧开始日期")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private Integer[] plStartDate;
+
+    @Schema(description = "已提折旧月数")
+    private Integer plMonthed;
+
+    @Schema(description = "已提折旧金额")
+    private Double plAmounted;
+
+    @Schema(description = "剩余金额")
+    private Double remainAmount;
+
+    @Schema(description = "资料分类id", example = "5597")
+    private Long infoId;
+
+    @Schema(description = "资料类型", example = "1")
+    private String infoType;
+
+    @Schema(description = "资料名称", example = "王五")
+    private String infoName;
+
+    @Schema(description = "资料备注", example = "你说的对")
+    private String infoRemark;
+
+    @Schema(description = "资料附件", example = "https://www.iocoder.cn")
+    private String infoUrl;
+
+    @Schema(description = "动态模板信息")
+    private String templateJson;
+
+}

+ 127 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/vo/IotDeviceRespVO.java

@@ -0,0 +1,127 @@
+package cn.iocoder.yudao.module.pms.controller.admin.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+
+import java.time.LocalDate;
+import java.util.*;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "管理后台 - 设备台账 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class IotDeviceRespVO {
+
+    @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "6797")
+    @ExcelProperty("主键id")
+    private Long id;
+
+    @Schema(description = "资产编码", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("资产编码")
+    private String deviceCode;
+
+    @Schema(description = "设备名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
+    @ExcelProperty("设备名称")
+    private String deivceName;
+
+    @Schema(description = "品牌", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("品牌")
+    private Long brand;
+
+    @Schema(description = "规格型号")
+    @ExcelProperty("规格型号")
+    private Long model;
+
+    @Schema(description = "所在部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "8581")
+    @ExcelProperty("所在部门")
+    private Long orgId;
+
+    @Schema(description = "设备状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
+    @ExcelProperty("设备状态")
+    private String deviceStatus;
+
+    @Schema(description = "资产性质", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("资产性质")
+    private String assetProperty;
+
+    @Schema(description = "图片", example = "https://www.iocoder.cn")
+    @ExcelProperty("图片")
+    private String picUrl;
+
+    @Schema(description = "备注", example = "你说的对")
+    @ExcelProperty("备注")
+    private String remark;
+
+    @Schema(description = "制造商id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1695")
+    @ExcelProperty("制造商id")
+    private Long manufacturerId;
+
+    @Schema(description = "供应商id", example = "18330")
+    @ExcelProperty("供应商id")
+    private Long supplierId;
+
+    @Schema(description = "生产日期", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("生产日期")
+    private LocalDate manDate;
+
+    @Schema(description = "铭牌信息")
+    @ExcelProperty("铭牌信息")
+    private String nameplate;
+
+    @Schema(description = "质保到期")
+    @ExcelProperty("质保到期")
+    private Integer expires;
+
+    @Schema(description = "采购/租赁价格", example = "14766")
+    @ExcelProperty("采购/租赁价格")
+    private Integer plPrice;
+
+    @Schema(description = "采购/租赁日期")
+    @ExcelProperty("采购/租赁日期")
+    private LocalDate plDate;
+
+    @Schema(description = "折旧年限")
+    @ExcelProperty("折旧年限")
+    private Integer plYear;
+
+    @Schema(description = "折旧开始日期")
+    @ExcelProperty("折旧开始日期")
+    private Integer plStartDate;
+
+    @Schema(description = "已提折旧月数")
+    @ExcelProperty("已提折旧月数")
+    private Integer plMonthed;
+
+    @Schema(description = "已提折旧金额")
+    @ExcelProperty("已提折旧金额")
+    private Double plAmounted;
+
+    @Schema(description = "剩余金额")
+    @ExcelProperty("剩余金额")
+    private Double remainAmount;
+
+    @Schema(description = "资料分类id", example = "5597")
+    @ExcelProperty("资料分类id")
+    private Long infoId;
+
+    @Schema(description = "资料类型", example = "1")
+    @ExcelProperty("资料类型")
+    private String infoType;
+
+    @Schema(description = "资料名称", example = "王五")
+    @ExcelProperty("资料名称")
+    private String infoName;
+
+    @Schema(description = "资料备注", example = "你说的对")
+    @ExcelProperty("资料备注")
+    private String infoRemark;
+
+    @Schema(description = "资料附件", example = "https://www.iocoder.cn")
+    @ExcelProperty("资料附件")
+    private String infoUrl;
+
+    @Schema(description = "动态模板信息")
+    @ExcelProperty("动态模板信息")
+    private String templateJson;
+
+}

+ 106 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/vo/IotDeviceSaveReqVO.java

@@ -0,0 +1,106 @@
+package cn.iocoder.yudao.module.pms.controller.admin.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+
+import java.time.LocalDate;
+import java.util.*;
+import javax.validation.constraints.*;
+
+@Schema(description = "管理后台 - 设备台账新增/修改 Request VO")
+@Data
+public class IotDeviceSaveReqVO {
+
+    @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "6797")
+    private Long id;
+
+    @Schema(description = "资产编码", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "资产编码不能为空")
+    private String deviceCode;
+
+    @Schema(description = "设备名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
+    @NotEmpty(message = "设备名称不能为空")
+    private String deivceName;
+
+    @Schema(description = "品牌", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "品牌不能为空")
+    private Long brand;
+
+    @Schema(description = "规格型号")
+    private Long model;
+
+    @Schema(description = "所在部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "8581")
+    @NotNull(message = "所在部门不能为空")
+    private Long orgId;
+
+    @Schema(description = "设备状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
+    @NotEmpty(message = "设备状态不能为空")
+    private String deviceStatus;
+
+    @Schema(description = "资产性质", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "资产性质不能为空")
+    private String assetProperty;
+
+    @Schema(description = "图片", example = "https://www.iocoder.cn")
+    private String picUrl;
+
+    @Schema(description = "备注", example = "你说的对")
+    private String remark;
+
+    @Schema(description = "制造商id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1695")
+    @NotNull(message = "制造商id不能为空")
+    private Long manufacturerId;
+
+    @Schema(description = "供应商id", example = "18330")
+    private Long supplierId;
+
+    @Schema(description = "生产日期", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "生产日期不能为空")
+    private LocalDate manDate;
+
+    @Schema(description = "铭牌信息")
+    private String nameplate;
+
+    @Schema(description = "质保到期")
+    private Integer expires;
+
+    @Schema(description = "采购/租赁价格", example = "14766")
+    private Integer plPrice;
+
+    @Schema(description = "采购/租赁日期")
+    private LocalDate plDate;
+
+    @Schema(description = "折旧年限")
+    private Integer plYear;
+
+    @Schema(description = "折旧开始日期")
+    private Integer plStartDate;
+
+    @Schema(description = "已提折旧月数")
+    private Integer plMonthed;
+
+    @Schema(description = "已提折旧金额")
+    private Double plAmounted;
+
+    @Schema(description = "剩余金额")
+    private Double remainAmount;
+
+    @Schema(description = "资料分类id", example = "5597")
+    private Long infoId;
+
+    @Schema(description = "资料类型", example = "1")
+    private String infoType;
+
+    @Schema(description = "资料名称", example = "王五")
+    private String infoName;
+
+    @Schema(description = "资料备注", example = "你说的对")
+    private String infoRemark;
+
+    @Schema(description = "资料附件", example = "https://www.iocoder.cn")
+    private String infoUrl;
+
+    @Schema(description = "动态模板信息")
+    private String templateJson;
+
+}

+ 1 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/vo/IotProductClassifyPageReqVO.java

@@ -33,5 +33,5 @@ public class IotProductClassifyPageReqVO extends PageParam {
     @Schema(description = "创建时间")
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private LocalDateTime[] createTime;
-
+    private String remark;
 }

+ 1 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/vo/IotProductClassifyRespVO.java

@@ -39,5 +39,5 @@ public class IotProductClassifyRespVO {
     @Schema(description = "创建时间")
     @ExcelProperty("创建时间")
     private LocalDateTime createTime;
-
+    private String remark;
 }

+ 1 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/vo/IotProductClassifySaveReqVO.java

@@ -29,4 +29,5 @@ public class IotProductClassifySaveReqVO {
     @Schema(description = "开启状态", example = "2")
     private Integer status;
 
+    private String remark;
 }

+ 139 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/IotDeviceDO.java

@@ -0,0 +1,139 @@
+package cn.iocoder.yudao.module.pms.dal.dataobject;
+
+import lombok.*;
+
+import java.time.LocalDate;
+import java.util.*;
+import com.baomidou.mybatisplus.annotation.*;
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 设备台账 DO
+ *
+ * @author 芋道源码
+ */
+@TableName("rq_iot_device")
+@KeySequence("rq_iot_device_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class IotDeviceDO extends BaseDO {
+
+    /**
+     * 主键id
+     */
+    @TableId
+    private Long id;
+    /**
+     * 资产编码
+     */
+    private String deviceCode;
+    /**
+     * 设备名称
+     */
+    private String deivceName;
+    /**
+     * 品牌
+     */
+    private Long brand;
+    /**
+     * 规格型号
+     */
+    private Long model;
+    /**
+     * 所在部门
+     */
+    private Long orgId;
+    /**
+     * 设备状态
+     */
+    private String deviceStatus;
+    /**
+     * 资产性质
+     */
+    private String assetProperty;
+    /**
+     * 图片
+     */
+    private String picUrl;
+    /**
+     * 备注
+     */
+    private String remark;
+    /**
+     * 制造商id
+     */
+    private Long manufacturerId;
+    /**
+     * 供应商id
+     */
+    private Long supplierId;
+    /**
+     * 生产日期
+     */
+    private LocalDate manDate;
+    /**
+     * 铭牌信息
+     */
+    private String nameplate;
+    /**
+     * 质保到期
+     */
+    private Integer expires;
+    /**
+     * 采购/租赁价格
+     */
+    private Integer plPrice;
+    /**
+     * 采购/租赁日期
+     */
+    private LocalDate plDate;
+    /**
+     * 折旧年限
+     */
+    private Integer plYear;
+    /**
+     * 折旧开始日期
+     */
+    private Integer plStartDate;
+    /**
+     * 已提折旧月数
+     */
+    private Integer plMonthed;
+    /**
+     * 已提折旧金额
+     */
+    private Double plAmounted;
+    /**
+     * 剩余金额
+     */
+    private Double remainAmount;
+    /**
+     * 资料分类id
+     */
+    private Long infoId;
+    /**
+     * 资料类型
+     */
+    private String infoType;
+    /**
+     * 资料名称
+     */
+    private String infoName;
+    /**
+     * 资料备注
+     */
+    private String infoRemark;
+    /**
+     * 资料附件
+     */
+    private String infoUrl;
+    /**
+     * 动态模板信息
+     */
+    private String templateJson;
+
+}

+ 2 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/IotProductClassifyDO.java

@@ -49,4 +49,6 @@ public class IotProductClassifyDO extends BaseDO {
      */
     private Integer status;
 
+    private String remark;
+
 }

+ 52 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/IotDeviceMapper.java

@@ -0,0 +1,52 @@
+package cn.iocoder.yudao.module.pms.dal.mysql;
+
+import java.util.*;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.module.pms.controller.admin.vo.IotDevicePageReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.IotDeviceDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 设备台账 Mapper
+ *
+ * @author 芋道源码
+ */
+@Mapper
+public interface IotDeviceMapper extends BaseMapperX<IotDeviceDO> {
+
+    default PageResult<IotDeviceDO> selectPage(IotDevicePageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<IotDeviceDO>()
+                .eqIfPresent(IotDeviceDO::getDeviceCode, reqVO.getDeviceCode())
+                .likeIfPresent(IotDeviceDO::getDeivceName, reqVO.getDeivceName())
+                .eqIfPresent(IotDeviceDO::getBrand, reqVO.getBrand())
+                .eqIfPresent(IotDeviceDO::getModel, reqVO.getModel())
+                .eqIfPresent(IotDeviceDO::getOrgId, reqVO.getOrgId())
+                .eqIfPresent(IotDeviceDO::getDeviceStatus, reqVO.getDeviceStatus())
+                .eqIfPresent(IotDeviceDO::getAssetProperty, reqVO.getAssetProperty())
+                .eqIfPresent(IotDeviceDO::getPicUrl, reqVO.getPicUrl())
+                .eqIfPresent(IotDeviceDO::getRemark, reqVO.getRemark())
+                .eqIfPresent(IotDeviceDO::getManufacturerId, reqVO.getManufacturerId())
+                .eqIfPresent(IotDeviceDO::getSupplierId, reqVO.getSupplierId())
+                .betweenIfPresent(IotDeviceDO::getManDate, reqVO.getManDate())
+                .eqIfPresent(IotDeviceDO::getNameplate, reqVO.getNameplate())
+                .eqIfPresent(IotDeviceDO::getExpires, reqVO.getExpires())
+                .eqIfPresent(IotDeviceDO::getPlPrice, reqVO.getPlPrice())
+                .betweenIfPresent(IotDeviceDO::getPlDate, reqVO.getPlDate())
+                .eqIfPresent(IotDeviceDO::getPlYear, reqVO.getPlYear())
+                .betweenIfPresent(IotDeviceDO::getPlStartDate, reqVO.getPlStartDate())
+                .eqIfPresent(IotDeviceDO::getPlMonthed, reqVO.getPlMonthed())
+                .eqIfPresent(IotDeviceDO::getPlAmounted, reqVO.getPlAmounted())
+                .eqIfPresent(IotDeviceDO::getRemainAmount, reqVO.getRemainAmount())
+                .eqIfPresent(IotDeviceDO::getInfoId, reqVO.getInfoId())
+                .eqIfPresent(IotDeviceDO::getInfoType, reqVO.getInfoType())
+                .likeIfPresent(IotDeviceDO::getInfoName, reqVO.getInfoName())
+                .eqIfPresent(IotDeviceDO::getInfoRemark, reqVO.getInfoRemark())
+                .eqIfPresent(IotDeviceDO::getInfoUrl, reqVO.getInfoUrl())
+                .eqIfPresent(IotDeviceDO::getTemplateJson, reqVO.getTemplateJson())
+                .orderByDesc(IotDeviceDO::getId));
+    }
+
+}

+ 1 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/IotProductClassifyMapper.java

@@ -39,6 +39,7 @@ public interface IotProductClassifyMapper extends BaseMapperX<IotProductClassify
                 .eqIfPresent(IotProductClassifyDO::getCode, reqVO.getCode())
                 .eqIfPresent(IotProductClassifyDO::getSort, reqVO.getSort())
                 .eqIfPresent(IotProductClassifyDO::getStatus, reqVO.getStatus())
+                .eqIfPresent(IotProductClassifyDO::getRemark, reqVO.getRemark())
                 .betweenIfPresent(IotProductClassifyDO::getCreateTime, reqVO.getCreateTime())
                 .orderByDesc(IotProductClassifyDO::getId));
     }

+ 57 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/IotDeviceService.java

@@ -0,0 +1,57 @@
+package cn.iocoder.yudao.module.pms.service;
+
+import java.util.*;
+import javax.validation.*;
+
+import cn.iocoder.yudao.module.pms.controller.admin.vo.IotDevicePageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.vo.IotDeviceSaveReqVO;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.module.pms.dal.dataobject.IotDeviceDO;
+
+/**
+ * 设备台账 Service 接口
+ *
+ * @author 芋道源码
+ */
+public interface IotDeviceService {
+
+    /**
+     * 创建设备台账
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createIotDevice(@Valid IotDeviceSaveReqVO createReqVO);
+
+    /**
+     * 更新设备台账
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateIotDevice(@Valid IotDeviceSaveReqVO updateReqVO);
+
+    /**
+     * 删除设备台账
+     *
+     * @param id 编号
+     */
+    void deleteIotDevice(Long id);
+
+    /**
+     * 获得设备台账
+     *
+     * @param id 编号
+     * @return 设备台账
+     */
+    IotDeviceDO getIotDevice(Long id);
+
+    /**
+     * 获得设备台账分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 设备台账分页
+     */
+    PageResult<IotDeviceDO> getIotDevicePage(IotDevicePageReqVO pageReqVO);
+
+}

+ 75 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/IotDeviceServiceImpl.java

@@ -0,0 +1,75 @@
+package cn.iocoder.yudao.module.pms.service;
+
+import cn.iocoder.yudao.module.pms.controller.admin.vo.IotDevicePageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.vo.IotDeviceSaveReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.IotDeviceDO;
+import cn.iocoder.yudao.module.pms.dal.mysql.IotDeviceMapper;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+
+
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant.IOT_DEVICE_NOT_EXISTS;
+
+/**
+ * 设备台账 Service 实现类
+ *
+ * @author 芋道源码
+ */
+@Service
+@Validated
+public class IotDeviceServiceImpl implements IotDeviceService {
+
+    @Resource
+    private IotDeviceMapper iotDeviceMapper;
+
+    @Override
+    public Long createIotDevice(IotDeviceSaveReqVO createReqVO) {
+        // 插入
+        IotDeviceDO iotDevice = BeanUtils.toBean(createReqVO, IotDeviceDO.class);
+        iotDeviceMapper.insert(iotDevice);
+        // 返回
+        return iotDevice.getId();
+    }
+
+    @Override
+    public void updateIotDevice(IotDeviceSaveReqVO updateReqVO) {
+        // 校验存在
+        validateIotDeviceExists(updateReqVO.getId());
+        // 更新
+        IotDeviceDO updateObj = BeanUtils.toBean(updateReqVO, IotDeviceDO.class);
+        iotDeviceMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteIotDevice(Long id) {
+        // 校验存在
+        validateIotDeviceExists(id);
+        // 删除
+        iotDeviceMapper.deleteById(id);
+    }
+
+    private void validateIotDeviceExists(Long id) {
+        if (iotDeviceMapper.selectById(id) == null) {
+            throw exception(IOT_DEVICE_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public IotDeviceDO getIotDevice(Long id) {
+        return iotDeviceMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<IotDeviceDO> getIotDevicePage(IotDevicePageReqVO pageReqVO) {
+        return iotDeviceMapper.selectPage(pageReqVO);
+    }
+
+}