解决了文件上传重名文件问题
This commit is contained in:
@ -240,6 +240,7 @@ public class DefaultAttachmentClient implements AttachmentClient {
|
||||
* @param 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));
|
||||
|
||||
op.ifPresent(detail -> {
|
||||
|
@ -26,8 +26,8 @@ public class AttachmentDetail extends Hashtable<String, List<AttachmentEntity>>
|
||||
|
||||
@Override
|
||||
public synchronized List<AttachmentEntity> get(Object key) {
|
||||
if (contains(key)) {
|
||||
super.get(key);
|
||||
if (containsKey(key)) {
|
||||
return super.get(key);
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
Reference in New Issue
Block a user