From e6f0a897f1eb0d058ab19032770306be08d784ff Mon Sep 17 00:00:00 2001 From: kongdeqiang <123456> Date: 星期二, 11 三月 2025 19:49:43 +0800 Subject: [PATCH] fix: 第一次提交 --- platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/packge-info.java | 4 platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceDemandPlanController.java | 119 +++ platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/TestController.java | 25 platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceDemandTotalServiceImpl.java | 16 platformx-device-biz/src/main/resources/mapper/DeviceClassMapper.xml | 21 platformx-boot/pom.xml | 6 platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/packge-info.java | 2 platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceClassController.java | 149 ++++ platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceDemandSubController.java | 122 ++++ platformx-device-biz/src/main/resources/logback-spring.xml | 0 platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceDemandTotalMapper.java | 11 platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceDemandPlanServiceImpl.java | 16 platformx-device-api/src/main/java/com/by4cloud/platformx/device/constant/packge-info.java | 6 platformx-boot/src/main/resources/application-dev.yml | 4 platformx-device-biz/src/main/resources/mapper/DeviceDemandTotalMapper.xml | 27 platformx-boot/src/main/java/com/by4cloud/platformx/PlatformxBootApplication.java | 2 platformx-device-biz/pom.xml | 6 platformx-device-api/pom.xml | 4 platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceController.java | 166 +++++ platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceDemandSubMapper.java | 11 platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceDemandTotalController.java | 119 +++ platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceMapper.java | 11 platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceDemandPlan.java | 64 ++ platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceDemandSubServiceImpl.java | 16 platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceDemandSubService.java | 8 platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceBaseModel.java | 321 ++++++++++ platformx-device-biz/src/main/resources/mapper/DeviceDemandSubMapper.xml | 29 platformx-device-api/src/main/java/com/by4cloud/platformx/device/api/feign/packge-info.java | 2 platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceClassServiceImpl.java | 94 +++ platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceClass.java | 61 ++ platformx-device-biz/src/main/resources/application.yml | 0 platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceClassMapper.java | 11 pom.xml | 6 platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceDemandTotal.java | 39 + platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceDemandSub.java | 46 + platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceService.java | 8 platformx-device-biz/src/main/java/com/by4cloud/platformx/device/App.java | 4 platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceServiceImpl.java | 16 platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceDemandTotalService.java | 8 platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceDemandPlanMapper.java | 11 platformx-device-biz/src/main/resources/mapper/DeviceMapper.xml | 28 /dev/null | 4 platformx-device-biz/src/main/resources/mapper/DeviceDemandPlanMapper.xml | 31 + platformx-device-api/src/main/java/com/by4cloud/platformx/device/dto/packge-info.java | 2 platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/packge-info.java | 4 platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceClassService.java | 14 platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceDemandPlanService.java | 8 platformx-boot/src/main/resources/application.yml | 4 platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/Demo.java | 8 platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/packge-info.java | 6 platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/Device.java | 78 ++ 51 files changed, 1,750 insertions(+), 28 deletions(-) diff --git a/platformx-boot/pom.xml b/platformx-boot/pom.xml index d3dbfc9..2d9167b 100644 --- a/platformx-boot/pom.xml +++ b/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> <!--瀹夊叏妯″潡--> diff --git a/platformx-boot/src/main/java/com/by4cloud/platformx/PlatformxBootApplication.java b/platformx-boot/src/main/java/com/by4cloud/platformx/PlatformxBootApplication.java index 12fbf7c..725c79c 100644 --- a/platformx-boot/src/main/java/com/by4cloud/platformx/PlatformxBootApplication.java +++ b/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 { diff --git a/platformx-boot/src/main/resources/application-dev.yml b/platformx-boot/src/main/resources/application-dev.yml index b6ee2e0..5013050 100644 --- a/platformx-boot/src/main/resources/application-dev.yml +++ b/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: diff --git a/platformx-boot/src/main/resources/application.yml b/platformx-boot/src/main/resources/application.yml index 4e14912..fc91368 100644 --- a/platformx-boot/src/main/resources/application.yml +++ b/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 # 婵�娲籨ev锛屽搴� application-dev.yml + redis: + database: 5 ## spring security 瀵瑰鏆撮湶鎺ュ彛璁剧疆锛堜笉閴存潈鐩存帴鍙闂級 diff --git a/platformx-demo-api/src/main/java/com/by4cloud/platformx/demo/constant/packge-info.java b/platformx-demo-api/src/main/java/com/by4cloud/platformx/demo/constant/packge-info.java deleted file mode 100644 index ab748a1..0000000 --- a/platformx-demo-api/src/main/java/com/by4cloud/platformx/demo/constant/packge-info.java +++ /dev/null @@ -1,6 +0,0 @@ -/* - * @author platformx archetype - * <p> - * 甯搁噺鍜屾灇涓惧畾涔� - */ -package com.by4cloud.platformx.demo.constant; \ No newline at end of file diff --git a/platformx-demo-api/src/main/java/com/by4cloud/platformx/demo/entity/packge-info.java b/platformx-demo-api/src/main/java/com/by4cloud/platformx/demo/entity/packge-info.java deleted file mode 100644 index e56cda8..0000000 --- a/platformx-demo-api/src/main/java/com/by4cloud/platformx/demo/entity/packge-info.java +++ /dev/null @@ -1,6 +0,0 @@ -/* - * @author platformx archetype - * <p> - * 瀹炰綋 瀛樻斁鐩綍 - */ -package com.by4cloud.platformx.demo.entity; \ No newline at end of file diff --git a/platformx-demo-biz/src/main/java/com/by4cloud/platformx/demo/controller/packge-info.java b/platformx-demo-biz/src/main/java/com/by4cloud/platformx/demo/controller/packge-info.java deleted file mode 100644 index 5104794..0000000 --- a/platformx-demo-biz/src/main/java/com/by4cloud/platformx/demo/controller/packge-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/* - * @author platformx archetype - */ -package com.by4cloud.platformx.demo.controller; \ No newline at end of file diff --git a/platformx-demo-biz/src/main/java/com/by4cloud/platformx/demo/service/packge-info.java b/platformx-demo-biz/src/main/java/com/by4cloud/platformx/demo/service/packge-info.java deleted file mode 100644 index 6b75b5e..0000000 --- a/platformx-demo-biz/src/main/java/com/by4cloud/platformx/demo/service/packge-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/* - * @author platformx archetype - */ -package com.by4cloud.platformx.demo.service; \ No newline at end of file diff --git a/platformx-demo-api/pom.xml b/platformx-device-api/pom.xml similarity index 93% rename from platformx-demo-api/pom.xml rename to platformx-device-api/pom.xml index e0aa33e..69b13cb 100644 --- a/platformx-demo-api/pom.xml +++ b/platformx-device-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> <!-- 杩炶〃鏌ヨ娉ㄨВ --> diff --git a/platformx-demo-api/src/main/java/com/by4cloud/platformx/demo/api/feign/packge-info.java b/platformx-device-api/src/main/java/com/by4cloud/platformx/device/api/feign/packge-info.java similarity index 71% rename from platformx-demo-api/src/main/java/com/by4cloud/platformx/demo/api/feign/packge-info.java rename to platformx-device-api/src/main/java/com/by4cloud/platformx/device/api/feign/packge-info.java index a9565f0..647258b 100644 --- a/platformx-demo-api/src/main/java/com/by4cloud/platformx/demo/api/feign/packge-info.java +++ b/platformx-device-api/src/main/java/com/by4cloud/platformx/device/api/feign/packge-info.java @@ -3,4 +3,4 @@ * <p> * feign client 瀛樻斁鐩綍锛屾敞鎰� @EnablePlatformxFeignClients 鐨勬壂鎻忚寖鍥� */ -package com.by4cloud.platformx.demo.api.feign; \ No newline at end of file +package com.by4cloud.platformx.device.api.feign; diff --git a/platformx-device-api/src/main/java/com/by4cloud/platformx/device/constant/packge-info.java b/platformx-device-api/src/main/java/com/by4cloud/platformx/device/constant/packge-info.java new file mode 100644 index 0000000..0b1c4ed --- /dev/null +++ b/platformx-device-api/src/main/java/com/by4cloud/platformx/device/constant/packge-info.java @@ -0,0 +1,6 @@ +/* + * @author platformx archetype + * <p> + * 甯搁噺鍜屾灇涓惧畾涔� + */ +package com.by4cloud.platformx.device.constant; diff --git a/platformx-demo-api/src/main/java/com/by4cloud/platformx/demo/dto/packge-info.java b/platformx-device-api/src/main/java/com/by4cloud/platformx/device/dto/packge-info.java similarity index 60% rename from platformx-demo-api/src/main/java/com/by4cloud/platformx/demo/dto/packge-info.java rename to platformx-device-api/src/main/java/com/by4cloud/platformx/device/dto/packge-info.java index a0695fe..b496b6d 100644 --- a/platformx-demo-api/src/main/java/com/by4cloud/platformx/demo/dto/packge-info.java +++ b/platformx-device-api/src/main/java/com/by4cloud/platformx/device/dto/packge-info.java @@ -3,4 +3,4 @@ * <p> * DTO 瀛樻斁鐩綍 */ -package com.by4cloud.platformx.demo.dto; \ No newline at end of file +package com.by4cloud.platformx.device.dto; diff --git a/platformx-demo-api/src/main/java/com/by4cloud/platformx/demo/entity/Demo.java b/platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/Demo.java similarity index 92% rename from platformx-demo-api/src/main/java/com/by4cloud/platformx/demo/entity/Demo.java rename to platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/Demo.java index b78e947..c434e5e 100644 --- a/platformx-demo-api/src/main/java/com/by4cloud/platformx/demo/entity/Demo.java +++ b/platformx-device-api/src/main/java/com/by4cloud/platformx/device/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 '濮撳悕'") diff --git a/platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/Device.java b/platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/Device.java new file mode 100644 index 0000000..c54c664 --- /dev/null +++ b/platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/Device.java @@ -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; + +} diff --git a/platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceBaseModel.java b/platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceBaseModel.java new file mode 100644 index 0000000..43d265b --- /dev/null +++ b/platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceBaseModel.java @@ -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/姝e父 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() + ")"; + } +} diff --git a/platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceClass.java b/platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceClass.java new file mode 100644 index 0000000..8b30c3b --- /dev/null +++ b/platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceClass.java @@ -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; +} diff --git a/platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceDemandPlan.java b/platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceDemandPlan.java new file mode 100644 index 0000000..9bfd7bf --- /dev/null +++ b/platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceDemandPlan.java @@ -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; +} diff --git a/platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceDemandSub.java b/platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceDemandSub.java new file mode 100644 index 0000000..b8d9e35 --- /dev/null +++ b/platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceDemandSub.java @@ -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 = "椤圭洰琛╥d") + @Column(columnDefinition="int comment '椤圭洰琛╥d'") + 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; + +} diff --git a/platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceDemandTotal.java b/platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceDemandTotal.java new file mode 100644 index 0000000..d6ce6c3 --- /dev/null +++ b/platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/DeviceDemandTotal.java @@ -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 = "闇�姹傝鍒抜d") + @Column(columnDefinition="int comment '闇�姹傝鍒抜d'") + 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; +} diff --git a/platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/packge-info.java b/platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/packge-info.java new file mode 100644 index 0000000..4a5d67d --- /dev/null +++ b/platformx-device-api/src/main/java/com/by4cloud/platformx/device/entity/packge-info.java @@ -0,0 +1,6 @@ +/* + * @author platformx archetype + * <p> + * 瀹炰綋 瀛樻斁鐩綍 + */ +package com.by4cloud.platformx.device.entity; diff --git a/platformx-demo-biz/pom.xml b/platformx-device-biz/pom.xml similarity index 96% rename from platformx-demo-biz/pom.xml rename to platformx-device-biz/pom.xml index 5c8f89d..93094f1 100644 --- a/platformx-demo-biz/pom.xml +++ b/platformx-device-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 渚濊禆--> diff --git a/platformx-demo-biz/src/main/java/com/by4cloud/platformx/demo/App.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/App.java similarity index 90% rename from platformx-demo-biz/src/main/java/com/by4cloud/platformx/demo/App.java rename to platformx-device-biz/src/main/java/com/by4cloud/platformx/device/App.java index 26cdb3b..a2f2183 100644 --- a/platformx-demo-biz/src/main/java/com/by4cloud/platformx/demo/App.java +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/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 diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceClassController.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceClassController.java new file mode 100644 index 0000000..2f377e2 --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceClassController.java @@ -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)); + } +} diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceController.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceController.java new file mode 100644 index 0000000..e69afb0 --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceController.java @@ -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)); + } +} diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceDemandPlanController.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceDemandPlanController.java new file mode 100644 index 0000000..95f48c8 --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceDemandPlanController.java @@ -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)); + } +} diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceDemandSubController.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceDemandSubController.java new file mode 100644 index 0000000..b9b32da --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceDemandSubController.java @@ -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)); + } +} diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceDemandTotalController.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceDemandTotalController.java new file mode 100644 index 0000000..8ebe9d6 --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/DeviceDemandTotalController.java @@ -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)); + } +} diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/TestController.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/TestController.java new file mode 100644 index 0000000..4f444ae --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/TestController.java @@ -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"; + } + +} diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/packge-info.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/packge-info.java new file mode 100644 index 0000000..a073b6c --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/controller/packge-info.java @@ -0,0 +1,4 @@ +/* + * @author platformx archetype + */ +package com.by4cloud.platformx.device.controller; diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceClassMapper.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceClassMapper.java new file mode 100644 index 0000000..bdcb528 --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceClassMapper.java @@ -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> { + + +} diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceDemandPlanMapper.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceDemandPlanMapper.java new file mode 100644 index 0000000..0f90936 --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceDemandPlanMapper.java @@ -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> { + + +} diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceDemandSubMapper.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceDemandSubMapper.java new file mode 100644 index 0000000..86d9858 --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceDemandSubMapper.java @@ -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> { + + +} diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceDemandTotalMapper.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceDemandTotalMapper.java new file mode 100644 index 0000000..3445dc9 --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceDemandTotalMapper.java @@ -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> { + + +} diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceMapper.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceMapper.java new file mode 100644 index 0000000..06b4439 --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/DeviceMapper.java @@ -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> { + + +} diff --git a/platformx-demo-biz/src/main/java/com/by4cloud/platformx/demo/mapper/packge-info.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/packge-info.java similarity index 62% rename from platformx-demo-biz/src/main/java/com/by4cloud/platformx/demo/mapper/packge-info.java rename to platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/packge-info.java index 1a927b0..fd28add 100644 --- a/platformx-demo-biz/src/main/java/com/by4cloud/platformx/demo/mapper/packge-info.java +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/mapper/packge-info.java @@ -3,4 +3,4 @@ * <p> * Mybatis Mapper 瀛樻斁鐩綍 */ -package com.by4cloud.platformx.demo.mapper; \ No newline at end of file +package com.by4cloud.platformx.device.mapper; diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceClassService.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceClassService.java new file mode 100644 index 0000000..68811e5 --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceClassService.java @@ -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(); + +} diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceDemandPlanService.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceDemandPlanService.java new file mode 100644 index 0000000..d18da00 --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceDemandPlanService.java @@ -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> { + +} diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceDemandSubService.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceDemandSubService.java new file mode 100644 index 0000000..3b55a73 --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceDemandSubService.java @@ -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> { + +} diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceDemandTotalService.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceDemandTotalService.java new file mode 100644 index 0000000..785dd12 --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceDemandTotalService.java @@ -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> { + +} diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceService.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceService.java new file mode 100644 index 0000000..d749225 --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/DeviceService.java @@ -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> { + +} diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceClassServiceImpl.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceClassServiceImpl.java new file mode 100644 index 0000000..edd44dd --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceClassServiceImpl.java @@ -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"); + // 绗簩涓弬鏁版槸鏍硅妭鐐筰d + 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); +// } +} diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceDemandPlanServiceImpl.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceDemandPlanServiceImpl.java new file mode 100644 index 0000000..b0b3984 --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceDemandPlanServiceImpl.java @@ -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 { +} diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceDemandSubServiceImpl.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceDemandSubServiceImpl.java new file mode 100644 index 0000000..8fc2f94 --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceDemandSubServiceImpl.java @@ -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 { +} diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceDemandTotalServiceImpl.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceDemandTotalServiceImpl.java new file mode 100644 index 0000000..ac90fc4 --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceDemandTotalServiceImpl.java @@ -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 { +} diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceServiceImpl.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceServiceImpl.java new file mode 100644 index 0000000..bab0eeb --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/impl/DeviceServiceImpl.java @@ -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 { +} diff --git a/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/packge-info.java b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/packge-info.java new file mode 100644 index 0000000..500e309 --- /dev/null +++ b/platformx-device-biz/src/main/java/com/by4cloud/platformx/device/service/packge-info.java @@ -0,0 +1,4 @@ +/* + * @author platformx archetype + */ +package com.by4cloud.platformx.device.service; diff --git a/platformx-demo-biz/src/main/resources/application.yml b/platformx-device-biz/src/main/resources/application.yml similarity index 100% rename from platformx-demo-biz/src/main/resources/application.yml rename to platformx-device-biz/src/main/resources/application.yml diff --git a/platformx-demo-biz/src/main/resources/logback-spring.xml b/platformx-device-biz/src/main/resources/logback-spring.xml similarity index 100% rename from platformx-demo-biz/src/main/resources/logback-spring.xml rename to platformx-device-biz/src/main/resources/logback-spring.xml diff --git a/platformx-device-biz/src/main/resources/mapper/DeviceClassMapper.xml b/platformx-device-biz/src/main/resources/mapper/DeviceClassMapper.xml new file mode 100644 index 0000000..0d83cf6 --- /dev/null +++ b/platformx-device-biz/src/main/resources/mapper/DeviceClassMapper.xml @@ -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> diff --git a/platformx-device-biz/src/main/resources/mapper/DeviceDemandPlanMapper.xml b/platformx-device-biz/src/main/resources/mapper/DeviceDemandPlanMapper.xml new file mode 100644 index 0000000..af14b10 --- /dev/null +++ b/platformx-device-biz/src/main/resources/mapper/DeviceDemandPlanMapper.xml @@ -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> diff --git a/platformx-device-biz/src/main/resources/mapper/DeviceDemandSubMapper.xml b/platformx-device-biz/src/main/resources/mapper/DeviceDemandSubMapper.xml new file mode 100644 index 0000000..e4e5c6c --- /dev/null +++ b/platformx-device-biz/src/main/resources/mapper/DeviceDemandSubMapper.xml @@ -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> diff --git a/platformx-device-biz/src/main/resources/mapper/DeviceDemandTotalMapper.xml b/platformx-device-biz/src/main/resources/mapper/DeviceDemandTotalMapper.xml new file mode 100644 index 0000000..b2a80ff --- /dev/null +++ b/platformx-device-biz/src/main/resources/mapper/DeviceDemandTotalMapper.xml @@ -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> diff --git a/platformx-device-biz/src/main/resources/mapper/DeviceMapper.xml b/platformx-device-biz/src/main/resources/mapper/DeviceMapper.xml new file mode 100644 index 0000000..26353cc --- /dev/null +++ b/platformx-device-biz/src/main/resources/mapper/DeviceMapper.xml @@ -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> diff --git a/pom.xml b/pom.xml index c5ac1cc..c381660 100644 --- a/pom.xml +++ b/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> -- Gitblit v1.9.1