Browse Source

经营报表

zouxuan 2 years ago
parent
commit
a2a34a91c8

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/ExportEnum.java

@@ -78,6 +78,7 @@ public enum ExportEnum implements BaseEnum<String, ExportEnum> {
     EXPORT_STUDENT_SERVE_INFO("EXPORT_STUDENT_SERVE_INFO", "乐团学生服务指标导出"),
     EXPORT_TRAINING_STATISTICS("EXPORT_TRAINING_STATISTICS", "训练统计导出"),
     EXPORT_OPERATING_VISIT_STATISTICS("EXPORT_OPERATING_VISIT_STATISTICS", "回访统计导出"),
+    EXPORT_OPERATING_REPORT_NEW("EXPORT_OPERATING_REPORT_NEW", "经营报表导出"),
     ;
 
     private String code;

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExportServiceImpl.java

@@ -180,6 +180,8 @@ public class ExportServiceImpl implements ExportService {
     private SysMusicCompareRecordDao sysMusicCompareRecordDao;
     @Autowired
     private StudentOperatingVisitDao studentOperatingVisitDao;
+    @Autowired
+    private OperatingReportNewService operatingReportNewService;
 
     private static final ExecutorService exportExecutorService = Executors.newFixedThreadPool(10);
     @Autowired
@@ -346,6 +348,7 @@ public class ExportServiceImpl implements ExportService {
         exportFuncMap.put(ExportEnum.EXPORT_BILL, info -> exportBill(info));
         exportFuncMap.put(ExportEnum.EXPORT_OPERATING_VISIT_STATISTICS, info -> exportOperatorVisit(info));
         exportFuncMap.put(ExportEnum.EXPORT_STUDENT_SERVE_INFO, (info) -> exportStudentServeInfo(info));
+        exportFuncMap.put(ExportEnum.EXPORT_OPERATING_REPORT_NEW, (info) -> exportOperatingNew(info));
 
 
         //导出到报表中心
@@ -386,6 +389,13 @@ public class ExportServiceImpl implements ExportService {
         return studentOperatingVisitDao.sumVisit(month,tenantId.equals("-1")?null:tenantId);
     }
 
+    //经营报表
+    private List<OperatingReportNew> exportOperatingNew(Map<String, Object> info){
+        OperatingReportNewQueryInfo queryInfo = JSONObject.parseObject(JSONObject.toJSONString(info), OperatingReportNewQueryInfo.class);
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
+        return operatingReportNewService.queryPage(queryInfo).getRows();
+    }
+
 
     //导出对账单
     @Override

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

@@ -51,9 +51,9 @@ public class OperatingReportNewServiceImpl extends BaseServiceImpl<Integer, Oper
 		//更新团体云教练计费时间()
 		operatingReportNewDao.initCloudStartTime(lastDayOfMonth);
 		//标记缴费项目为已结算(已排课,并且在上个月有关联的课程)
-		operatingReportCloudDao.settlementCalender(currentMonth);
+//		operatingReportCloudDao.settlementCalender(currentMonth);
 		//标记当月结算的缴费项目(缴费项目结算后缴费、或者进行中加学员的都算当月结算)
-		operatingReportCloudDao.settlementCurrentCalender(currentMonth);
+//		operatingReportCloudDao.settlementCurrentCalender(currentMonth);
 		//销售收入、销售成本
 		List<OperatingReportNew> sellList = operatingReportNewDao.sumSellAmount(currentMonth);
 		Map<Integer, OperatingReportNew> collect = sellList.stream().collect(Collectors.groupingBy(OperatingReportNew::getOrganId,Collectors.collectingAndThen(Collectors.toList(),value->value.get(0))));

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

@@ -239,13 +239,13 @@
 	<select id="sumCloudCoursePreAmount" resultType="java.util.Map">
 		SELECT cs.organ_id_ 'key',SUM(ctf.cost_) 'value' FROM cloud_teacher_free_course ctf
 		LEFT JOIN course_schedule cs ON cs.id_ = ctf.course_id_
-		where cs.del_flag_ = 0 AND cs.is_lock_ = 0 AND cs.class_date_ > #{lastDay}
+		where cs.del_flag_ = 0 AND cs.is_lock_ = 0 AND cs.pre_course_flag_ = 0 AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_) AND cs.class_date_ > #{lastDay}
 		group by cs.organ_id_;
 	</select>
 	<select id="sumCoursePreAmount" resultType="java.util.Map">
 		SELECT cs.organ_id_ 'key',SUM(cssp.actual_price_) 'value' FROM course_schedule cs
 		LEFT JOIN course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
-		where cs.del_flag_ = 0 AND cs.is_lock_ = 0 AND cs.class_date_ > #{lastDay}
+		where cs.del_flag_ = 0 AND cs.is_lock_ = 0 AND cs.pre_course_flag_ = 0 AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_) cs.class_date_ > #{lastDay}
 		group by cs.organ_id_;
 	</select>
 	<select id="sumOtherPreAmount" resultType="java.util.Map">