Compare commits

...

No commits in common. "258806b499187bd356dc12ff694fc05b169b88b3" and "9c8cff069c595a02d99f24d4ae0a3931e49d5292" have entirely different histories.

337 changed files with 19211 additions and 18956 deletions

2327
ceshi/test.sql Normal file

File diff suppressed because it is too large Load Diff

View File

@ -47,7 +47,7 @@ public class Schedule {
List<ImageEntity> successList = new ArrayList<>();
for (ImageEntity image : list) {
PartResp partResp = partRespMap.get(image.getPartId());
FilePathEnum pathEnum = FilePathEnum.getFilePathEnum(image.getImagePath());
FilePathEnum pathEnum = image.getImagePath().contains("temp") ? FilePathEnum.IMAGE_TEMP : FilePathEnum.IMAGE;
String inputFile = pathEnum.getFileAbsolutePath(image.getImagePath());
String outputDir = FilePathEnum.IMAGE.getFileAbsolutePathPrefix()
.concat("已调整")

View File

@ -38,6 +38,7 @@ public class SwaggerConfig {
.enable(true)//开启Swagger文档
.select()
.apis(RequestHandlerSelectors.basePackage("com.dite"))
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
.paths(PathSelectors.any())
.build()
.globalRequestParameters(parameters);

View File

@ -79,5 +79,4 @@ public class Message implements Serializable {
public static final String EQUIPMENT_USE_RECORD_STATUS_ERROR = "设备使用记录状态不合法";
public static final String EQUIPMENT_IS_USED = "设备已被使用";
public static final String EQUIPMENT_IS_RETURN = "设备已归还";
public static final String DAILY_REPORT_EXISTS = "当日已提交日报";
}

View File

@ -1,16 +1,20 @@
package com.dite.znpt.domain;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
* @description: 统一定义顶层Entity实体审计 基类
@ -37,6 +41,11 @@ public class AuditableEntity implements Serializable {
@ApiModelProperty(value = "修改人id", hidden = true)
private LocalDateTime updateTime;
@ExcelIgnore
@ApiModelProperty(value = "id集合", example = "[]", notes = "id集合")
@TableField(exist = false)
private List<String> idList;
@ExcelIgnore
@ApiModelProperty(value = "当前页", example = "1", notes = "0")
@TableField(exist = false)

View File

@ -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;
}

View File

@ -1,18 +0,0 @@
package com.dite.znpt.domain.dto;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
/**
* 制度确认DTO
* @author wangna
* @date 2025/07/29
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class RegulationConfirmDTO {
private Boolean agreeTerms = true; // 是否同意条款默认为true
}

View File

@ -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;
}

View File

@ -0,0 +1,38 @@
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.time.LocalDateTime;
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;
}

View File

@ -1,52 +0,0 @@
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;
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 java.io.Serial;
import java.io.Serializable;
import java.time.LocalDate;
/**
* @author huise23
* @date 2025/07/27 19:51
* @Description: 项目日报信息表实体类
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("project_daily_report")
@ApiModel(value="ProjectDailyReportEntity对象", description="项目日报信息表")
public class ProjectDailyReportEntity extends AuditableEntity implements Serializable {
@Serial
private static final long serialVersionUID = -88597301057742621L;
@ExcelProperty("主键")
@ApiModelProperty("主键")
@TableId(value = "report_id", type = IdType.ASSIGN_ID)
private String reportId;
@ExcelProperty("项目id")
@ApiModelProperty("项目id")
@TableField("project_id")
private String projectId;
@ExcelProperty("日报日期")
@ApiModelProperty("日报日期")
@TableField("report_date")
private LocalDate reportDate;
@ExcelProperty("日报提交人")
@ApiModelProperty("日报提交人")
@TableField("submit_user")
private String submitUser;
}

View File

@ -1,19 +1,18 @@
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;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.dite.znpt.domain.AuditableEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDate;
import com.alibaba.excel.annotation.ExcelProperty;
/**
* @author huise23
@ -159,7 +158,7 @@ public class ProjectEntity extends AuditableEntity implements Serializable {
@ApiModelProperty(value = "开始时间")
private LocalDate startDate;
// 施工人员安全经理项目经理商务财务高级管理员项目远程顾问外部协作者质量经理现场经理及工作组长
@ApiModelProperty(value = "结束时间")
private LocalDate endDate;
}

View File

@ -1,66 +0,0 @@
package com.dite.znpt.domain.entity;
import com.baomidou.mybatisplus.annotation.*;
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;
/**
* @author wangna
* @date 2025/07/28
* @Description: 制度确认实体类
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("regulation_confirmation")
@ApiModel(value="RegulationConfirmationEntity对象", description="制度确认")
public class RegulationConfirmationEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ExcelProperty("确认ID")
@ApiModelProperty("确认ID")
@TableId(value = "confirmation_id", type = IdType.ASSIGN_UUID)
private String confirmationId;
@ExcelProperty("制度ID")
@ApiModelProperty("制度ID")
@TableField("regulation_id")
private String regulationId;
@ExcelProperty("确认人ID")
@ApiModelProperty("确认人ID")
@TableField("confirmer_id")
private String confirmerId;
@ExcelProperty("确认人姓名")
@ApiModelProperty("确认人姓名")
@TableField("confirmer_name")
private String confirmerName;
@ExcelProperty("确认人部门")
@ApiModelProperty("确认人部门")
@TableField("confirmer_dept")
private String confirmerDept;
@ExcelProperty("确认状态")
@ApiModelProperty("确认状态CONFIRMED-已确认")
@TableField("status")
private String status;
@ExcelProperty("确认时间")
@ApiModelProperty("确认时间")
@TableField("confirm_time")
private LocalDateTime confirmTime;
@ExcelProperty("删除标志0代表存在1代表删除")
@ApiModelProperty("删除标志0代表存在1代表删除")
@TableField("del_flag")
private String delFlag;
}

View File

@ -1,106 +0,0 @@
package com.dite.znpt.domain.entity;
import com.baomidou.mybatisplus.annotation.*;
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;
/**
* @author wangna
* @date 2025/07/28
* @Description: 制度草案实体类
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("regulation_draft")
@ApiModel(value="RegulationDraftEntity对象", description="制度草案")
public class RegulationDraftEntity extends AuditableEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ExcelProperty("草案ID")
@ApiModelProperty("草案ID")
@TableId(value = "draft_id", type = IdType.ASSIGN_UUID)
private String draftId;
@ExcelProperty("制度标题")
@ApiModelProperty("制度标题")
@TableField("title")
private String title;
@ExcelProperty("制度内容")
@ApiModelProperty("制度内容")
@TableField("content")
private String content;
@ExcelProperty("制度类型")
@ApiModelProperty("制度类型")
@TableField("regulation_type")
private String regulationType;
@ExcelProperty("草案状态")
@ApiModelProperty("草案状态DRAFT-草稿REVIEWING-审核中APPROVED-已通过REJECTED-已拒绝")
@TableField("status")
private String status;
@ExcelProperty("创建人ID")
@ApiModelProperty("创建人ID")
@TableField("creator_id")
private String creatorId;
@ExcelProperty("创建人姓名")
@ApiModelProperty("创建人姓名")
@TableField("creator_name")
private String creatorName;
@ExcelProperty("审核人ID")
@ApiModelProperty("审核人ID")
@TableField("reviewer_id")
private String reviewerId;
@ExcelProperty("审核人姓名")
@ApiModelProperty("审核人姓名")
@TableField("reviewer_name")
private String reviewerName;
@ExcelProperty("审核时间")
@ApiModelProperty("审核时间")
@TableField("review_time")
private LocalDateTime reviewTime;
@ExcelProperty("审核意见")
@ApiModelProperty("审核意见")
@TableField("review_comment")
private String reviewComment;
@ExcelProperty("适用范围")
@ApiModelProperty("适用范围")
@TableField("scope")
private String scope;
@ExcelProperty("制度级别")
@ApiModelProperty("制度级别HIGH-高级MEDIUM-中级LOW-低级")
@TableField("level")
private String level;
@ExcelProperty("版本号")
@ApiModelProperty("版本号")
@TableField("version")
private String version;
@ExcelProperty("备注")
@ApiModelProperty("备注")
@TableField("remark")
private String remark;
@ExcelProperty("删除标志0代表存在1代表删除")
@ApiModelProperty("删除标志0代表存在1代表删除")
@TableField("del_flag")
private String delFlag;
}

View File

@ -1,99 +0,0 @@
package com.dite.znpt.domain.entity;
import com.baomidou.mybatisplus.annotation.*;
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;
/**
* @author wangna
* @date 2025/07/28
* @Description: 制度规范仓库实体类
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("regulation")
@ApiModel(value="RegulationEntity对象", description="制度规范仓库")
public class RegulationEntity extends AuditableEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ExcelProperty("制度ID")
@ApiModelProperty("制度ID")
@TableId(value = "regulation_id", type = IdType.ASSIGN_UUID)
private String regulationId;
@ExcelProperty("制度标题")
@ApiModelProperty("制度标题")
@TableField("title")
private String title;
@ExcelProperty("制度内容")
@ApiModelProperty("制度内容")
@TableField("content")
private String content;
@ExcelProperty("制度类型")
@ApiModelProperty("制度类型")
@TableField("regulation_type")
private String regulationType;
@ExcelProperty("制度状态")
@ApiModelProperty("制度状态DRAFT-草案APPROVED-已公示PUBLISHED-已发布ARCHIVED-已归档")
@TableField("status")
private String status;
@ExcelProperty("发布时间")
@ApiModelProperty("发布时间")
@TableField("publish_time")
private LocalDateTime publishTime;
@ExcelProperty("生效时间")
@ApiModelProperty("生效时间")
@TableField("effective_time")
private LocalDateTime effectiveTime;
@ExcelProperty("失效时间")
@ApiModelProperty("失效时间")
@TableField("expire_time")
private LocalDateTime expireTime;
@ExcelProperty("适用范围")
@ApiModelProperty("适用范围")
@TableField("scope")
private String scope;
@ExcelProperty("制度级别")
@ApiModelProperty("制度级别HIGH-高级MEDIUM-中级LOW-低级")
@TableField("level")
private String level;
@ExcelProperty("版本号")
@ApiModelProperty("版本号")
@TableField("version")
private String version;
@ExcelProperty("备注")
@ApiModelProperty("备注")
@TableField("remark")
private String remark;
@ExcelProperty("删除标志0代表存在1代表删除")
@ApiModelProperty("删除标志0代表存在1代表删除")
@TableField("del_flag")
private String delFlag;
@TableField(exist = false)
@ApiModelProperty("当前用户确认状态pending-待确认confirmed-已确认")
private String confirmStatus;
@TableField(exist = false)
@ApiModelProperty("创建人姓名")
private String createByName;
}

View File

@ -1,156 +0,0 @@
package com.dite.znpt.domain.entity;
import com.baomidou.mybatisplus.annotation.*;
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;
/**
* @author wangna
* @date 2025/07/28
* @Description: 制度提案实体类
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("regulation_proposal")
@ApiModel(value="RegulationProposalEntity对象", description="制度提案")
public class RegulationProposalEntity extends AuditableEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ExcelProperty("提案ID")
@ApiModelProperty("提案ID")
@TableId(value = "proposal_id", type = IdType.ASSIGN_UUID)
private String proposalId;
@ExcelProperty("提案标题")
@ApiModelProperty("提案标题")
@TableField("title")
private String title;
@ExcelProperty("提案内容")
@ApiModelProperty("提案内容")
@TableField("content")
private String content;
@ExcelProperty("提案类型")
@ApiModelProperty("提案类型")
@TableField("proposal_type")
private String proposalType;
@ExcelProperty("提案状态")
@ApiModelProperty("提案状态SUBMITTED-已提交DISCUSSING-讨论中APPROVED-已通过REJECTED-已拒绝CONVERTED-已转为草案")
@TableField("status")
private String status;
@ExcelProperty("提案人ID")
@ApiModelProperty("提案人ID")
@TableField("proposer_id")
private String proposerId;
@ExcelProperty("提案人姓名")
@ApiModelProperty("提案人姓名")
@TableField("proposer_name")
private String proposerName;
@ExcelProperty("提案人部门")
@ApiModelProperty("提案人部门")
@TableField("proposer_dept")
private String proposerDept;
@ExcelProperty("讨论组ID")
@ApiModelProperty("讨论组ID")
@TableField("discussion_group_id")
private String discussionGroupId;
@ExcelProperty("讨论组名称")
@ApiModelProperty("讨论组名称")
@TableField("discussion_group_name")
private String discussionGroupName;
@ExcelProperty("讨论开始时间")
@ApiModelProperty("讨论开始时间")
@TableField("discussion_start_time")
private LocalDateTime discussionStartTime;
@ExcelProperty("讨论结束时间")
@ApiModelProperty("讨论结束时间")
@TableField("discussion_end_time")
private LocalDateTime discussionEndTime;
@ExcelProperty("讨论状态")
@ApiModelProperty("讨论状态NOT_STARTED-未开始DISCUSSING-讨论中FINISHED-已结束")
@TableField("discussion_status")
private String discussionStatus;
@ExcelProperty("支持人数")
@ApiModelProperty("支持人数")
@TableField("support_count")
private Integer supportCount;
@ExcelProperty("反对人数")
@ApiModelProperty("反对人数")
@TableField("oppose_count")
private Integer opposeCount;
@ExcelProperty("总参与人数")
@ApiModelProperty("总参与人数")
@TableField("total_participants")
private Integer totalParticipants;
@ExcelProperty("审核人ID")
@ApiModelProperty("审核人ID")
@TableField("reviewer_id")
private String reviewerId;
@ExcelProperty("审核人姓名")
@ApiModelProperty("审核人姓名")
@TableField("reviewer_name")
private String reviewerName;
@ExcelProperty("审核时间")
@ApiModelProperty("审核时间")
@TableField("review_time")
private LocalDateTime reviewTime;
@ExcelProperty("审核意见")
@ApiModelProperty("审核意见")
@TableField("review_comment")
private String reviewComment;
@ExcelProperty("转为草案ID")
@ApiModelProperty("转为草案ID")
@TableField("converted_draft_id")
private String convertedDraftId;
@ExcelProperty("适用范围")
@ApiModelProperty("适用范围")
@TableField("scope")
private String scope;
@ExcelProperty("制度级别")
@ApiModelProperty("制度级别HIGH-高级MEDIUM-中级LOW-低级")
@TableField("level")
private String level;
@ExcelProperty("紧急程度")
@ApiModelProperty("紧急程度HIGH-高MEDIUM-中LOW-低")
@TableField("urgency_level")
private String urgencyLevel;
@ExcelProperty("备注")
@ApiModelProperty("备注")
@TableField("remark")
private String remark;
@ExcelProperty("删除标志0代表存在1代表删除")
@ApiModelProperty("删除标志0代表存在1代表删除")
@TableField("del_flag")
private String delFlag;
}

View File

@ -0,0 +1,16 @@
package com.dite.znpt.domain.page;
import io.swagger.annotations.ApiOperation;
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;
}

View File

@ -27,9 +27,6 @@ public class ImageListReq implements Serializable {
@ApiModelProperty("部件id")
private String partId;
@ApiModelProperty("项目id")
private String projectId;
@ApiModelProperty("图像类型")
private String[] imageTypes;

View File

@ -0,0 +1,38 @@
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 = "项目名称")
private String projectName;
@ExcelProperty(value = "预算名称")
private String budgetName;
@ExcelProperty(value = "预算类型")
private String budgetType;
@ExcelProperty(value = "预算金额(万元)")
private Double budgetAmount;
@ExcelProperty(value = "预算说明")
private String budgetDesc;
}

View File

@ -1,39 +0,0 @@
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;
import java.time.LocalDate;
/**
* @author huise23
* @date 2025/07/27 19:51
* @Description: 项目日报信息请求实体
*/
@Data
@ApiModel("项目日报信息列表请求实体")
public class ProjectDailyReportListReq implements Serializable {
@Serial
private static final long serialVersionUID = 913060537944500760L;
@ApiModelProperty("查询关键字")
private String keyword;
@ApiModelProperty("项目日报信息Id")
private String reportId;
@ApiModelProperty("项目id")
private String projectId;
@ApiModelProperty("日报日期")
private LocalDate reportDate;
@ApiModelProperty("日报提交人")
private String submitUser;
}

View File

@ -1,47 +0,0 @@
package com.dite.znpt.domain.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDate;
/**
* @author huise23
* @date 2025/07/27 19:51
* @Description: 项目日报信息表请求类
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="ProjectDailyReport请求对象", description="项目日报信息表")
public class ProjectDailyReportReq implements Serializable {
@Serial
private static final long serialVersionUID = -35936236241363317L;
@ApiModelProperty("主键")
private String reportId;
@NotNull(message = "项目id不能为空")
@ApiModelProperty("项目id")
private String projectId;
@NotNull(message = "日报日期不能为空")
@ApiModelProperty("日报日期")
private LocalDate reportDate;
@NotBlank(message = "日报提交人不能为空")
@Size(max = 32, message = "日报提交人长度不能超过32字符")
@ApiModelProperty("日报提交人")
private String submitUser;
@NotBlank(message = "日报附件id不能为空")
@ApiModelProperty("日报附件id")
private String reportAttachId;
}

View File

@ -1,23 +0,0 @@
package com.dite.znpt.domain.vo;
import com.dite.znpt.domain.entity.AttachInfoEntity;
import com.dite.znpt.domain.entity.ProjectDailyReportEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author huise23
* @date 2025/07/27 19:51
* @Description: 项目日报信息响应实体
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("项目日报信息响应实体")
public class ProjectDailyReportResp extends ProjectDailyReportEntity {
@ApiModelProperty("日报附件")
private AttachInfoEntity reportAttach;
}

View File

@ -19,7 +19,7 @@ public class UserResp extends UserReq implements Serializable{
@Serial
private static final long serialVersionUID = -2831232930040845716L;
@ApiModelProperty("用户id")
@ApiModelProperty("用户")
private String userId;
@ApiModelProperty("所属部门")
@ -39,8 +39,6 @@ public class UserResp extends UserReq implements Serializable{
@ApiModelProperty("在职状态描述")
private String userStatusLabel;
@ApiModelProperty("用户姓名")
private String userName;

View File

@ -19,7 +19,6 @@ public enum AttachBusinessTypeEnum {
DEFECT_MARK_PIC("defect_mark_pic", "缺陷标注图片"),
REPORT("report", "报告"),
PROJECT_BUDGE("project_budge", "预算文件"),
PROJECT_DAILY_REPORT("project_daily_report", "项目日报文件"),
;
private final String code;
private final String desc;

View File

@ -55,23 +55,4 @@ public enum FilePathEnum {
return StrUtil.replace(urlPath.concat(relativePath), FileUtil.FILE_SEPARATOR, StrUtil.SLASH);
}
/**
* 功能描述根据文件路径前缀获取文件路径ENUM
*
* @param fileDownPath 文件路径
* @return {@link FilePathEnum }
* @author cuizhibin
* @date 2025/07/27 16:00
**/
public static FilePathEnum getFilePathEnum(String fileDownPath) {
if (StrUtil.startWith(fileDownPath, FilePathEnum.IMAGE_TEMP.getUrlPath())) {
return FilePathEnum.IMAGE_TEMP;
}
for (FilePathEnum pathEnum : FilePathEnum.values()) {
if (StrUtil.startWith(fileDownPath, FilePathEnum.IMAGE_TEMP.getUrlPath())) {
return pathEnum;
}
}
return FilePathEnum.ATTACH;
}
}

View File

@ -0,0 +1,20 @@
package com.dite.znpt.mapper;
import com.dite.znpt.domain.entity.BusinessDataFileEntity;
import com.dite.znpt.domain.entity.BusinessDataEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@ApiOperation("商务资料文件对象")
public interface BusinessDataFileMapper {
public List<BusinessDataFileEntity> List( @Param("folderId") Long folderId,String fileName);
void delete(@Param("fileId") Long fileId,@Param("folderId") Long folderId);
void add(BusinessDataFileEntity businessDataFileEntity);
String getPath(Long fileId);
}

View File

@ -0,0 +1,29 @@
package com.dite.znpt.mapper;
import com.baomidou.mybatisplus.core.injector.methods.SelectList;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dite.znpt.domain.entity.BusinessDataEntity;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import com.dite.znpt.domain.entity.BusinessDataEntity;
import java.time.LocalDateTime;
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);
}

View File

@ -1,18 +0,0 @@
package com.dite.znpt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dite.znpt.domain.entity.ProjectDailyReportEntity;
import com.dite.znpt.domain.vo.ProjectDailyReportListReq;
import com.dite.znpt.domain.vo.ProjectDailyReportResp;
import java.util.List;
/**
* @author huise23
* @date 2025/07/27 19:51
* @Description: 项目日报信息表数据库访问层
*/
public interface ProjectDailyReportMapper extends BaseMapper<ProjectDailyReportEntity> {
List<ProjectDailyReportResp> queryBySelective(ProjectDailyReportListReq projectDailyReportReq);
}

View File

@ -1,14 +0,0 @@
package com.dite.znpt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dite.znpt.domain.entity.RegulationConfirmationEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* @author wangna
* @date 2025/07/28
* @Description: 制度确认Mapper接口
*/
@Mapper
public interface RegulationConfirmationMapper extends BaseMapper<RegulationConfirmationEntity> {
}

View File

@ -1,31 +0,0 @@
package com.dite.znpt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dite.znpt.domain.entity.RegulationEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @author wangna
* @date 2025/07/28
* @Description: 制度规范仓库Mapper接口
*/
@Mapper
public interface RegulationMapper extends BaseMapper<RegulationEntity> {
/**
* 分页查询制度列表包含创建人姓名
* @param page 分页参数
* @param status 状态
* @param type 类型
* @param title 提案标题
* @param proposer 提案人
* @return 分页结果
*/
Page<RegulationEntity> selectRegulationListWithCreator(Page<RegulationEntity> page,
@Param("status") String status,
@Param("type") String type,
@Param("title") String title,
@Param("proposer") String proposer);
}

View File

@ -1,29 +0,0 @@
package com.dite.znpt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dite.znpt.domain.entity.RegulationTypeEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 制度类型Mapper接口
* @author wangna
* @date 2025/07/29
*/
@Mapper
public interface RegulationTypeMapper extends BaseMapper<RegulationTypeEntity> {
/**
* 分页查询制度类型列表包含创建人姓名
* @param page 分页参数
* @param typeName 类型名称
* @param status 状态
* @param remark 备注
* @return 分页结果
*/
Page<RegulationTypeEntity> selectRegulationTypeListWithCreator(Page<RegulationTypeEntity> page,
@Param("typeName") String typeName,
@Param("status") String status,
@Param("remark") String remark);
}

View File

@ -23,7 +23,7 @@ public interface AttachInfoService extends IService<AttachInfoEntity> {
* @author huise23
* @date 2025/04/11 23:17
**/
List<AttachInfoEntity> listByBusinessIds(List<String> businessIds, AttachBusinessTypeEnum businessType);
List<AttachInfoEntity> listByBusinessIds(List<String> businessIds, String businessType);
/**
* 功能描述新增附件信息

View File

@ -0,0 +1,23 @@
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.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@ApiOperation("商务资料文件service")
public interface BusinessDataFileService {
PageBean pageSelect(Integer page, Integer pageSize, Long folderId);
Result delete(@RequestParam(value = "fileId", required = false) Long fileId,@RequestParam(value = "foldelId", required = false) Long folderId);
void add(BusinessDataFileEntity businessDataFileEntity);
String getPath(Long fileId);
}

View File

@ -0,0 +1,19 @@
package com.dite.znpt.service;
import com.dite.znpt.domain.Result;
import com.dite.znpt.domain.page.PageBean;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Service;
import com.dite.znpt.domain.entity.BusinessDataEntity;
import java.util.List;
@ApiOperation("商务资料文件夹service")
public interface BusinessDataService {
PageBean pageSelect(Integer page, Integer pageSize);
Result createFolder(String folderName, Long parentId);
String getPath(Long parentId);
Result delete(Long folderId);
Result reName(Long folderId, String newName);
}

View File

@ -1,74 +0,0 @@
package com.dite.znpt.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dite.znpt.domain.entity.ProjectDailyReportEntity;
import com.dite.znpt.domain.vo.ProjectDailyReportListReq;
import com.dite.znpt.domain.vo.ProjectDailyReportReq;
import com.dite.znpt.domain.vo.ProjectDailyReportResp;
import java.util.List;
/**
* @author huise23
* @date 2025/07/27 19:51
* @Description: 项目日报信息表服务接口
*/
public interface ProjectDailyReportService extends IService<ProjectDailyReportEntity> {
/**
* 功能描述查询项目日报信息列表
*
* @param projectDailyReportReq 项目日报信息
* @return {@link List }<{@link ProjectDailyReportResp }>
* @author huise23
* @date 2025/07/27 19:51
**/
List<ProjectDailyReportResp> selectList(ProjectDailyReportListReq projectDailyReportReq);
/**
* 功能描述查询单条项目日报信息
*
* @param reportId 项目日报信息Id
* @return {@link ProjectDailyReportResp }
* @author huise23
* @date 2025/07/27 19:51
**/
ProjectDailyReportResp selectById(String reportId);
/**
* 功能描述新增项目日报信息
*
* @param projectDailyReportReq 项目日报信息
* @author huise23
* @date 2025/07/27 19:51
**/
void saveData(ProjectDailyReportReq projectDailyReportReq);
/**
* 功能描述更新项目日报信息
*
* @param projectDailyReportReq 项目日报信息
* @author huise23
* @date 2025/07/27 19:51
**/
void updateData(ProjectDailyReportReq projectDailyReportReq);
/**
* 功能描述删除项目日报信息
*
* @param reportId 项目日报信息Id
* @author huise23
* @date 2025/07/27 19:51
**/
void deleteById(String reportId);
/**
* 功能描述我今天
*
* @return {@link ProjectDailyReportResp }
* @author cuizhibin
* @date 2025/07/27 19:53
**/
ProjectDailyReportResp myToday(String projectId);
}

View File

@ -1,14 +0,0 @@
package com.dite.znpt.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dite.znpt.domain.entity.RegulationConfirmationEntity;
/**
* @author wangna
* @date 2025/07/28
* @Description: 制度确认Service接口
*/
public interface RegulationConfirmationService extends IService<RegulationConfirmationEntity> {
// 继承自IService的方法已经足够使用
// 包括save, update, remove, list, page, lambdaQuery等
}

View File

@ -1,67 +0,0 @@
package com.dite.znpt.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dite.znpt.domain.entity.RegulationEntity;
import com.dite.znpt.domain.Result;
/**
* @author wangna
* @date 2025/07/29
* @Description: 制度规范仓库Service接口
*/
public interface RegulationService extends IService<RegulationEntity> {
/**
* 获取制度列表
* @param page 页码
* @param pageSize 页大小
* @param status 状态
* @param type 类型
* @param title 提案标题
* @param proposer 提案人
* @return 结果
*/
Result getRegulationList(Integer page, Integer pageSize, String status, String type, String title, String proposer);
/**
* 创建制度提案
* @param regulation 制度信息
* @return 结果
*/
Result createRegulationProposal(RegulationEntity regulation);
/**
* 更新制度提案
* @param regulation 制度信息
* @return 结果
*/
Result updateRegulationProposal(RegulationEntity regulation);
/**
* 删除制度提案
* @param regulationId 制度ID
* @return 结果
*/
Result deleteRegulationProposal(String regulationId);
/**
* 获取制度详情
* @param regulationId 制度ID
* @return 结果
*/
Result getRegulationDetail(String regulationId);
/**
* 确认制度知晓
* @param regulationId 制度ID
* @return 结果
*/
Result confirmRegulation(String regulationId);
/**
* 公示制度
* @param regulationId 制度ID
* @return 结果
*/
Result approveRegulation(String regulationId);
}

View File

@ -1,45 +0,0 @@
package com.dite.znpt.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dite.znpt.domain.entity.RegulationTypeEntity;
import com.dite.znpt.domain.Result;
/**
* 制度类型Service接口
* @author wangna
* @date 2025/07/29
*/
public interface RegulationTypeService extends IService<RegulationTypeEntity> {
/**
* 获取制度类型列表
* @param page 页码
* @param size 页大小
* @param typeName 类型名称
* @param status 状态
* @param remark 备注
* @return 结果
*/
Result getRegulationTypes(Integer page, Integer size, String typeName, String status, String remark);
/**
* 创建制度类型
* @param regulationType 制度类型信息
* @return 结果
*/
Result createRegulationType(RegulationTypeEntity regulationType);
/**
* 更新制度类型
* @param regulationType 制度类型信息
* @return 结果
*/
Result updateRegulationType(RegulationTypeEntity regulationType);
/**
* 删除制度类型
* @param typeId 类型ID
* @return 结果
*/
Result deleteRegulationType(String typeId);
}

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.dite.znpt.domain.entity.RoleMenuEntity;
import com.dite.znpt.domain.vo.RoleMenuReq;
import java.util.List;
/**
* @author Bear.G
@ -11,5 +12,6 @@ import com.dite.znpt.domain.vo.RoleMenuReq;
* @description
*/
public interface RoleMenuService extends IService<RoleMenuEntity> {
void bindRoleMenu(RoleMenuReq req);
}

View File

@ -30,7 +30,6 @@ import java.net.URLEncoder;
import java.rmi.ServerException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
@ -52,9 +51,9 @@ public class AttachInfoServiceImpl extends ServiceImpl<FileInfoMapper, AttachInf
* @date 2025/04/11 23:17
**/
@Override
public List<AttachInfoEntity> listByBusinessIds(List<String> businessIds, AttachBusinessTypeEnum businessType) {
public List<AttachInfoEntity> listByBusinessIds(List<String> businessIds, String businessType) {
return lambdaQuery().in(AttachInfoEntity::getBusinessId, businessIds)
.eq(Objects.nonNull(businessType), AttachInfoEntity::getBusinessType, businessType.getCode())
.eq(StrUtil.isNotEmpty(businessType), AttachInfoEntity::getBusinessType, businessType)
.list();
}

View File

@ -0,0 +1,95 @@
package com.dite.znpt.service.impl;
import com.dite.znpt.domain.Result;
import com.dite.znpt.domain.entity.BusinessDataEntity;
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.apache.ibatis.annotations.Param;
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("分页查询文件")
public PageBean pageSelect(Integer page, Integer pageSize, Long folderId) {
PageHelper.startPage(page, pageSize);
List<BusinessDataFileEntity> list = businessDataFileMapper.List(folderId ,"");
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) {
System.out.println(fileId+" 77777777777impl777777777777777");
return businessDataFileMapper.getPath(fileId);
}
}

View File

@ -0,0 +1,207 @@
package com.dite.znpt.service.impl;
import cn.dev33.satoken.stp.StpUtil;
import com.dite.znpt.domain.Result;
import com.dite.znpt.domain.page.PageBean;
import com.dite.znpt.mapper.BusinessDataFileMapper;
import com.dite.znpt.mapper.BusinessDataMapper;
import com.dite.znpt.service.BusinessDataFileService;
import com.dite.znpt.service.BusinessDataService;
import com.dite.znpt.domain.entity.BusinessDataEntity;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import org.apache.ibatis.jdbc.Null;
import org.apache.xmlbeans.impl.xb.xsdschema.Public;
import org.aspectj.bridge.IMessage;
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) {
// 分页查询,pageHelper.startPage()方法会返回一个Page对象该对象包含了分页信息如总记录数和当前页数据
PageHelper.startPage(page, pageSize);
// 查询所有数据
List<BusinessDataEntity> businessDataEntityList = businessDataMapper.List();
// 返回分页结果
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("重命名成功");
}
}

View File

@ -198,7 +198,7 @@ public class DefectServiceImpl extends ServiceImpl<DefectMapper, DefectEntity> i
}
image.setImageType(ImageTypeEnum.DEFECT.getCode());
imageService.updateById(image);
FilePathEnum pathEnum = FilePathEnum.getFilePathEnum(image.getImagePath());
FilePathEnum pathEnum = image.getImagePath().contains("temp") ? FilePathEnum.IMAGE_TEMP : FilePathEnum.IMAGE;
String inputPath = pathEnum.getFileAbsolutePath(image.getImagePath());
// 写入attach同层级文件夹下
String attachPath = FilePathEnum.ATTACH.getUrlPath() + StrUtil.removePrefix(image.getImagePath(), pathEnum.getUrlPath());

View File

@ -8,8 +8,8 @@ import com.dite.znpt.converts.Converts;
import com.dite.znpt.domain.entity.ImageCollectEntity;
import com.dite.znpt.domain.entity.ImageEntity;
import com.dite.znpt.domain.vo.ImageCollectReq;
import com.dite.znpt.domain.vo.ImageReq;
import com.dite.znpt.enums.FilePathEnum;
import com.dite.znpt.enums.ImageSourceEnum;
import com.dite.znpt.exception.ServiceException;
import com.dite.znpt.mapper.ImageCollectMapper;
import com.dite.znpt.service.ImageCollectService;
@ -20,10 +20,9 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.File;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @Author: gaoxiong
@ -50,21 +49,21 @@ public class ImageCollectServiceImpl extends ServiceImpl<ImageCollectMapper, Ima
}
ImageCollectEntity imageCollect = Converts.INSTANCE.toImageCollectEntity(req);
this.save(imageCollect);
Map<String, ImageReq> imageMap = req.getImageList().stream().collect(Collectors.toMap(ImageReq::getImageId, Function.identity(), (a,b) -> b));
List<ImageEntity> imageList = imageService.listByIds(imageMap.keySet());
String dateStr = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<ImageEntity> imageList = Converts.INSTANCE.toImageEntity(req.getImageList());
String permPathPrefix = FilePathEnum.IMAGE.getFileAbsolutePathPrefix().concat(ImageSourceEnum.COLLECT.getCode()).concat(FileUtil.FILE_SEPARATOR).concat(partId).concat(FileUtil.FILE_SEPARATOR).concat(dateStr).concat(FileUtil.FILE_SEPARATOR);
imageList.forEach(image -> {
image.setPartId(partId);
image.setCollectId(imageCollect.getCollectId());
image.setImageType(req.getImageType());
image.setImageTypeLabel(req.getImageTypeLabel());
if (FilePathEnum.getFilePathEnum(image.getImagePath()).equals(FilePathEnum.IMAGE_TEMP)) {
String newImagePath = image.getImagePath().replace(FilePathEnum.IMAGE_TEMP.getUrlPath(), FilePathEnum.IMAGE.getUrlPath());
String oldFileAbsolutePath = FilePathEnum.IMAGE_TEMP.getFileAbsolutePath(image.getImagePath());
File oldFile = FileUtil.file(oldFileAbsolutePath);
if (oldFile.exists()) {
FileUtil.move(oldFile, FileUtil.file(newImagePath), true);
image.setImagePath(newImagePath);
}
String path = permPathPrefix + image.getImageName();
String fileAbsolutePath = FilePathEnum.IMAGE_TEMP.getFileAbsolutePath(image.getImagePath());
File file = FileUtil.file(fileAbsolutePath);
if (file.exists()) {
FileUtil.copy(file, FileUtil.file(path), true);
image.setImagePath(FilePathEnum.IMAGE.getFileDownPath(path));
FileUtil.del(file);
}
});
imageService.saveOrUpdateBatch(imageList);

View File

@ -64,7 +64,6 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
private PartService partService;
@Autowired
private AudioFileInfoService audioFileInfoService;
@Autowired
private ProjectService projectService;
@Autowired
private UserService userService;
@ -297,7 +296,7 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
if(CollUtil.isEmpty(imageList)){
imageCollectService.removeById(image.getCollectId());
}
FilePathEnum pathEnum = FilePathEnum.getFilePathEnum(image.getImagePath());
FilePathEnum pathEnum = image.getImagePath().contains("temp") ? FilePathEnum.IMAGE_TEMP : FilePathEnum.IMAGE;
FileUtil.del(pathEnum.getFileAbsolutePath(image.getImagePath()));
FileUtil.del(FilePathEnum.IMAGE.getFileAbsolutePath(image.getPreImagePath()));
}

View File

@ -1,138 +0,0 @@
package com.dite.znpt.service.impl;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dite.znpt.constant.Message;
import com.dite.znpt.domain.entity.AttachInfoEntity;
import com.dite.znpt.domain.entity.ProjectDailyReportEntity;
import com.dite.znpt.domain.vo.ProjectDailyReportListReq;
import com.dite.znpt.domain.vo.ProjectDailyReportReq;
import com.dite.znpt.domain.vo.ProjectDailyReportResp;
import com.dite.znpt.enums.AttachBusinessTypeEnum;
import com.dite.znpt.exception.ServiceException;
import com.dite.znpt.mapper.ProjectDailyReportMapper;
import com.dite.znpt.service.AttachInfoService;
import com.dite.znpt.service.ProjectDailyReportService;
import com.dite.znpt.util.PageUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @author huise23
* @date 2025/07/27 19:51
* @Description: 项目日报信息表服务实现类
*/
@Service
@RequiredArgsConstructor
public class ProjectDailyReportServiceImpl extends ServiceImpl<ProjectDailyReportMapper, ProjectDailyReportEntity> implements ProjectDailyReportService {
private final AttachInfoService attachInfoService;
/**
* 功能描述查询项目日报信息列表
*
* @param projectDailyReportReq 项目日报信息信息
* @return {@link List }<{@link ProjectDailyReportResp }>
* @author huise23
* @date 2025/07/27 19:51
**/
@Override
public List<ProjectDailyReportResp> selectList(ProjectDailyReportListReq projectDailyReportReq) {
PageUtil.startPage();
List<ProjectDailyReportResp> respList= this.baseMapper.queryBySelective(projectDailyReportReq);
if (CollUtil.isNotEmpty(respList)) {
List<String> reportIds = respList.stream().map(ProjectDailyReportResp::getReportId).toList();
Map<String, AttachInfoEntity> attachMap = attachInfoService.listByBusinessIds(reportIds, AttachBusinessTypeEnum.PROJECT_DAILY_REPORT)
.stream().collect(Collectors.toMap(AttachInfoEntity::getBusinessId, Function.identity()));
respList.forEach(resp -> {
resp.setReportAttach(attachMap.get(resp.getReportId()));
});
}
return respList;
}
/**
* 功能描述查询单条项目日报信息
*
* @param reportId 项目日报信息Id
* @return {@link ProjectDailyReportResp }
* @author huise23
* @date 2025/07/27 19:51
**/
@Override
public ProjectDailyReportResp selectById(String reportId) {
ProjectDailyReportListReq projectDailyReportReq = new ProjectDailyReportListReq();
projectDailyReportReq.setReportId(reportId);
List<ProjectDailyReportResp> list = selectList(projectDailyReportReq);
return CollUtil.isNotEmpty(list) ? CollUtil.getFirst(list) : new ProjectDailyReportResp();
}
/**
* 功能描述新增项目日报信息
*
* @param projectDailyReportReq 项目日报信息
* @author huise23
* @date 2025/07/27 19:51
**/
@Override
public void saveData(ProjectDailyReportReq projectDailyReportReq) {
ProjectDailyReportResp myToday = myToday(projectDailyReportReq.getProjectId());
if (Objects.nonNull(myToday)) {
throw new ServiceException(Message.DAILY_REPORT_EXISTS);
}
ProjectDailyReportEntity entity = BeanUtil.copyProperties(projectDailyReportReq, ProjectDailyReportEntity.class);
save(entity);
attachInfoService.updateBusinessIdByAttachIds(entity.getReportId(), ListUtil.of(projectDailyReportReq.getReportAttachId()), AttachBusinessTypeEnum.PROJECT_DAILY_REPORT);
}
/**
* 功能描述更新项目日报信息
*
* @param projectDailyReportReq 项目日报信息
* @author huise23
* @date 2025/07/27 19:51
**/
@Override
public void updateData(ProjectDailyReportReq projectDailyReportReq) {
ProjectDailyReportEntity entity = BeanUtil.copyProperties(projectDailyReportReq, ProjectDailyReportEntity.class);
updateById(entity);
attachInfoService.updateBusinessIdByAttachIds(entity.getReportId(), ListUtil.of(projectDailyReportReq.getReportAttachId()), AttachBusinessTypeEnum.PROJECT_DAILY_REPORT);
}
/**
* 功能描述删除项目日报信息
*
* @param reportId 项目日报信息Id
* @author huise23
* @date 2025/07/27 19:51
**/
@Override
public void deleteById(String reportId) {
removeById(reportId);
}
@Override
public ProjectDailyReportResp myToday(String projectId) {
ProjectDailyReportListReq req = new ProjectDailyReportListReq();
req.setProjectId(projectId);
req.setSubmitUser(StpUtil.getLoginIdAsString());
req.setReportDate(LocalDate.now());
List<ProjectDailyReportResp> list = selectList(req);
if (CollUtil.isNotEmpty(list)){
return CollUtil.getFirst(list);
}
return null;
}
}

View File

@ -5,20 +5,20 @@ import cn.hutool.core.util.StrUtil;
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.ProjectEntity;
import com.dite.znpt.domain.entity.UserEntity;
import com.dite.znpt.domain.entity.ProjectEntity;
import com.dite.znpt.domain.vo.ProjectListReq;
import com.dite.znpt.domain.vo.ProjectListResp;
import com.dite.znpt.domain.vo.ProjectReq;
import com.dite.znpt.domain.vo.ProjectResp;
import com.dite.znpt.enums.ProjectStatusEnum;
import com.dite.znpt.exception.ServiceException;
import com.dite.znpt.mapper.ProjectMapper;
import com.dite.znpt.service.ProjectService;
import com.dite.znpt.service.UserService;
import com.dite.znpt.util.PageUtil;
import lombok.RequiredArgsConstructor;
import com.dite.znpt.service.ProjectService;
import com.dite.znpt.mapper.ProjectMapper;
import org.springframework.stereotype.Service;
import lombok.RequiredArgsConstructor;
import com.dite.znpt.util.PageUtil;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
@ -59,7 +59,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectEntity
List<ProjectListResp> list= this.baseMapper.queryBySelective(req);
list.forEach(resp -> {
resp.setStatusLabel(ProjectStatusEnum.getDescByCode(resp.getStatus()));
// 判断人员类型
});
return list;
}

View File

@ -20,6 +20,7 @@ import com.dite.znpt.mapper.ProjectTaskGroupMapper;
import com.dite.znpt.mapper.ProjectTaskMapper;
import com.dite.znpt.service.AttachInfoService;
import com.dite.znpt.service.ProjectTaskService;
import com.dite.znpt.util.PageUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -54,7 +55,7 @@ public class ProjectTaskServiceImpl extends ServiceImpl<ProjectTaskMapper, Proje
List<ProjectTaskResp> projectTaskList = this.baseMapper.queryBySelective(projectTaskReq);
Map<String, List<AttachInfoEntity>> attachMap;
if (!BooleanUtil.isTrue(projectTaskReq.getIsExport())) {
attachMap = attachInfoService.listByBusinessIds(projectTaskList.stream().map(ProjectTaskResp::getTaskId).collect(Collectors.toList()), AttachBusinessTypeEnum.PROJECT_TASK)
attachMap = attachInfoService.listByBusinessIds(projectTaskList.stream().map(ProjectTaskResp::getTaskId).collect(Collectors.toList()), null)
.stream().collect(Collectors.groupingBy(AttachInfoEntity::getBusinessId));
} else {
attachMap = new HashMap<>();

View File

@ -1,18 +0,0 @@
package com.dite.znpt.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dite.znpt.domain.entity.RegulationConfirmationEntity;
import com.dite.znpt.mapper.RegulationConfirmationMapper;
import com.dite.znpt.service.RegulationConfirmationService;
import org.springframework.stereotype.Service;
/**
* @author wangna
* @date 2025/07/28
* @Description: 制度确认服务实现类
*/
@Service
public class RegulationConfirmationServiceImpl extends ServiceImpl<RegulationConfirmationMapper, RegulationConfirmationEntity> implements RegulationConfirmationService {
// 继承自ServiceImpl的方法已经足够使用
// 包括save, update, remove, list, page, lambdaQuery等
}

View File

@ -1,285 +0,0 @@
package com.dite.znpt.service.impl;
import cn.dev33.satoken.stp.StpUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dite.znpt.domain.Result;
import com.dite.znpt.domain.entity.RegulationEntity;
import com.dite.znpt.domain.entity.RegulationConfirmationEntity;
import com.dite.znpt.domain.vo.UserResp;
import com.dite.znpt.mapper.RegulationMapper;
import com.dite.znpt.service.RegulationService;
import com.dite.znpt.service.RegulationConfirmationService;
import com.dite.znpt.service.UserService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
/**
* @author wangna
* @date 2025/07/29
* @Description: 制度规范仓库Service实现类
*/
@Service
public class RegulationServiceImpl extends ServiceImpl<RegulationMapper, RegulationEntity> implements RegulationService {
private final RegulationConfirmationService regulationConfirmationService;
private final UserService userService;
public RegulationServiceImpl(RegulationConfirmationService regulationConfirmationService, UserService userService) {
this.regulationConfirmationService = regulationConfirmationService;
this.userService = userService;
}
/**
* 每天凌晨1点自动将公示期10天已到的已公示制度变为已发布
*/
@Scheduled(cron = "0 0 1 * * ?")
@Transactional(rollbackFor = Exception.class)
public void autoPublishApprovedRegulations() {
LocalDateTime tenDaysAgo = LocalDateTime.now().minusDays(10);
// 查询需要自动发布的制度状态为APPROVED且更新时间超过10天
LambdaQueryWrapper<RegulationEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(RegulationEntity::getStatus, "APPROVED");
wrapper.le(RegulationEntity::getUpdateTime, tenDaysAgo);
wrapper.eq(RegulationEntity::getDelFlag, "0");
java.util.List<RegulationEntity> approvedRegulations = this.list(wrapper);
for (RegulationEntity regulation : approvedRegulations) {
// 更新制度状态和发布信息
regulation.setStatus("PUBLISHED");
regulation.setPublishTime(LocalDateTime.now());
regulation.setEffectiveTime(LocalDateTime.now()); // 设置生效时间为当前时间
regulation.setUpdateTime(LocalDateTime.now());
regulation.setUpdateBy("系统自动发布");
this.updateById(regulation);
}
if (!approvedRegulations.isEmpty()) {
System.out.println("自动发布完成,共发布 " + approvedRegulations.size() + " 个制度");
}
}
@Override
@Transactional(readOnly = true)
public Result getRegulationList(Integer page, Integer pageSize, String status, String type, String title, String proposer) {
try {
Page<RegulationEntity> pageParam = new Page<>(page, pageSize);
// 使用关联查询获取创建人姓名
Page<RegulationEntity> result = this.baseMapper.selectRegulationListWithCreator(pageParam, status, type, title, proposer);
// 如果是获取已发布的制度需要添加确认状态
if (status != null && "PUBLISHED".equals(status)) {
String userId = StpUtil.getLoginIdAsString();
java.util.List<String> confirmedIds = regulationConfirmationService.lambdaQuery()
.eq(RegulationConfirmationEntity::getConfirmerId, userId)
.eq(RegulationConfirmationEntity::getStatus, "CONFIRMED")
.eq(RegulationConfirmationEntity::getDelFlag, "0")
.list()
.stream()
.map(RegulationConfirmationEntity::getRegulationId)
.toList();
for (RegulationEntity reg : result.getRecords()) {
reg.setConfirmStatus(confirmedIds.contains(reg.getRegulationId()) ? "confirmed" : "pending");
}
}
return Result.ok(result);
} catch (Exception e) {
return Result.error("获取制度列表失败:" + e.getMessage());
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result createRegulationProposal(RegulationEntity regulation) {
try {
regulation.setRegulationId(java.util.UUID.randomUUID().toString());
regulation.setStatus("DRAFT");
regulation.setCreateTime(LocalDateTime.now());
String userId = StpUtil.getLoginIdAsString();
regulation.setCreateBy(userId);
regulation.setUpdateTime(LocalDateTime.now());
regulation.setUpdateBy(userId);
regulation.setDelFlag("0");
this.save(regulation);
return Result.okM("制度提案创建成功");
} catch (Exception e) {
return Result.error("制度提案创建失败:" + e.getMessage());
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result updateRegulationProposal(RegulationEntity regulation) {
try {
RegulationEntity existing = this.getById(regulation.getRegulationId());
if (existing == null) {
return Result.error("制度提案不存在");
}
// 只能更新DRAFT状态的提案
if (!"DRAFT".equals(existing.getStatus())) {
return Result.error("只能更新草稿状态的制度提案");
}
// 只能由创建人更新
if (!existing.getCreateBy().equals(StpUtil.getLoginIdAsString())) {
return Result.error("只能更新自己创建的制度提案");
}
String userId = StpUtil.getLoginIdAsString();
regulation.setUpdateTime(LocalDateTime.now());
regulation.setUpdateBy(userId);
regulation.setStatus("DRAFT"); // 确保状态保持为DRAFT
this.updateById(regulation);
return Result.okM("制度提案更新成功");
} catch (Exception e) {
return Result.error("制度提案更新失败:" + e.getMessage());
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result deleteRegulationProposal(String regulationId) {
try {
RegulationEntity regulation = this.getById(regulationId);
if (regulation == null) {
return Result.error("制度提案不存在");
}
// 只能删除DRAFT状态的提案
if (!"DRAFT".equals(regulation.getStatus())) {
return Result.error("只能删除草稿状态的制度提案");
}
// 只能由创建人删除
if (!regulation.getCreateBy().equals(StpUtil.getLoginIdAsString())) {
return Result.error("只能删除自己创建的制度提案");
}
// 软删除
regulation.setDelFlag("1");
regulation.setUpdateTime(LocalDateTime.now());
regulation.setUpdateBy(StpUtil.getLoginIdAsString());
this.updateById(regulation);
return Result.okM("制度提案删除成功");
} catch (Exception e) {
return Result.error("制度提案删除失败:" + e.getMessage());
}
}
@Override
@Transactional(readOnly = true)
public Result getRegulationDetail(String regulationId) {
try {
RegulationEntity regulation = this.getById(regulationId);
if (regulation == null) {
return Result.error("制度不存在");
}
// 获取创建人姓名
if (regulation.getCreateBy() != null && !regulation.getCreateBy().isEmpty()) {
try {
UserResp user = userService.detail(regulation.getCreateBy());
if (user != null) {
regulation.setCreateByName(user.getName());
}
} catch (Exception e) {
// 如果查询失败使用用户ID作为备选
regulation.setCreateByName(regulation.getCreateBy());
}
}
return Result.ok(regulation);
} catch (Exception e) {
return Result.error("获取制度详情失败:" + e.getMessage());
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result confirmRegulation(String regulationId) {
try {
RegulationEntity regulation = this.getById(regulationId);
if (regulation == null) {
return Result.error("制度不存在");
}
// 检查是否已经确认过
RegulationConfirmationEntity existingConfirmation = regulationConfirmationService.lambdaQuery()
.eq(RegulationConfirmationEntity::getRegulationId, regulationId)
.eq(RegulationConfirmationEntity::getConfirmerId, StpUtil.getLoginIdAsString())
.eq(RegulationConfirmationEntity::getDelFlag, "0")
.one();
if (existingConfirmation != null) {
return Result.error("您已经确认过该制度");
}
// 创建确认记录
RegulationConfirmationEntity confirmation = new RegulationConfirmationEntity();
confirmation.setConfirmationId(java.util.UUID.randomUUID().toString());
confirmation.setRegulationId(regulationId);
confirmation.setConfirmerId(StpUtil.getLoginIdAsString());
UserResp user = userService.detail(StpUtil.getLoginIdAsString());
if (user != null) {
confirmation.setConfirmerName(user.getName());
confirmation.setConfirmerDept(user.getDeptName());
}
confirmation.setStatus("CONFIRMED");
confirmation.setConfirmTime(LocalDateTime.now());
confirmation.setDelFlag("0");
regulationConfirmationService.save(confirmation);
return Result.okM("制度确认成功");
} catch (Exception e) {
return Result.error("制度确认失败:" + e.getMessage());
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result approveRegulation(String regulationId) {
try {
RegulationEntity regulation = this.getById(regulationId);
if (regulation == null) {
return Result.error("制度不存在");
}
// 检查制度状态只有DRAFT状态的制度才能公示
if (!"DRAFT".equals(regulation.getStatus())) {
return Result.error("只能公示草稿状态的制度");
}
// 检查权限只有创建人才能公示
if (!regulation.getCreateBy().equals(StpUtil.getLoginIdAsString())) {
return Result.error("只能公示自己创建的制度");
}
// 更新制度状态为已公示
regulation.setStatus("APPROVED");
regulation.setUpdateTime(LocalDateTime.now());
regulation.setUpdateBy(StpUtil.getLoginIdAsString());
this.updateById(regulation);
return Result.okM("制度公示成功");
} catch (Exception e) {
return Result.error("制度公示失败:" + e.getMessage());
}
}
}

View File

@ -1,127 +0,0 @@
package com.dite.znpt.service.impl;
import cn.dev33.satoken.stp.StpUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dite.znpt.domain.Result;
import com.dite.znpt.domain.entity.RegulationEntity;
import com.dite.znpt.domain.entity.RegulationTypeEntity;
import com.dite.znpt.mapper.RegulationMapper;
import com.dite.znpt.mapper.RegulationTypeMapper;
import com.dite.znpt.service.RegulationTypeService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
/**
* 制度类型Service实现类
* @author wangna
* @date 2025/07/29
*/
@Service
public class RegulationTypeServiceImpl extends ServiceImpl<RegulationTypeMapper, RegulationTypeEntity> implements RegulationTypeService {
private final RegulationMapper regulationMapper;
public RegulationTypeServiceImpl(RegulationMapper regulationMapper) {
this.regulationMapper = regulationMapper;
}
@Override
@Transactional(readOnly = true)
public Result getRegulationTypes(Integer page, Integer size, String typeName, String status, String remark) {
try {
Page<RegulationTypeEntity> pageParam = new Page<>(page, size);
// 使用连表查询获取创建人姓名
Page<RegulationTypeEntity> result = this.baseMapper.selectRegulationTypeListWithCreator(pageParam, typeName, status, remark);
return Result.ok(result);
} catch (Exception e) {
return Result.error("获取制度类型列表失败:" + e.getMessage());
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result createRegulationType(RegulationTypeEntity regulationType) {
try {
regulationType.setTypeId(java.util.UUID.randomUUID().toString());
regulationType.setCreateTime(LocalDateTime.now());
String userId = StpUtil.getLoginIdAsString();
regulationType.setCreateBy(userId);
regulationType.setUpdateTime(LocalDateTime.now());
regulationType.setUpdateBy(userId);
regulationType.setDelFlag("0");
// 如果没有设置排序顺序设置为当前最大值+1
if (regulationType.getSortOrder() == null) {
Integer maxSortOrder = this.lambdaQuery()
.eq(RegulationTypeEntity::getDelFlag, "0")
.orderByDesc(RegulationTypeEntity::getSortOrder)
.last("LIMIT 1")
.oneOpt()
.map(RegulationTypeEntity::getSortOrder)
.orElse(0);
regulationType.setSortOrder(maxSortOrder + 1);
}
this.save(regulationType);
return Result.okM("制度类型创建成功");
} catch (Exception e) {
return Result.error("制度类型创建失败:" + e.getMessage());
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result updateRegulationType(RegulationTypeEntity regulationType) {
try {
RegulationTypeEntity existing = this.getById(regulationType.getTypeId());
if (existing == null) {
return Result.error("制度类型不存在");
}
regulationType.setUpdateTime(LocalDateTime.now());
regulationType.setUpdateBy(cn.dev33.satoken.stp.StpUtil.getLoginIdAsString());
this.updateById(regulationType);
return Result.okM("制度类型更新成功");
} catch (Exception e) {
return Result.error("制度类型更新失败:" + e.getMessage());
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result deleteRegulationType(String typeId) {
try {
RegulationTypeEntity regulationType = this.getById(typeId);
if (regulationType == null) {
return Result.error("制度类型不存在");
}
// 检查是否有制度使用此类型
String typeName = regulationType.getTypeName();
// 检查制度表中是否有使用此类型的记录包括所有状态
long regulationCount = regulationMapper.selectCount(
new LambdaQueryWrapper<RegulationEntity>()
.eq(RegulationEntity::getRegulationType, typeName)
.eq(RegulationEntity::getDelFlag, "0")
);
// 如果有制度使用此类型则不允许删除
if (regulationCount > 0) {
return Result.error("该制度类型正在被使用,无法删除。请先删除或修改使用该类型的制度。");
}
regulationType.setDelFlag("1");
this.updateById(regulationType);
return Result.okM("制度类型删除成功");
} catch (Exception e) {
return Result.error("制度类型删除失败:" + e.getMessage());
}
}
}

View File

@ -107,7 +107,6 @@ 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.setDeptName(deptService.getById(userResp.getDeptId()).getDeptName());
}
userResp.setUserTypeLabel(UserTypeEnum.getDescByCode(userResp.getUserType()));
@ -253,6 +252,4 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
entity.setDelFlag(Constants.DEL_FLAG_1);
this.updateById(entity);
}
}

View File

@ -0,0 +1,41 @@
<?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="param1 != null">
and folder_id = #{param1}
</if>
<if test="param2 != null and param2 != ''">
and file_name = #{param2}
</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>

View File

@ -0,0 +1,47 @@
<?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>
</mapper>

View File

@ -20,9 +20,6 @@
<if test="partId != null and partId != ''">
AND p.part_id = #{partId}
</if>
<if test="projectId != null and projectId != ''">
AND i.project_id = #{projectId}
</if>
<if test="imageTypes != null and imageTypes.length > 0">
AND i.image_type in <foreach collection="imageTypes" item="imageType" open="(" close=")" separator=",">#{imageType}</foreach>
</if>

View File

@ -1,30 +0,0 @@
<?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.ProjectDailyReportMapper">
<sql id="Base_Column_List">
a.report_id, a.project_id, a.report_date, a.submit_user,
a.update_by, a.create_time, a.create_by, a.update_time
</sql>
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.ProjectDailyReportResp">
select
<include refid="Base_Column_List"/>
from project_daily_report a
<where>
<if test="reportId != null and reportId != ''">
and a.report_id like concat ('%', #{reportId}, '%')
</if>
<if test="projectId != null and projectId != ''">
and a.project_id like concat ('%', #{projectId}, '%')
</if>
<if test="reportDate != null">
and a.report_date = #{reportDate}
</if>
<if test="submitUser != null and submitUser != ''">
and a.submit_user like concat ('%', #{submitUser}, '%')
</if>
</where>
</select>
</mapper>

View File

@ -2,27 +2,23 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dite.znpt.mapper.ProjectMapper">
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.ProjectListResp">
with taskProgress as (SELECT count(1) task_count,
with taskProgress as (
SELECT
count(1) task_count,
sum(status=0) taskPendingCount,
sum(status=1) task_progress_count,
sum(status=2) task_complete_count,
project_id
FROM project_task
group by project_id),
constructor as (
select project_id, GROUP_CONCAT(DISTINCT con.name) AS constructor_name
FROM project prj
LEFT JOIN user con ON FIND_IN_SET(con.user_id,prj.constructor_ids) > 0 AND con.del_flag = '0'
GROUP BY prj.project_id
group by 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.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
GROUP_CONCAT(DISTINCT con.name) AS constructor_name, prj.start_date, prj.end_date, tp.taskPendingCount, tp.task_progress_count, tp.task_complete_count, tp.task_count
FROM project prj
LEFT JOIN user pm ON pm.user_id = prj.project_manager_id
LEFT JOIN constructor con on prj.project_id = con.project_id
LEFT JOIN user con ON FIND_IN_SET(con.user_id,prj.constructor_ids) > 0 AND con.del_flag = '0'
left join taskProgress tp on prj.project_id = tp.project_id
<where>
<if test="projectName != null and projectName != ''">
@ -52,6 +48,9 @@
or prj.constructor_ids like concat('%', #{userId},'%'))
</if>
</where>
GROUP BY 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.inspection_contact, prj.inspection_phone, prj.scale, prj.turbine_model, prj.project_manager_id, pm.name, prj.constructor_ids,
prj.start_date, prj.end_date, tp.taskPendingCount, tp.task_progress_count, tp.task_complete_count, tp.task_count
</select>
</mapper>

View File

@ -1,459 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AES加密解密工具</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
primary: '#3b82f6',
secondary: '#10b981',
accent: '#6366f1',
dark: '#1e293b',
light: '#f8fafc'
},
fontFamily: {
inter: ['Inter', 'system-ui', 'sans-serif'],
},
}
}
}
</script>
<style type="text/tailwindcss">
@layer utilities {
.content-auto {
content-visibility: auto;
}
.text-shadow {
text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.card-shadow {
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
.transition-custom {
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
}
</style>
</head>
<body class="font-inter bg-gradient-to-br from-light to-blue-50 min-h-screen">
<div class="container mx-auto px-4 py-8 max-w-5xl">
<!-- 标题区域 -->
<header class="mb-12 text-center">
<h1 class="text-[clamp(2rem,5vw,3.5rem)] font-bold text-dark mb-3 text-shadow">
<i class="fa-solid fa-lock text-primary mr-3"></i>AES加密解密工具
</h1>
<p class="text-gray-600 text-lg max-w-2xl mx-auto">
使用先进的AES加密算法保护您的数据安全支持多种加密模式和密钥长度
</p>
</header>
<!-- 主内容区 -->
<main class="grid grid-cols-1 lg:grid-cols-2 gap-8">
<!-- 加密区域 -->
<section class="bg-white rounded-2xl p-6 card-shadow transition-custom hover:shadow-xl">
<h2 class="text-2xl font-bold text-dark mb-6 flex items-center">
<i class="fa-solid fa-shield-lock text-primary mr-2"></i>加密
</h2>
<div class="space-y-4">
<div>
<label for="plaintext" class="block text-sm font-medium text-gray-700 mb-1">明文</label>
<textarea id="plaintext" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-primary/50 focus:border-primary transition-custom resize-none" rows="4" placeholder="请输入要加密的文本..."></textarea>
</div>
<div>
<label for="encrypt-key" class="block text-sm font-medium text-gray-700 mb-1">密钥</label>
<div class="relative">
<input type="text" id="encrypt-key" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-primary/50 focus:border-primary transition-custom" placeholder="请输入16/24/32字节密钥..." value="1234567890123456">
<button type="button" id="generate-key" class="absolute right-2 top-1/2 -translate-y-1/2 text-primary hover:text-primary/80 transition-custom">
<i class="fa-solid fa-refresh"></i>
</button>
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">加密选项</label>
<div class="grid grid-cols-2 gap-4">
<div>
<label for="encrypt-mode" class="block text-xs text-gray-500 mb-1">加密模式</label>
<select id="encrypt-mode" class="w-full px-3 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-primary/50 focus:border-primary transition-custom">
<option value="ECB">ECB</option>
<option value="CBC">CBC</option>
<option value="CFB">CFB</option>
<option value="OFB">OFB</option>
<option value="CTR">CTR</option>
</select>
</div>
<div>
<label for="encrypt-padding" class="block text-xs text-gray-500 mb-1">填充方式</label>
<select id="encrypt-padding" class="w-full px-3 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-primary/50 focus:border-primary transition-custom">
<option value="Pkcs7">PKCS#7</option>
<option value="Iso97971">ISO 9797-1</option>
<option value="AnsiX923">ANSI X.923</option>
<option value="Iso10126">ISO 10126</option>
<option value="ZeroPadding">Zero Padding</option>
<option value="NoPadding">No Padding</option>
</select>
</div>
</div>
</div>
<div id="iv-container" class="hidden">
<label for="encrypt-iv" class="block text-sm font-medium text-gray-700 mb-1">初始化向量(IV)</label>
<input type="text" id="encrypt-iv" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-primary/50 focus:border-primary transition-custom" placeholder="请输入16字节初始化向量...">
</div>
<button id="encrypt-btn" class="w-full bg-primary hover:bg-primary/90 text-white font-medium py-3 px-4 rounded-lg transition-custom transform hover:scale-[1.02] flex items-center justify-center">
<i class="fa-solid fa-lock mr-2"></i>加密
</button>
</div>
</section>
<!-- 解密区域 -->
<section class="bg-white rounded-2xl p-6 card-shadow transition-custom hover:shadow-xl">
<h2 class="text-2xl font-bold text-dark mb-6 flex items-center">
<i class="fa-solid fa-unlock text-secondary mr-2"></i>解密
</h2>
<div class="space-y-4">
<div>
<label for="ciphertext" class="block text-sm font-medium text-gray-700 mb-1">密文</label>
<textarea id="ciphertext" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-secondary/50 focus:border-secondary transition-custom resize-none" rows="4" placeholder="请输入要解密的文本..."></textarea>
</div>
<div>
<label for="decrypt-key" class="block text-sm font-medium text-gray-700 mb-1">密钥</label>
<input type="text" id="decrypt-key" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-secondary/50 focus:border-secondary transition-custom" placeholder="请输入16/24/32字节密钥..." value="1234567890123456">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">解密选项</label>
<div class="grid grid-cols-2 gap-4">
<div>
<label for="decrypt-mode" class="block text-xs text-gray-500 mb-1">解密模式</label>
<select id="decrypt-mode" class="w-full px-3 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-secondary/50 focus:border-secondary transition-custom">
<option value="ECB">ECB</option>
<option value="CBC">CBC</option>
<option value="CFB">CFB</option>
<option value="OFB">OFB</option>
<option value="CTR">CTR</option>
</select>
</div>
<div>
<label for="decrypt-padding" class="block text-xs text-gray-500 mb-1">填充方式</label>
<select id="decrypt-padding" class="w-full px-3 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-secondary/50 focus:border-secondary transition-custom">
<option value="Pkcs7">PKCS#7</option>
<option value="Iso97971">ISO 9797-1</option>
<option value="AnsiX923">ANSI X.923</option>
<option value="Iso10126">ISO 10126</option>
<option value="ZeroPadding">Zero Padding</option>
<option value="NoPadding">No Padding</option>
</select>
</div>
</div>
</div>
<div id="decrypt-iv-container" class="hidden">
<label for="decrypt-iv" class="block text-sm font-medium text-gray-700 mb-1">初始化向量(IV)</label>
<input type="text" id="decrypt-iv" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-secondary/50 focus:border-secondary transition-custom" placeholder="请输入16字节初始化向量...">
</div>
<button id="decrypt-btn" class="w-full bg-secondary hover:bg-secondary/90 text-white font-medium py-3 px-4 rounded-lg transition-custom transform hover:scale-[1.02] flex items-center justify-center">
<i class="fa-solid fa-unlock mr-2"></i>解密
</button>
</div>
</section>
</main>
<!-- 结果展示区 -->
<section class="mt-8 bg-white rounded-2xl p-6 card-shadow">
<h2 class="text-2xl font-bold text-dark mb-4 flex items-center">
<i class="fa-solid fa-file-text text-accent mr-2"></i>结果
</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">加密结果</label>
<div class="relative">
<textarea id="encrypt-result" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-accent/50 focus:border-accent transition-custom resize-none" rows="4" readonly placeholder="加密结果将显示在这里..."></textarea>
<button id="copy-encrypt" class="absolute right-2 top-2 text-gray-500 hover:text-accent transition-custom">
<i class="fa-solid fa-copy"></i>
</button>
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">解密结果</label>
<div class="relative">
<textarea id="decrypt-result" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-accent/50 focus:border-accent transition-custom resize-none" rows="4" readonly placeholder="解密结果将显示在这里..."></textarea>
<button id="copy-decrypt" class="absolute right-2 top-2 text-gray-500 hover:text-accent transition-custom">
<i class="fa-solid fa-copy"></i>
</button>
</div>
</div>
</div>
</section>
<!-- 信息提示区 -->
<div id="notification" class="fixed bottom-4 right-4 bg-dark text-white px-6 py-3 rounded-lg shadow-lg transform translate-y-20 opacity-0 transition-all duration-300 flex items-center">
<i id="notification-icon" class="fa-solid fa-info-circle mr-2"></i>
<span id="notification-message">操作成功</span>
</div>
</div>
<script>
// 加密函数
function encrypt() {
const plaintext = document.getElementById('plaintext').value.trim();
const key = document.getElementById('encrypt-key').value.trim();
const mode = document.getElementById('encrypt-mode').value;
const padding = document.getElementById('encrypt-padding').value;
const iv = document.getElementById('encrypt-iv').value.trim();
if (!plaintext) {
showNotification('请输入明文', 'error');
return;
}
if (!key) {
showNotification('请输入密钥', 'error');
return;
}
try {
// 获取加密模式
const modeObj = getModeObject(mode);
// 获取填充方式
const paddingObj = getPaddingObject(padding);
// 准备加密参数
const keyUtf8 = CryptoJS.enc.Utf8.parse(key);
let encrypted;
// 根据模式是否需要IV
if (mode === 'ECB') {
encrypted = CryptoJS.AES.encrypt(plaintext, keyUtf8, {
mode: modeObj,
padding: paddingObj
});
} else {
if (!iv) {
showNotification('使用该模式需要输入初始化向量(IV)', 'error');
return;
}
const ivUtf8 = CryptoJS.enc.Utf8.parse(iv);
encrypted = CryptoJS.AES.encrypt(plaintext, keyUtf8, {
iv: ivUtf8,
mode: modeObj,
padding: paddingObj
});
}
// 显示加密结果
const encryptedResult = encrypted.toString();
document.getElementById('encrypt-result').value = encryptedResult;
document.getElementById('ciphertext').value = encryptedResult;
showNotification('加密成功', 'success');
} catch (error) {
console.error('加密错误:', error);
showNotification('加密失败: ' + error.message, 'error');
}
}
// 解密函数
function decrypt() {
const ciphertext = document.getElementById('ciphertext').value.trim();
const key = document.getElementById('decrypt-key').value.trim();
const mode = document.getElementById('decrypt-mode').value;
const padding = document.getElementById('decrypt-padding').value;
const iv = document.getElementById('decrypt-iv').value.trim();
if (!ciphertext) {
showNotification('请输入密文', 'error');
return;
}
if (!key) {
showNotification('请输入密钥', 'error');
return;
}
try {
// 获取解密模式
const modeObj = getModeObject(mode);
// 获取填充方式
const paddingObj = getPaddingObject(padding);
// 准备解密参数
const keyUtf8 = CryptoJS.enc.Utf8.parse(key);
// 根据模式是否需要IV
let decrypted;
if (mode === 'ECB') {
decrypted = CryptoJS.AES.decrypt(ciphertext, keyUtf8, {
mode: modeObj,
padding: paddingObj
});
} else {
if (!iv) {
showNotification('使用该模式需要输入初始化向量(IV)', 'error');
return;
}
const ivUtf8 = CryptoJS.enc.Utf8.parse(iv);
decrypted = CryptoJS.AES.decrypt(ciphertext, keyUtf8, {
iv: ivUtf8,
mode: modeObj,
padding: paddingObj
});
}
// 显示解密结果
const decryptedResult = decrypted.toString(CryptoJS.enc.Utf8);
document.getElementById('decrypt-result').value = decryptedResult;
showNotification('解密成功', 'success');
} catch (error) {
console.error('解密错误:', error);
showNotification('解密失败: ' + error.message, 'error');
}
}
// 根据名称获取加密/解密模式对象
function getModeObject(modeName) {
switch (modeName) {
case 'ECB': return CryptoJS.mode.ECB;
case 'CBC': return CryptoJS.mode.CBC;
case 'CFB': return CryptoJS.mode.CFB;
case 'OFB': return CryptoJS.mode.OFB;
case 'CTR': return CryptoJS.mode.CTR;
default: return CryptoJS.mode.ECB;
}
}
// 根据名称获取填充方式对象
function getPaddingObject(paddingName) {
switch (paddingName) {
case 'Pkcs7': return CryptoJS.pad.Pkcs7;
case 'Iso97971': return CryptoJS.pad.Iso97971;
case 'AnsiX923': return CryptoJS.pad.AnsiX923;
case 'Iso10126': return CryptoJS.pad.Iso10126;
case 'ZeroPadding': return CryptoJS.pad.ZeroPadding;
case 'NoPadding': return CryptoJS.pad.NoPadding;
default: return CryptoJS.pad.Pkcs7;
}
}
// 生成随机密钥
function generateRandomKey(length = 16) {
const charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
let key = "";
for (let i = 0; i < length; i++) {
key += charset.charAt(Math.floor(Math.random() * charset.length));
}
return key;
}
// 显示通知
function showNotification(message, type = 'info') {
const notification = document.getElementById('notification');
const notificationIcon = document.getElementById('notification-icon');
const notificationMessage = document.getElementById('notification-message');
// 设置通知类型
notification.className = 'fixed bottom-4 right-4 px-6 py-3 rounded-lg shadow-lg transform translate-y-20 opacity-0 transition-all duration-300 flex items-center';
if (type === 'success') {
notification.classList.add('bg-green-500', 'text-white');
notificationIcon.className = 'fa-solid fa-check-circle mr-2';
} else if (type === 'error') {
notification.classList.add('bg-red-500', 'text-white');
notificationIcon.className = 'fa-solid fa-exclamation-circle mr-2';
} else {
notification.classList.add('bg-dark', 'text-white');
notificationIcon.className = 'fa-solid fa-info-circle mr-2';
}
// 设置通知消息
notificationMessage.textContent = message;
// 显示通知
setTimeout(() => {
notification.classList.remove('translate-y-20', 'opacity-0');
}, 10);
// 3秒后隐藏通知
setTimeout(() => {
notification.classList.add('translate-y-20', 'opacity-0');
}, 3000);
}
// 复制到剪贴板
function copyToClipboard(elementId) {
const element = document.getElementById(elementId);
element.select();
document.execCommand('copy');
showNotification('已复制到剪贴板', 'success');
}
// 模式变更事件处理
function handleModeChange() {
const encryptMode = document.getElementById('encrypt-mode').value;
const decryptMode = document.getElementById('decrypt-mode').value;
// 显示或隐藏加密IV输入框
const encryptIvContainer = document.getElementById('iv-container');
if (encryptMode === 'ECB') {
encryptIvContainer.classList.add('hidden');
} else {
encryptIvContainer.classList.remove('hidden');
}
// 显示或隐藏解密IV输入框
const decryptIvContainer = document.getElementById('decrypt-iv-container');
if (decryptMode === 'ECB') {
decryptIvContainer.classList.add('hidden');
} else {
decryptIvContainer.classList.remove('hidden');
}
}
// 生成随机密钥
document.getElementById('generate-key').addEventListener('click', () => {
document.getElementById('encrypt-key').value = generateRandomKey(16);
document.getElementById('decrypt-key').value = document.getElementById('encrypt-key').value;
showNotification('已生成随机密钥', 'success');
});
// 加密按钮点击事件
document.getElementById('encrypt-btn').addEventListener('click', encrypt);
// 解密按钮点击事件
document.getElementById('decrypt-btn').addEventListener('click', decrypt);
// 复制加密结果
document.getElementById('copy-encrypt').addEventListener('click', () => copyToClipboard('encrypt-result'));
// 复制解密结果
document.getElementById('copy-decrypt').addEventListener('click', () => copyToClipboard('decrypt-result'));
// 模式变更事件
document.getElementById('encrypt-mode').addEventListener('change', handleModeChange);
document.getElementById('decrypt-mode').addEventListener('change', handleModeChange);
// 初始化
handleModeChange();
// 添加示例数据
document.getElementById('plaintext').value = '这是一个使用AES加密的示例文本您可以替换为自己的内容。';
</script>
</body>
</html>

View File

@ -1,323 +0,0 @@
# 制度模块API测试文档
## 1. 获取制度列表 (流程管理页面)
### 请求信息
- **URL**: `GET /api/regulation?page=1&size=10`
- **Method**: GET
### 请求参数
- `page`: 页码从1开始必填
- `size`: 每页数量(必填)
### 响应格式
```json
{
"status": 200,
"data": {
"records": [
{
"regulationId": "reg001",
"title": "员工考勤管理制度优化提案",
"content": "建议优化考勤管理制度,增加弹性工作时间,提高员工工作积极性...",
"regulationType": "人事制度",
"status": "VOTING",
"createBy": "张三",
"publishTime": "2024-01-01T12:00:00",
"effectiveTime": "2024-01-01T12:00:00",
"expireTime": "2024-01-08T12:00:00",
"scope": "全体员工",
"level": "MEDIUM",
"version": "1.0",
"remark": "需要与人事部门协调实施",
"createBy": "admin",
"updateBy": "admin",
"createTime": "2024-01-01 10:00:00",
"updateTime": "2024-01-01 12:00:00",
"page": 1,
"pageSize": 10,
"delFlag": "0",
"voteFor": 15,
"voteAgainst": 3,
"voteAbstain": 2
}
],
"total": 4,
"size": 10,
"current": 1,
"pages": 1
}
}
```
## 2. 创建制度提案
### 请求信息
- **URL**: `POST /api/regulation/proposal`
- **Content-Type**: `application/json`
### 请求参数
```json
{
"title": "员工考勤管理制度优化提案",
"content": "建议优化考勤管理制度,增加弹性工作时间...",
"regulationType": "人事制度",
"scope": "全体员工",
"level": "MEDIUM",
"remark": "需要与人事部门协调实施"
}
```
### 响应格式
```json
{
"status": 200,
"data": {
"regulationId": "reg005",
"title": "员工考勤管理制度优化提案",
"content": "建议优化考勤管理制度,增加弹性工作时间...",
"regulationType": "人事制度",
"status": "DRAFT",
"createBy": "当前用户",
"publishTime": "2024-01-25T10:30:00",
"effectiveTime": "2024-01-25T10:30:00",
"expireTime": "2025-01-25T10:30:00",
"scope": "全体员工",
"level": "MEDIUM",
"version": "1.0",
"remark": "需要与人事部门协调实施",
"createBy": "admin",
"updateBy": "admin",
"createTime": "2024-01-25 10:30:00",
"updateTime": "2024-01-25 10:30:00",
"page": 1,
"pageSize": 10,
"delFlag": "0"
}
}
```
## 3. 更新制度提案
### 请求信息
- **URL**: `PUT /api/regulation/proposal/{regulationId}`
- **Content-Type**: `application/json`
### 请求参数
```json
{
"title": "员工考勤管理制度优化提案",
"content": "建议优化考勤管理制度,增加弹性工作时间...",
"regulationType": "人事制度",
"scope": "全体员工",
"level": "MEDIUM",
"remark": "需要与人事部门协调实施"
}
```
### 响应格式
```json
{
"status": 200,
"message": "制度提案更新成功"
}
```
## 4. 删除制度提案
### 请求信息
- **URL**: `DELETE /api/regulation/proposal/{regulationId}`
- **Method**: DELETE
### 响应格式
```json
{
"status": 200,
"data": {
"success": true
}
}
```
## 5. 获取制度详情
### 请求信息
- **URL**: `GET /api/regulation/{regulationId}`
- **Method**: GET
### 响应格式
```json
{
"status": 200,
"data": {
"regulationId": "reg001",
"title": "员工考勤管理制度优化提案",
"content": "建议优化考勤管理制度,增加弹性工作时间...",
"regulationType": "人事制度",
"status": "VOTING",
"createBy": "张三",
"publishTime": "2024-01-01T12:00:00",
"effectiveTime": "2024-01-01T12:00:00",
"expireTime": "2024-01-08T12:00:00",
"scope": "全体员工",
"level": "MEDIUM",
"version": "1.0",
"remark": "需要与人事部门协调实施",
"createBy": "admin",
"updateBy": "admin",
"createTime": "2024-01-01 10:00:00",
"updateTime": "2024-01-01 12:00:00",
"page": 1,
"pageSize": 10,
"delFlag": "0",
"voteFor": 15,
"voteAgainst": 3,
"voteAbstain": 2
}
}
```
## 6. 提交投票
### 请求信息
- **URL**: `POST /api/regulation/{regulationId}/vote`
- **Content-Type**: `application/json`
### 请求参数
```json
{
"voteType": "FOR", // FOR: 赞成, AGAINST: 反对, ABSTAIN: 弃权
"reason": "这个提案很有建设性" // 可选
}
```
### 响应格式
```json
{
"status": 200,
"data": {
"success": true
}
}
```
## 7. 获取投票结果
### 请求信息
- **URL**: `GET /api/regulation/{regulationId}/vote-result`
- **Method**: GET
### 响应格式
```json
{
"status": 200,
"data": {
"regulationId": "reg001",
"voteFor": 15,
"voteAgainst": 3,
"voteAbstain": 2,
"totalVotes": 20,
"approvalRate": 0.75
}
}
```
## 8. 发布制度
### 请求信息
- **URL**: `POST /api/regulation/{regulationId}/publish`
- **Method**: POST
### 响应格式
```json
{
"status": 200,
"message": "制度发布成功"
}
```
## 9. 获取已发布制度列表
### 请求信息
- **URL**: `GET /api/regulation/published?page=1&size=10`
- **Method**: GET
### 请求参数
- `page`: 页码默认1
- `size`: 页大小默认10
### 响应格式
```json
{
"status": 200,
"data": {
"records": [
{
"regulationId": "reg001",
"title": "员工考勤管理制度",
"content": "规范员工考勤管理...",
"status": "PUBLISHED",
"publishTime": "2024-01-01T12:00:00",
"confirmStatus": "pending"
}
],
"total": 1,
"size": 10,
"current": 1
}
}
```
## 10. 确认制度知晓
### 请求信息
- **URL**: `POST /api/regulation/{regulationId}/confirm`
- **Content-Type**: `application/json`
### 请求参数
```json
{
"confirmComment": "已阅读并同意遵守该制度"
}
```
### 响应格式
```json
{
"status": 200,
"message": "制度确认成功"
}
```
## 11. 批量确认制度
### 请求信息
- **URL**: `POST /api/regulation/confirm-all`
- **Method**: POST
### 响应格式
```json
{
"status": 200,
"data": {
"success": true,
"confirmedCount": 5
}
}
```
## 测试步骤
1. **执行建表语句**: 运行 `regulation_tables.sql`
2. **插入测试数据**: 运行 `regulation_test_data.sql`
3. **启动应用**: 确保后端服务正常运行
4. **测试接口**: 使用Postman或其他工具测试上述接口
## 注意事项
1. 所有接口都需要用户登录认证
2. ID字段使用UUID自动生成无需手动设置
3. 创建时间和更新时间会自动设置
4. 创建人和更新人会从当前登录用户获取
5. 制度状态包括DRAFT草稿、VOTING投票中、PUBLISHED已发布、ARCHIVED已归档
6. 投票类型FOR赞成、AGAINST反对、ABSTAIN弃权

View File

@ -1,221 +0,0 @@
# 制度模块说明文档
## 概述
制度模块是一个完整的企业制度管理系统,包含制度规范仓库、制度草案、个人制度提案等功能,支持投票、发布等完整的制度管理流程。
## 功能模块
### 1. 制度规范仓库 (RegulationEntity)
**功能描述:** 存储正式发布的制度,支持全员知晓承诺的确认
**主要功能:**
- 制度发布管理
- 制度版本控制
- 制度状态管理(草案、已发布、已归档)
- 制度生效时间管理
- 制度适用范围管理
**核心字段:**
- `regulation_id`: 制度ID
- `title`: 制度标题
- `content`: 制度内容
- `status`: 制度状态
- `publisher_id`: 发布人ID
- `publish_time`: 发布时间
- `effective_time`: 生效时间
- `expire_time`: 失效时间
### 2. 制度草案 (RegulationDraftEntity)
**功能描述:** 制度草案管理,包含投票、发布过程
**主要功能:**
- 草案创建和编辑
- 审核流程管理
- 投票系统
- 投票结果统计
- 草案状态跟踪
**核心字段:**
- `draft_id`: 草案ID
- `status`: 草案状态(草稿、审核中、已通过、已拒绝)
- `vote_status`: 投票状态
- `approve_votes`: 赞成票数
- `reject_votes`: 反对票数
- `pass_threshold`: 通过阈值
### 3. 制度提案 (RegulationProposalEntity)
**功能描述:** 个人制度提案,支持审核和转为草案
**主要功能:**
- 提案提交
- 提案审核
- 提案转为草案
**核心字段:**
- `proposal_id`: 提案ID
- `proposer_id`: 提案人ID
- `status`: 提案状态
- `reviewer_id`: 审核人ID
- `converted_draft_id`: 转为草案ID
### 4. 制度投票 (RegulationVoteEntity)
**功能描述:** 投票系统,支持对草案和提案进行投票
**主要功能:**
- 投票记录管理
- 投票选项(赞成、反对、弃权)
- 投票统计
- 防重复投票
**核心字段:**
- `vote_id`: 投票ID
- `related_id`: 关联ID草案或提案
- `related_type`: 关联类型
- `vote_option`: 投票选项
- `voter_id`: 投票人ID
### 5. 制度确认 (RegulationConfirmationEntity)
**功能描述:** 全员知晓承诺的确认系统
**主要功能:**
- 确认任务创建
- 确认状态管理
- 确认统计
- 阅读时长记录
**核心字段:**
- `confirmation_id`: 确认ID
- `regulation_id`: 制度ID
- `confirmer_id`: 确认人ID
- `status`: 确认状态
- `read_duration`: 阅读时长
## 业务流程
### 制度发布流程
1. **提案阶段**
- 个人提交制度提案
- 进行小组讨论
- 讨论结果统计
2. **草案阶段**
- 提案转为草案
- 草案审核
- 投票表决
- 投票结果统计
3. **发布阶段**
- 通过投票的草案转为正式制度
- 制度发布
- 全员确认
### 投票流程
1. **开始投票**
- 设置投票时间
- 设置通过阈值
- 通知相关人员
2. **投票进行**
- 用户参与投票
- 实时统计投票结果
- 防重复投票
3. **投票结束**
- 统计最终结果
- 判断是否通过
- 更新相关状态
### 确认流程
1. **创建确认任务**
- 批量创建确认任务
- 通知相关人员
2. **确认进行**
- 用户阅读制度
- 确认知晓
- 记录阅读时长
3. **确认统计**
- 统计确认情况
- 生成确认报告
## 技术实现
### 数据库设计
- 采用MyBatis Plus框架
- 支持软删除
- 包含审计字段(创建人、创建时间、更新人、更新时间)
- 合理的索引设计
### 服务层设计
- 采用Service接口 + 实现类的设计模式
- 支持事务管理
- 统一的异常处理
- 统一的返回结果格式
### 核心特性
- **防重复操作**: 投票和确认都支持防重复机制
- **状态管理**: 完整的状态流转管理
- **统计功能**: 支持各种统计和报表功能
- **扩展性**: 模块化设计,易于扩展
## 使用说明
### 1. 数据库初始化
执行 `doc/regulation_tables.sql` 创建相关数据表。
### 2. 服务调用示例
```java
// 发布制度
RegulationEntity regulation = new RegulationEntity();
regulation.setTitle("员工手册");
regulation.setContent("员工手册内容...");
regulationService.publishRegulation(regulation);
// 创建草案
RegulationDraftEntity draft = new RegulationDraftEntity();
draft.setTitle("新制度草案");
draftService.createDraft(draft);
// 提交提案
RegulationProposalEntity proposal = new RegulationProposalEntity();
proposal.setTitle("制度改进提案");
proposalService.submitProposal(proposal);
// 投票
RegulationVoteEntity vote = new RegulationVoteEntity();
vote.setVoteOption("APPROVE");
voteService.vote(vote);
// 确认制度
RegulationConfirmationEntity confirmation = new RegulationConfirmationEntity();
confirmationService.confirmRegulation(confirmation);
```
## 注意事项
1. **数据一致性**: 所有操作都支持事务管理,确保数据一致性
2. **权限控制**: 需要配合权限系统使用,控制用户操作权限
3. **性能优化**: 大数据量时需要考虑分页和索引优化
4. **日志记录**: 重要操作需要记录操作日志
## 扩展建议
1. **消息通知**: 集成消息系统,支持邮件、短信通知
2. **工作流**: 集成工作流引擎,支持更复杂的审批流程
3. **文档管理**: 集成文档管理系统,支持附件上传
4. **报表系统**: 集成报表系统,支持更丰富的统计报表

View File

@ -1,145 +0,0 @@
-- 制度模块数据库表创建脚本
-- @author wangna
-- @date 2025/07/28
-- 制度类型表
CREATE TABLE `regulation_type` (
`type_id` varchar(64) NOT NULL COMMENT '类型ID',
`type_name` varchar(100) NOT NULL COMMENT '类型名称',
`sort_order` int DEFAULT 0 COMMENT '排序顺序',
`is_enabled` char(1) DEFAULT '1' COMMENT '是否启用1-启用0-禁用)',
`remark` text COMMENT '备注',
`create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_by` varchar(64) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志0代表存在1代表删除',
PRIMARY KEY (`type_id`),
UNIQUE KEY `uk_type_name` (`type_name`),
KEY `idx_sort_order` (`sort_order`),
KEY `idx_is_enabled` (`is_enabled`),
KEY `idx_create_time` (`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='制度类型';
-- 插入制度类型测试数据
INSERT INTO `regulation_type` (`type_id`, `type_name`, `sort_order`, `is_enabled`, `remark`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`) VALUES
('type_001', '人事制度', 1, '1', '人力资源管理相关制度', 'admin', '2024-01-01 10:00:00', 'admin', '2024-01-01 10:00:00', '0'),
('type_002', '财务制度', 2, '1', '财务管理相关制度', 'admin', '2024-01-01 10:00:00', 'admin', '2024-01-01 10:00:00', '0'),
('type_003', '安全制度', 3, '1', '安全管理相关制度', 'admin', '2024-01-01 10:00:00', 'admin', '2024-01-01 10:00:00', '0'),
('type_004', '设备制度', 4, '1', '设备管理相关制度', 'admin', '2024-01-01 10:00:00', 'admin', '2024-01-01 10:00:00', '0'),
('type_005', '行政制度', 5, '1', '行政管理相关制度', 'admin', '2024-01-01 10:00:00', 'admin', '2024-01-01 10:00:00', '0');
-- 制度规范仓库表
CREATE TABLE `regulation` (
`regulation_id` varchar(64) NOT NULL COMMENT '制度ID',
`title` varchar(255) NOT NULL COMMENT '制度标题',
`content` text COMMENT '制度内容',
`regulation_type` varchar(50) DEFAULT NULL COMMENT '制度类型',
`status` varchar(20) DEFAULT 'DRAFT' COMMENT '制度状态DRAFT-草案PUBLISHED-已发布ARCHIVED-已归档',
`publisher_id` varchar(64) DEFAULT NULL COMMENT '发布人ID',
`publisher_name` varchar(100) DEFAULT NULL COMMENT '发布人姓名',
`publish_time` datetime DEFAULT NULL COMMENT '发布时间',
`effective_time` datetime DEFAULT NULL COMMENT '生效时间',
`expire_time` datetime DEFAULT NULL COMMENT '失效时间',
`scope` varchar(255) DEFAULT NULL COMMENT '适用范围',
`level` varchar(20) DEFAULT 'MEDIUM' COMMENT '制度级别HIGH-高级MEDIUM-中级LOW-低级',
`version` varchar(20) DEFAULT '1.0' COMMENT '版本号',
`remark` text COMMENT '备注',
`create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_by` varchar(64) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志0代表存在1代表删除',
PRIMARY KEY (`regulation_id`),
KEY `idx_status` (`status`),
KEY `idx_type` (`regulation_type`),
KEY `idx_publisher` (`publisher_id`),
KEY `idx_create_time` (`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='制度规范仓库';
-- 制度草案表
CREATE TABLE `regulation_draft` (
`draft_id` varchar(64) NOT NULL COMMENT '草案ID',
`title` varchar(255) NOT NULL COMMENT '制度标题',
`content` text COMMENT '制度内容',
`regulation_type` varchar(50) DEFAULT NULL COMMENT '制度类型',
`status` varchar(20) DEFAULT 'DRAFT' COMMENT '草案状态DRAFT-草稿REVIEWING-审核中APPROVED-已通过REJECTED-已拒绝',
`creator_id` varchar(64) DEFAULT NULL COMMENT '创建人ID',
`creator_name` varchar(100) DEFAULT NULL COMMENT '创建人姓名',
`reviewer_id` varchar(64) DEFAULT NULL COMMENT '审核人ID',
`reviewer_name` varchar(100) DEFAULT NULL COMMENT '审核人姓名',
`review_time` datetime DEFAULT NULL COMMENT '审核时间',
`review_comment` text COMMENT '审核意见',
`scope` varchar(255) DEFAULT NULL COMMENT '适用范围',
`level` varchar(20) DEFAULT 'MEDIUM' COMMENT '制度级别HIGH-高级MEDIUM-中级LOW-低级',
`version` varchar(20) DEFAULT '1.0' COMMENT '版本号',
`remark` text COMMENT '备注',
`create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_by` varchar(64) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志0代表存在1代表删除',
PRIMARY KEY (`draft_id`),
KEY `idx_status` (`status`),
KEY `idx_creator` (`creator_id`),
KEY `idx_reviewer` (`reviewer_id`),
KEY `idx_create_time` (`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='制度草案';
-- 制度提案表
CREATE TABLE `regulation_proposal` (
`proposal_id` varchar(64) NOT NULL COMMENT '提案ID',
`title` varchar(255) NOT NULL COMMENT '提案标题',
`content` text COMMENT '提案内容',
`proposal_type` varchar(50) DEFAULT NULL COMMENT '提案类型',
`status` varchar(20) DEFAULT 'SUBMITTED' COMMENT '提案状态SUBMITTED-已提交DISCUSSING-讨论中APPROVED-已通过REJECTED-已拒绝CONVERTED-已转为草案',
`proposer_id` varchar(64) DEFAULT NULL COMMENT '提案人ID',
`proposer_name` varchar(100) DEFAULT NULL COMMENT '提案人姓名',
`proposer_dept` varchar(100) DEFAULT NULL COMMENT '提案人部门',
`discussion_group_id` varchar(64) DEFAULT NULL COMMENT '讨论组ID',
`discussion_group_name` varchar(100) DEFAULT NULL COMMENT '讨论组名称',
`discussion_start_time` datetime DEFAULT NULL COMMENT '讨论开始时间',
`discussion_end_time` datetime DEFAULT NULL COMMENT '讨论结束时间',
`discussion_status` varchar(20) DEFAULT 'NOT_STARTED' COMMENT '讨论状态NOT_STARTED-未开始DISCUSSING-讨论中FINISHED-已结束',
`support_count` int DEFAULT 0 COMMENT '支持人数',
`oppose_count` int DEFAULT 0 COMMENT '反对人数',
`total_participants` int DEFAULT 0 COMMENT '总参与人数',
`reviewer_id` varchar(64) DEFAULT NULL COMMENT '审核人ID',
`reviewer_name` varchar(100) DEFAULT NULL COMMENT '审核人姓名',
`review_time` datetime DEFAULT NULL COMMENT '审核时间',
`review_comment` text COMMENT '审核意见',
`converted_draft_id` varchar(64) DEFAULT NULL COMMENT '转为草案ID',
`scope` varchar(255) DEFAULT NULL COMMENT '适用范围',
`level` varchar(20) DEFAULT 'MEDIUM' COMMENT '制度级别HIGH-高级MEDIUM-中级LOW-低级',
`urgency_level` varchar(20) DEFAULT 'MEDIUM' COMMENT '紧急程度HIGH-高MEDIUM-中LOW-低',
`remark` text COMMENT '备注',
`create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_by` varchar(64) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志0代表存在1代表删除',
PRIMARY KEY (`proposal_id`),
KEY `idx_status` (`status`),
KEY `idx_proposer` (`proposer_id`),
KEY `idx_reviewer` (`reviewer_id`),
KEY `idx_discussion_status` (`discussion_status`),
KEY `idx_create_time` (`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='制度提案';
-- 制度确认表
CREATE TABLE `regulation_confirmation` (
`confirmation_id` varchar(64) NOT NULL COMMENT '确认ID',
`regulation_id` varchar(64) NOT NULL COMMENT '制度ID',
`confirmer_id` varchar(64) NOT NULL COMMENT '确认人ID',
`confirmer_name` varchar(100) DEFAULT NULL COMMENT '确认人姓名',
`confirmer_dept` varchar(100) DEFAULT NULL COMMENT '确认人部门',
`status` varchar(20) DEFAULT 'CONFIRMED' COMMENT '确认状态CONFIRMED-已确认',
`confirm_time` datetime DEFAULT NULL COMMENT '确认时间',
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志0代表存在1代表删除',
PRIMARY KEY (`confirmation_id`),
UNIQUE KEY `uk_confirmer_regulation` (`confirmer_id`, `regulation_id`),
KEY `idx_regulation` (`regulation_id`),
KEY `idx_confirmer` (`confirmer_id`),
KEY `idx_status` (`status`),
KEY `idx_confirm_time` (`confirm_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='制度确认';

View File

@ -1,35 +0,0 @@
-- 制度模块测试数据
-- @author wangna
-- @date 2025/07/29
-- 插入测试用户数据(如果不存在)
INSERT INTO `sys_user` (`user_id`, `username`, `nickname`, `email`, `phonenumber`, `sex`, `avatar`, `password`, `status`, `login_ip`, `login_date`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`, `del_flag`) VALUES
('1', 'admin', '管理员', 'admin@example.com', '13800138000', '0', '', '$2a$10$7JB720yubVSOfvVWdBYoOeymFwJ9WxqHhqjqKqKqKqKqKqKqKqKqK', '0', '127.0.0.1', '2024-01-01 00:00:00', 'admin', '2024-01-01 00:00:00', 'admin', '2024-01-01 00:00:00', '管理员', '0'),
('2', 'user1', '张三', 'zhangsan@example.com', '13800138001', '0', '', '$2a$10$7JB720yubVSOfvVWdBYoOeymFwJ9WxqHhqjqKqKqKqKqKqKqKqKqK', '0', '127.0.0.1', '2024-01-01 00:00:00', 'admin', '2024-01-01 00:00:00', 'admin', '2024-01-01 00:00:00', '普通用户', '0'),
('3', 'user2', '李四', 'lisi@example.com', '13800138002', '0', '', '$2a$10$7JB720yubVSOfvVWdBYoOeymFwJ9WxqHhqjqKqKqKqKqKqKqKqKqK', '0', '127.0.0.1', '2024-01-01 00:00:00', 'admin', '2024-01-01 00:00:00', 'admin', '2024-01-01 00:00:00', '普通用户', '0'),
('4', 'user3', '王五', 'wangwu@example.com', '13800138003', '0', '', '$2a$10$7JB720yubVSOfvVWdBYoOeymFwJ9WxqHhqjqKqKqKqKqKqKqKqKqK', '0', '127.0.0.1', '2024-01-01 00:00:00', 'admin', '2024-01-01 00:00:00', 'admin', '2024-01-01 00:00:00', '普通用户', '0')
ON DUPLICATE KEY UPDATE `update_time` = NOW();
-- 插入测试制度数据符合前端API格式
INSERT INTO `regulation` (`regulation_id`, `title`, `content`, `regulation_type`, `status`, `publisher_id`, `publisher_name`, `publish_time`, `effective_time`, `expire_time`, `scope`, `level`, `version`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`, `del_flag`) VALUES
('reg001', '员工考勤管理制度优化提案', '建议优化考勤管理制度,增加弹性工作时间,提高员工工作积极性...', '人事制度', 'VOTING', '2', '张三', '2024-01-01 12:00:00', '2024-01-01 12:00:00', '2024-01-08 12:00:00', '全体员工', 'MEDIUM', '1.0', 'admin', '2024-01-01 10:00:00', 'admin', '2024-01-01 12:00:00', '需要与人事部门协调实施', '0'),
('reg002', '财务报销流程简化提案', '建议简化财务报销流程,提高工作效率,减少审批环节...', '财务制度', 'PUBLISHED', '3', '李四', '2024-01-15 14:30:00', '2024-01-15 14:30:00', '2024-12-31 23:59:59', '财务部门及相关员工', 'HIGH', '1.0', 'admin', '2024-01-15 14:00:00', 'admin', '2024-01-15 14:30:00', '已获得财务部门支持', '0'),
('reg003', '技术管理制度', '为规范技术管理流程,提高技术管理水平,特制定本制度...', '技术制度', 'DRAFT', '2', '张三', NULL, NULL, NULL, '技术部门', 'MEDIUM', '1.0', 'admin', '2024-01-25 16:00:00', 'admin', '2024-01-25 16:00:00', '技术管理制度草案', '0'),
('reg004', '项目管理制度', '为规范项目管理流程,提高项目执行效率,特制定本制度...', '项目制度', 'ARCHIVED', '1', '管理员', '2024-01-10 11:00:00', '2024-01-11 00:00:00', '2024-12-31 23:59:59', '项目部门', 'MEDIUM', '1.0', 'admin', '2024-01-10 10:00:00', 'admin', '2024-01-10 11:00:00', '项目管理规范', '0'),
('reg005', '远程办公管理制度', '随着远程办公的普及,需要制定相应的管理制度来规范远程办公行为...', '人事制度', 'DRAFT', '2', '张三', NULL, NULL, NULL, '全体员工', 'HIGH', '1.0', 'admin', '2024-01-27 10:00:00', 'admin', '2024-01-27 10:00:00', '远程办公管理提案', '0'),
('reg006', '数据安全管理制度', '为保护公司数据安全,防止数据泄露,需要制定数据安全管理制度...', '安全制度', 'PENDING', '2', '张三', NULL, NULL, NULL, '全体员工', 'HIGH', '1.0', 'admin', '2024-01-28 09:00:00', 'admin', '2024-01-28 09:00:00', '数据安全管理提案', '0');
-- 插入制度草案数据
INSERT INTO `regulation_draft` (`draft_id`, `regulation_id`, `title`, `content`, `draft_type`, `status`, `creator_id`, `creator_name`, `reviewer_id`, `reviewer_name`, `vote_status`, `vote_start_time`, `vote_end_time`, `approval_status`, `approval_time`, `approval_comment`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`, `del_flag`) VALUES
('draft_001', 'reg003', '技术管理制度', '为规范技术管理流程,提高技术管理水平,特制定本制度...', '技术制度', 'DRAFT', '2', '张三', '1', '管理员', 'PENDING', NULL, NULL, 'PENDING', NULL, NULL, 'admin', '2024-01-25 16:00:00', 'admin', '2024-01-25 16:00:00', '技术管理制度草案', '0'),
('draft_002', 'reg005', '远程办公管理制度', '随着远程办公的普及,需要制定相应的管理制度来规范远程办公行为...', '人事制度', 'REVIEWING', '2', '张三', '1', '管理员', 'VOTING', '2024-01-26 09:00:00', '2024-01-28 18:00:00', 'PENDING', NULL, NULL, 'admin', '2024-01-26 08:00:00', 'admin', '2024-01-26 09:00:00', '远程办公管理制度草案', '0');
-- 插入制度提案数据
INSERT INTO `regulation_proposal` (`proposal_id`, `regulation_id`, `title`, `description`, `proposal_type`, `status`, `proposer_id`, `proposer_name`, `proposer_dept`, `reviewer_id`, `reviewer_name`, `review_status`, `review_time`, `review_comment`, `priority`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`, `del_flag`) VALUES
('proposal_001', 'reg001', '员工考勤管理制度优化提案', '建议优化考勤管理制度,增加弹性工作时间,提高员工工作积极性...', '人事制度', 'APPROVED', '2', '张三', '技术部', '1', '管理员', 'APPROVED', '2024-01-27 14:00:00', '同意提案,可以开始制定制度', 'HIGH', 'admin', '2024-01-27 10:00:00', 'admin', '2024-01-27 14:00:00', '员工考勤管理提案', '0'),
('proposal_002', 'reg006', '数据安全管理制度', '为保护公司数据安全,防止数据泄露,需要制定数据安全管理制度...', '安全制度', 'PENDING', '2', '张三', '技术部', '1', '管理员', 'PENDING', NULL, NULL, 'HIGH', 'admin', '2024-01-28 09:00:00', 'admin', '2024-01-28 09:00:00', '数据安全管理提案', '0');
-- 插入制度确认数据
INSERT INTO `regulation_confirmation` (`confirmation_id`, `regulation_id`, `confirmer_id`, `confirmer_name`, `confirmer_dept`, `status`, `confirm_time`, `confirm_comment`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`, `del_flag`) VALUES
('confirm_001', 'reg002', '2', '张三', '技术部', 'CONFIRMED', '2024-01-16 10:00:00', '已阅读并确认知晓', 'admin', '2024-01-16 10:00:00', 'admin', '2024-01-16 10:00:00', '财务报销制度确认', '0'),
('confirm_002', 'reg002', '3', '李四', '财务部', 'CONFIRMED', '2024-01-21 15:00:00', '已阅读并确认知晓', 'admin', '2024-01-21 15:00:00', 'admin', '2024-01-21 15:00:00', '财务报销制度确认', '0');

View File

@ -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.apache.ibatis.annotations.Param;
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){
PageBean pageBean = businessDataService.pageSelect(page, pageSize);
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);
}
}

View File

@ -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.mapper.BusinessDataMapper;
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 javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import com.dite.znpt.domain.entity.BusinessDataFileEntity;
import org.springframework.web.multipart.MultipartFile;
/*
* @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) {
PageBean pageBean = businessDataFileService.pageSelect(page, pageSize, folderId);
return Result.ok(pageBean);
}
@ApiOperation(value = "增加文件")
@PostMapping("/add")
public Result add(@RequestParam("file") MultipartFile file,
@RequestParam Long folderId) {
System.out.println(file+" 77777777777777777777777777"+folderId);
if (file.isEmpty()) {
return Result.error("上传文件为空");
}
//TODO 以后可以优化就算文件名一样加个12这种
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();
}
}
}

View File

@ -1,66 +0,0 @@
package com.dite.znpt.web.controller;
import com.dite.znpt.domain.PageResult;
import com.dite.znpt.domain.Result;
import com.dite.znpt.domain.vo.ProjectDailyReportListReq;
import com.dite.znpt.domain.vo.ProjectDailyReportReq;
import com.dite.znpt.domain.vo.ProjectDailyReportResp;
import com.dite.znpt.service.ProjectDailyReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* @author huise23
* @date 2025/07/27 19:51
*/
@Api(tags = "项目日报信息")
@RestController
@RequestMapping("/project-daily-report")
public class ProjectDailyReportController {
@Resource
private ProjectDailyReportService projectDailyReportService;
@ApiOperation(value = "获取项目日报信息列表", httpMethod = "GET")
@GetMapping("/list")
public PageResult<ProjectDailyReportResp> list(ProjectDailyReportListReq projectDailyReportReq) {
return PageResult.ok(projectDailyReportService.selectList(projectDailyReportReq));
}
@ApiOperation(value = "根据项目日报信息Id获取详细信息", httpMethod = "GET")
@GetMapping("/{reportId}")
public Result<ProjectDailyReportResp> getInfo(@PathVariable String reportId) {
return Result.ok(projectDailyReportService.selectById(reportId));
}
@ApiOperation(value = "获取登录人当日日报", httpMethod = "GET")
@GetMapping("/my-today/{projectId}")
public Result<ProjectDailyReportResp> myToday(@PathVariable String projectId) {
return Result.ok(projectDailyReportService.myToday(projectId));
}
@ApiOperation(value = "新增项目日报信息", httpMethod = "POST")
@PostMapping
public Result<Object> add(@Validated @RequestBody ProjectDailyReportReq projectDailyReportReq) {
projectDailyReportService.saveData(projectDailyReportReq);
return Result.ok();
}
@ApiOperation(value = "修改项目日报信息", httpMethod = "PUT")
@PutMapping
public Result<Object> edit(@Validated @RequestBody ProjectDailyReportReq projectDailyReportReq) {
projectDailyReportService.updateData(projectDailyReportReq);
return Result.ok();
}
@ApiOperation(value = "删除项目日报信息", httpMethod = "DELETE")
@DeleteMapping("/{reportId}")
public Result<Object> remove(@PathVariable String reportId) {
projectDailyReportService.deleteById(reportId);
return Result.ok();
}
}

View File

@ -5,6 +5,7 @@ import cn.dev33.satoken.stp.StpUtil;
import com.dite.znpt.constant.Constants;
import com.dite.znpt.domain.PageResult;
import com.dite.znpt.domain.Result;
import com.dite.znpt.domain.entity.ProjectTaskEntity;
import com.dite.znpt.domain.vo.*;
import com.dite.znpt.service.ProjectTaskService;
import com.dite.znpt.util.PageUtil;
@ -101,7 +102,8 @@ public class ProjectTaskController {
@ApiOperation(value = "查询我的任务", httpMethod = "GET")
@GetMapping("/my")
public Result<List<ProjectTaskResp>> my(ProjectTaskListReq req) {
public Result<List<ProjectTaskResp>> my() {
ProjectTaskListReq req = new ProjectTaskListReq();
req.setUserId(StpUtil.getLoginIdAsString());
return Result.ok(projectTaskService.selectList(req));
}

View File

@ -1,77 +0,0 @@
package com.dite.znpt.web.controller;
import com.dite.znpt.domain.Result;
import com.dite.znpt.domain.entity.RegulationEntity;
import com.dite.znpt.service.RegulationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @author wangna
* @date 2025/07/29
* @Description: 制度规范仓库Controller
*/
@Api(tags = "制度管理")
@RestController
@RequestMapping("/regulation")
public class RegulationController {
@Autowired
private RegulationService regulationService;
@ApiOperation(value = "获取制度列表", httpMethod = "GET")
@GetMapping
public Result getRegulationList(@RequestParam(defaultValue = "1") int page,
@RequestParam(defaultValue = "10") int size,
@RequestParam(required = false) String status,
@RequestParam(required = false) String type,
@RequestParam(required = false) String title,
@RequestParam(required = false) String proposer) {
return regulationService.getRegulationList(page, size, status, type, title, proposer);
}
@ApiOperation(value = "创建制度提案", httpMethod = "POST")
@PostMapping("/proposal")
public Result createRegulationProposal(@RequestBody RegulationEntity regulation) {
return regulationService.createRegulationProposal(regulation);
}
@ApiOperation(value = "更新制度提案", httpMethod = "PUT")
@PutMapping("/proposal/{regulationId}")
public Result updateRegulationProposal(@PathVariable String regulationId, @RequestBody RegulationEntity regulation) {
regulation.setRegulationId(regulationId);
return regulationService.updateRegulationProposal(regulation);
}
@ApiOperation(value = "删除制度提案", httpMethod = "DELETE")
@DeleteMapping("/proposal/{regulationId}")
public Result deleteRegulationProposal(@PathVariable String regulationId) {
return regulationService.deleteRegulationProposal(regulationId);
}
@ApiOperation(value = "获取制度详情", httpMethod = "GET")
@GetMapping("/{regulationId}")
public Result getRegulationDetail(@PathVariable String regulationId) {
return regulationService.getRegulationDetail(regulationId);
}
@ApiOperation(value = "确认制度知晓", httpMethod = "POST")
@PostMapping("/{regulationId}/confirm")
public Result confirmRegulation(@PathVariable String regulationId) {
return regulationService.confirmRegulation(regulationId);
}
/**
* 点击确认公示后原本的制度草案就会进入十天公示期
* @param regulationId
* @return
*/
@ApiOperation(value = "公示制度", httpMethod = "POST")
@PostMapping("/{regulationId}/approve")
public Result approveRegulation(@PathVariable String regulationId) {
return regulationService.approveRegulation(regulationId);
}
}

View File

@ -1,52 +0,0 @@
package com.dite.znpt.web.controller;
import com.dite.znpt.domain.Result;
import com.dite.znpt.domain.entity.RegulationTypeEntity;
import com.dite.znpt.service.RegulationTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 制度类型Controller
* @author wangna
* @date 2025/07/29
*/
@Api(tags = "制度类型管理")
@RestController
@RequestMapping("/regulation/types")
public class RegulationTypeController {
@Autowired
private RegulationTypeService regulationTypeService;
@ApiOperation(value = "获取制度类型列表", httpMethod = "GET")
@GetMapping
public Result getRegulationTypes(@RequestParam(defaultValue = "1") int page,
@RequestParam(defaultValue = "10") int size,
@RequestParam(required = false) String typeName,
@RequestParam(required = false) String status,
@RequestParam(required = false) String remark) {
return regulationTypeService.getRegulationTypes(page, size, typeName, status, remark);
}
@ApiOperation(value = "创建制度类型", httpMethod = "POST")
@PostMapping
public Result createRegulationType(@RequestBody RegulationTypeEntity regulationType) {
return regulationTypeService.createRegulationType(regulationType);
}
@ApiOperation(value = "更新制度类型", httpMethod = "PUT")
@PutMapping("/{typeId}")
public Result updateRegulationType(@PathVariable String typeId, @RequestBody RegulationTypeEntity regulationType) {
regulationType.setTypeId(typeId);
return regulationTypeService.updateRegulationType(regulationType);
}
@ApiOperation(value = "删除制度类型", httpMethod = "DELETE")
@DeleteMapping("/{typeId}")
public Result deleteRegulationType(@PathVariable String typeId) {
return regulationTypeService.deleteRegulationType(typeId);
}
}

View File

@ -2,7 +2,7 @@
server:
# 服务器的HTTP端口默认为8080
port: 8888
address : 0.0.0.0 # 监听所有网络接口
address: 0.0.0.0
# 数据源配置
spring:
@ -100,39 +100,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
@ -149,3 +149,7 @@ util:
imagePreTreatmentPath: d:\
reportGeneratorPath: D:\blade_report_generator.exe
reportGeneratorTemplatePath: D:\muban
file:
upload:
businessDataPath: D:/upload/businessData