From 27b6cb41cf35dcc0332d3ba5a00af1f35f8333cd Mon Sep 17 00:00:00 2001 From: xia Date: Mon, 4 Jul 2022 14:13:08 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=9B=B4=E6=96=B0=E4=BC=98=E5=8C=96=E6=A1=A3?= =?UTF-8?q?=E6=A1=88=E6=A8=A1=E5=9D=97=202.=E6=9B=B4=E6=96=B0=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=A1=A3=E6=A1=88=E7=9B=92=E6=A8=A1=E5=9D=97=203.?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BC=98=E5=8C=96=E6=A0=87=E7=AD=BE=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=204.=E6=96=B0=E5=A2=9E=E6=A0=87=E7=AD=BE=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ArchivesController.java | 25 ++- .../archives/controller/CaseController.java | 62 +++---- .../archives/controller/TagController.java | 39 ++++- .../domain/ArchivesCaseCartoning.java | 10 +- .../archives/domain/ArchivesTagLog.java | 38 +++++ .../archives/domain/vo/ArchivesSummaryVO.java | 71 ++++++++ .../ArchivesCaseCartoningRepository.java | 5 + .../repository/ArchivesCaseRepository.java | 16 +- .../repository/ArchivesSummaryRepository.java | 11 ++ .../repository/ArchivesTagLogRepository.java | 19 +++ .../repository/ArchivesTagRepository.java | 8 +- .../archives/service/ArchivesCaseService.java | 4 +- .../archives/service/ArchivesService.java | 4 +- .../archives/service/ArchivesTagService.java | 13 +- .../service/impl/ArchivesCaseServiceImpl.java | 155 +++++++++++------- .../service/impl/ArchivesServiceImpl.java | 24 ++- .../service/impl/ArchivesTagServiceImpl.java | 154 ++++++++++++++++- system/src/main/resources/application.yml | 3 + 18 files changed, 524 insertions(+), 137 deletions(-) create mode 100644 archives/src/main/java/com/storeroom/modules/archives/domain/ArchivesTagLog.java create mode 100644 archives/src/main/java/com/storeroom/modules/archives/domain/vo/ArchivesSummaryVO.java create mode 100644 archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesTagLogRepository.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 index b113397..72ef465 100644 --- a/archives/src/main/java/com/storeroom/modules/archives/controller/ArchivesController.java +++ b/archives/src/main/java/com/storeroom/modules/archives/controller/ArchivesController.java @@ -44,7 +44,7 @@ public class ArchivesController { private final ArchivesService archivesService; private final ArchivesTypeService archivesTypeService; - @ApiOperation("档案列表") + @ApiOperation("档案列表列") @GetMapping("/initArchivesViewTable") public ApiResponse initArchivesViewTable( String categoryId @@ -55,13 +55,20 @@ public class ArchivesController { @ApiOperation("档案列表") @GetMapping("/initArchivesView") public ApiResponse initArchivesView( - String categoryId,String parentsId,String query,Integer archivesState,String archiveYear,String department, + String categoryId,String parentsId,Integer queryType,String queryTitle,String archiveNo,Integer archivesState,String archiveYear,String department, String retention,String securityClass,String organizationMatter,boolean isdel,Pageable page ){ - return ApiResponse.success(archivesService.initArchivesView(categoryId,parentsId,query,archivesState, + return ApiResponse.success(archivesService.initArchivesView(categoryId,parentsId,queryType,queryTitle,archiveNo,archivesState, archiveYear,department,retention,securityClass,organizationMatter,isdel,page)); } + @ApiOperation("档案列表外放接口") +// @GetMapping("/getArchivesRelease") + @AnonymousGetMapping("/getArchivesRelease") + public ApiResponse getArchivesRelease(Pageable page){ + return ApiResponse.success(archivesService.getArchivesRelease(page)); + } + @ApiOperation("档案详情") @GetMapping("/archivesDetails") public ApiResponse archivesDetails( @@ -118,7 +125,7 @@ public class ArchivesController { return ApiResponse.success(archivesService.editFile(dto)); } - @ApiOperation("删除档案附件") + @ApiOperation("档案附件排序") @PostMapping("/fileSort") public ApiResponse fileSort( @Validated @RequestBody ArchivesFileDTO dto @@ -135,7 +142,7 @@ public class ArchivesController { } @ApiOperation("档案删除") - @PostMapping("/delete") + @PostMapping("/delete") public ApiResponse delete( @Validated @RequestBody ArchivesDTO dto ){ @@ -233,12 +240,4 @@ public class ArchivesController { return ApiResponse.success("/"+path); } - @ApiOperation("标签管理") - @GetMapping("/initTagView") - public ApiResponse initTagView( - String query,Integer tagType,Pageable page - ){ - return ApiResponse.success(null); - } - } diff --git a/archives/src/main/java/com/storeroom/modules/archives/controller/CaseController.java b/archives/src/main/java/com/storeroom/modules/archives/controller/CaseController.java index d67755e..408c285 100644 --- a/archives/src/main/java/com/storeroom/modules/archives/controller/CaseController.java +++ b/archives/src/main/java/com/storeroom/modules/archives/controller/CaseController.java @@ -54,28 +54,28 @@ public class CaseController { return ApiResponse.success(caseService.edit(dto)); } - @ApiOperation("绑定标签") - @PostMapping("/bingdingLabel") - public ApiResponse bingdingLabel( - @Validated @RequestBody CaseDTO dto - ){ - String binding = caseService.findIsBingdingLabel(dto.getTid()); - String[] bindings = binding.split(","); - boolean coverLabel = null == dto.getCoverLabel() ? false : dto.getCoverLabel(); - if("0".equals(bindings[1]) || coverLabel){ - return ApiResponse.success(caseService.addCaseTag(dto.getId(),dto.getTid(),dto.getLabelType(),bindings[1],bindings[0])); - }else{ - return ApiResponse.success(ResponseStatus.LABEL_BOUND.getMessage()); - } - } - - @ApiOperation("解绑标签") - @PostMapping("/unbindTag") - public ApiResponse unbindTag( - @Validated @RequestBody CaseDTO dto - ){ - return ApiResponse.success(caseService.unbindTag(dto.getTid(),dto.getLabelType())); - } +// @ApiOperation("绑定标签") +// @PostMapping("/bingdingLabel") +// public ApiResponse bingdingLabel( +// @Validated @RequestBody CaseDTO dto +// ){ +// String binding = caseService.findIsBingdingLabel(dto.getTid()); +// String[] bindings = binding.split(","); +// boolean coverLabel = null == dto.getCoverLabel() ? false : dto.getCoverLabel(); +// if("0".equals(bindings[1]) || coverLabel){ +// return ApiResponse.success(caseService.addCaseTag(dto.getId(),dto.getTid(),dto.getLabelType(),bindings[1],bindings[0])); +// }else{ +// return ApiResponse.success(ResponseStatus.LABEL_BOUND.getMessage()); +// } +// } +// +// @ApiOperation("解绑标签") +// @PostMapping("/unbindTag") +// public ApiResponse unbindTag( +// @Validated @RequestBody CaseDTO dto +// ){ +// return ApiResponse.success(caseService.unbindTag(dto.getTid(),dto.getLabelType())); +// } @ApiOperation("档案盒装盒列表") @GetMapping("/initCartoningList") @@ -93,20 +93,20 @@ public class CaseController { return ApiResponse.success(caseService.cartoning(dtos)); } - @ApiOperation("预备拆盒") - @GetMapping("/doUnpacking") - public ApiResponse doUnpacking( - String caseId - ){ - return ApiResponse.success(caseService.doUnpacking(caseId)); - } +// @ApiOperation("预备拆盒") +// @GetMapping("/doUnpacking") +// public ApiResponse doUnpacking( +// String caseId +// ){ +// return ApiResponse.success(caseService.doUnpacking(caseId)); +// } @ApiOperation("拆盒") @PostMapping("/unpacking") public ApiResponse unpacking( - @Validated @RequestBody List dtos + @Validated @RequestBody String caseId ){ - return ApiResponse.success(caseService.cartoning(dtos)); + return ApiResponse.success(caseService.unpacking(caseId)); } @ApiOperation("查看盒内详情") diff --git a/archives/src/main/java/com/storeroom/modules/archives/controller/TagController.java b/archives/src/main/java/com/storeroom/modules/archives/controller/TagController.java index aff7ef5..6adc748 100644 --- a/archives/src/main/java/com/storeroom/modules/archives/controller/TagController.java +++ b/archives/src/main/java/com/storeroom/modules/archives/controller/TagController.java @@ -1,14 +1,17 @@ package com.storeroom.modules.archives.controller; import com.storeroom.modules.archives.service.ArchivesTagService; +import com.storeroom.modules.archives.service.dto.CaseDTO; import com.storeroom.utils.ApiResponse; +import com.storeroom.utils.enums.ResponseStatus; 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; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; @RestController @RequiredArgsConstructor @@ -26,4 +29,34 @@ public class TagController { return ApiResponse.success(archivesTagService.initTagList(tid,query,isType,page)); } + @ApiOperation("绑定标签") + @PostMapping("/bingdingLabel") + public ApiResponse bingdingLabel( + @Validated @RequestBody CaseDTO dto + ){ + Integer tagType = archivesTagService.findIsBingdingLabel(dto.getTid()); + boolean coverLabel = null == dto.getCoverLabel() ? false : dto.getCoverLabel(); + if(0 == tagType || coverLabel){ + return ApiResponse.success(archivesTagService.addTag(dto.getId(),dto.getTid(),dto.getLabelType(),tagType)); + }else{ + return ApiResponse.success(ResponseStatus.LABEL_BOUND.getMessage()); + } + } + + @ApiOperation("解绑标签") + @PostMapping("/unbindTag") + public ApiResponse unbindTag( + @Validated @RequestBody List dtos + ){ + return ApiResponse.success(archivesTagService.unbindTag(dtos)); + } + + @ApiOperation("标签使用列表") + @GetMapping("/initTagLogList") + public ApiResponse initTagLogList( + String tid, String title,Integer operType,Integer bindingType, Pageable page + ){ + return ApiResponse.success(archivesTagService.initTagLogList(tid,title,operType,bindingType,page)); + } + } diff --git a/archives/src/main/java/com/storeroom/modules/archives/domain/ArchivesCaseCartoning.java b/archives/src/main/java/com/storeroom/modules/archives/domain/ArchivesCaseCartoning.java index 1060d8f..e0a109d 100644 --- a/archives/src/main/java/com/storeroom/modules/archives/domain/ArchivesCaseCartoning.java +++ b/archives/src/main/java/com/storeroom/modules/archives/domain/ArchivesCaseCartoning.java @@ -4,11 +4,9 @@ import com.storeroom.base.BaseEntity; import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; +import org.hibernate.annotations.GenericGenerator; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; +import javax.persistence.*; import javax.validation.constraints.NotNull; import java.io.Serializable; @@ -20,8 +18,8 @@ public class ArchivesCaseCartoning extends BaseEntity implements Serializable { @Id @Column(name = "id") - @NotNull(groups = BaseEntity.Update.class) - @ApiModelProperty(value = "ID", hidden = true) + @GeneratedValue(generator = "idGenerator") + @GenericGenerator(name = "idGenerator", strategy = "uuid") private String id; @ApiModelProperty(value = "档案id") diff --git a/archives/src/main/java/com/storeroom/modules/archives/domain/ArchivesTagLog.java b/archives/src/main/java/com/storeroom/modules/archives/domain/ArchivesTagLog.java new file mode 100644 index 0000000..ada0fa5 --- /dev/null +++ b/archives/src/main/java/com/storeroom/modules/archives/domain/ArchivesTagLog.java @@ -0,0 +1,38 @@ +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.*; +import java.io.Serializable; + +@Entity +@Getter +@Setter +@Table(name = "archives_tag_log") +public class ArchivesTagLog extends BaseEntity implements Serializable { + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "ID_SEQ") + @Column(name="id") + private Integer id; + + @Column(name = "tid") + @ApiModelProperty(value = "标签id") + private String tid; + + @Column(name = "oper_type") + @ApiModelProperty(value = "操作类型 1.绑定 2.解绑") + private Integer operType; + + @Column(name = "binding_type") + @ApiModelProperty(value = "绑定类别 1.档案 2.档案盒 3.层架位") + private Integer bindingType; + + @Column(name = "title") + @ApiModelProperty(value = "标签标题") + private String title; + +} diff --git a/archives/src/main/java/com/storeroom/modules/archives/domain/vo/ArchivesSummaryVO.java b/archives/src/main/java/com/storeroom/modules/archives/domain/vo/ArchivesSummaryVO.java new file mode 100644 index 0000000..e26894b --- /dev/null +++ b/archives/src/main/java/com/storeroom/modules/archives/domain/vo/ArchivesSummaryVO.java @@ -0,0 +1,71 @@ +package com.storeroom.modules.archives.domain.vo; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.Setter; + +import java.sql.Timestamp; + +@Getter +@Setter +public class ArchivesSummaryVO { + + @JSONField(name="archivesId") + @JsonProperty("archives_id") + private String archivesId; + + @JSONField(name="categoryId") + @JsonProperty("category_id") + private String categoryId; + + @JSONField(name="categoryName") + @JsonProperty("category_name") + private String categoryName; + + @JSONField(name="categoryType") + @JsonProperty("category_type") + private Integer categoryType; + + @JSONField(name="tid") + @JsonProperty("tid") + private String tid; + + @JSONField(name="fondsNo") + @JsonProperty("fonds_no") + private String fondsNo; + + @JSONField(name="archiveNo") + @JsonProperty("archive_no") + private String archiveNo; + + @JSONField(name="department") + @JsonProperty("department") + private String department; + + @JSONField(name="archiveYear") + @JsonProperty("archive_year") + private Integer archiveYear; + + @JSONField(name="maintitle") + @JsonProperty("maintitle") + private String maintitle; + + @JSONField(name="retention") + @JsonProperty("retention") + private String retention; + + @JSONField(name="securityClass") + @JsonProperty("security_class") + private String securityClass; + +// @JSONField(name="createTime") +// @JsonProperty("create_time") +// private Timestamp create_time; +// +// @JSONField(name="updateTime") +// @JsonProperty("update_time") +// private Timestamp update_time; + + +} diff --git a/archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesCaseCartoningRepository.java b/archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesCaseCartoningRepository.java index 2ba5652..0601912 100644 --- a/archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesCaseCartoningRepository.java +++ b/archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesCaseCartoningRepository.java @@ -5,6 +5,7 @@ import com.storeroom.modules.archives.domain.ArchivesCaseCartoning; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import java.util.List; @@ -13,4 +14,8 @@ public interface ArchivesCaseCartoningRepository extends JpaRepository findAllByCaseId(String caseId); + @Modifying + @Query("delete from ArchivesCaseCartoning where caseId in ?1 ") + void deleteByCaseId(List caseIds); + } diff --git a/archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesCaseRepository.java b/archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesCaseRepository.java index 2367f82..eafc3be 100644 --- a/archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesCaseRepository.java +++ b/archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesCaseRepository.java @@ -12,12 +12,16 @@ import java.util.List; public interface ArchivesCaseRepository extends JpaRepository{ - @Query(countQuery = "select count(id) from ArchivesCase where caseName like concat('%',?1,'%') and tid like concat('%',?2,'%') and barcode like concat('%',?3,'%') ", - value = "from ArchivesCase where caseName like concat('%',?1,'%') and tid like concat('%',?2,'%') and barcode like concat('%',?3,'%')") - Page findAllByCaseNameLikeAndTidLikeAndBarcodeLike(String caseName, String tid,String barcode, Pageable page); + @Query(nativeQuery = true, + value = "select * from archives_case where if(?1 is null,1=1,case_name like ?1) and " + + "if(?2 is null,1=1,tid like ?2) and if(?3 is null,1=1,barcode like ?3) ") + Page initCaseList(String caseName, String tid,String barcode, Pageable page); - @Query(countQuery = "select count(id) from ArchivesCase where caseType in (0,?4) and caseName like concat('%',?1,'%') and tid like concat('%',?2,'%') and barcode like concat('%',?3,'%')", - value = "from ArchivesCase where caseType in (0,?4) and caseName like concat('%',?1,'%') and tid like concat('%',?2,'%') and barcode like concat('%',?3,'%')") + @Query(nativeQuery = true, + value = "select * from archives_case where case_type in (0,?4) and " + + "if(?1 is null,1=1,case_name like ?1) and " + + "if(?2 is null,1=1,tid like ?2) and " + + "if(?3 is null,1=1,barcode like ?3) ") Page initCartoningList(String caseName, String tid,String barcode,Integer caseType, Pageable page); Integer countAllByTid(String tid); @@ -26,7 +30,7 @@ public interface ArchivesCaseRepository extends JpaRepository findCaseName(List caseIds); @Modifying - @Query(value = "update ArchivesCase set tid = '' where tid = ?1") + @Query(value = "update ArchivesCase set tid = null where tid = ?1") void unbindTag(String tid); @Modifying 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 index 32d1e93..cc092cc 100644 --- a/archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesSummaryRepository.java +++ b/archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesSummaryRepository.java @@ -1,6 +1,9 @@ package com.storeroom.modules.archives.repository; import com.storeroom.modules.archives.domain.ArchivesSummary; +import com.storeroom.modules.archives.domain.vo.ArchivesSummaryVO; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; @@ -13,6 +16,14 @@ public interface ArchivesSummaryRepository extends JpaRepository> getArchivesRelease(Pageable page); + @Modifying @Transactional(rollbackFor = Exception.class) @Query(nativeQuery = true, diff --git a/archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesTagLogRepository.java b/archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesTagLogRepository.java new file mode 100644 index 0000000..9ddaecc --- /dev/null +++ b/archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesTagLogRepository.java @@ -0,0 +1,19 @@ +package com.storeroom.modules.archives.repository; + +import com.storeroom.modules.archives.domain.ArchivesTagLog; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; + +public interface ArchivesTagLogRepository extends JpaRepository{ + + @Query(nativeQuery = true, + value = "select * from archives_tag_log where if(?1 is null,1=1,tid like ?1) " + + "and if(?2 is null,1=1,title like ?2) " + + "and if(?3 is null,1=1,oper_type = ?3) " + + "and if(?4 is null,1=1,binding_type = ?4) ") + Page initTagLogList(String tid, String title, Integer operType, Integer bindingType, Pageable page); + +} diff --git a/archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesTagRepository.java b/archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesTagRepository.java index 0f76ecf..5f4b7e1 100644 --- a/archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesTagRepository.java +++ b/archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesTagRepository.java @@ -13,8 +13,12 @@ import java.util.List; public interface ArchivesTagRepository extends JpaRepository{ @Query(nativeQuery = true, - value = "select * from archives_tag where if(?1 is null,1=1,tid like ?1) and if(?2 is null,1=1,title like ?2) and if(?3 is null,1=1,is_type = ?3)") -// @Query("") + value = "select * from archives_tag where title is not null and " + + "if(?1 is null,1=1,tid like ?1) and if(?2 is null,1=1,title like ?2) and if(?3 is null,1=1,is_type = ?3)") Page initTagList(String tid, String query,Integer isType, Pageable page); + @Modifying + @Query("update ArchivesTag set parentsId = null,isType = 0,title = null where tid = ?1") + void unbindTag(String tid); + } diff --git a/archives/src/main/java/com/storeroom/modules/archives/service/ArchivesCaseService.java b/archives/src/main/java/com/storeroom/modules/archives/service/ArchivesCaseService.java index e71a0e3..1ec515f 100644 --- a/archives/src/main/java/com/storeroom/modules/archives/service/ArchivesCaseService.java +++ b/archives/src/main/java/com/storeroom/modules/archives/service/ArchivesCaseService.java @@ -27,9 +27,9 @@ public interface ArchivesCaseService { //装盒 Object cartoning(List dtos); //预拆盒 - Object doUnpacking(String caseId); +// Object doUnpacking(String caseId); //拆盒 - Object unpacking(List dtos); + Object unpacking(String caseId); //查看盒内详情 Object findInCase(String caseId); 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 index 18489f0..9394e3f 100644 --- a/archives/src/main/java/com/storeroom/modules/archives/service/ArchivesService.java +++ b/archives/src/main/java/com/storeroom/modules/archives/service/ArchivesService.java @@ -12,8 +12,10 @@ public interface ArchivesService { //初始化档案列表标题 Object initArchivesViewTable(String categoryId); //初始化档案列表 - Object initArchivesView(String categoryId,String parentsId, String query,Integer archivesState,String archiveYear,String department, + Object initArchivesView(String categoryId,String parentsId,Integer queryType, String queryTitle,String archiveNo,Integer archivesState,String archiveYear,String department, String retention,String securityClass,String organizationMatter, boolean isdel,Pageable page); + //档案列表外放接口 + Object getArchivesRelease(Pageable page); //根据门类id 档案id 获取显示档案详情信息 List archiveDetails(String categoryId,String archivesId); //根据门类id 档案id 获取元数据 diff --git a/archives/src/main/java/com/storeroom/modules/archives/service/ArchivesTagService.java b/archives/src/main/java/com/storeroom/modules/archives/service/ArchivesTagService.java index fc7d330..724edc3 100644 --- a/archives/src/main/java/com/storeroom/modules/archives/service/ArchivesTagService.java +++ b/archives/src/main/java/com/storeroom/modules/archives/service/ArchivesTagService.java @@ -1,10 +1,21 @@ package com.storeroom.modules.archives.service; +import com.storeroom.modules.archives.service.dto.CaseDTO; import org.springframework.data.domain.Pageable; -public interface ArchivesTagService { +import java.util.List; +public interface ArchivesTagService { + //初始化标签列表 Object initTagList(String tid, String query,Integer isType, Pageable page); + //初始化标签日志列表 + Object initTagLogList(String tid, String title,Integer operType,Integer bindingType, Pageable page); + //查看标签是否绑定 + Integer findIsBingdingLabel(String label); + //绑定标签 + Object addTag(String caseId,String tid,Integer labelType,Integer tagType); + //解绑标签 + Object unbindTag(List dtos); } diff --git a/archives/src/main/java/com/storeroom/modules/archives/service/impl/ArchivesCaseServiceImpl.java b/archives/src/main/java/com/storeroom/modules/archives/service/impl/ArchivesCaseServiceImpl.java index f0ac1a3..8fc48a4 100644 --- a/archives/src/main/java/com/storeroom/modules/archives/service/impl/ArchivesCaseServiceImpl.java +++ b/archives/src/main/java/com/storeroom/modules/archives/service/impl/ArchivesCaseServiceImpl.java @@ -43,10 +43,10 @@ public class ArchivesCaseServiceImpl implements ArchivesCaseService { @Override public Object initCaseList(String tid, String caseName,String barcode, Pageable page) { - tid = StringUtils.isEmpty(tid) ? "" : tid; - caseName = StringUtils.isEmpty(caseName) ? "" : caseName; - barcode = StringUtils.isEmpty(barcode) ? "" : barcode; - Page pageCase = caseRepository.findAllByCaseNameLikeAndTidLikeAndBarcodeLike(caseName,tid,barcode,page); + tid = StringUtils.isEmpty(tid) ? null : "%"+ tid +"%"; + caseName = StringUtils.isEmpty(caseName) ? null : "%"+ caseName +"%"; + barcode = StringUtils.isEmpty(barcode) ? null : "%"+ barcode +"%"; + Page pageCase = caseRepository.initCaseList(caseName,tid,barcode,page); return PageUtil.toPage(pageCase); } @@ -97,10 +97,6 @@ public class ArchivesCaseServiceImpl implements ArchivesCaseService { archivesCase.setId(NanoIdUtils.randomNanoId()); archivesCase.setCaseType(0); archivesCase.setDepositNum(0); - archivesCase.setTid(""); - archivesCase.setBarcode(""); - archivesCase.setFolderLocation(""); - archivesCase.setFolderLocationDetails(""); } archivesCase.setCaseName(dto.getCaseName()); archivesCase.setBarcode(dto.getBarcode()); @@ -185,9 +181,9 @@ public class ArchivesCaseServiceImpl implements ArchivesCaseService { @Override public Object initCartoningList(String tid, String caseName, String barcode, Integer caseType, Pageable page) { - tid = StringUtils.isEmpty(tid) ? "" : tid; - caseName = StringUtils.isEmpty(caseName) ? "" : caseName; - barcode = StringUtils.isEmpty(barcode) ? "" : barcode; + tid = StringUtils.isEmpty(tid) ? null : "%"+ tid +"%"; + caseName = StringUtils.isEmpty(caseName) ? null : "%"+ caseName +"%"; + barcode = StringUtils.isEmpty(barcode) ? null : "%"+ barcode +"%"; Page pageCase = caseRepository.initCartoningList(caseName,tid,barcode,caseType,page); return PageUtil.toPage(pageCase); } @@ -201,7 +197,7 @@ public class ArchivesCaseServiceImpl implements ArchivesCaseService { ArchivesCaseCartoning Cartoning = new ArchivesCaseCartoning(); caseIds.add(archivesCaseCartoning.getCaseId()); caseNames.add(archivesCaseCartoning.getCaseName()); - BeanUtils.copyProperties(Cartoning,archivesCaseCartoning); + BeanUtils.copyProperties(archivesCaseCartoning,Cartoning); return Cartoning; }).collect(Collectors.toList()); archivesCaseCartonings = archivesCaseCartoningRepository.saveAllAndFlush(archivesCaseCartonings); @@ -234,76 +230,111 @@ public class ArchivesCaseServiceImpl implements ArchivesCaseService { entityManager.createNativeQuery(psql).executeUpdate(); archivesSummaryRepository.cartoning(dtos.get(0).getArchivesParentsId(),caseIdArr,caseNames.stream().collect(Collectors.joining(","))); } - return null; + return archivesCaseCartonings.size(); } +// @Override +// public Object doUnpacking(String caseId) { +// ArchivesCase archivesCase = caseRepository.findById(caseId).get(); +// List returnList = new ArrayList(); +// //文件类型档案盒 +// if(archivesCase.getCaseType()==1){ +// ArchivesCaseVO vo = new ArchivesCaseVO(); +// BeanUtils.copyProperties(vo,archivesCase); +// List archivesSummaries = archivesSummaryRepository.findAllByCaseNoAndCategoryType(caseId, ArchivesTypeEnum.files.getCode()); +// vo.setArchives(archivesSummaries); +// returnList.add(vo); +// //案卷类型盒 +// }else if(archivesCase.getCaseType()==2){ +// List archivesSummaries = archivesSummaryRepository.findAllByCaseNoAndCategoryType(caseId,ArchivesTypeEnum.inChive.getCode()); +// Set caseIds = new HashSet<>(); +// for(ArchivesSummary archivesSummary:archivesSummaries){ +// caseIds.add(archivesSummary.getCaseNo()); +// } +// if(caseIds.size()==1){ +// ArchivesCaseVO vo = new ArchivesCaseVO(); +// BeanUtils.copyProperties(vo,archivesCase); +// vo.setArchives(archivesSummaries); +// returnList.add(vo); +// }else{ +// for (String thisCaseId:caseIds){ +// ArchivesCase newCase = caseRepository.findById(thisCaseId).get(); +// ArchivesCaseVO thisVo = new ArchivesCaseVO(); +// BeanUtils.copyProperties(thisVo,newCase); +// List newSummary = new ArrayList<>(); +// for(ArchivesSummary thisSummary:archivesSummaries){ +// if(thisCaseId.equals(thisSummary.getCaseNo())){ +// newSummary.add(thisSummary); +// } +// } +// returnList.add(thisVo); +// } +// } +// +// } +// return returnList; +// } + @Override - public Object doUnpacking(String caseId) { + @Transactional(rollbackFor = Exception.class) + public Object unpacking(String caseId) { ArchivesCase archivesCase = caseRepository.findById(caseId).get(); - List returnList = new ArrayList(); + List editArchivesSummaries = new ArrayList<>(); + List archivesIds = new ArrayList<>(); + Set caseIds = new HashSet<>(); + String categoryId = ""; //文件类型档案盒 if(archivesCase.getCaseType()==1){ - ArchivesCaseVO vo = new ArchivesCaseVO(); - BeanUtils.copyProperties(vo,archivesCase); List archivesSummaries = archivesSummaryRepository.findAllByCaseNoAndCategoryType(caseId, ArchivesTypeEnum.files.getCode()); - vo.setArchives(archivesSummaries); - returnList.add(vo); + for(ArchivesSummary archivesSummary:archivesSummaries){ + categoryId = archivesSummary.getCategoryId(); + archivesIds.add(archivesSummary.getArchivesId()); + archivesSummary.setCaseNo(null); + editArchivesSummaries.add(archivesSummary); + } + caseIds.add(archivesCase.getId()); //案卷类型盒 }else if(archivesCase.getCaseType()==2){ List archivesSummaries = archivesSummaryRepository.findAllByCaseNoAndCategoryType(caseId,ArchivesTypeEnum.inChive.getCode()); - Set caseIds = new HashSet<>(); for(ArchivesSummary archivesSummary:archivesSummaries){ + categoryId = archivesSummary.getCategoryId(); + archivesIds.add(archivesSummary.getArchivesId()); caseIds.add(archivesSummary.getCaseNo()); + archivesSummary.setCaseNo(null); + editArchivesSummaries.add(archivesSummary); } - if(caseIds.size()==1){ - ArchivesCaseVO vo = new ArchivesCaseVO(); - BeanUtils.copyProperties(vo,archivesCase); - vo.setArchives(archivesSummaries); - returnList.add(vo); - }else{ - for (String thisCaseId:caseIds){ - ArchivesCase newCase = caseRepository.findById(thisCaseId).get(); - ArchivesCaseVO thisVo = new ArchivesCaseVO(); - BeanUtils.copyProperties(thisVo,newCase); - List newSummary = new ArrayList<>(); - for(ArchivesSummary thisSummary:archivesSummaries){ - if(thisCaseId.equals(thisSummary.getCaseNo())){ - newSummary.add(thisSummary); + if(caseIds.size()>1) { + for (String thisCaseId : caseIds) { + if(!caseId.equals(thisCaseId)){ + for (ArchivesSummary thisSummary : archivesSummaries) { + if (thisCaseId.equals(thisSummary.getCaseNo())) { + thisSummary.setCaseNo(null); + archivesIds.add(thisSummary.getArchivesId()); + editArchivesSummaries.add(thisSummary); + } } } - returnList.add(thisVo); } } - - } - return returnList; - } - - @Override - @Transactional(rollbackFor = Exception.class) - public Object unpacking(List dtos) { - ArchivesType archivesType = archivesTypeRepository.findById(dtos.get(0).getCategoryId()).get(); - Set caseIds = new HashSet<>(); - List accIds = new ArrayList<>(); - for(ArchivesCaseCartoningDTO dto:dtos){ - accIds.add(dto.getId()); - caseIds.add(dto.getCaseId()); - String sql = "update "+archivesType.getEnName()+" set case_no = null where id = '"+dto.getArchivesId()+"'"; - entityManager.createNativeQuery(sql).executeUpdate(); - archivesSummaryRepository.unpacking(dto.getArchivesId()); } - if(null != archivesType.getPid()){ - ArchivesType archivesTypeP = archivesTypeRepository.findById(archivesType.getPid()).get(); - String sql = "update "+archivesTypeP.getEnName()+" set case_no = null where id = '"+dtos.get(0).getArchivesParentsId()+"'"; - entityManager.createNativeQuery(sql).executeUpdate(); - archivesSummaryRepository.unpacking(dtos.get(0).getArchivesParentsId()); - } - archivesCaseCartoningRepository.deleteAllById(accIds); - for(String caseId:caseIds){ - caseRepository.cartoning(caseId,0,0); + ArchivesType archivesType = archivesTypeRepository.findById(categoryId).get(); + //清空总表盒关联 + archivesSummaryRepository.saveAllAndFlush(editArchivesSummaries); + Integer result = 0; + //清空具体档案表盒信息 + for(String archivesId:archivesIds){ + //若为案卷 + if(archivesType.getIsType() == 2){ + ArchivesType archivesTypeP = archivesTypeRepository.findById(archivesType.getPid()).get(); + String sonsql = "update " +archivesTypeP.getEnName() + " set case_no = null where parent_id = '"+archivesId+"'"; + entityManager.createNativeQuery(sonsql).executeUpdate(); + } + String sql = "update " +archivesType.getEnName() + " set case_no = null where id = '"+archivesId+"'"; + result = entityManager.createNativeQuery(sql).executeUpdate(); } - return null; + archivesCaseCartoningRepository.deleteByCaseId(Arrays.asList(caseIds.toArray())); + return result; } @Override 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 index c70ad62..07a66bc 100644 --- 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 @@ -18,6 +18,7 @@ import com.storeroom.utils.NanoIdUtils; import com.storeroom.utils.PageUtil; import com.storeroom.utils.StringUtils; import lombok.RequiredArgsConstructor; +import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; @@ -49,7 +50,7 @@ public class ArchivesServiceImpl implements ArchivesService { } @Override - public Object initArchivesView(String categoryId,String parentsId, String query,Integer archivesState, + public Object initArchivesView(String categoryId,String parentsId,Integer queryType, String queryTitle,String archiveNo,Integer archivesState, String archiveYear,String department,String retention,String securityClass,String organizationMatter, boolean isdel,Pageable page) { Optional optional = archivesTypeRepository.findById(categoryId); @@ -67,7 +68,7 @@ public class ArchivesServiceImpl implements ArchivesService { queryFields.add("children_num"); if(archivesType.getIsType() == ArchivesTypeEnum.project.getCode() || archivesType.getIsType() == ArchivesTypeEnum.archives.getCode()){ String childrenTable = archivesTypeRepository.findEnNameByPid(archivesType.getId()); - appendQuery = StringUtils.isEmpty(childrenTable) ? ",0 " :",(select count(1) from "+childrenTable+" c where c.parent_id = t.id) "; + appendQuery = StringUtils.isEmpty(childrenTable) ? ",0 " :",(select count(1) from "+childrenTable+" c where c.parent_id = t.id and is_delete_time is null) "; }else{ appendQuery = ",(select count(1) from file_"+queryTable+" c where c.archive_id = t.id) "; } @@ -87,8 +88,8 @@ public class ArchivesServiceImpl implements ArchivesService { additional = StringUtils.isEmpty(retention) ? additional : additional + " and retention = '"+retention+"'"; additional = StringUtils.isEmpty(securityClass) ? additional : additional + " and security_class = '"+securityClass+"'"; additional = StringUtils.isEmpty(organizationMatter) ? additional : additional + " and organization_matter = '"+organizationMatter+"'"; - additional = StringUtils.isEmpty(query) ? additional : additional - + " and (maintitle like '%"+query+"%' or archive_no like '%"+query+"%' or archive_year like '%"+query+"%') "; + additional = StringUtils.isEmpty(queryTitle) ? additional : additional + " and maintitle like '%"+queryTitle+"%' "; + additional = StringUtils.isEmpty(archiveNo) ? additional : additional + " and archive_no like '%"+archiveNo+"%' "; if(objects.length > 0) quertOrder = " order by " + quertOrder.substring(0,quertOrder.length()-1); @@ -113,6 +114,12 @@ public class ArchivesServiceImpl implements ArchivesService { return object; } + @Override + public Object getArchivesRelease(Pageable pageable) { + Page> page = archivesSummaryRepository.getArchivesRelease(pageable); + return PageUtil.toPage(page); + } + @Override public List archiveDetails(String categoryId, String archivesId) { List returnVo = new ArrayList<>(); @@ -128,12 +135,11 @@ public class ArchivesServiceImpl implements ArchivesService { queryEditLength.add(archivesDictionary.getEditLength()); queryisLine.add(archivesDictionary.getIsLine()); } -// archivesDictionaryRepository.findDisPlayField(categoryId); -// archivesDictionaryRepository.findDisPlayCnField(categoryId); String queryField = queryFields.stream().map(String::valueOf).collect(Collectors.joining(",")); String queryTable = archivesType.getEnName(); - String appendQuery = ",tid,(select group_concat(case_name) from archives_case t inner join archives_case_cartoning t1 on t.id = t1.case_id where archives_id = z.id)," + + String appendQuery = "tid,(select group_concat(case_name) from archives_case t inner join archives_case_cartoning t1 on t.id = t1.case_id where archives_id = z.id)," + "folder_location,borrow_type,barcode "; + appendQuery = queryField.length() == 0 ? appendQuery : ","+appendQuery; List list = entityManager.createNativeQuery("select "+queryField+appendQuery+" from "+queryTable + " z where z.id = '"+archivesId+"'").getResultList(); queryFields.add("tid");queryCnFields.add("TID");queryEditLength.add(null);queryisLine.add(null); queryFields.add("case_name");queryCnFields.add("盒名称");queryEditLength.add(null);queryisLine.add(null); @@ -417,7 +423,7 @@ public class ArchivesServiceImpl implements ArchivesService { }).collect(Collectors.toList()); fields.add("id"); String queryFields = fields.stream().map(String::valueOf).collect(Collectors.joining(",")); - String sql = "select "+queryFields+" from file_"+archivesType.getEnName()+" where archive_id = '"+archiveId+"'"; + String sql = "select "+queryFields+" from file_"+archivesType.getEnName()+" where archive_id = '"+archiveId+"' order by sequence asc "; List list = entityManager.createNativeQuery(sql).getResultList(); List returnlist = new ArrayList<>(); for(Object[] objs:list){ @@ -551,7 +557,7 @@ public class ArchivesServiceImpl implements ArchivesService { int result = entityManager.createNativeQuery(sql).executeUpdate(); int result1 = 0; if(ArchivesTypeEnum.inChive.getCode() == archivesType.getIsType() || ArchivesTypeEnum.files.getCode() == archivesType.getIsType()){ - String sql1 = "delete from file_" +queryTable+" where parents_id in ('"+ids.stream().map(String::valueOf).collect(Collectors.joining("','"))+"')"; + String sql1 = "delete from file_" +queryTable+" where archive_id in ('"+ids.stream().map(String::valueOf).collect(Collectors.joining("','"))+"')"; result1 = entityManager.createNativeQuery(sql1).executeUpdate(); } return result+","+result1; diff --git a/archives/src/main/java/com/storeroom/modules/archives/service/impl/ArchivesTagServiceImpl.java b/archives/src/main/java/com/storeroom/modules/archives/service/impl/ArchivesTagServiceImpl.java index 58b10f0..3d2c142 100644 --- a/archives/src/main/java/com/storeroom/modules/archives/service/impl/ArchivesTagServiceImpl.java +++ b/archives/src/main/java/com/storeroom/modules/archives/service/impl/ArchivesTagServiceImpl.java @@ -1,22 +1,174 @@ package com.storeroom.modules.archives.service.impl; +import com.storeroom.modules.archives.domain.ArchivesCase; +import com.storeroom.modules.archives.domain.ArchivesSummary; +import com.storeroom.modules.archives.domain.ArchivesTag; +import com.storeroom.modules.archives.domain.ArchivesTagLog; +import com.storeroom.modules.archives.repository.ArchivesCaseRepository; +import com.storeroom.modules.archives.repository.ArchivesSummaryRepository; +import com.storeroom.modules.archives.repository.ArchivesTagLogRepository; import com.storeroom.modules.archives.repository.ArchivesTagRepository; import com.storeroom.modules.archives.service.ArchivesTagService; +import com.storeroom.modules.archives.service.dto.CaseDTO; +import com.storeroom.utils.PageUtil; import com.storeroom.utils.StringUtils; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import java.util.List; +import java.util.Optional; @Service @RequiredArgsConstructor public class ArchivesTagServiceImpl implements ArchivesTagService { private final ArchivesTagRepository archivesTagRepository; + private final ArchivesTagLogRepository archivesTagLogRepository; + private final ArchivesSummaryRepository archivesSummaryRepository; + private final ArchivesCaseRepository caseRepository; + + @PersistenceContext + EntityManager entityManager; @Override public Object initTagList(String tid, String query, Integer isType, Pageable page) { tid = null != tid ? "%"+tid+"%" : null; query = null != query ? "%"+query+"%" : null; - return archivesTagRepository.initTagList(tid,query,isType,page); + return PageUtil.toPage(archivesTagRepository.initTagList(tid,query,isType,page)); + } + + @Override + public Object initTagLogList(String tid, String title, Integer operType, Integer bindingType, Pageable page) { + tid = null != tid ? "%"+tid+"%" : null; + title = null != title ? "%"+title+"%" : null; + return PageUtil.toPage(archivesTagLogRepository.initTagLogList(tid,title,operType,bindingType,page)); + } + + @Override + public Integer findIsBingdingLabel(String label) { + Optional optional = archivesTagRepository.findById(label); + if(!optional.isPresent()){ + return 0; + }else{ + ArchivesTag tag = optional.get(); + return tag.getIsType() == null ? 0 : tag.getIsType(); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Object addTag(String parentId, String tid, Integer labelType, Integer tagType) { + String archivesTable = ""; + String oldTid = ""; + Integer returnCount = 0; + //若原标签有绑定 先解绑 + switch (tagType){ + case 1: + ArchivesSummary archivesSummary = archivesSummaryRepository.findFirstByTagNo(tid); + archivesSummaryRepository.unbindTag(tid); + archivesTable = archivesSummary.getArchivesTableName(); + String sql = "update "+archivesTable+" set tid = null where id = '"+archivesSummary.getArchivesId()+"'"; + entityManager.createNativeQuery(sql).executeUpdate(); + break; + case 2: + caseRepository.unbindTag(tid); + break; + default: + break; + } + Object title = ""; + //绑定标签 + switch (labelType){ + case 1: + oldTid = archivesSummaryRepository.findByArchivesId(parentId).getTagNo(); + archivesSummaryRepository.bindTag(tid,parentId); + String sql = "update "+archivesTable+" set tid = null where id = '"+parentId+"'"; + returnCount = entityManager.createNativeQuery(sql).executeUpdate(); + title = entityManager.createNativeQuery("select maintitle from "+archivesTable+" where id = '"+parentId+"'").getResultList().get(0); + break; + case 2: + ArchivesCase archivesCase = caseRepository.findById(parentId).get(); + title = archivesCase.getCaseName(); + oldTid = archivesCase.getTid(); + returnCount = caseRepository.bindTag(tid,parentId); + break; + case 3: + break; + default: + break; + } + //清空原本tid + if(!StringUtils.isEmpty(oldTid)){ + archivesTagRepository.unbindTag(oldTid); + } + + Optional optional = archivesTagRepository.findById(tid); + ArchivesTag tag = optional.isPresent() ? optional.get() : new ArchivesTag(); + if(tagType==1||tagType==2||tagType==3){ + ArchivesTagLog unbingLog = new ArchivesTagLog(); + unbingLog.setTid(tid); + unbingLog.setOperType(2); + unbingLog.setBindingType(tagType); + unbingLog.setTitle(tag.getTitle()); + archivesTagLogRepository.save(unbingLog); + } + + tag.setTid(tid); + tag.setParentsId(parentId); + tag.setIsType(labelType); + tag.setTitle(title==null?"":title+""); + tag = archivesTagRepository.saveAndFlush(tag); + + ArchivesTagLog bingLog = new ArchivesTagLog(); + bingLog.setTid(tid); + bingLog.setOperType(1); + bingLog.setBindingType(labelType); + bingLog.setTitle(tag.getTitle()); + archivesTagLogRepository.save(bingLog); + return returnCount; } + + @Override + @Transactional(rollbackFor = Exception.class) + public Object unbindTag(List dtos) { + Integer result = 0; + for(CaseDTO dto:dtos){ + String tid = dto.getTid(); + Integer labelType = dto.getLabelType(); + + ArchivesTag tag = archivesTagRepository.findById(tid).get(); + ArchivesTagLog unbingLog = new ArchivesTagLog(); + unbingLog.setTid(tid); + unbingLog.setOperType(2); + unbingLog.setBindingType(labelType); + unbingLog.setTitle(tag.getTitle()); + + switch (labelType){ + case 1: + ArchivesSummary archivesSummary = archivesSummaryRepository.findFirstByTagNo(tid); + archivesSummaryRepository.unbindTag(tid); + String archivesTable = archivesSummary.getArchivesTableName(); + String sql = "update "+archivesTable+" set tid = null where id = '"+archivesSummary.getArchivesId()+"'"; + result = entityManager.createNativeQuery(sql).executeUpdate(); + archivesTagLogRepository.save(unbingLog); + break; + case 2: + caseRepository.unbindTag(tid); + archivesTagLogRepository.save(unbingLog); + result = 1; + break; + default: + break; + } + archivesTagRepository.unbindTag(tid); + result++; + } + return result; + } + + } diff --git a/system/src/main/resources/application.yml b/system/src/main/resources/application.yml index 2a3dd1a..cb20fe2 100644 --- a/system/src/main/resources/application.yml +++ b/system/src/main/resources/application.yml @@ -15,6 +15,9 @@ spring: enabled: false main: allow-bean-definition-overriding: true + servlet: + multipart: + max-file-size: 5MB #配置 Jpa jpa: