Parcourir la source

fix(n-motion-system): 修复ational课程价格保存逻辑

-调整了原始价格和销售价格的设置顺序,确保价格信息正确保存
- 优化了价格类型的判断逻辑,提高了代码的可读性和维护性
SheepHy il y a 1 semaine
Parent
commit
25ee73421d

+ 4 - 3
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppCoureseServiceImpl.java

@@ -86,9 +86,6 @@ public class AppCoureseServiceImpl extends ServiceImpl<AppCoursesMapper, AppCour
             appCourses.setTenantId(site.getTenantId());
             appCourses.setSiteId(site.getId());
         }
-        if (ObjUtil.isNotEmpty(appCourses.getOriginalPrice())){
-            appCourses.setOriginalPrice(appCourses.getSellingPrice());
-        }
         if (appCoursesDTO.getCourses().getSellingPrice() == null ||
                 appCoursesDTO.getCourses().getSellingPrice().compareTo(BigDecimal.ZERO) == 0) {
             appCourses.setPriceType(1);
@@ -96,6 +93,10 @@ public class AppCoureseServiceImpl extends ServiceImpl<AppCoursesMapper, AppCour
             appCourses.setPriceType(0);
         }
 
+        if (ObjUtil.isNotEmpty(appCourses.getOriginalPrice())){
+            appCourses.setOriginalPrice(appCourses.getSellingPrice());
+        }
+
         appCourses.setUserId(coursesCuDTO.getUserId());
         appCourses.setAddressSiteId(coursesCuDTO.getAddressSiteId());
         List<AppCoursesRuleDTO> coursesRuleDTOS = appCoursesDTO.getPriceRulesList();