Browse Source

经营报表

zouxuan 2 years ago
parent
commit
1babe64d96

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

@@ -58,8 +58,8 @@ public class OperatingReportNewServiceImpl extends BaseServiceImpl<Integer, Oper
 		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))));
 		//服务收入
-		//导入的销售收入(学校缴费)
-		Map<Integer, BigDecimal> collect22 = MapUtil.convertIntegerMap(operatingReportNewDao.sumImportSaleOrderAmount(currentMonth));
+		//导入的销售收入
+//		Map<Integer, BigDecimal> collect22 = MapUtil.convertIntegerMap(operatingReportNewDao.sumImportSaleOrderAmount(currentMonth));
 		//导入的服务收入  (全部记录为课程收入)
 		Map<Integer, BigDecimal> collect24 = MapUtil.convertIntegerMap(operatingReportNewDao.sumImportServerOrderAmount(currentMonth));
 		//云教练赠送课程实际收入
@@ -127,7 +127,6 @@ public class OperatingReportNewServiceImpl extends BaseServiceImpl<Integer, Oper
 				operatingReportNew.setSaleAmount(reportNew.getSaleAmount());
 				operatingReportNew.setSaleCost(reportNew.getSaleCost());
 			}
-			operatingReportNew.setSaleAmount(operatingReportNew.getSaleAmount().add(getAmount(collect22.get(organId))));
 
 			operatingReportNew.setCourseAmount(getAmount(collect1.get(organId)));
 			operatingReportNew.setCourseAmount(operatingReportNew.getCourseAmount().add(getAmount(collect2.get(organId))));

+ 1 - 30
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServiceImpl.java

@@ -227,36 +227,6 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean updateOperatingTempTag() {
-        /*List<StudentCourseTimesDto> studentCourseTimesDtoList = courseScheduleStudentPaymentDao.queryStudentNotStartCourseTimesOfOnline();
-        Map<Integer, StudentCourseTimesDto> map = studentCourseTimesDtoList.stream().collect(Collectors.toMap(StudentCourseTimesDto::getUserId, s -> s));
-        //查询服务指标为0的用户
-        List<Student> unlabeledStudentList = studentDao.queryByOperatingTempTag(0);
-
-        List<Student> updateStudentList = new ArrayList<Student>();
-        StudentCourseTimesDto dto = null;
-        for (Student s : unlabeledStudentList) {
-            if (s.getOperatingTag() == 1) {
-                continue;
-            }
-            dto = map.get(s.getUserId());
-            if (dto != null) {
-                if (dto.getTotalCourseTimes() > 0 && dto.getTotalCourseTimes() != dto.getFreePracticeCourseTimes()) {
-                    s.setOperatingTempTag(1);
-                    s.setOperatingTag(1);
-                    updateStudentList.add(s);
-                }
-            }
-        }
-
-        List<Student> labeledStudentList = studentDao.queryByOperatingTempTag(1);
-        for (Student s : labeledStudentList) {
-            dto = map.get(s.getUserId());
-            if (dto == null || dto.getTotalCourseTimes() == dto.getFreePracticeCourseTimes()) {
-                s.setOperatingTempTag(0);
-                s.setOperatingTag(0);
-                updateStudentList.add(s);
-            }
-        }*/
         String month = DateUtil.format(new Date(), DateUtil.ISO_YEAR_MONTH_FORMAT);
         studentOperatingVisitDao.deleteByUserId(month);
         List<Integer> operatingUserIds = studentDao.queryByOperatingTag(1);
@@ -268,6 +238,7 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
                 studentOperatingVisitDao.batchAdd(operatingUserIds,month);
             }
         }
+        //更新学员基本信息
         return true;
     }
 

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

@@ -320,7 +320,7 @@
 	<select id="sumImportServerOrderAmount" resultType="java.util.Map">
 		select spo.organ_id_,SUM(spro.service_amount_) from student_payment_order spo
 		LEFT JOIN student_payment_route_order spro ON spro.order_no_ = spo.order_no_
-		where spo.group_type_ = 'OUTORDER' AND DATE_FORMAT(spro.pay_time_,'%Y-%m') = #{month}
+		where spo.group_type_ = 'OUTORDER' AND DATE_FORMAT(spo.create_time_,'%Y-%m') = #{month}
 		GROUP BY spo.organ_id_;
 	</select>
 </mapper>

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

@@ -329,7 +329,7 @@
 		<include refid="queryStatisticsSql"/>
 	</select>
 	<select id="queryStatistics" resultMap="StudentStatisticsDto">
-		SELECT *,ss.not_start_course_fee_ + ss.no_course_fee_ preCourseFee,
+		SELECT sbi.*,ss.not_start_course_fee_ + ss.no_course_fee_ preCourseFee,
 			CASE WHEN (ss.no_schedule_num_ > 0 OR ss.sub_course_num_ > 0) AND (ss.lately_year_course_consumer_ > 0 OR ss.over_course_num_ &lt;= 0) THEN '在读'
 			WHEN ss.over_course_num_ > 0 AND (ss.sub_course_num_ > 0 OR ss.no_schedule_num_ > 0) AND ss.lately_year_course_consumer_ &lt;= 0 THEN '沉睡'
 			WHEN ss.over_course_num_ > 0 AND ss.sub_course_num_ &lt;= 0 AND ss.no_schedule_num_ &lt;= 0 AND suca.course_balance_ &lt;= 0 THEN '流失'