| | |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.gistack.sm.skPanorama.entity.SkPanoramaEntity; |
| | |
| | | /** |
| | | * 对象存储构建类 |
| | | */ |
| | | @Autowired |
| | | private final IOssClient iOssClient; |
| | | |
| | | |
| | |
| | | public R cutPicture2(SkPanoramaEntity skPanorama) |
| | | throws IOException, InterruptedException, IM4JavaException, IllegalAccessException { |
| | | |
| | | SkPanoramaEntity entity = skPanoramaService.getOne(Condition.getQueryWrapper(skPanorama)); |
| | | SkPanoramaEntity entity = skPanoramaService.getById(skPanorama.getId()); |
| | | String picUrl = entity.getPicUrl(); |
| | | String picName = entity.getPicName(); |
| | | String resGuid = entity.getResGuid(); |
| | |
| | | String dirPath = linShiBaseUrl + resGuid + "/"; //临时文件夹路径 |
| | | String lingshiPic = linShiBaseUrl + resGuid + "/" + picName; //临时文件 |
| | | |
| | | File lingshiqjfile = getquanjingFile(dirPath,lingshiPic,entity); |
| | | File lingshiqjfile = getquanjingFile(dirPath,lingshiPic,entity.getId()); |
| | | |
| | | /** |
| | | * 这里开始切图 |
| | |
| | | return R.status(true); |
| | | } |
| | | |
| | | private File getquanjingFile (String dirPath ,String linshiUrl , SkPanoramaEntity skPanorama) throws IOException { |
| | | SkPanoramaEntity entity = skPanoramaService.getOne(Condition.getQueryWrapper(skPanorama)); |
| | | private File getquanjingFile (String dirPath ,String linshiUrl , Long id) throws IOException { |
| | | |
| | | // SkPanoramaEntity entity = skPanoramaService.getOne(Condition.getQueryWrapper(skPanorama)); |
| | | SkPanoramaEntity entity = skPanoramaService.getById(id); |
| | | String picUrl = entity.getPicUrl(); |
| | | String picName = entity.getPicName(); |
| | | String resGuid = entity.getResGuid(); |
| | |
| | | for (Long id : idlist ) { |
| | | FormateTuEntity formateTuEntity = new FormateTuEntity(); |
| | | |
| | | SkPanoramaEntity skPanorama = new SkPanoramaEntity(); |
| | | skPanorama.setId(id); |
| | | SkPanoramaEntity entity = skPanoramaService.getOne(Condition.getQueryWrapper(skPanorama)); |
| | | // SkPanoramaEntity skPanorama = new SkPanoramaEntity(); |
| | | // skPanorama.setId(id); |
| | | // SkPanoramaEntity entity = skPanoramaService.getOne(Condition.getQueryWrapper(skPanorama)); |
| | | SkPanoramaEntity entity = skPanoramaService.getById(id); |
| | | String picUrl = entity.getPicUrl(); |
| | | String picName = entity.getPicName(); |
| | | String resGuid = entity.getResGuid(); |
| | |
| | | String lingshigeshibilipath = linShiformateBaseUrl + resGuid + "/geshibili/" ; |
| | | String lingshigeshibiliPic = lingshigeshibilipath + picName; //格式化后的临时文件 |
| | | |
| | | File lingshiqjfile = getquanjingFile(dirPath,lingshiPic,entity); |
| | | File lingshiqjfile = getquanjingFile(dirPath,lingshiPic,id); |
| | | |
| | | // 创建文件夹 |
| | | File lingshigeshibilidir = new File(lingshigeshibilipath); |
| | |
| | | Integer height = imgInfoRT.get("height"); |
| | | if (width == height * 2) { |
| | | // 已经符合格式化标准 |
| | | |
| | | entity.setStatus(PanoramaUtilDict.panorama_status_2); |
| | | boolean b = skPanoramaService.updateBatchById(panoramalist); |
| | | return R.status( b); |
| | | } else { |
| | | Integer newWidth = height * 2; |
| | | // 图片格式化 |
| | |
| | | |
| | | boolean b = skPanoramaService.updateBatchById(panoramalist); |
| | | |
| | | return R.status(true); |
| | | return R.status( b); |
| | | } |
| | | |
| | | |