浏览代码

云教室扣费四舍五入问题修改

hgw 3 年之前
父节点
当前提交
83c3daab6c
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantAssetsInfoServiceImpl.java

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantAssetsInfoServiceImpl.java

@@ -80,7 +80,7 @@ public class TenantAssetsInfoServiceImpl extends ServiceImpl<TenantAssetsInfoDao
             //计算总上课时间
             BigDecimal courseDate = getCourseDate(record.getClassDate(), record.getStartClassTime(), record.getEndClassTime());
             //课程总价 = 每分钟扣费标准 * 总上课时间
-            BigDecimal coursePrice = minutePrice.multiply(courseDate, new MathContext(2, RoundingMode.HALF_UP));
+            BigDecimal coursePrice = minutePrice.multiply(courseDate, new MathContext(3, RoundingMode.HALF_UP));
             //修改流水
             TenantCloudCourseRecord sourceCord = new TenantCloudCourseRecord();
             sourceCord.setId(record.getId());
@@ -133,7 +133,7 @@ public class TenantAssetsInfoServiceImpl extends ServiceImpl<TenantAssetsInfoDao
             //计算总上课时间
             BigDecimal courseDate = getCourseDate(course.getClassDate(), course.getStartClassTime(), course.getEndClassTime());
             //课程总价 = 每分钟扣费标准 * 总上课时间
-            BigDecimal coursePrice = minutePrice.multiply(courseDate, new MathContext(2, RoundingMode.HALF_UP));
+            BigDecimal coursePrice = minutePrice.multiply(courseDate, new MathContext(3, RoundingMode.HALF_UP));
             //写流水
             insertRecord(course, coursePrice, 1);
             log.info("deductAmount >>>>>> coursePrice {}  tenantId {}", coursePrice, course.getTenantId());