platformx-boot/pom.xml
@@ -20,11 +20,11 @@ <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.by4cloud</groupId> <artifactId>platformx-demo</artifactId> <artifactId>platformx-device</artifactId> <version>5.5.0</version> </parent> <artifactId>demo-boot</artifactId> <artifactId>device-boot</artifactId> <packaging>jar</packaging> <description>demo 单体版本启动</description> @@ -39,7 +39,7 @@ <!--必备:用户管理模块--> <dependency> <groupId>com.by4cloud</groupId> <artifactId>platformx-demo-biz</artifactId> <artifactId>platformx-device-biz</artifactId> <version>${project.version}</version> </dependency> <!--安全模块--> platformx-boot/src/main/java/com/by4cloud/platformx/PlatformxBootApplication.java
@@ -24,7 +24,7 @@ /** * @author platformx 单体版本启动器,只需要运行此模块则整个系统启动 */ @EnableOpenApi(value = "demo", isMicro = false) @EnableOpenApi(value = "device", isMicro = false) @EnablePlatformxResourceServer @SpringBootApplication public class PlatformxBootApplication { platformx-boot/src/main/resources/application-dev.yml
@@ -9,8 +9,8 @@ druid: driver-class-name: com.mysql.cj.jdbc.Driver username: root password: root url: jdbc:mysql://platformx-mysql:3306/online_course?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true password: rootroot url: jdbc:mysql://platformx-mysql:3306/platformxx_device?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true jpa: # 自动生成表结构 hibernate: platformx-boot/src/main/resources/application.yml
@@ -1,7 +1,7 @@ server: port: 8888 # 项目端口 servlet: context-path: /admin # 项目访问路径 context-path: /device # 项目访问路径 spring: application: @@ -23,6 +23,8 @@ allow-bean-definition-overriding: true # 允许覆盖bean定义 profiles: active: dev # 激活dev,对应 application-dev.yml redis: database: 5 ## spring security 对外暴露接口设置(不鉴权直接可访问) platformx-demo-api/src/main/java/com/by4cloud/platformx/demo/constant/packge-info.java
File was deleted platformx-demo-api/src/main/java/com/by4cloud/platformx/demo/entity/packge-info.java
File was deleted platformx-demo-biz/src/main/java/com/by4cloud/platformx/demo/controller/packge-info.java
File was deleted platformx-demo-biz/src/main/java/com/by4cloud/platformx/demo/service/packge-info.java
File was deleted platformx-device-api/pom.xml
File was renamed from platformx-demo-api/pom.xml @@ -6,11 +6,11 @@ <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.by4cloud</groupId> <artifactId>platformx-demo</artifactId> <artifactId>platformx-device</artifactId> <version>5.5.0</version> </parent> <artifactId>platformx-demo-api</artifactId> <artifactId>platformx-device-api</artifactId> <dependencies> <!-- 连表查询注解 --> platformx-device-api/src/main/java/com/by4cloud/platformx/device/api/feign/packge-info.java
File was renamed from platformx-demo-api/src/main/java/com/by4cloud/platformx/demo/api/feign/packge-info.java @@ -3,4 +3,4 @@ * <p> * feign client 存放目录,注意 @EnablePlatformxFeignClients 的扫描范围 */ package com.by4cloud.platformx.demo.api.feign; package com.by4cloud.platformx.device.api.feign; platformx-device-api/src/main/java/com/by4cloud/platformx/device/constant/packge-info.java
New file @@ -0,0 +1,6 @@ /* * @author platformx archetype * <p> * 常量和枚举定义 */ package com.by4cloud.platformx.device.constant; platformx-device-api/src/main/java/com/by4cloud/platformx/device/dto/packge-info.java
File was renamed from platformx-demo-api/src/main/java/com/by4cloud/platformx/demo/dto/packge-info.java @@ -3,4 +3,4 @@ * <p> * DTO 存放目录 */ package com.by4cloud.platformx.demo.dto; package com.by4cloud.platformx.device.dto; platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/Demo.java
File was renamed from platformx-demo-api/src/main/java/com/by4cloud/platformx/demo/entity/Demo.java @@ -1,4 +1,4 @@ package com.by4cloud.platformx.demo.entity; package com.by4cloud.platformx.device.entity; import com.baomidou.mybatisplus.annotation.TableField; import com.by4cloud.platformx.common.data.mybatis.BaseModel; @@ -17,9 +17,9 @@ * @author xfei * @date 2023/2/1 11:19 */ @Data @Entity @Table(appliesTo = "demo", comment = "demo") //@Data //@Entity //@Table(appliesTo = "demo", comment = "demo") public class Demo extends BaseModel<Demo> { @Schema(description = "姓名") @Column(columnDefinition="VARCHAR(64) comment '姓名'") platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/Device.java
New file @@ -0,0 +1,78 @@ package com.by4cloud.platformx.device.entity; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.hibernate.annotations.Table; import org.springframework.format.annotation.DateTimeFormat; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Transient; import java.util.Date; /** * @author kdq * @version 1.0.0 * @ClassName Device.java * @Description TODO * @createTime 2025年03月04日 14:32:00 */ @Data @Entity @TableName("device") @javax.persistence.Table(name = "device") @Table(appliesTo = "device", comment = "出租设备清单表") public class Device extends DeviceBaseModel<Device>{ @Schema(description = "分类ID") @Column(columnDefinition="long comment '分类ID'") private Long classId; @Schema(description = "设备编码") @Column(columnDefinition="VARCHAR(64) comment '设备编码'") private String number; @Schema(description = "采购提前期") @Column(columnDefinition="int comment '采购提前期'") private Integer beforeDate; @Schema(description = "折旧年限") @Column(columnDefinition="int comment '折旧年限'") private Integer depreciation; @Schema(description = "提醒提前日") @Column(columnDefinition="int comment '提醒提前日'") private Integer remindDate; @Schema(description = "制造厂商") @Column(columnDefinition="VARCHAR(64) comment '制造厂商'") private String manu; @Schema(description = "发布人") @Column(columnDefinition="VARCHAR(64) comment '发布人'") private String releasePerson; @Schema(description = "申请人") @Column(columnDefinition="VARCHAR(64) comment '申请人'") private String reqPerson; @Schema(description = "申请单位") @Column(columnDefinition="long comment '申请单位'") private Long reqCompId; @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") @Schema(description = "申请时间") @Column(columnDefinition = "datetime comment '申请时间'") private Date reqDate; @Schema(description = "申请状态 0申请中,1通过,2拒绝") @Column(columnDefinition="int comment '申请状态'") private Integer reqStatus; @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") @Schema(description = "发布时间") @Column(columnDefinition = "datetime comment '发布时间'") private Date releaseDate; @Schema(description = "库存数") @Column(columnDefinition="int comment '库存数'") private Integer num; @Transient @TableField(exist = false) private String reqCompName; } platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceBaseModel.java
New file @@ -0,0 +1,321 @@ package com.by4cloud.platformx.device.entity; import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.extension.activerecord.Model; import com.by4cloud.platformx.common.data.mybatis.BaseModel; import io.swagger.v3.oas.annotations.media.Schema; import javax.persistence.Column; import javax.persistence.Id; import javax.persistence.MappedSuperclass; import java.time.LocalDateTime; /** * @author kdq * @version 1.0.0 * @ClassName DeviceBaseModel.java * @Description TODO * @createTime 2025年03月04日 13:58:00 */ @MappedSuperclass public class DeviceBaseModel<T extends Model<?>> extends Model<T> { @Id @TableId( value = "id", type = IdType.ASSIGN_ID ) private Long id; @Schema( description = "申请人" ) @TableField( fill = FieldFill.INSERT ) @Column( columnDefinition = "varchar(50) comment '申请人'" ) private String createBy; @Column( columnDefinition = "varchar(50) comment '修改人'" ) @Schema( description = "修改人" ) @TableField( fill = FieldFill.UPDATE ) private String updateBy; @Schema( description = "提交时间" ) @TableField( fill = FieldFill.INSERT ) @Column( columnDefinition = "datetime(6) comment '提交时间'" ) private LocalDateTime createTime; @Schema( description = "修改时间" ) @TableField( fill = FieldFill.UPDATE ) @Column( columnDefinition = "datetime(6) comment '修改时间'" ) private LocalDateTime updateTime; @Schema( description = "删除标记 0/正常 1/删除" ) @TableLogic @Column( length = 2, columnDefinition = "char(1) default '0'" ) private String delFlag = "0"; @Column( columnDefinition = "varchar(100) comment '名称'" ) private String name; @Column( columnDefinition = "varchar(200) comment '规格型号'" ) private String specification; @Column( columnDefinition = "int comment '到货月份'" ) private Integer month; @Column( columnDefinition = "int comment '数量'" ) private Integer num; @Column( columnDefinition = "varchar(20) comment '单位'" ) private String unit; @Column( columnDefinition = "double(10,2) comment '单价'" ) private Double price; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSpecification() { return specification; } public void setSpecification(String specification) { this.specification = specification; } public Integer getMonth() { return month; } public void setMonth(Integer month) { this.month = month; } public Integer getNum() { return num; } public void setNum(Integer num) { this.num = num; } public String getUnit() { return unit; } public void setUnit(String unit) { this.unit = unit; } public Double getPrice() { return price; } public void setPrice(Double price) { this.price = price; } public Double getAmount() { return amount; } public void setAmount(Double amount) { this.amount = amount; } @Column( columnDefinition = "double(10,2) comment '计划总额'" ) private Double amount; public DeviceBaseModel() { } public Long getId() { return this.id; } public String getCreateBy() { return this.createBy; } public String getUpdateBy() { return this.updateBy; } public LocalDateTime getCreateTime() { return this.createTime; } public LocalDateTime getUpdateTime() { return this.updateTime; } public String getDelFlag() { return this.delFlag; } public void setId(final Long id) { this.id = id; } public void setCreateBy(final String createBy) { this.createBy = createBy; } public void setUpdateBy(final String updateBy) { this.updateBy = updateBy; } public void setCreateTime(final LocalDateTime createTime) { this.createTime = createTime; } public void setUpdateTime(final LocalDateTime updateTime) { this.updateTime = updateTime; } public void setDelFlag(final String delFlag) { this.delFlag = delFlag; } public boolean equals(final Object o) { if (o == this) { return true; } else if (!(o instanceof DeviceBaseModel)) { return false; } else { DeviceBaseModel<?> other = (DeviceBaseModel)o; if (!other.canEqual(this)) { return false; } else { Object this$id = this.getId(); Object other$id = other.getId(); if (this$id == null) { if (other$id != null) { return false; } } else if (!this$id.equals(other$id)) { return false; } Object this$createBy = this.getCreateBy(); Object other$createBy = other.getCreateBy(); if (this$createBy == null) { if (other$createBy != null) { return false; } } else if (!this$createBy.equals(other$createBy)) { return false; } Object this$updateBy = this.getUpdateBy(); Object other$updateBy = other.getUpdateBy(); if (this$updateBy == null) { if (other$updateBy != null) { return false; } } else if (!this$updateBy.equals(other$updateBy)) { return false; } label62: { Object this$createTime = this.getCreateTime(); Object other$createTime = other.getCreateTime(); if (this$createTime == null) { if (other$createTime == null) { break label62; } } else if (this$createTime.equals(other$createTime)) { break label62; } return false; } label55: { Object this$updateTime = this.getUpdateTime(); Object other$updateTime = other.getUpdateTime(); if (this$updateTime == null) { if (other$updateTime == null) { break label55; } } else if (this$updateTime.equals(other$updateTime)) { break label55; } return false; } Object this$delFlag = this.getDelFlag(); Object other$delFlag = other.getDelFlag(); if (this$delFlag == null) { if (other$delFlag != null) { return false; } } else if (!this$delFlag.equals(other$delFlag)) { return false; } return true; } } } protected boolean canEqual(final Object other) { return other instanceof DeviceBaseModel; } public int hashCode() { int result = 1; Object $id = this.getId(); result = result * 59 + ($id == null ? 43 : $id.hashCode()); Object $createBy = this.getCreateBy(); result = result * 59 + ($createBy == null ? 43 : $createBy.hashCode()); Object $updateBy = this.getUpdateBy(); result = result * 59 + ($updateBy == null ? 43 : $updateBy.hashCode()); Object $createTime = this.getCreateTime(); result = result * 59 + ($createTime == null ? 43 : $createTime.hashCode()); Object $updateTime = this.getUpdateTime(); result = result * 59 + ($updateTime == null ? 43 : $updateTime.hashCode()); Object $delFlag = this.getDelFlag(); result = result * 59 + ($delFlag == null ? 43 : $delFlag.hashCode()); return result; } public String toString() { return "DeviceBaseModel(id=" + this.getId() + ", createBy=" + this.getCreateBy() + ", updateBy=" + this.getUpdateBy() + ", createTime=" + this.getCreateTime() + ", updateTime=" + this.getUpdateTime() + ", delFlag=" + this.getDelFlag() + ")"; } } platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceClass.java
New file @@ -0,0 +1,61 @@ package com.by4cloud.platformx.device.entity; import com.baomidou.mybatisplus.annotation.TableField; import com.by4cloud.platformx.common.data.mybatis.BaseModel; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.hibernate.annotations.Table; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Transient; import javax.validation.constraints.NotNull; /** * @author kdq * @version 1.0.0 * @ClassName DeviceClass.java * @Description TODO * @createTime 2025年03月04日 13:52:00 */ @Data @Entity @Table(appliesTo = "device_class", comment = "设备分类表") public class DeviceClass extends BaseModel<DeviceClass> { @Schema(description = "分类编码") @Column(columnDefinition="VARCHAR(64) comment '分类编码'") private String number; @Schema(description = "分类名称") @Column(columnDefinition="VARCHAR(64) comment '分类名称'") private String name; @Schema(description = "父级ID") @Column(columnDefinition="long comment '父级ID'") private Long pId; @Schema(description = "父级编码") @Column(columnDefinition="VARCHAR(64) comment '父级编码'") private String pNum; @Schema(description = "备注说明") @Column(columnDefinition="VARCHAR(100) comment '备注说明'") private String remark; @Schema(description = "采购提前期") @Column(columnDefinition="int comment '采购提前期'") private Integer beforeDate; @Schema(description = "折旧年限") @Column(columnDefinition="int comment '折旧年限'") private Integer depreciation; @NotNull(message = "排序值不能为空") @Schema(description = "排序值") private Integer sortOrder; @Transient @TableField(exist = false) private Integer parentId; } platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceDemandPlan.java
New file @@ -0,0 +1,64 @@ package com.by4cloud.platformx.device.entity; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.hibernate.annotations.Table; import org.springframework.format.annotation.DateTimeFormat; import javax.persistence.Column; import javax.persistence.Entity; import java.util.Date; /** * @author kdq * @version 1.0.0 * @ClassName DeviceDemandPlan.java * @Description TODO * @createTime 2025年03月04日 14:38:00 */ @Data @Entity @Table(appliesTo = "device_demand_plan", comment = "设备需求计划主表") public class DeviceDemandPlan extends DeviceBaseModel<DeviceDemandPlan>{ @Schema(description = "设备编码") @Column(columnDefinition="VARCHAR(64) comment '设备编码'") private String number; @Schema(description = "年度") @Column(columnDefinition="int comment '年度'") private Integer year; @Schema(description = "联系人") @Column(columnDefinition="VARCHAR(64) comment '联系人'") private String contacts; @Schema(description = "申报状态") @Column(columnDefinition="int comment '申报状态'") private Integer status; @Schema(description = "申报类型") @Column(columnDefinition="int comment '申报类型'") private Integer type; @Schema(description = "申报公司id") @Column(columnDefinition="int comment '申报公司id'") private Integer declareCompId; @Schema(description = "申报公司") @Column(columnDefinition="VARCHAR(64) comment '申报公司'") private String declareCompName; @Schema(description = "填报公司id") @Column(columnDefinition="int comment '填报公司id'") private Integer releaseCompId; @Schema(description = "填报公司") @Column(columnDefinition="VARCHAR(64) comment '填报公司'") private String releaseCompName; @Schema(description = "填报人") @Column(columnDefinition="VARCHAR(64) comment '填报人'") private String releasePerson; @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") @Schema(description = "填报时间") @Column(columnDefinition = "datetime comment '填报时间'") private Date releaseDate; @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") @Schema(description = "上报时间") @Column(columnDefinition = "datetime comment '上报时间'") private Date sendDate; } platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceDemandSub.java
New file @@ -0,0 +1,46 @@ package com.by4cloud.platformx.device.entity; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.hibernate.annotations.Table; import javax.persistence.Column; import javax.persistence.Entity; /** * @author kdq * @version 1.0.0 * @ClassName DeviceDemandSub.java * @Description TODO * @createTime 2025年03月04日 15:03:00 */ @Data @Entity @Table(appliesTo = "device_demand_sub", comment = "设备需求计划设备子表") public class DeviceDemandSub extends DeviceBaseModel<DeviceDemandSub>{ @Schema(description = "项目表id") @Column(columnDefinition="int comment '项目表id'") private Integer totalId; @Schema(description = "设备编码") @Column(columnDefinition="VARCHAR(64) comment '设备编码'") private String number; @Schema(description = "拟使用地点") @Column(columnDefinition="VARCHAR(64) comment '拟使用地点'") private String place; @Schema(description = "使用公司") @Column(columnDefinition="int comment '使用公司'") private Integer compId; @Schema(description = "申请部门") @Column(columnDefinition="int comment '申请部门'") private Integer deptId; @Schema(description = "建议厂家") @Column(columnDefinition="VARCHAR(64) comment '建议厂家'") private String manu; @Schema(description = "投资必要性") @Column(columnDefinition="VARCHAR(64) comment '投资必要性'") private String necessity; @Schema(description = "增减计划") @Column(columnDefinition="int comment '增减计划'") private Integer flucPlan; } platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceDemandTotal.java
New file @@ -0,0 +1,39 @@ package com.by4cloud.platformx.device.entity; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.hibernate.annotations.Table; import javax.persistence.Column; import javax.persistence.Entity; /** * @author kdq * @version 1.0.0 * @ClassName DeviceDemandTotal.java * @Description TODO * @createTime 2025年03月04日 14:56:00 */ @Data @Entity @Table(appliesTo = "device_demand_total", comment = "设备需求计划项目子表") public class DeviceDemandTotal extends DeviceBaseModel<DeviceDemandTotal>{ @Schema(description = "需求计划id") @Column(columnDefinition="int comment '需求计划id'") private Integer planId; @Schema(description = "拟使用地点") @Column(columnDefinition="VARCHAR(64) comment '拟使用地点'") private String place; @Schema(description = "使用公司") @Column(columnDefinition="int comment '使用公司'") private Integer compId; @Schema(description = "申请部门") @Column(columnDefinition="int comment '申请部门'") private Integer deptId; @Schema(description = "建议厂家") @Column(columnDefinition="VARCHAR(64) comment '建议厂家'") private String manu; @Schema(description = "投资必要性") @Column(columnDefinition="VARCHAR(64) comment '投资必要性'") private String necessity; } platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/packge-info.java
New file @@ -0,0 +1,6 @@ /* * @author platformx archetype * <p> * 实体 存放目录 */ package com.by4cloud.platformx.device.entity; platformx-device-biz/pom.xml
File was renamed from platformx-demo-biz/pom.xml @@ -6,11 +6,11 @@ <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.by4cloud</groupId> <artifactId>platformx-demo</artifactId> <artifactId>platformx-device</artifactId> <version>5.5.0</version> </parent> <artifactId>platformx-demo-biz</artifactId> <artifactId>platformx-device-biz</artifactId> <dependencies> <!--必备: undertow容器--> @@ -61,7 +61,7 @@ <!--必备: 依赖api模块--> <dependency> <groupId>com.by4cloud</groupId> <artifactId>platformx-demo-api</artifactId> <artifactId>platformx-device-api</artifactId> <version>5.5.0</version> </dependency> <!--必备: log 依赖--> platformx-device-biz/src/main/java/com/by4cloud/platformx/device/App.java
File was renamed from platformx-demo-biz/src/main/java/com/by4cloud/platformx/demo/App.java @@ -1,4 +1,4 @@ package com.by4cloud.platformx.demo; package com.by4cloud.platformx.device; import com.by4cloud.platformx.common.feign.annotation.EnablePlatformxFeignClients; import com.by4cloud.platformx.common.security.annotation.EnablePlatformxResourceServer; @@ -12,7 +12,7 @@ * <p> * 项目启动类 */ @EnableOpenApi("platformx-demo") @EnableOpenApi("platformx-device") @EnablePlatformxFeignClients @EnableDiscoveryClient @EnablePlatformxResourceServer platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceClassController.java
New file @@ -0,0 +1,149 @@ package com.by4cloud.platformx.device.controller; import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.by4cloud.platformx.common.core.util.R; import com.by4cloud.platformx.common.log.annotation.SysLog; import com.by4cloud.platformx.device.entity.DeviceClass; import com.by4cloud.platformx.device.service.DeviceClassService; import org.springframework.security.access.prepost.PreAuthorize; import com.by4cloud.platformx.common.excel.annotation.ResponseExcel; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import org.springdoc.api.annotations.ParameterObject; import org.springframework.http.HttpHeaders; import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; import java.util.List; import java.util.Objects; /** * 设备分类表 * * @author pig * @date 2025-03-05 10:46:29 */ @RestController @RequiredArgsConstructor @RequestMapping("/deviceClass" ) @Tag(description = "deviceClass" , name = "设备分类表管理" ) @SecurityRequirement(name = HttpHeaders.AUTHORIZATION) public class DeviceClassController { private final DeviceClassService deviceClassService; /** * 分页查询 * @param page 分页对象 * @param deviceClass 设备分类表 * @return */ @Operation(summary = "分页查询" , description = "分页查询" ) @GetMapping("/page" ) @PreAuthorize("@pms.hasPermission('platformx_deviceClass_view')" ) public R getDeviceClassPage(@ParameterObject Page page, @ParameterObject DeviceClass deviceClass) { LambdaQueryWrapper<DeviceClass> wrapper = Wrappers.lambdaQuery(); wrapper.eq(StrUtil.isNotBlank(deviceClass.getName()),DeviceClass::getName,deviceClass.getName()); wrapper.eq(StrUtil.isNotBlank(deviceClass.getNumber()),DeviceClass::getNumber,deviceClass.getNumber()); return R.ok(deviceClassService.page(page, wrapper)); } // /** // * 返回树形菜单集合 // * @return 树形菜单 // */ // @GetMapping(value = "/tree") // public R getTree(String name, Long parentId) { // return R.ok(deviceClassService.selectTree(name,parentId)); // } /** * 返回树形菜单集合 * @return 树形菜单 */ @GetMapping(value = "/tree") public R getTree() { return R.ok(deviceClassService.selectTree()); } /** * 通过id查询设备分类表 * @param id id * @return R */ @Operation(summary = "通过id查询" , description = "通过id查询" ) @GetMapping("/{id}" ) public R getById(@PathVariable("id" ) Long id) { DeviceClass byId = deviceClassService.getById(id); byId.setParentId(byId.getPId().intValue()); return R.ok(byId); } /** * 新增设备分类表 * @param deviceClass 设备分类表 * @return R */ @Operation(summary = "新增设备分类表" , description = "新增设备分类表" ) @SysLog("新增设备分类表" ) @PostMapping public R save(@RequestBody DeviceClass deviceClass) { if(deviceClass.getParentId()==null){ return R.failed("上级分类未选择!"); } deviceClass.setPId(deviceClass.getParentId().longValue()); return R.ok(deviceClassService.save(deviceClass)); } /** * 修改设备分类表 * @param deviceClass 设备分类表 * @return R */ @Operation(summary = "修改设备分类表" , description = "修改设备分类表" ) @SysLog("修改设备分类表" ) @PutMapping @PreAuthorize("@pms.hasPermission('platformx_deviceClass_edit')" ) public R updateById(@RequestBody DeviceClass deviceClass) { if(deviceClass.getParentId()==null){ return R.failed("上级分类未选择!"); } deviceClass.setPId(deviceClass.getParentId().longValue()); return R.ok(deviceClassService.updateById(deviceClass)); } /** * 通过id删除设备分类表 * @param ids id列表 * @return R */ @Operation(summary = "通过id删除设备分类表" , description = "通过id删除设备分类表" ) @SysLog("通过id删除设备分类表" ) @DeleteMapping @PreAuthorize("@pms.hasPermission('platformx_deviceClass_del')" ) public R removeById(@RequestBody Long[] ids) { return R.ok(deviceClassService.removeBatchByIds(CollUtil.toList(ids))); } /** * 导出excel 表格 * @param deviceClass 查询条件 * @param ids 导出指定ID * @return excel 文件流 */ @ResponseExcel @GetMapping("/export") @PreAuthorize("@pms.hasPermission('platformx_deviceClass_export')" ) public List<DeviceClass> export(DeviceClass deviceClass,Long[] ids) { return deviceClassService.list(Wrappers.lambdaQuery(deviceClass).in(ArrayUtil.isNotEmpty(ids), DeviceClass::getId, ids)); } } platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceController.java
New file @@ -0,0 +1,166 @@ package com.by4cloud.platformx.device.controller; import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.by4cloud.platformx.common.core.util.R; import com.by4cloud.platformx.common.log.annotation.SysLog; import com.by4cloud.platformx.device.entity.Device; import com.by4cloud.platformx.device.service.DeviceService; import org.springframework.security.access.prepost.PreAuthorize; import com.by4cloud.platformx.common.excel.annotation.ResponseExcel; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import org.springdoc.api.annotations.ParameterObject; import org.springframework.http.HttpHeaders; import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; import java.util.List; import java.util.Objects; /** * 出租设备清单表 * * @author pig * @date 2025-03-05 14:26:14 */ @RestController @RequiredArgsConstructor @RequestMapping("/device" ) @Tag(description = "device" , name = "出租设备清单表管理" ) @SecurityRequirement(name = HttpHeaders.AUTHORIZATION) public class DeviceController { private final DeviceService deviceService; /** * 分页查询 * @param page 分页对象 * @param device 出租设备清单表 * @return */ @Operation(summary = "分页查询" , description = "分页查询" ) @GetMapping("/page" ) @PreAuthorize("@pms.hasPermission('platformx_device_view')" ) public R getDevicePage(@ParameterObject Page page, @ParameterObject Device device) { LambdaQueryWrapper<Device> wrapper = Wrappers.lambdaQuery(); wrapper.eq(Device::getReqStatus,1); wrapper.like(StrUtil.isNotBlank(device.getNumber()),Device::getNumber,device.getNumber()); wrapper.like(StrUtil.isNotBlank(device.getName()),Device::getName,device.getName()); return R.ok(deviceService.page(page, wrapper)); } /** * 分页查询 * @param page 分页对象 * @param device 出租设备清单表 * @return */ @Operation(summary = "分页查询" , description = "分页查询" ) @GetMapping("/page2" ) @PreAuthorize("@pms.hasPermission('platformx_device_view')" ) public R getDevicePage2(@ParameterObject Page page, @ParameterObject Device device) { LambdaQueryWrapper<Device> wrapper = Wrappers.lambdaQuery(); wrapper.ne(Device::getReqStatus,1); wrapper.like(StrUtil.isNotBlank(device.getNumber()),Device::getNumber,device.getNumber()); wrapper.like(StrUtil.isNotBlank(device.getName()),Device::getName,device.getName()); return R.ok(deviceService.page(page, wrapper)); } /** * 通过id查询出租设备清单表 * @param id id * @return R */ @Operation(summary = "通过id查询" , description = "通过id查询" ) @GetMapping("/{id}" ) @PreAuthorize("@pms.hasPermission('platformx_device_view')" ) public R getById(@PathVariable("id" ) Long id) { return R.ok(deviceService.getById(id)); } /** * 审批通过 * @param id id * @return R */ @Operation(summary = "审批通过" , description = "审批通过" ) @GetMapping("/pass/{id}" ) public R passById(@PathVariable("id" ) Long id) { Device byId = deviceService.getById(id); byId.setReqStatus(1); deviceService.updateById(byId); return R.ok(); } /** * 审批拒绝 * @param id id * @return R */ @Operation(summary = "审批拒绝" , description = "审批拒绝" ) @GetMapping("/kill/{id}" ) public R killById(@PathVariable("id" ) Long id) { Device byId = deviceService.getById(id); byId.setReqStatus(2); deviceService.updateById(byId); return R.ok(); } /** * 新增出租设备清单表 * @param device 出租设备清单表 * @return R */ @Operation(summary = "新增出租设备清单表" , description = "新增出租设备清单表" ) @SysLog("新增出租设备清单表" ) @PostMapping @PreAuthorize("@pms.hasPermission('platformx_device_add')" ) public R save(@RequestBody Device device) { return R.ok(deviceService.save(device)); } /** * 修改出租设备清单表 * @param device 出租设备清单表 * @return R */ @Operation(summary = "修改出租设备清单表" , description = "修改出租设备清单表" ) @SysLog("修改出租设备清单表" ) @PutMapping @PreAuthorize("@pms.hasPermission('platformx_device_edit')" ) public R updateById(@RequestBody Device device) { return R.ok(deviceService.updateById(device)); } /** * 通过id删除出租设备清单表 * @param ids id列表 * @return R */ @Operation(summary = "通过id删除出租设备清单表" , description = "通过id删除出租设备清单表" ) @SysLog("通过id删除出租设备清单表" ) @DeleteMapping @PreAuthorize("@pms.hasPermission('platformx_device_del')" ) public R removeById(@RequestBody Long[] ids) { return R.ok(deviceService.removeBatchByIds(CollUtil.toList(ids))); } /** * 导出excel 表格 * @param device 查询条件 * @param ids 导出指定ID * @return excel 文件流 */ @ResponseExcel @GetMapping("/export") @PreAuthorize("@pms.hasPermission('platformx_device_export')" ) public List<Device> export(Device device,Long[] ids) { return deviceService.list(Wrappers.lambdaQuery(device).in(ArrayUtil.isNotEmpty(ids), Device::getId, ids)); } } platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceDemandPlanController.java
New file @@ -0,0 +1,119 @@ package com.by4cloud.platformx.device.controller; import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.by4cloud.platformx.common.core.util.R; import com.by4cloud.platformx.common.log.annotation.SysLog; import com.by4cloud.platformx.device.entity.DeviceDemandPlan; import com.by4cloud.platformx.device.service.DeviceDemandPlanService; import org.springframework.security.access.prepost.PreAuthorize; import com.by4cloud.platformx.common.excel.annotation.ResponseExcel; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import org.springdoc.api.annotations.ParameterObject; import org.springframework.http.HttpHeaders; import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; import java.util.List; import java.util.Objects; /** * 设备需求计划主表 * * @author pig * @date 2025-03-05 14:36:30 */ @RestController @RequiredArgsConstructor @RequestMapping("/deviceDemandPlan" ) @Tag(description = "deviceDemandPlan" , name = "设备需求计划主表管理" ) @SecurityRequirement(name = HttpHeaders.AUTHORIZATION) public class DeviceDemandPlanController { private final DeviceDemandPlanService deviceDemandPlanService; /** * 分页查询 * @param page 分页对象 * @param deviceDemandPlan 设备需求计划主表 * @return */ @Operation(summary = "分页查询" , description = "分页查询" ) @GetMapping("/page" ) @PreAuthorize("@pms.hasPermission('platformx_deviceDemandPlan_view')" ) public R getDeviceDemandPlanPage(@ParameterObject Page page, @ParameterObject DeviceDemandPlan deviceDemandPlan) { LambdaQueryWrapper<DeviceDemandPlan> wrapper = Wrappers.lambdaQuery(); return R.ok(deviceDemandPlanService.page(page, wrapper)); } /** * 通过id查询设备需求计划主表 * @param id id * @return R */ @Operation(summary = "通过id查询" , description = "通过id查询" ) @GetMapping("/{id}" ) @PreAuthorize("@pms.hasPermission('platformx_deviceDemandPlan_view')" ) public R getById(@PathVariable("id" ) Long id) { return R.ok(deviceDemandPlanService.getById(id)); } /** * 新增设备需求计划主表 * @param deviceDemandPlan 设备需求计划主表 * @return R */ @Operation(summary = "新增设备需求计划主表" , description = "新增设备需求计划主表" ) @SysLog("新增设备需求计划主表" ) @PostMapping @PreAuthorize("@pms.hasPermission('platformx_deviceDemandPlan_add')" ) public R save(@RequestBody DeviceDemandPlan deviceDemandPlan) { return R.ok(deviceDemandPlanService.save(deviceDemandPlan)); } /** * 修改设备需求计划主表 * @param deviceDemandPlan 设备需求计划主表 * @return R */ @Operation(summary = "修改设备需求计划主表" , description = "修改设备需求计划主表" ) @SysLog("修改设备需求计划主表" ) @PutMapping @PreAuthorize("@pms.hasPermission('platformx_deviceDemandPlan_edit')" ) public R updateById(@RequestBody DeviceDemandPlan deviceDemandPlan) { return R.ok(deviceDemandPlanService.updateById(deviceDemandPlan)); } /** * 通过id删除设备需求计划主表 * @param ids id列表 * @return R */ @Operation(summary = "通过id删除设备需求计划主表" , description = "通过id删除设备需求计划主表" ) @SysLog("通过id删除设备需求计划主表" ) @DeleteMapping @PreAuthorize("@pms.hasPermission('platformx_deviceDemandPlan_del')" ) public R removeById(@RequestBody Long[] ids) { return R.ok(deviceDemandPlanService.removeBatchByIds(CollUtil.toList(ids))); } /** * 导出excel 表格 * @param deviceDemandPlan 查询条件 * @param ids 导出指定ID * @return excel 文件流 */ @ResponseExcel @GetMapping("/export") @PreAuthorize("@pms.hasPermission('platformx_deviceDemandPlan_export')" ) public List<DeviceDemandPlan> export(DeviceDemandPlan deviceDemandPlan,Long[] ids) { return deviceDemandPlanService.list(Wrappers.lambdaQuery(deviceDemandPlan).in(ArrayUtil.isNotEmpty(ids), DeviceDemandPlan::getId, ids)); } } platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceDemandSubController.java
New file @@ -0,0 +1,122 @@ package com.by4cloud.platformx.device.controller; import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.by4cloud.platformx.common.core.util.R; import com.by4cloud.platformx.common.log.annotation.SysLog; import com.by4cloud.platformx.device.entity.DeviceDemandSub; import com.by4cloud.platformx.device.service.DeviceDemandSubService; import org.springframework.security.access.prepost.PreAuthorize; import com.by4cloud.platformx.common.excel.annotation.ResponseExcel; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import org.springdoc.api.annotations.ParameterObject; import org.springframework.http.HttpHeaders; import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; import java.util.List; import java.util.Objects; /** * 设备需求计划设备子表 * * @author pig * @date 2025-03-05 15:40:29 */ @RestController @RequiredArgsConstructor @RequestMapping("/deviceDemandSub" ) @Tag(description = "deviceDemandSub" , name = "设备需求计划设备子表管理" ) @SecurityRequirement(name = HttpHeaders.AUTHORIZATION) public class DeviceDemandSubController { private final DeviceDemandSubService deviceDemandSubService; /** * 分页查询 * @param page 分页对象 * @param deviceDemandSub 设备需求计划设备子表 * @return */ @Operation(summary = "分页查询" , description = "分页查询" ) @GetMapping("/page" ) @PreAuthorize("@pms.hasPermission('platformx_deviceDemandSub_view')" ) public R getDeviceDemandSubPage(@ParameterObject Page page, @ParameterObject DeviceDemandSub deviceDemandSub) { LambdaQueryWrapper<DeviceDemandSub> wrapper = Wrappers.lambdaQuery(); wrapper.eq(StrUtil.isNotBlank(deviceDemandSub.getNumber()),DeviceDemandSub::getNumber,deviceDemandSub.getNumber()); wrapper.eq(StrUtil.isNotBlank(deviceDemandSub.getName()),DeviceDemandSub::getName,deviceDemandSub.getName()); return R.ok(deviceDemandSubService.page(page, wrapper)); } /** * 通过id查询设备需求计划设备子表 * @param id id * @return R */ @Operation(summary = "通过id查询" , description = "通过id查询" ) @GetMapping("/{id}" ) @PreAuthorize("@pms.hasPermission('platformx_deviceDemandSub_view')" ) public R getById(@PathVariable("id" ) Long id) { return R.ok(deviceDemandSubService.getById(id)); } /** * 新增设备需求计划设备子表 * @param deviceDemandSub 设备需求计划设备子表 * @return R */ @Operation(summary = "新增设备需求计划设备子表" , description = "新增设备需求计划设备子表" ) @SysLog("新增设备需求计划设备子表" ) @PostMapping @PreAuthorize("@pms.hasPermission('platformx_deviceDemandSub_add')" ) public R save(@RequestBody DeviceDemandSub deviceDemandSub) { return R.ok(deviceDemandSubService.save(deviceDemandSub)); } /** * 修改设备需求计划设备子表 * @param deviceDemandSub 设备需求计划设备子表 * @return R */ @Operation(summary = "修改设备需求计划设备子表" , description = "修改设备需求计划设备子表" ) @SysLog("修改设备需求计划设备子表" ) @PutMapping @PreAuthorize("@pms.hasPermission('platformx_deviceDemandSub_edit')" ) public R updateById(@RequestBody DeviceDemandSub deviceDemandSub) { return R.ok(deviceDemandSubService.updateById(deviceDemandSub)); } /** * 通过id删除设备需求计划设备子表 * @param ids id列表 * @return R */ @Operation(summary = "通过id删除设备需求计划设备子表" , description = "通过id删除设备需求计划设备子表" ) @SysLog("通过id删除设备需求计划设备子表" ) @DeleteMapping @PreAuthorize("@pms.hasPermission('platformx_deviceDemandSub_del')" ) public R removeById(@RequestBody Long[] ids) { return R.ok(deviceDemandSubService.removeBatchByIds(CollUtil.toList(ids))); } /** * 导出excel 表格 * @param deviceDemandSub 查询条件 * @param ids 导出指定ID * @return excel 文件流 */ @ResponseExcel @GetMapping("/export") @PreAuthorize("@pms.hasPermission('platformx_deviceDemandSub_export')" ) public List<DeviceDemandSub> export(DeviceDemandSub deviceDemandSub,Long[] ids) { return deviceDemandSubService.list(Wrappers.lambdaQuery(deviceDemandSub).in(ArrayUtil.isNotEmpty(ids), DeviceDemandSub::getId, ids)); } } platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceDemandTotalController.java
New file @@ -0,0 +1,119 @@ package com.by4cloud.platformx.device.controller; import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.by4cloud.platformx.common.core.util.R; import com.by4cloud.platformx.common.log.annotation.SysLog; import com.by4cloud.platformx.device.entity.DeviceDemandTotal; import com.by4cloud.platformx.device.service.DeviceDemandTotalService; import org.springframework.security.access.prepost.PreAuthorize; import com.by4cloud.platformx.common.excel.annotation.ResponseExcel; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import org.springdoc.api.annotations.ParameterObject; import org.springframework.http.HttpHeaders; import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; import java.util.List; import java.util.Objects; /** * 设备需求计划项目子表 * * @author pig * @date 2025-03-05 14:58:41 */ @RestController @RequiredArgsConstructor @RequestMapping("/deviceDemandTotal" ) @Tag(description = "deviceDemandTotal" , name = "设备需求计划项目子表管理" ) @SecurityRequirement(name = HttpHeaders.AUTHORIZATION) public class DeviceDemandTotalController { private final DeviceDemandTotalService deviceDemandTotalService; /** * 分页查询 * @param page 分页对象 * @param deviceDemandTotal 设备需求计划项目子表 * @return */ @Operation(summary = "分页查询" , description = "分页查询" ) @GetMapping("/page" ) @PreAuthorize("@pms.hasPermission('platformx_deviceDemandTotal_view')" ) public R getDeviceDemandTotalPage(@ParameterObject Page page, @ParameterObject DeviceDemandTotal deviceDemandTotal) { LambdaQueryWrapper<DeviceDemandTotal> wrapper = Wrappers.lambdaQuery(); return R.ok(deviceDemandTotalService.page(page, wrapper)); } /** * 通过id查询设备需求计划项目子表 * @param id id * @return R */ @Operation(summary = "通过id查询" , description = "通过id查询" ) @GetMapping("/{id}" ) @PreAuthorize("@pms.hasPermission('platformx_deviceDemandTotal_view')" ) public R getById(@PathVariable("id" ) Long id) { return R.ok(deviceDemandTotalService.getById(id)); } /** * 新增设备需求计划项目子表 * @param deviceDemandTotal 设备需求计划项目子表 * @return R */ @Operation(summary = "新增设备需求计划项目子表" , description = "新增设备需求计划项目子表" ) @SysLog("新增设备需求计划项目子表" ) @PostMapping @PreAuthorize("@pms.hasPermission('platformx_deviceDemandTotal_add')" ) public R save(@RequestBody DeviceDemandTotal deviceDemandTotal) { return R.ok(deviceDemandTotalService.save(deviceDemandTotal)); } /** * 修改设备需求计划项目子表 * @param deviceDemandTotal 设备需求计划项目子表 * @return R */ @Operation(summary = "修改设备需求计划项目子表" , description = "修改设备需求计划项目子表" ) @SysLog("修改设备需求计划项目子表" ) @PutMapping @PreAuthorize("@pms.hasPermission('platformx_deviceDemandTotal_edit')" ) public R updateById(@RequestBody DeviceDemandTotal deviceDemandTotal) { return R.ok(deviceDemandTotalService.updateById(deviceDemandTotal)); } /** * 通过id删除设备需求计划项目子表 * @param ids id列表 * @return R */ @Operation(summary = "通过id删除设备需求计划项目子表" , description = "通过id删除设备需求计划项目子表" ) @SysLog("通过id删除设备需求计划项目子表" ) @DeleteMapping @PreAuthorize("@pms.hasPermission('platformx_deviceDemandTotal_del')" ) public R removeById(@RequestBody Long[] ids) { return R.ok(deviceDemandTotalService.removeBatchByIds(CollUtil.toList(ids))); } /** * 导出excel 表格 * @param deviceDemandTotal 查询条件 * @param ids 导出指定ID * @return excel 文件流 */ @ResponseExcel @GetMapping("/export") @PreAuthorize("@pms.hasPermission('platformx_deviceDemandTotal_export')" ) public List<DeviceDemandTotal> export(DeviceDemandTotal deviceDemandTotal,Long[] ids) { return deviceDemandTotalService.list(Wrappers.lambdaQuery(deviceDemandTotal).in(ArrayUtil.isNotEmpty(ids), DeviceDemandTotal::getId, ids)); } } platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/TestController.java
New file @@ -0,0 +1,25 @@ package com.by4cloud.platformx.device.controller; import com.by4cloud.platformx.common.security.annotation.Inner; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @author kdq * @version 1.0.0 * @ClassName TestController.java * @Description TODO * @createTime 2025年03月04日 15:43:00 */ @RequestMapping("test") @RestController public class TestController { @Inner(value = false) @RequestMapping("/ceshi") public String getInfo(){ return "123"; } } platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/packge-info.java
New file @@ -0,0 +1,4 @@ /* * @author platformx archetype */ package com.by4cloud.platformx.device.controller; platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceClassMapper.java
New file @@ -0,0 +1,11 @@ package com.by4cloud.platformx.device.mapper; import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper; import com.by4cloud.platformx.device.entity.DeviceClass; import org.apache.ibatis.annotations.Mapper; @Mapper public interface DeviceClassMapper extends PlatformxBaseMapper<DeviceClass> { } platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceDemandPlanMapper.java
New file @@ -0,0 +1,11 @@ package com.by4cloud.platformx.device.mapper; import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper; import com.by4cloud.platformx.device.entity.DeviceDemandPlan; import org.apache.ibatis.annotations.Mapper; @Mapper public interface DeviceDemandPlanMapper extends PlatformxBaseMapper<DeviceDemandPlan> { } platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceDemandSubMapper.java
New file @@ -0,0 +1,11 @@ package com.by4cloud.platformx.device.mapper; import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper; import com.by4cloud.platformx.device.entity.DeviceDemandSub; import org.apache.ibatis.annotations.Mapper; @Mapper public interface DeviceDemandSubMapper extends PlatformxBaseMapper<DeviceDemandSub> { } platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceDemandTotalMapper.java
New file @@ -0,0 +1,11 @@ package com.by4cloud.platformx.device.mapper; import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper; import com.by4cloud.platformx.device.entity.DeviceDemandTotal; import org.apache.ibatis.annotations.Mapper; @Mapper public interface DeviceDemandTotalMapper extends PlatformxBaseMapper<DeviceDemandTotal> { } platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceMapper.java
New file @@ -0,0 +1,11 @@ package com.by4cloud.platformx.device.mapper; import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper; import com.by4cloud.platformx.device.entity.Device; import org.apache.ibatis.annotations.Mapper; @Mapper public interface DeviceMapper extends PlatformxBaseMapper<Device> { } platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/packge-info.java
File was renamed from platformx-demo-biz/src/main/java/com/by4cloud/platformx/demo/mapper/packge-info.java @@ -3,4 +3,4 @@ * <p> * Mybatis Mapper 存放目录 */ package com.by4cloud.platformx.demo.mapper; package com.by4cloud.platformx.device.mapper; platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceClassService.java
New file @@ -0,0 +1,14 @@ package com.by4cloud.platformx.device.service; import cn.hutool.core.lang.tree.Tree; import com.baomidou.mybatisplus.extension.service.IService; import com.by4cloud.platformx.device.entity.DeviceClass; import java.util.List; public interface DeviceClassService extends IService<DeviceClass> { //List<Tree<Long>> selectTree(String name,Long pId); List<Tree<String>> selectTree(); } platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceDemandPlanService.java
New file @@ -0,0 +1,8 @@ package com.by4cloud.platformx.device.service; import com.baomidou.mybatisplus.extension.service.IService; import com.by4cloud.platformx.device.entity.DeviceDemandPlan; public interface DeviceDemandPlanService extends IService<DeviceDemandPlan> { } platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceDemandSubService.java
New file @@ -0,0 +1,8 @@ package com.by4cloud.platformx.device.service; import com.baomidou.mybatisplus.extension.service.IService; import com.by4cloud.platformx.device.entity.DeviceDemandSub; public interface DeviceDemandSubService extends IService<DeviceDemandSub> { } platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceDemandTotalService.java
New file @@ -0,0 +1,8 @@ package com.by4cloud.platformx.device.service; import com.baomidou.mybatisplus.extension.service.IService; import com.by4cloud.platformx.device.entity.DeviceDemandTotal; public interface DeviceDemandTotalService extends IService<DeviceDemandTotal> { } platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceService.java
New file @@ -0,0 +1,8 @@ package com.by4cloud.platformx.device.service; import com.baomidou.mybatisplus.extension.service.IService; import com.by4cloud.platformx.device.entity.Device; public interface DeviceService extends IService<Device> { } platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceClassServiceImpl.java
New file @@ -0,0 +1,94 @@ package com.by4cloud.platformx.device.service.impl; import cn.hutool.core.lang.tree.Tree; import cn.hutool.core.lang.tree.TreeNode; import cn.hutool.core.lang.tree.TreeNodeConfig; import cn.hutool.core.lang.tree.TreeUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.by4cloud.platformx.admin.api.entity.SysDept; import com.by4cloud.platformx.common.data.datascope.DataScope; import com.by4cloud.platformx.device.entity.DeviceClass; import com.by4cloud.platformx.device.mapper.DeviceClassMapper; import com.by4cloud.platformx.device.service.DeviceClassService; import lombok.AllArgsConstructor; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; /** * 设备分类表 * * @author pig * @date 2025-03-05 10:46:29 */ @Service @AllArgsConstructor public class DeviceClassServiceImpl extends ServiceImpl<DeviceClassMapper, DeviceClass> implements DeviceClassService { private final DeviceClassMapper deviceClassMapper; @Override public List<Tree<String>> selectTree() { // 查询全部部门 List<DeviceClass> taxList = list(Wrappers.emptyWrapper()); TreeNodeConfig treeNodeConfig = new TreeNodeConfig(); treeNodeConfig.setIdKey("id"); treeNodeConfig.setParentIdKey("pId"); treeNodeConfig.setNameKey("name"); // 第二个参数是根节点id List<Tree<String>> treeList = TreeUtil.build(taxList, "0", treeNodeConfig, (taxCode, tree) -> { tree.setId(taxCode.getId()+""); tree.setName(taxCode.getName()); tree.setParentId(taxCode.getPId()+""); tree.putExtra("beforeDate", taxCode.getBeforeDate()); tree.putExtra("depreciation", taxCode.getDepreciation()); tree.putExtra("remark", taxCode.getRemark()); tree.putExtra("number", taxCode.getNumber()); }); return treeList; } // @Override // public List<Tree<Long>> selectTree(String name,Long pId) { // // 查询全部部门 // QueryWrapper<DeviceClass> wrapper = new QueryWrapper<>(); // wrapper.lambda() // .like(StrUtil.isNotBlank(name),DeviceClass::getName,name); // List<DeviceClass> deviceClasses = deviceClassMapper.selectList(wrapper); // // 权限内部门 // List<TreeNode<Long>> collect = deviceClasses.stream() // .filter(dept -> dept.getId().intValue() != dept.getPId()) // .sorted(Comparator.comparingInt(DeviceClass::getSortOrder)).map(dept -> { // TreeNode<Long> treeNode = new TreeNode<>(); // treeNode.setId(dept.getId()); // treeNode.setParentId(dept.getPId()); // treeNode.setName(dept.getName()); // treeNode.setWeight(dept.getSortOrder()); // // 有权限不返回标识 // Map<String, Object> extra = new HashMap<>(8); // extra.put("createTime", dept.getCreateTime()); // treeNode.setExtra(extra); // return treeNode; // }).collect(Collectors.toList()); // // // 模糊查询 不组装树结构 直接返回 表格方便编辑 // if (StrUtil.isNotBlank(name)) { // return collect.stream().map(node -> { // Tree<Long> tree = new Tree<>(); // tree.putAll(node.getExtra()); // BeanUtils.copyProperties(node, tree); // return tree; // }).collect(Collectors.toList()); // } // // return TreeUtil.build(collect, pId == null ? 0 : pId); // } } platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceDemandPlanServiceImpl.java
New file @@ -0,0 +1,16 @@ package com.by4cloud.platformx.device.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.by4cloud.platformx.device.entity.DeviceDemandPlan; import com.by4cloud.platformx.device.mapper.DeviceDemandPlanMapper; import com.by4cloud.platformx.device.service.DeviceDemandPlanService; import org.springframework.stereotype.Service; /** * 设备需求计划主表 * * @author pig * @date 2025-03-05 14:36:30 */ @Service public class DeviceDemandPlanServiceImpl extends ServiceImpl<DeviceDemandPlanMapper, DeviceDemandPlan> implements DeviceDemandPlanService { } platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceDemandSubServiceImpl.java
New file @@ -0,0 +1,16 @@ package com.by4cloud.platformx.device.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.by4cloud.platformx.device.entity.DeviceDemandSub; import com.by4cloud.platformx.device.mapper.DeviceDemandSubMapper; import com.by4cloud.platformx.device.service.DeviceDemandSubService; import org.springframework.stereotype.Service; /** * 设备需求计划设备子表 * * @author pig * @date 2025-03-05 15:40:29 */ @Service public class DeviceDemandSubServiceImpl extends ServiceImpl<DeviceDemandSubMapper, DeviceDemandSub> implements DeviceDemandSubService { } platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceDemandTotalServiceImpl.java
New file @@ -0,0 +1,16 @@ package com.by4cloud.platformx.device.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.by4cloud.platformx.device.entity.DeviceDemandTotal; import com.by4cloud.platformx.device.mapper.DeviceDemandTotalMapper; import com.by4cloud.platformx.device.service.DeviceDemandTotalService; import org.springframework.stereotype.Service; /** * 设备需求计划项目子表 * * @author pig * @date 2025-03-05 14:58:41 */ @Service public class DeviceDemandTotalServiceImpl extends ServiceImpl<DeviceDemandTotalMapper, DeviceDemandTotal> implements DeviceDemandTotalService { } platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceServiceImpl.java
New file @@ -0,0 +1,16 @@ package com.by4cloud.platformx.device.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.by4cloud.platformx.device.entity.Device; import com.by4cloud.platformx.device.mapper.DeviceMapper; import com.by4cloud.platformx.device.service.DeviceService; import org.springframework.stereotype.Service; /** * 出租设备清单表 * * @author pig * @date 2025-03-05 14:26:14 */ @Service public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> implements DeviceService { } platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/packge-info.java
New file @@ -0,0 +1,4 @@ /* * @author platformx archetype */ package com.by4cloud.platformx.device.service; platformx-device-biz/src/main/resources/application.yml
platformx-device-biz/src/main/resources/logback-spring.xml
platformx-device-biz/src/main/resources/mapper/DeviceClassMapper.xml
New file @@ -0,0 +1,21 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.by4cloud.platformx.device.mapper.DeviceClassMapper"> <resultMap id="deviceClassMap" type="com.by4cloud.platformx.device.entity.DeviceClass"> <id property="id" column="id"/> <result property="name" column="name"/> <result property="number" column="number"/> <result property="pNum" column="p_num"/> <result property="pId" column="p_id"/> <result property="depreciation" column="depreciation"/> <result property="beforeDate" column="before_date"/> <result property="remark" column="remark"/> <result property="createBy" column="create_by"/> <result property="createTime" column="create_time"/> <result property="updateBy" column="update_by"/> <result property="updateTime" column="update_time"/> <result property="delFlag" column="del_flag"/> </resultMap> </mapper> platformx-device-biz/src/main/resources/mapper/DeviceDemandPlanMapper.xml
New file @@ -0,0 +1,31 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.by4cloud.platformx.device.mapper.DeviceDemandPlanMapper"> <resultMap id="deviceDemandPlanMap" type="com.by4cloud.platformx.device.entity.DeviceDemandPlan"> <id property="id" column="id"/> <result property="declareCompId" column="declare_comp_id"/> <result property="releaseCompId" column="release_comp_id"/> <result property="releasePerson" column="release_person"/> <result property="amount" column="amount"/> <result property="month" column="month"/> <result property="name" column="name"/> <result property="num" column="num"/> <result property="price" column="price"/> <result property="specification" column="specification"/> <result property="unit" column="unit"/> <result property="contacts" column="contacts"/> <result property="number" column="number"/> <result property="releaseDate" column="release_date"/> <result property="sendDate" column="send_date"/> <result property="status" column="status"/> <result property="type" column="type"/> <result property="year" column="year"/> <result property="createBy" column="create_by"/> <result property="createTime" column="create_time"/> <result property="updateBy" column="update_by"/> <result property="updateTime" column="update_time"/> <result property="delFlag" column="del_flag"/> </resultMap> </mapper> platformx-device-biz/src/main/resources/mapper/DeviceDemandSubMapper.xml
New file @@ -0,0 +1,29 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.by4cloud.platformx.device.mapper.DeviceDemandSubMapper"> <resultMap id="deviceDemandSubMap" type="com.by4cloud.platformx.device.entity.DeviceDemandSub"> <id property="id" column="id"/> <result property="number" column="number"/> <result property="name" column="name"/> <result property="compId" column="comp_id"/> <result property="place" column="place"/> <result property="deptId" column="dept_id"/> <result property="amount" column="amount"/> <result property="month" column="month"/> <result property="num" column="num"/> <result property="price" column="price"/> <result property="specification" column="specification"/> <result property="unit" column="unit"/> <result property="flucPlan" column="fluc_plan"/> <result property="manu" column="manu"/> <result property="necessity" column="necessity"/> <result property="totalId" column="total_id"/> <result property="createBy" column="create_by"/> <result property="createTime" column="create_time"/> <result property="updateBy" column="update_by"/> <result property="updateTime" column="update_time"/> <result property="delFlag" column="del_flag"/> </resultMap> </mapper> platformx-device-biz/src/main/resources/mapper/DeviceDemandTotalMapper.xml
New file @@ -0,0 +1,27 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.by4cloud.platformx.device.mapper.DeviceDemandTotalMapper"> <resultMap id="deviceDemandTotalMap" type="com.by4cloud.platformx.device.entity.DeviceDemandTotal"> <id property="id" column="id"/> <result property="name" column="name"/> <result property="num" column="num"/> <result property="compId" column="comp_id"/> <result property="deptId" column="dept_id"/> <result property="place" column="place"/> <result property="amount" column="amount"/> <result property="month" column="month"/> <result property="price" column="price"/> <result property="specification" column="specification"/> <result property="unit" column="unit"/> <result property="manu" column="manu"/> <result property="necessity" column="necessity"/> <result property="planId" column="plan_id"/> <result property="createBy" column="create_by"/> <result property="createTime" column="create_time"/> <result property="updateBy" column="update_by"/> <result property="updateTime" column="update_time"/> <result property="delFlag" column="del_flag"/> </resultMap> </mapper> platformx-device-biz/src/main/resources/mapper/DeviceMapper.xml
New file @@ -0,0 +1,28 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.by4cloud.platformx.device.mapper.DeviceMapper"> <resultMap id="deviceMap" type="com.by4cloud.platformx.device.entity.Device"> <id property="id" column="id"/> <result property="number" column="number"/> <result property="name" column="name"/> <result property="specification" column="specification"/> <result property="manu" column="manu"/> <result property="price" column="price"/> <result property="unit" column="unit"/> <result property="depreciation" column="depreciation"/> <result property="beforeDate" column="before_date"/> <result property="remindDate" column="remind_date"/> <result property="num" column="num"/> <result property="amount" column="amount"/> <result property="month" column="month"/> <result property="releaseDate" column="release_date"/> <result property="releasePerson" column="release_person"/> <result property="createBy" column="create_by"/> <result property="createTime" column="create_time"/> <result property="updateBy" column="update_by"/> <result property="updateTime" column="update_time"/> <result property="delFlag" column="del_flag"/> </resultMap> </mapper> pom.xml
@@ -10,13 +10,13 @@ <version>5.5.0</version> </parent> <artifactId>platformx-demo</artifactId> <artifactId>platformx-device</artifactId> <packaging>pom</packaging> <!--项目子模块--> <modules> <module>platformx-demo-api</module> <module>platformx-demo-biz</module> <module>platformx-device-api</module> <module>platformx-device-biz</module> <module>platformx-boot</module> </modules> </project>