Browse Source

Merge remote-tracking branch 'origin/master'

zouxuan 2 years ago
parent
commit
e2348822cb
52 changed files with 1351 additions and 176 deletions
  1. 70 0
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/PianoRoomSettingsController.java
  2. 3 3
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/VipCardRecordController.java
  3. 6 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/CourseGroupDao.java
  4. 4 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/CourseScheduleDao.java
  5. 29 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/CourseScheduleRecordDao.java
  6. 4 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/CourseScheduleStudentDao.java
  7. 39 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/PianoRoomSettingsDao.java
  8. 23 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/PianoRoomTimeDao.java
  9. 0 14
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/PinaoRoomTimeDao.java
  10. 8 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/StudentDao.java
  11. 5 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/UserBindingTeacherDao.java
  12. 3 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/VipCardRecordDao.java
  13. 24 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/PianoRoomSettingsDto.java
  14. 14 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/PianoRoomSettingsSearch.java
  15. 114 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/CourseScheduleRecord.java
  16. 123 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/PianoRoomSettings.java
  17. 1 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/PianoRoomTime.java
  18. 2 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/enums/GoodTypeEnum.java
  19. 5 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/CourseScheduleService.java
  20. 33 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/PianoRoomSettingsService.java
  21. 2 2
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/PianoRoomTimeService.java
  22. 17 4
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/StudentService.java
  23. 24 17
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/VipCardRecordService.java
  24. 90 22
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseScheduleServiceImpl.java
  25. 41 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/PianoRoomSettingsServiceImpl.java
  26. 20 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/PianoRoomTimeServiceImpl.java
  27. 0 20
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/PinaoRoomTimeServiceImpl.java
  28. 56 2
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/StudentServiceImpl.java
  29. 4 6
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/VipCardRecordServiceImpl.java
  30. 34 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/CourseCompleteVo.java
  31. 114 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/CourseScheduleRecordVo.java
  32. 74 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/CourseScheduleStudentVo.java
  33. 24 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/PianoRoomSettingsVo.java
  34. 2 2
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/PianoRoomTimeVo.java
  35. 8 1
      cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseGroupMapper.xml
  36. 4 1
      cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  37. 56 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseScheduleRecordMapper.xml
  38. 13 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseScheduleStudentMapper.xml
  39. 53 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/PianoRoomSettingsMapper.xml
  40. 26 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/PianoRoomTimeDao.xml
  41. 0 12
      cooleshow-user/user-biz/src/main/resources/config/mybatis/PinaoRoomTimeMapper.xml
  42. 21 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/StudentMapper.xml
  43. 47 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/UserBindingTeacherMapper.xml
  44. 10 4
      cooleshow-user/user-biz/src/main/resources/config/mybatis/VipCardRecordMapper.xml
  45. 1 1
      cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/config/ResourceServerConfig.java
  46. 9 0
      cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/MemberPriceSettingsController.java
  47. 0 2
      cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/StudentController.java
  48. 3 3
      cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/VipCardRecordController.java
  49. 58 0
      cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/open/OpenClient.java
  50. 30 2
      cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/TeacherCourseScheduleController.java
  51. 0 24
      toolset/toolset-payment/src/main/resources/apiclient_cert.pem
  52. 0 28
      toolset/toolset-payment/src/main/resources/apiclient_key.pem

+ 70 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/PianoRoomSettingsController.java

@@ -0,0 +1,70 @@
+package com.yonge.cooleshow.admin.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.toolset.base.page.PageInfo;
+import com.yonge.cooleshow.common.controller.BaseController;
+import com.yonge.cooleshow.common.entity.HttpResponseResult;
+import com.yonge.cooleshow.biz.dal.support.PageUtil;
+
+import com.yonge.toolset.utils.string.StringUtil;
+import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+
+import com.yonge.cooleshow.biz.dal.vo.PianoRoomSettingsVo;
+import com.yonge.cooleshow.biz.dal.dto.search.PianoRoomSettingsSearch;
+import com.yonge.cooleshow.biz.dal.entity.PianoRoomSettings;
+import com.yonge.cooleshow.biz.dal.service.PianoRoomSettingsService;
+
+import java.util.Date;
+
+@RestController
+@RequestMapping("/pianoRoomSettings")
+@Api(value = "琴房时长价格配置", tags = "")
+public class PianoRoomSettingsController extends BaseController {
+
+    @Autowired
+    private PianoRoomSettingsService pianoRoomSettingsService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    /**
+     * 查询单条
+     */
+    @GetMapping("/detail/{id}")
+    @ApiOperation(value = "详情", notes = "传入id")
+    public HttpResponseResult<PianoRoomSettingsVo> detail(@PathVariable("id") Long id) {
+        return succeed(pianoRoomSettingsService.detail(id));
+    }
+
+    /**
+     * 查询分页
+     */
+    @PostMapping("/page")
+    @ApiOperation(value = "查询分页", notes = "传入pianoRoomSettingsSearch")
+    public HttpResponseResult<PageInfo<PianoRoomSettingsVo>> page(@RequestBody PianoRoomSettingsSearch query) {
+        IPage<PianoRoomSettingsVo> pages = pianoRoomSettingsService.selectPage(PageUtil.getPage(query), query);
+        return succeed(PageUtil.pageInfo(pages));
+    }
+
+    /**
+     * 修改
+     */
+    @PostMapping("/update")
+    @ApiOperation(value = "修改", notes = "传入pianoRoomSettings")
+    public HttpResponseResult update(@Valid @RequestBody PianoRoomSettings pianoRoomSettings) {
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if (user == null || user.getId() == null) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+        pianoRoomSettings.setUpdateBy(user.getId());
+        pianoRoomSettings.setUpdateTime(new Date());
+        return status(pianoRoomSettingsService.updateById(pianoRoomSettings));
+    }
+
+}

+ 3 - 3
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/VipCardRecordController.java

@@ -24,10 +24,10 @@ public class VipCardRecordController extends BaseController {
 	/**
      * 查询单条
      */
-    @GetMapping("/detail/{id}")
+    @GetMapping("/detail/{orderDetilId")
     @ApiOperation(value = "详情", notes = "传入id")
-    public HttpResponseResult<VipCardRecordVo> detail(@PathVariable("id") Long id) {
-    	return succeed(vipCardRecordService.detail(id));
+    public HttpResponseResult<VipCardRecordVo> detail(@PathVariable("orderDetilId") Long orderDetilId) {
+    	return succeed(vipCardRecordService.detail(orderDetilId));
 	}
     
     /**

+ 6 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/CourseGroupDao.java

@@ -179,5 +179,11 @@ public interface CourseGroupDao extends BaseMapper<CourseGroup> {
      * @return
      */
     CourseGroupInfoVo selectGroupInfoVo(Long groupId);
+
+    /**
+     * 批量更新组状态
+     * @param list
+     */
+    void updateBatch(List<Long> list);
 }
 

+ 4 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/CourseScheduleDao.java

@@ -218,11 +218,14 @@ public interface CourseScheduleDao extends BaseMapper<CourseSchedule> {
     void updateStartTime(List<CourseSchedule> list);
 
     //更新课程状态
-    void updateEndTime(List<CourseSchedule> list);
+    void updateEndTime(List<CourseScheduleStudentVo> list);
 
     //根据日期查课程id
     List<Long> selectIdList(String day);
 
     //更新老师课酬
     void updateTeacherSalary(List<Long> list);
+
+    //查询已完成课时
+    List<CourseCompleteVo> selectComplete();
 }

+ 29 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/CourseScheduleRecordDao.java

@@ -0,0 +1,29 @@
+package com.yonge.cooleshow.biz.dal.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.yonge.cooleshow.biz.dal.entity.CourseScheduleRecord;
+import com.yonge.cooleshow.biz.dal.vo.CourseScheduleRecordVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Author: cy
+ * @Date: 2022/5/30
+ */
+public interface CourseScheduleRecordDao extends BaseMapper<CourseScheduleRecord> {
+    //统计人数&时长
+    List<CourseScheduleRecord> sumCourseTime();
+
+    //批量添加
+    void insertBatch(@Param("recordList") List<CourseScheduleRecord> recordList);
+
+    //消耗时长
+    Long countTimeByTeacherId(@Param("teacherId")Long teacherId,@Param("month") String month);
+
+    //消耗时长详情
+    IPage<CourseScheduleRecordVo> selectConsumeTimeList(Page<CourseScheduleRecordVo> pageInfo, @Param("param") Map<String, Object> param);
+}

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

@@ -2,6 +2,7 @@ package com.yonge.cooleshow.biz.dal.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.yonge.cooleshow.biz.dal.entity.CourseScheduleStudent;
+import com.yonge.cooleshow.biz.dal.vo.CourseScheduleStudentVo;
 
 import java.util.List;
 
@@ -12,4 +13,7 @@ import java.util.List;
 public interface CourseScheduleStudentDao extends BaseMapper<CourseScheduleStudent> {
     //批量添加学员
     void insertBatch(List<CourseScheduleStudent> list);
+
+    //查询课程对应的老师学员
+    List<CourseScheduleStudentVo> selectUser();
 }

+ 39 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/PianoRoomSettingsDao.java

@@ -0,0 +1,39 @@
+package com.yonge.cooleshow.biz.dal.dao;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.biz.dal.dto.search.MemberPriceSettingsSearch;
+import com.yonge.cooleshow.biz.dal.vo.MemberPriceSettingsVo;
+import org.apache.ibatis.annotations.Param;
+import com.yonge.cooleshow.biz.dal.entity.PianoRoomSettings;
+import com.yonge.cooleshow.biz.dal.vo.PianoRoomSettingsVo;
+import com.yonge.cooleshow.biz.dal.dto.search.PianoRoomSettingsSearch;
+
+
+public interface PianoRoomSettingsDao extends BaseMapper<PianoRoomSettings>{
+	/**
+	 * 查询详情
+     * @author liweifan
+     * @date 2022-05-30 15:54:20
+     * @return: com.yonge.cooleshow.biz.dal.vo.PianoRoomSettingsVo
+	 */
+	PianoRoomSettingsVo detail(@Param("id") Long id);
+	/**
+	 * 分页查询
+	 * @author liweifan
+	 * @date 2022-04-25 14:34:49
+	 * @return: com.yonge.cooleshow.biz.dal.vo.MemberPriceSettingsVo
+	 */
+	List<PianoRoomSettingsVo> selectPage(@Param("page") IPage page, @Param("param") PianoRoomSettingsSearch param);
+	/***
+	 * 查询集合
+	 * @author liweifan
+	 * @param: param
+	 * @updateTime 2022/4/25 14:58
+	 * @return: java.util.List<com.yonge.cooleshow.biz.dal.vo.MemberPriceSettingsVo>
+	 */
+	List<PianoRoomSettingsVo> selectList(@Param("param") PianoRoomSettingsSearch param);
+
+}

+ 23 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/PianoRoomTimeDao.java

@@ -0,0 +1,23 @@
+package com.yonge.cooleshow.biz.dal.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yonge.cooleshow.biz.dal.entity.PianoRoomTime;
+import com.yonge.cooleshow.biz.dal.vo.CourseScheduleStudentVo;
+import com.yonge.cooleshow.biz.dal.vo.PianoRoomTimeVo;
+
+import java.util.List;
+
+/**
+ * @Author: cy
+ * @Date: 2022/5/26
+ */
+public interface PianoRoomTimeDao extends BaseMapper<PianoRoomTime> {
+    //查询琴房剩余时长、冻结时长、统计学员人数
+    PianoRoomTimeVo selectRemainTime(Long teacherId);
+
+    //更新结课时间
+    void updateEndTime(List<CourseScheduleStudentVo> list);
+
+    //释放冻结时间
+    void updateBatch(List<PianoRoomTime> list);
+}

+ 0 - 14
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/PinaoRoomTimeDao.java

@@ -1,14 +0,0 @@
-package com.yonge.cooleshow.biz.dal.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.yonge.cooleshow.biz.dal.entity.PinaoRoomTime;
-import com.yonge.cooleshow.biz.dal.vo.PinaoRoomTimeVo;
-
-/**
- * @Author: cy
- * @Date: 2022/5/26
- */
-public interface PinaoRoomTimeDao extends BaseMapper<PinaoRoomTime> {
-    //查询琴房剩余时长、冻结时长、统计学员人数
-    PinaoRoomTimeVo selectRemainTime(Long teacherId);
-}

+ 8 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/StudentDao.java

@@ -21,6 +21,14 @@ public interface StudentDao extends BaseMapper<Student> {
      * @return: com.yonge.cooleshow.biz.dal.vo.StudentVo
      */
     StudentVo detail(@Param("userId") Long userId);
+    /***
+     * 查询详情
+     * @author liweifan
+     * @param: phone
+     * @updateTime 2022/3/24 18:14
+     * @return: com.yonge.cooleshow.biz.dal.vo.StudentVo
+     */
+    StudentVo detailByPhone(@Param("phone")String phone);
 
     /**
      * 自定义分页

+ 5 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/UserBindingTeacherDao.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.yonge.cooleshow.biz.dal.entity.UserBindingTeacher;
 import com.yonge.cooleshow.biz.dal.vo.CourseStudentVo;
+import com.yonge.cooleshow.biz.dal.vo.TeacherVo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.Map;
@@ -15,5 +16,8 @@ import java.util.Map;
  */
 public interface UserBindingTeacherDao extends BaseMapper<UserBindingTeacher> {
     //查询学员
-    IPage<CourseStudentVo> selectStudent(Page<CourseStudentVo> pageInfo,@Param("param") Map<String, Object> param);
+    IPage<CourseStudentVo> selectStudent(Page<CourseStudentVo> pageInfo, @Param("param") Map<String, Object> param);
+    //查询绑定的老师
+    TeacherVo getBindTeacherByPhone(@Param("phone") String phone);
+
 }

+ 3 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/VipCardRecordDao.java

@@ -11,6 +11,7 @@ import com.yonge.cooleshow.biz.dal.dto.search.VipCardRecordSearch;
 
 
 public interface VipCardRecordDao extends BaseMapper<VipCardRecord> {
+
     /**
      * 查询详情
      *
@@ -18,7 +19,7 @@ public interface VipCardRecordDao extends BaseMapper<VipCardRecord> {
      * @date 2022-03-30 13:53:51
      * @return: com.yonge.cooleshow.biz.dal.vo.VipCardRecordVo
      */
-    VipCardRecordVo detail(@Param("id") Long id, @Param("userId") Long userId);
+    VipCardRecordVo detail(@Param("orderDetilId") Long orderDetilId, @Param("userId") Long userId);
 
     /**
      * 分页查询
@@ -44,4 +45,5 @@ public interface VipCardRecordDao extends BaseMapper<VipCardRecord> {
      * @return: java.util.List<com.yonge.cooleshow.biz.dal.vo.VipCardRecordVo>
      */
     List<VipCardRecordVo> selectExpireRecord();
+
 }

+ 24 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/PianoRoomSettingsDto.java

@@ -0,0 +1,24 @@
+package com.yonge.cooleshow.biz.dal.dto;
+
+import com.yonge.cooleshow.biz.dal.entity.PianoRoomSettings;
+import io.swagger.annotations.ApiModel;
+import org.apache.commons.beanutils.BeanUtils;
+
+/**
+ * @Author: liweifan
+ * @Data: 2022-05-30 15:54:20
+ */
+@ApiModel(value = "PianoRoomSettingsDto对象", description = "数据传输对象")
+public class PianoRoomSettingsDto extends PianoRoomSettings{
+	private static final long serialVersionUID = 1L;
+    
+    public PianoRoomSettingsDto buildDto(PianoRoomSettings pianoRoomSettings){
+        try {
+            BeanUtils.copyProperties(this,pianoRoomSettings);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return this;
+    }
+
+}

+ 14 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/PianoRoomSettingsSearch.java

@@ -0,0 +1,14 @@
+package com.yonge.cooleshow.biz.dal.dto.search;
+
+import com.yonge.toolset.base.page.QueryInfo;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * @Author: liweifan
+ * @Data: 2022-05-30 15:54:20
+ */
+@ApiModel(value = "PianoRoomSettingsSearch对象", description = "查询对象")
+public class PianoRoomSettingsSearch extends QueryInfo{
+	private static final long serialVersionUID = 1L;
+
+}

+ 114 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/CourseScheduleRecord.java

@@ -0,0 +1,114 @@
+package com.yonge.cooleshow.biz.dal.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Author: cy
+ * @Date: 2022/5/30
+ */
+@ApiModel
+public class CourseScheduleRecord implements Serializable {
+    @TableId(value = "id_", type = IdType.AUTO)
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @TableField("course_id_")
+    @ApiModelProperty(value = "课程id")
+    private Long courseId;
+
+    @TableField("teacher_id_")
+    @ApiModelProperty(value = "老师id")
+    private Long teacherId;
+
+    @TableField("student_count_")
+    @ApiModelProperty(value = "上课学员人数")
+    private Integer studentCount;
+
+    @TableField("consum_time_")
+    @ApiModelProperty(value = "总消耗时长")
+    private Integer consumTime;
+
+    @TableField("end_time_")
+    @ApiModelProperty(value = "结课时间")
+    private Date endTime;
+
+    @TableField("created_time_")
+    @ApiModelProperty(value = "创建时间")
+    private Date createdTime;
+
+    @TableField("updated_time_")
+    @ApiModelProperty(value = "更新时间")
+    private Date updatedTime;
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public Long getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Long teacherId) {
+        this.teacherId = teacherId;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getCourseId() {
+        return courseId;
+    }
+
+    public void setCourseId(Long courseId) {
+        this.courseId = courseId;
+    }
+
+    public Integer getStudentCount() {
+        return studentCount;
+    }
+
+    public void setStudentCount(Integer studentCount) {
+        this.studentCount = studentCount;
+    }
+
+    public Integer getConsumTime() {
+        return consumTime;
+    }
+
+    public void setConsumTime(Integer consumTime) {
+        this.consumTime = consumTime;
+    }
+
+    public Date getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Date createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    public Date getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Date updatedTime) {
+        this.updatedTime = updatedTime;
+    }
+}
+

+ 123 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/PianoRoomSettings.java

@@ -0,0 +1,123 @@
+package com.yonge.cooleshow.biz.dal.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.math.BigDecimal;
+
+@TableName("piano_room_settings")
+@ApiModel(value = "PianoRoomSettings对象", description = "琴房时长价格配置")
+public class PianoRoomSettings implements Serializable {
+	private static final long serialVersionUID = 1L;
+    @TableId(value = "id_", type = IdType.AUTO)
+    private Long id;
+    @ApiModelProperty("时长(分) ")
+	@TableField(value = "times_")
+    private Integer times;
+    @ApiModelProperty("销售价 ")
+	@TableField(value = "sale_price_")
+    private BigDecimal salePrice;
+    @ApiModelProperty("原价 ")
+	@TableField(value = "original_price_")
+    private BigDecimal originalPrice;
+    @ApiModelProperty("描述 ")
+	@TableField(value = "description_")
+    private String description;
+    @ApiModelProperty("创建人 ")
+	@TableField(value = "create_by_")
+    private Long createBy;
+    @ApiModelProperty("创建时间 ")
+	@TableField(value = "create_time_")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date createTime;
+    @ApiModelProperty("更新人 ")
+	@TableField(value = "update_by_")
+    private Long updateBy;
+    @ApiModelProperty("更新时间 ")
+	@TableField(value = "update_time_")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date updateTime;
+
+	public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+    
+	public Integer getTimes() {
+        return times;
+    }
+
+    public void setTimes(Integer times) {
+        this.times = times;
+    }
+    
+	public BigDecimal getSalePrice() {
+        return salePrice;
+    }
+
+    public void setSalePrice(BigDecimal salePrice) {
+        this.salePrice = salePrice;
+    }
+    
+	public BigDecimal getOriginalPrice() {
+        return originalPrice;
+    }
+
+    public void setOriginalPrice(BigDecimal originalPrice) {
+        this.originalPrice = originalPrice;
+    }
+    
+	public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+    
+	public Long getCreateBy() {
+        return createBy;
+    }
+
+    public void setCreateBy(Long createBy) {
+        this.createBy = createBy;
+    }
+    
+	public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+    
+	public Long getUpdateBy() {
+        return updateBy;
+    }
+
+    public void setUpdateBy(Long updateBy) {
+        this.updateBy = updateBy;
+    }
+    
+	public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+    
+}

+ 1 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/PinaoRoomTime.java → cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/PianoRoomTime.java

@@ -14,7 +14,7 @@ import java.util.Date;
  * @Date: 2022/5/26
  */
 @ApiModel
-public class PinaoRoomTime implements Serializable {
+public class PianoRoomTime implements Serializable {
     @TableId(value = "id_", type = IdType.AUTO)
     @ApiModelProperty(value = "主键")
     private Long id;

+ 2 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/enums/GoodTypeEnum.java

@@ -14,7 +14,8 @@ public enum GoodTypeEnum implements BaseEnum<String, GoodTypeEnum> {
     PRACTICE("陪练课购买"),
     LIVE("直播课购买"),
     VIDEO("视频课购买"),
-    MUSIC("单曲点播");
+    MUSIC("单曲点播"),
+    PINAO_ROOM("琴房时长");
     @EnumValue
     private String code;
     private String msg;

+ 5 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/CourseScheduleService.java

@@ -238,10 +238,14 @@ public interface CourseScheduleService extends IService<CourseSchedule> {
 
     void teacherSalaryTask();
 
-    PinaoRoomTimeVo selectRemainTime(Long teacherId);
+    PianoRoomTimeVo selectRemainTime(Long teacherId);
 
     PageInfo<CourseStudentVo> selectStudent(Map<String, Object> param);
 
     void arrangeCourse(ArrangeCourseVo arrangeCourseVo, Long teacherId);
+
+    Map<String, Object> selectConsumeTime(String month, Long teacherId);
+
+    PageInfo<CourseScheduleRecordVo> selectConsumeTimeList(Map<String, Object> param);
 }
 

+ 33 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/PianoRoomSettingsService.java

@@ -0,0 +1,33 @@
+package com.yonge.cooleshow.biz.dal.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yonge.cooleshow.biz.dal.vo.PianoRoomSettingsVo;
+import com.yonge.cooleshow.biz.dal.dto.search.PianoRoomSettingsSearch;
+import com.yonge.cooleshow.biz.dal.entity.PianoRoomSettings;
+
+import java.util.List;
+
+/**
+ *  服务类
+ * @author liweifan
+ * @date 2022-05-30
+ */
+public interface PianoRoomSettingsService extends IService<PianoRoomSettings>  {
+
+	/**
+     * 查询详情
+     * @author liweifan
+ 	 * @date 2022-05-30
+     */
+	PianoRoomSettingsVo detail(Long id);
+
+    /**
+     * 分页查询
+     * @author liweifan
+ 	 * @date 2022-05-30
+     */
+    IPage<PianoRoomSettingsVo> selectPage(IPage<PianoRoomSettingsVo> page, PianoRoomSettingsSearch query);
+
+	List<PianoRoomSettingsVo> selectList(PianoRoomSettingsSearch query);
+}

+ 2 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/PinaoRoomTimeService.java → cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/PianoRoomTimeService.java

@@ -1,12 +1,12 @@
 package com.yonge.cooleshow.biz.dal.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.yonge.cooleshow.biz.dal.entity.PinaoRoomTime;
+import com.yonge.cooleshow.biz.dal.entity.PianoRoomTime;
 
 /**
  * @Author: cy
  * @Date: 2022/5/26
  */
-public interface PinaoRoomTimeService extends IService<PinaoRoomTime> {
+public interface PianoRoomTimeService extends IService<PianoRoomTime> {
 }
 

+ 17 - 4
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/StudentService.java

@@ -6,10 +6,8 @@ import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.dto.search.StudentSearch;
 import com.yonge.cooleshow.biz.dal.entity.Student;
 import com.yonge.cooleshow.biz.dal.entity.Subject;
-import com.yonge.cooleshow.biz.dal.vo.MyFollow;
-import com.yonge.cooleshow.biz.dal.vo.StudentHomeVo;
-import com.yonge.cooleshow.biz.dal.vo.StudentTotalVo;
-import com.yonge.cooleshow.biz.dal.vo.StudentVo;
+import com.yonge.cooleshow.biz.dal.vo.*;
+import com.yonge.cooleshow.common.entity.HttpResponseResult;
 
 import java.util.List;
 import java.util.Map;
@@ -31,6 +29,13 @@ public interface StudentService extends IService<Student> {
     StudentVo detail(Long userId);
 
     /**
+     * 查询学员详情
+     * @param phone
+     * @return
+     */
+    StudentVo detailByPhone(String phone);
+
+    /**
      * 自定义分页
      *
      * @author liweifan
@@ -75,4 +80,12 @@ public interface StudentService extends IService<Student> {
      */
     IPage<MyFollow> queryMyFollow(IPage<MyFollow> page, Long studentId);
 
+    /**
+     * 学院绑定老师
+     * @param phone
+     * @param userId
+     * @param isUpdate
+     * @return
+     */
+    HttpResponseResult<Map<String,TeacherVo>> bindTeacher(String phone, Long userId, Boolean isUpdate);
 }

+ 24 - 17
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/VipCardRecordService.java

@@ -12,34 +12,41 @@ import com.yonge.cooleshow.common.entity.HttpResponseResult;
 
 /**
  * 购买会员卡记录表 服务类
+ *
  * @author liweifan
  * @date 2022-03-30
  */
-public interface VipCardRecordService extends IService<VipCardRecord>  {
-	/**
-	 * 查询详情
-	 * @author liweifan
-	 * @date 2022-03-30
-	 */
-	VipCardRecordVo detail(Long id);
-	/**
+public interface VipCardRecordService extends IService<VipCardRecord> {
+    /**
+     * 查询详情
+     *
+     * @author liweifan
+     * @date 2022-03-30
+     */
+    VipCardRecordVo detail(Long orderDetilId);
+
+    /**
      * 查询详情
+     *
      * @author liweifan
- 	 * @date 2022-03-30
+     * @date 2022-03-30
      */
-	VipCardRecordVo detail(Long id,Long userId);
+    VipCardRecordVo detail(Long orderDetilId, Long userId);
 
     /**
      * 分页查询
+     *
      * @author liweifan
- 	 * @date 2022-03-30
+     * @date 2022-03-30
      */
     IPage<VipCardRecordVo> selectPage(IPage<VipCardRecordVo> page, VipCardRecordSearch query);
 
-	/***
-	 * 会员卡到期提醒
-	 * @author liweifan
-	 * @updateTime 2022/5/5 19:28
-	 */
-	void pollExpireMsg();
+    /***
+     * 会员卡到期提醒
+     * @author liweifan
+     * @updateTime 2022/5/5 19:28
+     */
+    void pollExpireMsg();
+
+
 }

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

@@ -95,11 +95,13 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
     @Autowired
     private HolidaysFestivalsDao holidaysFestivalsDao;
     @Autowired
-    private PinaoRoomTimeDao pinaoRoomTimeDao;
+    private PianoRoomTimeDao pianoRoomTimeDao;
     @Autowired
     private UserBindingTeacherDao userBindingTeacherDao;
     @Autowired
     private CourseScheduleStudentDao courseScheduleStudentDao;
+    @Autowired
+    private CourseScheduleRecordDao recordDao;
 
     @Override
     public CourseScheduleDao getDao() {
@@ -1489,26 +1491,70 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
      */
     @Transactional(rollbackFor = Exception.class)
     public void scheduleTask() {
-        //更新课程开始状态(开课时间 ≤ NOW ≤ 结束时间)
+        //课程开始(开课时间 ≤ NOW ≤ 结束时间)
         List<CourseSchedule> courseStart = baseMapper.selectList(Wrappers.<CourseSchedule>lambdaQuery()
                 .eq(CourseSchedule::getLock, 0)
-                .eq(CourseSchedule::getType, CourseScheduleEnum.NOT_START)
+                .eq(CourseSchedule::getStatus, CourseScheduleEnum.NOT_START)
                 .le(CourseSchedule::getStartTime, new Date())
                 .ge(CourseSchedule::getEndTime, new Date()));
         if (CollectionUtils.isNotEmpty(courseStart)) {
+            //课程状态更新为ING
             baseMapper.updateStartTime(courseStart);
         }
 
-        //更新课程结束状态(NOW ≥ 结束时间)
-        List<String> typeList = Arrays.asList(CourseScheduleEnum.ING.getCode(), CourseScheduleEnum.NOT_START.getCode());
-        List<CourseSchedule> courseEnd = baseMapper.selectList(Wrappers.<CourseSchedule>lambdaQuery()
-                .in(CourseSchedule::getType, typeList)
-                .eq(CourseSchedule::getLock, 0)
-                .le(CourseSchedule::getEndTime, new Date()));
-        if (CollectionUtils.isNotEmpty(courseEnd)) {
-            baseMapper.updateEndTime(courseEnd);
-            //TODO 根据老师&学生id 更新绑定学员结课时间
+        //课程结束(NOW ≥ 结束时间)
+        List<CourseScheduleStudentVo> userList = courseScheduleStudentDao.selectUser();
+        if (CollectionUtils.isNotEmpty(userList)) {
+            //更新学生最近结课时间
+            pianoRoomTimeDao.updateEndTime(userList);
+
+            List<CourseScheduleRecord> recordList = recordDao.sumCourseTime();
+            if (CollectionUtils.isNotEmpty(recordList)) {
+                //记录消耗课时
+                recordDao.insertBatch(recordList);
+
+                //释放冻结课时
+                List<PianoRoomTime> roomTimeList = new ArrayList<>();
+                Map<Long, List<CourseScheduleRecord>> collect = recordList.stream().collect(Collectors.groupingBy(CourseScheduleRecord::getTeacherId, Collectors.toList()));
+                collect.forEach((key, list) -> {
+                    PianoRoomTime pianoRoomTime = pianoRoomTimeDao.selectOne(Wrappers.<PianoRoomTime>lambdaQuery().eq(PianoRoomTime::getTeacherId, key));
+                    Long frozenTime = pianoRoomTime.getFrozenTime();
+
+                    PianoRoomTime roomTime = new PianoRoomTime();
+                    roomTime.setTeacherId(key);
+                    roomTime.setFrozenTime(frozenTime - Long.valueOf(list.stream().mapToInt(CourseScheduleRecord::getConsumTime).sum()));
+                    roomTimeList.add(roomTime);
+                });
+                pianoRoomTimeDao.updateBatch(roomTimeList);
+            }
+
+            //课程状态更新为COMPLETE
+            baseMapper.updateEndTime(userList);
+        }
+
+        //查完完成的课程
+        List<CourseCompleteVo> completeList=baseMapper.selectComplete();
+        if (CollectionUtils.isNotEmpty(completeList)){
+            List<Long> gids = completeList.stream().map(CourseCompleteVo::getCourseGroupId).collect(Collectors.toList());
+            List<CourseGroup> courseGroups = courseGroupService.getDao().selectList(Wrappers.<CourseGroup>lambdaQuery().in(CourseGroup::getId, gids));
+            if(CollectionUtils.isNotEmpty(courseGroups)){
+                List<Long> ids=new ArrayList<>();
+                for (CourseGroup group : courseGroups) {
+                    for (CourseCompleteVo complete : completeList) {
+                        Integer courseNum = group.getCourseNum();
+                        Integer completeCount = complete.getCourseCount();
+                        if (courseNum.equals(completeCount)){
+                            ids.add(complete.getCourseGroupId());
+                        }
+                    }
+                }
+                if(CollectionUtils.isNotEmpty(ids)){
+                    //同步课程组状态
+                    courseGroupService.getDao().updateBatch(ids);
+                }
+            }
         }
+
     }
 
     /**
@@ -1533,8 +1579,8 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
      * @Author: cy
      * @Date: 2022/5/27
      */
-    public PinaoRoomTimeVo selectRemainTime(Long teacherId) {
-        return pinaoRoomTimeDao.selectRemainTime(teacherId);
+    public PianoRoomTimeVo selectRemainTime(Long teacherId) {
+        return pianoRoomTimeDao.selectRemainTime(teacherId);
     }
 
     /**
@@ -1589,12 +1635,12 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
         }
 
         //校验时长
-        PinaoRoomTime pinaoRoomTime = pinaoRoomTimeDao.selectOne(Wrappers.<PinaoRoomTime>lambdaQuery().eq(PinaoRoomTime::getTeacherId, teacherId));
-        if (pinaoRoomTime == null) {
+        PianoRoomTime pianoRoomTime = pianoRoomTimeDao.selectOne(Wrappers.<PianoRoomTime>lambdaQuery().eq(PianoRoomTime::getTeacherId, teacherId));
+        if (pianoRoomTime == null) {
             throw new BizException("未查询到老师剩余时长");
         }
-        Long remainTime = pinaoRoomTime.getRemainTime();
-        Long frozenTime = pinaoRoomTime.getFrozenTime();
+        Long remainTime = pianoRoomTime.getRemainTime();
+        Long frozenTime = pianoRoomTime.getFrozenTime();
         if (consumTime > remainTime) {
             throw new BizException("剩余时长不足");
         }
@@ -1642,7 +1688,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
         courseGroup.setSubjectId(arrangeCourseVo.getSubjectId());
         courseGroup.setSingleCourseMinutes(singleClssTime);
         courseGroup.setCourseNum(classNum);
-        courseGroup.setStatus(CourseGroupEnum.NOT_SALE.getCode());
+        courseGroup.setStatus(CourseGroupEnum.ING.getCode());
         courseGroup.setCreatedBy(teacherId);
         courseGroupService.getDao().insert(courseGroup);
 
@@ -1674,10 +1720,32 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
             courseScheduleStudentDao.insertBatch(list);
         }
 
-        //扣减pinao_room_time
-        PinaoRoomTime roomTime = new PinaoRoomTime();
+        //扣减piano_room_time
+        PianoRoomTime roomTime = new PianoRoomTime();
         roomTime.setRemainTime(remainTime - consumTime);
         roomTime.setFrozenTime(frozenTime + consumTime);
-        pinaoRoomTimeDao.update(roomTime, Wrappers.<PinaoRoomTime>lambdaQuery().eq(PinaoRoomTime::getTeacherId, teacherId));
+        pianoRoomTimeDao.update(roomTime, Wrappers.<PianoRoomTime>lambdaQuery().eq(PianoRoomTime::getTeacherId, teacherId));
+    }
+
+    /**
+     * @Description: 根据月份查询消耗记录
+     * @Author: cy
+     * @Date: 2022/5/30
+     */
+    public Map<String, Object> selectConsumeTime(String month, Long teacherId) {
+        Map<String, Object> map = new HashMap();
+        map.put("consumeTime", recordDao.countTimeByTeacherId(teacherId, month));
+        return map;
+    }
+
+    /**
+     * @Description: 消耗时长详情
+     * @Author: cy
+     * @Date: 2022/5/30
+     */
+    @Override
+    public PageInfo<CourseScheduleRecordVo> selectConsumeTimeList(Map<String, Object> param) {
+        param.put("type",CourseScheduleEnum.PIANO_ROOM_CLASS.getCode());
+        return PageUtil.pageInfo(recordDao.selectConsumeTimeList(PageUtil.getPageInfo(param), param));
     }
 }

+ 41 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/PianoRoomSettingsServiceImpl.java

@@ -0,0 +1,41 @@
+package com.yonge.cooleshow.biz.dal.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import com.yonge.cooleshow.biz.dal.entity.PianoRoomSettings;
+import com.yonge.cooleshow.biz.dal.vo.PianoRoomSettingsVo;
+import com.yonge.cooleshow.biz.dal.dto.search.PianoRoomSettingsSearch;
+import com.yonge.cooleshow.biz.dal.dao.PianoRoomSettingsDao;
+import com.yonge.cooleshow.biz.dal.service.PianoRoomSettingsService;
+
+import java.util.List;
+
+
+@Service
+public class PianoRoomSettingsServiceImpl extends ServiceImpl<PianoRoomSettingsDao, PianoRoomSettings> implements PianoRoomSettingsService {
+    private final static Logger log = LoggerFactory.getLogger(PianoRoomSettingsServiceImpl.class);
+
+	@Override
+    public PianoRoomSettingsVo detail(Long id) {
+        return baseMapper.detail(id);
+    }
+    
+   /*  @Override
+    public IPage<PianoRoomSettingsVo> selectPage(IPage<PianoRoomSettingsVo> page, PianoRoomSettingsSearch query){
+        return page.setRecords(baseMapper.selectPage(page, query));
+    }*/
+
+    @Override
+    public IPage<PianoRoomSettingsVo> selectPage(IPage<PianoRoomSettingsVo> page, PianoRoomSettingsSearch query) {
+        return page.setRecords(baseMapper.selectPage(page, query));
+    }
+
+    @Override
+    public List<PianoRoomSettingsVo> selectList(PianoRoomSettingsSearch query) {
+        return baseMapper.selectList(query);
+    }
+	
+}

+ 20 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/PianoRoomTimeServiceImpl.java

@@ -0,0 +1,20 @@
+package com.yonge.cooleshow.biz.dal.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yonge.cooleshow.biz.dal.dao.PianoRoomTimeDao;
+import com.yonge.cooleshow.biz.dal.entity.PianoRoomTime;
+import com.yonge.cooleshow.biz.dal.service.PianoRoomTimeService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+/**
+ * @Author: cy
+ * @Date: 2022/5/26
+ */
+@Service("pianoRoomTimeService")
+public class PianoRoomTimeServiceImpl extends ServiceImpl<PianoRoomTimeDao, PianoRoomTime> implements PianoRoomTimeService {
+    private final static Logger log = LoggerFactory.getLogger(PianoRoomTimeServiceImpl.class);
+
+}
+

+ 0 - 20
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/PinaoRoomTimeServiceImpl.java

@@ -1,20 +0,0 @@
-package com.yonge.cooleshow.biz.dal.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.yonge.cooleshow.biz.dal.dao.PinaoRoomTimeDao;
-import com.yonge.cooleshow.biz.dal.entity.PinaoRoomTime;
-import com.yonge.cooleshow.biz.dal.service.PinaoRoomTimeService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Service;
-
-/**
- * @Author: cy
- * @Date: 2022/5/26
- */
-@Service("pinaoRoomTimeService")
-public class PinaoRoomTimeServiceImpl extends ServiceImpl<PinaoRoomTimeDao, PinaoRoomTime> implements PinaoRoomTimeService {
-    private final static Logger log = LoggerFactory.getLogger(PinaoRoomTimeServiceImpl.class);
-
-}
-

+ 56 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/StudentServiceImpl.java

@@ -1,15 +1,19 @@
 package com.yonge.cooleshow.biz.dal.service.impl;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.dao.TeacherDao;
+import com.yonge.cooleshow.biz.dal.dao.UserBindingTeacherDao;
 import com.yonge.cooleshow.biz.dal.dto.search.StudentSearch;
 import com.yonge.cooleshow.biz.dal.entity.StudentTotal;
 import com.yonge.cooleshow.biz.dal.entity.Subject;
+import com.yonge.cooleshow.biz.dal.entity.UserBindingTeacher;
 import com.yonge.cooleshow.biz.dal.enums.CacheNameEnum;
 import com.yonge.cooleshow.biz.dal.service.StudentTotalService;
-import com.yonge.cooleshow.biz.dal.support.WrapperUtil;
 import com.yonge.cooleshow.biz.dal.vo.*;
+import com.yonge.cooleshow.common.entity.HttpResponseResult;
 import com.yonge.toolset.utils.date.DateUtil;
 import com.yonge.toolset.utils.string.ValueUtil;
 import org.apache.commons.beanutils.BeanUtils;
@@ -28,9 +32,14 @@ import java.util.concurrent.TimeUnit;
 public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> implements StudentService {
     @Autowired
     private RedissonClient redissonClient;
-
     @Autowired
     private StudentTotalService totalService;
+    @Autowired
+    private UserBindingTeacherDao userBindingTeacherDao;
+    @Autowired
+    private StudentService studentService;
+    @Autowired
+    private TeacherDao teacherDao;
 
     @Override
     public StudentVo detail(Long userId) {
@@ -38,6 +47,11 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
     }
 
     @Override
+    public StudentVo detailByPhone(String phone) {
+        return baseMapper.detailByPhone(phone);
+    }
+
+    @Override
     public IPage<StudentVo> selectPage(IPage<StudentVo> page, StudentSearch studentSearch) {
         return page.setRecords(baseMapper.selectPage(page, studentSearch));
     }
@@ -95,4 +109,44 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
         return page.setRecords(teacherVos);
     }
 
+    @Override
+    public HttpResponseResult<Map<String, TeacherVo>> bindTeacher(String phone, Long userId, Boolean isUpdate) {
+        Map<String, TeacherVo> resMap = new HashMap<>();
+        TeacherVo old = userBindingTeacherDao.getBindTeacherByPhone(phone);
+        if (null != old) {
+            //身份证号、手机号脱敏
+            old.setIdCardNo(ValueUtil.fuzzyIdCard(old.getIdCardNo()));
+            old.setPhone(ValueUtil.fuzzyMobile(old.getPhone()));
+        }
+        resMap.put("old", old);
+
+        StudentVo studentVo = studentService.detailByPhone(phone);
+
+        if (null == studentVo) {
+            return HttpResponseResult.failed("未找到用户信息");
+        }
+        TeacherVo detail = teacherDao.detail(userId);
+        if (null != detail) {
+            //身份证号、手机号脱敏
+            detail.setIdCardNo(ValueUtil.fuzzyIdCard(detail.getIdCardNo()));
+            detail.setPhone(ValueUtil.fuzzyMobile(detail.getPhone()));
+        }
+        if (null == detail) {
+            return HttpResponseResult.failed("未找老师信息");
+        }
+        if (null == old || (null != isUpdate && isUpdate)) {
+            //更新
+            //删除用户绑定
+            userBindingTeacherDao.delete(Wrappers.<UserBindingTeacher>lambdaQuery()
+                    .eq(UserBindingTeacher::getStudentId, studentVo.getUserId()));
+
+            UserBindingTeacher userBindingTeacher = new UserBindingTeacher();
+            userBindingTeacher.setTeacherId(userId);
+            userBindingTeacher.setStudentId(studentVo.getUserId());
+            userBindingTeacherDao.insert(userBindingTeacher);
+        }
+        resMap.put("now", detail);
+        return HttpResponseResult.succeed(resMap);
+    }
+
 }

+ 4 - 6
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/VipCardRecordServiceImpl.java

@@ -32,15 +32,13 @@ public class VipCardRecordServiceImpl extends ServiceImpl<VipCardRecordDao, VipC
     private SysMessageService sysMessageService;
 
     @Override
-    public VipCardRecordVo detail(Long id) {
-        VipCardRecordVo detail = baseMapper.detail(id, null);
-        return detail;
+    public VipCardRecordVo detail(Long orderDetilId) {
+        return baseMapper.detail(orderDetilId, null);
     }
 
     @Override
-    public VipCardRecordVo detail(Long id, Long userId) {
-        VipCardRecordVo detail =  baseMapper.detail(id, userId);
-        return detail;
+    public VipCardRecordVo detail(Long orderDetilId, Long userId) {
+        return baseMapper.detail(orderDetilId, userId);
     }
 
     @Override

+ 34 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/CourseCompleteVo.java

@@ -0,0 +1,34 @@
+package com.yonge.cooleshow.biz.dal.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * @Author: cy
+ * @Date: 2022/5/30
+ */
+@ApiModel
+public class CourseCompleteVo implements Serializable {
+    @ApiModelProperty("课程组id")
+    private Long courseGroupId;
+    @ApiModelProperty("已完成课时数")
+    private Integer courseCount;
+
+    public Long getCourseGroupId() {
+        return courseGroupId;
+    }
+
+    public void setCourseGroupId(Long courseGroupId) {
+        this.courseGroupId = courseGroupId;
+    }
+
+    public Integer getCourseCount() {
+        return courseCount;
+    }
+
+    public void setCourseCount(Integer courseCount) {
+        this.courseCount = courseCount;
+    }
+}

+ 114 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/CourseScheduleRecordVo.java

@@ -0,0 +1,114 @@
+package com.yonge.cooleshow.biz.dal.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Author: cy
+ * @Date: 2022/5/30
+ */
+@ApiModel
+public class CourseScheduleRecordVo implements Serializable {
+    @ApiModelProperty(value = "课程id")
+    private Long courseId;
+
+    @ApiModelProperty(value = "课程组名称")
+    private String groupName;
+
+    @ApiModelProperty(value = "声部id")
+    private Long subjectId;
+
+    @ApiModelProperty(value = "声部名称")
+    private String subjectName;
+
+    @ApiModelProperty(value = "课程状态 NOT_START未开始 ING进行中 COMPLETE已完成 CANCEL已取消")
+    private String status;
+
+    @ApiModelProperty(value = "开课时间")
+    private Date startTime;
+
+    @ApiModelProperty(value = "结课时间")
+    private Date endTime;
+
+    @ApiModelProperty(value = "上课学员人数")
+    private Integer studentCount;
+
+    @ApiModelProperty(value = "总消耗时长")
+    private Integer consumTime;
+
+    public Long getCourseId() {
+        return courseId;
+    }
+
+    public void setCourseId(Long courseId) {
+        this.courseId = courseId;
+    }
+
+    public String getGroupName() {
+        return groupName;
+    }
+
+    public void setGroupName(String groupName) {
+        this.groupName = groupName;
+    }
+
+    public Long getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Long subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public Integer getStudentCount() {
+        return studentCount;
+    }
+
+    public void setStudentCount(Integer studentCount) {
+        this.studentCount = studentCount;
+    }
+
+    public Integer getConsumTime() {
+        return consumTime;
+    }
+
+    public void setConsumTime(Integer consumTime) {
+        this.consumTime = consumTime;
+    }
+}
+

+ 74 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/CourseScheduleStudentVo.java

@@ -0,0 +1,74 @@
+package com.yonge.cooleshow.biz.dal.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Author: cy
+ * @Date: 2022/5/30
+ */
+@ApiModel
+public class CourseScheduleStudentVo implements Serializable {
+    @ApiModelProperty(value = "课程id")
+    private Long courseId;
+
+    @ApiModelProperty(value = "老师id")
+    private Long teacherId;
+
+    @ApiModelProperty(value = "学生id")
+    private Long studentId;
+
+    @ApiModelProperty(value = "结课时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date endTime;
+
+    @ApiModelProperty(value = "单课时长(分)")
+    private Integer singleCourseTime;
+
+    public Integer getSingleCourseTime() {
+        return singleCourseTime;
+    }
+
+    public void setSingleCourseTime(Integer singleCourseTime) {
+        this.singleCourseTime = singleCourseTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public Long getCourseId() {
+        return courseId;
+    }
+
+    public void setCourseId(Long courseId) {
+        this.courseId = courseId;
+    }
+
+    public Long getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Long teacherId) {
+        this.teacherId = teacherId;
+    }
+
+    public Long getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Long studentId) {
+        this.studentId = studentId;
+    }
+}
+

+ 24 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/PianoRoomSettingsVo.java

@@ -0,0 +1,24 @@
+package com.yonge.cooleshow.biz.dal.vo;
+
+import com.yonge.cooleshow.biz.dal.entity.PianoRoomSettings;
+import io.swagger.annotations.ApiModel;
+import org.apache.commons.beanutils.BeanUtils;
+
+/**
+ * @Author: liweifan
+ * @Data: 2022-05-30 15:54:20
+ */
+@ApiModel(value = "PianoRoomSettingsVo对象", description = "查询视图对象")
+public class PianoRoomSettingsVo extends PianoRoomSettings{
+	private static final long serialVersionUID = 1L;
+    
+    public PianoRoomSettingsVo buildVo(PianoRoomSettings pianoRoomSettings){
+        try {
+            BeanUtils.copyProperties(this,pianoRoomSettings);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return this;
+    }
+
+}

+ 2 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/PinaoRoomTimeVo.java → cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/PianoRoomTimeVo.java

@@ -1,6 +1,6 @@
 package com.yonge.cooleshow.biz.dal.vo;
 
-import com.yonge.cooleshow.biz.dal.entity.PinaoRoomTime;
+import com.yonge.cooleshow.biz.dal.entity.PianoRoomTime;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
  * @Date: 2022/5/26
  */
 @ApiModel
-public class PinaoRoomTimeVo extends PinaoRoomTime {
+public class PianoRoomTimeVo extends PianoRoomTime {
     @ApiModelProperty(value = "我的学员")
     private Integer studentCount;
 

+ 8 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseGroupMapper.xml

@@ -655,5 +655,12 @@
             pre_student_num_ = pre_student_num_ + #{num}
         where id_ = #{id}
     </update>
-
+    <update id="updateBatch">
+        UPDATE course_group
+        SET status_='COMPLETE'
+        WHERE id_ IN
+        <foreach collection="list" item="item" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+    </update>
 </mapper>

+ 4 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -792,6 +792,9 @@
     <select id="selectIdList" resultType="java.lang.Long">
         SELECT id_ FROM course_schedule WHERE lock_=0 AND class_date_ &lt;= #{day}
     </select>
+    <select id="selectComplete" resultType="com.yonge.cooleshow.biz.dal.vo.CourseCompleteVo">
+        SELECT course_group_id_ AS courseGroupId ,COUNT(1) AS courseCount  FROM course_schedule WHERE lock_=0 AND status_='COMPLETE' GROUP BY course_group_id_
+    </select>
     <update id="updateStartTime">
         UPDATE course_schedule SET status_='ING' WHERE id_ IN(
         <foreach collection="list" item="item" index="index" open="" close="" separator=",">
@@ -801,7 +804,7 @@
     <update id="updateEndTime">
         UPDATE course_schedule SET status_='COMPLETE' WHERE id_ IN(
         <foreach collection="list" item="item" index="index" open="" close="" separator=",">
-            #{item.id}
+            #{item.courseId}
         </foreach>)
     </update>
     <update id="updateTeacherSalary" parameterType="java.util.List">

+ 56 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseScheduleRecordMapper.xml

@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.yonge.cooleshow.biz.dal.dao.CourseScheduleRecordDao">
+    <select id="sumCourseTime" resultType="com.yonge.cooleshow.biz.dal.entity.CourseScheduleRecord">
+        SELECT * FROM(
+        SELECT teacherId, courseId, SUM(singleCourseTime) AS consumTime, COUNT(studentId) AS studentCount, endTime FROM (
+        SELECT c.id_ AS courseId, c.teacher_id_ AS teacherId, s.student_id_ AS studentId, c.end_time_ AS endTime, c.single_course_time_ AS singleCourseTime
+        FROM course_schedule c LEFT JOIN course_schedule_student s ON c.id_ = s.course_id_ WHERE c.lock_ = 0 AND c.status_ IN ('ING', 'NOT_START') AND NOW() >= c.end_time_ ) a GROUP BY courseId) b
+        WHERE b.studentCount!=0
+    </select>
+    <select id="countTimeByTeacherId" resultType="java.lang.Long">
+        SELECT SUM(consum_time_) FROM course_schedule_record WHERE teacher_id_=#{teacherId} AND  date_format(end_time_,'%Y-%m') = #{month}
+    </select>
+    <insert id="insertBatch">
+        INSERT INTO course_schedule_record (course_id_, teacher_id_, student_count_, consum_time_, end_time_) VALUES
+        <foreach collection ="recordList" item="item" index="index" separator =",">
+            (#{item.courseId},#{item.teacherId},#{item.studentCount}, #{item.consumTime}, #{item.endTime})
+        </foreach>
+    </insert>
+    <select id="selectConsumeTimeList" resultType="com.yonge.cooleshow.biz.dal.vo.CourseScheduleRecordVo">
+        SELECT
+            s.id_ AS courseId,
+            g.name_ AS groupName,
+            g.subject_id_ AS subjectId,
+            sb.name_ AS subjectName,
+            s.status_ AS `status`,
+            s.start_time_ AS startTime,
+            s.end_time_ AS endTime,
+            r.student_count_ AS studentCount,
+            r.consum_time_ AS consumTime
+        FROM course_schedule s
+        LEFT JOIN course_schedule_record r ON r.course_id_ =s.id_
+        LEFT JOIN course_group g ON s.course_group_id_=g.id_
+        LEFT JOIN `subject` sb ON g.subject_id_ = sb.id_
+        <where>
+            <if test="param.type != null and param.type !=''">
+                AND s.type_ = #{param.type}
+            </if>
+            <if test="param.status != null and param.status !=''">
+                AND s.status_ = #{param.status}
+            </if>
+            <if test="param.teacherId != null">
+               AND r.teacher_id_ = #{param.teacherId}
+            </if>
+            <if test="param.subjectId != null">
+                AND g.subject_id_ = #{param.subjectId}
+            </if>
+            <if test="param.month != null and param.month !=''">
+                AND date_format(s.end_time_,'%Y-%m') = #{param.month}
+            </if>
+            <if test="param.status != null and param.status !=''">
+                AND s.status_ = #{param.status}
+            </if>
+        </where>
+    </select>
+</mapper>

+ 13 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseScheduleStudentMapper.xml

@@ -7,4 +7,17 @@
             (#{item.courseId}, #{item.studentId})
         </foreach >
     </insert>
+    <select id="selectUser" resultType="com.yonge.cooleshow.biz.dal.vo.CourseScheduleStudentVo">
+        SELECT
+        c.id_ AS courseId,
+        c.teacher_id_ AS teacherId,
+        s.student_id_ AS studentId,
+        c.end_time_ AS endTime,
+        c.single_course_time_ AS singleCourseTime
+        FROM course_schedule c
+        LEFT JOIN course_schedule_student s ON c.id_ = s.course_id_
+        WHERE c.lock_ = 0
+        AND c.status_ IN ('ING','NOT_START')
+        AND NOW() &gt;= c.end_time_
+    </select>
 </mapper>

+ 53 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/PianoRoomSettingsMapper.xml

@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE  mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.yonge.cooleshow.biz.dal.dao.PianoRoomSettingsDao">
+	<resultMap id="BaseResultMap" type="com.yonge.cooleshow.biz.dal.entity.PianoRoomSettings">
+            <result column="id_" property="id" />
+	        <result column="times_" property="times" />
+	        <result column="sale_price_" property="salePrice" />
+	        <result column="original_price_" property="originalPrice" />
+	        <result column="description_" property="description" />
+	        <result column="create_by_" property="createBy" />
+	        <result column="create_time_" property="createTime" />
+	        <result column="update_by_" property="updateBy" />
+	        <result column="update_time_" property="updateTime" />
+		</resultMap>  
+    
+    <!-- 表字段 -->
+    <sql id="baseColumns">
+         t.id_ as id
+        , t.times_ as times
+        , t.sale_price_ as salePrice
+        , t.original_price_ as originalPrice
+        , t.description_ as description
+        , t.create_by_ as createBy
+        , t.create_time_ as createTime
+        , t.update_by_ as updateBy
+        , t.update_time_ as updateTime
+        </sql> 
+    
+    <select id="detail" resultType="com.yonge.cooleshow.biz.dal.vo.PianoRoomSettingsVo">
+        SELECT
+            <include refid="baseColumns"/>,
+            ifnull(u.real_name_,u.username_) modifierName
+        FROM piano_room_settings t
+        LEFT JOIN sys_user u on t.update_by_ = u.id_
+        where t.id_ = #{id}
+    </select>
+
+    <sql id="selectSql">
+        SELECT
+            <include refid="baseColumns" />,
+            ifnull(u.real_name_,u.username_) modifierName
+        FROM piano_room_settings t
+        LEFT JOIN sys_user u on t.update_by_ = u.id_
+    </sql>
+
+    <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.vo.PianoRoomSettingsVo">
+        <include refid="selectSql"/>
+    </select>
+
+    <select id="selectList" resultType="com.yonge.cooleshow.biz.dal.vo.PianoRoomSettingsVo">
+        <include refid="selectSql"/>
+    </select>
+</mapper>

+ 26 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/PianoRoomTimeDao.xml

@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.yonge.cooleshow.biz.dal.dao.PianoRoomTimeDao">
+    <select id="selectRemainTime" resultType="com.yonge.cooleshow.biz.dal.vo.PianoRoomTimeVo"
+            parameterType="java.lang.Long">
+        SELECT *,
+        (SELECT COUNT(1) FROM user_binding_teacher WHERE teacher_id_=#{teacherId}) AS studentCount
+        FROM piano_room_time
+        WHERE teacher_id_=#{teacherId}
+    </select>
+    <update id="updateEndTime">
+        <foreach collection="list" item="item" index="index" separator=";">
+            UPDATE user_binding_teacher
+            SET last_end_class_ = #{item.endTime}
+            WHERE teacher_id_ = #{item.teacherId}
+            AND student_id_ = #{item.studentId}
+        </foreach>
+    </update>
+    <update id="updateBatch">
+        <foreach collection="list" item="item" index="index" separator=";">
+            UPDATE piano_room_time
+            SET frozen_time_ = #{item.frozenTime}
+            WHERE teacher_id_ = #{item.teacherId}
+        </foreach>
+    </update>
+</mapper>

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

@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.yonge.cooleshow.biz.dal.dao.PinaoRoomTimeDao">
-
-    <select id="selectRemainTime" resultType="com.yonge.cooleshow.biz.dal.vo.PinaoRoomTimeVo"
-            parameterType="java.lang.Long">
-        SELECT *,
-        (SELECT COUNT(1) FROM user_binding_teacher WHERE teacher_id_=#{teacherId}) AS studentCount
-        FROM pinao_room_time
-        WHERE teacher_id_=#{teacherId}
-    </select>
-</mapper>

+ 21 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -29,6 +29,7 @@
     <update id="setSubject">
         update student set subject_id_ = #{subjectIds},update_time_ = now() where user_id_ = #{id}
     </update>
+
     <select id="detail" resultType="com.yonge.cooleshow.biz.dal.vo.StudentVo">
         SELECT
             <include refid="baseColumns"/>,
@@ -49,6 +50,26 @@
         left join sys_user u on t.user_id_ = u.id_
         where t.user_id_ = #{userId}
     </select>
+    <select id="detailByPhone" resultType="com.yonge.cooleshow.biz.dal.vo.StudentVo">
+        SELECT
+            <include refid="baseColumns"/>,
+            u.avatar_ as avatar,
+            u.real_name_ as realName,
+            u.id_card_no_ as idCardNo,
+            u.username_ as username,
+            u.gender_ as gender,
+            u.birthdate_ as birthdate,
+            TIMESTAMPDIFF(YEAR, u.birthdate_, CURDATE()) as age,
+            u.phone_ as phone,
+            (case when isnull(u.id_card_no_) then 0 else 1 end) as isReal,
+            (!isnull(membership_end_time_) and membership_end_time_ > now()) as isVip,
+            (
+                SELECT GROUP_CONCAT(name_) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
+            ) as subjectName
+        FROM student t
+        left join sys_user u on t.user_id_ = u.id_
+        where u.phone_ = #{phone}
+    </select>
     <!-- 分页查询 -->
     <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.vo.StudentVo">
         SELECT

+ 47 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/UserBindingTeacherMapper.xml

@@ -31,4 +31,51 @@
             </if>
         </where>
     </select>
+
+    <!-- 表字段 -->
+    <sql id="teacherColumns">
+        t.user_id_ as "userId"
+        , t.education_background_ as "educationBackground"
+        , t.graduate_school_ as "graduateSchool"
+        , t.technical_titles_ as "technicalTitles"
+        , t.work_unit_ as "workUnit"
+        , t.subject_id_ as "subjectId"
+        , t.introduction_ as "introduction"
+        , t.subject_ as "subject"
+        , t.grad_certificate_ as "gradCertificate"
+        , t.degree_certificate_ as "degreeCertificate"
+        , t.teacher_certificate_ as "teacherCertificate"
+        , t.entry_flag_ as "entryFlag"
+        , t.entry_auth_date_ as "entryAuthDate"
+        , t.musician_flag_ as "musicianFlag"
+        , t.musician_date_ as "musicianDate"
+        , t.live_flag_ as "liveFlag"
+        , t.live_date_ as "liveDate"
+        , t.memo_ as "memo"
+        , t.create_time_ as "createTime"
+        , t.update_time_ as "updateTime"
+    </sql>
+
+    <select id="getBindTeacherByPhone" resultType="com.yonge.cooleshow.biz.dal.vo.TeacherVo">
+        SELECT
+            <include refid="teacherColumns"/>,
+            u.avatar_ as avatar,
+            u.username_ as username,
+            u.gender_ as `gender`,
+            u.birthdate_ as birthdate,
+            u.phone_ as phone,
+            (case when isnull(u.id_card_no_) then 0 else 1 end) as isReal,
+            u.real_name_ as realName,
+            u.id_card_no_ as idCardNo,
+            (
+                SELECT GROUP_CONCAT(name_) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
+            ) as subjectName
+        FROM (
+            select a.* from user_binding_teacher a
+            left join sys_user b on a.student_id_ = b.id_
+            where b.phone_ = #{phone}
+        ) a
+        left join teacher t on a.teacher_id_ = t.user_id_
+        left join sys_user u on t.user_id_ = u.id_
+    </select>
 </mapper>

+ 10 - 4
cooleshow-user/user-biz/src/main/resources/config/mybatis/VipCardRecordMapper.xml

@@ -34,18 +34,24 @@
             s.original_price_ as originalPrice,
             s.sale_price_ as salePrice,
             s.period_ as `period`
-        FROM vip_card_record t
+        FROM user_order_detail a
+        left join vip_card_record t on a.order_no_ = t.order_no_ and a.sub_order_no_ = t.sub_order_no_
         left join member_price_settings s on t.vip_card_id_ = s.id_
-        where t.id_ = #{id}
+        where a.id_ = #{orderDetilId}
         <if test="userId != null">
             and t.user_id_ = #{userId}
         </if>
     </select>
-    
+
+
     <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.vo.VipCardRecordVo">
 		SELECT         
-        	<include refid="baseColumns" />
+        	<include refid="baseColumns" />,
+            s.original_price_ as originalPrice,
+            s.sale_price_ as salePrice,
+            s.period_ as `period`
 		FROM vip_card_record t
+        left join member_price_settings s on t.vip_card_id_ = s.id_
         order by t.create_time_ desc
 	</select>
 

+ 1 - 1
cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/config/ResourceServerConfig.java

@@ -28,7 +28,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
                 .authorizeRequests()
                 .antMatchers("/task/**")
                 .hasIpAddress("0.0.0.0/0")
-                .antMatchers("/wechat/*", "/v2/api-docs", "/code/*", "/payment/callback", "/userOrder/setSuccessStatus")
+                .antMatchers("/wechat/*", "/v2/api-docs", "/code/*","/open/**", "/payment/callback", "/userOrder/setSuccessStatus")
                 .permitAll().anyRequest().authenticated().and().httpBasic();
     }
 

+ 9 - 0
cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/MemberPriceSettingsController.java

@@ -25,6 +25,15 @@ public class MemberPriceSettingsController extends BaseController {
 	@Autowired
 	private SysConfigService sysConfigService;
 
+	/**
+	 * 查询单条
+	 */
+	@GetMapping("/detail/{id}")
+	@ApiOperation(value = "详情", notes = "传入id")
+	public HttpResponseResult<MemberPriceSettingsVo> detail(@PathVariable("id") Long id) {
+		return succeed(memberPriceSettingsService.detail(id));
+	}
+
 	@PostMapping("/list")
 	@ApiOperation(value = "查询列表")
 	public HttpResponseResult<List<MemberPriceSettingsVo>> list(@RequestBody MemberPriceSettingsSearch query) {

+ 0 - 2
cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/StudentController.java

@@ -5,7 +5,6 @@ import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.entity.Subject;
 import com.yonge.cooleshow.biz.dal.support.PageUtil;
-import com.yonge.cooleshow.biz.dal.vo.MyFens;
 import com.yonge.cooleshow.biz.dal.vo.MyFollow;
 import com.yonge.cooleshow.biz.dal.vo.StudentHomeVo;
 import com.yonge.cooleshow.common.controller.BaseController;
@@ -22,7 +21,6 @@ import com.yonge.cooleshow.biz.dal.entity.Student;
 import com.yonge.cooleshow.biz.dal.service.StudentService;
 
 import java.util.List;
-import java.util.Map;
 
 @RestController
 @RequestMapping("/student")

+ 3 - 3
cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/VipCardRecordController.java

@@ -35,14 +35,14 @@ public class VipCardRecordController extends BaseController {
     /**
      * 查询单条
      */
-    @GetMapping("/detail/{id}")
+    @GetMapping("/detail/{orderDetilId}")
     @ApiOperation(value = "详情", notes = "传入id")
-    public HttpResponseResult<VipCardRecordVo> detail(@PathVariable("id") Long id) {
+    public HttpResponseResult<VipCardRecordVo> detail(@PathVariable("orderDetilId") Long orderDetilId) {
         SysUser user = sysUserFeignService.queryUserInfo();
         if (user == null || null == user.getId()) {
             return failed(HttpStatus.FORBIDDEN, "请登录");
         }
-        return succeed(vipCardRecordService.detail(id, user.getId()));
+        return succeed(vipCardRecordService.detail(orderDetilId, user.getId()));
     }
 
     /**

+ 58 - 0
cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/open/OpenClient.java

@@ -0,0 +1,58 @@
+package com.yonge.cooleshow.student.open;
+
+import com.yonge.cooleshow.biz.dal.service.StudentService;
+import com.yonge.cooleshow.biz.dal.service.TeacherService;
+import com.yonge.cooleshow.biz.dal.vo.TeacherVo;
+import com.yonge.cooleshow.common.controller.BaseController;
+import com.yonge.cooleshow.common.entity.HttpResponseResult;
+import com.yonge.toolset.utils.string.StringUtil;
+import com.yonge.toolset.utils.string.ValueUtil;
+import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Map;
+
+
+@RestController
+@RequestMapping("/open")
+@Api(value = "开放权限接口")
+public class OpenClient extends BaseController {
+    @Autowired
+    private TeacherService teacherService;
+
+    @Autowired
+    private StudentService studentService;
+
+    @ApiOperation(value = "查询老师头像昵称信息")
+    @GetMapping("/getTeacher")
+    public HttpResponseResult<TeacherVo> getTeacher(@ApiParam(value = "老师ID", required = true) @RequestParam("userId") Long userId) {
+        if (null == userId) {
+            return failed("缺少老师ID");
+        }
+        TeacherVo detail = teacherService.detail(userId);
+        detail.setIdCardNo(ValueUtil.fuzzyIdCard(detail.getIdCardNo()));
+        detail.setPhone(ValueUtil.fuzzyMobile(detail.getPhone()));
+        return HttpResponseResult.succeed(detail);
+    }
+
+    @ApiOperation(value = "绑定老师")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "phone", value = "手机号", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "userId", value = "老师id", required = true),
+            @ApiImplicitParam(name = "isUpdate", value = "是否更新绑定老师", dataType = "Boolean")
+    })
+    @GetMapping("/bindTeacher")
+    public HttpResponseResult<Map<String,TeacherVo>> bindTeacher(String phone, Long userId, Boolean isUpdate) {
+        if (StringUtil.isEmpty(phone)) {
+            return failed("缺少手机号");
+        }
+        if (null == userId) {
+            return failed("缺少老师ID");
+        }
+        return studentService.bindTeacher(phone, userId, isUpdate);
+    }
+}

+ 30 - 2
cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/TeacherCourseScheduleController.java

@@ -156,12 +156,14 @@ public class TeacherCourseScheduleController extends BaseController {
     //测试未约满课老师
     @GetMapping("/test")
     public HttpResponseResult<Object> test(Integer amount) {
-        return succeed(courseScheduleService.getTeacherId(amount));
+//        return succeed(courseScheduleService.getTeacherId(amount));
+        courseScheduleService.scheduleTask();
+        return succeed();
     }
 
     @ApiOperation("查询琴房剩余时长、冻结时长、统计学员人数")
     @GetMapping("/selectRemainTime")
-    public HttpResponseResult<PinaoRoomTimeVo> selectRemainTime() {
+    public HttpResponseResult<PianoRoomTimeVo> selectRemainTime() {
         SysUser user = sysUserFeignService.queryUserInfo();
         if (user == null || null == user.getId()) {
             return failed(HttpStatus.FORBIDDEN, "请登录");
@@ -195,5 +197,31 @@ public class TeacherCourseScheduleController extends BaseController {
         courseScheduleService.arrangeCourse(arrangeCourseVo, user.getId());
         return succeed();
     }
+
+    @ApiOperation("根据月份查询消耗时长")
+    @GetMapping("/selectConsumeTime")
+    public HttpResponseResult<Object> selectConsumeTime(String month) {
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if (user == null || null == user.getId()) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+        return succeed(courseScheduleService.selectConsumeTime(month, user.getId()));
+    }
+
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "subjectId", dataType = "Long", value = "声部id"),
+            @ApiImplicitParam(name = "month", dataType = "String", value = "月份,yyyy-mm"),
+            @ApiImplicitParam(name = "status", dataType = "String", value = "课程状态"),
+    })
+    @ApiOperation("课程列表&消耗时长列表")
+    @PostMapping("/selectConsumeTimeList")
+    public HttpResponseResult<PageInfo<CourseScheduleRecordVo>> selectConsumeTimeList(@RequestBody Map<String, Object> param) {
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if (user == null || null == user.getId()) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+        param.put("teacherId", user.getId());
+        return succeed(courseScheduleService.selectConsumeTimeList(param));
+    }
 }
 

+ 0 - 24
toolset/toolset-payment/src/main/resources/apiclient_cert.pem

@@ -1,24 +0,0 @@
------BEGIN CERTIFICATE-----
-MIID8zCCAtugAwIBAgIUXkiyBI0+OOmO2K35AnprC9vhf8kwDQYJKoZIhvcNAQEL
-BQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT
-FFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg
-Q0EwHhcNMjIwNTE2MDcxNzE5WhcNMjcwNTE1MDcxNzE5WjCBhDETMBEGA1UEAwwK
-MTYyNTkzMDAzNDEbMBkGA1UECgwS5b6u5L+h5ZWG5oi357O757ufMTAwLgYDVQQL
-DCfmrabmsYnphbfkuZDnp4DnvZHnu5znp5HmioDmnInpmZDlhazlj7gxCzAJBgNV
-BAYMAkNOMREwDwYDVQQHDAhTaGVuWmhlbjCCASIwDQYJKoZIhvcNAQEBBQADggEP
-ADCCAQoCggEBANAWcWJgjzWHrqjxidhyekmBXOTj54lHYkggJC1esX1AwEISOk1E
-edbsw4OVvUZJcyg6pu/vmLTgNZSoCQ2fuiWhTXg5BeMBRN/UejSQFDRVSCfsAnkY
-Xx2eGMKvLWD8Z8VGBtM7nCfb18EGe35vyNtj2v/9o/8hv/cUoGGccFY21gYxiJAQ
-sEKwRjz1hgmahgSOYnb4GQRLbKKPwzToo7oVeKnAjRHQ8wr/+shCjIFGiPXHcIha
-DcU/Wz6StHMp54m9E7cvyHoNK4jlSHjNqWdBZPKzaYx+sozsZD9rZQGjB6l5h3RU
-kU4PaIe+g06FCEp1Yw7eaoTVCM3j+dhVvRcCAwEAAaOBgTB/MAkGA1UdEwQCMAAw
-CwYDVR0PBAQDAgTwMGUGA1UdHwReMFwwWqBYoFaGVGh0dHA6Ly9ldmNhLml0cnVz
-LmNvbS5jbi9wdWJsaWMvaXRydXNjcmw/Q0E9MUJENDIyMEU1MERCQzA0QjA2QUQz
-OTc1NDk4NDZDMDFDM0U4RUJEMjANBgkqhkiG9w0BAQsFAAOCAQEAS3D2jC435T13
-PRYgNceYidbnds+cHWT7e8YJZl5aKNzGY8mCxuGPrmNHblUOfeq0V4cfoSlh/RCv
-8kgKI3a5z6ZvFhuZ9CITKELkuV9ClQIiMveJkxcU68giR7GY68kesZRDYeM2lVCk
-sSOzKjfXbZX30OhDM24vcVD2z6/y/XVoB7MOY8PcrdFT3hRnP1u+3lUXQGijLkMY
-szU6yX4NSac7OSaKNwaJNMqpuHM1uAd6NM4qTQ0oXuwN+uOR0+GCgrUkM/34MPsm
-P/o8TmyqzwJl12k9RNwqlGBem5re08vxrDTnEaZG5NklV8GFmxGyToo+4foueunk
-22KIeOpo6g==
------END CERTIFICATE-----

+ 0 - 28
toolset/toolset-payment/src/main/resources/apiclient_key.pem

@@ -1,28 +0,0 @@
------BEGIN PRIVATE KEY-----
-MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDQFnFiYI81h66o
-8YnYcnpJgVzk4+eJR2JIICQtXrF9QMBCEjpNRHnW7MODlb1GSXMoOqbv75i04DWU
-qAkNn7oloU14OQXjAUTf1Ho0kBQ0VUgn7AJ5GF8dnhjCry1g/GfFRgbTO5wn29fB
-Bnt+b8jbY9r//aP/Ib/3FKBhnHBWNtYGMYiQELBCsEY89YYJmoYEjmJ2+BkES2yi
-j8M06KO6FXipwI0R0PMK//rIQoyBRoj1x3CIWg3FP1s+krRzKeeJvRO3L8h6DSuI
-5Uh4zalnQWTys2mMfrKM7GQ/a2UBowepeYd0VJFOD2iHvoNOhQhKdWMO3mqE1QjN
-4/nYVb0XAgMBAAECggEAPHN4pwrEL9nl/MCGujGvovEI6pnm5rOtMqTbva53w5pv
-AALJmy7ccnq/5dc3cFbgNHytiKDDbTCBgFk8oA+aBVqR5e4y7pqsxpW0ltaQeA+a
-cbaXlVRmNXV7XfuEJFvPTbklPHJh0BaG3FWkxLt2z3133sxxuymz2fTNDu5imDi5
-zmwQ0+WHy955jPOsE726Vnef76PtOxYdZip0QigXeVTr715ohsxPQ+sXyNYMpYsF
-k5A19IkGSYqCzQpyDCA1dDKiAQQQ9Ikh34/B/lOkfOI/Ivf1YTSVjj/XsRd6RW3V
-CQWx7MKTXFE3U/dxragu98ejYmaT5DL9/G5Yptx1kQKBgQDvLLCp0iT5sCCrisH+
-f8fLfvCgUE+MuVYyvFMcps+b/eXaF7SjESqqYgpB2U32vJiCzk760yMFGR7zeoRs
-eUPT0SYIKgm8+t4DnaMBxIarDbgU+KvVlYQR7n1tqf8f2InTWbq/KCVzt+fCP6gO
-vjHUEB2m22pKomGTrNYNQaWxXwKBgQDeueglZsx7Z4QyRKBLYAIqUtFD0kysMz9x
-KLPwRZCceFF8jEl4vk8Ldrvhn0oiz0sPKyvL9Fg4oH+ZWPs2ovCA3vNWGea6Sa5Z
-s1QBDWch1yBaHLStniC1vrLd4lUOraKXFqFBae75430vUlYxzXdaJXdbrzmvFp+V
-yLIZiT13SQKBgGcwPcwWyTMcpQu9ovLdSGLokoJoA9owABuFmsoKwhmIEknk3l9Y
-QbMe91PvoC5qsdYFkpeuzjYd33emjUmLjBLv8lulX2w0Q+MFeNWDZ6KXGauamfBd
-QIzH+z98D4E62EPiO6rLdFUXrBrngedScYcPqOtbUOGAa17eO7+eahE7AoGACKOR
-W5IHMGoteH2s8f+BVf7sWwMXMj6yoUMA57rrBwarsncGioZnLnymgPPavkroEGiO
-RFTv7xJaoKoQ5GehiH4dViOfDW66MoSAJ6JLc8aSXKxsXaeagTIqYezbe7xEaDPa
-gV0IhezK+EDrUvczP+3gGVBMnnv0KK0mK1NlbPECgYEAqs9Usr1XfV/2T0qYY+6J
-KiEHav/SL583ED9ZwPxE/DArc0T0GdJj6ZLhhZFPRFaIRoV4LvoTEg/P5yAg3gkk
-ngc7BCofbkMJ5fIDKO7d6p8aPnlJDYz6GVtGNFJqoCFw7138b0YoxRar0nlUXWBj
-LfwTdN+4AsR0S8oLaKju7QQ=
------END PRIVATE KEY-----