浏览代码

酷乐秀优化

zouxuan 1 天之前
父节点
当前提交
0c47c9e19b

+ 4 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/HomeDao.java

@@ -8,6 +8,7 @@ import com.yonge.cooleshow.biz.dal.vo.TagTotalTeacher;
 import com.yonge.cooleshow.biz.dal.vo.res.HomeTotalStudent;
 import com.yonge.cooleshow.biz.dal.vo.res.HomeTotalTeacher;
 import com.yonge.cooleshow.biz.dal.vo.res.HomeUserToDoNum;
+import com.yonge.cooleshow.biz.dal.wrapper.TeacherIndexWrapper;
 import com.yonge.cooleshow.biz.dal.wrapper.teacher.TeacherHomeWrapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -74,4 +75,7 @@ public interface HomeDao {
      * @return TeacherHomeWrapper.TeacherTotalCourse
      */
     List<TeacherHomeWrapper.TeacherTotalCourse> teacherTotalCourse(@Param("param") TeacherHomeWrapper.TeacherTotalCourseQuery query);
+
+    IPage<TeacherIndexWrapper.TeacherIncome> teacherIncomeList(@Param("page") IPage<TeacherIndexWrapper.TeacherIncome> page,
+                                                              @Param("param") TeacherIndexWrapper.CourseExposureSearch query);
 }

+ 22 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/HomeServiceImpl.java

@@ -7,6 +7,7 @@ import com.yonge.cooleshow.biz.dal.dao.MusicSheetDao;
 import com.yonge.cooleshow.biz.dal.dao.UserAccountRecordDao;
 import com.yonge.cooleshow.biz.dal.dto.SubjectHomeSearch;
 import com.yonge.cooleshow.biz.dal.dto.req.TotalReq;
+import com.yonge.cooleshow.biz.dal.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum;
 import com.yonge.cooleshow.biz.dal.enums.GoodTypeEnum;
 import com.yonge.cooleshow.biz.dal.enums.TeacherTagEnum;
@@ -58,6 +59,10 @@ public class HomeServiceImpl implements HomeService {
     private SysMusicCompareRecordService sysMusicCompareRecordService;
     @Resource
     private UserOrderDetailService userOrderDetailService;
+    @Resource
+    private SysUserService sysUserService;
+    @Resource
+    private StudentService studentService;
 
     @Override
     public HomeUserToDoNum getUserToDoNum() {
@@ -556,7 +561,23 @@ public class HomeServiceImpl implements HomeService {
 
     @Override
     public PageInfo<TeacherIndexWrapper.TeacherIncome> teacherIncomeList(IPage<TeacherIndexWrapper.TeacherIncome> page,TeacherIndexWrapper.CourseExposureSearch query) {
-        return null;
+        IPage<TeacherIndexWrapper.TeacherIncome> record = baserMapper.teacherIncomeList(page,query);
+        List<TeacherIndexWrapper.TeacherIncome> records = record.getRecords();
+        if (CollectionUtils.isNotEmpty(records)) {
+            List<Long> userIds = records.stream().map(TeacherIndexWrapper.TeacherIncome::getUserId).collect(Collectors.toList());
+            //获取用户声部信息
+//            studentService.querySubject()
+            List<SysUser> sysUsers = sysUserService.getDao().selectBatchIds(userIds);
+            Map<Long, SysUser> sysUserMap = sysUsers.stream().collect(Collectors.toMap(SysUser::getId, Function.identity()));
+            for (TeacherIndexWrapper.TeacherIncome teacherIncome : records) {
+                SysUser sysUser = sysUserMap.get(teacherIncome.getUserId());
+                if (sysUser != null) {
+                    teacherIncome.setUserName(sysUser.getUsername());
+                    teacherIncome.setUserAvatar(sysUser.getAvatar());
+                }
+            }
+        }
+        return PageUtil.pageInfo(record);
     }
 
 }

+ 12 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/HomeMapper.xml

@@ -526,4 +526,16 @@
 		</where>
 		group by t.good_type_
 	</select>
+	<select id="teacherIncomeList"
+			resultType="com.yonge.cooleshow.biz.dal.wrapper.TeacherIndexWrapper$TeacherIncome">
+		select uo.user_id_ userId,cg.course_num_ bizQuantity,ttar.trans_amount_ amount,uo.create_time_ orderTime
+		from tenant_teacher_account_record ttar
+		left join user_order uo ON uo.order_no_ = ttar.order_no_
+		left join user_order_detail uod ON uod.order_no_ = uo.order_no_
+		left join course_group cg ON cg.id_ = ttar.biz_id_
+		where uo.status_ = 'PAID' AND ttar.biz_type_ = uod.good_type_ AND ttar.in_or_out_ = 'IN'
+		AND uo.create_time_ BETWEEN #{param.startTime} AND #{param.endTime} AND ttar.teacher_id_ = #{param.teacherId}
+		AND ttar.biz_type_ = #{param.type}
+		order by uo.create_time_ desc
+	</select>
 </mapper>