|
@@ -15,7 +15,9 @@ import com.fdkankan.common.exception.BusinessException;
|
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
import com.fdkankan.model.constants.ConstantFilePath;
|
|
|
import com.fdkankan.model.constants.UploadFilePath;
|
|
|
+import com.fdkankan.scene.entity.SceneEditInfoExt;
|
|
|
import com.fdkankan.scene.entity.ScenePro;
|
|
|
+import com.fdkankan.scene.service.ISceneEditInfoExtService;
|
|
|
import com.fdkankan.scene.service.ISceneProService;
|
|
|
import com.fdkankan.web.response.ResultData;
|
|
|
import com.fdkankan.redis.constant.RedisKey;
|
|
@@ -77,6 +79,8 @@ public class ScenePlusServiceImpl extends ServiceImpl<IScenePlusMapper, ScenePlu
|
|
|
private ISceneProService sceneProService;
|
|
|
@Autowired
|
|
|
private FYunFileServiceInterface fYunFileService;
|
|
|
+ @Autowired
|
|
|
+ private ISceneEditInfoExtService sceneEditInfoExtService;
|
|
|
|
|
|
@Override
|
|
|
public ScenePlus getScenePlusByNum(String num) {
|
|
@@ -205,24 +209,32 @@ public class ScenePlusServiceImpl extends ServiceImpl<IScenePlusMapper, ScenePlu
|
|
|
return ResultData.error(ErrorCode.FAILURE_CODE_5005);
|
|
|
}
|
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
+ SceneEditInfoExt sceneEditInfoExt = sceneEditInfoExtService.getByScenePlusId(scenePlus.getId());
|
|
|
|
|
|
String fileName = file.getOriginalFilename();
|
|
|
String extName = fileName.substring(fileName.lastIndexOf("."));
|
|
|
File newFile = File.createTempFile(UUID.randomUUID().toString() ,extName);
|
|
|
file.transferTo(newFile);
|
|
|
|
|
|
- String logoPah = newFile.getPath();
|
|
|
+ String logoPath = newFile.getPath();
|
|
|
|
|
|
String outPathZh = ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+num+".png";
|
|
|
String outPathEn = ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+num+"_en.png";
|
|
|
|
|
|
String webSize = mainUrl + "/" + sceneProNewUrl + num;
|
|
|
- QrCodeUtil.generate(webSize, QrConfig.create().setImg(logoPah), FileUtil.file(outPathZh));
|
|
|
- QrCodeUtil.generate(webSize + "&lang=en", QrConfig.create().setImg(logoPah), FileUtil.file(outPathEn));
|
|
|
+ QrCodeUtil.generate(webSize, QrConfig.create().setImg(logoPath), FileUtil.file(outPathZh));
|
|
|
+ QrCodeUtil.generate(webSize + "&lang=en", QrConfig.create().setImg(logoPath), FileUtil.file(outPathEn));
|
|
|
+ //上传logo图片
|
|
|
+ String ossLogoPath = String.format(UploadFilePath.DOWNLOADS_QRCODE, num) + "shareLogo" + extName;
|
|
|
+ fYunFileService.uploadFile(scenePlusExt.getYunFileBucket(), logoPath, ossLogoPath);
|
|
|
+
|
|
|
//上传二维码
|
|
|
fYunFileService.uploadFile(scenePlusExt.getYunFileBucket(), outPathZh, String.format(UploadFilePath.DOWNLOADS_QRCODE, num) + num + ".png");
|
|
|
fYunFileService.uploadFile(scenePlusExt.getYunFileBucket(), outPathEn, String.format(UploadFilePath.DOWNLOADS_QRCODE, num) + num + "_en.png");
|
|
|
|
|
|
+ sceneEditInfoExt.setShareLogoImg(ossLogoPath);
|
|
|
+ sceneEditInfoExtService.updateById(sceneEditInfoExt);
|
|
|
+
|
|
|
FileUtil.del(newFile);
|
|
|
FileUtil.del(new File(outPathEn));
|
|
|
FileUtil.del(new File(outPathZh));
|