|
|
|
@@ -21,6 +21,7 @@ import com.iformall.domain.po.base.TenantEntity; |
|
|
|
import com.iformall.enums.EnumPayWay; |
|
|
|
import com.iformall.domain.po.WxAppinfo; |
|
|
|
import com.iformall.exception.MallinkException; |
|
|
|
import com.iformall.file.aliyun.AliyunOSS; |
|
|
|
import com.iformall.service.MallResourceService; |
|
|
|
import com.iformall.service.QrCodeService; |
|
|
|
import com.iformall.service.WxAppinfoService; |
|
|
|
@@ -57,7 +58,9 @@ public class QrCodeServiceImpl implements QrCodeService { |
|
|
|
@Autowired |
|
|
|
private String fmUploadDir; |
|
|
|
@Autowired |
|
|
|
private PayServiceFactory payServiceFactory; |
|
|
|
private PayServiceFactory payServiceFactory; |
|
|
|
@Autowired |
|
|
|
private AliyunOSS aliyunOSS; |
|
|
|
|
|
|
|
private AmazonS3 s3 = null; |
|
|
|
|
|
|
|
@@ -238,14 +241,16 @@ public class QrCodeServiceImpl implements QrCodeService { |
|
|
|
|
|
|
|
String fn = UUID.randomUUID().toString(); |
|
|
|
int dot = fileName.lastIndexOf('.'); |
|
|
|
String fileFormat = ""; |
|
|
|
if (dot >= 0) { |
|
|
|
String fileFormat = dest.getName().substring(dot, dest.getName().length()); |
|
|
|
fileFormat = dest.getName().substring(dot, dest.getName().length()); |
|
|
|
fn = getFileName(tenantEntity, fn + fileFormat); |
|
|
|
} else { |
|
|
|
fn = getFileName(tenantEntity, fn); |
|
|
|
} |
|
|
|
|
|
|
|
ResultData data = awsUpload(new FileInputStream(dest), metadata, fn, tenantEntity); |
|
|
|
// ResultData data = awsUpload(new FileInputStream(dest), metadata, fn, tenantEntity); |
|
|
|
ResultData data = aliyunOSS.uploadFile(tenantEntity.getTenantId(), fileFormat, new FileInputStream(dest)); |
|
|
|
org.apache.commons.io.FileUtils.forceDelete(dest); |
|
|
|
return data; |
|
|
|
} catch (Exception e) { |
|
|
|
|