档案补录新增逻辑修改.返回主键
Showing
5 changed files
with
24 additions
and
13 deletions
... | @@ -261,6 +261,13 @@ | ... | @@ -261,6 +261,13 @@ |
261 | <artifactId>dynamic-datasource-spring-boot-starter</artifactId> | 261 | <artifactId>dynamic-datasource-spring-boot-starter</artifactId> |
262 | <version>3.5.0</version> | 262 | <version>3.5.0</version> |
263 | </dependency> | 263 | </dependency> |
264 | |||
265 | <dependency> | ||
266 | <groupId>net.sourceforge.tess4j</groupId> | ||
267 | <artifactId>tess4j</artifactId> | ||
268 | <version>4.5.3</version> | ||
269 | </dependency> | ||
270 | |||
264 | </dependencies> | 271 | </dependencies> |
265 | 272 | ||
266 | <build> | 273 | <build> | ... | ... |
... | @@ -57,7 +57,7 @@ public class MinioUtil { | ... | @@ -57,7 +57,7 @@ public class MinioUtil { |
57 | String expandName = StringUtils.getFilenameExtension(file.getOriginalFilename()); | 57 | String expandName = StringUtils.getFilenameExtension(file.getOriginalFilename()); |
58 | // 文件名 | 58 | // 文件名 |
59 | String fileName = originalFilename.substring(0, originalFilename.indexOf(".")); | 59 | String fileName = originalFilename.substring(0, originalFilename.indexOf(".")); |
60 | String contentType = contentTypeMap.get(expandName.toLowerCase()); | 60 | String contentType = CONTENT_TYPE_MAP.get(expandName.toLowerCase()); |
61 | // 下载地址 | 61 | // 下载地址 |
62 | String saveUrl = savePath + "/" + originalFilename; | 62 | String saveUrl = savePath + "/" + originalFilename; |
63 | // 浏览器直接预览地址,针对图片 | 63 | // 浏览器直接预览地址,针对图片 |
... | @@ -131,7 +131,7 @@ public class MinioUtil { | ... | @@ -131,7 +131,7 @@ public class MinioUtil { |
131 | */ | 131 | */ |
132 | public FileAttribute transferToMinio(InputStream inputStream, String fileName, String expandName, String fileSize) throws IOException { | 132 | public FileAttribute transferToMinio(InputStream inputStream, String fileName, String expandName, String fileSize) throws IOException { |
133 | String savePath = FileAttachmentUtil.getSavePath(UUID.randomUUID().toString()); | 133 | String savePath = FileAttachmentUtil.getSavePath(UUID.randomUUID().toString()); |
134 | String contentType = contentTypeMap.get(expandName.toLowerCase()); | 134 | String contentType = CONTENT_TYPE_MAP.get(expandName.toLowerCase()); |
135 | // 下载地址 | 135 | // 下载地址 |
136 | String saveUrl = savePath + "/" + fileName + expandName; | 136 | String saveUrl = savePath + "/" + fileName + expandName; |
137 | // 浏览器直接预览地址,针对图片 | 137 | // 浏览器直接预览地址,针对图片 |
... | @@ -160,7 +160,11 @@ public class MinioUtil { | ... | @@ -160,7 +160,11 @@ public class MinioUtil { |
160 | return minioConfig.getType() + minioConfig.getEndpoint() + "/file/" + saveUrl; | 160 | return minioConfig.getType() + minioConfig.getEndpoint() + "/file/" + saveUrl; |
161 | } | 161 | } |
162 | 162 | ||
163 | private static final Map<String, String> contentTypeMap = new HashMap<>() { | 163 | public InputStream getObject(String objectName) throws Exception{ |
164 | return minioClient.getObject(GetObjectArgs.builder().bucket(minioConfig.getBucket()).object(objectName).build()); | ||
165 | } | ||
166 | |||
167 | private static final Map<String, String> CONTENT_TYPE_MAP = new HashMap<>() { | ||
164 | { | 168 | { |
165 | put("323", "text/h323"); | 169 | put("323", "text/h323"); |
166 | put("3gp", "video/3gpp"); | 170 | put("3gp", "video/3gpp"); | ... | ... |
1 | package com.pashanhoo.replenish.controller; | 1 | package com.pashanhoo.replenish.controller; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.metadata.IPage; | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; |
4 | import com.baomidou.mybatisplus.core.toolkit.IdWorker; | ||
4 | import com.pashanhoo.common.Result; | 5 | import com.pashanhoo.common.Result; |
5 | import com.pashanhoo.replenish.entity.vo.AddDgArchivesReplenishRequest; | 6 | import com.pashanhoo.replenish.entity.vo.AddDgArchivesReplenishRequest; |
6 | import com.pashanhoo.replenish.entity.vo.DgArchivesReplenishListVO; | 7 | import com.pashanhoo.replenish.entity.vo.DgArchivesReplenishListVO; |
7 | import com.pashanhoo.replenish.entity.vo.DgArchivesReplenishSearchRequest; | 8 | import com.pashanhoo.replenish.entity.vo.DgArchivesReplenishSearchRequest; |
8 | import com.pashanhoo.replenish.service.DgArchivesReplenishService; | 9 | import com.pashanhoo.replenish.service.DgArchivesReplenishService; |
9 | import org.springframework.web.bind.annotation.RestController; | ||
10 | import org.springframework.web.bind.annotation.*; | ||
11 | import io.swagger.annotations.Api; | 10 | import io.swagger.annotations.Api; |
12 | import io.swagger.annotations.ApiOperation; | 11 | import io.swagger.annotations.ApiOperation; |
13 | import io.swagger.annotations.ApiParam; | 12 | import io.swagger.annotations.ApiParam; |
14 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
14 | import org.springframework.web.bind.annotation.*; | ||
15 | 15 | ||
16 | import java.util.List; | 16 | import java.util.List; |
17 | 17 | ||
... | @@ -33,8 +33,10 @@ public class DgArchivesReplenishController { | ... | @@ -33,8 +33,10 @@ public class DgArchivesReplenishController { |
33 | @PostMapping("insertDgArchivesReplenish") | 33 | @PostMapping("insertDgArchivesReplenish") |
34 | @ApiOperation("新增档案补录信息") | 34 | @ApiOperation("新增档案补录信息") |
35 | public Result insertDgArchivesReplenish(@RequestBody AddDgArchivesReplenishRequest request){ | 35 | public Result insertDgArchivesReplenish(@RequestBody AddDgArchivesReplenishRequest request){ |
36 | if(dgarchivesreplenishService.insertDgArchivesReplenish(request)){ | 36 | //生成案卷标识码 |
37 | return Result.ok(); | 37 | String bsmArchive = IdWorker.get32UUID(); |
38 | if(dgarchivesreplenishService.insertDgArchivesReplenish(request,bsmArchive)){ | ||
39 | return Result.ok(bsmArchive); | ||
38 | } | 40 | } |
39 | return Result.error("新增失败"); | 41 | return Result.error("新增失败"); |
40 | } | 42 | } | ... | ... |
... | @@ -20,9 +20,10 @@ public interface DgArchivesReplenishService extends IService<DgArchivesReplenish | ... | @@ -20,9 +20,10 @@ public interface DgArchivesReplenishService extends IService<DgArchivesReplenish |
20 | * 新增记录 | 20 | * 新增记录 |
21 | * | 21 | * |
22 | * @param request | 22 | * @param request |
23 | * @param bsmArchive 主键 | ||
23 | * @return | 24 | * @return |
24 | */ | 25 | */ |
25 | boolean insertDgArchivesReplenish(AddDgArchivesReplenishRequest request); | 26 | boolean insertDgArchivesReplenish(AddDgArchivesReplenishRequest request,String bsmArchive); |
26 | 27 | ||
27 | /** | 28 | /** |
28 | * 根据主键查询记录详情 | 29 | * 根据主键查询记录详情 | ... | ... |
... | @@ -6,7 +6,6 @@ import cn.hutool.core.date.DateUtil; | ... | @@ -6,7 +6,6 @@ import cn.hutool.core.date.DateUtil; |
6 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 6 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
7 | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; | 7 | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
8 | import com.baomidou.mybatisplus.core.metadata.IPage; | 8 | import com.baomidou.mybatisplus.core.metadata.IPage; |
9 | import com.baomidou.mybatisplus.core.toolkit.IdWorker; | ||
10 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 9 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
11 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 10 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
12 | import com.pashanhoo.archive.entity.ArchiveStatus; | 11 | import com.pashanhoo.archive.entity.ArchiveStatus; |
... | @@ -104,14 +103,12 @@ public class DgArchivesReplenishServiceImpl extends ServiceImpl<DgArchivesReplen | ... | @@ -104,14 +103,12 @@ public class DgArchivesReplenishServiceImpl extends ServiceImpl<DgArchivesReplen |
104 | * 新增记录 | 103 | * 新增记录 |
105 | * | 104 | * |
106 | * @param request | 105 | * @param request |
106 | * @param bsmArchive 生成主键 | ||
107 | * @return | 107 | * @return |
108 | */ | 108 | */ |
109 | @Override | 109 | @Override |
110 | @Transactional(rollbackFor = Exception.class) | 110 | @Transactional(rollbackFor = Exception.class) |
111 | public boolean insertDgArchivesReplenish(AddDgArchivesReplenishRequest request) { | 111 | public boolean insertDgArchivesReplenish(AddDgArchivesReplenishRequest request,String bsmArchive) { |
112 | |||
113 | //生成案卷标识码 | ||
114 | String bsmArchive = IdWorker.get32UUID(); | ||
115 | 112 | ||
116 | //案卷基本信息 | 113 | //案卷基本信息 |
117 | AddDgArchivesRequest addDgArchivesRequest = request.getAddDgArchivesRequest(); | 114 | AddDgArchivesRequest addDgArchivesRequest = request.getAddDgArchivesRequest(); | ... | ... |
-
Please register or sign in to post a comment