代码合并问题处理
This commit is contained in:
parent
a5d5c0006d
commit
a996310f25
36
core/pom.xml
36
core/pom.xml
|
@ -10,6 +10,10 @@
|
|||
<artifactId>core</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
@ -161,6 +165,38 @@
|
|||
<artifactId>opencv</artifactId>
|
||||
<version>4.7.0-0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- JavaMail邮件依赖 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-mail</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 阿里云短信核心库 -->
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-core</artifactId>
|
||||
<version>4.6.3</version> <!-- 建议使用最新版本 -->
|
||||
</dependency>
|
||||
|
||||
<!-- 阿里云短信服务 SDK -->
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
|
||||
<version>2.1.0</version> <!-- 建议使用最新版本 -->
|
||||
</dependency>
|
||||
|
||||
<!-- Java 11+ 需要额外添加的依赖 -->
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
<version>2.3.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -59,6 +59,8 @@ public interface Converts {
|
|||
|
||||
List<RoleResp> toRoleResp(List<RoleEntity> list);
|
||||
|
||||
List<UserResp> toUserResp(List<UserEntity> list);
|
||||
|
||||
RoleEntity toRoleEntity(RoleReq req);
|
||||
|
||||
MenuEntity toMenuEntity(MenuReq req);
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package com.dite.znpt.domain.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel("接受文件夹参数")
|
||||
public class FolderDto {
|
||||
private String name = "tom";
|
||||
private Long parentId = 0L;
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("business_data_part")
|
||||
@ApiModel(value="商务资料文件夹对象")
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class BusinessDataEntity {
|
||||
|
||||
// 主键
|
||||
private Long folderId = null;
|
||||
// 文件夹名称
|
||||
private String folderName = null;
|
||||
// 父级文件夹
|
||||
private Long parentId = null;
|
||||
// 创建人
|
||||
private Long creatorId = null;
|
||||
// 创建时间
|
||||
private LocalDateTime createTime = null;
|
||||
// 更新时间
|
||||
private LocalDateTime updateTime = null;
|
||||
// 是否删除
|
||||
private Boolean isDeleted = false;
|
||||
// 文件夹路径
|
||||
private String folderPath = null;
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("business_data_part_file")
|
||||
@ApiModel(value="商务资料对象")
|
||||
|
||||
public class BusinessDataFileEntity {
|
||||
|
||||
//文件id
|
||||
private Long fileId = null;
|
||||
//文件夹id
|
||||
private Long folderId = null;
|
||||
//文件名
|
||||
private String fileName = null;
|
||||
//文件路径
|
||||
private String filePath = null;
|
||||
//文件类型
|
||||
private String fileType = "unknown";
|
||||
//文件大小
|
||||
private Long fileSize = null;
|
||||
//上传时间
|
||||
private Date uploadTime = null;
|
||||
//上传人id
|
||||
private Long uploaderId = null;
|
||||
//是否删除
|
||||
private Boolean isDeleted = false;
|
||||
|
||||
}
|
|
@ -7,8 +7,9 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
|
@ -20,13 +21,15 @@ import java.io.Serializable;
|
|||
@TableName("equipment")
|
||||
@ApiModel(value="EquipmentEntity对象", description="设备信息表")
|
||||
public class EquipmentEntity extends AuditableEntity implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = -6665040704562461286L;
|
||||
|
||||
@ApiModelProperty("设备id")
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String equipmentId;
|
||||
|
||||
@ApiModelProperty("资产编号")
|
||||
private String assetCode;
|
||||
|
||||
@ApiModelProperty("设备名称")
|
||||
private String equipmentName;
|
||||
|
||||
|
@ -45,6 +48,165 @@ public class EquipmentEntity extends AuditableEntity implements Serializable {
|
|||
@ApiModelProperty("设备序列号")
|
||||
private String equipmentSn;
|
||||
|
||||
@ApiModelProperty("品牌")
|
||||
private String brand;
|
||||
|
||||
@ApiModelProperty("配置规格/参数")
|
||||
private String specification;
|
||||
|
||||
@ApiModelProperty("位置状态")
|
||||
private String locationStatus;
|
||||
|
||||
@ApiModelProperty("设备当前物理位置")
|
||||
private String physicalLocation;
|
||||
|
||||
@ApiModelProperty("负责人")
|
||||
private String responsiblePerson;
|
||||
|
||||
@ApiModelProperty("健康状态")
|
||||
private String healthStatus;
|
||||
|
||||
@ApiModelProperty("采购时间")
|
||||
private LocalDateTime purchaseTime;
|
||||
|
||||
@ApiModelProperty("入库时间")
|
||||
private LocalDateTime inStockTime;
|
||||
|
||||
@ApiModelProperty("启用时间")
|
||||
private LocalDateTime activationTime;
|
||||
|
||||
@ApiModelProperty("预计报废时间")
|
||||
private LocalDateTime expectedScrapTime;
|
||||
|
||||
@ApiModelProperty("实际报废时间")
|
||||
private LocalDateTime actualScrapTime;
|
||||
|
||||
@ApiModelProperty("状态变更时间")
|
||||
private LocalDateTime statusChangeTime;
|
||||
|
||||
@ApiModelProperty("采购订单")
|
||||
private String purchaseOrder;
|
||||
|
||||
@ApiModelProperty("供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
// 移除采购价格字段,使用单价和总价替代
|
||||
// @ApiModelProperty("采购价格")
|
||||
// private BigDecimal purchasePrice;
|
||||
|
||||
@ApiModelProperty("当前净值")
|
||||
private BigDecimal currentNetValue;
|
||||
|
||||
@ApiModelProperty("折旧方法")
|
||||
private String depreciationMethod;
|
||||
|
||||
@ApiModelProperty("折旧年限")
|
||||
private Integer depreciationYears;
|
||||
|
||||
@ApiModelProperty("残值")
|
||||
private BigDecimal salvageValue;
|
||||
|
||||
@ApiModelProperty("保修截止日期")
|
||||
private LocalDateTime warrantyExpireDate;
|
||||
|
||||
@ApiModelProperty("上次维护日期")
|
||||
private LocalDateTime lastMaintenanceDate;
|
||||
|
||||
@ApiModelProperty("下次维护日期")
|
||||
private LocalDateTime nextMaintenanceDate;
|
||||
|
||||
@ApiModelProperty("维护人员")
|
||||
private String maintenancePerson;
|
||||
|
||||
@ApiModelProperty("库存条码")
|
||||
private String inventoryBarcode;
|
||||
|
||||
@ApiModelProperty("资产备注")
|
||||
private String assetRemark;
|
||||
|
||||
@ApiModelProperty("次户号")
|
||||
private String accountNumber;
|
||||
|
||||
@ApiModelProperty("数量")
|
||||
private Integer quantity;
|
||||
|
||||
@ApiModelProperty("单价")
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
@ApiModelProperty("总价")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
// 移除备用状态字段,使用现有的 location_status 字段
|
||||
// @ApiModelProperty("备用状态")
|
||||
// private String spareStatus;
|
||||
|
||||
@ApiModelProperty("盘点依据")
|
||||
private String inventoryBasis;
|
||||
|
||||
@ApiModelProperty("动态记录")
|
||||
private String dynamicRecord;
|
||||
|
||||
// 移除认证状态字段,使用现有的 health_status 字段
|
||||
// @ApiModelProperty("认证状态")
|
||||
// private String certificationStatus;
|
||||
|
||||
@ApiModelProperty("使用部门/人")
|
||||
private String usingDepartment;
|
||||
|
||||
@ApiModelProperty("领用时间")
|
||||
private LocalDateTime borrowingTime;
|
||||
|
||||
@ApiModelProperty("归还时间")
|
||||
private LocalDateTime returnTime;
|
||||
|
||||
@ApiModelProperty("出库时间")
|
||||
private LocalDateTime outStockTime;
|
||||
|
||||
@ApiModelProperty("总使用时间")
|
||||
private String totalUsageTime;
|
||||
|
||||
@ApiModelProperty("折旧率")
|
||||
private BigDecimal depreciationRate;
|
||||
|
||||
@ApiModelProperty("折旧方法说明")
|
||||
private String depreciationMethodDesc;
|
||||
|
||||
@ApiModelProperty("发票")
|
||||
private String invoice;
|
||||
|
||||
@ApiModelProperty("发票状态")
|
||||
private String invoiceStatus;
|
||||
|
||||
@ApiModelProperty("附件")
|
||||
private String attachments;
|
||||
|
||||
@ApiModelProperty("照片")
|
||||
private String photos;
|
||||
|
||||
@ApiModelProperty("条码")
|
||||
private String barcode;
|
||||
|
||||
@ApiModelProperty("导入人")
|
||||
private String importer;
|
||||
|
||||
@ApiModelProperty("盘库时间/状态1")
|
||||
private String inventoryTimeStatus1;
|
||||
|
||||
@ApiModelProperty("盘库时间/状态2")
|
||||
private String inventoryTimeStatus2;
|
||||
|
||||
@ApiModelProperty("盘库时间/状态3")
|
||||
private String inventoryTimeStatus3;
|
||||
|
||||
@ApiModelProperty("盘点时间/状态1")
|
||||
private String inventoryCheckTimeStatus1;
|
||||
|
||||
@ApiModelProperty("盘点时间/状态2")
|
||||
private String inventoryCheckTimeStatus2;
|
||||
|
||||
@ApiModelProperty("盘点时间/状态3")
|
||||
private String inventoryCheckTimeStatus3;
|
||||
|
||||
@ApiModelProperty("当前使用记录id")
|
||||
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
||||
private String useRecordId;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
@ -13,6 +12,7 @@ import lombok.EqualsAndHashCode;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
|
@ -50,4 +50,32 @@ public class PostEntity extends AuditableEntity implements Serializable {
|
|||
@ApiModelProperty("备注")
|
||||
@TableField("remark")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
@TableField("create_time")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
@TableField("update_time")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty("岗位说明")
|
||||
@TableField("statement")
|
||||
private String statement;
|
||||
|
||||
@ApiModelProperty("岗位任务")
|
||||
@TableField("responsibilities_task")
|
||||
private String responsibilitiesTask;
|
||||
|
||||
@ApiModelProperty("岗位任职资格")
|
||||
@TableField("qualifications")
|
||||
private String qualifications;
|
||||
|
||||
@ApiModelProperty("岗位工作条件")
|
||||
@TableField("working_conditions")
|
||||
private String workingConditions;
|
||||
|
||||
@ApiModelProperty("岗位薪资")
|
||||
@TableField("salary")
|
||||
private Double salary;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ public class ProjectBudgetInfoEntity extends AuditableEntity implements Serializ
|
|||
|
||||
@ExcelProperty("主键")
|
||||
@ApiModelProperty("主键")
|
||||
@TableId(value = "budget_id", type = IdType.ASSIGN_ID)
|
||||
@TableId(value = "budget_id", type = IdType.AUTO)
|
||||
private String budgetId;
|
||||
|
||||
@ExcelProperty("项目id")
|
||||
|
@ -43,13 +43,8 @@ public class ProjectBudgetInfoEntity extends AuditableEntity implements Serializ
|
|||
@TableField("budget_name")
|
||||
private String budgetName;
|
||||
|
||||
@ExcelProperty("预算类型")
|
||||
@ApiModelProperty("预算类型")
|
||||
@TableField("budget_type")
|
||||
private String budgetType;
|
||||
|
||||
@ExcelProperty("预算金额(万元)")
|
||||
@ApiModelProperty("预算金额(万元)")
|
||||
@ExcelProperty("预算花费金额")
|
||||
@ApiModelProperty("预算花费金额")
|
||||
@TableField("budget_amount")
|
||||
private Double budgetAmount;
|
||||
|
||||
|
@ -57,5 +52,10 @@ public class ProjectBudgetInfoEntity extends AuditableEntity implements Serializ
|
|||
@ApiModelProperty("预算说明")
|
||||
@TableField("budget_desc")
|
||||
private String budgetDesc;
|
||||
|
||||
@ExcelProperty("附件")
|
||||
@ApiModelProperty("附件")
|
||||
@TableField("attach")
|
||||
private String attach;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,16 @@ public class ProjectEntity extends AuditableEntity implements Serializable {
|
|||
@TableId(value = "project_id", type = IdType.ASSIGN_UUID)
|
||||
private String projectId;
|
||||
|
||||
@ExcelProperty("项目来源")
|
||||
@ApiModelProperty("项目来源")
|
||||
@TableField("project_origin")
|
||||
private String projectOrigin;
|
||||
|
||||
@ExcelProperty("项目预算")
|
||||
@ApiModelProperty("项目预算")
|
||||
@TableField("project_budget")
|
||||
private Integer projectBudget;
|
||||
|
||||
@ExcelProperty("项目名称")
|
||||
@ApiModelProperty("项目名称")
|
||||
@TableField("project_name")
|
||||
|
@ -169,5 +179,35 @@ public class ProjectEntity extends AuditableEntity implements Serializable {
|
|||
// 施工人员,安全经理,项目经理,商务,财务,高级管理员,项目远程顾问外部协作者,质量经理、现场经理及工作组长。
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private LocalDate endDate;
|
||||
|
||||
@ApiModelProperty("人工成本")
|
||||
private Double laborCost;
|
||||
|
||||
@ApiModelProperty("设备摊销")
|
||||
private Double equipmentAmortization;
|
||||
|
||||
@ApiModelProperty("奖金预提")
|
||||
private Double bonusProvision;
|
||||
|
||||
@ApiModelProperty("交通食宿")
|
||||
private Double transAccomMeals;
|
||||
|
||||
@ApiModelProperty("其他杂费")
|
||||
private Double othersCost;
|
||||
|
||||
@ApiModelProperty("已用人工成本")
|
||||
private Double useLaborCost;
|
||||
|
||||
@ApiModelProperty("已用设备摊销")
|
||||
private Double useEquipmentAmortization;
|
||||
|
||||
@ApiModelProperty("已用奖金预提")
|
||||
private Double useBonusProvision;
|
||||
|
||||
@ApiModelProperty("已用交通食宿")
|
||||
private Double useTransAccomMeals;
|
||||
|
||||
@ApiModelProperty("已用其他杂费")
|
||||
private Double useOthersCost;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
@ -39,9 +42,7 @@ public class RegulationEntity extends AuditableEntity implements Serializable {
|
|||
@TableField("content")
|
||||
private String content;
|
||||
|
||||
@ExcelProperty("制度类型")
|
||||
@ApiModelProperty("制度类型")
|
||||
@TableField("regulation_type")
|
||||
@TableField(exist = false)
|
||||
private String type;
|
||||
|
||||
@ExcelProperty("制度状态")
|
||||
|
@ -97,7 +98,8 @@ public class RegulationEntity extends AuditableEntity implements Serializable {
|
|||
@ApiModelProperty("创建人姓名")
|
||||
private String createByName;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ExcelProperty("制度类型")
|
||||
@ApiModelProperty("制度类型")
|
||||
@TableField("regulation_type")
|
||||
private String regulationType;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.dite.znpt.domain.page;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PageBean {
|
||||
private Long total;
|
||||
private List<?> rows;
|
||||
}
|
|
@ -7,7 +7,6 @@ import lombok.Data;
|
|||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
|
@ -42,9 +41,6 @@ public class ContractListReq implements Serializable {
|
|||
@ApiModelProperty("部门id")
|
||||
private String departmentId;
|
||||
|
||||
@ApiModelProperty("签订日期")
|
||||
private Date signDate;
|
||||
|
||||
@ApiModelProperty("期限")
|
||||
private String duration;
|
||||
|
||||
|
@ -54,12 +50,6 @@ public class ContractListReq implements Serializable {
|
|||
@ApiModelProperty("产品或服务")
|
||||
private String productService;
|
||||
|
||||
@ApiModelProperty("付款日期/交付日期")
|
||||
private Date paymentDate;
|
||||
|
||||
@ApiModelProperty("履约时间期限")
|
||||
private Date performanceDeadline;
|
||||
|
||||
@ApiModelProperty("付款地址/交付地址")
|
||||
private String paymentAddress;
|
||||
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.dite.znpt.domain.entity.ContractEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.dite.znpt.domain.entity.ContractEntity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
|
@ -35,5 +32,8 @@ public class ContractResp extends ContractEntity {
|
|||
|
||||
@ApiModelProperty("已收款金额")
|
||||
private BigDecimal receivedAmount;
|
||||
|
||||
@ApiModelProperty("合同状态名称")
|
||||
private String contractStatusLabel;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
|
@ -26,4 +27,154 @@ public class EquipmentListReq implements Serializable {
|
|||
|
||||
@ApiModelProperty("设备状态,0-空闲中,1-使用,3-保养中,4-维修中,5-已报废")
|
||||
private String equipmentStatus;
|
||||
|
||||
@ApiModelProperty("设备序列号")
|
||||
private String equipmentSn;
|
||||
|
||||
@ApiModelProperty("资产编号")
|
||||
private String assetCode;
|
||||
|
||||
@ApiModelProperty("品牌")
|
||||
private String brand;
|
||||
|
||||
@ApiModelProperty("位置状态")
|
||||
private String locationStatus;
|
||||
|
||||
@ApiModelProperty("健康状态")
|
||||
private String healthStatus;
|
||||
|
||||
@ApiModelProperty("负责人")
|
||||
private String responsiblePerson;
|
||||
|
||||
@ApiModelProperty("使用状态,0-空闲中,1-使用中")
|
||||
private String useStatus;
|
||||
|
||||
@ApiModelProperty("项目ID")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("用户ID")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty("设备型号")
|
||||
private String equipmentModel;
|
||||
|
||||
@ApiModelProperty("配置规格/参数")
|
||||
private String specification;
|
||||
|
||||
@ApiModelProperty("设备当前物理位置")
|
||||
private String physicalLocation;
|
||||
|
||||
@ApiModelProperty("供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
@ApiModelProperty("采购订单号")
|
||||
private String purchaseOrder;
|
||||
|
||||
@ApiModelProperty("维护人员")
|
||||
private String maintenancePerson;
|
||||
|
||||
@ApiModelProperty("次户号")
|
||||
private String accountNumber;
|
||||
|
||||
@ApiModelProperty("数量")
|
||||
private Integer quantity;
|
||||
|
||||
@ApiModelProperty("单价")
|
||||
private java.math.BigDecimal unitPrice;
|
||||
|
||||
@ApiModelProperty("总价")
|
||||
private java.math.BigDecimal totalPrice;
|
||||
|
||||
@ApiModelProperty("盘点依据")
|
||||
private String inventoryBasis;
|
||||
|
||||
@ApiModelProperty("动态记录")
|
||||
private String dynamicRecord;
|
||||
|
||||
@ApiModelProperty("库存条码")
|
||||
private String inventoryBarcode;
|
||||
|
||||
@ApiModelProperty("资产备注")
|
||||
private String assetRemark;
|
||||
|
||||
@ApiModelProperty("使用部门/人")
|
||||
private String usingDepartment;
|
||||
|
||||
@ApiModelProperty("发票")
|
||||
private String invoice;
|
||||
|
||||
@ApiModelProperty("条码")
|
||||
private String barcode;
|
||||
|
||||
@ApiModelProperty("导入人")
|
||||
private String importer;
|
||||
|
||||
@ApiModelProperty("采购时间开始")
|
||||
private LocalDateTime purchaseTimeStart;
|
||||
|
||||
@ApiModelProperty("采购时间结束")
|
||||
private LocalDateTime purchaseTimeEnd;
|
||||
|
||||
@ApiModelProperty("入库时间开始")
|
||||
private LocalDateTime inStockTimeStart;
|
||||
|
||||
@ApiModelProperty("入库时间结束")
|
||||
private LocalDateTime inStockTimeEnd;
|
||||
|
||||
@ApiModelProperty("启用时间开始")
|
||||
private LocalDateTime activationTimeStart;
|
||||
|
||||
@ApiModelProperty("启用时间结束")
|
||||
private LocalDateTime activationTimeEnd;
|
||||
|
||||
@ApiModelProperty("预计报废时间开始")
|
||||
private LocalDateTime expectedScrapTimeStart;
|
||||
|
||||
@ApiModelProperty("预计报废时间结束")
|
||||
private LocalDateTime expectedScrapTimeEnd;
|
||||
|
||||
@ApiModelProperty("保修截止日期开始")
|
||||
private LocalDateTime warrantyExpireDateStart;
|
||||
|
||||
@ApiModelProperty("保修截止日期结束")
|
||||
private LocalDateTime warrantyExpireDateEnd;
|
||||
|
||||
@ApiModelProperty("上次维护日期开始")
|
||||
private LocalDateTime lastMaintenanceDateStart;
|
||||
|
||||
@ApiModelProperty("上次维护日期结束")
|
||||
private LocalDateTime lastMaintenanceDateEnd;
|
||||
|
||||
@ApiModelProperty("下次维护日期开始")
|
||||
private LocalDateTime nextMaintenanceDateStart;
|
||||
|
||||
@ApiModelProperty("下次维护日期结束")
|
||||
private LocalDateTime nextMaintenanceDateEnd;
|
||||
|
||||
@ApiModelProperty("创建时间开始")
|
||||
private LocalDateTime createTimeStart;
|
||||
|
||||
@ApiModelProperty("创建时间结束")
|
||||
private LocalDateTime createTimeEnd;
|
||||
|
||||
@ApiModelProperty("更新时间开始")
|
||||
private LocalDateTime updateTimeStart;
|
||||
|
||||
@ApiModelProperty("更新时间结束")
|
||||
private LocalDateTime updateTimeEnd;
|
||||
|
||||
@ApiModelProperty("当前页码")
|
||||
private Integer pageNum;
|
||||
|
||||
@ApiModelProperty("每页大小")
|
||||
private Integer pageSize;
|
||||
|
||||
@ApiModelProperty("排序字段")
|
||||
private String orderBy;
|
||||
|
||||
@ApiModelProperty("排序方向")
|
||||
private String orderDirection;
|
||||
|
||||
@ApiModelProperty("页码")
|
||||
private Integer page;
|
||||
}
|
||||
|
|
|
@ -8,6 +8,8 @@ import javax.validation.constraints.NotBlank;
|
|||
import javax.validation.constraints.Size;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
|
@ -22,7 +24,7 @@ public class EquipmentReq implements Serializable {
|
|||
|
||||
@ApiModelProperty("设备名称")
|
||||
@NotBlank(message = "设备名称不能为空")
|
||||
@Size(max = 100, message = "设备名称长度不能超过100个字")
|
||||
@Size(max = 200, message = "设备名称长度不能超过200个字")
|
||||
private String equipmentName;
|
||||
|
||||
@ApiModelProperty("设备类型, 枚举:EquipmentTypeEnum")
|
||||
|
@ -31,11 +33,204 @@ public class EquipmentReq implements Serializable {
|
|||
|
||||
@ApiModelProperty("设备型号")
|
||||
@NotBlank(message = "设备型号不能为空")
|
||||
@Size(max = 50, message = "设备型号长度不能超过50个字")
|
||||
@Size(max = 200, message = "设备型号长度不能超过200个字")
|
||||
private String equipmentModel;
|
||||
|
||||
@ApiModelProperty("设备SN")
|
||||
@NotBlank(message = "设备SN不能为空")
|
||||
@Size(max = 50, message = "设备SN长度不能超过50个字")
|
||||
@Size(max = 100, message = "设备SN长度不能超过100个字")
|
||||
private String equipmentSn;
|
||||
|
||||
@ApiModelProperty("资产编号")
|
||||
@Size(max = 50, message = "资产编号长度不能超过50个字")
|
||||
private String assetCode;
|
||||
|
||||
@ApiModelProperty("品牌")
|
||||
@Size(max = 100, message = "品牌长度不能超过100个字")
|
||||
private String brand;
|
||||
|
||||
@ApiModelProperty("配置规格/参数")
|
||||
@Size(max = 500, message = "配置规格长度不能超过500个字")
|
||||
private String specification;
|
||||
|
||||
@ApiModelProperty("设备状态,枚举:EquipmentStatusEnum")
|
||||
private String equipmentStatus;
|
||||
|
||||
@ApiModelProperty("使用状态,0-空闲中,1-使用中")
|
||||
private String useStatus;
|
||||
|
||||
@ApiModelProperty("位置状态")
|
||||
private String locationStatus;
|
||||
|
||||
@ApiModelProperty("设备当前物理位置")
|
||||
@Size(max = 200, message = "物理位置长度不能超过200个字")
|
||||
private String physicalLocation;
|
||||
|
||||
@ApiModelProperty("负责人")
|
||||
@Size(max = 100, message = "负责人长度不能超过100个字")
|
||||
private String responsiblePerson;
|
||||
|
||||
@ApiModelProperty("健康状态")
|
||||
private String healthStatus;
|
||||
|
||||
@ApiModelProperty("采购时间")
|
||||
private LocalDateTime purchaseTime;
|
||||
|
||||
@ApiModelProperty("入库时间")
|
||||
private LocalDateTime inStockTime;
|
||||
|
||||
@ApiModelProperty("启用时间")
|
||||
private LocalDateTime activationTime;
|
||||
|
||||
@ApiModelProperty("预计报废时间")
|
||||
private LocalDateTime expectedScrapTime;
|
||||
|
||||
@ApiModelProperty("实际报废时间")
|
||||
private LocalDateTime actualScrapTime;
|
||||
|
||||
@ApiModelProperty("状态变更时间")
|
||||
private LocalDateTime statusChangeTime;
|
||||
|
||||
@ApiModelProperty("采购订单")
|
||||
@Size(max = 100, message = "采购订单长度不能超过100个字")
|
||||
private String purchaseOrder;
|
||||
|
||||
@ApiModelProperty("供应商名称")
|
||||
@Size(max = 200, message = "供应商名称长度不能超过200个字")
|
||||
private String supplierName;
|
||||
|
||||
// 移除采购价格字段,使用单价和总价替代
|
||||
// @ApiModelProperty("采购价格")
|
||||
// private BigDecimal purchasePrice;
|
||||
|
||||
@ApiModelProperty("当前净值")
|
||||
private BigDecimal currentNetValue;
|
||||
|
||||
@ApiModelProperty("折旧方法")
|
||||
private String depreciationMethod;
|
||||
|
||||
@ApiModelProperty("折旧年限")
|
||||
private Integer depreciationYears;
|
||||
|
||||
@ApiModelProperty("残值")
|
||||
private BigDecimal salvageValue;
|
||||
|
||||
@ApiModelProperty("保修截止日期")
|
||||
private LocalDateTime warrantyExpireDate;
|
||||
|
||||
@ApiModelProperty("上次维护日期")
|
||||
private LocalDateTime lastMaintenanceDate;
|
||||
|
||||
@ApiModelProperty("下次维护日期")
|
||||
private LocalDateTime nextMaintenanceDate;
|
||||
|
||||
@ApiModelProperty("维护人员")
|
||||
@Size(max = 100, message = "维护人员长度不能超过100个字")
|
||||
private String maintenancePerson;
|
||||
|
||||
@ApiModelProperty("库存条码")
|
||||
@Size(max = 100, message = "库存条码长度不能超过100个字")
|
||||
private String inventoryBarcode;
|
||||
|
||||
@ApiModelProperty("资产备注")
|
||||
@Size(max = 1000, message = "资产备注长度不能超过1000个字")
|
||||
private String assetRemark;
|
||||
|
||||
@ApiModelProperty("次户号")
|
||||
private String accountNumber;
|
||||
|
||||
@ApiModelProperty("数量")
|
||||
private Integer quantity;
|
||||
|
||||
@ApiModelProperty("单价")
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
@ApiModelProperty("总价")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
// 移除备用状态字段,使用现有的 location_status 字段
|
||||
// @ApiModelProperty("备用状态")
|
||||
// private String spareStatus;
|
||||
|
||||
@ApiModelProperty("盘点依据")
|
||||
private String inventoryBasis;
|
||||
|
||||
@ApiModelProperty("动态记录")
|
||||
private String dynamicRecord;
|
||||
|
||||
// 移除认证状态字段,使用现有的 health_status 字段
|
||||
// @ApiModelProperty("认证状态")
|
||||
// private String certificationStatus;
|
||||
|
||||
@ApiModelProperty("使用部门/人")
|
||||
@Size(max = 200, message = "使用部门/人长度不能超过200个字")
|
||||
private String usingDepartment;
|
||||
|
||||
@ApiModelProperty("领用时间")
|
||||
private LocalDateTime borrowingTime;
|
||||
|
||||
@ApiModelProperty("归还时间")
|
||||
private LocalDateTime returnTime;
|
||||
|
||||
@ApiModelProperty("出库时间")
|
||||
private LocalDateTime outStockTime;
|
||||
|
||||
@ApiModelProperty("总使用时间")
|
||||
@Size(max = 100, message = "总使用时间长度不能超过100个字")
|
||||
private String totalUsageTime;
|
||||
|
||||
@ApiModelProperty("折旧率")
|
||||
private BigDecimal depreciationRate;
|
||||
|
||||
@ApiModelProperty("折旧方法说明")
|
||||
@Size(max = 500, message = "折旧方法说明长度不能超过500个字")
|
||||
private String depreciationMethodDesc;
|
||||
|
||||
@ApiModelProperty("发票")
|
||||
@Size(max = 100, message = "发票长度不能超过100个字")
|
||||
private String invoice;
|
||||
|
||||
@ApiModelProperty("发票状态")
|
||||
@Size(max = 50, message = "发票状态长度不能超过50个字")
|
||||
private String invoiceStatus;
|
||||
|
||||
@ApiModelProperty("附件")
|
||||
@Size(max = 500, message = "附件长度不能超过500个字")
|
||||
private String attachments;
|
||||
|
||||
@ApiModelProperty("照片")
|
||||
@Size(max = 500, message = "照片长度不能超过500个字")
|
||||
private String photos;
|
||||
|
||||
@ApiModelProperty("条码")
|
||||
@Size(max = 100, message = "条码长度不能超过100个字")
|
||||
private String barcode;
|
||||
|
||||
@ApiModelProperty("导入人")
|
||||
@Size(max = 100, message = "导入人长度不能超过100个字")
|
||||
private String importer;
|
||||
|
||||
@ApiModelProperty("盘库时间/状态1")
|
||||
@Size(max = 100, message = "盘库时间/状态1长度不能超过100个字")
|
||||
private String inventoryTimeStatus1;
|
||||
|
||||
@ApiModelProperty("盘库时间/状态2")
|
||||
@Size(max = 100, message = "盘库时间/状态2长度不能超过100个字")
|
||||
private String inventoryTimeStatus2;
|
||||
|
||||
@ApiModelProperty("盘库时间/状态3")
|
||||
@Size(max = 100, message = "盘库时间/状态3长度不能超过100个字")
|
||||
private String inventoryTimeStatus3;
|
||||
|
||||
@ApiModelProperty("盘点时间/状态1")
|
||||
@Size(max = 100, message = "盘点时间/状态1长度不能超过100个字")
|
||||
private String inventoryCheckTimeStatus1;
|
||||
|
||||
@ApiModelProperty("盘点时间/状态2")
|
||||
@Size(max = 100, message = "盘点时间/状态2长度不能超过100个字")
|
||||
private String inventoryCheckTimeStatus2;
|
||||
|
||||
@ApiModelProperty("盘点时间/状态3")
|
||||
@Size(max = 100, message = "盘点时间/状态3长度不能超过100个字")
|
||||
private String inventoryCheckTimeStatus3;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
|
@ -21,6 +23,9 @@ public class EquipmentResp implements Serializable {
|
|||
@ApiModelProperty("设备ID")
|
||||
private String equipmentId;
|
||||
|
||||
@ApiModelProperty("资产编号")
|
||||
private String assetCode;
|
||||
|
||||
@ApiModelProperty("设备名称")
|
||||
private String equipmentName;
|
||||
|
||||
|
@ -36,6 +41,12 @@ public class EquipmentResp implements Serializable {
|
|||
@ApiModelProperty("设备SN")
|
||||
private String equipmentSn;
|
||||
|
||||
@ApiModelProperty("品牌")
|
||||
private String brand;
|
||||
|
||||
@ApiModelProperty("配置规格/参数")
|
||||
private String specification;
|
||||
|
||||
@ApiModelProperty("设备状态, 枚举:EquipmentStatusEnum")
|
||||
private String equipmentStatus;
|
||||
|
||||
|
@ -45,6 +56,171 @@ public class EquipmentResp implements Serializable {
|
|||
@ApiModelProperty("设备使用状态,0-空闲中,1-使用中")
|
||||
private String useStatus;
|
||||
|
||||
@ApiModelProperty("位置状态")
|
||||
private String locationStatus;
|
||||
|
||||
@ApiModelProperty("位置状态描述")
|
||||
private String locationStatusLabel;
|
||||
|
||||
@ApiModelProperty("设备当前物理位置")
|
||||
private String physicalLocation;
|
||||
|
||||
@ApiModelProperty("负责人")
|
||||
private String responsiblePerson;
|
||||
|
||||
@ApiModelProperty("健康状态")
|
||||
private String healthStatus;
|
||||
|
||||
@ApiModelProperty("健康状态描述")
|
||||
private String healthStatusLabel;
|
||||
|
||||
@ApiModelProperty("采购时间")
|
||||
private LocalDateTime purchaseTime;
|
||||
|
||||
@ApiModelProperty("入库时间")
|
||||
private LocalDateTime inStockTime;
|
||||
|
||||
@ApiModelProperty("启用时间")
|
||||
private LocalDateTime activationTime;
|
||||
|
||||
@ApiModelProperty("预计报废时间")
|
||||
private LocalDateTime expectedScrapTime;
|
||||
|
||||
@ApiModelProperty("实际报废时间")
|
||||
private LocalDateTime actualScrapTime;
|
||||
|
||||
@ApiModelProperty("状态变更时间")
|
||||
private LocalDateTime statusChangeTime;
|
||||
|
||||
@ApiModelProperty("采购订单")
|
||||
private String purchaseOrder;
|
||||
|
||||
@ApiModelProperty("供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
// 移除采购价格字段,使用单价和总价替代
|
||||
// @ApiModelProperty("采购价格")
|
||||
// private BigDecimal purchasePrice;
|
||||
|
||||
@ApiModelProperty("当前净值")
|
||||
private BigDecimal currentNetValue;
|
||||
|
||||
@ApiModelProperty("折旧方法")
|
||||
private String depreciationMethod;
|
||||
|
||||
@ApiModelProperty("折旧年限")
|
||||
private Integer depreciationYears;
|
||||
|
||||
@ApiModelProperty("残值")
|
||||
private BigDecimal salvageValue;
|
||||
|
||||
@ApiModelProperty("保修截止日期")
|
||||
private LocalDateTime warrantyExpireDate;
|
||||
|
||||
@ApiModelProperty("上次维护日期")
|
||||
private LocalDateTime lastMaintenanceDate;
|
||||
|
||||
@ApiModelProperty("下次维护日期")
|
||||
private LocalDateTime nextMaintenanceDate;
|
||||
|
||||
@ApiModelProperty("维护人员")
|
||||
private String maintenancePerson;
|
||||
|
||||
@ApiModelProperty("库存条码")
|
||||
private String inventoryBarcode;
|
||||
|
||||
@ApiModelProperty("资产备注")
|
||||
private String assetRemark;
|
||||
|
||||
@ApiModelProperty("次户号")
|
||||
private String accountNumber;
|
||||
|
||||
@ApiModelProperty("数量")
|
||||
private Integer quantity;
|
||||
|
||||
@ApiModelProperty("单价")
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
@ApiModelProperty("总价")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
// 移除备用状态字段,使用现有的 location_status 字段
|
||||
// @ApiModelProperty("备用状态")
|
||||
// private String spareStatus;
|
||||
|
||||
// @ApiModelProperty("备用状态描述")
|
||||
// private String spareStatusLabel;
|
||||
|
||||
@ApiModelProperty("盘点依据")
|
||||
private String inventoryBasis;
|
||||
|
||||
@ApiModelProperty("动态记录")
|
||||
private String dynamicRecord;
|
||||
|
||||
// 移除认证状态字段,使用现有的 health_status 字段
|
||||
// @ApiModelProperty("认证状态")
|
||||
// private String certificationStatus;
|
||||
|
||||
// @ApiModelProperty("认证状态描述")
|
||||
// private String certificationStatusLabel;
|
||||
|
||||
@ApiModelProperty("使用部门/人")
|
||||
private String usingDepartment;
|
||||
|
||||
@ApiModelProperty("领用时间")
|
||||
private LocalDateTime borrowingTime;
|
||||
|
||||
@ApiModelProperty("归还时间")
|
||||
private LocalDateTime returnTime;
|
||||
|
||||
@ApiModelProperty("出库时间")
|
||||
private LocalDateTime outStockTime;
|
||||
|
||||
@ApiModelProperty("总使用时间")
|
||||
private String totalUsageTime;
|
||||
|
||||
@ApiModelProperty("折旧率")
|
||||
private BigDecimal depreciationRate;
|
||||
|
||||
@ApiModelProperty("折旧方法说明")
|
||||
private String depreciationMethodDesc;
|
||||
|
||||
@ApiModelProperty("发票")
|
||||
private String invoice;
|
||||
|
||||
@ApiModelProperty("发票状态")
|
||||
private String invoiceStatus;
|
||||
|
||||
@ApiModelProperty("附件")
|
||||
private String attachments;
|
||||
|
||||
@ApiModelProperty("照片")
|
||||
private String photos;
|
||||
|
||||
@ApiModelProperty("条码")
|
||||
private String barcode;
|
||||
|
||||
@ApiModelProperty("导入人")
|
||||
private String importer;
|
||||
|
||||
@ApiModelProperty("盘库时间/状态1")
|
||||
private String inventoryTimeStatus1;
|
||||
|
||||
@ApiModelProperty("盘库时间/状态2")
|
||||
private String inventoryTimeStatus2;
|
||||
|
||||
@ApiModelProperty("盘库时间/状态3")
|
||||
private String inventoryTimeStatus3;
|
||||
|
||||
@ApiModelProperty("盘点时间/状态1")
|
||||
private String inventoryCheckTimeStatus1;
|
||||
|
||||
@ApiModelProperty("盘点时间/状态2")
|
||||
private String inventoryCheckTimeStatus2;
|
||||
|
||||
@ApiModelProperty("盘点时间/状态3")
|
||||
private String inventoryCheckTimeStatus3;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
|
@ -56,4 +232,10 @@ public class EquipmentResp implements Serializable {
|
|||
|
||||
@ApiModelProperty("使用人")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
|
|
|
@ -33,9 +33,24 @@ public class PostReq implements Serializable {
|
|||
@ApiModelProperty("显示顺序")
|
||||
private Integer postSort;
|
||||
|
||||
@ApiModelProperty("状态(0正常 1停用)")
|
||||
@ApiModelProperty("状态(0停用 1正常)")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("岗位说明")
|
||||
private String statement;
|
||||
|
||||
@ApiModelProperty("岗位任务")
|
||||
private String responsibilitiesTask;
|
||||
|
||||
@ApiModelProperty("岗位任职资格")
|
||||
private String qualifications;
|
||||
|
||||
@ApiModelProperty("岗位工作条件")
|
||||
private String workingConditions;
|
||||
|
||||
@ApiModelProperty("岗位薪资")
|
||||
private Double salary;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import lombok.Data;
|
|||
import javax.validation.constraints.Size;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
|
@ -41,4 +42,25 @@ public class PostResp implements Serializable {
|
|||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty("岗位说明")
|
||||
private String statement;
|
||||
|
||||
@ApiModelProperty("岗位任务")
|
||||
private String responsibilitiesTask;
|
||||
|
||||
@ApiModelProperty("岗位任职资格")
|
||||
private String qualifications;
|
||||
|
||||
@ApiModelProperty("岗位工作条件")
|
||||
private String workingConditions;
|
||||
|
||||
@ApiModelProperty("岗位薪资")
|
||||
private Double salary;
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@ApiModel("项目预算信息详情")
|
||||
public class ProjectBudgetInfoDetailResp implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 766154886845694269L;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("项目预算")
|
||||
private Double projectBudget;
|
||||
|
||||
@ApiModelProperty("人工成本")
|
||||
private Double laborCost;
|
||||
|
||||
@ApiModelProperty("设备摊销")
|
||||
private Double equipmentAmortization;
|
||||
|
||||
@ApiModelProperty("奖金预提")
|
||||
private Double bonusProvision;
|
||||
|
||||
@ApiModelProperty("交通食宿")
|
||||
private Double transAccomMeals;
|
||||
|
||||
@ApiModelProperty("其他杂费")
|
||||
private Double othersCost;
|
||||
|
||||
@ApiModelProperty("已用人工成本")
|
||||
private Double useLaborCost;
|
||||
|
||||
@ApiModelProperty("已用设备摊销")
|
||||
private Double useEquipmentAmortization;
|
||||
|
||||
@ApiModelProperty("已用奖金预提")
|
||||
private Double useBonusProvision;
|
||||
|
||||
@ApiModelProperty("已用交通食宿")
|
||||
private Double useTransAccomMeals;
|
||||
|
||||
@ApiModelProperty("已用其他杂费")
|
||||
private Double useOthersCost;
|
||||
|
||||
@ApiModelProperty("剩余预算")
|
||||
private Double restBudget;
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/17 21:58
|
||||
* @Description: 项目预算信息表导入请求类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="ProjectBudgetInfo导入请求对象", description="项目预算信息表")
|
||||
public class ProjectBudgetInfoImportReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 580212651388155611L;
|
||||
|
||||
@ExcelProperty(value = "项目Id")
|
||||
private String projectId;
|
||||
|
||||
@ExcelProperty(value = "预算名称")
|
||||
private String budgetName;
|
||||
|
||||
@ExcelProperty(value = "预算花费金额")
|
||||
private Double budgetAmount;
|
||||
|
||||
@ExcelProperty(value = "预算说明")
|
||||
private String budgetDesc;
|
||||
|
||||
@ExcelProperty(value = "附件")
|
||||
private String attach;
|
||||
}
|
|
@ -22,7 +22,7 @@ public class ProjectBudgetInfoListReq implements Serializable {
|
|||
@ApiModelProperty("查询关键字")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("项目预算信息Id")
|
||||
@ApiModelProperty("项目预算单Id")
|
||||
private String budgetId;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
|
@ -31,14 +31,10 @@ public class ProjectBudgetInfoListReq implements Serializable {
|
|||
@ApiModelProperty("预算名称")
|
||||
private String budgetName;
|
||||
|
||||
@ApiModelProperty("预算类型")
|
||||
private String budgetType;
|
||||
|
||||
@ApiModelProperty("预算金额(万元)")
|
||||
@ApiModelProperty("预算花费金额")
|
||||
private Double budgetAmount;
|
||||
|
||||
@ApiModelProperty("预算说明")
|
||||
private String budgetDesc;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.dite.znpt.domain.vo;
|
|||
|
||||
import com.dite.znpt.domain.entity.ProjectBudgetInfoEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
|
@ -14,6 +15,7 @@ import lombok.EqualsAndHashCode;
|
|||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("项目预算信息列表响应实体")
|
||||
public class ProjectBudgetInfoListResp extends ProjectBudgetInfoEntity {
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
private String projectName;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,16 +26,13 @@ public class ProjectBudgetInfoReq implements Serializable {
|
|||
@ApiModelProperty("预算名称")
|
||||
private String budgetName;
|
||||
|
||||
@ApiModelProperty("预算类型")
|
||||
private String budgetType;
|
||||
|
||||
@ApiModelProperty("预算金额(万元)")
|
||||
@ApiModelProperty("预算花费金额")
|
||||
private Double budgetAmount;
|
||||
|
||||
@ApiModelProperty("预算说明")
|
||||
private String budgetDesc;
|
||||
|
||||
@ApiModelProperty("附件id")
|
||||
private String attachId;
|
||||
@ApiModelProperty("附件")
|
||||
private String attach;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,8 +15,7 @@ import lombok.EqualsAndHashCode;
|
|||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("项目预算信息响应实体")
|
||||
public class ProjectBudgetInfoResp extends ProjectBudgetInfoEntity {
|
||||
|
||||
@ApiModelProperty("预算类型描述")
|
||||
private String budgetTypeDesc;
|
||||
@ApiModelProperty("项目名称")
|
||||
private String projectName;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -70,12 +71,31 @@ public class ProjectDetailResp {
|
|||
@ApiModelProperty("结束时间")
|
||||
private LocalDate endDate;
|
||||
|
||||
@ApiModelProperty("计划开始时间")
|
||||
private LocalDate plannedStartDate;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private String createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private String updateTime;
|
||||
|
||||
// 新增字段 - 对应前端ProjectCard接口
|
||||
@ApiModelProperty("项目预算(万元)")
|
||||
private BigDecimal budget;
|
||||
|
||||
@ApiModelProperty("项目经理")
|
||||
private String manager;
|
||||
|
||||
@ApiModelProperty("团队规模")
|
||||
private Integer teamSize;
|
||||
|
||||
@ApiModelProperty("准备进度百分比")
|
||||
private Integer preparationProgress;
|
||||
|
||||
@ApiModelProperty("项目进度百分比")
|
||||
private Integer progress;
|
||||
|
||||
// 项目人员信息(从新关联表获取)
|
||||
@ApiModelProperty("项目人员列表")
|
||||
private List<ProjectMemberResp> projectMembers;
|
||||
|
@ -152,9 +172,6 @@ public class ProjectDetailResp {
|
|||
@ApiModelProperty("预算名称")
|
||||
private String budgetName;
|
||||
|
||||
@ApiModelProperty("预算类型")
|
||||
private String budgetType;
|
||||
|
||||
@ApiModelProperty("预算金额(万元)")
|
||||
private Double budgetAmount;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -71,6 +72,9 @@ public class ProjectKanbanDataResp {
|
|||
@ApiModelProperty("结束时间")
|
||||
private LocalDate endDate;
|
||||
|
||||
@ApiModelProperty("计划开始时间")
|
||||
private LocalDate plannedStartDate;
|
||||
|
||||
@ApiModelProperty("项目经理")
|
||||
private String projectManagerName;
|
||||
|
||||
|
@ -103,5 +107,67 @@ public class ProjectKanbanDataResp {
|
|||
|
||||
@ApiModelProperty("更新时间")
|
||||
private String updateTime;
|
||||
|
||||
// 新增字段 - 对应前端ProjectCard接口
|
||||
@ApiModelProperty("项目预算(万元)")
|
||||
private BigDecimal budget;
|
||||
|
||||
@ApiModelProperty("项目经理")
|
||||
private String manager;
|
||||
|
||||
@ApiModelProperty("团队规模")
|
||||
private Integer teamSize;
|
||||
|
||||
@ApiModelProperty("准备进度百分比")
|
||||
private Integer preparationProgress;
|
||||
|
||||
@ApiModelProperty("项目进度百分比")
|
||||
private Integer progress;
|
||||
|
||||
@ApiModelProperty("团队成员列表")
|
||||
private List<TeamMemberResp> teamMembers;
|
||||
|
||||
@Data
|
||||
@ApiModel(value="TeamMemberResp对象", description="团队成员响应")
|
||||
public static class TeamMemberResp {
|
||||
@ApiModelProperty("成员ID")
|
||||
private String memberId;
|
||||
|
||||
@ApiModelProperty("用户ID")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty("用户姓名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("用户账号")
|
||||
private String userAccount;
|
||||
|
||||
@ApiModelProperty("用户头像")
|
||||
private String userAvatar;
|
||||
|
||||
@ApiModelProperty("角色类型")
|
||||
private String roleType;
|
||||
|
||||
@ApiModelProperty("角色类型描述")
|
||||
private String roleTypeDesc;
|
||||
|
||||
@ApiModelProperty("岗位代码")
|
||||
private String jobCode;
|
||||
|
||||
@ApiModelProperty("岗位代码描述")
|
||||
private String jobCodeDesc;
|
||||
|
||||
@ApiModelProperty("岗位描述")
|
||||
private String jobDesc;
|
||||
|
||||
@ApiModelProperty("加入时间")
|
||||
private LocalDate joinDate;
|
||||
|
||||
@ApiModelProperty("离开时间")
|
||||
private LocalDate leaveDate;
|
||||
|
||||
@ApiModelProperty("状态")
|
||||
private String status;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,5 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
@ -23,6 +21,12 @@ public class ProjectListReq implements Serializable {
|
|||
@ApiModelProperty("项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty(value = "项目来源")
|
||||
private String projectOrigin;
|
||||
|
||||
@ApiModelProperty(value = "项目预算")
|
||||
private Integer projectBudget;
|
||||
|
||||
@ApiModelProperty("风场名称")
|
||||
private String farmName;
|
||||
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
@ -12,7 +7,6 @@ import lombok.Data;
|
|||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
|
@ -31,6 +25,12 @@ public class ProjectListResp implements Serializable {
|
|||
@ApiModelProperty("项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty(value = "项目来源")
|
||||
private String projectOrigin;
|
||||
|
||||
@ApiModelProperty(value = "项目预算")
|
||||
private Integer projectBudget;
|
||||
|
||||
@ApiModelProperty("风场名称")
|
||||
private String farmName;
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.dite.znpt.util.ValidationGroup;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
@ -28,6 +27,14 @@ public class ProjectReq implements Serializable {
|
|||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
@NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "项目来源不能为空")
|
||||
@ApiModelProperty("项目来源")
|
||||
private String projectOrigin;
|
||||
|
||||
@NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "项目预算不能为空")
|
||||
@ApiModelProperty("项目预算")
|
||||
private Integer projectBudget;
|
||||
|
||||
@NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "项目名称不能为空")
|
||||
@Size(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, max = 50, message = "项目名称长度不能超过50字符")
|
||||
@ApiModelProperty("项目名称")
|
||||
|
@ -105,4 +112,19 @@ public class ProjectReq implements Serializable {
|
|||
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private LocalDate endDate;
|
||||
|
||||
@ApiModelProperty("人工成本")
|
||||
private Double laborCost;
|
||||
|
||||
@ApiModelProperty("设备摊销")
|
||||
private Double equipmentAmortization;
|
||||
|
||||
@ApiModelProperty("奖金预提")
|
||||
private Double bonusProvision;
|
||||
|
||||
@ApiModelProperty("交通食宿")
|
||||
private Double transAccomMeals;
|
||||
|
||||
@ApiModelProperty("其他杂费")
|
||||
private Double othersCost;
|
||||
}
|
||||
|
|
|
@ -1,19 +1,11 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.dite.znpt.domain.entity.ProjectEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
|
@ -27,6 +19,15 @@ public class ProjectResp extends ProjectReq implements Serializable {
|
|||
@Serial
|
||||
private static final long serialVersionUID = -1883901559600186726L;
|
||||
|
||||
@ApiModelProperty("项目ID")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("项目来源")
|
||||
private String projectOrigin;
|
||||
|
||||
@ApiModelProperty("项目预算")
|
||||
private Integer projectBudget;
|
||||
|
||||
@ApiModelProperty("施工人员")
|
||||
private String constructorName;
|
||||
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
package com.dite.znpt.enums;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
* @date 2025/5/27/周二 15:33
|
||||
* @description
|
||||
*/
|
||||
@Getter
|
||||
public enum ContractStatusEnum {
|
||||
|
||||
UN_APPROVAL("UN_APPROVAL", "待审批"),
|
||||
UN_SETTLED("UN_SETTLED", "待结算"),
|
||||
UN_PAY("UN_PAY", "待收款"),
|
||||
COMPLETE("COMPLETE", "已完成"),
|
||||
;
|
||||
|
||||
private final String code;
|
||||
private final String desc;
|
||||
|
||||
ContractStatusEnum(String code, String desc){
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public static ContractStatusEnum getByCode(String code){
|
||||
for (ContractStatusEnum e : ContractStatusEnum.values() ) {
|
||||
if(e.code.equals(code)){
|
||||
return e;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getDescByCode(String code){
|
||||
ContractStatusEnum e = getByCode(code);
|
||||
return null == e ? null : e.desc;
|
||||
}
|
||||
|
||||
public static List<JSONObject> listAll(){
|
||||
List<JSONObject> list = new ArrayList<>(ContractStatusEnum.values().length);
|
||||
for (ContractStatusEnum e : ContractStatusEnum.values() ) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set(e.code, e.desc);
|
||||
list.add(jsonObject);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package com.dite.znpt.enums;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
* @date 2025/7/31/周四 15:30
|
||||
* @description 设备健康状态枚举
|
||||
*/
|
||||
@Getter
|
||||
public enum HealthStatusEnum {
|
||||
EXCELLENT("excellent", "优秀"),
|
||||
GOOD("good", "良好"),
|
||||
NORMAL("normal", "一般"),
|
||||
POOR("poor", "较差"),
|
||||
BAD("bad", "差");
|
||||
|
||||
private final String code;
|
||||
private final String desc;
|
||||
|
||||
HealthStatusEnum(String code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public static HealthStatusEnum getByCode(String code) {
|
||||
for (HealthStatusEnum e : HealthStatusEnum.values()) {
|
||||
if (e.code.equals(code)) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getDescByCode(String code) {
|
||||
HealthStatusEnum e = getByCode(code);
|
||||
return null == e ? null : e.desc;
|
||||
}
|
||||
|
||||
public static List<JSONObject> listAll() {
|
||||
List<JSONObject> list = new ArrayList<>(HealthStatusEnum.values().length);
|
||||
for (HealthStatusEnum e : HealthStatusEnum.values()) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set(e.code, e.desc);
|
||||
list.add(jsonObject);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package com.dite.znpt.enums;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
* @date 2025/7/31/周四 15:30
|
||||
* @description 设备位置状态枚举
|
||||
*/
|
||||
@Getter
|
||||
public enum LocationStatusEnum {
|
||||
IN_STOCK("in_stock", "库存中"),
|
||||
ALLOCATED("allocated", "已分配"),
|
||||
REPAIR("repair", "维修中"),
|
||||
SCRAP("scrap", "待报废"),
|
||||
SCRAPPED("scrapped", "已报废"),
|
||||
BORROWED("borrowed", "外借中"),
|
||||
LOST("lost", "丢失");
|
||||
|
||||
private final String code;
|
||||
private final String desc;
|
||||
|
||||
LocationStatusEnum(String code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public static LocationStatusEnum getByCode(String code) {
|
||||
for (LocationStatusEnum e : LocationStatusEnum.values()) {
|
||||
if (e.code.equals(code)) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getDescByCode(String code) {
|
||||
LocationStatusEnum e = getByCode(code);
|
||||
return null == e ? null : e.desc;
|
||||
}
|
||||
|
||||
public static List<JSONObject> listAll() {
|
||||
List<JSONObject> list = new ArrayList<>(LocationStatusEnum.values().length);
|
||||
for (LocationStatusEnum e : LocationStatusEnum.values()) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set(e.code, e.desc);
|
||||
list.add(jsonObject);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.dite.znpt.domain.entity.BusinessDataFileEntity;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ApiOperation("商务资料文件对象")
|
||||
public interface BusinessDataFileMapper {
|
||||
public List<BusinessDataFileEntity> List(@Param("folderId") Long folderId, @Param("fileName") String fileName);
|
||||
void delete(@Param("fileId") Long fileId,@Param("folderId") Long folderId);
|
||||
|
||||
void add(BusinessDataFileEntity businessDataFileEntity);
|
||||
|
||||
String getPath(Long fileId);
|
||||
|
||||
// 在接口中添加重命名方法
|
||||
void reName(@Param("fileId") Long fileId, @Param("newFileName") String newFileName, @Param("newFilePath") String newFilePath);
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.dite.znpt.domain.entity.BusinessDataEntity;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ApiOperation("商务资料文件夹对象")
|
||||
public interface BusinessDataMapper {
|
||||
public String getPath(Long parentId);
|
||||
|
||||
public List<BusinessDataEntity> List();
|
||||
|
||||
void insert(BusinessDataEntity businessDataEntity);
|
||||
|
||||
void delete(Long folderId);
|
||||
|
||||
void reName(BusinessDataEntity businessDataEntity);
|
||||
|
||||
public List<BusinessDataEntity> ListWithCondition(@Param("folderName") String folderName);
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.entity.BusinessDataFileEntity;
|
||||
import com.dite.znpt.domain.page.PageBean;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@ApiOperation("商务资料文件service")
|
||||
@Service
|
||||
public interface BusinessDataFileService {
|
||||
|
||||
PageBean pageSelect(Integer page, Integer pageSize, Long folderId, String fileName);
|
||||
|
||||
Result delete(@RequestParam(value = "fileId", required = false) Long fileId,@RequestParam(value = "foldelId", required = false) Long folderId);
|
||||
|
||||
void add(BusinessDataFileEntity businessDataFileEntity);
|
||||
|
||||
String getPath(Long fileId);
|
||||
|
||||
// 在接口中添加重命名方法
|
||||
Result reName(Long fileId, String newFileName);
|
||||
|
||||
// 在接口中添加预览方法
|
||||
// Result preview(Long fileId, HttpServletResponse response);
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.page.PageBean;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
@ApiOperation("商务资料文件夹service")
|
||||
public interface BusinessDataService {
|
||||
|
||||
PageBean pageSelect(Integer page, Integer pageSize, String folderName);
|
||||
Result createFolder(String folderName, Long parentId);
|
||||
String getPath(Long parentId);
|
||||
Result delete(Long folderId);
|
||||
Result reName(Long folderId, String newName);
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
//package com.dite.znpt.service;
|
||||
//
|
||||
//import org.springframework.stereotype.Service;
|
||||
//
|
||||
//@Service
|
||||
//public interface EmailService {
|
||||
// /**
|
||||
// * 发送邮箱验证码
|
||||
// * @param email
|
||||
// * @param code
|
||||
// * @return
|
||||
// */
|
||||
// public boolean sendVerificationCode(String email, String code);
|
||||
//
|
||||
// /**
|
||||
// * 生成验证码
|
||||
// * @param email
|
||||
// * @return
|
||||
// */
|
||||
// public String generateCode(String email);
|
||||
//
|
||||
// /**
|
||||
// * 验证邮箱验证码
|
||||
// * @param email
|
||||
// * @param code
|
||||
// * @return
|
||||
// */
|
||||
// public boolean verifyCode(String email, String code);
|
||||
//
|
||||
//}
|
|
@ -1,24 +1,74 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.EquipmentEntity;
|
||||
import com.dite.znpt.domain.vo.EquipmentListReq;
|
||||
import com.dite.znpt.domain.vo.EquipmentReq;
|
||||
import com.dite.znpt.domain.vo.EquipmentResp;
|
||||
import com.dite.znpt.domain.vo.EquipmentUseRecordReq;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备服务接口
|
||||
* @author Bear.G
|
||||
* @date 2025/7/23/周三 17:39
|
||||
* @description
|
||||
*/
|
||||
public interface EquipmentService extends IService<EquipmentEntity> {
|
||||
List<EquipmentResp> page(EquipmentListReq req);
|
||||
List<EquipmentResp> list(EquipmentListReq req);
|
||||
|
||||
/**
|
||||
* 分页查询设备信息
|
||||
*/
|
||||
IPage<EquipmentResp> page(EquipmentListReq req);
|
||||
|
||||
/**
|
||||
* 查询设备详情
|
||||
*/
|
||||
EquipmentResp detail(String equipmentId);
|
||||
|
||||
/**
|
||||
* 新增设备
|
||||
*/
|
||||
void save(EquipmentReq req);
|
||||
|
||||
/**
|
||||
* 修改设备
|
||||
*/
|
||||
void update(String equipmentId, EquipmentReq req);
|
||||
|
||||
/**
|
||||
* 删除设备
|
||||
*/
|
||||
void deleteById(String equipmentId);
|
||||
|
||||
/**
|
||||
* 批量删除设备
|
||||
*/
|
||||
void batchDelete(List<String> equipmentIds);
|
||||
|
||||
/**
|
||||
* 获取采购统计信息
|
||||
*/
|
||||
Object getProcurementStats();
|
||||
|
||||
/**
|
||||
* 导出采购记录
|
||||
*/
|
||||
byte[] exportProcurement(EquipmentListReq req);
|
||||
|
||||
/**
|
||||
* 分页查询设备采购记录
|
||||
*/
|
||||
IPage<EquipmentResp> procurementPage(EquipmentListReq req);
|
||||
|
||||
/**
|
||||
* 新增设备采购记录
|
||||
*/
|
||||
void saveProcurement(EquipmentReq req);
|
||||
|
||||
/**
|
||||
* 修改设备采购记录
|
||||
*/
|
||||
void updateProcurement(String equipmentId, EquipmentReq req);
|
||||
}
|
||||
|
|
|
@ -2,10 +2,11 @@ package com.dite.znpt.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.ProjectBudgetInfoEntity;
|
||||
import com.dite.znpt.domain.vo.ProjectBudgetInfoDetailResp;
|
||||
import com.dite.znpt.domain.vo.ProjectBudgetInfoImportReq;
|
||||
import com.dite.znpt.domain.vo.ProjectBudgetInfoListReq;
|
||||
import com.dite.znpt.domain.vo.ProjectBudgetInfoListResp;
|
||||
import com.dite.znpt.domain.vo.ProjectBudgetInfoReq;
|
||||
import com.dite.znpt.domain.vo.ProjectBudgetInfoResp;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -15,34 +16,16 @@ import java.util.List;
|
|||
* @Description: 项目预算信息表服务接口
|
||||
*/
|
||||
public interface ProjectBudgetInfoService extends IService<ProjectBudgetInfoEntity> {
|
||||
List<ProjectBudgetInfoListResp> list(ProjectBudgetInfoListReq projectBudgetInfoListReq);
|
||||
|
||||
/**
|
||||
* 功能描述:查询项目预算信息列表
|
||||
*
|
||||
* @param projectBudgetInfoReq 项目预算信息
|
||||
* @return {@link List }<{@link ProjectBudgetInfoListResp }>
|
||||
* @author huise23
|
||||
* @date 2025/07/17 21:58
|
||||
**/
|
||||
List<ProjectBudgetInfoListResp> selectList(ProjectBudgetInfoListReq projectBudgetInfoReq);
|
||||
List<ProjectBudgetInfoListResp> page(ProjectBudgetInfoListReq projectBudgetInfoListReq);
|
||||
|
||||
/**
|
||||
* 功能描述:根据项目id获取项目预算信息列表
|
||||
*
|
||||
* @param projectId 项目id
|
||||
* @return {@link List }<{@link ProjectBudgetInfoListResp }>
|
||||
* @author huise23
|
||||
* @date 2025/07/17 21:58
|
||||
**/
|
||||
List<ProjectBudgetInfoResp> detailByProjectId(String projectId);
|
||||
void saveData(ProjectBudgetInfoImportReq req);
|
||||
|
||||
/**
|
||||
* 功能描述:新增项目预算信息
|
||||
*
|
||||
* @param projectBudgetInfoReq 项目预算信息
|
||||
* @author huise23
|
||||
* @date 2025/07/17 21:58
|
||||
**/
|
||||
void saveData(List<ProjectBudgetInfoReq> projectBudgetInfoReq);
|
||||
void saveData(ProjectBudgetInfoImportReq req, MultipartFile[] files);
|
||||
|
||||
ProjectBudgetInfoDetailResp detailByProjectId(String projectId);
|
||||
|
||||
void delete(String budgetId);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.PostEntity;
|
||||
import com.dite.znpt.domain.entity.UserPostEntity;
|
||||
import com.dite.znpt.domain.vo.PostResp;
|
||||
import com.dite.znpt.domain.vo.UserResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -16,4 +16,5 @@ public interface UserPostService extends IService<UserPostEntity> {
|
|||
List<PostResp> getPostsByUserId(String userId);
|
||||
void bindUserPost(String userId, List<String> postIds);
|
||||
void bindPostUser(String postId, List<String> userIds);
|
||||
List<UserResp> getUsersByPostId(String postId);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.dite.znpt.service;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.UserRoleEntity;
|
||||
import com.dite.znpt.domain.vo.RoleResp;
|
||||
import com.dite.znpt.domain.vo.UserResp;
|
||||
import com.dite.znpt.domain.vo.UserRoleReq;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -19,4 +20,6 @@ public interface UserRoleService extends IService<UserRoleEntity> {
|
|||
void bindUserRole(UserRoleReq req);
|
||||
|
||||
void bindRoleUser(String roleId, List<String> userIds);
|
||||
|
||||
List<UserResp> getUsersByRoleId(String roleId);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,163 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
|
||||
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.entity.BusinessDataFileEntity;
|
||||
import com.dite.znpt.domain.page.PageBean;
|
||||
import com.dite.znpt.mapper.BusinessDataFileMapper;
|
||||
import com.dite.znpt.service.BusinessDataFileService;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static jodd.io.FileUtil.deleteFile;
|
||||
import static org.apache.tomcat.util.http.fileupload.FileUtils.deleteDirectory;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Service
|
||||
@ApiOperation("商务资料文件service实现类")
|
||||
public class BusinessDataFileServiceImpl implements BusinessDataFileService {
|
||||
@Resource
|
||||
private BusinessDataFileMapper businessDataFileMapper;
|
||||
|
||||
|
||||
@ApiOperation("分页查询文件")
|
||||
@Override
|
||||
public PageBean pageSelect(Integer page, Integer pageSize, Long folderId, String fileName) {
|
||||
PageHelper.startPage(page, pageSize);
|
||||
List<BusinessDataFileEntity> list = businessDataFileMapper.List(folderId, fileName);
|
||||
Page<BusinessDataFileEntity> p = (Page<BusinessDataFileEntity>) list;
|
||||
PageBean pageBean = new PageBean(p.getTotal(), p.getResult());
|
||||
return pageBean;
|
||||
}
|
||||
@ApiOperation("删除文件")
|
||||
public Result delete(Long fileId, Long folderId) {
|
||||
//删除数据库数据
|
||||
if (folderId != null){
|
||||
businessDataFileMapper.delete(null,folderId);
|
||||
System.out.println("888888888走对了");
|
||||
|
||||
return Result.okM("删除,走对了,成功");
|
||||
}
|
||||
|
||||
//删除文件
|
||||
String sPath = businessDataFileMapper.getPath(fileId);
|
||||
|
||||
businessDataFileMapper.delete(fileId,null);
|
||||
|
||||
boolean flag = false;
|
||||
File file = new File(sPath);
|
||||
// 判断目录或文件是否存在
|
||||
if (!file.exists()) { // 不存在返回 false
|
||||
return Result.error("文件不存在");
|
||||
} else {
|
||||
// 判断是否为文件
|
||||
if (file.isFile()) { // 为文件时调用删除文件方法
|
||||
try {
|
||||
deleteFile(file);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return Result.okM("删除成功");
|
||||
} else { // 为目录时调用删除目录方法
|
||||
try {
|
||||
deleteDirectory(file);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return Result.okM("删除成功");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation("增加文件")
|
||||
public void add(BusinessDataFileEntity businessDataFileEntity) {
|
||||
businessDataFileMapper.add(businessDataFileEntity);
|
||||
}
|
||||
|
||||
@ApiOperation("获取文件路径")
|
||||
public String getPath(Long fileId) {
|
||||
return businessDataFileMapper.getPath(fileId);
|
||||
}
|
||||
|
||||
@ApiOperation("重命名文件")
|
||||
@Override
|
||||
public Result reName(Long fileId, String newFileName) {
|
||||
// 参数校验
|
||||
if (fileId == null) {
|
||||
return Result.error("文件ID不能为空");
|
||||
}
|
||||
if (newFileName == null || newFileName.trim().isEmpty()) {
|
||||
return Result.error("新文件名不能为空");
|
||||
}
|
||||
if (newFileName.length() > 100) {
|
||||
return Result.error("文件名过长");
|
||||
}
|
||||
|
||||
try {
|
||||
// 获取原文件信息
|
||||
String oldFilePath = businessDataFileMapper.getPath(fileId);
|
||||
if (oldFilePath == null) {
|
||||
return Result.error("文件不存在");
|
||||
}
|
||||
|
||||
// 创建原文件对象
|
||||
File oldFile = new File(oldFilePath);
|
||||
if (!oldFile.exists()) {
|
||||
return Result.error("文件不存在");
|
||||
}
|
||||
|
||||
// 构建新文件路径
|
||||
String parentPath = oldFile.getParent();
|
||||
String fileExtension = "";
|
||||
String fileNameWithoutExt = newFileName;
|
||||
|
||||
// 获取原文件扩展名
|
||||
int lastDotIndex = oldFile.getName().lastIndexOf('.');
|
||||
if (lastDotIndex > 0) {
|
||||
fileExtension = oldFile.getName().substring(lastDotIndex);
|
||||
}
|
||||
|
||||
// 如果新文件名没有扩展名,则添加原文件扩展名
|
||||
if (!newFileName.contains(".")) {
|
||||
newFileName = newFileName + fileExtension;
|
||||
}
|
||||
|
||||
// 构建新文件路径
|
||||
String newFilePath = parentPath + File.separator + newFileName;
|
||||
File newFile = new File(newFilePath);
|
||||
|
||||
// 检查新文件名是否已存在
|
||||
if (newFile.exists()) {
|
||||
return Result.error("文件名已存在");
|
||||
}
|
||||
|
||||
// 重命名实际文件
|
||||
boolean renameSuccess = oldFile.renameTo(newFile);
|
||||
if (!renameSuccess) {
|
||||
return Result.error("文件重命名失败");
|
||||
}
|
||||
|
||||
// 更新数据库中的文件信息
|
||||
businessDataFileMapper.reName(fileId, newFileName, newFilePath);
|
||||
|
||||
return Result.okM("文件重命名成功");
|
||||
|
||||
} catch (Exception e) {
|
||||
return Result.error("文件重命名失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,197 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.entity.BusinessDataEntity;
|
||||
import com.dite.znpt.domain.page.PageBean;
|
||||
import com.dite.znpt.mapper.BusinessDataMapper;
|
||||
import com.dite.znpt.service.BusinessDataFileService;
|
||||
import com.dite.znpt.service.BusinessDataService;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商务资料文件夹实现类
|
||||
*/
|
||||
@Service
|
||||
@ApiOperation("商务资料文件夹service实现类")
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class BusinessDataServiceImpl implements BusinessDataService {
|
||||
@Resource
|
||||
private BusinessDataMapper businessDataMapper;
|
||||
@Resource
|
||||
private BusinessDataFileService businessDataFileService;
|
||||
|
||||
// 从配置文件中读取基础路径(默认值:D:/upload/businessData)
|
||||
// ,新建文件夹的时候,如果没指定父文件夹Id,就用这个
|
||||
@Value("${file.upload.businessDataPath:D:/upload/businessData}")
|
||||
private String businessDataPath;
|
||||
|
||||
@ApiOperation(value = "分页查询")
|
||||
@Override
|
||||
public PageBean pageSelect(Integer page, Integer pageSize, String folderName) {
|
||||
PageHelper.startPage(page, pageSize);
|
||||
List<BusinessDataEntity> businessDataEntityList = businessDataMapper.ListWithCondition(folderName);
|
||||
Page<BusinessDataEntity> p = (Page<BusinessDataEntity>) businessDataEntityList;
|
||||
PageBean pageBean = new PageBean(p.getTotal(), p.getResult());
|
||||
return pageBean;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "创建文件夹")
|
||||
@Override
|
||||
public Result createFolder(String folderName, Long parentId) {
|
||||
//获取ID
|
||||
Long loginIdAsLong = 888L;
|
||||
// loginIdAsLong = StpUtil.getLoginIdAsLong();
|
||||
//
|
||||
// 文件夹名称不能为空
|
||||
//TODO: 添加文件夹名称校验,后续最好更规范些,写个工具类专门校验,用正则表达式
|
||||
if (folderName == null || folderName.trim().isEmpty()) {
|
||||
return Result.error("文件夹名称不能为空");
|
||||
}
|
||||
if (folderName.length() > 50) {
|
||||
return Result.error("文件夹名称过长");
|
||||
}
|
||||
|
||||
// 文件夹名称前置一个/
|
||||
String folderName1 = "/" + folderName;
|
||||
// 目标文件夹
|
||||
File targetDir=Paths.get(businessDataPath, folderName1).toFile();
|
||||
if(parentId != 0L){
|
||||
// 获取父文件夹路径
|
||||
targetDir = Paths.get(businessDataMapper.getPath(parentId), folderName1).toFile();
|
||||
}
|
||||
// 创建文件夹和新增文件夹路径
|
||||
if (!targetDir.exists()) {
|
||||
// 创建文件夹
|
||||
boolean created = targetDir.mkdirs();
|
||||
if (!created) {
|
||||
throw new RuntimeException("文件夹创建失败: " + targetDir.getAbsolutePath());
|
||||
}
|
||||
//上面是新增文件夹功能,但没有往数据库插入文件夹相关数据,所以下面新增
|
||||
// 创建BusinessDataEntity对象并设置属性
|
||||
BusinessDataEntity businessDataEntity = new BusinessDataEntity(
|
||||
null,
|
||||
folderName,
|
||||
parentId,
|
||||
loginIdAsLong,
|
||||
LocalDateTime.now(),
|
||||
LocalDateTime.now(),
|
||||
false,
|
||||
targetDir.getAbsolutePath()
|
||||
);
|
||||
// 插入到数据库
|
||||
businessDataMapper.insert(businessDataEntity);
|
||||
return Result.okM( "文件夹创建成功");
|
||||
} else {
|
||||
return Result.error("文件夹已存在: ");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("获取文件夹路径")
|
||||
public String getPath(Long parentId) {
|
||||
return businessDataMapper.getPath(parentId);
|
||||
}
|
||||
|
||||
// @ApiOperation("删除文件夹")
|
||||
// @Override
|
||||
// public Result delete(Long folderId) {
|
||||
// // 获取文件夹路径
|
||||
// String folderPath = businessDataMapper.getPath(folderId);
|
||||
//
|
||||
// // 创建File对象并删除文件夹
|
||||
// File folder = new File(folderPath);
|
||||
// if (folder.exists()) {
|
||||
// boolean deleted = folder.delete();
|
||||
// if (!deleted) {
|
||||
// // throw new RuntimeException("文件夹删除失败: " + folderPath);
|
||||
// // TODO: 以后可以用全局异常处理器捕获,或者用try catch捕获
|
||||
// return Result.error("文件夹删除失败: " + folderPath);
|
||||
// }
|
||||
// //删除数据库中文件夹的数据
|
||||
// businessDataMapper.delete(folderId);
|
||||
// //删除文件夹下文件的数据
|
||||
// businessDataFileService.delete(folderId);
|
||||
// return Result.okM("删除成功");
|
||||
// } else {
|
||||
// // throw new RuntimeException("文件夹不存在: " + folderPath);
|
||||
// return Result.error("文件夹不存在: " + folderPath);
|
||||
// }
|
||||
// }
|
||||
@ApiOperation("删除文件夹")
|
||||
@Override
|
||||
public Result delete(Long folderId) {
|
||||
// 获取文件夹路径
|
||||
String folderPath = businessDataMapper.getPath(folderId);
|
||||
|
||||
// 创建Path对象并删除文件夹
|
||||
Path folder = Paths.get(folderPath);
|
||||
if (Files.exists(folder)) {
|
||||
try {
|
||||
// 使用Files.walk获取所有文件和目录,按深度排序后删除
|
||||
java.util.stream.Stream<Path> filePaths = Files.walk(folder);
|
||||
filePaths.sorted(Comparator.reverseOrder())
|
||||
.map(Path::toFile)
|
||||
.forEach(File::delete);
|
||||
filePaths.close();
|
||||
|
||||
//删除数据库中文件夹的数据
|
||||
businessDataMapper.delete(folderId);
|
||||
//删除文件夹下文件的数据
|
||||
businessDataFileService.delete(null , folderId);
|
||||
return Result.okM("删除成功");
|
||||
} catch (Exception e) {
|
||||
return Result.okM("删除成功");
|
||||
}
|
||||
} else {
|
||||
return Result.error("文件夹不存在: " + folderPath);
|
||||
}
|
||||
}
|
||||
@ApiOperation("重命名文件夹")
|
||||
@Override
|
||||
public Result reName(Long folderId, String newName) {
|
||||
// 获取文件夹路径
|
||||
String folderPath = businessDataMapper.getPath(folderId);
|
||||
String newPath = folderPath.substring(0, folderPath.lastIndexOf('\\'))+"\\" + newName;
|
||||
System.out.printf("7777777"+newPath);
|
||||
//
|
||||
// //想命名的原文件的路径
|
||||
// File file = new File("f:/a/a.xlsx");
|
||||
// //将原文件更改为f:\a\b.xlsx,其中路径是必要的。注意
|
||||
// file.renameTo(new File("f:/a/b.xlsx"));
|
||||
//想命名的原文件夹的路径
|
||||
File file1 = new File(folderPath);
|
||||
//将原文件夹更改为A,其中路径是必要的。注意
|
||||
file1.renameTo(new File(newPath));
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
BusinessDataEntity businessDataEntity = new BusinessDataEntity(
|
||||
folderId,
|
||||
newName,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
now,
|
||||
null,
|
||||
newPath
|
||||
);
|
||||
System.out.println(businessDataEntity);
|
||||
businessDataMapper.reName(businessDataEntity);
|
||||
return Result.okM("重命名成功");
|
||||
}
|
||||
|
||||
}
|
|
@ -1,17 +1,18 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.domain.entity.ContractEntity;
|
||||
import com.dite.znpt.domain.vo.ContractListReq;
|
||||
import com.dite.znpt.domain.vo.ContractResp;
|
||||
import com.dite.znpt.domain.vo.ContractReq;
|
||||
import com.dite.znpt.service.ContractService;
|
||||
import com.dite.znpt.domain.vo.ContractResp;
|
||||
import com.dite.znpt.enums.ContractStatusEnum;
|
||||
import com.dite.znpt.mapper.ContractMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.service.ContractService;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -37,7 +38,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, ContractEnt
|
|||
PageUtil.startPage();
|
||||
List<ContractResp> contractList= this.baseMapper.queryBySelective(contractReq);
|
||||
contractList.forEach(resp -> {
|
||||
|
||||
resp.setContractStatusLabel(ContractStatusEnum.getDescByCode(resp.getContractStatus()));
|
||||
});
|
||||
return contractList;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
//package com.dite.znpt.service.impl;
|
||||
//
|
||||
//import com.dite.znpt.service.EmailService;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.beans.factory.annotation.Value;
|
||||
//import org.springframework.http.HttpStatus;
|
||||
//import org.springframework.mail.SimpleMailMessage;
|
||||
//import org.springframework.mail.javamail.JavaMailSender;
|
||||
//import org.springframework.stereotype.Service;
|
||||
//import org.springframework.web.server.ResponseStatusException;
|
||||
//
|
||||
//import java.util.Random;
|
||||
//
|
||||
//@Slf4j
|
||||
//@Service
|
||||
//public class EmailServiceImpl implements EmailService {
|
||||
//
|
||||
// @Autowired
|
||||
// private JavaMailSender mailSender;
|
||||
//
|
||||
// @Autowired
|
||||
// private InMemoryVerificationCodeStore codeStore;
|
||||
//
|
||||
// @Value("${email.verification.from}")
|
||||
// private String from;
|
||||
// @Value("${email.verification.subject}")
|
||||
// private String subject;
|
||||
// @Value("${email.verification.template}")
|
||||
// private String template;
|
||||
//
|
||||
// @Override
|
||||
// public boolean sendVerificationCode(String email, String code) {
|
||||
// SimpleMailMessage message = new SimpleMailMessage();
|
||||
// message.setFrom(from);
|
||||
// message.setSubject(subject);
|
||||
// message.setTo(email);
|
||||
// message.setText(String.format(template,code));
|
||||
// try{
|
||||
// mailSender.send(message);
|
||||
// return true;
|
||||
// }catch (Exception e){
|
||||
// log.error("发送邮件失败:",e);
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String generateCode(String email) {
|
||||
// if (!codeStore.canSend(email)) {
|
||||
// throw new ResponseStatusException(
|
||||
// HttpStatus.TOO_MANY_REQUESTS, // 429 状态码
|
||||
// "验证码发送过于频繁,请稍后再试"
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// String code = String.format("%04d", new Random().nextInt(9999));
|
||||
// codeStore.save(email, code);
|
||||
// return code;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean verifyCode(String email, String code) {
|
||||
// return codeStore.validate(email, code);
|
||||
// }
|
||||
//}
|
|
@ -1,97 +1,418 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.constant.Message;
|
||||
import com.dite.znpt.converts.Converts;
|
||||
import com.dite.znpt.domain.entity.EquipmentEntity;
|
||||
import com.dite.znpt.domain.entity.EquipmentUseRecordEntity;
|
||||
import com.dite.znpt.domain.vo.EquipmentListReq;
|
||||
import com.dite.znpt.domain.vo.EquipmentReq;
|
||||
import com.dite.znpt.domain.vo.EquipmentResp;
|
||||
import com.dite.znpt.domain.vo.EquipmentUseRecordReq;
|
||||
import com.dite.znpt.enums.EquipmentStatusEnum;
|
||||
import com.dite.znpt.enums.EquipmentTypeEnum;
|
||||
import com.dite.znpt.enums.HealthStatusEnum;
|
||||
import com.dite.znpt.enums.LocationStatusEnum;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
import com.dite.znpt.mapper.EquipmentMapper;
|
||||
import com.dite.znpt.service.EquipmentService;
|
||||
import com.dite.znpt.service.EquipmentUseRecordService;
|
||||
import com.dite.znpt.service.ProjectService;
|
||||
import com.dite.znpt.service.UserService;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
* @date 2025/7/23/周三 17:39
|
||||
* @description
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, EquipmentEntity> implements EquipmentService {
|
||||
|
||||
@Resource
|
||||
private EquipmentUseRecordService equipmentUseRecordService;
|
||||
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
@Resource
|
||||
private ProjectService projectService;
|
||||
|
||||
@Override
|
||||
public List<EquipmentResp> page(EquipmentListReq req) {
|
||||
PageUtil.startPage();
|
||||
return this.list(req);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EquipmentResp> list(EquipmentListReq req) {
|
||||
List<EquipmentResp> list = this.baseMapper.selectEquipmentResp(req);
|
||||
list.forEach(resp -> {
|
||||
resp.setEquipmentTypeLabel(EquipmentTypeEnum.getDescByCode(resp.getEquipmentType()));
|
||||
resp.setEquipmentStatusLabel(EquipmentStatusEnum.getDescByCode(resp.getEquipmentStatus()));
|
||||
});
|
||||
return list;
|
||||
public IPage<EquipmentResp> page(EquipmentListReq req) {
|
||||
log.info("开始执行设备分页查询,请求参数: {}", req);
|
||||
|
||||
// 创建分页对象,处理null值
|
||||
Integer pageNum = req.getPage() != null ? req.getPage() : (req.getPageNum() != null ? req.getPageNum() : 1);
|
||||
Integer pageSize = req.getPageSize() != null ? req.getPageSize() : 10;
|
||||
Page<EquipmentEntity> page = new Page<>(pageNum, pageSize);
|
||||
|
||||
// 构建查询条件
|
||||
LambdaQueryWrapper<EquipmentEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||
// 不需要手动添加 del_flag 条件,@TableLogic 注解会自动处理
|
||||
|
||||
// 添加搜索条件并记录日志
|
||||
int conditionCount = 0;
|
||||
|
||||
if (StringUtils.hasText(req.getEquipmentName())) {
|
||||
queryWrapper.like(EquipmentEntity::getEquipmentName, req.getEquipmentName());
|
||||
log.info("添加设备名称查询条件: {}", req.getEquipmentName());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getEquipmentType())) {
|
||||
queryWrapper.eq(EquipmentEntity::getEquipmentType, req.getEquipmentType());
|
||||
log.info("添加设备类型查询条件: {}", req.getEquipmentType());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getEquipmentStatus())) {
|
||||
queryWrapper.eq(EquipmentEntity::getEquipmentStatus, req.getEquipmentStatus());
|
||||
log.info("添加设备状态查询条件: {}", req.getEquipmentStatus());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getEquipmentSn())) {
|
||||
queryWrapper.like(EquipmentEntity::getEquipmentSn, req.getEquipmentSn());
|
||||
log.info("添加设备序列号查询条件: {}", req.getEquipmentSn());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getAssetCode())) {
|
||||
queryWrapper.like(EquipmentEntity::getAssetCode, req.getAssetCode());
|
||||
log.info("添加资产编号查询条件: {}", req.getAssetCode());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getBrand())) {
|
||||
queryWrapper.like(EquipmentEntity::getBrand, req.getBrand());
|
||||
log.info("添加品牌查询条件: {}", req.getBrand());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getLocationStatus())) {
|
||||
queryWrapper.eq(EquipmentEntity::getLocationStatus, req.getLocationStatus());
|
||||
log.info("添加位置状态查询条件: {}", req.getLocationStatus());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getHealthStatus())) {
|
||||
queryWrapper.eq(EquipmentEntity::getHealthStatus, req.getHealthStatus());
|
||||
log.info("添加健康状态查询条件: {}", req.getHealthStatus());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getResponsiblePerson())) {
|
||||
queryWrapper.like(EquipmentEntity::getResponsiblePerson, req.getResponsiblePerson());
|
||||
log.info("添加负责人查询条件: {}", req.getResponsiblePerson());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getUseStatus())) {
|
||||
queryWrapper.eq(EquipmentEntity::getUseStatus, req.getUseStatus());
|
||||
log.info("添加使用状态查询条件: {}", req.getUseStatus());
|
||||
conditionCount++;
|
||||
}
|
||||
|
||||
// 新增查询条件
|
||||
if (StringUtils.hasText(req.getEquipmentModel())) {
|
||||
queryWrapper.like(EquipmentEntity::getEquipmentModel, req.getEquipmentModel());
|
||||
log.info("添加设备型号查询条件: {}", req.getEquipmentModel());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getSpecification())) {
|
||||
queryWrapper.like(EquipmentEntity::getSpecification, req.getSpecification());
|
||||
log.info("添加配置规格查询条件: {}", req.getSpecification());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getPhysicalLocation())) {
|
||||
queryWrapper.like(EquipmentEntity::getPhysicalLocation, req.getPhysicalLocation());
|
||||
log.info("添加物理位置查询条件: {}", req.getPhysicalLocation());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getSupplierName())) {
|
||||
queryWrapper.like(EquipmentEntity::getSupplierName, req.getSupplierName());
|
||||
log.info("添加供应商名称查询条件: {}", req.getSupplierName());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getMaintenancePerson())) {
|
||||
queryWrapper.like(EquipmentEntity::getMaintenancePerson, req.getMaintenancePerson());
|
||||
log.info("添加维护人员查询条件: {}", req.getMaintenancePerson());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getInventoryBarcode())) {
|
||||
queryWrapper.like(EquipmentEntity::getInventoryBarcode, req.getInventoryBarcode());
|
||||
log.info("添加库存条码查询条件: {}", req.getInventoryBarcode());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getAssetRemark())) {
|
||||
queryWrapper.like(EquipmentEntity::getAssetRemark, req.getAssetRemark());
|
||||
log.info("添加资产备注查询条件: {}", req.getAssetRemark());
|
||||
conditionCount++;
|
||||
}
|
||||
|
||||
// 新增字段查询条件
|
||||
if (StringUtils.hasText(req.getUsingDepartment())) {
|
||||
queryWrapper.like(EquipmentEntity::getUsingDepartment, req.getUsingDepartment());
|
||||
log.info("添加使用部门/人查询条件: {}", req.getUsingDepartment());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getInvoice())) {
|
||||
queryWrapper.like(EquipmentEntity::getInvoice, req.getInvoice());
|
||||
log.info("添加发票查询条件: {}", req.getInvoice());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getBarcode())) {
|
||||
queryWrapper.like(EquipmentEntity::getBarcode, req.getBarcode());
|
||||
log.info("添加条码查询条件: {}", req.getBarcode());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getImporter())) {
|
||||
queryWrapper.like(EquipmentEntity::getImporter, req.getImporter());
|
||||
log.info("添加导入人查询条件: {}", req.getImporter());
|
||||
conditionCount++;
|
||||
}
|
||||
|
||||
// 新增采购相关字段查询条件
|
||||
if (StringUtils.hasText(req.getAccountNumber())) {
|
||||
queryWrapper.like(EquipmentEntity::getAccountNumber, req.getAccountNumber());
|
||||
log.info("添加次户号查询条件: {}", req.getAccountNumber());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getQuantity() != null) {
|
||||
queryWrapper.eq(EquipmentEntity::getQuantity, req.getQuantity());
|
||||
log.info("添加数量查询条件: {}", req.getQuantity());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getUnitPrice() != null) {
|
||||
queryWrapper.eq(EquipmentEntity::getUnitPrice, req.getUnitPrice());
|
||||
log.info("添加单价查询条件: {}", req.getUnitPrice());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getTotalPrice() != null) {
|
||||
queryWrapper.eq(EquipmentEntity::getTotalPrice, req.getTotalPrice());
|
||||
log.info("添加总价查询条件: {}", req.getTotalPrice());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getInventoryBasis())) {
|
||||
queryWrapper.like(EquipmentEntity::getInventoryBasis, req.getInventoryBasis());
|
||||
log.info("添加盘点依据查询条件: {}", req.getInventoryBasis());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getDynamicRecord())) {
|
||||
queryWrapper.like(EquipmentEntity::getDynamicRecord, req.getDynamicRecord());
|
||||
log.info("添加动态记录查询条件: {}", req.getDynamicRecord());
|
||||
conditionCount++;
|
||||
}
|
||||
|
||||
// 时间范围查询
|
||||
if (req.getPurchaseTimeStart() != null) {
|
||||
queryWrapper.ge(EquipmentEntity::getPurchaseTime, req.getPurchaseTimeStart());
|
||||
log.info("添加采购时间开始查询条件: {}", req.getPurchaseTimeStart());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getPurchaseTimeEnd() != null) {
|
||||
queryWrapper.le(EquipmentEntity::getPurchaseTime, req.getPurchaseTimeEnd());
|
||||
log.info("添加采购时间结束查询条件: {}", req.getPurchaseTimeEnd());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getInStockTimeStart() != null) {
|
||||
queryWrapper.ge(EquipmentEntity::getInStockTime, req.getInStockTimeStart());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getInStockTimeEnd() != null) {
|
||||
queryWrapper.le(EquipmentEntity::getInStockTime, req.getInStockTimeEnd());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getActivationTimeStart() != null) {
|
||||
queryWrapper.ge(EquipmentEntity::getActivationTime, req.getActivationTimeStart());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getActivationTimeEnd() != null) {
|
||||
queryWrapper.le(EquipmentEntity::getActivationTime, req.getActivationTimeEnd());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getExpectedScrapTimeStart() != null) {
|
||||
queryWrapper.ge(EquipmentEntity::getExpectedScrapTime, req.getExpectedScrapTimeStart());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getExpectedScrapTimeEnd() != null) {
|
||||
queryWrapper.le(EquipmentEntity::getExpectedScrapTime, req.getExpectedScrapTimeEnd());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getWarrantyExpireDateStart() != null) {
|
||||
queryWrapper.ge(EquipmentEntity::getWarrantyExpireDate, req.getWarrantyExpireDateStart());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getWarrantyExpireDateEnd() != null) {
|
||||
queryWrapper.le(EquipmentEntity::getWarrantyExpireDate, req.getWarrantyExpireDateEnd());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getLastMaintenanceDateStart() != null) {
|
||||
queryWrapper.ge(EquipmentEntity::getLastMaintenanceDate, req.getLastMaintenanceDateStart());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getLastMaintenanceDateEnd() != null) {
|
||||
queryWrapper.le(EquipmentEntity::getLastMaintenanceDate, req.getLastMaintenanceDateEnd());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getNextMaintenanceDateStart() != null) {
|
||||
queryWrapper.ge(EquipmentEntity::getNextMaintenanceDate, req.getNextMaintenanceDateStart());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getNextMaintenanceDateEnd() != null) {
|
||||
queryWrapper.le(EquipmentEntity::getNextMaintenanceDate, req.getNextMaintenanceDateEnd());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getCreateTimeStart() != null) {
|
||||
queryWrapper.ge(EquipmentEntity::getCreateTime, req.getCreateTimeStart());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getCreateTimeEnd() != null) {
|
||||
queryWrapper.le(EquipmentEntity::getCreateTime, req.getCreateTimeEnd());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getUpdateTimeStart() != null) {
|
||||
queryWrapper.ge(EquipmentEntity::getUpdateTime, req.getUpdateTimeStart());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getUpdateTimeEnd() != null) {
|
||||
queryWrapper.le(EquipmentEntity::getUpdateTime, req.getUpdateTimeEnd());
|
||||
conditionCount++;
|
||||
}
|
||||
|
||||
log.info("总共添加了 {} 个查询条件", conditionCount);
|
||||
|
||||
// 排序处理
|
||||
if (StringUtils.hasText(req.getOrderBy())) {
|
||||
String orderBy = req.getOrderBy();
|
||||
String orderDirection = "desc".equalsIgnoreCase(req.getOrderDirection()) ? "desc" : "asc";
|
||||
|
||||
switch (orderBy.toLowerCase()) {
|
||||
case "equipment_name":
|
||||
if ("desc".equals(orderDirection)) {
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getEquipmentName);
|
||||
} else {
|
||||
queryWrapper.orderByAsc(EquipmentEntity::getEquipmentName);
|
||||
}
|
||||
break;
|
||||
case "equipment_sn":
|
||||
if ("desc".equals(orderDirection)) {
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getEquipmentSn);
|
||||
} else {
|
||||
queryWrapper.orderByAsc(EquipmentEntity::getEquipmentSn);
|
||||
}
|
||||
break;
|
||||
case "asset_code":
|
||||
if ("desc".equals(orderDirection)) {
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getAssetCode);
|
||||
} else {
|
||||
queryWrapper.orderByAsc(EquipmentEntity::getAssetCode);
|
||||
}
|
||||
break;
|
||||
case "equipment_type":
|
||||
if ("desc".equals(orderDirection)) {
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getEquipmentType);
|
||||
} else {
|
||||
queryWrapper.orderByAsc(EquipmentEntity::getEquipmentType);
|
||||
}
|
||||
break;
|
||||
case "equipment_status":
|
||||
if ("desc".equals(orderDirection)) {
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getEquipmentStatus);
|
||||
} else {
|
||||
queryWrapper.orderByAsc(EquipmentEntity::getEquipmentStatus);
|
||||
}
|
||||
break;
|
||||
case "brand":
|
||||
if ("desc".equals(orderDirection)) {
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getBrand);
|
||||
} else {
|
||||
queryWrapper.orderByAsc(EquipmentEntity::getBrand);
|
||||
}
|
||||
break;
|
||||
case "responsible_person":
|
||||
if ("desc".equals(orderDirection)) {
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getResponsiblePerson);
|
||||
} else {
|
||||
queryWrapper.orderByAsc(EquipmentEntity::getResponsiblePerson);
|
||||
}
|
||||
break;
|
||||
case "purchase_time":
|
||||
if ("desc".equals(orderDirection)) {
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getPurchaseTime);
|
||||
} else {
|
||||
queryWrapper.orderByAsc(EquipmentEntity::getPurchaseTime);
|
||||
}
|
||||
break;
|
||||
case "purchase_price":
|
||||
if ("desc".equals(orderDirection)) {
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getTotalPrice);
|
||||
} else {
|
||||
queryWrapper.orderByAsc(EquipmentEntity::getTotalPrice);
|
||||
}
|
||||
break;
|
||||
case "update_time":
|
||||
if ("desc".equals(orderDirection)) {
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getUpdateTime);
|
||||
} else {
|
||||
queryWrapper.orderByAsc(EquipmentEntity::getUpdateTime);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// 默认按创建时间倒序
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getCreateTime);
|
||||
break;
|
||||
}
|
||||
log.info("添加排序条件: {} {}", orderBy, orderDirection);
|
||||
} else {
|
||||
// 默认按创建时间倒序
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getCreateTime);
|
||||
log.info("使用默认排序: 按创建时间倒序");
|
||||
}
|
||||
|
||||
log.info("执行分页查询,SQL条件: {}", queryWrapper.getTargetSql());
|
||||
|
||||
// 执行分页查询
|
||||
IPage<EquipmentEntity> equipmentPage = this.page(page, queryWrapper);
|
||||
|
||||
log.info("查询完成,总记录数: {}, 当前页记录数: {}", equipmentPage.getTotal(), equipmentPage.getRecords().size());
|
||||
|
||||
// 转换为响应对象
|
||||
List<EquipmentResp> equipmentRespList = equipmentPage.getRecords().stream()
|
||||
.map(this::convertToResp)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 创建响应分页对象
|
||||
Page<EquipmentResp> respPage = new Page<>(equipmentPage.getCurrent(), equipmentPage.getSize(), equipmentPage.getTotal());
|
||||
respPage.setRecords(equipmentRespList);
|
||||
|
||||
return respPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EquipmentResp detail(String equipmentId) {
|
||||
EquipmentResp resp = this.baseMapper.getEquipmentRespByEquipmentId(equipmentId);
|
||||
resp.setEquipmentTypeLabel(EquipmentTypeEnum.getDescByCode(resp.getEquipmentType()));
|
||||
resp.setEquipmentStatusLabel(EquipmentStatusEnum.getDescByCode(resp.getEquipmentStatus()));
|
||||
return resp;
|
||||
EquipmentEntity equipment = this.getById(equipmentId);
|
||||
if (equipment == null) {
|
||||
throw new ServiceException(Message.EQUIPMENT_ID_NOT_EXIST);
|
||||
}
|
||||
return convertToResp(equipment);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void save(EquipmentReq req) {
|
||||
EquipmentEntity entity = Converts.INSTANCE.toEquipmentUseRecordEntity(req);
|
||||
if(null != getByEquipmentSn(entity.getEquipmentSn())){
|
||||
EquipmentEntity entity = convertToEntity(req);
|
||||
if (getByEquipmentSn(entity.getEquipmentSn()) != null) {
|
||||
throw new ServiceException(Message.EQUIPMENT_SN_EXIST);
|
||||
}
|
||||
this.save(entity);
|
||||
}
|
||||
|
||||
private EquipmentEntity getByEquipmentSn(String equipmentSn){
|
||||
return this.getOne(Wrappers.lambdaQuery(EquipmentEntity.class).eq(EquipmentEntity::getEquipmentSn, equipmentSn));
|
||||
private EquipmentEntity getByEquipmentSn(String equipmentSn) {
|
||||
LambdaQueryWrapper<EquipmentEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(EquipmentEntity::getEquipmentSn, equipmentSn);
|
||||
return this.getOne(queryWrapper);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void update(String equipmentId, EquipmentReq req) {
|
||||
EquipmentEntity equipment = this.getById(equipmentId);
|
||||
if(null == equipment){
|
||||
if (equipment == null) {
|
||||
throw new ServiceException(Message.EQUIPMENT_ID_NOT_EXIST);
|
||||
}
|
||||
if(!equipment.getEquipmentSn().equals(req.getEquipmentSn()) && null != getByEquipmentSn(req.getEquipmentSn())){
|
||||
if (!equipment.getEquipmentSn().equals(req.getEquipmentSn()) && getByEquipmentSn(req.getEquipmentSn()) != null) {
|
||||
throw new ServiceException(Message.EQUIPMENT_SN_EXIST);
|
||||
}
|
||||
EquipmentEntity entity = Converts.INSTANCE.toEquipmentUseRecordEntity(req);
|
||||
EquipmentEntity entity = convertToEntity(req);
|
||||
entity.setEquipmentId(equipmentId);
|
||||
this.updateById(entity);
|
||||
}
|
||||
|
@ -100,9 +421,393 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
|
|||
@Override
|
||||
public void deleteById(String equipmentId) {
|
||||
EquipmentEntity equipment = this.getById(equipmentId);
|
||||
if(null == equipment){
|
||||
if (equipment == null) {
|
||||
throw new ServiceException(Message.EQUIPMENT_ID_NOT_EXIST);
|
||||
}
|
||||
this.removeById(equipmentId);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void batchDelete(List<String> equipmentIds) {
|
||||
if (equipmentIds == null || equipmentIds.isEmpty()) {
|
||||
throw new ServiceException("设备ID列表不能为空");
|
||||
}
|
||||
this.removeByIds(equipmentIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] exportProcurement(EquipmentListReq req) {
|
||||
// 这里可以实现导出功能,返回Excel文件的字节数组
|
||||
// 暂时返回空数组,实际项目中需要实现具体的导出逻辑
|
||||
return new byte[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* 将EquipmentReq转换为EquipmentEntity
|
||||
*/
|
||||
private EquipmentEntity convertToEntity(EquipmentReq req) {
|
||||
EquipmentEntity entity = new EquipmentEntity();
|
||||
entity.setAssetCode(req.getAssetCode());
|
||||
entity.setEquipmentName(req.getEquipmentName());
|
||||
entity.setEquipmentModel(req.getEquipmentModel());
|
||||
entity.setEquipmentType(req.getEquipmentType());
|
||||
entity.setEquipmentStatus(req.getEquipmentStatus());
|
||||
entity.setUseStatus(req.getUseStatus());
|
||||
entity.setEquipmentSn(req.getEquipmentSn());
|
||||
entity.setBrand(req.getBrand());
|
||||
entity.setSpecification(req.getSpecification());
|
||||
entity.setLocationStatus(req.getLocationStatus());
|
||||
entity.setPhysicalLocation(req.getPhysicalLocation());
|
||||
entity.setResponsiblePerson(req.getResponsiblePerson());
|
||||
entity.setHealthStatus(req.getHealthStatus());
|
||||
entity.setPurchaseTime(req.getPurchaseTime());
|
||||
entity.setInStockTime(req.getInStockTime());
|
||||
entity.setActivationTime(req.getActivationTime());
|
||||
entity.setExpectedScrapTime(req.getExpectedScrapTime());
|
||||
entity.setActualScrapTime(req.getActualScrapTime());
|
||||
entity.setStatusChangeTime(req.getStatusChangeTime());
|
||||
entity.setPurchaseOrder(req.getPurchaseOrder());
|
||||
entity.setSupplierName(req.getSupplierName());
|
||||
entity.setCurrentNetValue(req.getCurrentNetValue());
|
||||
entity.setDepreciationMethod(req.getDepreciationMethod());
|
||||
entity.setDepreciationYears(req.getDepreciationYears());
|
||||
entity.setSalvageValue(req.getSalvageValue());
|
||||
entity.setWarrantyExpireDate(req.getWarrantyExpireDate());
|
||||
entity.setLastMaintenanceDate(req.getLastMaintenanceDate());
|
||||
entity.setNextMaintenanceDate(req.getNextMaintenanceDate());
|
||||
entity.setMaintenancePerson(req.getMaintenancePerson());
|
||||
entity.setInventoryBarcode(req.getInventoryBarcode());
|
||||
entity.setAssetRemark(req.getAssetRemark());
|
||||
|
||||
// 新增采购相关字段
|
||||
entity.setAccountNumber(req.getAccountNumber());
|
||||
entity.setQuantity(req.getQuantity());
|
||||
entity.setUnitPrice(req.getUnitPrice());
|
||||
entity.setTotalPrice(req.getTotalPrice());
|
||||
entity.setInventoryBasis(req.getInventoryBasis());
|
||||
entity.setDynamicRecord(req.getDynamicRecord());
|
||||
|
||||
// 新增字段转换
|
||||
entity.setUsingDepartment(req.getUsingDepartment());
|
||||
entity.setBorrowingTime(req.getBorrowingTime());
|
||||
entity.setReturnTime(req.getReturnTime());
|
||||
entity.setOutStockTime(req.getOutStockTime());
|
||||
entity.setTotalUsageTime(req.getTotalUsageTime());
|
||||
entity.setDepreciationRate(req.getDepreciationRate());
|
||||
entity.setDepreciationMethodDesc(req.getDepreciationMethodDesc());
|
||||
entity.setInvoice(req.getInvoice());
|
||||
entity.setInvoiceStatus(req.getInvoiceStatus());
|
||||
entity.setAttachments(req.getAttachments());
|
||||
entity.setPhotos(req.getPhotos());
|
||||
entity.setBarcode(req.getBarcode());
|
||||
entity.setImporter(req.getImporter());
|
||||
entity.setInventoryTimeStatus1(req.getInventoryTimeStatus1());
|
||||
entity.setInventoryTimeStatus2(req.getInventoryTimeStatus2());
|
||||
entity.setInventoryTimeStatus3(req.getInventoryTimeStatus3());
|
||||
entity.setInventoryCheckTimeStatus1(req.getInventoryCheckTimeStatus1());
|
||||
entity.setInventoryCheckTimeStatus2(req.getInventoryCheckTimeStatus2());
|
||||
entity.setInventoryCheckTimeStatus3(req.getInventoryCheckTimeStatus3());
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换为响应对象
|
||||
*/
|
||||
private EquipmentResp convertToResp(EquipmentEntity entity) {
|
||||
EquipmentResp resp = new EquipmentResp();
|
||||
resp.setEquipmentId(entity.getEquipmentId());
|
||||
resp.setAssetCode(entity.getAssetCode());
|
||||
resp.setEquipmentName(entity.getEquipmentName());
|
||||
resp.setEquipmentType(entity.getEquipmentType());
|
||||
resp.setEquipmentTypeLabel(EquipmentTypeEnum.getDescByCode(entity.getEquipmentType()));
|
||||
resp.setEquipmentModel(entity.getEquipmentModel());
|
||||
resp.setEquipmentSn(entity.getEquipmentSn());
|
||||
resp.setBrand(entity.getBrand());
|
||||
resp.setSpecification(entity.getSpecification());
|
||||
resp.setEquipmentStatus(entity.getEquipmentStatus());
|
||||
resp.setEquipmentStatusLabel(EquipmentStatusEnum.getDescByCode(entity.getEquipmentStatus()));
|
||||
resp.setUseStatus(entity.getUseStatus());
|
||||
resp.setLocationStatus(entity.getLocationStatus());
|
||||
resp.setLocationStatusLabel(LocationStatusEnum.getDescByCode(entity.getLocationStatus()));
|
||||
resp.setPhysicalLocation(entity.getPhysicalLocation());
|
||||
resp.setResponsiblePerson(entity.getResponsiblePerson());
|
||||
resp.setHealthStatus(entity.getHealthStatus());
|
||||
resp.setHealthStatusLabel(HealthStatusEnum.getDescByCode(entity.getHealthStatus()));
|
||||
resp.setPurchaseTime(entity.getPurchaseTime());
|
||||
resp.setInStockTime(entity.getInStockTime());
|
||||
resp.setActivationTime(entity.getActivationTime());
|
||||
resp.setExpectedScrapTime(entity.getExpectedScrapTime());
|
||||
resp.setActualScrapTime(entity.getActualScrapTime());
|
||||
resp.setStatusChangeTime(entity.getStatusChangeTime());
|
||||
resp.setPurchaseOrder(entity.getPurchaseOrder());
|
||||
resp.setSupplierName(entity.getSupplierName());
|
||||
resp.setCurrentNetValue(entity.getCurrentNetValue());
|
||||
resp.setDepreciationMethod(entity.getDepreciationMethod());
|
||||
resp.setDepreciationYears(entity.getDepreciationYears());
|
||||
resp.setSalvageValue(entity.getSalvageValue());
|
||||
resp.setWarrantyExpireDate(entity.getWarrantyExpireDate());
|
||||
resp.setLastMaintenanceDate(entity.getLastMaintenanceDate());
|
||||
resp.setNextMaintenanceDate(entity.getNextMaintenanceDate());
|
||||
resp.setMaintenancePerson(entity.getMaintenancePerson());
|
||||
resp.setInventoryBarcode(entity.getInventoryBarcode());
|
||||
resp.setAssetRemark(entity.getAssetRemark());
|
||||
|
||||
// 新增采购相关字段
|
||||
resp.setAccountNumber(entity.getAccountNumber());
|
||||
resp.setQuantity(entity.getQuantity());
|
||||
resp.setUnitPrice(entity.getUnitPrice());
|
||||
resp.setTotalPrice(entity.getTotalPrice());
|
||||
resp.setInventoryBasis(entity.getInventoryBasis());
|
||||
resp.setDynamicRecord(entity.getDynamicRecord());
|
||||
|
||||
// 新增字段转换
|
||||
resp.setUsingDepartment(entity.getUsingDepartment());
|
||||
resp.setBorrowingTime(entity.getBorrowingTime());
|
||||
resp.setReturnTime(entity.getReturnTime());
|
||||
resp.setOutStockTime(entity.getOutStockTime());
|
||||
resp.setTotalUsageTime(entity.getTotalUsageTime());
|
||||
resp.setDepreciationRate(entity.getDepreciationRate());
|
||||
resp.setDepreciationMethodDesc(entity.getDepreciationMethodDesc());
|
||||
resp.setInvoice(entity.getInvoice());
|
||||
resp.setInvoiceStatus(entity.getInvoiceStatus());
|
||||
resp.setAttachments(entity.getAttachments());
|
||||
resp.setPhotos(entity.getPhotos());
|
||||
resp.setBarcode(entity.getBarcode());
|
||||
resp.setImporter(entity.getImporter());
|
||||
resp.setInventoryTimeStatus1(entity.getInventoryTimeStatus1());
|
||||
resp.setInventoryTimeStatus2(entity.getInventoryTimeStatus2());
|
||||
resp.setInventoryTimeStatus3(entity.getInventoryTimeStatus3());
|
||||
resp.setInventoryCheckTimeStatus1(entity.getInventoryCheckTimeStatus1());
|
||||
resp.setInventoryCheckTimeStatus2(entity.getInventoryCheckTimeStatus2());
|
||||
resp.setInventoryCheckTimeStatus3(entity.getInventoryCheckTimeStatus3());
|
||||
|
||||
resp.setCreateTime(entity.getCreateTime());
|
||||
resp.setUpdateTime(entity.getUpdateTime());
|
||||
|
||||
return resp;
|
||||
}
|
||||
|
||||
// 采购管理相关方法实现
|
||||
@Override
|
||||
public IPage<EquipmentResp> procurementPage(EquipmentListReq req) {
|
||||
log.info("开始执行设备采购记录分页查询,请求参数: {}", req);
|
||||
|
||||
// 创建分页对象,处理null值
|
||||
Integer pageNum = req.getPage() != null ? req.getPage() : (req.getPageNum() != null ? req.getPageNum() : 1);
|
||||
Integer pageSize = req.getPageSize() != null ? req.getPageSize() : 10;
|
||||
Page<EquipmentEntity> page = new Page<>(pageNum, pageSize);
|
||||
|
||||
// 构建查询条件,参考设备分页查询的逻辑
|
||||
LambdaQueryWrapper<EquipmentEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||
// 不需要手动添加 del_flag 条件,@TableLogic 注解会自动处理
|
||||
|
||||
// 添加搜索条件并记录日志
|
||||
int conditionCount = 0;
|
||||
|
||||
if (StringUtils.hasText(req.getEquipmentName())) {
|
||||
queryWrapper.like(EquipmentEntity::getEquipmentName, req.getEquipmentName());
|
||||
log.info("添加设备名称查询条件: {}", req.getEquipmentName());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getEquipmentType())) {
|
||||
queryWrapper.eq(EquipmentEntity::getEquipmentType, req.getEquipmentType());
|
||||
log.info("添加设备类型查询条件: {}", req.getEquipmentType());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getEquipmentStatus())) {
|
||||
queryWrapper.eq(EquipmentEntity::getEquipmentStatus, req.getEquipmentStatus());
|
||||
log.info("添加设备状态查询条件: {}", req.getEquipmentStatus());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getEquipmentSn())) {
|
||||
queryWrapper.like(EquipmentEntity::getEquipmentSn, req.getEquipmentSn());
|
||||
log.info("添加设备序列号查询条件: {}", req.getEquipmentSn());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getAssetCode())) {
|
||||
queryWrapper.like(EquipmentEntity::getAssetCode, req.getAssetCode());
|
||||
log.info("添加资产编号查询条件: {}", req.getAssetCode());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getBrand())) {
|
||||
queryWrapper.like(EquipmentEntity::getBrand, req.getBrand());
|
||||
log.info("添加品牌查询条件: {}", req.getBrand());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getLocationStatus())) {
|
||||
queryWrapper.eq(EquipmentEntity::getLocationStatus, req.getLocationStatus());
|
||||
log.info("添加位置状态查询条件: {}", req.getLocationStatus());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getHealthStatus())) {
|
||||
queryWrapper.eq(EquipmentEntity::getHealthStatus, req.getHealthStatus());
|
||||
log.info("添加健康状态查询条件: {}", req.getHealthStatus());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getResponsiblePerson())) {
|
||||
queryWrapper.like(EquipmentEntity::getResponsiblePerson, req.getResponsiblePerson());
|
||||
log.info("添加负责人查询条件: {}", req.getResponsiblePerson());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getPhysicalLocation())) {
|
||||
queryWrapper.like(EquipmentEntity::getPhysicalLocation, req.getPhysicalLocation());
|
||||
log.info("添加物理位置查询条件: {}", req.getPhysicalLocation());
|
||||
conditionCount++;
|
||||
}
|
||||
|
||||
// 添加采购相关的搜索条件
|
||||
if (StringUtils.hasText(req.getPurchaseOrder())) {
|
||||
queryWrapper.like(EquipmentEntity::getPurchaseOrder, req.getPurchaseOrder());
|
||||
log.info("添加采购订单查询条件: {}", req.getPurchaseOrder());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getSupplierName())) {
|
||||
queryWrapper.like(EquipmentEntity::getSupplierName, req.getSupplierName());
|
||||
log.info("添加供应商查询条件: {}", req.getSupplierName());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getAccountNumber())) {
|
||||
queryWrapper.like(EquipmentEntity::getAccountNumber, req.getAccountNumber());
|
||||
log.info("添加次户号查询条件: {}", req.getAccountNumber());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getQuantity() != null) {
|
||||
queryWrapper.eq(EquipmentEntity::getQuantity, req.getQuantity());
|
||||
log.info("添加数量查询条件: {}", req.getQuantity());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getUnitPrice() != null) {
|
||||
queryWrapper.eq(EquipmentEntity::getUnitPrice, req.getUnitPrice());
|
||||
log.info("添加单价查询条件: {}", req.getUnitPrice());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getTotalPrice() != null) {
|
||||
queryWrapper.eq(EquipmentEntity::getTotalPrice, req.getTotalPrice());
|
||||
log.info("添加总价查询条件: {}", req.getTotalPrice());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getInventoryBasis())) {
|
||||
queryWrapper.like(EquipmentEntity::getInventoryBasis, req.getInventoryBasis());
|
||||
log.info("添加盘点依据查询条件: {}", req.getInventoryBasis());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getDynamicRecord())) {
|
||||
queryWrapper.like(EquipmentEntity::getDynamicRecord, req.getDynamicRecord());
|
||||
log.info("添加动态记录查询条件: {}", req.getDynamicRecord());
|
||||
conditionCount++;
|
||||
}
|
||||
|
||||
log.info("总共添加了 {} 个查询条件", conditionCount);
|
||||
|
||||
// 按采购时间倒序排列
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getPurchaseTime);
|
||||
|
||||
// 执行查询
|
||||
IPage<EquipmentEntity> result = this.page(page, queryWrapper);
|
||||
|
||||
// 转换为响应对象
|
||||
List<EquipmentResp> records = result.getRecords().stream()
|
||||
.map(this::convertToResp)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 创建新的分页结果
|
||||
Page<EquipmentResp> respPage = new Page<>(result.getCurrent(), result.getSize(), result.getTotal());
|
||||
respPage.setRecords(records);
|
||||
|
||||
log.info("设备采购记录分页查询完成,总记录数: {}", result.getTotal());
|
||||
return respPage;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void saveProcurement(EquipmentReq req) {
|
||||
log.info("开始新增设备采购记录,请求参数: {}", req);
|
||||
|
||||
// 验证采购订单号唯一性
|
||||
if (StringUtils.hasText(req.getPurchaseOrder())) {
|
||||
LambdaQueryWrapper<EquipmentEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(EquipmentEntity::getPurchaseOrder, req.getPurchaseOrder());
|
||||
long count = this.count(queryWrapper);
|
||||
if (count > 0) {
|
||||
throw new ServiceException("采购订单号已存在");
|
||||
}
|
||||
}
|
||||
|
||||
// 设置采购相关的时间字段
|
||||
if (req.getPurchaseTime() == null) {
|
||||
req.setPurchaseTime(LocalDateTime.now());
|
||||
}
|
||||
|
||||
// 转换为实体并保存
|
||||
EquipmentEntity entity = convertToEntity(req);
|
||||
this.save(entity);
|
||||
|
||||
log.info("设备采购记录新增成功,设备ID: {}", entity.getEquipmentId());
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void updateProcurement(String equipmentId, EquipmentReq req) {
|
||||
log.info("开始修改设备采购记录,设备ID: {}, 请求参数: {}", equipmentId, req);
|
||||
|
||||
// 检查设备是否存在
|
||||
EquipmentEntity existingEntity = this.getById(equipmentId);
|
||||
if (existingEntity == null) {
|
||||
throw new ServiceException("设备不存在");
|
||||
}
|
||||
|
||||
// 验证采购订单号唯一性(排除当前设备)
|
||||
if (StringUtils.hasText(req.getPurchaseOrder())) {
|
||||
LambdaQueryWrapper<EquipmentEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(EquipmentEntity::getPurchaseOrder, req.getPurchaseOrder())
|
||||
.ne(EquipmentEntity::getEquipmentId, equipmentId);
|
||||
long count = this.count(queryWrapper);
|
||||
if (count > 0) {
|
||||
throw new ServiceException("采购订单号已存在");
|
||||
}
|
||||
}
|
||||
|
||||
// 转换为实体并更新
|
||||
EquipmentEntity entity = convertToEntity(req);
|
||||
entity.setEquipmentId(equipmentId);
|
||||
this.updateById(entity);
|
||||
|
||||
log.info("设备采购记录修改成功,设备ID: {}", equipmentId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getProcurementStats() {
|
||||
log.info("开始获取采购统计信息");
|
||||
|
||||
// 统计采购总金额
|
||||
LambdaQueryWrapper<EquipmentEntity> priceWrapper = new LambdaQueryWrapper<>();
|
||||
priceWrapper.isNotNull(EquipmentEntity::getTotalPrice);
|
||||
List<EquipmentEntity> priceEntities = this.list(priceWrapper);
|
||||
double totalAmount = priceEntities.stream()
|
||||
.mapToDouble(entity -> entity.getTotalPrice() != null ? entity.getTotalPrice().doubleValue() : 0)
|
||||
.sum();
|
||||
|
||||
// 统计供应商数量
|
||||
LambdaQueryWrapper<EquipmentEntity> supplierWrapper = new LambdaQueryWrapper<>();
|
||||
supplierWrapper.isNotNull(EquipmentEntity::getSupplierName)
|
||||
.groupBy(EquipmentEntity::getSupplierName);
|
||||
long supplierCount = this.count(supplierWrapper);
|
||||
|
||||
// 统计采购设备数量
|
||||
LambdaQueryWrapper<EquipmentEntity> equipmentWrapper = new LambdaQueryWrapper<>();
|
||||
equipmentWrapper.isNotNull(EquipmentEntity::getPurchaseOrder);
|
||||
long equipmentCount = this.count(equipmentWrapper);
|
||||
|
||||
// 构建统计结果
|
||||
java.util.Map<String, Object> stats = new java.util.HashMap<>();
|
||||
stats.put("totalAmount", totalAmount);
|
||||
stats.put("supplierCount", supplierCount);
|
||||
stats.put("equipmentCount", equipmentCount);
|
||||
stats.put("averageAmount", equipmentCount > 0 ? totalAmount / equipmentCount : 0);
|
||||
|
||||
log.info("采购统计信息获取完成,总金额: {}, 供应商数: {}, 设备数: {}", totalAmount, supplierCount, equipmentCount);
|
||||
return stats;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@Component
|
||||
public class InMemoryVerificationCodeStore {
|
||||
|
||||
// 存储邮箱验证码的map
|
||||
private final Map<String,codeInfo> emailCodeMap = new ConcurrentHashMap<>();
|
||||
|
||||
public void save(String email, String code){
|
||||
// 设置五分钟过期
|
||||
emailCodeMap.put(email,new codeInfo(code, LocalDateTime.now().plusMinutes(5)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证验证码
|
||||
* @param email
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
public boolean validate(String email, String code){
|
||||
codeInfo codeInfo = emailCodeMap.get(email);
|
||||
if(codeInfo == null){
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean isValid = false;
|
||||
if(code.equals(codeInfo.getCode()) && LocalDateTime.now().isBefore(codeInfo.getExpireTime())){
|
||||
isValid = true;
|
||||
}
|
||||
if(isValid){
|
||||
emailCodeMap.remove(email);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断邮箱是否可发送验证码
|
||||
* @param email
|
||||
* @return
|
||||
*/
|
||||
public boolean canSend(String email){
|
||||
codeInfo codeInfo = emailCodeMap.get(email);
|
||||
if(codeInfo != null && LocalDateTime.now().isBefore(codeInfo.getExpireTime())){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class codeInfo {
|
||||
// 验证码
|
||||
private String code;
|
||||
|
||||
// 过期时间
|
||||
private LocalDateTime expireTime;
|
||||
|
||||
// 上一次发送时间
|
||||
private LocalDateTime lastSendTime;
|
||||
|
||||
public codeInfo(String code, LocalDateTime expireTime){
|
||||
this.code = code;
|
||||
this.expireTime = expireTime;
|
||||
this.lastSendTime = LocalDateTime.now();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,25 +1,24 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.domain.entity.ProjectBudgetInfoEntity;
|
||||
import com.dite.znpt.domain.entity.ProjectEntity;
|
||||
import com.dite.znpt.domain.vo.ProjectBudgetInfoDetailResp;
|
||||
import com.dite.znpt.domain.vo.ProjectBudgetInfoImportReq;
|
||||
import com.dite.znpt.domain.vo.ProjectBudgetInfoListReq;
|
||||
import com.dite.znpt.domain.vo.ProjectBudgetInfoListResp;
|
||||
import com.dite.znpt.domain.vo.ProjectBudgetInfoReq;
|
||||
import com.dite.znpt.domain.vo.ProjectBudgetInfoResp;
|
||||
import com.dite.znpt.enums.AttachBusinessTypeEnum;
|
||||
import com.dite.znpt.enums.BudgeTypeEnum;
|
||||
import com.dite.znpt.mapper.ProjectBudgetInfoMapper;
|
||||
import com.dite.znpt.service.AttachInfoService;
|
||||
import com.dite.znpt.service.ProjectBudgetInfoService;
|
||||
import com.dite.znpt.service.ProjectService;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -30,63 +29,98 @@ import java.util.List;
|
|||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ProjectBudgetInfoServiceImpl extends ServiceImpl<ProjectBudgetInfoMapper, ProjectBudgetInfoEntity> implements ProjectBudgetInfoService {
|
||||
@Resource
|
||||
ProjectService projectService;
|
||||
|
||||
private final AttachInfoService attachInfoService;
|
||||
@Resource
|
||||
AttachInfoServiceImpl attachInfoService;
|
||||
|
||||
/**
|
||||
* 功能描述:查询项目预算信息列表
|
||||
*
|
||||
* @param projectBudgetInfoReq 项目预算信息信息
|
||||
* @return {@link List }<{@link ProjectBudgetInfoResp }>
|
||||
* @author huise23
|
||||
* @date 2025/07/17 21:58
|
||||
**/
|
||||
@Override
|
||||
public List<ProjectBudgetInfoListResp> selectList(ProjectBudgetInfoListReq projectBudgetInfoReq) {
|
||||
PageUtil.startPage();
|
||||
List<ProjectBudgetInfoListResp> projectBudgetInfoList= this.baseMapper.queryBySelective(projectBudgetInfoReq);
|
||||
projectBudgetInfoList.forEach(resp -> {
|
||||
|
||||
});
|
||||
return projectBudgetInfoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:根据项目id获取项目预算信息列表
|
||||
*
|
||||
* @param projectId 项目id
|
||||
* @return {@link List }<{@link ProjectBudgetInfoListResp }>
|
||||
* @author huise23
|
||||
* @date 2025/07/17 21:58
|
||||
**/
|
||||
@Override
|
||||
public List<ProjectBudgetInfoResp> detailByProjectId(String projectId) {
|
||||
List<ProjectBudgetInfoResp> projectBudgetInfoList= this.baseMapper.detailByProjectId(projectId);
|
||||
projectBudgetInfoList.forEach(resp -> {
|
||||
resp.setBudgetTypeDesc(BudgeTypeEnum.getDescByCode(resp.getBudgetType()));
|
||||
});
|
||||
return projectBudgetInfoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:新增项目预算信息
|
||||
*
|
||||
* @param projectBudgetInfoReq 项目预算信息
|
||||
* @author huise23
|
||||
* @date 2025/07/17 21:58
|
||||
**/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveData(List<ProjectBudgetInfoReq> projectBudgetInfoReq) {
|
||||
List<ProjectBudgetInfoEntity> list = new ArrayList<>();
|
||||
for (ProjectBudgetInfoReq req : projectBudgetInfoReq) {
|
||||
ProjectBudgetInfoEntity info = BeanUtil.copyProperties(req, ProjectBudgetInfoEntity.class);
|
||||
info.setBudgetId(IdUtil.simpleUUID());
|
||||
attachInfoService.updateBusinessIdByAttachIds(info.getBudgetId(), ListUtil.of(req.getAttachId()), AttachBusinessTypeEnum.PROJECT_BUDGE);
|
||||
list.add(info);
|
||||
public List<ProjectBudgetInfoListResp> list(ProjectBudgetInfoListReq req) {
|
||||
List<ProjectBudgetInfoListResp> list = this.baseMapper.queryBySelective(req);
|
||||
if (CollectionUtil.isEmpty(list)) {
|
||||
return Collections.emptyList(); // 返回不可修改的空集合
|
||||
}
|
||||
lambdaUpdate().eq(ProjectBudgetInfoEntity::getProjectId, list.get(0).getProjectId()).remove();
|
||||
baseMapper.insert(list);
|
||||
list.forEach(item -> {
|
||||
item.setProjectName(projectService.getById(item.getProjectId()).getProjectName());
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProjectBudgetInfoListResp> page(ProjectBudgetInfoListReq req) {
|
||||
PageUtil.startPage();
|
||||
return this.list(req);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveData(ProjectBudgetInfoImportReq req) {
|
||||
ProjectBudgetInfoEntity entity = BeanUtil.copyProperties(req, ProjectBudgetInfoEntity.class);
|
||||
ProjectEntity projectEntity = projectService.getById(req.getProjectId());
|
||||
switch (req.getBudgetName()) {
|
||||
case "人工成本":
|
||||
projectEntity.setUseLaborCost(projectEntity.getUseLaborCost() + req.getBudgetAmount());
|
||||
break;
|
||||
case "设备摊销":
|
||||
projectEntity.setUseEquipmentAmortization(projectEntity.getUseEquipmentAmortization() + req.getBudgetAmount());
|
||||
break;
|
||||
case "奖金预提":
|
||||
projectEntity.setUseBonusProvision(projectEntity.getUseBonusProvision() + req.getBudgetAmount());
|
||||
break;
|
||||
case "交通食宿":
|
||||
projectEntity.setUseTransAccomMeals(projectEntity.getUseTransAccomMeals() + req.getBudgetAmount());
|
||||
break;
|
||||
case "其他杂费":
|
||||
projectEntity.setUseOthersCost(projectEntity.getUseOthersCost() + req.getBudgetAmount());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
projectService.updateById(projectEntity);
|
||||
this.baseMapper.insert(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveData(ProjectBudgetInfoImportReq req, MultipartFile[] files) {
|
||||
ProjectBudgetInfoEntity entity = BeanUtil.copyProperties(req, ProjectBudgetInfoEntity.class);
|
||||
// 把附件存起来,使用已有的附件上传逻辑就行,但我看不懂,pass
|
||||
this.baseMapper.insert(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProjectBudgetInfoDetailResp detailByProjectId(String projectId) {
|
||||
ProjectEntity projectEntity = projectService.getById(projectId);
|
||||
ProjectBudgetInfoDetailResp resp = new ProjectBudgetInfoDetailResp();
|
||||
BeanUtil.copyProperties(projectEntity, resp);
|
||||
resp.setRestBudget(resp.getProjectBudget() - resp.getUseLaborCost() - resp.getUseEquipmentAmortization() - resp.getUseBonusProvision() - resp.getUseTransAccomMeals() - resp.getUseOthersCost());
|
||||
return resp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(String budgetId) {
|
||||
ProjectBudgetInfoEntity entity = this.baseMapper.selectById(budgetId);
|
||||
ProjectEntity projectEntity = projectService.getById(entity.getProjectId());
|
||||
switch (entity.getBudgetName()) {
|
||||
case "人工成本":
|
||||
projectEntity.setUseLaborCost(projectEntity.getUseLaborCost() - entity.getBudgetAmount());
|
||||
break;
|
||||
case "设备摊销":
|
||||
projectEntity.setUseEquipmentAmortization(projectEntity.getUseEquipmentAmortization() - entity.getBudgetAmount());
|
||||
break;
|
||||
case "奖金预提":
|
||||
projectEntity.setUseBonusProvision(projectEntity.getUseBonusProvision() - entity.getBudgetAmount());
|
||||
break;
|
||||
case "交通食宿":
|
||||
projectEntity.setUseTransAccomMeals(projectEntity.getUseTransAccomMeals() - entity.getBudgetAmount());
|
||||
break;
|
||||
case "其他杂费":
|
||||
projectEntity.setUseOthersCost(projectEntity.getUseOthersCost() - entity.getBudgetAmount());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
projectService.updateById(projectEntity);
|
||||
this.baseMapper.deleteById(budgetId);
|
||||
// 删除附件
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ import lombok.RequiredArgsConstructor;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
@ -293,7 +294,51 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
|
|||
resp.setStatusLabel(ProjectStatusEnum.getDescByCode(resp.getStatus()));
|
||||
|
||||
// 获取项目人员信息
|
||||
resp.setProjectMembers(selectByProjectId(projectId));
|
||||
List<ProjectMemberResp> projectMembers = selectByProjectId(projectId);
|
||||
resp.setProjectMembers(projectMembers);
|
||||
|
||||
// 计算团队规模
|
||||
resp.setTeamSize(projectMembers.size());
|
||||
|
||||
// 获取项目经理信息
|
||||
String managerName = projectMembers.stream()
|
||||
.filter(member -> "PROJECT_MANAGER".equals(member.getRoleType()))
|
||||
.map(ProjectMemberResp::getUserName)
|
||||
.findFirst()
|
||||
.orElse("");
|
||||
resp.setManager(managerName);
|
||||
|
||||
// 计算项目预算(从预算信息中汇总)
|
||||
List<ProjectBudgetInfoEntity> budgets = projectBudgetInfoService.lambdaQuery()
|
||||
.eq(ProjectBudgetInfoEntity::getProjectId, projectId)
|
||||
.list();
|
||||
BigDecimal totalBudget = budgets.stream()
|
||||
.map(budget -> BigDecimal.valueOf(budget.getBudgetAmount()))
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
resp.setBudget(totalBudget);
|
||||
|
||||
// 计算项目进度
|
||||
List<ProjectTaskEntity> tasks = projectTaskService.lambdaQuery()
|
||||
.eq(ProjectTaskEntity::getProjectId, projectId)
|
||||
.list();
|
||||
if (!tasks.isEmpty()) {
|
||||
long completedTasks = tasks.stream()
|
||||
.filter(task -> task.getStatus() != null && task.getStatus() == 2)
|
||||
.count();
|
||||
resp.setProgress((int) (completedTasks * 100 / tasks.size()));
|
||||
} else {
|
||||
resp.setProgress(0);
|
||||
}
|
||||
|
||||
// 计算准备进度(基于任务状态)
|
||||
if (!tasks.isEmpty()) {
|
||||
long preparedTasks = tasks.stream()
|
||||
.filter(task -> task.getStatus() != null && task.getStatus() >= 1)
|
||||
.count();
|
||||
resp.setPreparationProgress((int) (preparedTasks * 100 / tasks.size()));
|
||||
} else {
|
||||
resp.setPreparationProgress(0);
|
||||
}
|
||||
|
||||
// 获取项目机组信息
|
||||
List<TurbineEntity> turbines = turbineService.lambdaQuery()
|
||||
|
@ -307,9 +352,6 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
|
|||
}).collect(Collectors.toList()));
|
||||
|
||||
// 获取项目任务信息
|
||||
List<ProjectTaskEntity> tasks = projectTaskService.lambdaQuery()
|
||||
.eq(ProjectTaskEntity::getProjectId, projectId)
|
||||
.list();
|
||||
resp.setTasks(tasks.stream().map(task -> {
|
||||
ProjectDetailResp.TaskInfo info = new ProjectDetailResp.TaskInfo();
|
||||
BeanUtil.copyProperties(task, info);
|
||||
|
@ -318,9 +360,6 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
|
|||
}).collect(Collectors.toList()));
|
||||
|
||||
// 获取项目预算信息
|
||||
List<ProjectBudgetInfoEntity> budgets = projectBudgetInfoService.lambdaQuery()
|
||||
.eq(ProjectBudgetInfoEntity::getProjectId, projectId)
|
||||
.list();
|
||||
resp.setBudgets(budgets.stream().map(budget -> {
|
||||
ProjectDetailResp.BudgetInfo info = new ProjectDetailResp.BudgetInfo();
|
||||
BeanUtil.copyProperties(budget, info);
|
||||
|
@ -381,6 +420,22 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
|
|||
item.setConstructionTeamLeaderName(memberNames.get("TEAM_LEADER"));
|
||||
item.setConstructorNames(memberNames.get("CONSTRUCTOR"));
|
||||
|
||||
// 设置项目经理
|
||||
item.setManager(memberNames.get("PROJECT_MANAGER"));
|
||||
|
||||
// 设置团队规模
|
||||
item.setTeamSize(members.size());
|
||||
|
||||
// 转换为团队成员列表
|
||||
List<ProjectKanbanDataResp.ProjectKanbanItem.TeamMemberResp> teamMembers = members.stream()
|
||||
.map(member -> {
|
||||
ProjectKanbanDataResp.ProjectKanbanItem.TeamMemberResp teamMember = new ProjectKanbanDataResp.ProjectKanbanItem.TeamMemberResp();
|
||||
BeanUtil.copyProperties(member, teamMember);
|
||||
return teamMember;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
item.setTeamMembers(teamMembers);
|
||||
|
||||
// 统计机组数量
|
||||
Long turbineCount = turbineService.lambdaQuery()
|
||||
.eq(TurbineEntity::getProjectId, project.getProjectId())
|
||||
|
@ -403,10 +458,32 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
|
|||
// 计算项目进度百分比
|
||||
if (taskCount > 0) {
|
||||
item.setProgressPercentage((int) (completedTaskCount * 100 / taskCount));
|
||||
item.setProgress((int) (completedTaskCount * 100 / taskCount));
|
||||
} else {
|
||||
item.setProgressPercentage(0);
|
||||
item.setProgress(0);
|
||||
}
|
||||
|
||||
// 计算准备进度(基于任务状态)
|
||||
if (taskCount > 0) {
|
||||
Long preparedTasks = projectTaskService.lambdaQuery()
|
||||
.eq(ProjectTaskEntity::getProjectId, project.getProjectId())
|
||||
.ge(ProjectTaskEntity::getStatus, 1)
|
||||
.count();
|
||||
item.setPreparationProgress((int) (preparedTasks * 100 / taskCount));
|
||||
} else {
|
||||
item.setPreparationProgress(0);
|
||||
}
|
||||
|
||||
// 计算项目预算(从预算信息中汇总)
|
||||
List<ProjectBudgetInfoEntity> budgets = projectBudgetInfoService.lambdaQuery()
|
||||
.eq(ProjectBudgetInfoEntity::getProjectId, project.getProjectId())
|
||||
.list();
|
||||
BigDecimal totalBudget = budgets.stream()
|
||||
.map(budget -> BigDecimal.valueOf(budget.getBudgetAmount()))
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
item.setBudget(totalBudget);
|
||||
|
||||
return item;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.dite.znpt.domain.entity.PostEntity;
|
|||
import com.dite.znpt.domain.entity.UserEntity;
|
||||
import com.dite.znpt.domain.entity.UserPostEntity;
|
||||
import com.dite.znpt.domain.vo.PostResp;
|
||||
import com.dite.znpt.domain.vo.UserResp;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
import com.dite.znpt.mapper.UserPostMapper;
|
||||
import com.dite.znpt.service.PostService;
|
||||
|
@ -88,4 +89,14 @@ public class UserPostServiceImpl extends ServiceImpl<UserPostMapper, UserPostEnt
|
|||
});
|
||||
this.saveBatch(userPostList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserResp> getUsersByPostId(String postId) {
|
||||
List<String> userIds = this.list(Wrappers.lambdaQuery(UserPostEntity.class).eq(UserPostEntity::getPostId, postId)).stream().map(UserPostEntity::getUserId).toList();
|
||||
if (CollUtil.isEmpty(userIds)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<UserEntity> users = userService.listByIds(userIds).stream().filter(user -> Constants.DEL_FLAG_0.equals(user.getDelFlag()) && Constants.STATUS_0.equals(user.getStatus())).toList();
|
||||
return Converts.INSTANCE.toUserResp(users);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.dite.znpt.domain.entity.RoleEntity;
|
|||
import com.dite.znpt.domain.entity.UserEntity;
|
||||
import com.dite.znpt.domain.entity.UserRoleEntity;
|
||||
import com.dite.znpt.domain.vo.RoleResp;
|
||||
import com.dite.znpt.domain.vo.UserResp;
|
||||
import com.dite.znpt.domain.vo.UserRoleReq;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
import com.dite.znpt.mapper.UserRoleMapper;
|
||||
|
@ -88,4 +89,14 @@ public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRoleEnt
|
|||
});
|
||||
this.saveBatch(userRoleList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserResp> getUsersByRoleId(String roleId) {
|
||||
List<String> userIds = this.list(Wrappers.lambdaQuery(UserRoleEntity.class).eq(UserRoleEntity::getRoleId, roleId)).stream().map(UserRoleEntity::getUserId).toList();
|
||||
if (CollUtil.isEmpty(userIds)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<UserEntity> users = userService.listByIds(userIds).stream().filter(user -> Constants.DEL_FLAG_0.equals(user.getDelFlag()) && Constants.STATUS_0.equals(user.getStatus())).toList();
|
||||
return Converts.INSTANCE.toUserResp(users);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
|
|||
UserEntity entity = this.getById(userId);
|
||||
UserResp userResp= Converts.INSTANCE.toUserResp(entity);
|
||||
if(StrUtil.isNotBlank(userResp.getDeptId())){
|
||||
userResp.setUserName(entity.getName());
|
||||
userResp.setName(entity.getName());
|
||||
userResp.setDeptName(deptService.getById(userResp.getDeptId()).getDeptName());
|
||||
}
|
||||
userResp.setUserTypeLabel(UserTypeEnum.getDescByCode(userResp.getUserType()));
|
||||
|
@ -198,6 +198,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
|
|||
if(CollUtil.isNotEmpty(req.getPostIds())){
|
||||
userPostService.bindUserPost(userId, req.getPostIds());
|
||||
}
|
||||
if(CollUtil.isNotEmpty(req.getRoleIds())){
|
||||
userRoleService.bindUserRole(new UserRoleReq().setUserId(userId).setRoleIds(req.getRoleIds()));
|
||||
}
|
||||
this.updateById(entity);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
<?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.dite.znpt.mapper.BusinessDataFileMapper">
|
||||
<select id="List" resultType="com.dite.znpt.domain.entity.BusinessDataFileEntity">
|
||||
select * from business_data_part_file
|
||||
<where>
|
||||
<if test="folderId != null">
|
||||
and folder_id = #{folderId}
|
||||
</if>
|
||||
<if test="fileName != null and fileName != ''">
|
||||
and file_name like concat('%', #{fileName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<delete id="delete" parameterType="com.dite.znpt.domain.entity.BusinessDataFileEntity" >
|
||||
delete from business_data_part_file
|
||||
<where>
|
||||
<if test="fileId != null">
|
||||
and file_id = #{fileId}
|
||||
</if>
|
||||
<if test="folderId != null ">
|
||||
and folder_id = #{folderId}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
|
||||
</delete>
|
||||
<insert id="add" parameterType="com.dite.znpt.domain.entity.BusinessDataFileEntity">
|
||||
insert into business_data_part_file (file_id, folder_id, file_name, file_path, file_type, file_size, upload_time, uploader_id, is_deleted)
|
||||
values (#{fileId}, #{folderId}, #{fileName}, #{filePath}, #{fileType}, #{fileSize}, #{uploadTime}, #{uploaderId}, #{isDeleted})
|
||||
</insert>
|
||||
<select id="getPath" parameterType="java.lang.Long" resultType="java.lang.String">
|
||||
select file_path from business_data_part_file
|
||||
<where>
|
||||
<if test="fileId != null">
|
||||
and file_id = #{param1}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<!-- 在mapper中添加重命名SQL -->
|
||||
<update id="reName">
|
||||
update business_data_part_file
|
||||
<set>
|
||||
<if test="newFileName != null">file_name = #{newFileName},</if>
|
||||
<if test="newFilePath != null">file_path = #{newFilePath},</if>
|
||||
</set>
|
||||
where file_id = #{fileId}
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
<?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.dite.znpt.mapper.BusinessDataMapper">
|
||||
<insert id="insert" parameterType="com.dite.znpt.domain.entity.BusinessDataEntity">
|
||||
insert into business_data_part
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="folderName != null">folder_name,</if>
|
||||
<if test="parentId != null">parent_id,</if>
|
||||
<if test="creatorId != null">creator_id,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="isDeleted != null">is_deleted,</if>
|
||||
<if test="folderPath != null">folder_path,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="folderName != null">#{folderName},</if>
|
||||
<if test="parentId != null">#{parentId},</if>
|
||||
<if test="creatorId != null">#{creatorId},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="isDeleted != null">#{isDeleted},</if>
|
||||
<if test="folderPath != null">#{folderPath},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<select id="List" resultType="com.dite.znpt.domain.entity.BusinessDataEntity">
|
||||
select * from business_data_part
|
||||
</select>
|
||||
|
||||
<select id="getPath" resultType="java.lang.String">
|
||||
select folder_path from business_data_part where folder_id = #{parentId}
|
||||
</select>
|
||||
|
||||
<delete id="delete">
|
||||
delete from business_data_part where folder_id = #{folderId}
|
||||
</delete>
|
||||
<update id="reName">
|
||||
update business_data_part
|
||||
<set>
|
||||
<if test="folderName != null">folder_name = #{folderName},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="folderPath != null">folder_path = #{folderPath},</if>
|
||||
</set>
|
||||
where folder_id = #{folderId}
|
||||
</update>
|
||||
<select id="ListWithCondition" resultType="com.dite.znpt.domain.entity.BusinessDataEntity">
|
||||
select * from business_data_part
|
||||
<where>
|
||||
<if test="folderName != null and folderName != ''">
|
||||
folder_name like concat('%', #{folderName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -38,9 +38,6 @@
|
|||
<if test="departmentId != null and departmentId != ''">
|
||||
and a.department_id like concat ('%', #{departmentId}, '%')
|
||||
</if>
|
||||
<if test="signDate != null">
|
||||
and a.sign_date = #{signDate}
|
||||
</if>
|
||||
<if test="duration != null and duration != ''">
|
||||
and a.duration like concat ('%', #{duration}, '%')
|
||||
</if>
|
||||
|
@ -50,12 +47,6 @@
|
|||
<if test="productService != null and productService != ''">
|
||||
and a.product_service like concat ('%', #{productService}, '%')
|
||||
</if>
|
||||
<if test="paymentDate != null">
|
||||
and a.payment_date = #{paymentDate}
|
||||
</if>
|
||||
<if test="performanceDeadline != null">
|
||||
and a.performance_deadline = #{performanceDeadline}
|
||||
</if>
|
||||
<if test="paymentAddress != null and paymentAddress != ''">
|
||||
and a.payment_address like concat ('%', #{paymentAddress}, '%')
|
||||
</if>
|
||||
|
|
|
@ -3,47 +3,24 @@
|
|||
<mapper namespace="com.dite.znpt.mapper.ProjectBudgetInfoMapper">
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
a.budget_id, a.project_id, a.budget_name, a.budget_type,
|
||||
a.budget_amount, a.budget_desc, a.update_by, a.create_time,
|
||||
a.create_by, a.update_time
|
||||
a.budget_id, a.project_id, a.budget_name,
|
||||
a.budget_amount, a.budget_desc, a.attach
|
||||
</sql>
|
||||
|
||||
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.ProjectBudgetInfoListResp">
|
||||
select
|
||||
<include refid="Base_Column_List"/>, p.*
|
||||
<include refid="Base_Column_List"/>, p.*
|
||||
from project_budget_info a
|
||||
left join project p on a.project_id = p.project_id
|
||||
<where>
|
||||
<if test="budgetId != null and budgetId != ''">
|
||||
and a.budget_id like concat ('%', #{budgetId}, '%')
|
||||
</if>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
and a.project_id like concat ('%', #{projectId}, '%')
|
||||
and a.project_id = #{projectId}
|
||||
</if>
|
||||
<if test="budgetName != null and budgetName != ''">
|
||||
and a.budget_name like concat ('%', #{budgetName}, '%')
|
||||
</if>
|
||||
<if test="budgetType != null and budgetType != ''">
|
||||
and a.budget_type like concat ('%', #{budgetType}, '%')
|
||||
</if>
|
||||
<if test="budgetAmount != null">
|
||||
and a.budget_amount = #{budgetAmount}
|
||||
</if>
|
||||
<if test="budgetDesc != null and budgetDesc != ''">
|
||||
and a.budget_desc like concat ('%', #{budgetDesc}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="detailByProjectId" resultType="com.dite.znpt.domain.vo.ProjectBudgetInfoResp">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from project_budget_info a
|
||||
<where>
|
||||
<if test="_parameter != null and _parameter != ''">
|
||||
and a.project_id like concat ('%', #{projectId}, '%')
|
||||
and a.budget_name = #{budgetName}
|
||||
</if>
|
||||
</where>
|
||||
order by a.project_id, a.budget_name
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
GROUP BY prj.project_id
|
||||
)
|
||||
SELECT
|
||||
prj.project_id, prj.project_name, prj.farm_name, prj.status, prj.cover_url, prj.farm_address, prj.client, prj.client_contact, prj.client_phone, prj.inspection_unit,
|
||||
prj.project_id, prj.project_origin, prj.project_budget, prj.project_name, prj.farm_name, prj.status, prj.cover_url, prj.farm_address, prj.client, prj.client_contact, prj.client_phone, prj.inspection_unit,
|
||||
prj.inspection_contact, prj.inspection_phone, prj.scale, prj.turbine_model, prj.project_manager_id, pm.name AS project_manager_name, prj.constructor_ids,
|
||||
prj.start_date, prj.end_date, con.constructor_name, tp.taskPendingCount, tp.task_progress_count, tp.task_complete_count, tp.task_count, prj.auditor_id,
|
||||
prj.construct_team_leader_id, prj.quality_officer_id
|
||||
|
|
|
@ -8,37 +8,55 @@
|
|||
</sql>
|
||||
|
||||
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.UserListResp">
|
||||
SELECT u.user_id, u.account, u.status, u.name, u.user_code, u.user_type, u.user_status, d.dept_name, u.mobile, u.create_time,
|
||||
GROUP_CONCAT(r.role_name) AS role_name,GROUP_CONCAT(p.post_name) AS post_name
|
||||
SELECT
|
||||
u.user_id,
|
||||
u.account,
|
||||
u.status,
|
||||
u.name,
|
||||
u.user_code,
|
||||
u.user_type,
|
||||
u.user_status,
|
||||
d.dept_name,
|
||||
u.mobile,
|
||||
u.create_time,
|
||||
(
|
||||
SELECT GROUP_CONCAT(DISTINCT r.role_name)
|
||||
FROM user_role ur
|
||||
JOIN role r ON ur.role_id = r.role_id
|
||||
WHERE ur.user_id = u.user_id
|
||||
) AS role_name,
|
||||
(
|
||||
SELECT GROUP_CONCAT(DISTINCT p.post_name)
|
||||
FROM user_post up
|
||||
JOIN post p ON up.post_id = p.post_id
|
||||
WHERE up.user_id = u.user_id
|
||||
) AS post_name
|
||||
FROM user u
|
||||
LEFT JOIN dept d ON u.dept_id = d.dept_id
|
||||
LEFT JOIN user_role ur ON u.user_id = ur.user_id
|
||||
LEFT JOIN role r ON ur.role_id = r.role_id
|
||||
LEFT JOIN user_post up ON up.user_id = u.user_id
|
||||
LEFT JOIN post p ON p.post_id = up.post_id
|
||||
WHERE u.del_flag = '0'
|
||||
<where>
|
||||
<if test="userCode != null and userCode != ''">
|
||||
AND u.user_code LIKE concat ('%', #{userCode}, '%')
|
||||
AND u.user_code LIKE CONCAT('%', #{userCode}, '%')
|
||||
</if>
|
||||
<if test="account != null and account != ''">
|
||||
AND u.account LIKE concat ('%', #{account}, '%')
|
||||
AND u.account LIKE CONCAT('%', #{account}, '%')
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
AND u.name LIKE concat ('%', #{name}, '%')
|
||||
AND u.name LIKE CONCAT('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="mobile != null and mobile != ''">
|
||||
AND u.mobile LIKE concat ('%', #{mobile}, '%')
|
||||
AND u.mobile LIKE CONCAT('%', #{mobile}, '%')
|
||||
</if>
|
||||
<if test="deptId != null and deptId != ''">
|
||||
AND d.dept_id = #{deptId}
|
||||
</if>
|
||||
<if test="userStatus != null and userStatus!=''">
|
||||
<if test="userStatus != null and userStatus != ''">
|
||||
AND u.user_status = #{userStatus}
|
||||
</if>
|
||||
<if test="userType != null and userType!=''">
|
||||
<if test="userType != null and userType != ''">
|
||||
AND u.user_Type = #{userType}
|
||||
</if>
|
||||
GROUP BY u.user_id, u.account, u.status, u.name, u.user_code, u.user_type, u.user_status, d.dept_name, u.mobile, u.create_time
|
||||
</where>
|
||||
<!-- 移除了 GROUP BY -->
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
|
@ -11,6 +11,10 @@
|
|||
<artifactId>flowable</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.dite.znpt</groupId>
|
||||
|
|
1
pom.xml
1
pom.xml
|
@ -12,6 +12,7 @@
|
|||
</properties>
|
||||
<modules>
|
||||
<module>core</module>
|
||||
<module>sip</module>
|
||||
<module>web</module>
|
||||
<module>flowable</module>
|
||||
</modules>
|
||||
|
|
10
web/pom.xml
10
web/pom.xml
|
@ -20,11 +20,11 @@
|
|||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.dite.znpt</groupId>-->
|
||||
<!-- <artifactId>sip</artifactId>-->
|
||||
<!-- <version>1.0.0-SNAPSHOT</version>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.dite.znpt</groupId>
|
||||
<artifactId>sip</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.dite.znpt</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
package com.dite.znpt.web.controller;
|
||||
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.dto.FolderDto;
|
||||
import com.dite.znpt.domain.page.PageBean;
|
||||
import com.dite.znpt.service.BusinessDataService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/*
|
||||
* @Description: 商务资料管理,文件夹层
|
||||
* 虽然文件夹本质也是文件,但我们页面上很多地方,光查文件信息,根据文件夹ID
|
||||
* 获取文件列表,如果文件夹和文件都放一张表,不好区分,接口也不好区分,这样分开写方便
|
||||
*/
|
||||
@Api(tags = "文件夹接口")
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/businessData/folder")
|
||||
@ApiOperation("商务资料管理,文件夹contrller层")
|
||||
public class BusinessDataController {
|
||||
@Resource
|
||||
private BusinessDataService businessDataService;
|
||||
|
||||
@ApiOperation(value = "分页查询文件夹", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public Result pageSelect(@RequestParam(defaultValue = "1") Integer page,
|
||||
@RequestParam(defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(required = false) String folderName) {
|
||||
PageBean pageBean = businessDataService.pageSelect(page, pageSize, folderName);
|
||||
return Result.ok(pageBean);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "增加文件夹", httpMethod = "POST")
|
||||
@PostMapping("/creatFolder")
|
||||
public Result createFolder(@RequestBody FolderDto folderDto) {
|
||||
return businessDataService.createFolder(folderDto.getName(), folderDto.getParentId());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除文件夹", httpMethod = "DELETE")
|
||||
@DeleteMapping("/delete")
|
||||
public Result delete(@RequestParam Long folderId) {
|
||||
|
||||
return businessDataService.delete(folderId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "重命名文件夹", httpMethod = "PUT")
|
||||
@PutMapping("/rename")
|
||||
public Result Rename(@RequestParam Long folderId, @RequestParam String newName) {
|
||||
|
||||
return businessDataService.reName(folderId, newName);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,137 @@
|
|||
package com.dite.znpt.web.controller;
|
||||
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.entity.BusinessDataFileEntity;
|
||||
import com.dite.znpt.domain.page.PageBean;
|
||||
import com.dite.znpt.mapper.BusinessDataFileMapper;
|
||||
import com.dite.znpt.service.BusinessDataFileService;
|
||||
import com.dite.znpt.service.BusinessDataService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Date;
|
||||
|
||||
/*
|
||||
* @Description: 商务资料管理,文件夹层
|
||||
*/
|
||||
|
||||
@Api(tags = "文件接口")
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/businessData/file")
|
||||
@ApiOperation("商务资料管理,文件层")
|
||||
public class BusinessDataFileController {
|
||||
@Resource
|
||||
private BusinessDataFileService businessDataFileService;
|
||||
@Resource
|
||||
private BusinessDataService businessDataService;
|
||||
@Resource
|
||||
private BusinessDataFileMapper businessDataFileMapper;
|
||||
|
||||
@ApiOperation(value = "分页查询文件", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public Result pageSelect(@RequestParam(defaultValue = "1") Integer page,
|
||||
@RequestParam(defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(defaultValue = "0") Long folderId,
|
||||
@RequestParam(required = false) String fileName) {
|
||||
PageBean pageBean = businessDataFileService.pageSelect(page, pageSize, folderId, fileName);
|
||||
return Result.ok(pageBean);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "增加文件")
|
||||
@PostMapping("/add")
|
||||
public Result add(@RequestParam("file") MultipartFile file,
|
||||
@RequestParam Long folderId) {
|
||||
|
||||
if (file.isEmpty()) {
|
||||
return Result.error("上传文件为空");
|
||||
}
|
||||
// TODO 以后可以优化,就算文件名一样,加个(1),(2)这种
|
||||
|
||||
try {
|
||||
byte[] bytes = file.getBytes();
|
||||
String uploadDir = businessDataService.getPath(folderId);
|
||||
|
||||
File uploadedFile = new File(uploadDir + "\\" + file.getOriginalFilename());
|
||||
if (uploadedFile.exists()) {
|
||||
return Result.error("文件已存在");
|
||||
}
|
||||
file.transferTo(uploadedFile);
|
||||
|
||||
// 保存文件信息到数据
|
||||
BusinessDataFileEntity fileEntity = new BusinessDataFileEntity();
|
||||
fileEntity.setFolderId(folderId);
|
||||
fileEntity.setFileName(file.getOriginalFilename());
|
||||
fileEntity.setFilePath(uploadDir + "\\" + file.getOriginalFilename());
|
||||
fileEntity.setFileType(file.getContentType());
|
||||
fileEntity.setFileSize(file.getSize());
|
||||
fileEntity.setUploadTime(new Date());
|
||||
fileEntity.setUploaderId(0L);
|
||||
System.out.println(uploadDir + "\\" + file.getOriginalFilename());
|
||||
businessDataFileService.add(fileEntity);
|
||||
|
||||
return Result.okM("上传成功");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return Result.error("上传失败");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除文件")
|
||||
@DeleteMapping("/delete")
|
||||
public Result delete(@RequestParam Long fileId) {
|
||||
businessDataFileService.delete(fileId, null);
|
||||
return Result.okM("删除成功");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "下载文件")
|
||||
@GetMapping("/download")
|
||||
public void download(@RequestParam("fileId") Long fileId, HttpServletResponse response) {
|
||||
String path = businessDataFileService.getPath(fileId);
|
||||
try {
|
||||
// path是指想要下载的文件的路径
|
||||
File file = new File(path);
|
||||
log.info(file.getPath());
|
||||
// 获取文件名
|
||||
String filename = file.getName();
|
||||
// 获取文件后缀名
|
||||
String ext = filename.substring(filename.lastIndexOf(".") + 1).toLowerCase();
|
||||
log.info("文件后缀名:" + ext);
|
||||
|
||||
// 将文件写入输入流
|
||||
FileInputStream fileInputStream = new FileInputStream(file);
|
||||
InputStream fis = new BufferedInputStream(fileInputStream);
|
||||
byte[] buffer = new byte[fis.available()];
|
||||
fis.read(buffer);
|
||||
fis.close();
|
||||
|
||||
// 清空response
|
||||
response.reset();
|
||||
// 设置response的Header
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename, "UTF-8"));
|
||||
// 告知浏览器文件的大小
|
||||
response.addHeader("Content-Length", "" + file.length());
|
||||
OutputStream outputStream = new BufferedOutputStream(response.getOutputStream());
|
||||
response.setContentType("application/octet-stream");
|
||||
outputStream.write(buffer);
|
||||
outputStream.flush();
|
||||
} catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "重命名文件", httpMethod = "PUT")
|
||||
@PutMapping("/rename")
|
||||
public Result reName(@RequestParam Long fileId, @RequestParam String newFileName) {
|
||||
return businessDataFileService.reName(fileId, newFileName);
|
||||
}
|
||||
|
||||
}
|
|
@ -175,5 +175,11 @@ public class CommonController {
|
|||
return Result.ok(EquipmentTypeEnum.listAll());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询合同状态", httpMethod = "GET")
|
||||
@GetMapping("/list/contract-status")
|
||||
public Result<?> listContractStatus(){
|
||||
return Result.ok(ContractStatusEnum.listAll());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
//package com.dite.znpt.web.controller;
|
||||
//
|
||||
//import com.dite.znpt.domain.Result;
|
||||
//import com.dite.znpt.domain.entity.UserEntity;
|
||||
//import com.dite.znpt.service.EmailService;
|
||||
//import com.dite.znpt.service.UserService;
|
||||
//import io.swagger.annotations.Api;
|
||||
//import io.swagger.annotations.ApiOperation;
|
||||
//import org.springframework.web.bind.annotation.PostMapping;
|
||||
//import org.springframework.web.bind.annotation.RequestParam;
|
||||
//import org.springframework.web.bind.annotation.RestController;
|
||||
//
|
||||
//import javax.annotation.Resource;
|
||||
//
|
||||
//@Api(tags = "邮件")
|
||||
//@RestController("/email")
|
||||
//public class EmailController {
|
||||
// @Resource
|
||||
// private EmailService emailService;
|
||||
//
|
||||
// @Resource
|
||||
// private UserService userService;
|
||||
//
|
||||
// @ApiOperation(value = "发送邮箱验证码", httpMethod = "POST")
|
||||
// @PostMapping("/send")
|
||||
// public Result<?> send(@RequestParam("email") String email) {
|
||||
// boolean send = emailService.sendVerificationCode(email, emailService.generateCode(email));
|
||||
// if (send) {
|
||||
// return Result.ok("发送成功");
|
||||
// }
|
||||
// return Result.error("发送失败");
|
||||
// }
|
||||
//
|
||||
// @ApiOperation(value = "验证邮箱验证码", httpMethod = "POST")
|
||||
// @PostMapping("/verify")
|
||||
// public Result<?> verify(@RequestParam("userId") String userId, @RequestParam("email") String email, @RequestParam("code") String code) {
|
||||
// boolean verify = emailService.verifyCode(email, code);
|
||||
// if (verify) {
|
||||
// UserEntity userEntity = userService.getById(userId);
|
||||
// userEntity.setEmail(email);
|
||||
// userService.updateById(userEntity);
|
||||
// return Result.ok("验证成功");
|
||||
// }
|
||||
// return Result.error("验证失败");
|
||||
// }
|
||||
//}
|
|
@ -1,5 +1,6 @@
|
|||
package com.dite.znpt.web.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.dite.znpt.domain.PageResult;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.vo.EquipmentListReq;
|
||||
|
@ -8,35 +9,33 @@ import com.dite.znpt.domain.vo.EquipmentResp;
|
|||
import com.dite.znpt.service.EquipmentService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
* @date 2025/7/23/周三 17:41
|
||||
* @description
|
||||
*/
|
||||
@Api(tags = "设备信息")
|
||||
@Api(tags = "设备信息----------------------------")
|
||||
@RestController
|
||||
@RequestMapping("/equipment")
|
||||
public class EquipmentController {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(EquipmentController.class);
|
||||
|
||||
@Resource
|
||||
private EquipmentService equipmentService;
|
||||
|
||||
@ApiOperation(value = "分页查询设备信息列表", httpMethod = "GET")
|
||||
@GetMapping("/page")
|
||||
public PageResult<EquipmentResp> page(EquipmentListReq req) {
|
||||
return PageResult.ok(equipmentService.page(req));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询设备信息列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public Result<List<EquipmentResp>> list(EquipmentListReq req) {
|
||||
return Result.ok(equipmentService.list(req));
|
||||
IPage<EquipmentResp> page = equipmentService.page(req);
|
||||
return PageResult.ok(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询设备信息详情", httpMethod = "GET")
|
||||
|
@ -66,4 +65,47 @@ public class EquipmentController {
|
|||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询设备采购记录", httpMethod = "GET")
|
||||
@GetMapping("/procurement/page")
|
||||
public PageResult<EquipmentResp> procurementPage(EquipmentListReq req) {
|
||||
log.info("=== 设备采购记录查询接口被调用 ===");
|
||||
log.info("接收到的请求参数: {}", req);
|
||||
log.info("设备名称: {}", req.getEquipmentName());
|
||||
log.info("设备类型: {}", req.getEquipmentType());
|
||||
log.info("供应商名称: {}", req.getSupplierName());
|
||||
log.info("采购订单号: {}", req.getPurchaseOrder());
|
||||
log.info("次户号: {}", req.getAccountNumber());
|
||||
log.info("数量: {}", req.getQuantity());
|
||||
log.info("单价: {}", req.getUnitPrice());
|
||||
log.info("总价: {}", req.getTotalPrice());
|
||||
log.info("盘点依据: {}", req.getInventoryBasis());
|
||||
log.info("动态记录: {}", req.getDynamicRecord());
|
||||
log.info("页码: {}", req.getPage());
|
||||
log.info("每页大小: {}", req.getPageSize());
|
||||
log.info("排序字段: {}", req.getOrderBy());
|
||||
log.info("排序方向: {}", req.getOrderDirection());
|
||||
|
||||
IPage<EquipmentResp> page = equipmentService.procurementPage(req);
|
||||
return PageResult.ok(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增设备采购记录", httpMethod = "POST")
|
||||
@PostMapping("/procurement")
|
||||
public Result<?> addProcurement(@Validated @RequestBody EquipmentReq req){
|
||||
equipmentService.saveProcurement(req);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改设备采购记录", httpMethod = "PUT")
|
||||
@PutMapping("/procurement/{equipmentId}")
|
||||
public Result<?> editProcurement(@PathVariable String equipmentId, @Validated @RequestBody EquipmentReq req){
|
||||
equipmentService.updateProcurement(equipmentId, req);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取采购统计信息", httpMethod = "GET")
|
||||
@GetMapping("/procurement/stats")
|
||||
public Result<?> getProcurementStats(){
|
||||
return Result.ok(equipmentService.getProcurementStats());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
package com.dite.znpt.web.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.dite.znpt.domain.PageResult;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.entity.UserPostEntity;
|
||||
import com.dite.znpt.domain.vo.PostListReq;
|
||||
import com.dite.znpt.domain.vo.PostReq;
|
||||
import com.dite.znpt.domain.vo.PostResp;
|
||||
import com.dite.znpt.domain.vo.UserResp;
|
||||
import com.dite.znpt.service.PostService;
|
||||
import com.dite.znpt.service.UserPostService;
|
||||
import com.dite.znpt.util.ValidationGroup;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
@ -27,6 +31,9 @@ public class PostController {
|
|||
@Resource
|
||||
private PostService postService;
|
||||
|
||||
@Resource
|
||||
private UserPostService userPostService;
|
||||
|
||||
@ApiOperation(value = "分页查询岗位信息列表", httpMethod = "GET")
|
||||
@GetMapping("/page")
|
||||
public PageResult<PostResp> page(PostListReq req){
|
||||
|
@ -62,8 +69,14 @@ public class PostController {
|
|||
@ApiOperation(value = "删除岗位信息", httpMethod = "DELETE")
|
||||
@DeleteMapping("/{postId}")
|
||||
public Result<?> remove(@PathVariable String postId){
|
||||
userPostService.remove(new QueryWrapper<UserPostEntity>().eq("post_id", postId));
|
||||
postService.deleteById(postId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value="查询属于该岗位的用户", httpMethod = "GET")
|
||||
@GetMapping("/{postId}/user")
|
||||
public Result<List<UserResp>> listUser(@PathVariable String postId){
|
||||
return Result.ok(userPostService.getUsersByPostId(postId));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,10 +3,10 @@ package com.dite.znpt.web.controller;
|
|||
|
||||
import com.dite.znpt.domain.PageResult;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.vo.ProjectBudgetInfoDetailResp;
|
||||
import com.dite.znpt.domain.vo.ProjectBudgetInfoImportReq;
|
||||
import com.dite.znpt.domain.vo.ProjectBudgetInfoListReq;
|
||||
import com.dite.znpt.domain.vo.ProjectBudgetInfoListResp;
|
||||
import com.dite.znpt.domain.vo.ProjectBudgetInfoReq;
|
||||
import com.dite.znpt.domain.vo.ProjectBudgetInfoResp;
|
||||
import com.dite.znpt.service.ProjectBudgetInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
@ -26,22 +26,35 @@ public class ProjectBudgetInfoController {
|
|||
@Resource
|
||||
private ProjectBudgetInfoService projectBudgetInfoService;
|
||||
|
||||
@ApiOperation(value = "获取项目预算信息列表", httpMethod = "GET")
|
||||
@ApiOperation(value = "筛选项目预算信息列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public PageResult<ProjectBudgetInfoListResp> list(ProjectBudgetInfoListReq projectBudgetInfoReq) {
|
||||
return PageResult.ok(projectBudgetInfoService.selectList(projectBudgetInfoReq));
|
||||
public Result<List<ProjectBudgetInfoListResp>> list(ProjectBudgetInfoListReq projectBudgetInfoListReq) {
|
||||
return Result.ok(projectBudgetInfoService.list(projectBudgetInfoListReq));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据项目id获取项目预算信息列表", httpMethod = "GET")
|
||||
@GetMapping("/detail/{projectId}")
|
||||
public PageResult<ProjectBudgetInfoResp> detailByProjectId(@PathVariable String projectId) {
|
||||
return PageResult.ok(projectBudgetInfoService.detailByProjectId(projectId));
|
||||
@ApiOperation(value = "分页筛选项目预算信息列表", httpMethod = "GET")
|
||||
@GetMapping("/page")
|
||||
public PageResult<ProjectBudgetInfoListResp> page(ProjectBudgetInfoListReq projectBudgetInfoListReq) {
|
||||
return PageResult.ok(projectBudgetInfoService.page(projectBudgetInfoListReq));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "保存项目预算信息", httpMethod = "POST")
|
||||
@PostMapping
|
||||
public Result<Object> add(@RequestBody List<ProjectBudgetInfoReq> projectBudgetInfoReq) {
|
||||
projectBudgetInfoService.saveData(projectBudgetInfoReq);
|
||||
@ApiOperation(value = "新增项目预算信息", httpMethod = "POST")
|
||||
@PostMapping("/save")
|
||||
public Result<Void> save(@RequestBody ProjectBudgetInfoImportReq req) {
|
||||
projectBudgetInfoService.saveData(req);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "项目预算信息详情", httpMethod = "GET")
|
||||
@GetMapping("/{projectId}/detail")
|
||||
public Result<ProjectBudgetInfoDetailResp> detail(@PathVariable String projectId) {
|
||||
return Result.ok(projectBudgetInfoService.detailByProjectId(projectId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除项目预算信息", httpMethod = "DELETE")
|
||||
@DeleteMapping("/{budgetId}")
|
||||
public Result<Void> delete(@PathVariable String budgetId) {
|
||||
projectBudgetInfoService.delete(budgetId);
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,12 +2,7 @@ package com.dite.znpt.web.controller;
|
|||
|
||||
import com.dite.znpt.domain.PageResult;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.vo.ProjectMemberListReq;
|
||||
import com.dite.znpt.domain.vo.ProjectMemberReq;
|
||||
import com.dite.znpt.domain.vo.ProjectMemberResp;
|
||||
import com.dite.znpt.domain.vo.ProjectKanbanStatsResp;
|
||||
import com.dite.znpt.domain.vo.ProjectKanbanDataResp;
|
||||
import com.dite.znpt.domain.vo.ProjectDetailResp;
|
||||
import com.dite.znpt.domain.vo.*;
|
||||
import com.dite.znpt.service.ProjectMemberService;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import com.dite.znpt.util.ValidationGroup;
|
||||
|
@ -24,6 +19,7 @@ import java.util.List;
|
|||
* @date 2025/08/05
|
||||
* @Description: 项目人员管理Controller
|
||||
*/
|
||||
|
||||
@Api(tags = "项目人员管理")
|
||||
@RestController
|
||||
@RequestMapping("/project-member")
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
package com.dite.znpt.web.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.dite.znpt.domain.PageResult;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.entity.UserRoleEntity;
|
||||
import com.dite.znpt.domain.vo.RoleMenuReq;
|
||||
import com.dite.znpt.domain.vo.RoleReq;
|
||||
import com.dite.znpt.domain.vo.RoleResp;
|
||||
import com.dite.znpt.domain.vo.UserResp;
|
||||
import com.dite.znpt.service.RoleMenuService;
|
||||
import com.dite.znpt.service.RoleService;
|
||||
import com.dite.znpt.service.UserRoleService;
|
||||
|
@ -14,8 +17,6 @@ import org.springframework.validation.annotation.Validated;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -34,6 +35,9 @@ public class RoleController {
|
|||
@Resource
|
||||
private RoleMenuService roleMenuService;
|
||||
|
||||
@Resource
|
||||
private UserRoleService userRoleService;
|
||||
|
||||
@ApiOperation(value = "分页查询角色信息列表", httpMethod = "GET")
|
||||
@GetMapping("/page")
|
||||
public PageResult<RoleResp> page(@RequestParam(value = "roleName", required = false) String roleName){
|
||||
|
@ -69,6 +73,7 @@ public class RoleController {
|
|||
@ApiOperation(value = "删除角色信息", httpMethod = "DELETE")
|
||||
@DeleteMapping("/{roleId}")
|
||||
public Result<?> delete(@PathVariable String roleId){
|
||||
userRoleService.remove(new QueryWrapper<UserRoleEntity>().eq("role_id", roleId));
|
||||
roleService.deleteById(roleId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
@ -79,4 +84,10 @@ public class RoleController {
|
|||
roleMenuService.bindRoleMenu(req);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value="查询属于该角色的用户", httpMethod = "GET")
|
||||
@GetMapping("/{roleId}/user")
|
||||
public Result<List<UserResp>> listUser(@PathVariable String roleId){
|
||||
return Result.ok(userRoleService.getUsersByRoleId(roleId));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
package com.dite.znpt.web.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.dite.znpt.domain.PageResult;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.entity.UserPostEntity;
|
||||
import com.dite.znpt.domain.entity.UserRoleEntity;
|
||||
import com.dite.znpt.domain.vo.*;
|
||||
import com.dite.znpt.service.UserPostService;
|
||||
import com.dite.znpt.service.UserRoleService;
|
||||
import com.dite.znpt.service.UserService;
|
||||
import com.dite.znpt.util.ValidationGroup;
|
||||
|
@ -26,6 +30,8 @@ public class UserController {
|
|||
private UserService userService;
|
||||
@Resource
|
||||
private UserRoleService userRoleService;
|
||||
@Resource
|
||||
private UserPostService userPostService;
|
||||
|
||||
@ApiOperation(value = "分页查询用户信息列表", httpMethod = "GET")
|
||||
@GetMapping("/page")
|
||||
|
@ -68,6 +74,8 @@ public class UserController {
|
|||
@ApiOperation(value = "删除用户信息", httpMethod = "DELETE")
|
||||
@DeleteMapping("/{userId}")
|
||||
public Result<?> remove(@PathVariable String userId) {
|
||||
userRoleService.remove(new QueryWrapper<UserRoleEntity>().eq("user_id", userId));
|
||||
userPostService.remove(new QueryWrapper<UserPostEntity>().eq("user_id", userId));
|
||||
userService.deleteById(userId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
|
|
@ -105,39 +105,39 @@ sa-token:
|
|||
# 是否输出操作日志
|
||||
is-log: true
|
||||
|
||||
#sip-config:
|
||||
# name: 信令服务
|
||||
# ip: 127.0.0.1
|
||||
# port: 1074
|
||||
# charset: gb2312
|
||||
# domain: 3402000000
|
||||
# id: 34020000002000000001
|
||||
# password: 123456
|
||||
# mediaType: mp4
|
||||
#
|
||||
#zlm-config:
|
||||
# # 流媒体名称
|
||||
# mediaName: 媒体服务
|
||||
# # 流媒体服务商
|
||||
# mediaService: ZLMdia
|
||||
# # 公网ip
|
||||
# publicHost:
|
||||
# # 接口ip
|
||||
# apiHost: 127.0.0.1
|
||||
# # 接口端口
|
||||
# apiPort: 8080
|
||||
# # 密钥
|
||||
# secretKey: 6Q76ivvVOQDsnnfOSKbtVzcYpbgy4n1G
|
||||
# # 流id前缀
|
||||
# streamPrefix:
|
||||
# # rtp ip
|
||||
# rtpHost: 127.0.0.1
|
||||
# # rtp 端口
|
||||
# rtpPort: 8080
|
||||
# # 动态端口起始值
|
||||
# dynamicPortStart: 30150
|
||||
# # 动态端口结束值
|
||||
# dynamicPortEnd: 30185
|
||||
sip-config:
|
||||
name: 信令服务
|
||||
ip: 127.0.0.1
|
||||
port: 1074
|
||||
charset: gb2312
|
||||
domain: 3402000000
|
||||
id: 34020000002000000001
|
||||
password: 123456
|
||||
mediaType: mp4
|
||||
|
||||
zlm-config:
|
||||
# 流媒体名称
|
||||
mediaName: 媒体服务
|
||||
# 流媒体服务商
|
||||
mediaService: ZLMdia
|
||||
# 公网ip
|
||||
publicHost:
|
||||
# 接口ip
|
||||
apiHost: 127.0.0.1
|
||||
# 接口端口
|
||||
apiPort: 8080
|
||||
# 密钥
|
||||
secretKey: 6Q76ivvVOQDsnnfOSKbtVzcYpbgy4n1G
|
||||
# 流id前缀
|
||||
streamPrefix:
|
||||
# rtp ip
|
||||
rtpHost: 127.0.0.1
|
||||
# rtp 端口
|
||||
rtpPort: 8080
|
||||
# 动态端口起始值
|
||||
dynamicPortStart: 30150
|
||||
# 动态端口结束值
|
||||
dynamicPortEnd: 30185
|
||||
|
||||
upload:
|
||||
# 此处仅定义总的父路径,细节定义到 FilePathEnum
|
||||
|
|
Loading…
Reference in New Issue