Browse Source

fix(app): 修复约课类型课程下单时的设备获取逻辑- 优化了 AppSite 对象的查询逻辑,避免多次数据库查询
- 修改了设备获取条件,从按 orgCode 查询改为按 siteId 查询
- 增加了对 appSite 是否为空的判断,提高代码健壮性

SheepHy 3 tuần trước cách đây
mục cha
commit
9d6593f52c

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

@@ -960,9 +960,10 @@ public class OrderServiceImpl implements IOrderService {
                     .setTicketNo(RandomUtil.randomNumbers(10))
             ;
             if(appOrderProInfoMapper.insert(appOrderProInfo) > 0){
-                if(appOrderProInfo.getType() == 5 &&
-                        appSiteMapper.selectById(appCoursesMapper.selectById(appOrderProInfo.getProductId()).getAddressSiteId()).getType() == 0){
-                    for (AppDevice appDevice : appDeviceMapper.selectList(Wrappers.<AppDevice>lambdaQuery().eq(AppDevice::getOrgCode, appOrder.getOrgCode()))){
+                AppSite appSite = appSiteMapper.selectById(appCoursesMapper.selectById(appOrderProInfo.getProductId()).getAddressSiteId());
+                if(null != appSite && appOrderProInfo.getType() == 5 &&
+                        appSite.getType() == 0){
+                    for (AppDevice appDevice : appDeviceMapper.selectList(Wrappers.<AppDevice>lambdaQuery().eq(AppDevice::getSiteId, appSite.getId()))){
                         if(null != appDevice){
                             JsonObject addUserJson = JsonParser.parseString(addUser(new Date(),
                                     appDevice.getDeviceSerial(),