字段调整
Showing
8 changed files
with
119 additions
and
13 deletions
| ... | @@ -5,45 +5,45 @@ public enum ArchiveStatus { | ... | @@ -5,45 +5,45 @@ public enum ArchiveStatus { |
| 5 | /** | 5 | /** |
| 6 | * 正在接收 | 6 | * 正在接收 |
| 7 | */ | 7 | */ |
| 8 | RECEIVING("1","正在接收"), | 8 | RECEIVING(1,"正在接收"), |
| 9 | /** | 9 | /** |
| 10 | * 正在补录 | 10 | * 正在补录 |
| 11 | */ | 11 | */ |
| 12 | REPLENISHING("2","正在补录"), | 12 | REPLENISHING(2,"正在补录"), |
| 13 | /** | 13 | /** |
| 14 | * 正在修改 | 14 | * 正在修改 |
| 15 | */ | 15 | */ |
| 16 | MODIFYING("3","正在修改"), | 16 | MODIFYING(3,"正在修改"), |
| 17 | /** | 17 | /** |
| 18 | * 在库 | 18 | * 在库 |
| 19 | */ | 19 | */ |
| 20 | STORED("4","在库"), | 20 | STORED(4,"在库"), |
| 21 | /** | 21 | /** |
| 22 | * 正在销毁 | 22 | * 正在销毁 |
| 23 | */ | 23 | */ |
| 24 | DESTROYING("5","正在销毁"), | 24 | DESTROYING(5,"正在销毁"), |
| 25 | /** | 25 | /** |
| 26 | * 已销毁 | 26 | * 已销毁 |
| 27 | */ | 27 | */ |
| 28 | DESTROYED("6","已销毁"), | 28 | DESTROYED(6,"已销毁"), |
| 29 | /** | 29 | /** |
| 30 | * 正在借阅 | 30 | * 正在借阅 |
| 31 | */ | 31 | */ |
| 32 | LENDING("7","正在借阅"), | 32 | LENDING(7,"正在借阅"), |
| 33 | /** | 33 | /** |
| 34 | * 已借阅 | 34 | * 已借阅 |
| 35 | */ | 35 | */ |
| 36 | LENDED("8","已借阅"); | 36 | LENDED(8,"已借阅"); |
| 37 | 37 | ||
| 38 | private String code; | 38 | private Integer code; |
| 39 | private String description; | 39 | private String description; |
| 40 | 40 | ||
| 41 | ArchiveStatus(String code,String description) { | 41 | ArchiveStatus(Integer code,String description) { |
| 42 | this.code = code; | 42 | this.code = code; |
| 43 | this.description = description; | 43 | this.description = description; |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | public String getCode() { | 46 | public Integer getCode() { |
| 47 | return this.code; | 47 | return this.code; |
| 48 | } | 48 | } |
| 49 | } | 49 | } | ... | ... |
| 1 | package com.pashanhoo.file.controller; | 1 | package com.pashanhoo.file.controller; |
| 2 | 2 | ||
| 3 | import com.pashanhoo.common.Result; | 3 | import com.pashanhoo.common.Result; |
| 4 | import com.pashanhoo.common.util.fileupload.MinioConfig; | ||
| 5 | import com.pashanhoo.common.util.fileupload.MinioUtil; | ||
| 4 | import com.pashanhoo.file.entity.vo.AddDgFileRequest; | 6 | import com.pashanhoo.file.entity.vo.AddDgFileRequest; |
| 5 | import com.pashanhoo.file.entity.vo.DgCatalogWithFileVO; | 7 | import com.pashanhoo.file.entity.vo.DgCatalogWithFileVO; |
| 6 | import com.pashanhoo.file.entity.vo.DgFileListVO; | 8 | import com.pashanhoo.file.entity.vo.DgFileListVO; |
| ... | @@ -12,7 +14,9 @@ import io.swagger.annotations.Api; | ... | @@ -12,7 +14,9 @@ import io.swagger.annotations.Api; |
| 12 | import io.swagger.annotations.ApiOperation; | 14 | import io.swagger.annotations.ApiOperation; |
| 13 | import io.swagger.annotations.ApiParam; | 15 | import io.swagger.annotations.ApiParam; |
| 14 | import org.springframework.beans.factory.annotation.Autowired; | 16 | import org.springframework.beans.factory.annotation.Autowired; |
| 17 | import org.springframework.web.multipart.MultipartFile; | ||
| 15 | 18 | ||
| 19 | import javax.servlet.http.HttpServletResponse; | ||
| 16 | import java.io.IOException; | 20 | import java.io.IOException; |
| 17 | import java.util.List; | 21 | import java.util.List; |
| 18 | 22 | ||
| ... | @@ -76,4 +80,14 @@ public class DgFileController { | ... | @@ -76,4 +80,14 @@ public class DgFileController { |
| 76 | } | 80 | } |
| 77 | return Result.error("修改失败"); | 81 | return Result.error("修改失败"); |
| 78 | } | 82 | } |
| 83 | |||
| 84 | @RequestMapping(value = "/upload", method = RequestMethod.POST) | ||
| 85 | @ApiOperation("上传材料附件") | ||
| 86 | public Result upload(@RequestPart("file") MultipartFile file, AddDgFileRequest fileRequest) { | ||
| 87 | try { | ||
| 88 | return Result.ok(dgfileService.upload(file,fileRequest)); | ||
| 89 | } catch (Exception e) { | ||
| 90 | return Result.exception(e.getMessage()); | ||
| 91 | } | ||
| 92 | } | ||
| 79 | } | 93 | } | ... | ... |
| ... | @@ -2,10 +2,13 @@ package com.pashanhoo.file.entity.vo; | ... | @@ -2,10 +2,13 @@ package com.pashanhoo.file.entity.vo; |
| 2 | 2 | ||
| 3 | import java.util.Date; | 3 | import java.util.Date; |
| 4 | import java.io.Serializable; | 4 | import java.io.Serializable; |
| 5 | |||
| 6 | import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 5 | import io.swagger.annotations.ApiModel; | 7 | import io.swagger.annotations.ApiModel; |
| 6 | import io.swagger.annotations.ApiModelProperty; | 8 | import io.swagger.annotations.ApiModelProperty; |
| 7 | import lombok.Data; | 9 | import lombok.Data; |
| 8 | import lombok.EqualsAndHashCode; | 10 | import lombok.EqualsAndHashCode; |
| 11 | import org.springframework.format.annotation.DateTimeFormat; | ||
| 9 | 12 | ||
| 10 | /** | 13 | /** |
| 11 | * <p> | 14 | * <p> |
| ... | @@ -44,6 +47,8 @@ public class UpdateDgFileRequest implements Serializable { | ... | @@ -44,6 +47,8 @@ public class UpdateDgFileRequest implements Serializable { |
| 44 | * 上传日期 | 47 | * 上传日期 |
| 45 | */ | 48 | */ |
| 46 | @ApiModelProperty(name = "scrq", value = "上传日期") | 49 | @ApiModelProperty(name = "scrq", value = "上传日期") |
| 50 | @DateTimeFormat(pattern = "yyyy-MM-dd") | ||
| 51 | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | ||
| 47 | private Date scrq; | 52 | private Date scrq; |
| 48 | 53 | ||
| 49 | /** | 54 | /** | ... | ... |
| ... | @@ -3,6 +3,7 @@ package com.pashanhoo.file.service; | ... | @@ -3,6 +3,7 @@ package com.pashanhoo.file.service; |
| 3 | import com.baomidou.mybatisplus.extension.service.IService; | 3 | import com.baomidou.mybatisplus.extension.service.IService; |
| 4 | import com.pashanhoo.file.entity.DgFileDO; | 4 | import com.pashanhoo.file.entity.DgFileDO; |
| 5 | import com.pashanhoo.file.entity.vo.*; | 5 | import com.pashanhoo.file.entity.vo.*; |
| 6 | import org.springframework.web.multipart.MultipartFile; | ||
| 6 | 7 | ||
| 7 | import java.io.IOException; | 8 | import java.io.IOException; |
| 8 | import java.util.List; | 9 | import java.util.List; |
| ... | @@ -57,4 +58,12 @@ public interface DgFileService extends IService<DgFileDO> { | ... | @@ -57,4 +58,12 @@ public interface DgFileService extends IService<DgFileDO> { |
| 57 | * @return | 58 | * @return |
| 58 | */ | 59 | */ |
| 59 | boolean delete(List<String> bsmFileList) throws Exception; | 60 | boolean delete(List<String> bsmFileList) throws Exception; |
| 61 | |||
| 62 | /** | ||
| 63 | * 上传材料附件.材料附件信息入库 | ||
| 64 | * @param file | ||
| 65 | * @param fileRequest | ||
| 66 | * @return | ||
| 67 | */ | ||
| 68 | boolean upload(MultipartFile file, AddDgFileRequest fileRequest) throws IOException; | ||
| 60 | } | 69 | } | ... | ... |
| ... | @@ -11,6 +11,7 @@ import com.pashanhoo.file.mapper.DgFileMapper; | ... | @@ -11,6 +11,7 @@ import com.pashanhoo.file.mapper.DgFileMapper; |
| 11 | import com.pashanhoo.file.service.DgFileService; | 11 | import com.pashanhoo.file.service.DgFileService; |
| 12 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | import org.springframework.stereotype.Service; | 13 | import org.springframework.stereotype.Service; |
| 14 | import org.springframework.web.multipart.MultipartFile; | ||
| 14 | 15 | ||
| 15 | 16 | ||
| 16 | import java.io.IOException; | 17 | import java.io.IOException; |
| ... | @@ -117,5 +118,21 @@ public class DgFileServiceImpl extends ServiceImpl<DgFileMapper, DgFileDO> imple | ... | @@ -117,5 +118,21 @@ public class DgFileServiceImpl extends ServiceImpl<DgFileMapper, DgFileDO> imple |
| 117 | return flag; | 118 | return flag; |
| 118 | } | 119 | } |
| 119 | 120 | ||
| 121 | /** | ||
| 122 | * 上传材料附件.材料附件信息入库 | ||
| 123 | * | ||
| 124 | * @param file | ||
| 125 | * @param fileRequest | ||
| 126 | * @return | ||
| 127 | */ | ||
| 128 | @Override | ||
| 129 | public boolean upload(MultipartFile file, AddDgFileRequest fileRequest) throws IOException { | ||
| 130 | //文件上传 | ||
| 131 | FileAttribute fileAttribute = minioUtil.upload(file); | ||
| 132 | |||
| 133 | //文件 | ||
| 134 | return true; | ||
| 135 | } | ||
| 136 | |||
| 120 | 137 | ||
| 121 | } | 138 | } | ... | ... |
| ... | @@ -39,8 +39,8 @@ public class DgArchivesModifyController { | ... | @@ -39,8 +39,8 @@ public class DgArchivesModifyController { |
| 39 | 39 | ||
| 40 | @DeleteMapping("deleteDgArchivesModifyByIds") | 40 | @DeleteMapping("deleteDgArchivesModifyByIds") |
| 41 | @ApiOperation(value = "批量删除档案修改信息") | 41 | @ApiOperation(value = "批量删除档案修改信息") |
| 42 | public Result deleteDgArchivesModifyByIds(@ApiParam("档案修改信息ID列表") @RequestParam(value = "idList") List<String> idList) { | 42 | public Result deleteDgArchivesModifyByIds(@ApiParam("档案修改标识码") @RequestParam(value = "bsmModify") String bsmModify) { |
| 43 | if(dgarchivesmodifyService.removeByIds(idList)) { | 43 | if(dgarchivesmodifyService.delete(bsmModify)) { |
| 44 | return Result.ok("删除成功"); | 44 | return Result.ok("删除成功"); |
| 45 | } | 45 | } |
| 46 | return Result.error("删除失败"); | 46 | return Result.error("删除失败"); | ... | ... |
| ... | @@ -58,4 +58,11 @@ public interface DgArchivesModifyService extends IService<DgModifyDO> { | ... | @@ -58,4 +58,11 @@ public interface DgArchivesModifyService extends IService<DgModifyDO> { |
| 58 | * @return | 58 | * @return |
| 59 | */ | 59 | */ |
| 60 | List<DgArchivesModifyDetailVO> getArchiveWithModify(String bsmArchive); | 60 | List<DgArchivesModifyDetailVO> getArchiveWithModify(String bsmArchive); |
| 61 | |||
| 62 | /** | ||
| 63 | * 删除修改记录,并回滚档案信息和修改档案状态在库 | ||
| 64 | * @param bsmModify | ||
| 65 | * @return | ||
| 66 | */ | ||
| 67 | boolean delete(String bsmModify); | ||
| 61 | } | 68 | } | ... | ... |
| ... | @@ -186,4 +186,58 @@ public class DgArchivesModifyServiceImpl extends ServiceImpl<DgArchivesModifyMap | ... | @@ -186,4 +186,58 @@ public class DgArchivesModifyServiceImpl extends ServiceImpl<DgArchivesModifyMap |
| 186 | List<DgModifyDO> modifyDOS = this.list(modifyWrapper); | 186 | List<DgModifyDO> modifyDOS = this.list(modifyWrapper); |
| 187 | return dgarchivesmodifyConverter.doList2DetailVOList(modifyDOS); | 187 | return dgarchivesmodifyConverter.doList2DetailVOList(modifyDOS); |
| 188 | } | 188 | } |
| 189 | |||
| 190 | /** | ||
| 191 | * 删除修改记录,并回滚档案信息和修改档案状态在库 | ||
| 192 | * @param bsmModify | ||
| 193 | * @return | ||
| 194 | */ | ||
| 195 | @Override | ||
| 196 | @Transactional(rollbackFor = Exception.class) | ||
| 197 | public boolean delete(String bsmModify) { | ||
| 198 | //获取修改前信息 | ||
| 199 | DgModifyDO modifyDO = this.getById(bsmModify); | ||
| 200 | String bsmArchives = modifyDO.getBsmArchives(); | ||
| 201 | //获取原档案信息json字段 | ||
| 202 | String ydaxxJson = modifyDO.getYdaxx(); | ||
| 203 | ModifyRecord modifyRecord = JSONUtil.toBean(ydaxxJson, ModifyRecord.class); | ||
| 204 | |||
| 205 | //删除修改记录表数据 | ||
| 206 | this.removeById(bsmModify); | ||
| 207 | |||
| 208 | //删除案卷附件 | ||
| 209 | QueryWrapper<DgArchivesCatalogDO> catalogWrapper = new QueryWrapper<>(); | ||
| 210 | catalogWrapper.lambda().eq(DgArchivesCatalogDO::getBsmArchives, bsmArchives); | ||
| 211 | List<DgArchivesCatalogDO> catalogDOList = catalogService.list(catalogWrapper); | ||
| 212 | List<String> bsmCatalogList = catalogDOList.stream().map(DgArchivesCatalogDO::getBsmCatalog).collect(Collectors.toList()); | ||
| 213 | QueryWrapper<DgFileDO> fileWrapper = new QueryWrapper<>(); | ||
| 214 | fileWrapper.lambda().in(DgFileDO::getBsmCatalog, bsmCatalogList); | ||
| 215 | fileService.remove(fileWrapper); | ||
| 216 | //插入原案卷附件 | ||
| 217 | fileService.saveBatch(modifyRecord.getDgFileDOList()); | ||
| 218 | |||
| 219 | //删除案卷目录 | ||
| 220 | catalogService.removeByIds(bsmCatalogList); | ||
| 221 | //插入原案卷目录 | ||
| 222 | catalogService.saveBatch(modifyRecord.getCatalogDOList()); | ||
| 223 | |||
| 224 | //删除不动产信息 | ||
| 225 | QueryWrapper<DgBdcdyDO> bdcdyWrapper = new QueryWrapper<>(); | ||
| 226 | bdcdyWrapper.lambda().eq(DgBdcdyDO::getBsmArchives, bsmArchives); | ||
| 227 | bdcdyService.remove(bdcdyWrapper); | ||
| 228 | //插入原不动产信息 | ||
| 229 | bdcdyService.saveBatch(modifyRecord.getDgBdcdyDOList()); | ||
| 230 | |||
| 231 | //删除业务信息 | ||
| 232 | QueryWrapper<DgBusinessDO> businessWrapper = new QueryWrapper<>(); | ||
| 233 | businessWrapper.lambda().eq(DgBusinessDO::getBsmArchives, bsmArchives); | ||
| 234 | businessService.remove(businessWrapper); | ||
| 235 | //插入原业务信息 | ||
| 236 | businessService.save(modifyRecord.getDgBusinessDO()); | ||
| 237 | |||
| 238 | //更新档案信息 | ||
| 239 | DgArchivesDO archivesDO = modifyRecord.getArchivesDO(); | ||
| 240 | archivesDO.setDazt(ArchiveStatus.STORED.getCode()); | ||
| 241 | return archivesService.updateById(archivesDO); | ||
| 242 | } | ||
| 189 | } | 243 | } | ... | ... |
-
Please register or sign in to post a comment