|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
package cokr.xit.adds.biz.nims.service.bean;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
@ -985,12 +985,12 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
|
|
|
|
|
* </pre>
|
|
|
|
|
*/
|
|
|
|
|
private String uploadFileAndSave(String infType, String infKey, String subType, MultipartFile mf) {
|
|
|
|
|
String fileId = bizNimsMapper.selectFileId(Map.of("infType", infType, "infKey", infKey, "subType", subType));
|
|
|
|
|
if(!isEmpty(fileId)){
|
|
|
|
|
fileService.delete(new String[]{fileId});
|
|
|
|
|
List<String> fileIds = bizNimsMapper.selectFileId(Map.of("infType", infType, "infKey", infKey, "subType", subType));
|
|
|
|
|
if(!fileIds.isEmpty()){
|
|
|
|
|
fileService.delete(fileIds.toArray(new String[0]));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MultipartFile[] uploads = Arrays.asList(mf).toArray(new MultipartFile[0]);
|
|
|
|
|
MultipartFile[] uploads = Collections.singletonList(mf).toArray(new MultipartFile[0]);
|
|
|
|
|
List<FileInfo> files = (new FileInfoFactory()).makeFileInfos((new FileInfo.Relation()).setInfoType(infType).setInfoKey(infKey).setSubType(subType), uploads);
|
|
|
|
|
fileService.create(files);
|
|
|
|
|
|
|
|
|
|