Browse Source

Merge branch 'zx_saas_0810' of http://git.dayaedu.com/yonge/mec into master_saas

zouxuan 2 years ago
parent
commit
298fbc2066

+ 4 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/OperatingReportNewServiceImpl.java

@@ -67,12 +67,14 @@ public class OperatingReportNewServiceImpl extends BaseServiceImpl<Integer, Oper
 		Map<Integer, BigDecimal> collect22 = MapUtil.convertIntegerMap(operatingReportNewDao.sumLossCloudAmount(currentMonth));
 		//付费课程实际收入
 		Map<Integer, BigDecimal> collect2 = MapUtil.convertIntegerMap(operatingReportNewDao.sumCourseAmount(firstDayOfMonth,lastDayOfMonth));
+
 		//个人云教练当月收入
 		Map<Integer, BigDecimal> collect3 = MapUtil.convertIntegerMap(operatingReportNewDao.sumPersonalCloudAmount(currentMonth,firstDayOfMonth,lastDayOfMonth));
 		//团体云教练费用
 		Map<Integer, BigDecimal> collect4 = MapUtil.convertIntegerMap(operatingReportNewDao.sumGroupCloudAmount(currentMonth,firstDayOfMonth,lastDayOfMonth));
 		//团体云教练当月一次性结转
 		Map<Integer, BigDecimal> collect5 = MapUtil.convertIntegerMap(operatingReportNewDao.sumGroupAmount());
+
 		//乐保实收
 		Map<Integer, BigDecimal> collect26 = MapUtil.convertIntegerMap(operatingReportNewDao.sumMaintenanceAmount(currentMonth));
 
@@ -145,11 +147,11 @@ public class OperatingReportNewServiceImpl extends BaseServiceImpl<Integer, Oper
 			operatingReportNew.setCloudAmount(operatingReportNew.getCloudAmount().add(getAmount(collect22.get(organId))));
 
 			operatingReportNew.setMaintenanceAmount(getAmount(collect26.get(organId)));
+			operatingReportNew.setBusinessRefund(getAmount(collect6.get(organId)));
 
 			operatingReportNew.setServiceAmount(operatingReportNew.getCloudAmount().add(operatingReportNew.getCourseAmount()).add(operatingReportNew.getMaintenanceAmount()));
-			operatingReportNew.setTotalIncome(operatingReportNew.getSaleAmount().add(operatingReportNew.getServiceAmount()));
+			operatingReportNew.setTotalIncome(operatingReportNew.getSaleAmount().add(operatingReportNew.getServiceAmount()).subtract(operatingReportNew.getBusinessRefund()));
 
-			operatingReportNew.setBusinessRefund(getAmount(collect6.get(organId)));
 			operatingReportNew.setFixedCosts(getAmount(collect7.get(organId)));
 			operatingReportNew.setVariableCosts(getAmount(collect8.get(organId)));
 			operatingReportNew.setTotalCost(operatingReportNew.getBusinessRefund().

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/CloudTeacherFreeCourseMapper.xml

@@ -37,7 +37,7 @@
 		left join organ_course_type_original_cost oct1 ON oct1.course_type_ = cs.type_ AND oct1.organ_id_ = 0
 		where FIND_IN_SET(cs.id_,#{scheduleIdList})
 		GROUP BY cs.id_
-	</insert>
+	</insert>Ï
 
     <!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.CloudTeacherFreeCourse">

+ 0 - 1
mec-biz/src/main/resources/config/mybatis/OperatingReportNewMapper.xml

@@ -182,7 +182,6 @@
 		select so.organ_id_,SUM(so.actual_amount_) sale_amount_,SUM(CASE WHEN so.status_ = 1 THEN 0 ELSE so.sell_cost_ * so.num_ END) sale_cost_ from sell_order so
 		left join student_payment_order spo ON spo.order_no_ = so.order_no_
 		left join music_group mg ON mg.id_ = spo.music_group_id_ AND spo.group_type_ = 'MUSIC'
-		LEFT JOIN organization o ON o.id_ = so.organ_id_
 		where (mg.musical_instruments_provide_status_ = 1 AND mg.musical_instruments_provide_time_ = #{month}) OR
 		      (DATE_FORMAT(so.create_ime_,'%Y-%m') = #{month} AND (mg.musical_instruments_provide_status_ IS NULL OR mg.musical_instruments_provide_status_ = 1))
 		group by so.organ_id_

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/OrganCourseTypeOriginalCostMapper.xml

@@ -16,7 +16,7 @@
         where (organ_id_ = #{organId} OR organ_id_ = 0) AND course_type_ = #{courseType} limit 1
     </select>
     <select id="getCourseCostPrice" resultType="java.math.BigDecimal">
-        SELECT SUM(CASE WHEN oct.id_ IS NULL THEN oct1.price_ ELSE oct.price_ END cost_) FROM course_schedule cs
+        SELECT SUM(CASE WHEN oct.id_ IS NULL THEN oct1.price_ ELSE oct.price_ END) cost_ FROM course_schedule cs
         left join organ_course_type_original_cost oct ON oct.course_type_ = cs.type_ AND oct.organ_id_ = cs.organ_id_
         left join organ_course_type_original_cost oct1 ON oct1.course_type_ = cs.type_ AND oct1.organ_id_ = 0
         where FIND_IN_SET(cs.id_,#{courseIds})