|
@@ -73,6 +73,7 @@ import com.ruoyi.project.business.service.quotation.*;
|
|
|
import com.ruoyi.project.system.domain.SysDictData;
|
|
|
import com.ruoyi.project.system.mapper.SysDictDataMapper;
|
|
|
import fr.opensagres.xdocreport.document.images.FileImageProvider;
|
|
|
+import fr.opensagres.xdocreport.document.images.IImageInfo;
|
|
|
import fr.opensagres.xdocreport.template.formatter.NullImageBehaviour;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -1255,11 +1256,12 @@ public class TqQuotationServiceImpl extends ServiceImpl<TqQuotationMapper, TqQuo
|
|
|
String path = RuoYiConfig.getProfile() + StringUtils.substringAfter(imageMap.get(key).get(0).getPrarSource(), Constants.RESOURCE_PREFIX);
|
|
|
FileImageProvider file = new FileImageProvider(new File(path), true);
|
|
|
try {
|
|
|
- if (file.getImageInfo().getWidth() > 250f){
|
|
|
+ IImageInfo imageInfo = file.getImageInfo();
|
|
|
+ if (imageInfo.getWidth() > 250f && imageInfo.getWidth() >= imageInfo.getHeight()){
|
|
|
file.setWidth(250f);
|
|
|
file.setResize(true);
|
|
|
}
|
|
|
- if (file.getImageInfo().getHeight() > 250f){
|
|
|
+ if (imageInfo.getHeight() > 250f && imageInfo.getHeight() >= imageInfo.getWidth()){
|
|
|
file.setHeight(250f);
|
|
|
file.setResize(true);
|
|
|
}
|
|
@@ -1322,10 +1324,15 @@ public class TqQuotationServiceImpl extends ServiceImpl<TqQuotationMapper, TqQuo
|
|
|
FileImageProvider file = new FileImageProvider(new File(path), true);
|
|
|
file.setBehaviour(NullImageBehaviour.RemoveImageTemplate);
|
|
|
try {
|
|
|
- if (file.getImageInfo().getWidth() > 600f){
|
|
|
+ IImageInfo imageInfo = file.getImageInfo();
|
|
|
+ if (imageInfo.getWidth() > 600f && imageInfo.getWidth() >= imageInfo.getHeight()){
|
|
|
file.setWidth(600f);
|
|
|
file.setResize(true);
|
|
|
}
|
|
|
+ if (imageInfo.getHeight() > 600f && imageInfo.getHeight() >= imageInfo.getWidth()){
|
|
|
+ file.setHeight(600f);
|
|
|
+ file.setResize(true);
|
|
|
+ }
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|