From e3c4fe0ba422d74455128b62a8e30ce7e796775e Mon Sep 17 00:00:00 2001 From: xia Date: Fri, 27 May 2022 12:12:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=A1=A3=E6=A1=88=E6=B1=87?= =?UTF-8?q?=E6=80=BB=E8=A1=A8=20=E6=9B=B4=E6=96=B0=E8=A1=A8=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ArchivesController.java | 29 ++++ .../archives/domain/ArchivesSummary.java | 124 ++++++++++++++++++ .../repository/ArchivesSummaryRepository.java | 13 ++ .../archives/service/ArchivesService.java | 5 + .../service/impl/ArchivesServiceImpl.java | 30 +++++ .../modules/dictionary/domain/Field.java | 2 +- .../repository/FieldRepository.java | 4 +- 7 files changed, 204 insertions(+), 3 deletions(-) create mode 100644 archives/src/main/java/com/storeroom/modules/archives/controller/ArchivesController.java create mode 100644 archives/src/main/java/com/storeroom/modules/archives/domain/ArchivesSummary.java create mode 100644 archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesSummaryRepository.java create mode 100644 archives/src/main/java/com/storeroom/modules/archives/service/ArchivesService.java create mode 100644 archives/src/main/java/com/storeroom/modules/archives/service/impl/ArchivesServiceImpl.java diff --git a/archives/src/main/java/com/storeroom/modules/archives/controller/ArchivesController.java b/archives/src/main/java/com/storeroom/modules/archives/controller/ArchivesController.java new file mode 100644 index 0000000..8d40975 --- /dev/null +++ b/archives/src/main/java/com/storeroom/modules/archives/controller/ArchivesController.java @@ -0,0 +1,29 @@ +package com.storeroom.modules.archives.controller; + +import com.storeroom.modules.archives.service.ArchivesService; +import com.storeroom.utils.ApiResponse; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.data.domain.Pageable; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +@Api(tags = "档案管理") +@RequestMapping("/api/archives") +public class ArchivesController { + + private final ArchivesService archivesService; + + @ApiOperation("测试档案") + @GetMapping("/test") + public ApiResponse test( + ){ + archivesService.test(); + return ApiResponse.success(null); + } + +} diff --git a/archives/src/main/java/com/storeroom/modules/archives/domain/ArchivesSummary.java b/archives/src/main/java/com/storeroom/modules/archives/domain/ArchivesSummary.java new file mode 100644 index 0000000..e91340f --- /dev/null +++ b/archives/src/main/java/com/storeroom/modules/archives/domain/ArchivesSummary.java @@ -0,0 +1,124 @@ +package com.storeroom.modules.archives.domain; + +import com.storeroom.base.BaseEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Getter; +import lombok.Setter; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import java.io.Serializable; + +@Entity +@Getter +@Setter +@Table(name = "archives_summary") +public class ArchivesSummary extends BaseEntity implements Serializable { + + @Id + @Column(name = "archives_id") + private String archivesId; + + @Column(name = "archive_no") + @ApiModelProperty(value = "档号") + private String archiveNo; + + @Column(name = "archive_ctg_no") + @ApiModelProperty(value = "分类号") + private String archiveCtgNo; + + @Column(name = "fonds_no") + @ApiModelProperty(value = "全宗号") + private String fondsNo; + + @Column(name = "item_no") + @ApiModelProperty(value = "项目号") + private String itemNo; + + @Column(name = "record_no") + @ApiModelProperty(value = "案卷号") + private String recordNo; + + @Column(name = "maintitle") + @ApiModelProperty(value = "名称") + private String maintitle; + + @Column(name = "security_class") + @ApiModelProperty(value = "密级") + private String securityClass; + + @Column(name = "retention") + @ApiModelProperty(value = "保管期限") + private String retention; + + @Column(name = "archive_year") + @ApiModelProperty(value = "归档年度") + private Integer archiveYear; + + @Column(name = "responsibleby") + @ApiModelProperty(value = "责任人") + private String responsibleby; + + @Column(name = "department") + @ApiModelProperty(value = "部门名称") + private String department; + + @Column(name = "filing_person") + @ApiModelProperty(value = "立卷人") + private String filingPerson; + + @Column(name = "filing_date") + @ApiModelProperty(value = "立卷日期") + private String filingDate; + + @Column(name = "archive_person") + @ApiModelProperty(value = "归档人") + private String archivePerson; + + @Column(name = "archive_date") + @ApiModelProperty(value = "归档日期") + private String archiveDate; + + @Column(name = "category_id") + @ApiModelProperty(value = "门类id") + private String categoryId; + + @Column(name = "category_name") + @ApiModelProperty(value = "门类名称") + private String categoryName; + + @Column(name = "category_type") + @ApiModelProperty(value = "门类级别") + private Integer categoryType; + + @Column(name = "archives_table_name") + @ApiModelProperty(value = "档案表名") + private String archivesTableName; + + @Column(name = "case_no") + @ApiModelProperty(value = "档案盒id") + private String caseNo; + + @Column(name = "case_name") + @ApiModelProperty(value = "档案盒名称") + private String caseName; + + @Column(name = "folder_location") + @ApiModelProperty(value = "存放位置") + private String folderLocation; + + @Column(name = "folder_location_details") + @ApiModelProperty(value = "存放具体位置") + private String folderLocationDetails; + + @Column(name = "tag_no") + @ApiModelProperty(value = "标签号") + private String tagNo; + + @Column(name = "child") + @ApiModelProperty(value = "子条目数") + private Integer child; + +} diff --git a/archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesSummaryRepository.java b/archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesSummaryRepository.java new file mode 100644 index 0000000..8324144 --- /dev/null +++ b/archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesSummaryRepository.java @@ -0,0 +1,13 @@ +package com.storeroom.modules.archives.repository; + +import com.storeroom.modules.archives.domain.ArchivesSummary; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; + +import java.util.List; +import java.util.Map; + +public interface ArchivesSummaryRepository extends JpaRepository{ + + +} diff --git a/archives/src/main/java/com/storeroom/modules/archives/service/ArchivesService.java b/archives/src/main/java/com/storeroom/modules/archives/service/ArchivesService.java new file mode 100644 index 0000000..fa7fbfb --- /dev/null +++ b/archives/src/main/java/com/storeroom/modules/archives/service/ArchivesService.java @@ -0,0 +1,5 @@ +package com.storeroom.modules.archives.service; + +public interface ArchivesService { + String test(); +} diff --git a/archives/src/main/java/com/storeroom/modules/archives/service/impl/ArchivesServiceImpl.java b/archives/src/main/java/com/storeroom/modules/archives/service/impl/ArchivesServiceImpl.java new file mode 100644 index 0000000..4b8b439 --- /dev/null +++ b/archives/src/main/java/com/storeroom/modules/archives/service/impl/ArchivesServiceImpl.java @@ -0,0 +1,30 @@ +package com.storeroom.modules.archives.service.impl; + +import com.storeroom.modules.archives.repository.ArchivesSummaryRepository; +import com.storeroom.modules.archives.service.ArchivesService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import java.util.List; +import java.util.Map; + +@Service +@RequiredArgsConstructor +public class ArchivesServiceImpl implements ArchivesService { + + private final ArchivesSummaryRepository archivesSummaryRepository; + + @PersistenceContext + EntityManager entityManager; + + @Override + public String test() { + + String testQuery = "dic_name,dic_code"; + String testTable = "archives_dictionary_config"; + List list = entityManager.createNativeQuery("select "+testQuery+" from "+testTable).getResultList(); + return null; + } +} diff --git a/archives/src/main/java/com/storeroom/modules/dictionary/domain/Field.java b/archives/src/main/java/com/storeroom/modules/dictionary/domain/Field.java index 13649fe..3908eca 100644 --- a/archives/src/main/java/com/storeroom/modules/dictionary/domain/Field.java +++ b/archives/src/main/java/com/storeroom/modules/dictionary/domain/Field.java @@ -12,7 +12,7 @@ import java.io.Serializable; @Entity @Getter @Setter -@Table(name="sys_field") +@Table(name="archives_field") public class Field extends BaseEntity implements Serializable { @Id diff --git a/archives/src/main/java/com/storeroom/modules/dictionary/repository/FieldRepository.java b/archives/src/main/java/com/storeroom/modules/dictionary/repository/FieldRepository.java index 42c2d6c..5841bb8 100644 --- a/archives/src/main/java/com/storeroom/modules/dictionary/repository/FieldRepository.java +++ b/archives/src/main/java/com/storeroom/modules/dictionary/repository/FieldRepository.java @@ -13,14 +13,14 @@ import java.util.Map; public interface FieldRepository extends JpaRepository{ - @Query(nativeQuery = true,value = "select id from sys_field where field_name = ?1 limit 0,1 ") + @Query(nativeQuery = true,value = "select id from archives_field where field_name = ?1 limit 0,1 ") String findIdFirstByFieldName(String fieldName); @Query("from Field where isType = ?1 order by isSequence asc ") List findAllByIsType(Integer isType); @Query(nativeQuery = true, - value = "select max(is_sequence) from sys_field where is_type = ?1 ") + value = "select max(is_sequence) from archives_field where is_type = ?1 ") Integer getMaxSequence(Integer isType); }