Commit db292062 authored by hongguangwu's avatar hongguangwu

MVP1.7.9-税友图片大小

parent 47e08556
...@@ -33,6 +33,8 @@ public class ExcelToImage { ...@@ -33,6 +33,8 @@ public class ExcelToImage {
private final static String toImag ="\\ToImg.png"; private final static String toImag ="\\ToImg.png";
private static final String TO_IMAGE_TEMP ="\\ToImgTemp.png";
private final static String toImagParamError = ":带印章excel生成图片传参异常"; private final static String toImagParamError = ":带印章excel生成图片传参异常";
private final static String toImagConvertError = ":ExcelToImage转换异常-"; private final static String toImagConvertError = ":ExcelToImage转换异常-";
...@@ -90,7 +92,7 @@ public class ExcelToImage { ...@@ -90,7 +92,7 @@ public class ExcelToImage {
File originalFile = Paths.get(projectRoot, toImag).toFile(); File originalFile = Paths.get(projectRoot, toImag).toFile();
BufferedImage image = ImageIO.read(originalFile); BufferedImage image = ImageIO.read(originalFile);
int quality = 100; // 从100%开始 int quality = 100; // 从100%开始
File compressedFile = new File(projectRoot, "compressed_" + toImag); File compressedFile = new File(projectRoot, TO_IMAGE_TEMP);
while (originalFile.length() > maxSize && quality > 10) { while (originalFile.length() > maxSize && quality > 10) {
quality -= 5; quality -= 5;
ImageIO.write(image, "png", compressedFile); ImageIO.write(image, "png", compressedFile);
......
...@@ -2271,6 +2271,12 @@ ...@@ -2271,6 +2271,12 @@
<if test="tDispatchInfo.socialId != null and tDispatchInfo.socialId.trim() != ''"> <if test="tDispatchInfo.socialId != null and tDispatchInfo.socialId.trim() != ''">
AND a.SOCIAL_ID = #{tDispatchInfo.socialId} AND a.SOCIAL_ID = #{tDispatchInfo.socialId}
</if> </if>
<if test="tDispatchInfo.socialIdList != null and tDispatchInfo.socialIdList.size > 0 ">
AND a.SOCIAL_ID in
<foreach item="items" index="index" collection="tDispatchInfo.socialIdList" open="(" separator="," close=")">
#{items}
</foreach>
</if>
<if test="tDispatchInfo.syFlag != null and tDispatchInfo.syFlag.trim() == '1'"> <if test="tDispatchInfo.syFlag != null and tDispatchInfo.syFlag.trim() == '1'">
AND a.STATUS = '2' AND a.STATUS = '2'
</if> </if>
......
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