Commit b62dabc1 by 徐高华

下载

parent 3edbbc43
......@@ -55,6 +55,8 @@ import com.gic.log.record.anno.GicLogRecord;
import com.gic.log.record.util.GicLogRecordCategoryEnum;
import com.gic.log.record.util.GicLogRecordEvaluationContext;
import com.gic.log.record.util.GicLogRecordOptTypeEnum;
import com.gic.qcloud.BucketNameEnum;
import com.gic.qcloud.FileUploadUtil;
import com.gic.thirdparty.cloudfile.CloudFileUtil;
import com.gic.thirdparty.cloudfile.enums.CloudFileBusinessOptEnum;
import com.gic.thirdparty.cloudfile.enums.CloudFileTypeEnum;
......@@ -410,7 +412,13 @@ public class GroupChatHmController {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
String qrCodeName = "群活码";
final String fileName = qrCodeName + "_" + sdf.format(new Date()) + ".zip";
final AuthorizedUser au = SessionContextUtils.getLoginUser();
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
String wxEnterpriseId = loginUser.getWxEnterpriseId();
String enterpriseId = loginUser.getEnterpriseId();
final AuthorizedUser au = new AuthorizedUser();
au.setEnterpriseId(enterpriseId);
au.setUserId(loginUser.getClerkId());
au.setRealName(loginUser.getClerkName());
String path = RequestThreadLocal.get().getSession().getServletContext().getRealPath("/chat/qrcode/");
String uuId = ToolUtil.randomUUID();
path = path + uuId;
......@@ -424,9 +432,6 @@ public class GroupChatHmController {
} catch (IOException e) {
}
}
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
String wxEnterpriseId = loginUser.getWxEnterpriseId();
String enterpriseId = loginUser.getEnterpriseId();
qdto.setEnterpriseId(enterpriseId);
qdto.setWxEnterpriseId(wxEnterpriseId);
qdto.setStatus(1);
......@@ -453,6 +458,7 @@ public class GroupChatHmController {
ZipOutputStream out = new ZipOutputStream(new FileOutputStream(tempFile));
for (GroupChatHmDTO dto : dtoList) {
String qrCodeUrl = dto.getWxQrCode();
logger.info("下载={}",qrCodeUrl);
if (StringUtils.isNotBlank(qrCodeUrl)) {
try {
ZipEntry e = new ZipEntry(dto.getChatHmCode() + "_" + dto.getName() + ".png");
......@@ -469,12 +475,14 @@ public class GroupChatHmController {
out.close();
} catch (IOException e) {
}
CloudFileTypeEnum cloudFileTypeEnum = CloudFileTypeEnum.OTHER;
/*CloudFileTypeEnum cloudFileTypeEnum = CloudFileTypeEnum.OTHER;
CloudFileInfo cloudFileInfo = CloudFileUtil.uploadFile(new FileInputStream(tempFile), "zip",
cloudFileTypeEnum, au.getEnterpriseDTO().getFactoryCode(),
CloudFileBusinessOptEnum.HAOBAN_COMMON);
CloudFileBusinessOptEnum.HAOBAN_COMMON);*/
String url = FileUploadUtil.simpleUploadFileFromLocal(tempFile, fileName, BucketNameEnum.COMPRESS_60000.getName());
DownloadReportDTO downloadReportDTO = new DownloadReportDTO();
downloadReportDTO.setDownloadUrl(cloudFileInfo.getOrgFileUrl());
downloadReportDTO.setDownloadUrl("https://" + url);
downloadReportService.updateDownloadReport(reportId, downloadReportDTO);
tempFile.deleteOnExit();
} catch (Exception e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment