Browse Source

Merge remote-tracking branch 'origin/feature/0529-live' into feature/0529-live

shangke 2 years ago
parent
commit
3be13f159e

+ 185 - 183
.idea/httpRequests/http-requests-log.http

@@ -1,3 +1,188 @@
+POST http://127.0.0.1:9002/teacherAttendance/getLiveCurrentCourseStudents
+authorization: bearer b2d082f2-2e51-4880-8119-5471c5287bf9
+Content-Type: application/json
+Content-Length: 69
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{
+  "courseScheduleId": "2328",
+  "status": "SHARE",
+  "search": ""
+}
+
+<> 2023-06-14T124937.200.json
+
+###
+
+POST http://127.0.0.1:9002/teacherAttendance/getLiveCurrentCourseStudents
+authorization: bearer b2d082f2-2e51-4880-8119-5471c5287bf9
+Content-Type: application/json
+Content-Length: 69
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{
+  "courseScheduleId": "2328",
+  "status": "SHARE",
+  "search": ""
+}
+
+<> 2023-06-14T124615.200.json
+
+###
+
+POST http://127.0.0.1:9002/teacherAttendance/getLiveCurrentCourseStudents
+authorization: bearer b2d082f2-2e51-4880-8119-5471c5287bf9
+Content-Type: application/json
+Content-Length: 69
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{
+  "courseScheduleId": "2328",
+  "status": "SHARE",
+  "search": ""
+}
+
+<> 2023-06-14T124548.200.json
+
+###
+
+POST http://127.0.0.1:9002/teacherAttendance/getLiveCurrentCourseStudents
+authorization: bearer b2d082f2-2e51-4880-8119-5471c5287bf9
+Content-Type: application/json
+Content-Length: 69
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{
+  "courseScheduleId": "2328",
+  "status": "SHARE",
+  "search": ""
+}
+
+<> 2023-06-14T124526.200.json
+
+###
+
+POST http://127.0.0.1:9002/teacherAttendance/getLiveCurrentCourseStudents
+authorization: bearer b2d082f2-2e51-4880-8119-5471c5287bf9
+Content-Type: application/json
+Content-Length: 69
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{
+  "courseScheduleId": "2328",
+  "status": "SHARE",
+  "search": ""
+}
+
+<> 2023-06-14T124513.200.json
+
+###
+
+POST http://127.0.0.1:9002/teacherAttendance/getLiveCurrentCourseStudents
+authorization: bearer b2d082f2-2e51-4880-8119-5471c5287bf9
+Content-Type: application/json
+Content-Length: 69
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{
+  "courseScheduleId": "2328",
+  "status": "SHARE",
+  "search": ""
+}
+
+<> 2023-06-14T124441.200.json
+
+###
+
+POST http://127.0.0.1:9002/teacherCourseSchedule/liveCoursePage
+authorization: bearer a9b023c1-f525-4b95-8723-0ca14b038624
+Content-Type: application/json
+Content-Length: 152
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{
+  "page": 1,
+  "rows": 10,
+//  "startTime": "2023-06-06 10:14:57",
+//  "endTime": "2023-06-08 10:14:57",
+//  "search": "",
+//  "status": "NOT_START"
+}
+
+<> 2023-06-14T111123.200.json
+
+###
+
+POST http://127.0.0.1:8005/vipGroupManage/liveStudentList
+Authorization: bearer b2d082f2-2e51-4880-8119-5471c5287bf9
+Content-Type: application/json
+Content-Length: 78
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{
+  "page": 1,
+  "rows": 10,
+  "liveGroupId": 102,
+  "search": "测试59611"
+}
+
+<> 2023-06-14T105403.200.json
+
+###
+
+POST http://127.0.0.1:8005/vipGroupManage/liveStudentList
+Authorization: bearer b2d082f2-2e51-4880-8119-5471c5287bf9
+Content-Type: application/json
+Content-Length: 77
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{
+  "page": 1,
+  "rows": 10,
+  "liveGroupId": 102,
+  "search": "测试5961"
+}
+
+<> 2023-06-14T105355.200.json
+
+###
+
+POST http://127.0.0.1:8005/vipGroupManage/liveStudentList
+Authorization: bearer b2d082f2-2e51-4880-8119-5471c5287bf9
+Content-Type: application/json
+Content-Length: 51
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{
+  "page": 1,
+  "rows": 10,
+  "liveGroupId": 102
+}
+
+<> 2023-06-14T105332.200.json
+
+###
+
 GET http://127.0.0.1:8005/task/liveCourseRemind
 Connection: Keep-Alive
 User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
@@ -546,186 +731,3 @@ Accept-Encoding: br,deflate,gzip,x-gzip
 
 ###
 
-POST http://127.0.0.1:9002/teacherCourseSchedule/liveCoursePage
-authorization: bearer 1238347b-3b06-444e-9d35-d122639121ad
-Content-Type: application/json
-Content-Length: 152
-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-{
-  "page": 1,
-  "rows": 10,
-//  "startTime": "2023-06-06 10:14:57",
-//  "endTime": "2023-06-08 10:14:57",
-//  "search": "",
-//  "status": "NOT_START"
-}
-
-<> 2023-06-08T111624.200.json
-
-###
-
-POST http://127.0.0.1:9002/teacherCourseSchedule/liveCoursePage
-authorization: bearer 1238347b-3b06-444e-9d35-d122639121ad
-Content-Type: application/json
-Content-Length: 146
-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-{
-  "page": 1,
-  "rows": 10,
-  "startTime": "2023-06-06 10:14:57",
-  "endTime": "2023-06-08 10:14:57",
-  "search": "",
-//  "status": "NOT_START"
-}
-
-<> 2023-06-08T111544.200.json
-
-###
-
-POST http://127.0.0.1:9002/teacherCourseSchedule/liveCoursePage
-Authorization: bearer 3c1eec84-6ee9-4c70-a4a8-d857d57338f6
-Content-Type: application/json
-Content-Length: 146
-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-{
-  "page": 1,
-  "rows": 10,
-  "startTime": "2023-06-06 10:14:57",
-  "endTime": "2023-06-08 10:14:57",
-  "search": "",
-//  "status": "NOT_START"
-}
-
-<> 2023-06-08T110339.200.json
-
-###
-
-POST http://127.0.0.1:9002/teacherCourseSchedule/liveCoursePage
-Authorization: bearer 3c1eec84-6ee9-4c70-a4a8-d857d57338f6
-Content-Type: application/json
-Content-Length: 146
-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-{
-  "page": 1,
-  "rows": 10,
-  "startTime": "2023-06-08 10:14:57",
-  "endTime": "2023-06-08 10:14:57",
-  "search": "",
-//  "status": "NOT_START"
-}
-
-<> 2023-06-08T110325.200.json
-
-###
-
-POST http://127.0.0.1:9002/teacherCourseSchedule/liveCoursePage
-Authorization: bearer 3c1eec84-6ee9-4c70-a4a8-d857d57338f6
-Content-Type: application/json
-Content-Length: 144
-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-{
-  "page": 1,
-  "rows": 10,
-  "startTime": "2023-06-08 10:14:57",
-  "endTime": "2023-06-08 10:14:57",
-  "search": "",
-  "status": "NOT_START"
-}
-
-<> 2023-06-08T110304.200.json
-
-###
-
-POST http://127.0.0.1:9002/teacherCourseSchedule/liveCoursePage
-Authorization: bearer 3c1eec84-6ee9-4c70-a4a8-d857d57338f6
-Content-Type: application/json
-Content-Length: 144
-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-{
-  "page": 1,
-  "rows": 10,
-  "startTime": "2023-06-08 10:14:57",
-  "endTime": "2023-06-08 10:14:57",
-  "search": "",
-  "status": "NOT_START"
-}
-
-<> 2023-06-08T102617.200.json
-
-###
-
-POST http://127.0.0.1:9002/teacherCourseSchedule/liveCoursePage
-Authorization: bearer 6dbea593-df93-4bf4-9f75-538c1bcc231e
-Content-Type: application/json
-Content-Length: 145
-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-{
-  "page": 1,
-  "rows": 10,
-  "startTime": "2023-06-08 10:14:57",
-  "endTime": "2023-06-08 10:14:57",
-  "search": "",
-  "status": "NOT_START",
-}
-
-<> 2023-06-08T101549.200.json
-
-###
-
-POST http://127.0.0.1:9002/teacherCourseSchedule/liveCoursePage
-Authorization: bearer 6dbea593-df93-4bf4-9f75-538c1bcc231e
-Content-Length: 29
-Content-Type: */*; charset=UTF-8
-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-{
-  "page": 1,
-  "rows": 10
-}
-
-<> 2023-06-08T100117.200.json
-
-###
-
-GET http://127.0.0.1:8005/task/liveCourseRemind
-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-<> 2023-06-07T141437.200.json
-
-###
-
-GET http://127.0.0.1:9002/teacherCourseSchedule/liveCourseScheduleTime?courseScheduleId=2030
-Authorization: bearer 2cd308e9-0b8b-4b08-b3cd-f34dc50a8dfd
-Proxy-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-<> 2023-06-07T155507.200.json
-
-###
-

+ 2 - 176
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleStudentPayment.java

@@ -4,6 +4,7 @@ import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.JoinCourseType;
 import com.ym.mec.common.entity.BaseEntity;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import java.math.BigDecimal;
@@ -11,6 +12,7 @@ import java.math.BigDecimal;
 /**
  * 对应数据库表(course_schedule_student_payment):
  */
+@Data
 public class CourseScheduleStudentPayment extends BaseEntity implements Comparable<CourseScheduleStudentPayment> {
 
 	/**  */
@@ -72,46 +74,6 @@ public class CourseScheduleStudentPayment extends BaseEntity implements Comparab
 	@ApiModelProperty(value = "加入课程类型 PURCHASE:购买 SHARE:分享")
 	private JoinCourseType joinCourseType;
 
-	public BigDecimal getExpectPriceBak() {
-		return expectPriceBak;
-	}
-
-	public void setExpectPriceBak(BigDecimal expectPriceBak) {
-		this.expectPriceBak = expectPriceBak;
-	}
-
-	public BigDecimal getActualPriceBak() {
-		return actualPriceBak;
-	}
-
-	public void setActualPriceBak(BigDecimal actualPriceBak) {
-		this.actualPriceBak = actualPriceBak;
-	}
-
-	public Long getCalenderId() {
-		return calenderId;
-	}
-
-	public void setCalenderId(Long calenderId) {
-		this.calenderId = calenderId;
-	}
-
-	public Integer getActivityUserMapperId() {
-		return activityUserMapperId;
-	}
-
-	public void setActivityUserMapperId(Integer activityUserMapperId) {
-		this.activityUserMapperId = activityUserMapperId;
-	}
-
-	public Boolean getBeMerged() {
-		return beMerged;
-	}
-
-	public void setBeMerged(Boolean beMerged) {
-		this.beMerged = beMerged;
-	}
-
 	public CourseScheduleStudentPayment() {
 	}
 
@@ -127,142 +89,6 @@ public class CourseScheduleStudentPayment extends BaseEntity implements Comparab
 		this.courseScheduleId = courseScheduleId;
 	}
 
-	public String getExamSongDownloadJson() {
-		return examSongDownloadJson;
-	}
-
-	public void setExamSongDownloadJson(String examSongDownloadJson) {
-		this.examSongDownloadJson = examSongDownloadJson;
-	}
-
-	public String getOpenPlayMidi() {
-		return openPlayMidi;
-	}
-
-	public void setOpenPlayMidi(String openPlayMidi) {
-		this.openPlayMidi = openPlayMidi;
-	}
-
-	public void setId(Long id){
-		this.id = id;
-	}
-	
-	public Long getId(){
-		return this.id;
-	}
-			
-	public GroupType getGroupType() {
-		return groupType;
-	}
-
-	public void setGroupType(GroupType groupType) {
-		this.groupType = groupType;
-	}
-
-	public String getMusicGroupId() {
-		return musicGroupId;
-	}
-
-	public void setMusicGroupId(String musicGroupId) {
-		this.musicGroupId = musicGroupId;
-	}
-
-	public void setCourseScheduleId(Long courseScheduleId){
-		this.courseScheduleId = courseScheduleId;
-	}
-	
-	public Long getCourseScheduleId(){
-		return this.courseScheduleId;
-	}
-			
-	public void setUserId(Integer userId){
-		this.userId = userId;
-	}
-	
-	public Integer getUserId(){
-		return this.userId;
-	}
-
-	public BigDecimal getOriginalPrice() {
-		return originalPrice;
-	}
-
-	public void setOriginalPrice(BigDecimal originalPrice) {
-		this.originalPrice = originalPrice;
-	}
-
-	public void setExpectPrice(java.math.BigDecimal expectPrice){
-		this.expectPrice = expectPrice;
-	}
-	
-	public java.math.BigDecimal getExpectPrice(){
-		return this.expectPrice;
-	}
-			
-	public void setActualPrice(java.math.BigDecimal actualPrice){
-		this.actualPrice = actualPrice;
-	}
-	
-	public java.math.BigDecimal getActualPrice(){
-		return this.actualPrice;
-	}
-			
-	public void setCreateTime(java.util.Date createTime){
-		this.createTime = createTime;
-	}
-	
-	public java.util.Date getCreateTime(){
-		return this.createTime;
-	}
-			
-	public void setUpdateTime(java.util.Date updateTime){
-		this.updateTime = updateTime;
-	}
-	
-	public java.util.Date getUpdateTime(){
-		return this.updateTime;
-	}
-			
-	public void setSettlementTime(java.util.Date settlementTime){
-		this.settlementTime = settlementTime;
-	}
-	
-	public java.util.Date getSettlementTime(){
-		return this.settlementTime;
-	}
-			
-	public Integer getClassGroupId() {
-		return classGroupId;
-	}
-
-	public void setClassGroupId(Integer classGroupId) {
-		this.classGroupId = classGroupId;
-	}
-
-	public String getBatchNo() {
-		return batchNo;
-	}
-
-	public void setBatchNo(String batchNo) {
-		this.batchNo = batchNo;
-	}
-
-	public CourseSchedule getCourseSchedule() {
-		return courseSchedule;
-	}
-
-	public void setCourseSchedule(CourseSchedule courseSchedule) {
-		this.courseSchedule = courseSchedule;
-	}
-
-	public JoinCourseType getJoinCourseType() {
-		return joinCourseType;
-	}
-
-	public void setJoinCourseType(JoinCourseType joinCourseType) {
-		this.joinCourseType = joinCourseType;
-	}
-
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 6 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/LiveGroupWrapper.java

@@ -38,6 +38,9 @@ public class LiveGroupWrapper {
 
         @ApiModelProperty("共享方式,NO_SHARE:未共享,OPEN:公开,PRIVATE:私密")
         private ShareModeEnum shareMode;
+
+        @ApiModelProperty("模糊查询")
+        private String search;
     }
 
 
@@ -112,6 +115,9 @@ public class LiveGroupWrapper {
 
         private Integer tenantId;
 
+        //未开始直播课,提前开始时间
+        private Integer notStartCourseTime;
+
     }
 
 

+ 14 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -6037,6 +6037,11 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
     @Override
     public IPage<CourseScheduleDto> liveCoursePage(LiveGroupWrapper.LiveCoursePageQuery queryInfo) {
         IPage<CourseScheduleDto> page = com.microsvc.toolkit.common.response.paging.QueryInfo.getPage(queryInfo);
+
+        // 直播课判断时间,提前30分钟将课程改为进行中
+        Integer studentRemindTime = Integer.parseInt(sysConfigService.findByParamName(SysConfigService.LIVE_CLASS_START_REMIND_TIME).getParanValue());
+
+        queryInfo.setNotStartCourseTime(studentRemindTime);
         List<CourseScheduleDto> courseScheduleDtos = liveGroupPlusMapper.liveCoursePage(page, queryInfo);
         if (CollectionUtils.isEmpty(courseScheduleDtos)) {
             return page;
@@ -6046,6 +6051,15 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         List<CourseScheduleDto> teacherCourseFormat = getTeacherCourseFormat(queryInfo.getTeacherId(), new Date(),
                 queryInfo.getTenantId(), courseScheduleDtos, courseIds, courseIds);
 
+
+        for (CourseScheduleDto record : teacherCourseFormat) {
+            if (CourseScheduleType.LIVE.equals(record.getType()) && CourseStatusEnum.NOT_START.equals(record.getStatus())) {
+                Date date = DateUtil.addMinutes(new Date(), studentRemindTime);
+                if (date.after(record.getStartClassTime())) {
+                    record.setStatus(CourseStatusEnum.UNDERWAY);
+                }
+            }
+        }
         return page.setRecords(teacherCourseFormat);
     }
 

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseShareServiceImpl.java

@@ -157,6 +157,7 @@ public class CourseShareServiceImpl extends BaseServiceImpl<Integer, CourseShare
             CourseSchedule schedule = schedules.get(0);
             CourseScheduleStudentPayment payment = new CourseScheduleStudentPayment();
             payment.setGroupType(schedule.getGroupType());
+            payment.setCourseScheduleId(courseId);
             payment.setMusicGroupId(schedule.getMusicGroupId());
             payment.setUserId(userId);
             // 分享方式下,价格为0

+ 46 - 23
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -3205,12 +3205,28 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
         classStudentMapperByUserIdAndClassGroupId.setStatus(ClassGroupStudentStatusEnum.QUIT);
         classGroupStudentMapperDao.update(classStudentMapperByUserIdAndClassGroupId);
+        List<CourseSchedule> musicGroupCourseSchedules = courseScheduleDao.findMusicGroupCourseSchedulesWithStudent(vipGroupId.toString(), groupType.getCode(), CourseStatusEnum.NOT_START.getCode(), studentId);
+        if (!org.apache.commons.collections.CollectionUtils.isEmpty(musicGroupCourseSchedules)) {
+            List<Long> courseScheduleIds = musicGroupCourseSchedules.stream()
+                    .map(courseSchedule -> courseSchedule.getId())
+                    .collect(Collectors.toList());
+            courseScheduleDao.deleteMusicGroupCourseSchedulesWithStudent(courseScheduleIds, studentId);
+            studentAttendanceDao.deleteByCourseAndUser(courseScheduleIds,studentId);
+            if(groupType == LIVE){
+                List<CourseScheduleStudentPayment> studentPayments = courseScheduleStudentPaymentDao.findByCourseScheduleIds(courseScheduleIds);
+                if(!CollectionUtils.isEmpty(studentPayments)){
+                    Map<Long, Integer> courseStudentNumMap = studentPayments.stream().filter(e -> e.getJoinCourseType() == JoinCourseType.PURCHASE)
+                            .collect(Collectors.groupingBy(e -> e.getCourseScheduleId(), Collectors.collectingAndThen(Collectors.toList(), v -> v.size())));
+                    for (Long courseId : courseStudentNumMap.keySet()) {
+                        Integer studentNum = courseStudentNumMap.get(courseId);
+                        if(studentNum != null && studentNum > 0){
+                            
+                        }else {
 
-        courseScheduleService.batchDeleteMusicGroupCourseWithStudent(vipGroupId.toString(), studentId, groupType);
-
-        List<Integer> studentPaymentIds = courseScheduleStudentPaymentDao.findNotStartCourseStudentPaymentIdsWithClassGroupAndStudent(classGroup.getId(), studentId);
-        if (!CollectionUtils.isEmpty(studentPaymentIds)) {
-            courseScheduleStudentPaymentDao.batchDeleteWithID(studentPaymentIds);
+                        }
+                    }
+                }
+            }
         }
 
         if (!vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING) || (Objects.nonNull(vipGroupCategory) && vipGroupCategory.getMusicTheory())) {
@@ -4886,7 +4902,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         Map<Integer, List<StudentApplyRefunds>> studentApplyRefundsMap = applyRefunds.stream()
                 .collect(Collectors.groupingBy(StudentApplyRefunds::getUserId));
         records.forEach(data -> {
-            ClassGroupStudentMapper classGroupStudentMapper = studentMapperMap.get(data.getStudentId().intValue());
+            ClassGroupStudentMapper classGroupStudentMapper = studentMapperMap.get(data.getStudentId());
             if (Objects.isNull(classGroupStudentMapper)) {
                 data.setStudentStatus(0);
                 return;
@@ -4899,7 +4915,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
                 return;
             }
 
-            List<StudentApplyRefunds> studentApplyRefunds = studentApplyRefundsMap.get(data.getStudentId().intValue());
+            List<StudentApplyRefunds> studentApplyRefunds = studentApplyRefundsMap.get(data.getStudentId());
             if (!CollectionUtils.isEmpty(studentApplyRefunds)) {
                 StudentApplyRefunds studentApplyRefund = studentApplyRefunds.get(0);
                 if (data.getStudentStatus() == 0 && studentApplyRefund.getStatus().equals(StudentApplyRefundsStatus.ING)) {
@@ -5220,25 +5236,32 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
             throw new BizException("课程不存在");
         }
 
+        // 购买用户可以直接进入
+        CourseScheduleStudentPayment payment = courseScheduleStudentPaymentDao.getByUserIdAndCourseId(studentId, courseScheduleId.longValue());
+        if (!Objects.isNull(payment) && JoinCourseType.PURCHASE.equals(payment.getJoinCourseType())) {
 
-        // 分享类型  是否能进入
-        if (ShareModeEnum.NO_SHARE.equals(courseSchedule.getShareMode())) {
-            throw new BizException("课程不允许分享");
-        }
-        if (ShareModeEnum.PRIVATE.equals(courseSchedule.getShareMode())) {
-            // 查询
-            CourseShare courseShare = courseShareService.getByUserIdAndCourseId(studentId, courseScheduleId);
-            if (Objects.isNull(courseShare)) {
-                throw new BizException("非分享用户,不可进入");
+        } else {
+
+
+            // 分享类型  是否能进入
+            if (ShareModeEnum.NO_SHARE.equals(courseSchedule.getShareMode())) {
+                throw new BizException("课程不允许分享");
+            }
+            if (ShareModeEnum.PRIVATE.equals(courseSchedule.getShareMode())) {
+                // 查询
+                CourseShare courseShare = courseShareService.getByUserIdAndCourseId(studentId, courseScheduleId);
+                if (Objects.isNull(courseShare)) {
+                    throw new BizException("非分享用户,不可进入");
+                }
             }
-        }
 
-        SysUser sysUser = sysUserService.queryUserById(studentId);
-        if (Objects.isNull(sysUser)) {
-            throw new BizException("用户不存在");
-        }
-        if(!courseSchedule.getTenantId().equals(sysUser.getTenantId())) {
-            throw new BizException("用户不属于此机构");
+            SysUser sysUser = sysUserService.queryUserById(studentId);
+            if (Objects.isNull(sysUser)) {
+                throw new BizException("用户不存在");
+            }
+            if (!courseSchedule.getTenantId().equals(sysUser.getTenantId())) {
+                throw new BizException("用户不属于此机构");
+            }
         }
 
         Integer studentRemindTime = Integer.parseInt(sysConfigService.findByParamName(SysConfigService.LIVE_CLASS_START_REMIND_TIME).getParanValue());

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

@@ -60,10 +60,11 @@
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO course_schedule_student_payment (id_,group_type_,music_group_id_,course_schedule_id_,user_id_,
 			original_price_,expect_price_,actual_price_,expect_price_bak_,actual_price_bak_,create_time_,update_time_,
-		settlement_time_,class_group_id_,batch_no_,be_merged_,tenant_id_,activity_user_mapper_id_)
+		settlement_time_,class_group_id_,batch_no_,be_merged_,tenant_id_,activity_user_mapper_id_,join_course_type_)
 		VALUES(#{id},#{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{musicGroupId},#{courseScheduleId},#{userId},
 			#{originalPrice},#{expectPrice},#{actualPrice},#{expectPriceBak},#{actualPriceBak},NOW(),NOW()
-			,#{settlementTime},#{classGroupId},#{batchNo},#{beMerged},#{tenantId},#{activityUserMapperId})
+			,#{settlementTime},#{classGroupId},#{batchNo},#{beMerged},#{tenantId},#{activityUserMapperId}
+        ,#{joinCourseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
 	</insert>
     <insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id_">
 		INSERT INTO course_schedule_student_payment (id_,group_type_,music_group_id_,course_schedule_id_,user_id_,

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

@@ -8,12 +8,19 @@
     t.create_time_ as createTime,
     t.order_no_ as orderNo
     from student_payment_order t
+    left join sys_user su on su.id_ = t.user_id_
     <where>
         <if test="param.liveGroupId != null">
             and t.music_group_id_ = #{param.liveGroupId}
             and t.type_ = 'LIVE_GROUP_BUY'
             and t.status_ = 'SUCCESS'
         </if>
+        <if test="param.search != null and param.search != ''">
+            and (su.id_ = #{param.search}
+                or su.username_ like concat('%',#{param.search},'%')
+                or su.phone_ like concat('%',#{param.search},'%')
+            )
+        </if>
     </where>
 
     </select>
@@ -30,7 +37,7 @@
     cs.class_date_,
     CONCAT(cs.class_date_,' ',cs.start_class_time_) start_class_time_,
     CONCAT(cs.class_date_,' ',cs.end_class_time_) end_class_time_,
-    cs.status_,
+    cs.status_ as status_,
     csts.user_id_ actual_teacher_id_,
     csts.teacher_role_,
     cg.expect_student_num_,
@@ -64,7 +71,14 @@
     </if>
     AND csts.user_id_ = #{param.teacherId} AND cs.pre_course_flag_ = 0
     <if test="param.status != null">
-        AND cs.status_ = #{param.status}
+        <if test="param.status == 'UNDERWAY'">
+            AND (cs.status_  = 'UNDERWAY'
+                or (cs.status_ = 'NOT_START' and  CONCAT(cs.class_date_,' ',cs.start_class_time_) &lt; date_add(now(), interval #{param.notStartCourseTime} minute))
+            )
+        </if>
+        <if test="param.status == 'NOT_START'">
+            AND cs.status_ = 'NOT_START' and CONCAT(cs.class_date_,' ',cs.start_class_time_) &gt; date_add(now(), interval #{param.notStartCourseTime} minute)
+        </if>
     </if>
     <if test="param.search != null and param.search != ''">
         AND (cs.name_ LIKE CONCAT('%',#{param.search},'%'))

+ 284 - 224
mec-common/common-core/src/main/java/com/ym/mec/common/service/impl/BaseServiceImpl.java

@@ -25,6 +25,7 @@ import java.math.BigDecimal;
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
+import java.sql.SQLException;
 import java.util.*;
 
 /**
@@ -34,244 +35,303 @@ import java.util.*;
  */
 public abstract class BaseServiceImpl<PK extends Serializable, T> implements BaseService<PK, T> {
 
-	@Autowired
-	protected SqlSessionFactory sqlSessionFactory;
+    @Autowired
+    protected SqlSessionFactory sqlSessionFactory;
 
-	public abstract BaseDAO<PK, T> getDAO();
+    public abstract BaseDAO<PK, T> getDAO();
 
-	/**
-	 * 通过主键id加载对象
-	 * @param id
-	 * @return
-	 */
-	public T get(final PK id) {
-		return this.getDAO().get(id);
-	}
+    /**
+     * 通过主键id加载对象
+     * @param id
+     * @return
+     */
+    public T get(final PK id) {
+        return this.getDAO().get(id);
+    }
 
-	/**
-	 * 更新实体对象
-	 * @param bean
-	 * @return int
-	 */
-	public int update(T bean) {
-		return this.getDAO().update(bean);
-	}
+    /**
+     * 更新实体对象
+     * @param bean
+     * @return int
+     */
+    public int update(T bean) {
+        return this.getDAO().update(bean);
+    }
 
-	/**
-	 * 通过主键id删除对象
-	 * @param id
-	 * @return int
-	 */
-	public int delete(final PK id) {
-		return this.getDAO().delete(id);
-	}
+    /**
+     * 通过主键id删除对象
+     * @param id
+     * @return int
+     */
+    public int delete(final PK id) {
+        return this.getDAO().delete(id);
+    }
 
-	/**
-	 * 写入实体对象
-	 * @param bean
-	 * @return int
-	 */
-	public long insert(T bean) {
-		return this.getDAO().insert(bean);
-	}
+    /**
+     * 写入实体对象
+     * @param bean
+     * @return int
+     */
+    public long insert(T bean) {
+        return this.getDAO().insert(bean);
+    }
 
-	/**
-	 * 通过参数查找所有结果集
-	 * @param params
-	 * @return
-	 */
-	public List<T> findAll(Map<String, Object> params) {
-		final String TENANT_ID = "tenantId";
-		
-		if(!params.containsKey(TENANT_ID)){
-			params.put(TENANT_ID, TenantContextHolder.getTenantId());
-		}
-		return this.getDAO().findAll(params);
-	}
+    /**
+     * 通过参数查找所有结果集
+     * @param params
+     * @return
+     */
+    public List<T> findAll(Map<String, Object> params) {
+        final String TENANT_ID = "tenantId";
 
-	/**
-	 * 通过参数查找结果集,适合分页场景
-	 * @param queryInfo
-	 * @return
-	 */
-	public PageInfo<T> queryPage(QueryInfo queryInfo) {
-		PageInfo<T> pageInfo = new PageInfo<T>(queryInfo.getPage(), queryInfo.getRows());
-		Map<String, Object> params = new HashMap<String, Object>();
-		MapUtil.populateMap(params, queryInfo);
-		
-		List<T> dataList = null;
-		int count = this.findCount(params);
-		if (count > 0) {
-			pageInfo.setTotal(count);
-			params.put("offset", pageInfo.getOffset());
-			dataList = this.getDAO().queryPage(params);
-		}
-		if (count == 0) {
-			dataList = new ArrayList<T>();
-		}
-		pageInfo.setRows(dataList);
-		return pageInfo;
-	}
+        if(!params.containsKey(TENANT_ID)){
+            params.put(TENANT_ID, TenantContextHolder.getTenantId());
+        }
+        return this.getDAO().findAll(params);
+    }
 
-	/**
-	 * 通过参数查找结果集数目
-	 * @author pengdc
-	 * @param params
-	 * @return
-	 */
-	public int findCount(Map<String, Object> params) {
-		return this.getDAO().queryCount(params);
-	}
+    /**
+     * 通过参数查找结果集,适合分页场景
+     * @param queryInfo
+     * @return
+     */
+    public PageInfo<T> queryPage(QueryInfo queryInfo) {
+        PageInfo<T> pageInfo = new PageInfo<T>(queryInfo.getPage(), queryInfo.getRows());
+        Map<String, Object> params = new HashMap<String, Object>();
+        MapUtil.populateMap(params, queryInfo);
 
+        List<T> dataList = null;
+        int count = this.findCount(params);
+        if (count > 0) {
+            pageInfo.setTotal(count);
+            params.put("offset", pageInfo.getOffset());
+            dataList = this.getDAO().queryPage(params);
+        }
+        if (count == 0) {
+            dataList = new ArrayList<T>();
+        }
+        pageInfo.setRows(dataList);
+        return pageInfo;
+    }
 
-	@Override
-	public <K extends Collection, Y, Z> Map<Y,Z> getMap(String tableName, String columnKey, String columnValue, K ids,Integer tenantId, Class<Y> keyType, Class<Z> valueType){
-		if(CollectionUtils.isEmpty(ids)){
-			return Collections.emptyMap();
-		}
-		StringBuffer sql=new StringBuffer();
-		Map<Y,Z> result=new HashMap();
-		try {
-			SqlSession sqlSession = sqlSessionFactory.openSession();
-			Connection connection = sqlSession.getConnection();
-			sql.append("SELECT ").append(columnKey).append(",").append(columnValue).append(" FROM ").append(tableName).append(" WHERE ").append(columnKey).append(" IN (").append(StringUtils.join(ids, ",")).append(")");
-			if(tenantId != null){
-				sql.append(" AND tenant_id_ = ").append(tenantId);
-			}
-			PreparedStatement ps = connection.prepareStatement(sql.toString());
-			ResultSet resultSet = ps.executeQuery();
-			while (resultSet.next()){
-				Y key;
-				Z value;
-				if(keyType.isAssignableFrom(BigDecimal.class)){
-					key = (Y) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(1));
-				}else if(keyType.isAssignableFrom(String.class)){
-					key = (Y) resultSet.getString(1);
-				}else{
-					key = (Y) keyType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(1));
-				}
-				if(valueType.isAssignableFrom(BigDecimal.class)){
-					value = (Z) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(2));
-				}else if(valueType.isAssignableFrom(String.class)){
-					value = (Z) resultSet.getString(2);
-				}else{
-					value = (Z) valueType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(2));
-				}
-				result.put(key, value);
-			}
-			if(resultSet!=null){
-				resultSet.close();
-			}
-			if(ps!=null){
-				ps.close();
-			}
-			if(sqlSession!=null){
-				sqlSession.close();
-			}
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
+    /**
+     * 通过参数查找结果集数目
+     * @author pengdc
+     * @param params
+     * @return
+     */
+    public int findCount(Map<String, Object> params) {
+        return this.getDAO().queryCount(params);
+    }
 
-		return result;
-	}
 
-	@Override
-	public <K extends List, Y, Z> Map<Y,Z> getMap(String tableName, String columnKey, String columnValue, String ids, Class<Y> keyType, Class<Z> valueType){
-		if(StringUtils.isEmpty(ids)){
-			return Collections.emptyMap();
-		}
-		StringBuffer sql=new StringBuffer();
-		Map<Y,Z> result=new HashMap();
-		try {
-			SqlSession sqlSession = sqlSessionFactory.openSession();
-			Connection connection = sqlSession.getConnection();
-			sql.append("SELECT ").append(columnKey).append(",").append(columnValue).append(" FROM ").append(tableName).append(" WHERE ").append(columnKey).append(" IN (").append(ids).append(")");
-			PreparedStatement ps = connection.prepareStatement(sql.toString());
-			ResultSet resultSet = ps.executeQuery();
-			while (resultSet.next()){
-				Y key;
-				Z value;
-				if(keyType.isAssignableFrom(BigDecimal.class)){
-					key = (Y) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(1));
-				}else if(keyType.isAssignableFrom(String.class)){
-					key = (Y) resultSet.getString(1);
-				}else{
-					key = (Y) keyType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(1));
-				}
-				if(valueType.isAssignableFrom(BigDecimal.class)){
-					value = (Z) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(2));
-				}else if(valueType.isAssignableFrom(String.class)){
-					value = (Z) resultSet.getString(2);
-				}else{
-					value = (Z) valueType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(2));
-				}
-				result.put(key, value);
-			}
-			if(resultSet!=null){
-				resultSet.close();
-			}
-			if(ps!=null){
-				ps.close();
-			}
-			if(sqlSession!=null){
-				sqlSession.close();
-			}
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
+    @Override
+    public <K extends Collection, Y, Z> Map<Y,Z> getMap(String tableName, String columnKey, String columnValue, K ids,Integer tenantId, Class<Y> keyType, Class<Z> valueType){
+        if(CollectionUtils.isEmpty(ids)){
+            return Collections.emptyMap();
+        }
+        StringBuffer sql=new StringBuffer();
+        Map<Y,Z> result=new HashMap();
+        SqlSession sqlSession = null;
+        Connection connection = null;
+        PreparedStatement ps = null;
+        try {
+            sqlSession = sqlSessionFactory.openSession();
+            connection = sqlSession.getConnection();
+            sql.append("SELECT ").append(columnKey).append(",").append(columnValue).append(" FROM ").append(tableName).append(" WHERE ").append(columnKey).append(" IN (").append(StringUtils.join(ids, ",")).append(")");
+            if(tenantId != null){
+                sql.append(" AND tenant_id_ = ").append(tenantId);
+            }
+            ps = connection.prepareStatement(sql.toString());
+            ResultSet resultSet = ps.executeQuery();
+            while (resultSet.next()){
+                Y key;
+                Z value;
+                if(keyType.isAssignableFrom(BigDecimal.class)){
+                    key = (Y) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(1));
+                }else if(keyType.isAssignableFrom(String.class)){
+                    key = (Y) resultSet.getString(1);
+                }else{
+                    key = (Y) keyType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(1));
+                }
+                if(valueType.isAssignableFrom(BigDecimal.class)){
+                    value = (Z) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(2));
+                }else if(valueType.isAssignableFrom(String.class)){
+                    value = (Z) resultSet.getString(2);
+                }else{
+                    value = (Z) valueType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(2));
+                }
+                result.put(key, value);
+            }
+            if(resultSet!=null){
+                resultSet.close();
+            }
+            if(ps!=null){
+                ps.close();
+            }
+            if(sqlSession!=null){
+                sqlSession.close();
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            if(ps!=null){
+                try {
+                    ps.close();
+                } catch (SQLException e) {
+                }
+            }
+            if(sqlSession!=null){
+                sqlSession.close();
+            }
+            if(connection!=null){
+                try {
+                    connection.close();
+                } catch (SQLException e) {
+                }
+            }
+        }
 
-		return result;
-	}
+            return result;
+        }
 
+        @Override
+        public <K extends List, Y, Z> Map<Y,Z> getMap(String tableName, String columnKey, String columnValue, String ids, Class<Y> keyType, Class<Z> valueType){
+            if(StringUtils.isEmpty(ids)){
+                return Collections.emptyMap();
+            }
+            StringBuffer sql=new StringBuffer();
+            Map<Y,Z> result=new HashMap();
 
-	@Override
-	public <K extends List, Y, Z> Map<Y,Z> getMap(String tableName, String columnKey, String columnValue,Boolean hasDelFlag,Integer tenantId, Class<Y> keyType, Class<Z> valueType){
-		StringBuffer sql=new StringBuffer();
-		Map<Y,Z> result=new HashMap();
-		try {
-			SqlSession sqlSession = sqlSessionFactory.openSession();
-			Connection connection = sqlSession.getConnection();
-			sql.append("SELECT ").append(columnKey).append(",").append(columnValue).append(" FROM ").append(tableName).append(" WHERE 1 = 1");
-			if(hasDelFlag){
-				sql.append(" AND del_flag_ = 0");
-			}
-			if(tenantId != null){
-				sql.append(" AND tenant_id_ = ").append(tenantId);
-			}
-			PreparedStatement ps = connection.prepareStatement(sql.toString());
-			ResultSet resultSet = ps.executeQuery();
-			while (resultSet.next()){
-				Y key;
-				Z value;
-				if(keyType.isAssignableFrom(BigDecimal.class)){
-					key = (Y) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(1));
-				}else if(keyType.isAssignableFrom(String.class)){
-					key = (Y) resultSet.getString(1);
-				}else{
-					key = (Y) keyType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(1));
-				}
-				if(valueType.isAssignableFrom(BigDecimal.class)){
-					value = (Z) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(2));
-				}else if(valueType.isAssignableFrom(String.class)){
-					value = (Z) resultSet.getString(2);
-				}else{
-					value = (Z) valueType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(2));
-				}
-				result.put(key, value);
-			}
-			if(resultSet!=null){
-				resultSet.close();
-			}
-			if(ps!=null){
-				ps.close();
-			}
-			if(sqlSession!=null){
-				sqlSession.close();
-			}
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
+            SqlSession sqlSession = null;
+            Connection connection = null;
+            PreparedStatement ps = null;
+            try {
+                sqlSession = sqlSessionFactory.openSession();
+                connection = sqlSession.getConnection();
+                sql.append("SELECT ").append(columnKey).append(",").append(columnValue).append(" FROM ").append(tableName).append(" WHERE ").append(columnKey).append(" IN (").append(ids).append(")");
+                ps = connection.prepareStatement(sql.toString());
+                ResultSet resultSet = ps.executeQuery();
+                while (resultSet.next()){
+                    Y key;
+                    Z value;
+                    if(keyType.isAssignableFrom(BigDecimal.class)){
+                        key = (Y) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(1));
+                    }else if(keyType.isAssignableFrom(String.class)){
+                        key = (Y) resultSet.getString(1);
+                    }else{
+                        key = (Y) keyType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(1));
+                    }
+                    if(valueType.isAssignableFrom(BigDecimal.class)){
+                        value = (Z) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(2));
+                    }else if(valueType.isAssignableFrom(String.class)){
+                        value = (Z) resultSet.getString(2);
+                    }else{
+                        value = (Z) valueType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(2));
+                    }
+                    result.put(key, value);
+                }
+                if(resultSet!=null){
+                    resultSet.close();
+                }
+                if(ps!=null){
+                    ps.close();
+                }
+                if(sqlSession!=null){
+                    sqlSession.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }finally {
+                if(ps!=null){
+                    try {
+                        ps.close();
+                    } catch (SQLException e) {
+                    }
+                }
+                if(sqlSession!=null){
+                    sqlSession.close();
+                }
+                if(connection!=null){
+                    try {
+                        connection.close();
+                    } catch (SQLException e) {
+                    }
+                }
+            }
 
-		return result;
-	}
+            return result;
+        }
+
+
+        @Override
+        public <K extends List, Y, Z> Map<Y,Z> getMap(String tableName, String columnKey, String columnValue,Boolean hasDelFlag,Integer tenantId, Class<Y> keyType, Class<Z> valueType){
+            StringBuffer sql=new StringBuffer();
+            Map<Y,Z> result=new HashMap();
+
+            SqlSession sqlSession = null;
+            Connection connection = null;
+            PreparedStatement ps = null;
+            try {
+                sqlSession = sqlSessionFactory.openSession();
+                connection = sqlSession.getConnection();
+                sql.append("SELECT ").append(columnKey).append(",").append(columnValue).append(" FROM ").append(tableName).append(" WHERE 1 = 1");
+                if(hasDelFlag){
+                    sql.append(" AND del_flag_ = 0");
+                }
+                if(tenantId != null){
+                    sql.append(" AND tenant_id_ = ").append(tenantId);
+                }
+                ps = connection.prepareStatement(sql.toString());
+                ResultSet resultSet = ps.executeQuery();
+                while (resultSet.next()){
+                    Y key;
+                    Z value;
+                    if(keyType.isAssignableFrom(BigDecimal.class)){
+                        key = (Y) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(1));
+                    }else if(keyType.isAssignableFrom(String.class)){
+                        key = (Y) resultSet.getString(1);
+                    }else{
+                        key = (Y) keyType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(1));
+                    }
+                    if(valueType.isAssignableFrom(BigDecimal.class)){
+                        value = (Z) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(2));
+                    }else if(valueType.isAssignableFrom(String.class)){
+                        value = (Z) resultSet.getString(2);
+                    }else{
+                        value = (Z) valueType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(2));
+                    }
+                    result.put(key, value);
+                }
+                if(resultSet!=null){
+                    resultSet.close();
+                }
+                if(ps!=null){
+                    ps.close();
+                }
+                if(sqlSession!=null){
+                    sqlSession.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }finally {
+                if(ps!=null){
+                    try {
+                        ps.close();
+                    } catch (SQLException e) {
+                    }
+                }
+                if(sqlSession!=null){
+                    sqlSession.close();
+                }
+                if(connection!=null){
+                    try {
+                        connection.close();
+                    } catch (SQLException e) {
+                    }
+                }
+            }
+
+            return result;
+        }
 }