From 4581db487ca237dca8eb31415135e800b9982929 Mon Sep 17 00:00:00 2001 From: feige <791364011@qq.com> Date: 星期一, 04 八月 2025 21:44:05 +0800 Subject: [PATCH] 增加了相关代码 --- archiveManager/pom.xml | 8 archiveManager/src/main/java/com/ruoyi/service/IArchiveRecordsService.java | 1 ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiverecordstouserController.java | 22 ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveRecordsController.java | 10 archiveManager/src/main/java/com/ruoyi/mapper/ArchiveCategoryMapper.java | 9 archiveManager/src/main/java/com/ruoyi/service/IArchiverecordstouserService.java | 7 archiveManager/src/main/java/com/ruoyi/mapper/DocumentMaterialsMapper.java | 9 archiveManager/src/main/java/com/ruoyi/domain/Archiverecordstouser.java | 18 archiveManager/src/main/java/com/ruoyi/service/IDocumentMaterialsService.java | 59 ++ archiveManager/src/main/java/com/ruoyi/mapper/ArchiveRecordsMapper.java | 12 archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveCategoryServiceImpl.java | 194 +++++++ archiveManager/src/main/java/com/ruoyi/domain/ArchiveRecords.java | 61 ++ archiveManager/src/main/java/com/ruoyi/service/IArchiveCategoryService.java | 72 ++ archiveManager/src/main/java/com/ruoyi/domain/ArchiveCategory.java | 86 +++ ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveCategoryController.java | 122 ++++ archiveManager/src/main/java/com/ruoyi/service/impl/ArchiverecordstouserServiceImpl.java | 69 ++ archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveRecordsServiceImpl.java | 54 + ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/DocumentMaterialsController.java | 114 ++++ archiveManager/src/main/java/com/ruoyi/domain/DocumentMaterials.java | 416 ++++++++++++++++ archiveManager/src/main/java/com/ruoyi/mapper/ArchiverecordstouserMapper.java | 2 archiveManager/src/main/java/com/ruoyi/service/impl/DocumentMaterialsServiceImpl.java | 142 +++++ 21 files changed, 1,468 insertions(+), 19 deletions(-) diff --git a/archiveManager/pom.xml b/archiveManager/pom.xml index 052828a..a9e76c6 100644 --- a/archiveManager/pom.xml +++ b/archiveManager/pom.xml @@ -40,6 +40,14 @@ </exclusions> </dependency> + <dependency> + <groupId>com.ruoyi</groupId> + <artifactId>ruoyi-system</artifactId> + </dependency> + <dependency> + <groupId>com.ruoyi</groupId> + <artifactId>ruoyi-system</artifactId> + </dependency> </dependencies> </project> \ No newline at end of file diff --git a/archiveManager/src/main/java/com/ruoyi/domain/ArchiveCategory.java b/archiveManager/src/main/java/com/ruoyi/domain/ArchiveCategory.java new file mode 100644 index 0000000..a29827c --- /dev/null +++ b/archiveManager/src/main/java/com/ruoyi/domain/ArchiveCategory.java @@ -0,0 +1,86 @@ +package com.ruoyi.domain; + + + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.util.Date; + +/** + * 銆愯濉啓鍔熻兘鍚嶇О銆戝璞� archive_category + * + * @author ruoyi + * @date 2025-07-26 + */ +public class ArchiveCategory extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + @TableId(type = IdType.AUTO) + + private Long id; + + /** $column.columnComment */ + @Excel(name = "缂栧彿") + private String numb; + + /** $column.columnComment */ + @Excel(name = "鍚嶇О") + private String nname; + + + private Date ctime; + + public Date getCtime() { + return ctime; + } + + public void setCtime(Date ctime) { + this.ctime = ctime; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setNumb(String numb) + { + this.numb = numb; + } + + public String getNumb() + { + return numb; + } + + public void setNname(String nname) + { + this.nname = nname; + } + + public String getNname() + { + return nname; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("numb", getNumb()) + .append("nname", getNname()) + .toString(); + } +} diff --git a/archiveManager/src/main/java/com/ruoyi/domain/ArchiveRecords.java b/archiveManager/src/main/java/com/ruoyi/domain/ArchiveRecords.java index 700861e..78bbbc7 100644 --- a/archiveManager/src/main/java/com/ruoyi/domain/ArchiveRecords.java +++ b/archiveManager/src/main/java/com/ruoyi/domain/ArchiveRecords.java @@ -3,6 +3,7 @@ import java.util.Date; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; import org.apache.commons.lang3.builder.ToStringBuilder; @@ -101,11 +102,69 @@ @Excel(name = "澶囨敞") private String remarks; + /** 鍘嗗彶鐩稿叧鍙戞枃鍙� */ @Excel(name = "鍘嗗彶鐩稿叧鍙戞枃鍙�") private String historicalReferenceNumber; - public void setId(Long id) + @TableField(exist = false) + private boolean isOwnData; + @TableField(exist = false) + + private String archiveRecordsId; + @TableField(exist = false) + + private Long userId; + + @Override + public Date getCreateTime() { + return createTime; + } + + @Override + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + private Date createTime; + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getArchiveRecordsId() { + return archiveRecordsId; + } + + public String isArchiveRecordsId() { + return archiveRecordsId; + } + + public void setArchiveRecordsId(String archiveRecordsId) { + this.archiveRecordsId = archiveRecordsId; + } + + public boolean isOwnData() { + return isOwnData; + } + + public void setOwnData(boolean ownData) { + isOwnData = ownData; + } + + public String getRecordStatus() { + return recordStatus; + } + + public void setRecordStatus(String recordStatus) { + this.recordStatus = recordStatus; + } + + public void setId(Long id) { this.id = id; } diff --git a/archiveManager/src/main/java/com/ruoyi/domain/Archiverecordstouser.java b/archiveManager/src/main/java/com/ruoyi/domain/Archiverecordstouser.java index 2c693db..ed7388a 100644 --- a/archiveManager/src/main/java/com/ruoyi/domain/Archiverecordstouser.java +++ b/archiveManager/src/main/java/com/ruoyi/domain/Archiverecordstouser.java @@ -1,7 +1,9 @@ package com.ruoyi.domain; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; +import com.ruoyi.common.core.domain.entity.SysUser; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -24,11 +26,21 @@ /** 妗f鐩綍id */ @Excel(name = "妗f鐩綍id ") - private Long archiveRecordsId; + private String archiveRecordsId; /** 鐢ㄦ埛id */ @Excel(name = "鐢ㄦ埛id") private Long userId; + + public SysUser getSysUser() { + return sysUser; + } + + public void setSysUser(SysUser sysUser) { + this.sysUser = sysUser; + } + @TableField(exist = false) + private SysUser sysUser; public void setId(Long id) { @@ -40,12 +52,12 @@ return id; } - public void setArchiveRecordsId(Long archiveRecordsId) + public void setArchiveRecordsId(String archiveRecordsId) { this.archiveRecordsId = archiveRecordsId; } - public Long getArchiveRecordsId() + public String getArchiveRecordsId() { return archiveRecordsId; } diff --git a/archiveManager/src/main/java/com/ruoyi/domain/DocumentMaterials.java b/archiveManager/src/main/java/com/ruoyi/domain/DocumentMaterials.java new file mode 100644 index 0000000..5206ff0 --- /dev/null +++ b/archiveManager/src/main/java/com/ruoyi/domain/DocumentMaterials.java @@ -0,0 +1,416 @@ +package com.ruoyi.domain; + + + +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 銆愯濉啓鍔熻兘鍚嶇О銆戝璞� document_materials + * + * @author ruoyi + * @date 2025-07-26 + */ +public class DocumentMaterials extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + @TableId(type = IdType.AUTO) + private Long materialId; + + /** $column.columnComment */ + @Excel(name = "鏂囦欢缂栦换鑰�") + private String creator; + + /** $column.columnComment */ + @Excel(name = "鏂囦欢鎻愬悕") + private String title; + + /** $column.columnComment */ + @Excel(name = "鏃ユ湡") + private Date date; + + /** $column.columnComment */ + @Excel(name = "椤靛彿") + private Long pageNumber; + + /** $column.columnComment */ + @Excel(name = "椤垫") + private Long pageOrder; + + /** $column.columnComment */ + @Excel(name = "鎵�澶勯樁娈�") + private String stage; + + /** $column.columnComment */ + @Excel(name = "鍏紑灞炴��") + private String publicity; + + /** $column.columnComment */ + @Excel(name = "鏄惁涓洪檮浠�") + private String isAttachment; + + /** $column.columnComment */ + @Excel(name = "鏄惁涓洪檮鍥�") + private String isDiagram; + + /** $column.columnComment */ + @Excel(name = "淇濈鏈熼檺") + private String retentionPeriod; + + /** $column.columnComment */ + @Excel(name = "瀵嗙骇") + private String securityLevel; + + /** $column.columnComment */ + @Excel(name = "鏄惁娑夊瘑鍙婃晱鎰熶俊鎭�") + private String isSensitive; + + /** $column.columnComment */ + @Excel(name = "鏄惁娉ㄩ攢") + private String isCanceled; + + /** $column.columnComment */ + @Excel(name = "鏍煎紡") + private String format; + + /** $column.columnComment */ + @Excel(name = "骞呴潰") + private String sizeType; + + /** $column.columnComment */ + @Excel(name = "姘村钩鍒嗚鲸鐜�") + private Long horizontalResolution; + + /** $column.columnComment */ + @Excel(name = "鍨傜洿鍒嗚鲸鐜�") + private Long verticalResolution; + + /** $column.columnComment */ + @Excel(name = "瀹藉害") + private Long width; + + /** $column.columnComment */ + @Excel(name = "楂樺害") + private Long height; + + /** $column.columnComment */ + @Excel(name = "澶у皬") + private Long fileSize; + + /** $column.columnComment */ + @Excel(name = "闄勪欢鍙婂巻鍙插彂鏂囧彿") + private String attachmentHistoryNumbers; + + /** $column.columnComment */ + @Excel(name = "澶囨敞") + private String remarks; + + /** $column.columnComment */ + @Excel(name = "${comment}") + private Date createdAt; + + /** $column.columnComment */ + @Excel(name = "${comment}") + private Date updatedAt; + + + private Long recordId; + + public Long getRecordId() { + return recordId; + } + + public void setRecordId(Long recordId) { + this.recordId = recordId; + } + + public void setMaterialId(Long materialId) + { + this.materialId = materialId; + } + + public Long getMaterialId() + { + return materialId; + } + + public void setCreator(String creator) + { + this.creator = creator; + } + + public String getCreator() + { + return creator; + } + + public void setTitle(String title) + { + this.title = title; + } + + public String getTitle() + { + return title; + } + + public void setDate(Date date) + { + this.date = date; + } + + public Date getDate() + { + return date; + } + + public void setPageNumber(Long pageNumber) + { + this.pageNumber = pageNumber; + } + + public Long getPageNumber() + { + return pageNumber; + } + + public void setPageOrder(Long pageOrder) + { + this.pageOrder = pageOrder; + } + + public Long getPageOrder() + { + return pageOrder; + } + + public void setStage(String stage) + { + this.stage = stage; + } + + public String getStage() + { + return stage; + } + + public void setPublicity(String publicity) + { + this.publicity = publicity; + } + + public String getPublicity() + { + return publicity; + } + + public void setIsAttachment(String isAttachment) + { + this.isAttachment = isAttachment; + } + + public String getIsAttachment() + { + return isAttachment; + } + + public void setIsDiagram(String isDiagram) + { + this.isDiagram = isDiagram; + } + + public String getIsDiagram() + { + return isDiagram; + } + + public void setRetentionPeriod(String retentionPeriod) + { + this.retentionPeriod = retentionPeriod; + } + + public String getRetentionPeriod() + { + return retentionPeriod; + } + + public void setSecurityLevel(String securityLevel) + { + this.securityLevel = securityLevel; + } + + public String getSecurityLevel() + { + return securityLevel; + } + + public void setIsSensitive(String isSensitive) + { + this.isSensitive = isSensitive; + } + + public String getIsSensitive() + { + return isSensitive; + } + + public void setIsCanceled(String isCanceled) + { + this.isCanceled = isCanceled; + } + + public String getIsCanceled() + { + return isCanceled; + } + + public void setFormat(String format) + { + this.format = format; + } + + public String getFormat() + { + return format; + } + + public void setSizeType(String sizeType) + { + this.sizeType = sizeType; + } + + public String getSizeType() + { + return sizeType; + } + + public void setHorizontalResolution(Long horizontalResolution) + { + this.horizontalResolution = horizontalResolution; + } + + public Long getHorizontalResolution() + { + return horizontalResolution; + } + + public void setVerticalResolution(Long verticalResolution) + { + this.verticalResolution = verticalResolution; + } + + public Long getVerticalResolution() + { + return verticalResolution; + } + + public void setWidth(Long width) + { + this.width = width; + } + + public Long getWidth() + { + return width; + } + + public void setHeight(Long height) + { + this.height = height; + } + + public Long getHeight() + { + return height; + } + + public void setFileSize(Long fileSize) + { + this.fileSize = fileSize; + } + + public Long getFileSize() + { + return fileSize; + } + + public void setAttachmentHistoryNumbers(String attachmentHistoryNumbers) + { + this.attachmentHistoryNumbers = attachmentHistoryNumbers; + } + + public String getAttachmentHistoryNumbers() + { + return attachmentHistoryNumbers; + } + + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + + public void setCreatedAt(Date createdAt) + { + this.createdAt = createdAt; + } + + public Date getCreatedAt() + { + return createdAt; + } + + public void setUpdatedAt(Date updatedAt) + { + this.updatedAt = updatedAt; + } + + public Date getUpdatedAt() + { + return updatedAt; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("materialId", getMaterialId()) + .append("creator", getCreator()) + .append("title", getTitle()) + .append("date", getDate()) + .append("pageNumber", getPageNumber()) + .append("pageOrder", getPageOrder()) + .append("stage", getStage()) + .append("publicity", getPublicity()) + .append("isAttachment", getIsAttachment()) + .append("isDiagram", getIsDiagram()) + .append("retentionPeriod", getRetentionPeriod()) + .append("securityLevel", getSecurityLevel()) + .append("isSensitive", getIsSensitive()) + .append("isCanceled", getIsCanceled()) + .append("format", getFormat()) + .append("sizeType", getSizeType()) + .append("horizontalResolution", getHorizontalResolution()) + .append("verticalResolution", getVerticalResolution()) + .append("width", getWidth()) + .append("height", getHeight()) + .append("fileSize", getFileSize()) + .append("attachmentHistoryNumbers", getAttachmentHistoryNumbers()) + .append("remarks", getRemarks()) + .append("createdAt", getCreatedAt()) + .append("updatedAt", getUpdatedAt()) + .toString(); + } +} diff --git a/archiveManager/src/main/java/com/ruoyi/mapper/ArchiveCategoryMapper.java b/archiveManager/src/main/java/com/ruoyi/mapper/ArchiveCategoryMapper.java new file mode 100644 index 0000000..ff656a8 --- /dev/null +++ b/archiveManager/src/main/java/com/ruoyi/mapper/ArchiveCategoryMapper.java @@ -0,0 +1,9 @@ +package com.ruoyi.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.domain.ArchiveCategory; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface ArchiveCategoryMapper extends BaseMapper<ArchiveCategory> { +} diff --git a/archiveManager/src/main/java/com/ruoyi/mapper/ArchiveRecordsMapper.java b/archiveManager/src/main/java/com/ruoyi/mapper/ArchiveRecordsMapper.java index 03e96eb..429c7be 100644 --- a/archiveManager/src/main/java/com/ruoyi/mapper/ArchiveRecordsMapper.java +++ b/archiveManager/src/main/java/com/ruoyi/mapper/ArchiveRecordsMapper.java @@ -1,9 +1,21 @@ package com.ruoyi.mapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.domain.ArchiveRecords; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; @Mapper public interface ArchiveRecordsMapper extends BaseMapper<ArchiveRecords> { + + + @Select("SELECT c.*,a.archive_records_id,b.user_id FROM archiverecordstouser a inner join sys_user b ON a.user_id = b.user_id right join archive_records c on c.record_id=a.archive_records_id ${ew.customSqlSegment} ") + Page<ArchiveRecords> selectJoinUserPage(Page<ArchiveRecords> page, @Param("ew") LambdaQueryWrapper<ArchiveRecords> queryWrapper); + + @Select("select max(id) from archive_records") + Long findMaxId(); + } diff --git a/archiveManager/src/main/java/com/ruoyi/mapper/ArchiverecordstouserMapper.java b/archiveManager/src/main/java/com/ruoyi/mapper/ArchiverecordstouserMapper.java index c5e6dee..2a24e07 100644 --- a/archiveManager/src/main/java/com/ruoyi/mapper/ArchiverecordstouserMapper.java +++ b/archiveManager/src/main/java/com/ruoyi/mapper/ArchiverecordstouserMapper.java @@ -3,9 +3,11 @@ import java.util.List; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.domain.ArchiveRecords; import com.ruoyi.domain.Archiverecordstouser; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Select; /** * 銆愯濉啓鍔熻兘鍚嶇О銆慚apper鎺ュ彛 diff --git a/archiveManager/src/main/java/com/ruoyi/mapper/DocumentMaterialsMapper.java b/archiveManager/src/main/java/com/ruoyi/mapper/DocumentMaterialsMapper.java new file mode 100644 index 0000000..3ce0637 --- /dev/null +++ b/archiveManager/src/main/java/com/ruoyi/mapper/DocumentMaterialsMapper.java @@ -0,0 +1,9 @@ +package com.ruoyi.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.domain.DocumentMaterials; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface DocumentMaterialsMapper extends BaseMapper<DocumentMaterials> { +} diff --git a/archiveManager/src/main/java/com/ruoyi/service/IArchiveCategoryService.java b/archiveManager/src/main/java/com/ruoyi/service/IArchiveCategoryService.java new file mode 100644 index 0000000..0b7125e --- /dev/null +++ b/archiveManager/src/main/java/com/ruoyi/service/IArchiveCategoryService.java @@ -0,0 +1,72 @@ +package com.ruoyi.service; + + + + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.domain.ArchiveCategory; +import com.ruoyi.domain.ArchiveRecords; + +import java.util.List; + + +/** + * 銆愯濉啓鍔熻兘鍚嶇О銆慡ervice鎺ュ彛 + * + * @author ruoyi + * @date 2025-07-26 + */ +public interface IArchiveCategoryService +{ + + + AjaxResult selectDataList(ArchiveCategory archiveCategory, Integer pageNum, Integer pageSize); + + /** + * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿� + * @return 銆愯濉啓鍔熻兘鍚嶇О銆� + */ + public ArchiveCategory selectArchiveCategoryById(Long id); + + /** + * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛� + * + * @param archiveCategory 銆愯濉啓鍔熻兘鍚嶇О銆� + * @return 銆愯濉啓鍔熻兘鍚嶇О銆戦泦鍚� + */ + public List<ArchiveCategory> selectArchiveCategoryList(ArchiveCategory archiveCategory); + + /** + * 鏂板銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param archiveCategory 銆愯濉啓鍔熻兘鍚嶇О銆� + * @return 缁撴灉 + */ + public int insertArchiveCategory(ArchiveCategory archiveCategory); + + /** + * 淇敼銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param archiveCategory 銆愯濉啓鍔熻兘鍚嶇О銆� + * @return 缁撴灉 + */ + public int updateArchiveCategory(ArchiveCategory archiveCategory); + + /** + * 鎵归噺鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param ids 闇�瑕佸垹闄ょ殑銆愯濉啓鍔熻兘鍚嶇О銆戜富閿泦鍚� + * @return 缁撴灉 + */ + public int deleteArchiveCategoryByIds(Long[] ids); + + /** + * 鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆戜俊鎭� + * + * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿� + * @return 缁撴灉 + */ + public int deleteArchiveCategoryById(Long id); +} diff --git a/archiveManager/src/main/java/com/ruoyi/service/IArchiveRecordsService.java b/archiveManager/src/main/java/com/ruoyi/service/IArchiveRecordsService.java index a4fe276..079abe1 100644 --- a/archiveManager/src/main/java/com/ruoyi/service/IArchiveRecordsService.java +++ b/archiveManager/src/main/java/com/ruoyi/service/IArchiveRecordsService.java @@ -13,6 +13,7 @@ */ public interface IArchiveRecordsService { + Long getMaxId(); AjaxResult selectDataList(ArchiveRecords archiveRecords, Integer pageNum, Integer pageSize); diff --git a/archiveManager/src/main/java/com/ruoyi/service/IArchiverecordstouserService.java b/archiveManager/src/main/java/com/ruoyi/service/IArchiverecordstouserService.java index 022caaa..b46923e 100644 --- a/archiveManager/src/main/java/com/ruoyi/service/IArchiverecordstouserService.java +++ b/archiveManager/src/main/java/com/ruoyi/service/IArchiverecordstouserService.java @@ -1,5 +1,7 @@ package com.ruoyi.service; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.domain.ArchiveRecords; import com.ruoyi.domain.Archiverecordstouser; import java.util.List; @@ -10,8 +12,11 @@ * @author ruoyi * @date 2025-07-20 */ -public interface IArchiverecordstouserService +public interface IArchiverecordstouserService { + public int insertRecordToUsers(String recordId, Long[] userIds); + AjaxResult selectDataList(Archiverecordstouser archiverecordstouser, Integer pageNum, Integer pageSize); + /** * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆� * diff --git a/archiveManager/src/main/java/com/ruoyi/service/IDocumentMaterialsService.java b/archiveManager/src/main/java/com/ruoyi/service/IDocumentMaterialsService.java new file mode 100644 index 0000000..a47faf7 --- /dev/null +++ b/archiveManager/src/main/java/com/ruoyi/service/IDocumentMaterialsService.java @@ -0,0 +1,59 @@ +package com.ruoyi.service; + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.domain.Archiverecordstouser; +import com.ruoyi.domain.DocumentMaterials; + +import java.util.List; + +public interface IDocumentMaterialsService { + + + AjaxResult selectDataList(DocumentMaterials documentMaterials, Integer pageNum, Integer pageSize); + + /** + * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆� + * @param materialId 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿� + * @return 銆愯濉啓鍔熻兘鍚嶇О銆� + */ + public DocumentMaterials selectDocumentMaterialsByMaterialId(String materialId); + + /** + * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛� + * @param documentMaterials 銆愯濉啓鍔熻兘鍚嶇О銆� + * @return 銆愯濉啓鍔熻兘鍚嶇О銆戦泦鍚� + */ + public List<DocumentMaterials> selectDocumentMaterialsList(DocumentMaterials documentMaterials); + + /** + * 鏂板銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param documentMaterials 銆愯濉啓鍔熻兘鍚嶇О銆� + * @return + */ + public int insertDocumentMaterials(DocumentMaterials documentMaterials); + + /** + * 淇敼銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param documentMaterials 銆愯濉啓鍔熻兘鍚嶇О銆� + * @return 缁撴灉 + */ + public int updateDocumentMaterials(DocumentMaterials documentMaterials); + + /** + * 鎵归噺鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param materialIds 闇�瑕佸垹闄ょ殑銆愯濉啓鍔熻兘鍚嶇О銆戜富閿泦鍚� + * @return 缁撴灉 + */ + public int deleteDocumentMaterialsByMaterialIds(String[] materialIds); + + /** + * 鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆戜俊鎭� + * + * @param materialId 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿� + * @return 缁撴灉 + */ + public int deleteDocumentMaterialsByMaterialId(String materialId); +} diff --git a/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveCategoryServiceImpl.java b/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveCategoryServiceImpl.java new file mode 100644 index 0000000..da6f49e --- /dev/null +++ b/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveCategoryServiceImpl.java @@ -0,0 +1,194 @@ +package com.ruoyi.service.impl; + + + +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; + +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.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.utils.MapUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.domain.ArchiveCategory; + +import com.ruoyi.domain.ArchiveRecords; +import com.ruoyi.domain.Archiverecordstouser; +import com.ruoyi.mapper.ArchiveCategoryMapper; +import com.ruoyi.mapper.ArchiveRecordsMapper; +import com.ruoyi.service.IArchiveCategoryService; +import com.ruoyi.service.IArchiveRecordsService; +import com.ruoyi.service.IDocumentMaterialsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * 銆愯濉啓鍔熻兘鍚嶇О銆慡ervice涓氬姟灞傚鐞� + * + * @author ruoyi + * @date 2025-07-26 + */ +@Service +public class ArchiveCategoryServiceImpl extends ServiceImpl<ArchiveCategoryMapper, ArchiveCategory> implements IArchiveCategoryService +{ + + + + + private LambdaQueryWrapper<ArchiveCategory> buildCondition(ArchiveCategory archiveRecords){ + LambdaQueryWrapper<ArchiveCategory> lqw = new LambdaQueryWrapper<>(); + lqw.like(!StringUtils.isEmpty(archiveRecords.getNumb()), ArchiveCategory::getNumb, archiveRecords.getNumb()) + .like(!StringUtils.isEmpty(archiveRecords.getNname()), ArchiveCategory::getNname, archiveRecords.getNname()); +// lqw.like(!StringUtils.isEmpty(archiveRecords.getProjectName()), ArchiveRecords::getProjectName, archiveRecords.getProjectName()) +// .like(!StringUtils.isEmpty(archiveRecords.getFilingNumber()), ArchiveRecords::getFilingNumber, archiveRecords.getFilingNumber()) +// .like(!StringUtils.isEmpty(archiveRecords.getArchiveRoomNumber()), ArchiveRecords::getArchiveRoomNumber, archiveRecords.getArchiveRoomNumber()) +// .like(!StringUtils.isEmpty(archiveRecords.getRecordId()), ArchiveRecords::getRecordId, archiveRecords.getRecordId()); +// // .like(!StringUtils.isEmpty(zfProperty.getLocation()), ZfProperty::getLocation, zfProperty.getLocation()) +// .like(!StringUtils.isEmpty(zfProperty.getHolder()), ZfProperty::getHolder, zfProperty.getHolder()) +// .like(!StringUtils.isEmpty(zfProperty.getAddress()), ZfProperty::getAddress, zfProperty.getAddress()) +// .like(!StringUtils.isEmpty(zfProperty.getRemark()), ZfProperty::getRemark, zfProperty.getRemark()) +// .eq(zfProperty.getFamilyId()!=null,ZfProperty::getFamilyId,zfProperty.getFamilyId()) +// .in(ZfProperty::getFamilyId,familyIdList) +// .eq(zfProperty.getHappenTime()!=null,ZfProperty::getHappenTime,zfProperty.getHappenTime()) +// .between(zfProperty.getHappenStartTime() != null && zfProperty.getHappenEndTime() != null, ZfProperty::getHappenTime, zfProperty.getHappenStartTime(), zfProperty.getHappenEndTime()); +// lqw.orderByDesc(ZfProperty::getCreateTime); + // lqw.orderByDesc(ArchiveRecords::isOwnData); + lqw.orderByDesc(ArchiveCategory::getCtime); + System.out.println("ssssssssssssddd0000000000000000"); + return lqw; + + } + @Override + public AjaxResult selectDataList(ArchiveCategory archiveCategory, Integer pageNum, Integer pageSize) { + LambdaQueryWrapper<ArchiveCategory> lqw = buildCondition(archiveCategory); + + + Page<ArchiveCategory> zfClanPage = new Page<>(pageNum, pageSize); + Page<ArchiveCategory> pageResult = page(zfClanPage, lqw); + + List<ArchiveCategory> beanRecords = pageResult.getRecords();//寰楀埌鏌ヨ鍑烘潵鐨勬暟鎹� + + + + // List<ArchiveRecords> beanRecords = list(lqw); + // log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", beanRecords); + // return markOwnData(familyId, fatherFaId, motherFaId, beanRecords); + HashMap<String, Object> data = MapUtils.getResult(pageResult, beanRecords); + + + return AjaxResult.success(data); } + + /** + * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿� + * @return 銆愯濉啓鍔熻兘鍚嶇О銆� + */ + @Override + public ArchiveCategory selectArchiveCategoryById(Long id) + { + LambdaQueryWrapper<ArchiveCategory> lqw = new LambdaQueryWrapper<>(); + lqw.eq(id!=null, ArchiveCategory::getId, id); + List<ArchiveCategory> records = list(lqw); + if(!records.isEmpty()) + return records.get(0); + else + return null; } + + /** + * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛� + * + * @param archiveCategory 銆愯濉啓鍔熻兘鍚嶇О銆� + * @return 銆愯濉啓鍔熻兘鍚嶇О銆� + */ + @Override + public List<ArchiveCategory> selectArchiveCategoryList(ArchiveCategory archiveCategory) + { + + LambdaQueryWrapper<ArchiveCategory> lambdaQueryWrapper = buildCondition(archiveCategory); + List<ArchiveCategory> beanRecords = list(lambdaQueryWrapper); + System.out.println(beanRecords.size()); + return beanRecords; + + } + + /** + * 鏂板銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param archiveCategory 銆愯濉啓鍔熻兘鍚嶇О銆� + * @return 缁撴灉 + */ + @Override + public int insertArchiveCategory(ArchiveCategory archiveCategory) + { + LocalDateTime time = LocalDateTime.now(); + + Date date = Date.from(time.atZone(ZoneId.systemDefault()).toInstant()); + archiveCategory.setCtime(date); + boolean res = this.save(archiveCategory); + if(res) + return 1; + else + return 0; + + } + + /** + * 淇敼銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param archiveCategory 銆愯濉啓鍔熻兘鍚嶇О銆� + * @return 缁撴灉 + */ + @Override + public int updateArchiveCategory(ArchiveCategory archiveCategory) + { + + + boolean result = updateById(archiveCategory); + if(result) + return 1; + else + return 0; + + } + + /** + * 鎵归噺鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆� + * + * @param ids 闇�瑕佸垹闄ょ殑銆愯濉啓鍔熻兘鍚嶇О銆戜富閿� + * @return 缁撴灉 + */ + @Override + public int deleteArchiveCategoryByIds(Long[] ids) + { + + if (this.removeByIds(Arrays.asList(ids))) { + return 1; + } + else + return 0; + + + } + + /** + * 鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆戜俊鎭� + * + * @param id 銆愯濉啓鍔熻兘鍚嶇О銆戜富閿� + * @return 缁撴灉 + */ + @Override + public int deleteArchiveCategoryById(Long id) + { + return 0; + } + + +} diff --git a/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveRecordsServiceImpl.java b/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveRecordsServiceImpl.java index 3dc66f6..22f5ae5 100644 --- a/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveRecordsServiceImpl.java +++ b/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveRecordsServiceImpl.java @@ -1,17 +1,20 @@ package com.ruoyi.service.impl; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.*; 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.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.MapUtils; +import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.domain.ArchiveRecords; +import com.ruoyi.domain.Archiverecordstouser; import com.ruoyi.mapper.ArchiveRecordsMapper; +import com.ruoyi.mapper.ArchiverecordstouserMapper; import com.ruoyi.service.IArchiveRecordsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -29,7 +32,8 @@ // @Autowired // private ArchiveRecordsMapper archiveRecordsMapper; - + @Autowired + private ArchiverecordstouserMapper archiverecordstouserMapper; @@ -49,10 +53,20 @@ // .eq(zfProperty.getHappenTime()!=null,ZfProperty::getHappenTime,zfProperty.getHappenTime()) // .between(zfProperty.getHappenStartTime() != null && zfProperty.getHappenEndTime() != null, ZfProperty::getHappenTime, zfProperty.getHappenStartTime(), zfProperty.getHappenEndTime()); // lqw.orderByDesc(ZfProperty::getCreateTime); + // lqw.orderByDesc(ArchiveRecords::isOwnData); + // lqw.orderByDesc(ArchiveRecords::getCreateTime); + lqw.orderByDesc(ArchiveRecords::getCreateTime); System.out.println("ssssssssssssddd0000000000000000"); return lqw; } + + @Override + public Long getMaxId() { + //return this. + return baseMapper.findMaxId(); + } + @Override public AjaxResult selectDataList(ArchiveRecords archiveRecords, Integer pageNum, Integer pageSize) { @@ -61,13 +75,37 @@ System.out.println("-------------"); System.out.println(pageNum); - Page<ArchiveRecords> zfClanPage = new Page<>(pageNum, pageSize); - Page<ArchiveRecords> pageResult = page(zfClanPage, lqw); + + + + Page<ArchiveRecords> page = new Page<>(pageNum, pageSize); + + // 浣跨敤鑷畾涔夌殑鍒嗛〉鏌ヨ鏂规硶锛屽厛杩炴帴鍐嶅垎椤� + Page<ArchiveRecords> pageResult = this.baseMapper.selectJoinUserPage(page, lqw); + + + //selectJoinUserPage(page, lqw); + + List<ArchiveRecords> beanRecords = pageResult.getRecords();//寰楀埌鏌ヨ鍑烘潵鐨勬暟鎹� // List<ArchiveRecords> beanRecords = list(lqw); // log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", beanRecords); // return markOwnData(familyId, fatherFaId, motherFaId, beanRecords); + //鎷垮埌褰撳墠鐢ㄦ埛鐨刬d + // 鑾峰彇褰撳墠鐢ㄦ埛ID + Long userid = SecurityUtils.getUserId(); + + beanRecords.forEach(record ->{ + if(record.isArchiveRecordsId()!=null&&record.getUserId()==userid) + { + record.setOwnData(true); + } + else + record.setOwnData(false); + }); + + // Collections.sort(beanRecords, Comparator.comparing(ArchiveRecords::isOwnData)); HashMap<String, Object> data = MapUtils.getResult(pageResult, beanRecords); // System.out.println(data.get("data")); // System.out.println(data.get("pageNum")); @@ -120,6 +158,10 @@ @Override public int insertArchiveRecords(ArchiveRecords archiveRecords) { + LocalDateTime time = LocalDateTime.now(); + + Date date = Date.from(time.atZone(ZoneId.systemDefault()).toInstant()); + archiveRecords.setCreateTime(date); boolean res = this.save(archiveRecords); if(res) return 1; diff --git a/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiverecordstouserServiceImpl.java b/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiverecordstouserServiceImpl.java index 09ee243..d7b7df3 100644 --- a/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiverecordstouserServiceImpl.java +++ b/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiverecordstouserServiceImpl.java @@ -1,12 +1,21 @@ package com.ruoyi.service.impl; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +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.ruoyi.domain.ArchiveRecords; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.utils.MapUtils; + +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.domain.Archiverecordstouser; -import com.ruoyi.mapper.ArchiveRecordsMapper; +import com.ruoyi.mapper.ArchiverecordstouserMapper; import com.ruoyi.service.IArchiverecordstouserService; +import com.ruoyi.system.mapper.SysUserMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -18,9 +27,63 @@ * @date 2025-07-20 */ @Service -public class ArchiverecordstouserServiceImpl extends ServiceImpl<ArchiveRecordsMapper, ArchiveRecords> implements IArchiverecordstouserService +public class ArchiverecordstouserServiceImpl extends ServiceImpl<ArchiverecordstouserMapper, Archiverecordstouser> implements IArchiverecordstouserService { + @Autowired + private SysUserMapper userMapper; + private LambdaQueryWrapper<Archiverecordstouser> buildCondition(Archiverecordstouser archiverecordstouser) { + LambdaQueryWrapper<Archiverecordstouser> lqw = new LambdaQueryWrapper<>(); + lqw.eq(!StringUtils.isEmpty(archiverecordstouser.getArchiveRecordsId()),Archiverecordstouser::getArchiveRecordsId, archiverecordstouser.getArchiveRecordsId()); + return lqw; + } + + + @Override + public int insertRecordToUsers(String recordId, Long[] userIds) { + // 鏂板鐢ㄦ埛涓庤鑹茬鐞� + List<Archiverecordstouser> list = new ArrayList<Archiverecordstouser>(); + for (Long userId : userIds) + { + Archiverecordstouser ur = new Archiverecordstouser(); + ur.setArchiveRecordsId(recordId); + ur.setUserId(userId); + list.add(ur); + } + boolean res = this.saveBatch(list); + if(res) + return 1; + else + return 0; + // return userRoleMapper.batchUserRole(list); + } + + @Override + public AjaxResult selectDataList(Archiverecordstouser archiverecordstouser, Integer pageNum, Integer pageSize) { + System.out.println(archiverecordstouser.getArchiveRecordsId()); + System.out.println("sssssssssssssssssssssssss"); + LambdaQueryWrapper<Archiverecordstouser> lqw = buildCondition(archiverecordstouser); + + + Page<Archiverecordstouser> zfClanPage = new Page<>(pageNum, pageSize); + Page<Archiverecordstouser> pageResult = page(zfClanPage, lqw); + + List<Archiverecordstouser> beanRecords = pageResult.getRecords();//寰楀埌鏌ヨ鍑烘潵鐨勬暟鎹� + + + beanRecords.forEach(record -> { + if (record.getUserId() != null) { + SysUser user = userMapper.selectUserById(record.getUserId()); + record.setSysUser(user); // 鍋囪Archiverecordstouser涓湁setUser鏂规硶 + } + }); + // List<ArchiveRecords> beanRecords = list(lqw); + // log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", beanRecords); + // return markOwnData(familyId, fatherFaId, motherFaId, beanRecords); + HashMap<String, Object> data = MapUtils.getResult(pageResult, beanRecords); + + + return AjaxResult.success(data); } /** * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆� diff --git a/archiveManager/src/main/java/com/ruoyi/service/impl/DocumentMaterialsServiceImpl.java b/archiveManager/src/main/java/com/ruoyi/service/impl/DocumentMaterialsServiceImpl.java new file mode 100644 index 0000000..7b2d06f --- /dev/null +++ b/archiveManager/src/main/java/com/ruoyi/service/impl/DocumentMaterialsServiceImpl.java @@ -0,0 +1,142 @@ +package com.ruoyi.service.impl; + + +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.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.utils.MapUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.domain.ArchiveRecords; +import com.ruoyi.domain.Archiverecordstouser; +import com.ruoyi.domain.DocumentMaterials; +import com.ruoyi.mapper.DocumentMaterialsMapper; +import com.ruoyi.service.IArchiveCategoryService; +import com.ruoyi.service.IDocumentMaterialsService; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +@Service +public class DocumentMaterialsServiceImpl extends ServiceImpl<DocumentMaterialsMapper, DocumentMaterials> implements IDocumentMaterialsService { + private LambdaQueryWrapper<DocumentMaterials> buildCondition(DocumentMaterials documentMaterials){ + LambdaQueryWrapper<DocumentMaterials> lqw = new LambdaQueryWrapper<>(); + + lqw.like(!StringUtils.isEmpty(documentMaterials.getCreator()), DocumentMaterials::getCreator, documentMaterials.getCreator()) + .like(!StringUtils.isEmpty(documentMaterials.getStage()), DocumentMaterials::getStage, documentMaterials.getStage()) + .like(!StringUtils.isEmpty(documentMaterials.getIsCanceled()), DocumentMaterials::getIsCanceled, documentMaterials.getIsCanceled()) + .like(!StringUtils.isEmpty(documentMaterials.getIsAttachment()), DocumentMaterials::getIsAttachment, documentMaterials.getIsAttachment()) + .like(!StringUtils.isEmpty(documentMaterials.getIsSensitive()), DocumentMaterials::getIsSensitive, documentMaterials.getIsSensitive()) + .like(!StringUtils.isEmpty(documentMaterials.getPublicity()), DocumentMaterials::getPublicity, documentMaterials.getPublicity()) + .like(!StringUtils.isEmpty(documentMaterials.getRetentionPeriod()), DocumentMaterials::getRetentionPeriod, documentMaterials.getRetentionPeriod()) + .like(!StringUtils.isEmpty(documentMaterials.getSecurityLevel()), DocumentMaterials::getSecurityLevel, documentMaterials.getSecurityLevel()) + .eq(documentMaterials.getDate()!=null, DocumentMaterials::getDate, documentMaterials.getDate()) + .eq(documentMaterials.getRecordId()!=null, DocumentMaterials::getRecordId, documentMaterials.getRecordId()); +// .like(!StringUtils.isEmpty(archiveRecords.getFilingNumber()), ArchiveRecords::getFilingNumber, archiveRecords.getFilingNumber()) +// .like(!StringUtils.isEmpty(archiveRecords.getArchiveRoomNumber()), ArchiveRecords::getArchiveRoomNumber, archiveRecords.getArchiveRoomNumber()) +// .like(!StringUtils.isEmpty(archiveRecords.getRecordId()), ArchiveRecords::getRecordId, archiveRecords.getRecordId()); +// // .like(!StringUtils.isEmpty(zfProperty.getLocation()), ZfProperty::getLocation, zfProperty.getLocation()) +// .like(!StringUtils.isEmpty(zfProperty.getHolder()), ZfProperty::getHolder, zfProperty.getHolder()) +// .like(!StringUtils.isEmpty(zfProperty.getAddress()), ZfProperty::getAddress, zfProperty.getAddress()) +// .like(!StringUtils.isEmpty(zfProperty.getRemark()), ZfProperty::getRemark, zfProperty.getRemark()) +// .eq(zfProperty.getFamilyId()!=null,ZfProperty::getFamilyId,zfProperty.getFamilyId()) +// .in(ZfProperty::getFamilyId,familyIdList) +// .eq(zfProperty.getHappenTime()!=null,ZfProperty::getHappenTime,zfProperty.getHappenTime()) +// .between(zfProperty.getHappenStartTime() != null && zfProperty.getHappenEndTime() != null, ZfProperty::getHappenTime, zfProperty.getHappenStartTime(), zfProperty.getHappenEndTime()); +// lqw.orderByDesc(ZfProperty::getCreateTime); + // lqw.orderByDesc(ArchiveRecords::isOwnData) + lqw.orderByDesc(DocumentMaterials::getCreatedAt); + System.out.println("ssssssssssssddd0000000000000000"); + return lqw; + + } + @Override + public AjaxResult selectDataList(DocumentMaterials documentMaterials, Integer pageNum, Integer pageSize) { + LambdaQueryWrapper<DocumentMaterials> lqw = buildCondition(documentMaterials); + + + Page<DocumentMaterials> zfClanPage = new Page<>(pageNum, pageSize); + Page<DocumentMaterials> pageResult = page(zfClanPage, lqw); + + List<DocumentMaterials> beanRecords = pageResult.getRecords();//寰楀埌鏌ヨ鍑烘潵鐨勬暟鎹� + + +// beanRecords.forEach(record -> { +// if (record.getUserId() != null) { +// SysUser user = userMapper.selectUserById(record.getUserId()); +// record.setSysUser(user); // 鍋囪Archiverecordstouser涓湁setUser鏂规硶 +// } +// }); + // List<ArchiveRecords> beanRecords = list(lqw); + // log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", beanRecords); + // return markOwnData(familyId, fatherFaId, motherFaId, beanRecords); + HashMap<String, Object> data = MapUtils.getResult(pageResult, beanRecords); + + + return AjaxResult.success(data); } + + + + @Override + public DocumentMaterials selectDocumentMaterialsByMaterialId(String materialId) { + + + LambdaQueryWrapper<DocumentMaterials> lqw = new LambdaQueryWrapper<>(); + lqw.eq(materialId!=null, DocumentMaterials::getMaterialId, materialId); + List<DocumentMaterials> records = list(lqw); + if(!records.isEmpty()) + return records.get(0); + else + return null; + } + + @Override + public List<DocumentMaterials> selectDocumentMaterialsList(DocumentMaterials documentMaterials) { + LambdaQueryWrapper<DocumentMaterials> lambdaQueryWrapper = buildCondition(documentMaterials); + List<DocumentMaterials> beanRecords = list(lambdaQueryWrapper); + + return beanRecords; + } + + @Override + public int insertDocumentMaterials(DocumentMaterials documentMaterials) { + LocalDateTime time = LocalDateTime.now(); + + Date date = Date.from(time.atZone(ZoneId.systemDefault()).toInstant()); + documentMaterials.setCreatedAt(date); + boolean res = this.save(documentMaterials); + if(res) + return 1; + else + return 0; + } + + @Override + public int updateDocumentMaterials(DocumentMaterials documentMaterials) { + + boolean result = updateById(documentMaterials); + if(result) + return 1; + else + return 0; + } + + @Override + public int deleteDocumentMaterialsByMaterialIds(String[] materialIds) { + if (this.removeByIds(Arrays.asList(materialIds))) { + return 1; + } + else + return 0; + } + + @Override + public int deleteDocumentMaterialsByMaterialId(String materialId) { + return 0; + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveCategoryController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveCategoryController.java new file mode 100644 index 0000000..fe97bf5 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveCategoryController.java @@ -0,0 +1,122 @@ +package com.ruoyi.web.controller.archive; + + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.domain.ArchiveCategory; +import com.ruoyi.framework.web.domain.server.Sys; +import com.ruoyi.service.IArchiveCategoryService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; + +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM; +import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE; + +/** + * 銆愯濉啓鍔熻兘鍚嶇О銆慍ontroller + * + * @author ruoyi + * @date 2025-07-26 + */ +@RestController +@RequestMapping("/system/category") +public class ArchiveCategoryController extends BaseController +{ + @Autowired + private IArchiveCategoryService archiveCategoryService; + + /** + * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛� + */ + @PreAuthorize("@ss.hasPermi('system:category:list')") + @GetMapping("/list") + public AjaxResult list(ArchiveCategory archiveCategory) + { + Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); + Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); + return archiveCategoryService.selectDataList(archiveCategory, pageNum, pageSize); + + } + @PreAuthorize("@ss.hasPermi('system:category:list')") + @GetMapping("/listAll") + public AjaxResult getAllCategory() + { + ArchiveCategory archiveCategory = new ArchiveCategory(); + return success(archiveCategoryService.selectArchiveCategoryList(archiveCategory)); + } + /** + * 瀵煎嚭銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛� + */ + @PreAuthorize("@ss.hasPermi('system:category:export')") + @Log(title = "銆愯濉啓鍔熻兘鍚嶇О銆�", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ArchiveCategory archiveCategory) + { + List<ArchiveCategory> list = archiveCategoryService.selectArchiveCategoryList(archiveCategory); + + System.out.println(list); + ExcelUtil<ArchiveCategory> util = new ExcelUtil<ArchiveCategory>(ArchiveCategory.class); + util.exportExcel(response, list, "妗堝嵎绫诲埆淇℃伅"); + } + + /** + * 鑾峰彇銆愯濉啓鍔熻兘鍚嶇О銆戣缁嗕俊鎭� + */ + @PreAuthorize("@ss.hasPermi('system:category:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(archiveCategoryService.selectArchiveCategoryById(id)); + } + + /** + * 鏂板銆愯濉啓鍔熻兘鍚嶇О銆� + */ + @PreAuthorize("@ss.hasPermi('system:category:add')") + @Log(title = "銆愯濉啓鍔熻兘鍚嶇О銆�", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ArchiveCategory archiveCategory) + { + return toAjax(archiveCategoryService.insertArchiveCategory(archiveCategory)); + } + + /** + * 淇敼銆愯濉啓鍔熻兘鍚嶇О銆� + */ + @PreAuthorize("@ss.hasPermi('system:category:edit')") + @Log(title = "銆愯濉啓鍔熻兘鍚嶇О銆�", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ArchiveCategory archiveCategory) + { + return toAjax(archiveCategoryService.updateArchiveCategory(archiveCategory)); + } + + /** + * 鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆� + */ + @PreAuthorize("@ss.hasPermi('system:category:remove')") + @Log(title = "銆愯濉啓鍔熻兘鍚嶇О銆�", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(archiveCategoryService.deleteArchiveCategoryByIds(ids)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveRecordsController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveRecordsController.java index 9419131..79a8a12 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveRecordsController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveRecordsController.java @@ -54,7 +54,15 @@ return archiveRecordsService.selectDataList(archiveRecords, pageNum, pageSize); } - + /** + * 鎷垮埌鏈�澶d + */ + @PreAuthorize("@ss.hasPermi('system:records:list')") + @GetMapping("/getMaxId") + public AjaxResult getMaxId() + { + return success(archiveRecordsService.getMaxId()+1); + } /** * 瀵煎嚭妗f璁板綍鍒楄〃 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiverecordstouserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiverecordstouserController.java index e024e87..285a545 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiverecordstouserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiverecordstouserController.java @@ -3,6 +3,8 @@ import java.util.List; import javax.servlet.http.HttpServletResponse; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.utils.ServletUtils; import com.ruoyi.domain.Archiverecordstouser; import com.ruoyi.service.IArchiverecordstouserService; import org.springframework.security.access.prepost.PreAuthorize; @@ -23,6 +25,9 @@ import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; +import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM; +import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE; + /** * 銆愯濉啓鍔熻兘鍚嶇О銆慍ontroller * @@ -36,16 +41,25 @@ @Autowired private IArchiverecordstouserService archiverecordstouserService; + + @PreAuthorize("@ss.hasPermi('system:archiverecordstouser:edit')") + + @PutMapping("/authUserToArchive") + public AjaxResult selectRecordToUser(String recordId, Long[] userIds) + { + return toAjax(archiverecordstouserService.insertRecordToUsers(recordId, userIds)); + } /** * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛� */ @PreAuthorize("@ss.hasPermi('system:archiverecordstouser:list')") @GetMapping("/list") - public TableDataInfo list(Archiverecordstouser archiverecordstouser) + public AjaxResult list(Archiverecordstouser archiverecordstouser) { - startPage(); - List<Archiverecordstouser> list = archiverecordstouserService.selectArchiverecordstouserList(archiverecordstouser); - return getDataTable(list); + Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); + Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); + return archiverecordstouserService.selectDataList(archiverecordstouser, pageNum, pageSize); + } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/DocumentMaterialsController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/DocumentMaterialsController.java new file mode 100644 index 0000000..acd5ba6 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/DocumentMaterialsController.java @@ -0,0 +1,114 @@ +package com.ruoyi.web.controller.archive; + + + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.domain.DocumentMaterials; +import com.ruoyi.service.IDocumentMaterialsService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; + +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM; +import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE; + +/** + * 銆愯濉啓鍔熻兘鍚嶇О銆慍ontroller + * + * @author ruoyi + * @date 2025-07-28 + */ +@RestController +@RequestMapping("/system/materials") +public class DocumentMaterialsController extends BaseController +{ + @Autowired + private IDocumentMaterialsService documentMaterialsService; + + /** + * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛� + */ + @PreAuthorize("@ss.hasPermi('system:materials:list')") + @GetMapping("/list") + public AjaxResult list(DocumentMaterials documentMaterials) + { + + Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); + Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); + return documentMaterialsService.selectDataList(documentMaterials, pageNum, pageSize); + } + + /** + * 瀵煎嚭銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛� + */ + @PreAuthorize("@ss.hasPermi('system:materials:export')") + @Log(title = "銆愯濉啓鍔熻兘鍚嶇О銆�", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DocumentMaterials documentMaterials) + { + List<DocumentMaterials> list = documentMaterialsService.selectDocumentMaterialsList(documentMaterials); + ExcelUtil<DocumentMaterials> util = new ExcelUtil<DocumentMaterials>(DocumentMaterials.class); + util.exportExcel(response, list, "銆愯濉啓鍔熻兘鍚嶇О銆戞暟鎹�"); + } + + /** + * 鑾峰彇銆愯濉啓鍔熻兘鍚嶇О銆戣缁嗕俊鎭� + */ + @PreAuthorize("@ss.hasPermi('system:materials:query')") + @GetMapping(value = "/{materialId}") + public AjaxResult getInfo(@PathVariable("materialId") String materialId) + { + return success(documentMaterialsService.selectDocumentMaterialsByMaterialId(materialId)); + } + + /** + * 鏂板銆愯濉啓鍔熻兘鍚嶇О銆� + */ + @PreAuthorize("@ss.hasPermi('system:materials:add')") + @Log(title = "銆愯濉啓鍔熻兘鍚嶇О銆�", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DocumentMaterials documentMaterials) + { + return toAjax(documentMaterialsService.insertDocumentMaterials(documentMaterials)); + } + + /** + * 淇敼銆愯濉啓鍔熻兘鍚嶇О銆� + */ + @PreAuthorize("@ss.hasPermi('system:materials:edit')") + @Log(title = "銆愯濉啓鍔熻兘鍚嶇О銆�", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DocumentMaterials documentMaterials) + { + return toAjax(documentMaterialsService.updateDocumentMaterials(documentMaterials)); + } + + /** + * 鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆� + */ + @PreAuthorize("@ss.hasPermi('system:materials:remove')") + @Log(title = "銆愯濉啓鍔熻兘鍚嶇О銆�", businessType = BusinessType.DELETE) + @DeleteMapping("/{materialIds}") + public AjaxResult remove(@PathVariable String[] materialIds) + { + return toAjax(documentMaterialsService.deleteDocumentMaterialsByMaterialIds(materialIds)); + } +} -- Gitblit v1.9.1