Ver Fonte

修复补课通知bug

zhangxin há 3 semanas atrás
pai
commit
dca19389e5

+ 1 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/AppCoursesPriceRulesMapper.java

@@ -16,5 +16,5 @@ import java.util.List;
 public interface AppCoursesPriceRulesMapper extends BaseMapper<AppCoursesPriceRules> {
     List<String> selectRuleIdsByCourseId(@Param("coursesId") String coursesId);
 
-    JobExtendedClassNoticeVo findByClassPrice(@Param("userId") String userId);
+    JobExtendedClassNoticeVo findByClassPrice(@Param("userId") String userId,@Param("id") String id);
 }

+ 1 - 4
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppCoursesPriceRulesMapper.xml

@@ -9,9 +9,6 @@
         LEFT JOIN nm_order b on b.id =a.order_id
         LEFT JOIN nm_courses c on a.courses_id = c.id
         LEFT JOIN nm_site d on  c.address_site_id =d.id
-        where a.use_user_id = #{userId}
-        GROUP BY b.user_open_id,d.`name`
-        order by b.user_open_id desc
-        limit 1
+        where a.use_user_id = #{userId} and a.courses_price_rule_id = #{id} order by  a.create_time desc limit 1
     </select>
 </mapper>

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

@@ -451,7 +451,7 @@ public class AppCoureseServiceImpl extends ServiceImpl<AppCoursesMapper, AppCour
             verificationRecord.setVerifyStatus(CommonConstant.STATUS_0_INT);
             verificationRecord.setCoursesType(CommonConstant.STATUS_1_INT);
             appCoursesVerificationRecordMapper.insert(verificationRecord);
-            JobExtendedClassNoticeVo jobExtendedClassNoticeVo =  priceRulesMapper.findByClassPrice(familyMembers.getId());
+            JobExtendedClassNoticeVo jobExtendedClassNoticeVo =  priceRulesMapper.findByClassPrice(familyMembers.getId(),coursesPriceRules.getId());
             if (jobExtendedClassNoticeVo==null||StringUtils.isEmpty(jobExtendedClassNoticeVo.getUserOpenId())|| StringUtils.isEmpty(jobExtendedClassNoticeVo.getSiteName())){
                 continue;
             }
@@ -459,7 +459,10 @@ public class AppCoureseServiceImpl extends ServiceImpl<AppCoursesMapper, AppCour
             jobExtendedClassNoticeVos.add(jobExtendedClassNoticeVo);
 
         }
-        wxNotificationService.extendedClassesJob(jobExtendedClassNoticeVos);
+        if (!jobExtendedClassNoticeVos.isEmpty()){
+            wxNotificationService.extendedClassesJob(jobExtendedClassNoticeVos);
+        }
+
         return Boolean.TRUE;
     }