|
@@ -4,6 +4,8 @@ import cn.hutool.core.io.FileUtil;
|
|
|
import cn.hutool.core.io.file.FileNameUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.core.util.ZipUtil;
|
|
|
+import cn.hutool.extra.qrcode.QrCodeUtil;
|
|
|
+import cn.hutool.extra.qrcode.QrConfig;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
@@ -109,6 +111,9 @@ public class BuildV3SceneServiceImpl implements IBuildSceneService {
|
|
|
@Autowired
|
|
|
private ISceneColdStorageService sceneColdStorageService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ICompanyService companyService;
|
|
|
+
|
|
|
@Override
|
|
|
public void buildScenePre(BuildSceneCallMessage message) {
|
|
|
boolean success = false;
|
|
@@ -263,7 +268,8 @@ public class BuildV3SceneServiceImpl implements IBuildSceneService {
|
|
|
uploadFiles.entrySet().stream().filter(entry-> FileNameUtil.getName(entry.getKey()).equals("floorplan_cad.json"))
|
|
|
.forEach(entry-> uploadHouseTypeJson(sceneCode,entry.getKey()));
|
|
|
|
|
|
-
|
|
|
+ //生成二维码
|
|
|
+ this.createQrcode(sceneCode);
|
|
|
|
|
|
//计算成功,通知APP
|
|
|
Integer pushChannel = fdageData.getInteger("pushChannel");
|
|
@@ -305,6 +311,30 @@ public class BuildV3SceneServiceImpl implements IBuildSceneService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void createQrcode(String num){
|
|
|
+ ScenePro scenePro = sceneProService.getByNum(num);
|
|
|
+ String logoPath = null;
|
|
|
+ if(Objects.nonNull(scenePro.getCameraId())){
|
|
|
+ CameraDetail cameraDetail = cameraDetailService.getByCameraId(scenePro.getId());
|
|
|
+ Company company = companyService.getById(cameraDetail.getCompanyId());
|
|
|
+ if(Objects.nonNull(company) && StrUtil.isNotEmpty(company.getQrLogo())){
|
|
|
+ logoPath = ConstantFilePath.BASE_PATH + File.separator + company.getQrLogo();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //生成二维码
|
|
|
+ String outPathZh = ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+ num +".png";
|
|
|
+ String outPathEn = ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+ num +"_en.png";
|
|
|
+ QrConfig qrConfig = QrConfig.create();
|
|
|
+ qrConfig.setWidth(1024);
|
|
|
+ qrConfig.setHeight(1024);
|
|
|
+ if(StrUtil.isNotEmpty(logoPath)){
|
|
|
+ qrConfig.setImg(logoPath);
|
|
|
+ }
|
|
|
+ QrCodeUtil.generate(scenePro.getWebSite(), qrConfig, FileUtil.file(outPathZh));
|
|
|
+ QrCodeUtil.generate(scenePro.getWebSite() + "&lang=en", qrConfig, FileUtil.file(outPathEn));
|
|
|
+ }
|
|
|
+
|
|
|
private void copyFiles(String path, String num) {
|
|
|
if (new File(path + File.separator + "results" + File.separator + "floor.json").exists()) {
|
|
|
FileUtils.copyFile(path + File.separator + "results" + File.separator + "floor.json", ConstantFilePath.SCENE_PATH + "data" + File.separator + "data" + num + File.separator + "floor.json", true);
|