Browse Source

经营报表相关改动

zouxuan 2 years ago
parent
commit
050b292f16

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java

@@ -757,4 +757,6 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
     * @date 2022/10/9 18:11
     */
     List<Map<Integer, String>> queryStudentEduMap(Integer userId);
+
+    void updateCourseFee(@Param("id") Long id, @Param("musicalFee") BigDecimal musicalFee);
 }

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

@@ -125,14 +125,13 @@ public class MusicGroupPaymentStudentCourseDetailServiceImpl extends BaseService
 							&& chargeType.getFee().compareTo(orderMusical.getPrice()) < 0){
 						musicalFee = orderMusical.getPrice().subtract(chargeType.getFee());
 						//累加充值金额
-						studentRegistration.setSurplusCourseFee(studentRegistration.getSurplusCourseFee().add(musicalFee));
-						studentRegistrationDao.update(studentRegistration);
+						studentRegistrationDao.updateCourseFee(studentRegistration.getId(),musicalFee);
 						//添加日志
 						StudentCourseFeeDetail studentCourseFeeDetail = new StudentCourseFeeDetail();
 						studentCourseFeeDetail.setTenantId(musicGroup.getTenantId());
 						studentCourseFeeDetail.setStudentRegistrationId(studentRegistration.getId());
 						studentCourseFeeDetail.setAmount(musicalFee);
-						studentCourseFeeDetail.setSurplusCourseFee(studentRegistration.getSurplusCourseFee());
+						studentCourseFeeDetail.setSurplusCourseFee(studentRegistration.getSurplusCourseFee().add(musicalFee));
 						studentCourseFeeDetail.setMemo("免费团,购买乐器赠送课费");
 						studentCourseFeeDetail.setOperator(userId);
 						studentCourseFeeDetailDao.insert(studentCourseFeeDetail);

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -1362,6 +1362,9 @@
             AND music_group_id_ = #{musicGroupId}
         </if>
     </update>
+    <update id="updateCourseFee">
+        UPDATE student_registration SET surplus_course_fee_ = surplus_course_fee_ + #{musicalFee} WHERE id_ = #{id}
+    </update>
 
     <select id="countPayingNum" resultType="map">
         SELECT COUNT(DISTINCT user_id_) `value`, actual_subject_id_ `key`