he2802 1 năm trước cách đây
mục cha
commit
cc2cc9e85d

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseMenuServiceImpl.java

@@ -79,7 +79,7 @@ public class CourseMenuServiceImpl extends ServiceImpl<CourseMenuMapper, CourseM
         //        courseMenuVo.setClassHours(Double.valueOf(String.format("%.2f", courseMenuVo.getDurationMinTime()/45.0)));
 //                courseMenuVo.setClassHours(Double.valueOf(df.format(courseMenuVo.getDurationMinTime()/45)));
 
-                courseMenuVo.setClassHours(Double.valueOf(String.format("%.1f", courseMenuVo.getDurationMinTime()/45.0)));
+                courseMenuVo.setClassHours(Double.valueOf(String.format("%.2f", courseMenuVo.getDurationMinTime()/45.0)));
             }
         });
         return list;

+ 4 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -411,7 +411,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
                         List<CourseMenuVo> courseMenuVoList = iCourseMenuService.selectList(bo1);
                         if (courseMenuVoList != null && courseMenuVoList.size() > 0) {
                             courseMenuVoList.forEach(courseMenuVo -> {
-                                classHours.updateAndGet(v -> v + Math.round(courseMenuVo.getClassHours()));
+                                classHours.updateAndGet(v -> v + courseMenuVo.getClassHours());
                                 if(courseMenuVo.getType()==1){
                                     //获取章信息
                                     List<CourseModuleChapterVo> courseModuleChapterVoList = iCourseModuleChapterService.getListById(courseMenuVo.getMenuId());
@@ -427,7 +427,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
                                             }
                                         });
                                     }
-                                    classHours.updateAndGet(v -> v + Math.round(chapterHours.get()));
+                                    classHours.updateAndGet(v -> v + chapterHours.get());
                                 }
                                 else if(courseMenuVo.getType()==2){
                                     AtomicReference<Double> chapterHours = new AtomicReference<>(0.0);
@@ -438,14 +438,14 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
                                             chapterHours.updateAndGet(v -> v + courseChapterSectionVo.getClassHours());
                                         });
                                     }
-                                    classHours.updateAndGet(v -> v + Math.round(chapterHours.get()));
+                                    classHours.updateAndGet(v -> v + chapterHours.get());
                                 }
 
                             });
                         }
                     });
                 }
-                goodsVo.setClassHours((new BigDecimal(String.valueOf(classHours))).setScale(0, HALF_UP));
+                goodsVo.setClassHours((new BigDecimal(String.valueOf(classHours))).setScale(0, BigDecimal.ROUND_HALF_UP));
             });
         }
         return list;