Commit 6241d020 by 刘泽志

0202

parent 619cf8e1
......@@ -174,6 +174,12 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData
} catch (Exception ignore) {
}
}
// 这里需要进行四舍五入的精确位数处理
if(StringUtils.isNotBlank(rule.getRemarks())){
int scale = Integer.parseInt(rule.getRemarks());
left.setScale(scale,BigDecimal.ROUND_UP);
right.setScale(scale,BigDecimal.ROUND_UP);
}
if (left.compareTo(right) != 0) {
ExcelVO excelVO = new ExcelVO();
BeanUtils.copyProperties(excels[r], excelVO);
......@@ -278,6 +284,7 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData
}
public static void main(String[] args) {
System.out.println(new BigDecimal("0").add(new BigDecimal("")));
BigDecimal bigDecimal = new BigDecimal("1234567.123");
System.out.println(bigDecimal.setScale(5,BigDecimal.ROUND_DOWN).intValue());
}
}
......@@ -75,7 +75,7 @@
</select>
<select id="getAllRule" resultType="com.tbyf.his.web.dataImport.entity.DataRule">
select dr.id as id, dr.name as name, dr.mode as mode, dr.content as content
select dr.id as id, dr.name as name, dr.mode as mode, dr.content as content, dr.remarks as remarks
from bind_rule br
left join data_rule dr on br.rule_id = dr.id
where br.data_id = #{templateId}
......
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