解决了文件上传重名文件问题
This commit is contained in:
@ -240,6 +240,7 @@ public class DefaultAttachmentClient implements AttachmentClient {
|
|||||||
* @param filename
|
* @param filename
|
||||||
*/
|
*/
|
||||||
private void removeDuplicateObject(String businessId, String filename) {
|
private void removeDuplicateObject(String businessId, String filename) {
|
||||||
|
log.info("remove duplicate name files {} in business: {}", filename, businessId);
|
||||||
Optional<AttachmentDetail> op = findByBusinessId(Arrays.asList(businessId));
|
Optional<AttachmentDetail> op = findByBusinessId(Arrays.asList(businessId));
|
||||||
|
|
||||||
op.ifPresent(detail -> {
|
op.ifPresent(detail -> {
|
||||||
|
@ -26,8 +26,8 @@ public class AttachmentDetail extends Hashtable<String, List<AttachmentEntity>>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized List<AttachmentEntity> get(Object key) {
|
public synchronized List<AttachmentEntity> get(Object key) {
|
||||||
if (contains(key)) {
|
if (containsKey(key)) {
|
||||||
super.get(key);
|
return super.get(key);
|
||||||
}
|
}
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user