Преглед изворни кода

pms功能优化 设备属性模板 BOM 代码初始化

zhangcl пре 5 месеци
родитељ
комит
85130ef828
49 измењених фајлова са 2928 додато и 0 уклоњено
  1. 6 0
      yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/enums/ErrorCodeConstant.java
  2. 91 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotbom/IotBomController.java
  3. 60 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotbom/vo/IotBomPageReqVO.java
  4. 71 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotbom/vo/IotBomRespVO.java
  5. 49 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotbom/vo/IotBomSaveReqVO.java
  6. 91 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotdevicetemplate/IotDeviceTemplateController.java
  7. 58 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotdevicetemplate/vo/IotDeviceTemplatePageReqVO.java
  8. 67 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotdevicetemplate/vo/IotDeviceTemplateRespVO.java
  9. 48 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotdevicetemplate/vo/IotDeviceTemplateSaveReqVO.java
  10. 93 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotdevicetemplateattrs/IotDeviceTemplateAttrsController.java
  11. 63 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotdevicetemplateattrs/vo/IotDeviceTemplateAttrsPageReqVO.java
  12. 75 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotdevicetemplateattrs/vo/IotDeviceTemplateAttrsRespVO.java
  13. 52 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotdevicetemplateattrs/vo/IotDeviceTemplateAttrsSaveReqVO.java
  14. 93 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmaterial/IotMaterialController.java
  15. 67 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmaterial/vo/IotMaterialPageReqVO.java
  16. 79 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmaterial/vo/IotMaterialRespVO.java
  17. 57 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmaterial/vo/IotMaterialSaveReqVO.java
  18. 93 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmaterialgroup/IotMaterialGroupController.java
  19. 39 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmaterialgroup/vo/IotMaterialGroupPageReqVO.java
  20. 43 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmaterialgroup/vo/IotMaterialGroupRespVO.java
  21. 28 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmaterialgroup/vo/IotMaterialGroupSaveReqVO.java
  22. 91 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmodel/IotModelController.java
  23. 42 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmodel/vo/IotModelPageReqVO.java
  24. 47 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmodel/vo/IotModelRespVO.java
  25. 31 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmodel/vo/IotModelSaveReqVO.java
  26. 78 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/iotbom/IotBomDO.java
  27. 76 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/iotdevicetemplate/IotDeviceTemplateDO.java
  28. 86 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/iotdevicetemplateattrs/IotDeviceTemplateAttrsDO.java
  29. 88 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/iotmaterial/IotMaterialDO.java
  30. 50 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/iotmaterialgroup/IotMaterialGroupDO.java
  31. 54 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/iotmodel/IotModelDO.java
  32. 36 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotbom/IotBomMapper.java
  33. 35 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotdevicetemplate/IotDeviceTemplateMapper.java
  34. 37 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotdevicetemplateattrs/IotDeviceTemplateAttrsMapper.java
  35. 38 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotmaterial/IotMaterialMapper.java
  36. 29 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotmaterialgroup/IotMaterialGroupMapper.java
  37. 30 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotmodel/IotModelMapper.java
  38. 55 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotbom/IotBomService.java
  39. 71 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotbom/IotBomServiceImpl.java
  40. 55 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotdevicetemplate/IotDeviceTemplateService.java
  41. 71 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotdevicetemplate/IotDeviceTemplateServiceImpl.java
  42. 55 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotdevicetemplateattrs/IotDeviceTemplateAttrsService.java
  43. 71 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotdevicetemplateattrs/IotDeviceTemplateAttrsServiceImpl.java
  44. 54 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotmaterial/IotMaterialService.java
  45. 71 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotmaterial/IotMaterialServiceImpl.java
  46. 55 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotmaterialgroup/IotMaterialGroupService.java
  47. 72 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotmaterialgroup/IotMaterialGroupServiceImpl.java
  48. 55 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotmodel/IotModelService.java
  49. 72 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotmodel/IotModelServiceImpl.java

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

@@ -5,4 +5,10 @@ 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, "设备台账不存在");
+    ErrorCode IOT_MODEL_NOT_EXISTS = new ErrorCode(102, "规格型号不存在");
+    ErrorCode IOT_MATERIAL_GROUP_NOT_EXISTS = new ErrorCode(103, "物料组不存在");
+    ErrorCode IOT_MATERIAL_NOT_EXISTS = new ErrorCode(104, "物料不存在");
+    ErrorCode IOT_DEVICE_TEMPLATE_ATTRS_NOT_EXISTS = new ErrorCode(105, "设备模板属性不存在");
+    ErrorCode IOT_DEVICE_TEMPLATE_NOT_EXISTS = new ErrorCode(106, "设备模板不存在");
+    ErrorCode IOT_BOM_NOT_EXISTS = new ErrorCode(107, "BOM 关系不存在");
 }

+ 91 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotbom/IotBomController.java

@@ -0,0 +1,91 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotbom;
+
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+import cn.iocoder.yudao.module.pms.controller.admin.iotbom.vo.*;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotbom.IotBomDO;
+import cn.iocoder.yudao.module.pms.service.iotbom.IotBomService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.io.IOException;
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+@Tag(name = "管理后台 - PMS BOM 关系")
+@RestController
+@RequestMapping("/rq/iot-bom")
+@Validated
+public class IotBomController {
+
+    @Resource
+    private IotBomService iotBomService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建PMS BOM 关系")
+    @PreAuthorize("@ss.hasPermission('rq:iot-bom:create')")
+    public CommonResult<Long> createIotBom(@Valid @RequestBody IotBomSaveReqVO createReqVO) {
+        return success(iotBomService.createIotBom(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新PMS BOM 关系")
+    @PreAuthorize("@ss.hasPermission('rq:iot-bom:update')")
+    public CommonResult<Boolean> updateIotBom(@Valid @RequestBody IotBomSaveReqVO updateReqVO) {
+        iotBomService.updateIotBom(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除PMS BOM 关系")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('rq:iot-bom:delete')")
+    public CommonResult<Boolean> deleteIotBom(@RequestParam("id") Long id) {
+        iotBomService.deleteIotBom(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得PMS BOM 关系")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('rq:iot-bom:query')")
+    public CommonResult<IotBomRespVO> getIotBom(@RequestParam("id") Long id) {
+        IotBomDO iotBom = iotBomService.getIotBom(id);
+        return success(BeanUtils.toBean(iotBom, IotBomRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得PMS BOM 关系分页")
+    @PreAuthorize("@ss.hasPermission('rq:iot-bom:query')")
+    public CommonResult<PageResult<IotBomRespVO>> getIotBomPage(@Valid IotBomPageReqVO pageReqVO) {
+        PageResult<IotBomDO> pageResult = iotBomService.getIotBomPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, IotBomRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出PMS BOM 关系 Excel")
+    @PreAuthorize("@ss.hasPermission('rq:iot-bom:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportIotBomExcel(@Valid IotBomPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<IotBomDO> list = iotBomService.getIotBomPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "PMS BOM 关系.xls", "数据", IotBomRespVO.class,
+                        BeanUtils.toBean(list, IotBomRespVO.class));
+    }
+
+}

+ 60 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotbom/vo/IotBomPageReqVO.java

@@ -0,0 +1,60 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotbom.vo;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDateTime;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - PMS BOM 关系分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class IotBomPageReqVO extends PageParam {
+
+    @Schema(description = "BOM名称", example = "李四")
+    private String name;
+
+    @Schema(description = "BOM编码")
+    private String code;
+
+    @Schema(description = "父BOM id 顶级为0", example = "3918")
+    private Long parentId;
+
+    @Schema(description = "子节点id 逗号分隔")
+    private String childIds;
+
+    @Schema(description = "层级")
+    private Integer level;
+
+    @Schema(description = "所属设备分类", example = "23419")
+    private Long deviceCategoryId;
+
+    @Schema(description = "显示顺序")
+    private Integer sort;
+
+    @Schema(description = "M维修 S保养 维修+保养", example = "1")
+    private String type;
+
+    @Schema(description = "状态 0启用  1停用", example = "1")
+    private Integer status;
+
+    @Schema(description = "是否叶子节点 0是 1否")
+    private Integer leafFlag;
+
+    @Schema(description = "备注", example = "随便")
+    private String remark;
+
+    @Schema(description = "版本")
+    private Integer version;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 71 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotbom/vo/IotBomRespVO.java

@@ -0,0 +1,71 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotbom.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - PMS BOM 关系 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class IotBomRespVO {
+
+    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25349")
+    @ExcelProperty("主键")
+    private Long id;
+
+    @Schema(description = "BOM名称", example = "李四")
+    @ExcelProperty("BOM名称")
+    private String name;
+
+    @Schema(description = "BOM编码")
+    @ExcelProperty("BOM编码")
+    private String code;
+
+    @Schema(description = "父BOM id 顶级为0", example = "3918")
+    @ExcelProperty("父BOM id 顶级为0")
+    private Long parentId;
+
+    @Schema(description = "子节点id 逗号分隔")
+    @ExcelProperty("子节点id 逗号分隔")
+    private String childIds;
+
+    @Schema(description = "层级")
+    @ExcelProperty("层级")
+    private Integer level;
+
+    @Schema(description = "所属设备分类", example = "23419")
+    @ExcelProperty("所属设备分类")
+    private Long deviceCategoryId;
+
+    @Schema(description = "显示顺序")
+    @ExcelProperty("显示顺序")
+    private Integer sort;
+
+    @Schema(description = "M维修 S保养 维修+保养", example = "1")
+    @ExcelProperty("M维修 S保养 维修+保养")
+    private String type;
+
+    @Schema(description = "状态 0启用  1停用", example = "1")
+    @ExcelProperty("状态 0启用  1停用")
+    private Integer status;
+
+    @Schema(description = "是否叶子节点 0是 1否")
+    @ExcelProperty("是否叶子节点 0是 1否")
+    private Integer leafFlag;
+
+    @Schema(description = "备注", example = "随便")
+    @ExcelProperty("备注")
+    private String remark;
+
+    @Schema(description = "版本")
+    @ExcelProperty("版本")
+    private Integer version;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

+ 49 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotbom/vo/IotBomSaveReqVO.java

@@ -0,0 +1,49 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotbom.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - PMS BOM 关系新增/修改 Request VO")
+@Data
+public class IotBomSaveReqVO {
+
+    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25349")
+    private Long id;
+
+    @Schema(description = "BOM名称", example = "李四")
+    private String name;
+
+    @Schema(description = "BOM编码")
+    private String code;
+
+    @Schema(description = "父BOM id 顶级为0", example = "3918")
+    private Long parentId;
+
+    @Schema(description = "子节点id 逗号分隔")
+    private String childIds;
+
+    @Schema(description = "层级")
+    private Integer level;
+
+    @Schema(description = "所属设备分类", example = "23419")
+    private Long deviceCategoryId;
+
+    @Schema(description = "显示顺序")
+    private Integer sort;
+
+    @Schema(description = "M维修 S保养 维修+保养", example = "1")
+    private String type;
+
+    @Schema(description = "状态 0启用  1停用", example = "1")
+    private Integer status;
+
+    @Schema(description = "是否叶子节点 0是 1否")
+    private Integer leafFlag;
+
+    @Schema(description = "备注", example = "随便")
+    private String remark;
+
+    @Schema(description = "版本")
+    private Integer version;
+
+}

+ 91 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotdevicetemplate/IotDeviceTemplateController.java

@@ -0,0 +1,91 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplate;
+
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+import cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplate.vo.*;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicetemplate.IotDeviceTemplateDO;
+import cn.iocoder.yudao.module.pms.service.iotdevicetemplate.IotDeviceTemplateService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.io.IOException;
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+@Tag(name = "管理后台 - PMS 功能优化 设备模板")
+@RestController
+@RequestMapping("/rq/iot-device-template")
+@Validated
+public class IotDeviceTemplateController {
+
+    @Resource
+    private IotDeviceTemplateService iotDeviceTemplateService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建PMS 功能优化 设备模板")
+    @PreAuthorize("@ss.hasPermission('rq:iot-device-template:create')")
+    public CommonResult<Long> createIotDeviceTemplate(@Valid @RequestBody IotDeviceTemplateSaveReqVO createReqVO) {
+        return success(iotDeviceTemplateService.createIotDeviceTemplate(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新PMS 功能优化 设备模板")
+    @PreAuthorize("@ss.hasPermission('rq:iot-device-template:update')")
+    public CommonResult<Boolean> updateIotDeviceTemplate(@Valid @RequestBody IotDeviceTemplateSaveReqVO updateReqVO) {
+        iotDeviceTemplateService.updateIotDeviceTemplate(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除PMS 功能优化 设备模板")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('rq:iot-device-template:delete')")
+    public CommonResult<Boolean> deleteIotDeviceTemplate(@RequestParam("id") Long id) {
+        iotDeviceTemplateService.deleteIotDeviceTemplate(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得PMS 功能优化 设备模板")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('rq:iot-device-template:query')")
+    public CommonResult<IotDeviceTemplateRespVO> getIotDeviceTemplate(@RequestParam("id") Long id) {
+        IotDeviceTemplateDO iotDeviceTemplate = iotDeviceTemplateService.getIotDeviceTemplate(id);
+        return success(BeanUtils.toBean(iotDeviceTemplate, IotDeviceTemplateRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得PMS 功能优化 设备模板分页")
+    @PreAuthorize("@ss.hasPermission('rq:iot-device-template:query')")
+    public CommonResult<PageResult<IotDeviceTemplateRespVO>> getIotDeviceTemplatePage(@Valid IotDeviceTemplatePageReqVO pageReqVO) {
+        PageResult<IotDeviceTemplateDO> pageResult = iotDeviceTemplateService.getIotDeviceTemplatePage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, IotDeviceTemplateRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出PMS 功能优化 设备模板 Excel")
+    @PreAuthorize("@ss.hasPermission('rq:iot-device-template:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportIotDeviceTemplateExcel(@Valid IotDeviceTemplatePageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<IotDeviceTemplateDO> list = iotDeviceTemplateService.getIotDeviceTemplatePage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "PMS 功能优化 设备模板.xls", "数据", IotDeviceTemplateRespVO.class,
+                        BeanUtils.toBean(list, IotDeviceTemplateRespVO.class));
+    }
+
+}

+ 58 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotdevicetemplate/vo/IotDeviceTemplatePageReqVO.java

@@ -0,0 +1,58 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplate.vo;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDateTime;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - PMS 功能优化 设备模板分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class IotDeviceTemplatePageReqVO extends PageParam {
+
+    @Schema(description = "所属设备分类", example = "22225")
+    private Long deviceCategoryId;
+
+    @Schema(description = "模板名称", example = "赵六")
+    private String name;
+
+    @Schema(description = "模板编码")
+    private String code;
+
+    @Schema(description = "模板属性 json 格式数据")
+    private String attrs;
+
+    @Schema(description = "同步状态 0未同步 1同步成功 2同步失败", example = "2")
+    private Integer syncStatus;
+
+    @Schema(description = "最后一次同步时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] syncTime;
+
+    @Schema(description = "模板描述", example = "随便")
+    private String description;
+
+    @Schema(description = "状态 0启用  1停用", example = "1")
+    private Integer status;
+
+    @Schema(description = "排序")
+    private Integer sort;
+
+    @Schema(description = "备注", example = "随便")
+    private String remark;
+
+    @Schema(description = "模板版本号")
+    private Integer version;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 67 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotdevicetemplate/vo/IotDeviceTemplateRespVO.java

@@ -0,0 +1,67 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplate.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - PMS 功能优化 设备模板 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class IotDeviceTemplateRespVO {
+
+    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "11061")
+    @ExcelProperty("主键")
+    private Long id;
+
+    @Schema(description = "所属设备分类", example = "22225")
+    @ExcelProperty("所属设备分类")
+    private Long deviceCategoryId;
+
+    @Schema(description = "模板名称", example = "赵六")
+    @ExcelProperty("模板名称")
+    private String name;
+
+    @Schema(description = "模板编码")
+    @ExcelProperty("模板编码")
+    private String code;
+
+    @Schema(description = "模板属性 json 格式数据")
+    @ExcelProperty("模板属性 json 格式数据")
+    private String attrs;
+
+    @Schema(description = "同步状态 0未同步 1同步成功 2同步失败", example = "2")
+    @ExcelProperty("同步状态 0未同步 1同步成功 2同步失败")
+    private Integer syncStatus;
+
+    @Schema(description = "最后一次同步时间")
+    @ExcelProperty("最后一次同步时间")
+    private LocalDateTime syncTime;
+
+    @Schema(description = "模板描述", example = "随便")
+    @ExcelProperty("模板描述")
+    private String description;
+
+    @Schema(description = "状态 0启用  1停用", example = "1")
+    @ExcelProperty("状态 0启用  1停用")
+    private Integer status;
+
+    @Schema(description = "排序")
+    @ExcelProperty("排序")
+    private Integer sort;
+
+    @Schema(description = "备注", example = "随便")
+    @ExcelProperty("备注")
+    private String remark;
+
+    @Schema(description = "模板版本号")
+    @ExcelProperty("模板版本号")
+    private Integer version;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

+ 48 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotdevicetemplate/vo/IotDeviceTemplateSaveReqVO.java

@@ -0,0 +1,48 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplate.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - PMS 功能优化 设备模板新增/修改 Request VO")
+@Data
+public class IotDeviceTemplateSaveReqVO {
+
+    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "11061")
+    private Long id;
+
+    @Schema(description = "所属设备分类", example = "22225")
+    private Long deviceCategoryId;
+
+    @Schema(description = "模板名称", example = "赵六")
+    private String name;
+
+    @Schema(description = "模板编码")
+    private String code;
+
+    @Schema(description = "模板属性 json 格式数据")
+    private String attrs;
+
+    @Schema(description = "同步状态 0未同步 1同步成功 2同步失败", example = "2")
+    private Integer syncStatus;
+
+    @Schema(description = "最后一次同步时间")
+    private LocalDateTime syncTime;
+
+    @Schema(description = "模板描述", example = "随便")
+    private String description;
+
+    @Schema(description = "状态 0启用  1停用", example = "1")
+    private Integer status;
+
+    @Schema(description = "排序")
+    private Integer sort;
+
+    @Schema(description = "备注", example = "随便")
+    private String remark;
+
+    @Schema(description = "模板版本号")
+    private Integer version;
+
+}

+ 93 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotdevicetemplateattrs/IotDeviceTemplateAttrsController.java

@@ -0,0 +1,93 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplateattrs;
+
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+import cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplateattrs.vo.IotDeviceTemplateAttrsPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplateattrs.vo.IotDeviceTemplateAttrsRespVO;
+import cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplateattrs.vo.IotDeviceTemplateAttrsSaveReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicetemplateattrs.IotDeviceTemplateAttrsDO;
+import cn.iocoder.yudao.module.pms.service.iotdevicetemplateattrs.IotDeviceTemplateAttrsService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.io.IOException;
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+@Tag(name = "管理后台 - PMS 功能优化 设备模板属性")
+@RestController
+@RequestMapping("/rq/iot-device-template-attrs")
+@Validated
+public class IotDeviceTemplateAttrsController {
+
+    @Resource
+    private IotDeviceTemplateAttrsService iotDeviceTemplateAttrsService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建PMS 功能优化 设备模板属性")
+    @PreAuthorize("@ss.hasPermission('rq:iot-device-template-attrs:create')")
+    public CommonResult<Long> createIotDeviceTemplateAttrs(@Valid @RequestBody IotDeviceTemplateAttrsSaveReqVO createReqVO) {
+        return success(iotDeviceTemplateAttrsService.createIotDeviceTemplateAttrs(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新PMS 功能优化 设备模板属性")
+    @PreAuthorize("@ss.hasPermission('rq:iot-device-template-attrs:update')")
+    public CommonResult<Boolean> updateIotDeviceTemplateAttrs(@Valid @RequestBody IotDeviceTemplateAttrsSaveReqVO updateReqVO) {
+        iotDeviceTemplateAttrsService.updateIotDeviceTemplateAttrs(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除PMS 功能优化 设备模板属性")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('rq:iot-device-template-attrs:delete')")
+    public CommonResult<Boolean> deleteIotDeviceTemplateAttrs(@RequestParam("id") Long id) {
+        iotDeviceTemplateAttrsService.deleteIotDeviceTemplateAttrs(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得PMS 功能优化 设备模板属性")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('rq:iot-device-template-attrs:query')")
+    public CommonResult<IotDeviceTemplateAttrsRespVO> getIotDeviceTemplateAttrs(@RequestParam("id") Long id) {
+        IotDeviceTemplateAttrsDO iotDeviceTemplateAttrs = iotDeviceTemplateAttrsService.getIotDeviceTemplateAttrs(id);
+        return success(BeanUtils.toBean(iotDeviceTemplateAttrs, IotDeviceTemplateAttrsRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得PMS 功能优化 设备模板属性分页")
+    @PreAuthorize("@ss.hasPermission('rq:iot-device-template-attrs:query')")
+    public CommonResult<PageResult<IotDeviceTemplateAttrsRespVO>> getIotDeviceTemplateAttrsPage(@Valid IotDeviceTemplateAttrsPageReqVO pageReqVO) {
+        PageResult<IotDeviceTemplateAttrsDO> pageResult = iotDeviceTemplateAttrsService.getIotDeviceTemplateAttrsPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, IotDeviceTemplateAttrsRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出PMS 功能优化 设备模板属性 Excel")
+    @PreAuthorize("@ss.hasPermission('rq:iot-device-template-attrs:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportIotDeviceTemplateAttrsExcel(@Valid IotDeviceTemplateAttrsPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<IotDeviceTemplateAttrsDO> list = iotDeviceTemplateAttrsService.getIotDeviceTemplateAttrsPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "PMS 功能优化 设备模板属性.xls", "数据", IotDeviceTemplateAttrsRespVO.class,
+                        BeanUtils.toBean(list, IotDeviceTemplateAttrsRespVO.class));
+    }
+
+}

+ 63 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotdevicetemplateattrs/vo/IotDeviceTemplateAttrsPageReqVO.java

@@ -0,0 +1,63 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplateattrs.vo;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDateTime;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - PMS 功能优化 设备模板属性分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class IotDeviceTemplateAttrsPageReqVO extends PageParam {
+
+    @Schema(description = "设备模板id", example = "32238")
+    private Long deviceTemplateId;
+
+    @Schema(description = "属性名称", example = "李四")
+    private String name;
+
+    @Schema(description = "属性编码")
+    private String code;
+
+    @Schema(description = "属性数据类型 string number boolean", example = "1")
+    private String type;
+
+    @Schema(description = "是否必填 0不必填 1必填")
+    private Integer requiredFlag;
+
+    @Schema(description = "默认值")
+    private String defaultValue;
+
+    @Schema(description = "属性值单位")
+    private String unit;
+
+    @Schema(description = "模板描述", example = "随便")
+    private String description;
+
+    @Schema(description = "状态 0启用  1停用", example = "1")
+    private Integer status;
+
+    @Schema(description = "备注", example = "随便")
+    private String remark;
+
+    @Schema(description = "排序")
+    private Integer sort;
+
+    @Schema(description = "下拉框选项 ")
+    private String selectOptions;
+
+    @Schema(description = "模板版本号")
+    private Integer version;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 75 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotdevicetemplateattrs/vo/IotDeviceTemplateAttrsRespVO.java

@@ -0,0 +1,75 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplateattrs.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - PMS 功能优化 设备模板属性 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class IotDeviceTemplateAttrsRespVO {
+
+    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "12178")
+    @ExcelProperty("主键")
+    private Long id;
+
+    @Schema(description = "设备模板id", example = "32238")
+    @ExcelProperty("设备模板id")
+    private Long deviceTemplateId;
+
+    @Schema(description = "属性名称", example = "李四")
+    @ExcelProperty("属性名称")
+    private String name;
+
+    @Schema(description = "属性编码")
+    @ExcelProperty("属性编码")
+    private String code;
+
+    @Schema(description = "属性数据类型 string number boolean", example = "1")
+    @ExcelProperty("属性数据类型 string number boolean")
+    private String type;
+
+    @Schema(description = "是否必填 0不必填 1必填")
+    @ExcelProperty("是否必填 0不必填 1必填")
+    private Integer requiredFlag;
+
+    @Schema(description = "默认值")
+    @ExcelProperty("默认值")
+    private String defaultValue;
+
+    @Schema(description = "属性值单位")
+    @ExcelProperty("属性值单位")
+    private String unit;
+
+    @Schema(description = "模板描述", example = "随便")
+    @ExcelProperty("模板描述")
+    private String description;
+
+    @Schema(description = "状态 0启用  1停用", example = "1")
+    @ExcelProperty("状态 0启用  1停用")
+    private Integer status;
+
+    @Schema(description = "备注", example = "随便")
+    @ExcelProperty("备注")
+    private String remark;
+
+    @Schema(description = "排序")
+    @ExcelProperty("排序")
+    private Integer sort;
+
+    @Schema(description = "下拉框选项 ")
+    @ExcelProperty("下拉框选项 ")
+    private String selectOptions;
+
+    @Schema(description = "模板版本号")
+    @ExcelProperty("模板版本号")
+    private Integer version;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

+ 52 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotdevicetemplateattrs/vo/IotDeviceTemplateAttrsSaveReqVO.java

@@ -0,0 +1,52 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplateattrs.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - PMS 功能优化 设备模板属性新增/修改 Request VO")
+@Data
+public class IotDeviceTemplateAttrsSaveReqVO {
+
+    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "12178")
+    private Long id;
+
+    @Schema(description = "设备模板id", example = "32238")
+    private Long deviceTemplateId;
+
+    @Schema(description = "属性名称", example = "李四")
+    private String name;
+
+    @Schema(description = "属性编码")
+    private String code;
+
+    @Schema(description = "属性数据类型 string number boolean", example = "1")
+    private String type;
+
+    @Schema(description = "是否必填 0不必填 1必填")
+    private Integer requiredFlag;
+
+    @Schema(description = "默认值")
+    private String defaultValue;
+
+    @Schema(description = "属性值单位")
+    private String unit;
+
+    @Schema(description = "模板描述", example = "随便")
+    private String description;
+
+    @Schema(description = "状态 0启用  1停用", example = "1")
+    private Integer status;
+
+    @Schema(description = "备注", example = "随便")
+    private String remark;
+
+    @Schema(description = "排序")
+    private Integer sort;
+
+    @Schema(description = "下拉框选项 ")
+    private String selectOptions;
+
+    @Schema(description = "模板版本号")
+    private Integer version;
+
+}

+ 93 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmaterial/IotMaterialController.java

@@ -0,0 +1,93 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotmaterial;
+
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+import cn.iocoder.yudao.module.pms.controller.admin.iotmaterial.vo.IotMaterialPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.iotmaterial.vo.IotMaterialRespVO;
+import cn.iocoder.yudao.module.pms.controller.admin.iotmaterial.vo.IotMaterialSaveReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotmaterial.IotMaterialDO;
+import cn.iocoder.yudao.module.pms.service.iotmaterial.IotMaterialService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.io.IOException;
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+@Tag(name = "管理后台 - PMS 功能优化 物料")
+@RestController
+@RequestMapping("/rq/iot-material")
+@Validated
+public class IotMaterialController {
+
+    @Resource
+    private IotMaterialService iotMaterialService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建PMS 功能优化 物料")
+    @PreAuthorize("@ss.hasPermission('rq:iot-material:create')")
+    public CommonResult<Long> createIotMaterial(@Valid @RequestBody IotMaterialSaveReqVO createReqVO) {
+        return success(iotMaterialService.createIotMaterial(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新PMS 功能优化 物料")
+    @PreAuthorize("@ss.hasPermission('rq:iot-material:update')")
+    public CommonResult<Boolean> updateIotMaterial(@Valid @RequestBody IotMaterialSaveReqVO updateReqVO) {
+        iotMaterialService.updateIotMaterial(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除PMS 功能优化 物料")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('rq:iot-material:delete')")
+    public CommonResult<Boolean> deleteIotMaterial(@RequestParam("id") Long id) {
+        iotMaterialService.deleteIotMaterial(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得PMS 功能优化 物料")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('rq:iot-material:query')")
+    public CommonResult<IotMaterialRespVO> getIotMaterial(@RequestParam("id") Long id) {
+        IotMaterialDO iotMaterial = iotMaterialService.getIotMaterial(id);
+        return success(BeanUtils.toBean(iotMaterial, IotMaterialRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得PMS 功能优化 物料分页")
+    @PreAuthorize("@ss.hasPermission('rq:iot-material:query')")
+    public CommonResult<PageResult<IotMaterialRespVO>> getIotMaterialPage(@Valid IotMaterialPageReqVO pageReqVO) {
+        PageResult<IotMaterialDO> pageResult = iotMaterialService.getIotMaterialPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, IotMaterialRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出PMS 功能优化 物料 Excel")
+    @PreAuthorize("@ss.hasPermission('rq:iot-material:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportIotMaterialExcel(@Valid IotMaterialPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<IotMaterialDO> list = iotMaterialService.getIotMaterialPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "PMS 功能优化 物料.xls", "数据", IotMaterialRespVO.class,
+                        BeanUtils.toBean(list, IotMaterialRespVO.class));
+    }
+
+}

+ 67 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmaterial/vo/IotMaterialPageReqVO.java

@@ -0,0 +1,67 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotmaterial.vo;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDateTime;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - PMS 功能优化 物料分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class IotMaterialPageReqVO extends PageParam {
+
+    @Schema(description = "物料组id", example = "14786")
+    private Long materialGroupId;
+
+    @Schema(description = "BOM叶子节点", example = "10893")
+    private Long bomId;
+
+    @Schema(description = "物料类型 ROH原材料 FERT成品 HALB半成品", example = "1")
+    private String type;
+
+    @Schema(description = "物料编码")
+    private String code;
+
+    @Schema(description = "物料名称", example = "芋艿")
+    private String name;
+
+    @Schema(description = "规格型号")
+    private String model;
+
+    @Schema(description = "单位 字典表")
+    private String unit;
+
+    @Schema(description = "SAP系统中的物料唯一编号")
+    private String sapCode;
+
+    @Schema(description = "同步状态 0未同步 1同步成功 2同步失败", example = "2")
+    private Integer syncStatus;
+
+    @Schema(description = "最后一次同步时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] syncTime;
+
+    @Schema(description = "同步失败时的错误信息")
+    private String syncError;
+
+    @Schema(description = "排序")
+    private Integer sort;
+
+    @Schema(description = "状态 0启用  1停用", example = "2")
+    private Integer status;
+
+    @Schema(description = "备注", example = "你说的对")
+    private String remark;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 79 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmaterial/vo/IotMaterialRespVO.java

@@ -0,0 +1,79 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotmaterial.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - PMS 功能优化 物料 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class IotMaterialRespVO {
+
+    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "8816")
+    @ExcelProperty("主键")
+    private Long id;
+
+    @Schema(description = "物料组id", example = "14786")
+    @ExcelProperty("物料组id")
+    private Long materialGroupId;
+
+    @Schema(description = "BOM叶子节点", example = "10893")
+    @ExcelProperty("BOM叶子节点")
+    private Long bomId;
+
+    @Schema(description = "物料类型 ROH原材料 FERT成品 HALB半成品", example = "1")
+    @ExcelProperty("物料类型 ROH原材料 FERT成品 HALB半成品")
+    private String type;
+
+    @Schema(description = "物料编码")
+    @ExcelProperty("物料编码")
+    private String code;
+
+    @Schema(description = "物料名称", example = "芋艿")
+    @ExcelProperty("物料名称")
+    private String name;
+
+    @Schema(description = "规格型号")
+    @ExcelProperty("规格型号")
+    private String model;
+
+    @Schema(description = "单位 字典表")
+    @ExcelProperty("单位 字典表")
+    private String unit;
+
+    @Schema(description = "SAP系统中的物料唯一编号")
+    @ExcelProperty("SAP系统中的物料唯一编号")
+    private String sapCode;
+
+    @Schema(description = "同步状态 0未同步 1同步成功 2同步失败", example = "2")
+    @ExcelProperty("同步状态 0未同步 1同步成功 2同步失败")
+    private Integer syncStatus;
+
+    @Schema(description = "最后一次同步时间")
+    @ExcelProperty("最后一次同步时间")
+    private LocalDateTime syncTime;
+
+    @Schema(description = "同步失败时的错误信息")
+    @ExcelProperty("同步失败时的错误信息")
+    private String syncError;
+
+    @Schema(description = "排序")
+    @ExcelProperty("排序")
+    private Integer sort;
+
+    @Schema(description = "状态 0启用  1停用", example = "2")
+    @ExcelProperty("状态 0启用  1停用")
+    private Integer status;
+
+    @Schema(description = "备注", example = "你说的对")
+    @ExcelProperty("备注")
+    private String remark;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

+ 57 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmaterial/vo/IotMaterialSaveReqVO.java

@@ -0,0 +1,57 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotmaterial.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - PMS 功能优化 物料新增/修改 Request VO")
+@Data
+public class IotMaterialSaveReqVO {
+
+    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "8816")
+    private Long id;
+
+    @Schema(description = "物料组id", example = "14786")
+    private Long materialGroupId;
+
+    @Schema(description = "BOM叶子节点", example = "10893")
+    private Long bomId;
+
+    @Schema(description = "物料类型 ROH原材料 FERT成品 HALB半成品", example = "1")
+    private String type;
+
+    @Schema(description = "物料编码")
+    private String code;
+
+    @Schema(description = "物料名称", example = "芋艿")
+    private String name;
+
+    @Schema(description = "规格型号")
+    private String model;
+
+    @Schema(description = "单位 字典表")
+    private String unit;
+
+    @Schema(description = "SAP系统中的物料唯一编号")
+    private String sapCode;
+
+    @Schema(description = "同步状态 0未同步 1同步成功 2同步失败", example = "2")
+    private Integer syncStatus;
+
+    @Schema(description = "最后一次同步时间")
+    private LocalDateTime syncTime;
+
+    @Schema(description = "同步失败时的错误信息")
+    private String syncError;
+
+    @Schema(description = "排序")
+    private Integer sort;
+
+    @Schema(description = "状态 0启用  1停用", example = "2")
+    private Integer status;
+
+    @Schema(description = "备注", example = "你说的对")
+    private String remark;
+
+}

+ 93 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmaterialgroup/IotMaterialGroupController.java

@@ -0,0 +1,93 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotmaterialgroup;
+
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+import cn.iocoder.yudao.module.pms.controller.admin.iotmaterialgroup.vo.IotMaterialGroupPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.iotmaterialgroup.vo.IotMaterialGroupRespVO;
+import cn.iocoder.yudao.module.pms.controller.admin.iotmaterialgroup.vo.IotMaterialGroupSaveReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotmaterialgroup.IotMaterialGroupDO;
+import cn.iocoder.yudao.module.pms.service.iotmaterialgroup.IotMaterialGroupService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.io.IOException;
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+@Tag(name = "管理后台 - PMS 功能优化 物料组")
+@RestController
+@RequestMapping("/rq/iot-material-group")
+@Validated
+public class IotMaterialGroupController {
+
+    @Resource
+    private IotMaterialGroupService iotMaterialGroupService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建PMS 功能优化 物料组")
+    @PreAuthorize("@ss.hasPermission('rq:iot-material-group:create')")
+    public CommonResult<Long> createIotMaterialGroup(@Valid @RequestBody IotMaterialGroupSaveReqVO createReqVO) {
+        return success(iotMaterialGroupService.createIotMaterialGroup(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新PMS 功能优化 物料组")
+    @PreAuthorize("@ss.hasPermission('rq:iot-material-group:update')")
+    public CommonResult<Boolean> updateIotMaterialGroup(@Valid @RequestBody IotMaterialGroupSaveReqVO updateReqVO) {
+        iotMaterialGroupService.updateIotMaterialGroup(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除PMS 功能优化 物料组")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('rq:iot-material-group:delete')")
+    public CommonResult<Boolean> deleteIotMaterialGroup(@RequestParam("id") Long id) {
+        iotMaterialGroupService.deleteIotMaterialGroup(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得PMS 功能优化 物料组")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('rq:iot-material-group:query')")
+    public CommonResult<IotMaterialGroupRespVO> getIotMaterialGroup(@RequestParam("id") Long id) {
+        IotMaterialGroupDO iotMaterialGroup = iotMaterialGroupService.getIotMaterialGroup(id);
+        return success(BeanUtils.toBean(iotMaterialGroup, IotMaterialGroupRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得PMS 功能优化 物料组分页")
+    @PreAuthorize("@ss.hasPermission('rq:iot-material-group:query')")
+    public CommonResult<PageResult<IotMaterialGroupRespVO>> getIotMaterialGroupPage(@Valid IotMaterialGroupPageReqVO pageReqVO) {
+        PageResult<IotMaterialGroupDO> pageResult = iotMaterialGroupService.getIotMaterialGroupPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, IotMaterialGroupRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出PMS 功能优化 物料组 Excel")
+    @PreAuthorize("@ss.hasPermission('rq:iot-material-group:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportIotMaterialGroupExcel(@Valid IotMaterialGroupPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<IotMaterialGroupDO> list = iotMaterialGroupService.getIotMaterialGroupPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "PMS 功能优化 物料组.xls", "数据", IotMaterialGroupRespVO.class,
+                        BeanUtils.toBean(list, IotMaterialGroupRespVO.class));
+    }
+
+}

+ 39 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmaterialgroup/vo/IotMaterialGroupPageReqVO.java

@@ -0,0 +1,39 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotmaterialgroup.vo;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDateTime;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - PMS 功能优化 物料组分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class IotMaterialGroupPageReqVO extends PageParam {
+
+    @Schema(description = "物料组名称", example = "李四")
+    private String name;
+
+    @Schema(description = "父物料组id", example = "15666")
+    private Long parentId;
+
+    @Schema(description = "显示顺序")
+    private Integer sort;
+
+    @Schema(description = "状态 0启用  1停用", example = "2")
+    private Integer status;
+
+    @Schema(description = "备注", example = "你说的对")
+    private String remark;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 43 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmaterialgroup/vo/IotMaterialGroupRespVO.java

@@ -0,0 +1,43 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotmaterialgroup.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - PMS 功能优化 物料组 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class IotMaterialGroupRespVO {
+
+    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "12551")
+    @ExcelProperty("主键")
+    private Long id;
+
+    @Schema(description = "物料组名称", example = "李四")
+    @ExcelProperty("物料组名称")
+    private String name;
+
+    @Schema(description = "父物料组id", example = "15666")
+    @ExcelProperty("父物料组id")
+    private Long parentId;
+
+    @Schema(description = "显示顺序")
+    @ExcelProperty("显示顺序")
+    private Integer sort;
+
+    @Schema(description = "状态 0启用  1停用", example = "2")
+    @ExcelProperty("状态 0启用  1停用")
+    private Integer status;
+
+    @Schema(description = "备注", example = "你说的对")
+    @ExcelProperty("备注")
+    private String remark;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

+ 28 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmaterialgroup/vo/IotMaterialGroupSaveReqVO.java

@@ -0,0 +1,28 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotmaterialgroup.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - PMS 功能优化 物料组新增/修改 Request VO")
+@Data
+public class IotMaterialGroupSaveReqVO {
+
+    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "12551")
+    private Long id;
+
+    @Schema(description = "物料组名称", example = "李四")
+    private String name;
+
+    @Schema(description = "父物料组id", example = "15666")
+    private Long parentId;
+
+    @Schema(description = "显示顺序")
+    private Integer sort;
+
+    @Schema(description = "状态 0启用  1停用", example = "2")
+    private Integer status;
+
+    @Schema(description = "备注", example = "你说的对")
+    private String remark;
+
+}

+ 91 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmodel/IotModelController.java

@@ -0,0 +1,91 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotmodel;
+
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+import cn.iocoder.yudao.module.pms.controller.admin.iotmodel.vo.*;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotmodel.IotModelDO;
+import cn.iocoder.yudao.module.pms.service.iotmodel.IotModelService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.io.IOException;
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+@Tag(name = "管理后台 - PMS 功能优化 规格型号")
+@RestController
+@RequestMapping("/rq/iot-model")
+@Validated
+public class IotModelController {
+
+    @Resource
+    private IotModelService iotModelService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建PMS 功能优化 规格型号")
+    @PreAuthorize("@ss.hasPermission('rq:iot-model:create')")
+    public CommonResult<Long> createIotModel(@Valid @RequestBody IotModelSaveReqVO createReqVO) {
+        return success(iotModelService.createIotModel(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新PMS 功能优化 规格型号")
+    @PreAuthorize("@ss.hasPermission('rq:iot-model:update')")
+    public CommonResult<Boolean> updateIotModel(@Valid @RequestBody IotModelSaveReqVO updateReqVO) {
+        iotModelService.updateIotModel(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除PMS 功能优化 规格型号")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('rq:iot-model:delete')")
+    public CommonResult<Boolean> deleteIotModel(@RequestParam("id") Long id) {
+        iotModelService.deleteIotModel(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得PMS 功能优化 规格型号")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('rq:iot-model:query')")
+    public CommonResult<IotModelRespVO> getIotModel(@RequestParam("id") Long id) {
+        IotModelDO iotModel = iotModelService.getIotModel(id);
+        return success(BeanUtils.toBean(iotModel, IotModelRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得PMS 功能优化 规格型号分页")
+    @PreAuthorize("@ss.hasPermission('rq:iot-model:query')")
+    public CommonResult<PageResult<IotModelRespVO>> getIotModelPage(@Valid IotModelPageReqVO pageReqVO) {
+        PageResult<IotModelDO> pageResult = iotModelService.getIotModelPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, IotModelRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出PMS 功能优化 规格型号 Excel")
+    @PreAuthorize("@ss.hasPermission('rq:iot-model:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportIotModelExcel(@Valid IotModelPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<IotModelDO> list = iotModelService.getIotModelPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "PMS 功能优化 规格型号.xls", "数据", IotModelRespVO.class,
+                        BeanUtils.toBean(list, IotModelRespVO.class));
+    }
+
+}

+ 42 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmodel/vo/IotModelPageReqVO.java

@@ -0,0 +1,42 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotmodel.vo;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDateTime;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - PMS 功能优化 规格型号分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class IotModelPageReqVO extends PageParam {
+
+    @Schema(description = "规格型号名称", example = "芋艿")
+    private String name;
+
+    @Schema(description = "品牌")
+    private String brand;
+
+    @Schema(description = "符合标准 如 API 6D、ASME B16.5、ISO 3183")
+    private String standard;
+
+    @Schema(description = "显示顺序")
+    private Integer sort;
+
+    @Schema(description = "状态 0启用  1停用", example = "2")
+    private Integer status;
+
+    @Schema(description = "备注", example = "你猜")
+    private String remark;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 47 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmodel/vo/IotModelRespVO.java

@@ -0,0 +1,47 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotmodel.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - PMS 功能优化 规格型号 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class IotModelRespVO {
+
+    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "12314")
+    @ExcelProperty("主键")
+    private Long id;
+
+    @Schema(description = "规格型号名称", example = "芋艿")
+    @ExcelProperty("规格型号名称")
+    private String name;
+
+    @Schema(description = "品牌")
+    @ExcelProperty("品牌")
+    private String brand;
+
+    @Schema(description = "符合标准 如 API 6D、ASME B16.5、ISO 3183")
+    @ExcelProperty("符合标准 如 API 6D、ASME B16.5、ISO 3183")
+    private String standard;
+
+    @Schema(description = "显示顺序")
+    @ExcelProperty("显示顺序")
+    private Integer sort;
+
+    @Schema(description = "状态 0启用  1停用", example = "2")
+    @ExcelProperty("状态 0启用  1停用")
+    private Integer status;
+
+    @Schema(description = "备注", example = "你猜")
+    @ExcelProperty("备注")
+    private String remark;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

+ 31 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmodel/vo/IotModelSaveReqVO.java

@@ -0,0 +1,31 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotmodel.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - PMS 功能优化 规格型号新增/修改 Request VO")
+@Data
+public class IotModelSaveReqVO {
+
+    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "12314")
+    private Long id;
+
+    @Schema(description = "规格型号名称", example = "芋艿")
+    private String name;
+
+    @Schema(description = "品牌")
+    private String brand;
+
+    @Schema(description = "符合标准 如 API 6D、ASME B16.5、ISO 3183")
+    private String standard;
+
+    @Schema(description = "显示顺序")
+    private Integer sort;
+
+    @Schema(description = "状态 0启用  1停用", example = "2")
+    private Integer status;
+
+    @Schema(description = "备注", example = "你猜")
+    private String remark;
+
+}

+ 78 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/iotbom/IotBomDO.java

@@ -0,0 +1,78 @@
+package cn.iocoder.yudao.module.pms.dal.dataobject.iotbom;
+
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
+import com.baomidou.mybatisplus.annotation.KeySequence;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+/**
+ * PMS BOM 关系 DO
+ *
+ * @author 芋道源码
+ */
+@TableName("rq_iot_bom")
+@KeySequence("rq_iot_bom_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class IotBomDO extends BaseDO {
+
+    /**
+     * 主键
+     */
+    @TableId
+    private Long id;
+    /**
+     * BOM名称
+     */
+    private String name;
+    /**
+     * BOM编码
+     */
+    private String code;
+    /**
+     * 父BOM id 顶级为0
+     */
+    private Long parentId;
+    /**
+     * 子节点id 逗号分隔
+     */
+    private String childIds;
+    /**
+     * 层级
+     */
+    private Integer level;
+    /**
+     * 所属设备分类
+     */
+    private Long deviceCategoryId;
+    /**
+     * 显示顺序
+     */
+    private Integer sort;
+    /**
+     * M维修 S保养 维修+保养
+     */
+    private String type;
+    /**
+     * 状态 0启用  1停用
+     */
+    private Integer status;
+    /**
+     * 是否叶子节点 0是 1否
+     */
+    private Integer leafFlag;
+    /**
+     * 备注
+     */
+    private String remark;
+    /**
+     * 版本
+     */
+    private Integer version;
+
+}

+ 76 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/iotdevicetemplate/IotDeviceTemplateDO.java

@@ -0,0 +1,76 @@
+package cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicetemplate;
+
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
+import com.baomidou.mybatisplus.annotation.KeySequence;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+import java.time.LocalDateTime;
+
+/**
+ * PMS 功能优化 设备模板 DO
+ *
+ * @author 芋道源码
+ */
+@TableName("rq_iot_device_template")
+@KeySequence("rq_iot_device_template_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class IotDeviceTemplateDO extends BaseDO {
+
+    /**
+     * 主键
+     */
+    @TableId
+    private Long id;
+    /**
+     * 所属设备分类
+     */
+    private Long deviceCategoryId;
+    /**
+     * 模板名称
+     */
+    private String name;
+    /**
+     * 模板编码
+     */
+    private String code;
+    /**
+     * 模板属性 json 格式数据
+     */
+    private String attrs;
+    /**
+     * 同步状态 0未同步 1同步成功 2同步失败
+     */
+    private Integer syncStatus;
+    /**
+     * 最后一次同步时间
+     */
+    private LocalDateTime syncTime;
+    /**
+     * 模板描述
+     */
+    private String description;
+    /**
+     * 状态 0启用  1停用
+     */
+    private Integer status;
+    /**
+     * 排序
+     */
+    private Integer sort;
+    /**
+     * 备注
+     */
+    private String remark;
+    /**
+     * 模板版本号
+     */
+    private Integer version;
+
+}

+ 86 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/iotdevicetemplateattrs/IotDeviceTemplateAttrsDO.java

@@ -0,0 +1,86 @@
+package cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicetemplateattrs;
+
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
+import com.baomidou.mybatisplus.annotation.KeySequence;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+/**
+ * PMS 功能优化 设备模板属性 DO
+ *
+ * @author 芋道源码
+ */
+@TableName("rq_iot_device_template_attrs")
+@KeySequence("rq_iot_device_template_attrs_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class IotDeviceTemplateAttrsDO extends BaseDO {
+
+    /**
+     * 主键
+     */
+    @TableId
+    private Long id;
+    /**
+     * 设备模板id
+     */
+    private Long deviceTemplateId;
+    /**
+     * 属性名称
+     */
+    private String name;
+    /**
+     * 属性编码
+     */
+    private String code;
+    /**
+     * 属性数据类型 string number boolean
+     */
+    private String type;
+    /**
+     * 是否必填 0不必填 1必填
+     */
+    private Integer requiredFlag;
+    /**
+     * 默认值
+     */
+    private String defaultValue;
+    /**
+     * 属性值单位
+     */
+    private String unit;
+    /**
+     * 模板描述
+     */
+    private String description;
+    /**
+     * 状态 0启用  1停用
+     */
+    private Integer status;
+    /**
+     * 备注
+     */
+    private String remark;
+    /**
+     * 排序
+     */
+    private Integer sort;
+    /**
+     * 下拉框选项 [
+    {"value": "1", "text": "泵"},
+    {"value": "2", "text": "阀门"},
+    {"value": "3", "text": "传感器"}
+  ]
+     */
+    private String selectOptions;
+    /**
+     * 模板版本号
+     */
+    private Integer version;
+
+}

+ 88 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/iotmaterial/IotMaterialDO.java

@@ -0,0 +1,88 @@
+package cn.iocoder.yudao.module.pms.dal.dataobject.iotmaterial;
+
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
+import com.baomidou.mybatisplus.annotation.KeySequence;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+import java.time.LocalDateTime;
+
+/**
+ * PMS 功能优化 物料 DO
+ *
+ * @author 芋道源码
+ */
+@TableName("rq_iot_material")
+@KeySequence("rq_iot_material_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class IotMaterialDO extends BaseDO {
+
+    /**
+     * 主键
+     */
+    @TableId
+    private Long id;
+    /**
+     * 物料组id
+     */
+    private Long materialGroupId;
+    /**
+     * BOM叶子节点
+     */
+    private Long bomId;
+    /**
+     * 物料类型 ROH原材料 FERT成品 HALB半成品
+     */
+    private String type;
+    /**
+     * 物料编码
+     */
+    private String code;
+    /**
+     * 物料名称
+     */
+    private String name;
+    /**
+     * 规格型号
+     */
+    private String model;
+    /**
+     * 单位 字典表
+     */
+    private String unit;
+    /**
+     * SAP系统中的物料唯一编号
+     */
+    private String sapCode;
+    /**
+     * 同步状态 0未同步 1同步成功 2同步失败
+     */
+    private Integer syncStatus;
+    /**
+     * 最后一次同步时间
+     */
+    private LocalDateTime syncTime;
+    /**
+     * 同步失败时的错误信息
+     */
+    private String syncError;
+    /**
+     * 排序
+     */
+    private Integer sort;
+    /**
+     * 状态 0启用  1停用
+     */
+    private Integer status;
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 50 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/iotmaterialgroup/IotMaterialGroupDO.java

@@ -0,0 +1,50 @@
+package cn.iocoder.yudao.module.pms.dal.dataobject.iotmaterialgroup;
+
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
+import com.baomidou.mybatisplus.annotation.KeySequence;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+/**
+ * PMS 功能优化 物料组 DO
+ *
+ * @author 芋道源码
+ */
+@TableName("rq_iot_material_group")
+@KeySequence("rq_iot_material_group_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class IotMaterialGroupDO extends BaseDO {
+
+    /**
+     * 主键
+     */
+    @TableId
+    private Long id;
+    /**
+     * 物料组名称
+     */
+    private String name;
+    /**
+     * 父物料组id
+     */
+    private Long parentId;
+    /**
+     * 显示顺序
+     */
+    private Integer sort;
+    /**
+     * 状态 0启用  1停用
+     */
+    private Integer status;
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 54 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/iotmodel/IotModelDO.java

@@ -0,0 +1,54 @@
+package cn.iocoder.yudao.module.pms.dal.dataobject.iotmodel;
+
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
+import com.baomidou.mybatisplus.annotation.KeySequence;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+/**
+ * PMS 功能优化 规格型号 DO
+ *
+ * @author 芋道源码
+ */
+@TableName("rq_iot_model")
+@KeySequence("rq_iot_model_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class IotModelDO extends BaseDO {
+
+    /**
+     * 主键
+     */
+    @TableId
+    private Long id;
+    /**
+     * 规格型号名称
+     */
+    private String name;
+    /**
+     * 品牌
+     */
+    private String brand;
+    /**
+     * 符合标准 如 API 6D、ASME B16.5、ISO 3183
+     */
+    private String standard;
+    /**
+     * 显示顺序
+     */
+    private Integer sort;
+    /**
+     * 状态 0启用  1停用
+     */
+    private Integer status;
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 36 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotbom/IotBomMapper.java

@@ -0,0 +1,36 @@
+package cn.iocoder.yudao.module.pms.dal.mysql.iotbom;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.pms.controller.admin.iotbom.vo.IotBomPageReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotbom.IotBomDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * PMS BOM 关系 Mapper
+ *
+ * @author 芋道源码
+ */
+@Mapper
+public interface IotBomMapper extends BaseMapperX<IotBomDO> {
+
+    default PageResult<IotBomDO> selectPage(IotBomPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<IotBomDO>()
+                .likeIfPresent(IotBomDO::getName, reqVO.getName())
+                .eqIfPresent(IotBomDO::getCode, reqVO.getCode())
+                .eqIfPresent(IotBomDO::getParentId, reqVO.getParentId())
+                .eqIfPresent(IotBomDO::getChildIds, reqVO.getChildIds())
+                .eqIfPresent(IotBomDO::getLevel, reqVO.getLevel())
+                .eqIfPresent(IotBomDO::getDeviceCategoryId, reqVO.getDeviceCategoryId())
+                .eqIfPresent(IotBomDO::getSort, reqVO.getSort())
+                .eqIfPresent(IotBomDO::getType, reqVO.getType())
+                .eqIfPresent(IotBomDO::getStatus, reqVO.getStatus())
+                .eqIfPresent(IotBomDO::getLeafFlag, reqVO.getLeafFlag())
+                .eqIfPresent(IotBomDO::getRemark, reqVO.getRemark())
+                .eqIfPresent(IotBomDO::getVersion, reqVO.getVersion())
+                .betweenIfPresent(IotBomDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(IotBomDO::getId));
+    }
+
+}

+ 35 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotdevicetemplate/IotDeviceTemplateMapper.java

@@ -0,0 +1,35 @@
+package cn.iocoder.yudao.module.pms.dal.mysql.iotdevicetemplate;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplate.vo.IotDeviceTemplatePageReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicetemplate.IotDeviceTemplateDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * PMS 功能优化 设备模板 Mapper
+ *
+ * @author 芋道源码
+ */
+@Mapper
+public interface IotDeviceTemplateMapper extends BaseMapperX<IotDeviceTemplateDO> {
+
+    default PageResult<IotDeviceTemplateDO> selectPage(IotDeviceTemplatePageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<IotDeviceTemplateDO>()
+                .eqIfPresent(IotDeviceTemplateDO::getDeviceCategoryId, reqVO.getDeviceCategoryId())
+                .likeIfPresent(IotDeviceTemplateDO::getName, reqVO.getName())
+                .eqIfPresent(IotDeviceTemplateDO::getCode, reqVO.getCode())
+                .eqIfPresent(IotDeviceTemplateDO::getAttrs, reqVO.getAttrs())
+                .eqIfPresent(IotDeviceTemplateDO::getSyncStatus, reqVO.getSyncStatus())
+                .betweenIfPresent(IotDeviceTemplateDO::getSyncTime, reqVO.getSyncTime())
+                .eqIfPresent(IotDeviceTemplateDO::getDescription, reqVO.getDescription())
+                .eqIfPresent(IotDeviceTemplateDO::getStatus, reqVO.getStatus())
+                .eqIfPresent(IotDeviceTemplateDO::getSort, reqVO.getSort())
+                .eqIfPresent(IotDeviceTemplateDO::getRemark, reqVO.getRemark())
+                .eqIfPresent(IotDeviceTemplateDO::getVersion, reqVO.getVersion())
+                .betweenIfPresent(IotDeviceTemplateDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(IotDeviceTemplateDO::getId));
+    }
+
+}

+ 37 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotdevicetemplateattrs/IotDeviceTemplateAttrsMapper.java

@@ -0,0 +1,37 @@
+package cn.iocoder.yudao.module.pms.dal.mysql.iotdevicetemplateattrs;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplateattrs.vo.IotDeviceTemplateAttrsPageReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicetemplateattrs.IotDeviceTemplateAttrsDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * PMS 功能优化 设备模板属性 Mapper
+ *
+ * @author 芋道源码
+ */
+@Mapper
+public interface IotDeviceTemplateAttrsMapper extends BaseMapperX<IotDeviceTemplateAttrsDO> {
+
+    default PageResult<IotDeviceTemplateAttrsDO> selectPage(IotDeviceTemplateAttrsPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<IotDeviceTemplateAttrsDO>()
+                .eqIfPresent(IotDeviceTemplateAttrsDO::getDeviceTemplateId, reqVO.getDeviceTemplateId())
+                .likeIfPresent(IotDeviceTemplateAttrsDO::getName, reqVO.getName())
+                .eqIfPresent(IotDeviceTemplateAttrsDO::getCode, reqVO.getCode())
+                .eqIfPresent(IotDeviceTemplateAttrsDO::getType, reqVO.getType())
+                .eqIfPresent(IotDeviceTemplateAttrsDO::getRequiredFlag, reqVO.getRequiredFlag())
+                .eqIfPresent(IotDeviceTemplateAttrsDO::getDefaultValue, reqVO.getDefaultValue())
+                .eqIfPresent(IotDeviceTemplateAttrsDO::getUnit, reqVO.getUnit())
+                .eqIfPresent(IotDeviceTemplateAttrsDO::getDescription, reqVO.getDescription())
+                .eqIfPresent(IotDeviceTemplateAttrsDO::getStatus, reqVO.getStatus())
+                .eqIfPresent(IotDeviceTemplateAttrsDO::getRemark, reqVO.getRemark())
+                .eqIfPresent(IotDeviceTemplateAttrsDO::getSort, reqVO.getSort())
+                .eqIfPresent(IotDeviceTemplateAttrsDO::getSelectOptions, reqVO.getSelectOptions())
+                .eqIfPresent(IotDeviceTemplateAttrsDO::getVersion, reqVO.getVersion())
+                .betweenIfPresent(IotDeviceTemplateAttrsDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(IotDeviceTemplateAttrsDO::getId));
+    }
+
+}

+ 38 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotmaterial/IotMaterialMapper.java

@@ -0,0 +1,38 @@
+package cn.iocoder.yudao.module.pms.dal.mysql.iotmaterial;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.pms.controller.admin.iotmaterial.vo.IotMaterialPageReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotmaterial.IotMaterialDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * PMS 功能优化 物料 Mapper
+ *
+ * @author 芋道源码
+ */
+@Mapper
+public interface IotMaterialMapper extends BaseMapperX<IotMaterialDO> {
+
+    default PageResult<IotMaterialDO> selectPage(IotMaterialPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<IotMaterialDO>()
+                .eqIfPresent(IotMaterialDO::getMaterialGroupId, reqVO.getMaterialGroupId())
+                .eqIfPresent(IotMaterialDO::getBomId, reqVO.getBomId())
+                .eqIfPresent(IotMaterialDO::getType, reqVO.getType())
+                .eqIfPresent(IotMaterialDO::getCode, reqVO.getCode())
+                .likeIfPresent(IotMaterialDO::getName, reqVO.getName())
+                .eqIfPresent(IotMaterialDO::getModel, reqVO.getModel())
+                .eqIfPresent(IotMaterialDO::getUnit, reqVO.getUnit())
+                .eqIfPresent(IotMaterialDO::getSapCode, reqVO.getSapCode())
+                .eqIfPresent(IotMaterialDO::getSyncStatus, reqVO.getSyncStatus())
+                .betweenIfPresent(IotMaterialDO::getSyncTime, reqVO.getSyncTime())
+                .eqIfPresent(IotMaterialDO::getSyncError, reqVO.getSyncError())
+                .eqIfPresent(IotMaterialDO::getSort, reqVO.getSort())
+                .eqIfPresent(IotMaterialDO::getStatus, reqVO.getStatus())
+                .eqIfPresent(IotMaterialDO::getRemark, reqVO.getRemark())
+                .betweenIfPresent(IotMaterialDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(IotMaterialDO::getId));
+    }
+
+}

+ 29 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotmaterialgroup/IotMaterialGroupMapper.java

@@ -0,0 +1,29 @@
+package cn.iocoder.yudao.module.pms.dal.mysql.iotmaterialgroup;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.pms.controller.admin.iotmaterialgroup.vo.IotMaterialGroupPageReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotmaterialgroup.IotMaterialGroupDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * PMS 功能优化 物料组 Mapper
+ *
+ * @author 芋道源码
+ */
+@Mapper
+public interface IotMaterialGroupMapper extends BaseMapperX<IotMaterialGroupDO> {
+
+    default PageResult<IotMaterialGroupDO> selectPage(IotMaterialGroupPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<IotMaterialGroupDO>()
+                .likeIfPresent(IotMaterialGroupDO::getName, reqVO.getName())
+                .eqIfPresent(IotMaterialGroupDO::getParentId, reqVO.getParentId())
+                .eqIfPresent(IotMaterialGroupDO::getSort, reqVO.getSort())
+                .eqIfPresent(IotMaterialGroupDO::getStatus, reqVO.getStatus())
+                .eqIfPresent(IotMaterialGroupDO::getRemark, reqVO.getRemark())
+                .betweenIfPresent(IotMaterialGroupDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(IotMaterialGroupDO::getId));
+    }
+
+}

+ 30 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotmodel/IotModelMapper.java

@@ -0,0 +1,30 @@
+package cn.iocoder.yudao.module.pms.dal.mysql.iotmodel;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.pms.controller.admin.iotmodel.vo.IotModelPageReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotmodel.IotModelDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * PMS 功能优化 规格型号 Mapper
+ *
+ * @author 芋道源码
+ */
+@Mapper
+public interface IotModelMapper extends BaseMapperX<IotModelDO> {
+
+    default PageResult<IotModelDO> selectPage(IotModelPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<IotModelDO>()
+                .likeIfPresent(IotModelDO::getName, reqVO.getName())
+                .eqIfPresent(IotModelDO::getBrand, reqVO.getBrand())
+                .eqIfPresent(IotModelDO::getStandard, reqVO.getStandard())
+                .eqIfPresent(IotModelDO::getSort, reqVO.getSort())
+                .eqIfPresent(IotModelDO::getStatus, reqVO.getStatus())
+                .eqIfPresent(IotModelDO::getRemark, reqVO.getRemark())
+                .betweenIfPresent(IotModelDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(IotModelDO::getId));
+    }
+
+}

+ 55 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotbom/IotBomService.java

@@ -0,0 +1,55 @@
+package cn.iocoder.yudao.module.pms.service.iotbom;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.pms.controller.admin.iotbom.vo.IotBomPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.iotbom.vo.IotBomSaveReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotbom.IotBomDO;
+
+import javax.validation.Valid;
+
+/**
+ * PMS BOM 关系 Service 接口
+ *
+ * @author 芋道源码
+ */
+public interface IotBomService {
+
+    /**
+     * 创建PMS BOM 关系
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createIotBom(@Valid IotBomSaveReqVO createReqVO);
+
+    /**
+     * 更新PMS BOM 关系
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateIotBom(@Valid IotBomSaveReqVO updateReqVO);
+
+    /**
+     * 删除PMS BOM 关系
+     *
+     * @param id 编号
+     */
+    void deleteIotBom(Long id);
+
+    /**
+     * 获得PMS BOM 关系
+     *
+     * @param id 编号
+     * @return PMS BOM 关系
+     */
+    IotBomDO getIotBom(Long id);
+
+    /**
+     * 获得PMS BOM 关系分页
+     *
+     * @param pageReqVO 分页查询
+     * @return PMS BOM 关系分页
+     */
+    PageResult<IotBomDO> getIotBomPage(IotBomPageReqVO pageReqVO);
+
+}

+ 71 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotbom/IotBomServiceImpl.java

@@ -0,0 +1,71 @@
+package cn.iocoder.yudao.module.pms.service.iotbom;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.pms.controller.admin.iotbom.vo.IotBomPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.iotbom.vo.IotBomSaveReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotbom.IotBomDO;
+import cn.iocoder.yudao.module.pms.dal.mysql.iotbom.IotBomMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import javax.annotation.Resource;
+
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant.IOT_BOM_NOT_EXISTS;
+
+/**
+ * PMS BOM 关系 Service 实现类
+ *
+ * @author 芋道源码
+ */
+@Service
+@Validated
+public class IotBomServiceImpl implements IotBomService {
+
+    @Resource
+    private IotBomMapper iotBomMapper;
+
+    @Override
+    public Long createIotBom(IotBomSaveReqVO createReqVO) {
+        // 插入
+        IotBomDO iotBom = BeanUtils.toBean(createReqVO, IotBomDO.class);
+        iotBomMapper.insert(iotBom);
+        // 返回
+        return iotBom.getId();
+    }
+
+    @Override
+    public void updateIotBom(IotBomSaveReqVO updateReqVO) {
+        // 校验存在
+        validateIotBomExists(updateReqVO.getId());
+        // 更新
+        IotBomDO updateObj = BeanUtils.toBean(updateReqVO, IotBomDO.class);
+        iotBomMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteIotBom(Long id) {
+        // 校验存在
+        validateIotBomExists(id);
+        // 删除
+        iotBomMapper.deleteById(id);
+    }
+
+    private void validateIotBomExists(Long id) {
+        if (iotBomMapper.selectById(id) == null) {
+            throw exception(IOT_BOM_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public IotBomDO getIotBom(Long id) {
+        return iotBomMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<IotBomDO> getIotBomPage(IotBomPageReqVO pageReqVO) {
+        return iotBomMapper.selectPage(pageReqVO);
+    }
+
+}

+ 55 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotdevicetemplate/IotDeviceTemplateService.java

@@ -0,0 +1,55 @@
+package cn.iocoder.yudao.module.pms.service.iotdevicetemplate;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplate.vo.IotDeviceTemplatePageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplate.vo.IotDeviceTemplateSaveReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicetemplate.IotDeviceTemplateDO;
+
+import javax.validation.Valid;
+
+/**
+ * PMS 功能优化 设备模板 Service 接口
+ *
+ * @author 芋道源码
+ */
+public interface IotDeviceTemplateService {
+
+    /**
+     * 创建PMS 功能优化 设备模板
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createIotDeviceTemplate(@Valid IotDeviceTemplateSaveReqVO createReqVO);
+
+    /**
+     * 更新PMS 功能优化 设备模板
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateIotDeviceTemplate(@Valid IotDeviceTemplateSaveReqVO updateReqVO);
+
+    /**
+     * 删除PMS 功能优化 设备模板
+     *
+     * @param id 编号
+     */
+    void deleteIotDeviceTemplate(Long id);
+
+    /**
+     * 获得PMS 功能优化 设备模板
+     *
+     * @param id 编号
+     * @return PMS 功能优化 设备模板
+     */
+    IotDeviceTemplateDO getIotDeviceTemplate(Long id);
+
+    /**
+     * 获得PMS 功能优化 设备模板分页
+     *
+     * @param pageReqVO 分页查询
+     * @return PMS 功能优化 设备模板分页
+     */
+    PageResult<IotDeviceTemplateDO> getIotDeviceTemplatePage(IotDeviceTemplatePageReqVO pageReqVO);
+
+}

+ 71 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotdevicetemplate/IotDeviceTemplateServiceImpl.java

@@ -0,0 +1,71 @@
+package cn.iocoder.yudao.module.pms.service.iotdevicetemplate;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplate.vo.IotDeviceTemplatePageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplate.vo.IotDeviceTemplateSaveReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicetemplate.IotDeviceTemplateDO;
+import cn.iocoder.yudao.module.pms.dal.mysql.iotdevicetemplate.IotDeviceTemplateMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import javax.annotation.Resource;
+
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant.IOT_DEVICE_TEMPLATE_NOT_EXISTS;
+
+/**
+ * PMS 功能优化 设备模板 Service 实现类
+ *
+ * @author 芋道源码
+ */
+@Service
+@Validated
+public class IotDeviceTemplateServiceImpl implements IotDeviceTemplateService {
+
+    @Resource
+    private IotDeviceTemplateMapper iotDeviceTemplateMapper;
+
+    @Override
+    public Long createIotDeviceTemplate(IotDeviceTemplateSaveReqVO createReqVO) {
+        // 插入
+        IotDeviceTemplateDO iotDeviceTemplate = BeanUtils.toBean(createReqVO, IotDeviceTemplateDO.class);
+        iotDeviceTemplateMapper.insert(iotDeviceTemplate);
+        // 返回
+        return iotDeviceTemplate.getId();
+    }
+
+    @Override
+    public void updateIotDeviceTemplate(IotDeviceTemplateSaveReqVO updateReqVO) {
+        // 校验存在
+        validateIotDeviceTemplateExists(updateReqVO.getId());
+        // 更新
+        IotDeviceTemplateDO updateObj = BeanUtils.toBean(updateReqVO, IotDeviceTemplateDO.class);
+        iotDeviceTemplateMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteIotDeviceTemplate(Long id) {
+        // 校验存在
+        validateIotDeviceTemplateExists(id);
+        // 删除
+        iotDeviceTemplateMapper.deleteById(id);
+    }
+
+    private void validateIotDeviceTemplateExists(Long id) {
+        if (iotDeviceTemplateMapper.selectById(id) == null) {
+            throw exception(IOT_DEVICE_TEMPLATE_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public IotDeviceTemplateDO getIotDeviceTemplate(Long id) {
+        return iotDeviceTemplateMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<IotDeviceTemplateDO> getIotDeviceTemplatePage(IotDeviceTemplatePageReqVO pageReqVO) {
+        return iotDeviceTemplateMapper.selectPage(pageReqVO);
+    }
+
+}

+ 55 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotdevicetemplateattrs/IotDeviceTemplateAttrsService.java

@@ -0,0 +1,55 @@
+package cn.iocoder.yudao.module.pms.service.iotdevicetemplateattrs;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplateattrs.vo.IotDeviceTemplateAttrsPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplateattrs.vo.IotDeviceTemplateAttrsSaveReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicetemplateattrs.IotDeviceTemplateAttrsDO;
+
+import javax.validation.Valid;
+
+/**
+ * PMS 功能优化 设备模板属性 Service 接口
+ *
+ * @author 芋道源码
+ */
+public interface IotDeviceTemplateAttrsService {
+
+    /**
+     * 创建PMS 功能优化 设备模板属性
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createIotDeviceTemplateAttrs(@Valid IotDeviceTemplateAttrsSaveReqVO createReqVO);
+
+    /**
+     * 更新PMS 功能优化 设备模板属性
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateIotDeviceTemplateAttrs(@Valid IotDeviceTemplateAttrsSaveReqVO updateReqVO);
+
+    /**
+     * 删除PMS 功能优化 设备模板属性
+     *
+     * @param id 编号
+     */
+    void deleteIotDeviceTemplateAttrs(Long id);
+
+    /**
+     * 获得PMS 功能优化 设备模板属性
+     *
+     * @param id 编号
+     * @return PMS 功能优化 设备模板属性
+     */
+    IotDeviceTemplateAttrsDO getIotDeviceTemplateAttrs(Long id);
+
+    /**
+     * 获得PMS 功能优化 设备模板属性分页
+     *
+     * @param pageReqVO 分页查询
+     * @return PMS 功能优化 设备模板属性分页
+     */
+    PageResult<IotDeviceTemplateAttrsDO> getIotDeviceTemplateAttrsPage(IotDeviceTemplateAttrsPageReqVO pageReqVO);
+
+}

+ 71 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotdevicetemplateattrs/IotDeviceTemplateAttrsServiceImpl.java

@@ -0,0 +1,71 @@
+package cn.iocoder.yudao.module.pms.service.iotdevicetemplateattrs;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplateattrs.vo.IotDeviceTemplateAttrsPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplateattrs.vo.IotDeviceTemplateAttrsSaveReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicetemplateattrs.IotDeviceTemplateAttrsDO;
+import cn.iocoder.yudao.module.pms.dal.mysql.iotdevicetemplateattrs.IotDeviceTemplateAttrsMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import javax.annotation.Resource;
+
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant.IOT_DEVICE_TEMPLATE_ATTRS_NOT_EXISTS;
+
+/**
+ * PMS 功能优化 设备模板属性 Service 实现类
+ *
+ * @author 芋道源码
+ */
+@Service
+@Validated
+public class IotDeviceTemplateAttrsServiceImpl implements IotDeviceTemplateAttrsService {
+
+    @Resource
+    private IotDeviceTemplateAttrsMapper iotDeviceTemplateAttrsMapper;
+
+    @Override
+    public Long createIotDeviceTemplateAttrs(IotDeviceTemplateAttrsSaveReqVO createReqVO) {
+        // 插入
+        IotDeviceTemplateAttrsDO iotDeviceTemplateAttrs = BeanUtils.toBean(createReqVO, IotDeviceTemplateAttrsDO.class);
+        iotDeviceTemplateAttrsMapper.insert(iotDeviceTemplateAttrs);
+        // 返回
+        return iotDeviceTemplateAttrs.getId();
+    }
+
+    @Override
+    public void updateIotDeviceTemplateAttrs(IotDeviceTemplateAttrsSaveReqVO updateReqVO) {
+        // 校验存在
+        validateIotDeviceTemplateAttrsExists(updateReqVO.getId());
+        // 更新
+        IotDeviceTemplateAttrsDO updateObj = BeanUtils.toBean(updateReqVO, IotDeviceTemplateAttrsDO.class);
+        iotDeviceTemplateAttrsMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteIotDeviceTemplateAttrs(Long id) {
+        // 校验存在
+        validateIotDeviceTemplateAttrsExists(id);
+        // 删除
+        iotDeviceTemplateAttrsMapper.deleteById(id);
+    }
+
+    private void validateIotDeviceTemplateAttrsExists(Long id) {
+        if (iotDeviceTemplateAttrsMapper.selectById(id) == null) {
+            throw exception(IOT_DEVICE_TEMPLATE_ATTRS_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public IotDeviceTemplateAttrsDO getIotDeviceTemplateAttrs(Long id) {
+        return iotDeviceTemplateAttrsMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<IotDeviceTemplateAttrsDO> getIotDeviceTemplateAttrsPage(IotDeviceTemplateAttrsPageReqVO pageReqVO) {
+        return iotDeviceTemplateAttrsMapper.selectPage(pageReqVO);
+    }
+
+}

+ 54 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotmaterial/IotMaterialService.java

@@ -0,0 +1,54 @@
+package cn.iocoder.yudao.module.pms.service.iotmaterial;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.pms.controller.admin.iotmaterial.vo.*;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotmaterial.IotMaterialDO;
+
+import javax.validation.Valid;
+
+/**
+ * PMS 功能优化 物料 Service 接口
+ *
+ * @author 芋道源码
+ */
+public interface IotMaterialService {
+
+    /**
+     * 创建PMS 功能优化 物料
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createIotMaterial(@Valid IotMaterialSaveReqVO createReqVO);
+
+    /**
+     * 更新PMS 功能优化 物料
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateIotMaterial(@Valid IotMaterialSaveReqVO updateReqVO);
+
+    /**
+     * 删除PMS 功能优化 物料
+     *
+     * @param id 编号
+     */
+    void deleteIotMaterial(Long id);
+
+    /**
+     * 获得PMS 功能优化 物料
+     *
+     * @param id 编号
+     * @return PMS 功能优化 物料
+     */
+    IotMaterialDO getIotMaterial(Long id);
+
+    /**
+     * 获得PMS 功能优化 物料分页
+     *
+     * @param pageReqVO 分页查询
+     * @return PMS 功能优化 物料分页
+     */
+    PageResult<IotMaterialDO> getIotMaterialPage(IotMaterialPageReqVO pageReqVO);
+
+}

+ 71 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotmaterial/IotMaterialServiceImpl.java

@@ -0,0 +1,71 @@
+package cn.iocoder.yudao.module.pms.service.iotmaterial;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.pms.controller.admin.iotmaterial.vo.*;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotmaterial.IotMaterialDO;
+import cn.iocoder.yudao.module.pms.dal.mysql.iotmaterial.IotMaterialMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import javax.annotation.Resource;
+
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant.IOT_MATERIAL_NOT_EXISTS;
+
+
+/**
+ * PMS 功能优化 物料 Service 实现类
+ *
+ * @author 芋道源码
+ */
+@Service
+@Validated
+public class IotMaterialServiceImpl implements IotMaterialService {
+
+    @Resource
+    private IotMaterialMapper iotMaterialMapper;
+
+    @Override
+    public Long createIotMaterial(IotMaterialSaveReqVO createReqVO) {
+        // 插入
+        IotMaterialDO iotMaterial = BeanUtils.toBean(createReqVO, IotMaterialDO.class);
+        iotMaterialMapper.insert(iotMaterial);
+        // 返回
+        return iotMaterial.getId();
+    }
+
+    @Override
+    public void updateIotMaterial(IotMaterialSaveReqVO updateReqVO) {
+        // 校验存在
+        validateIotMaterialExists(updateReqVO.getId());
+        // 更新
+        IotMaterialDO updateObj = BeanUtils.toBean(updateReqVO, IotMaterialDO.class);
+        iotMaterialMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteIotMaterial(Long id) {
+        // 校验存在
+        validateIotMaterialExists(id);
+        // 删除
+        iotMaterialMapper.deleteById(id);
+    }
+
+    private void validateIotMaterialExists(Long id) {
+        if (iotMaterialMapper.selectById(id) == null) {
+            throw exception(IOT_MATERIAL_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public IotMaterialDO getIotMaterial(Long id) {
+        return iotMaterialMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<IotMaterialDO> getIotMaterialPage(IotMaterialPageReqVO pageReqVO) {
+        return iotMaterialMapper.selectPage(pageReqVO);
+    }
+
+}

+ 55 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotmaterialgroup/IotMaterialGroupService.java

@@ -0,0 +1,55 @@
+package cn.iocoder.yudao.module.pms.service.iotmaterialgroup;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.pms.controller.admin.iotmaterialgroup.vo.IotMaterialGroupPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.iotmaterialgroup.vo.IotMaterialGroupSaveReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotmaterialgroup.IotMaterialGroupDO;
+
+import javax.validation.Valid;
+
+/**
+ * PMS 功能优化 物料组 Service 接口
+ *
+ * @author 芋道源码
+ */
+public interface IotMaterialGroupService {
+
+    /**
+     * 创建PMS 功能优化 物料组
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createIotMaterialGroup(@Valid IotMaterialGroupSaveReqVO createReqVO);
+
+    /**
+     * 更新PMS 功能优化 物料组
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateIotMaterialGroup(@Valid IotMaterialGroupSaveReqVO updateReqVO);
+
+    /**
+     * 删除PMS 功能优化 物料组
+     *
+     * @param id 编号
+     */
+    void deleteIotMaterialGroup(Long id);
+
+    /**
+     * 获得PMS 功能优化 物料组
+     *
+     * @param id 编号
+     * @return PMS 功能优化 物料组
+     */
+    IotMaterialGroupDO getIotMaterialGroup(Long id);
+
+    /**
+     * 获得PMS 功能优化 物料组分页
+     *
+     * @param pageReqVO 分页查询
+     * @return PMS 功能优化 物料组分页
+     */
+    PageResult<IotMaterialGroupDO> getIotMaterialGroupPage(IotMaterialGroupPageReqVO pageReqVO);
+
+}

+ 72 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotmaterialgroup/IotMaterialGroupServiceImpl.java

@@ -0,0 +1,72 @@
+package cn.iocoder.yudao.module.pms.service.iotmaterialgroup;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.pms.controller.admin.iotmaterialgroup.vo.IotMaterialGroupPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.iotmaterialgroup.vo.IotMaterialGroupSaveReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotmaterialgroup.IotMaterialGroupDO;
+import cn.iocoder.yudao.module.pms.dal.mysql.iotmaterialgroup.IotMaterialGroupMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import javax.annotation.Resource;
+
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant.IOT_MATERIAL_GROUP_NOT_EXISTS;
+
+
+/**
+ * PMS 功能优化 物料组 Service 实现类
+ *
+ * @author 芋道源码
+ */
+@Service
+@Validated
+public class IotMaterialGroupServiceImpl implements IotMaterialGroupService {
+
+    @Resource
+    private IotMaterialGroupMapper iotMaterialGroupMapper;
+
+    @Override
+    public Long createIotMaterialGroup(IotMaterialGroupSaveReqVO createReqVO) {
+        // 插入
+        IotMaterialGroupDO iotMaterialGroup = BeanUtils.toBean(createReqVO, IotMaterialGroupDO.class);
+        iotMaterialGroupMapper.insert(iotMaterialGroup);
+        // 返回
+        return iotMaterialGroup.getId();
+    }
+
+    @Override
+    public void updateIotMaterialGroup(IotMaterialGroupSaveReqVO updateReqVO) {
+        // 校验存在
+        validateIotMaterialGroupExists(updateReqVO.getId());
+        // 更新
+        IotMaterialGroupDO updateObj = BeanUtils.toBean(updateReqVO, IotMaterialGroupDO.class);
+        iotMaterialGroupMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteIotMaterialGroup(Long id) {
+        // 校验存在
+        validateIotMaterialGroupExists(id);
+        // 删除
+        iotMaterialGroupMapper.deleteById(id);
+    }
+
+    private void validateIotMaterialGroupExists(Long id) {
+        if (iotMaterialGroupMapper.selectById(id) == null) {
+            throw exception(IOT_MATERIAL_GROUP_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public IotMaterialGroupDO getIotMaterialGroup(Long id) {
+        return iotMaterialGroupMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<IotMaterialGroupDO> getIotMaterialGroupPage(IotMaterialGroupPageReqVO pageReqVO) {
+        return iotMaterialGroupMapper.selectPage(pageReqVO);
+    }
+
+}

+ 55 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotmodel/IotModelService.java

@@ -0,0 +1,55 @@
+package cn.iocoder.yudao.module.pms.service.iotmodel;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.pms.controller.admin.iotmodel.vo.IotModelPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.iotmodel.vo.IotModelSaveReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotmodel.IotModelDO;
+
+import javax.validation.Valid;
+
+/**
+ * PMS 功能优化 规格型号 Service 接口
+ *
+ * @author 芋道源码
+ */
+public interface IotModelService {
+
+    /**
+     * 创建PMS 功能优化 规格型号
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createIotModel(@Valid IotModelSaveReqVO createReqVO);
+
+    /**
+     * 更新PMS 功能优化 规格型号
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateIotModel(@Valid IotModelSaveReqVO updateReqVO);
+
+    /**
+     * 删除PMS 功能优化 规格型号
+     *
+     * @param id 编号
+     */
+    void deleteIotModel(Long id);
+
+    /**
+     * 获得PMS 功能优化 规格型号
+     *
+     * @param id 编号
+     * @return PMS 功能优化 规格型号
+     */
+    IotModelDO getIotModel(Long id);
+
+    /**
+     * 获得PMS 功能优化 规格型号分页
+     *
+     * @param pageReqVO 分页查询
+     * @return PMS 功能优化 规格型号分页
+     */
+    PageResult<IotModelDO> getIotModelPage(IotModelPageReqVO pageReqVO);
+
+}

+ 72 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotmodel/IotModelServiceImpl.java

@@ -0,0 +1,72 @@
+package cn.iocoder.yudao.module.pms.service.iotmodel;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.pms.controller.admin.iotmodel.vo.IotModelPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.iotmodel.vo.IotModelSaveReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotmodel.IotModelDO;
+import cn.iocoder.yudao.module.pms.dal.mysql.iotmodel.IotModelMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import javax.annotation.Resource;
+
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant.IOT_MODEL_NOT_EXISTS;
+
+
+/**
+ * PMS 功能优化 规格型号 Service 实现类
+ *
+ * @author 芋道源码
+ */
+@Service
+@Validated
+public class IotModelServiceImpl implements IotModelService {
+
+    @Resource
+    private IotModelMapper iotModelMapper;
+
+    @Override
+    public Long createIotModel(IotModelSaveReqVO createReqVO) {
+        // 插入
+        IotModelDO iotModel = BeanUtils.toBean(createReqVO, IotModelDO.class);
+        iotModelMapper.insert(iotModel);
+        // 返回
+        return iotModel.getId();
+    }
+
+    @Override
+    public void updateIotModel(IotModelSaveReqVO updateReqVO) {
+        // 校验存在
+        validateIotModelExists(updateReqVO.getId());
+        // 更新
+        IotModelDO updateObj = BeanUtils.toBean(updateReqVO, IotModelDO.class);
+        iotModelMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteIotModel(Long id) {
+        // 校验存在
+        validateIotModelExists(id);
+        // 删除
+        iotModelMapper.deleteById(id);
+    }
+
+    private void validateIotModelExists(Long id) {
+        if (iotModelMapper.selectById(id) == null) {
+            throw exception(IOT_MODEL_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public IotModelDO getIotModel(Long id) {
+        return iotModelMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<IotModelDO> getIotModelPage(IotModelPageReqVO pageReqVO) {
+        return iotModelMapper.selectPage(pageReqVO);
+    }
+
+}