Commit 71b13819 authored by 董建华's avatar 董建华

修改一些格式问题

parent d804242d
......@@ -609,7 +609,7 @@ public class IReportServiceImpl implements ReportService {
// }
for (Integer moneyindex : MONEYINDEX) {
if (i == moneyindex) {
value = DateUtil.getInt(value);
value = utils.getInt(value);
}
}
......
......@@ -109,8 +109,4 @@ public class DateUtil {
return null;
}
public static String getInt(Object val){
return new BigDecimal(String.valueOf(val)).setScale(0,BigDecimal.ROUND_HALF_UP).toString();
}
}
......@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.*;
import java.math.BigDecimal;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.security.MessageDigest;
......@@ -155,8 +156,8 @@ public class Utils {
CryptoUtil.writeFile(b2, file2);
} catch (Exception e) {
e.printStackTrace();
throw new QgException("zip转enc失败",e);
}finally {
throw new QgException("zip转enc失败", e);
} finally {
System.gc();
}
return file2;
......@@ -168,12 +169,13 @@ public class Utils {
byte[] var4;
try {
MappedByteBuffer bytebuffer = fc.map(FileChannel.MapMode.READ_ONLY, 0L, fc.size()).load();
byte[] result = new byte[(int)fc.size()];
byte[] result = new byte[(int) fc.size()];
if (bytebuffer.remaining() > 0) {
bytebuffer.get(result, 0, bytebuffer.remaining());
}
var4 = result;System.gc();
var4 = result;
System.gc();
} catch (IOException var8) {
throw var8;
} finally {
......@@ -183,6 +185,7 @@ public class Utils {
}
return var4;
}
/**
* 国密解密 env转zip
*
......@@ -214,8 +217,8 @@ public class Utils {
CryptoUtil.writeFile(prb2, file3);
} catch (Exception e) {
e.printStackTrace();
throw new QgException("国密解密 env转zip异常",e);
}finally {
throw new QgException("国密解密 env转zip异常", e);
} finally {
//释放占用的文件
System.gc();
}
......@@ -238,13 +241,14 @@ public class Utils {
encodeBase64String = Base64.encodeBase64String(buffer);
} catch (IOException e) {
e.printStackTrace();
throw new QgException("读取file 转为base64字符串异常",e);
throw new QgException("读取file 转为base64字符串异常", e);
}
return encodeBase64String;
}
/**
* 将身份证的小写转为大写
*
* @param idCardNo
* @return
*/
......@@ -255,10 +259,13 @@ public class Utils {
return idCardNo;
}
public int random(int max) {
public int random(int max) {
Random random = new Random();
return random.nextInt(max);
}
public String getInt(Object val) {
return new BigDecimal(String.valueOf(val)).setScale(0, BigDecimal.ROUND_HALF_UP).toString();
}
}
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