|
@@ -92,10 +92,13 @@ public class OssService extends ServiceImpl<OssServiceMapper, WorkAttachment> {
|
|
|
int i = 1;
|
|
|
for (WorkAttachment workAttachment : workAttachments) {
|
|
|
//判断文件是否存在
|
|
|
- LambdaQueryWrapper<WorkAttachment> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ /*LambdaQueryWrapper<WorkAttachment> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
lambdaQueryWrapper.eq(WorkAttachment::getUrl, workAttachment.getUrl());
|
|
|
- lambdaQueryWrapper.eq(WorkAttachment::getAttachmentId, workAttachment.getAttachmentId());
|
|
|
- List<WorkAttachment> list = ossServiceMapper.selectList(lambdaQueryWrapper);
|
|
|
+ lambdaQueryWrapper.eq(WorkAttachment::getAttachmentId, workAttachment.getAttachmentId());*/
|
|
|
+ WorkAttachmentInfo workAttachmentInfo = new WorkAttachmentInfo();
|
|
|
+ workAttachmentInfo.setUrl(workAttachment.getUrl());
|
|
|
+ workAttachmentInfo.setAttachmentId(workAttachment.getAttachmentId());
|
|
|
+ List<WorkAttachmentInfo> list = ossServiceMapper.getByAttachmentIdAndUrlAndAttachmentFlag(workAttachmentInfo);
|
|
|
if (CollectionUtil.isNotEmpty(list)) {
|
|
|
i++;
|
|
|
continue;
|
|
@@ -118,6 +121,8 @@ public class OssService extends ServiceImpl<OssServiceMapper, WorkAttachment> {
|
|
|
UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken (currentToken);
|
|
|
ossServiceMapper.insertWorkAttachment(workAttachment, userDTO);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
log.info("保存操作执行完成");
|
|
|
}
|
|
|
}
|
|
@@ -142,7 +147,7 @@ public class OssService extends ServiceImpl<OssServiceMapper, WorkAttachment> {
|
|
|
log.info("开始执行删除操作,入参:{}" , id);
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
map.put("id", id);
|
|
|
- int i = ossServiceMapper.deleteByMap(map);
|
|
|
+ int i = ossServiceMapper.deleteById(id);
|
|
|
//项目文件删除后处理项目文件状态
|
|
|
Integer num = ossServiceMapper.selectSaveById(id);
|
|
|
if (num == 0) {
|