Browse Source

Merge remote-tracking branch 'origin/master'

周箭河 5 years ago
parent
commit
012d34fb00
18 changed files with 248 additions and 26 deletions
  1. 1 1
      cms/src/main/java/com/ym/mec/cms/CmsServerApplication.java
  2. 2 2
      cms/src/main/java/com/ym/mec/cms/service/impl/SysNewsInformationServiceImpl.java
  3. 22 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java
  4. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/PracticeGroupDao.java
  5. 31 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ExtraExerciseStudentsDto.java
  6. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentExercisesSituationDto.java
  7. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/ExtraExercilseReplyQueryInfo.java
  8. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentExercisesSituationQueryInfo.java
  9. 20 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/EduPracticeGroupServiceImpl.java
  10. 18 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesReplyServiceImpl.java
  11. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java
  12. 18 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentExtracurricularExercisesSituationServiceImpl.java
  13. 22 9
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  14. 34 0
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  15. 6 0
      mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesReplyMapper.xml
  16. 6 2
      mec-biz/src/main/resources/config/mybatis/PracticeGroupMapper.xml
  17. 19 3
      mec-biz/src/main/resources/config/mybatis/StudentExtracurricularExercisesSituationMapper.xml
  18. 4 2
      mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

+ 1 - 1
cms/src/main/java/com/ym/mec/cms/CmsServerApplication.java

@@ -15,7 +15,7 @@ import com.spring4all.swagger.EnableSwagger2Doc;
 
 
 @SpringBootApplication
 @SpringBootApplication
 @EnableDiscoveryClient
 @EnableDiscoveryClient
-@EnableFeignClients
+@EnableFeignClients("com.ym.mec")
 @MapperScan("com.ym.mec.cms.dal.dao")
 @MapperScan("com.ym.mec.cms.dal.dao")
 @ComponentScan(basePackages = { "com.ym.mec.cms", "com.ym.mec.im", "com.ym.mec.auth", "com.ym.mec.common.config", "com.ym.mec.common.security" })
 @ComponentScan(basePackages = { "com.ym.mec.cms", "com.ym.mec.im", "com.ym.mec.auth", "com.ym.mec.common.config", "com.ym.mec.common.security" })
 @Configuration
 @Configuration

+ 2 - 2
cms/src/main/java/com/ym/mec/cms/service/impl/SysNewsInformationServiceImpl.java

@@ -98,10 +98,10 @@ public class SysNewsInformationServiceImpl extends BaseServiceImpl<Long, SysNews
 				SysNewsInformation info = new SysNewsInformation();
 				SysNewsInformation info = new SysNewsInformation();
 				info.setOrder(1);
 				info.setOrder(1);
 				if (isNewer) {
 				if (isNewer) {
-					info.setLinkUrl(serverContextPath + "/#/auditionActive/1");
+					info.setLinkUrl(serverContextPath + "/#/auditionActive");
 					info.setCoverImage("https://daya-online.oss-cn-beijing.aliyuncs.com/tempActivity/3_1.jpg");
 					info.setCoverImage("https://daya-online.oss-cn-beijing.aliyuncs.com/tempActivity/3_1.jpg");
 				} else {
 				} else {
-					info.setLinkUrl(serverContextPath + "/#/auditionActive/1");
+					info.setLinkUrl(serverContextPath + "/#/auditionActive");
 					info.setCoverImage("https://daya-online.oss-cn-beijing.aliyuncs.com/tempActivity/3_2.jpg");
 					info.setCoverImage("https://daya-online.oss-cn-beijing.aliyuncs.com/tempActivity/3_2.jpg");
 				}
 				}
 				pageInfos.getRows().add(info);
 				pageInfos.getRows().add(info);

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java

@@ -1299,6 +1299,28 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
     List<Map<Long, String>> queryTeacherName(@Param("courseScheduleIds") List<Long> courseScheduleIds);
     List<Map<Long, String>> queryTeacherName(@Param("courseScheduleIds") List<Long> courseScheduleIds);
 
 
     /**
     /**
+     * @describe 统计学生在指定周期内的vip课数量
+     * @author Joburgess
+     * @date 2020.04.28
+     * @param studentIds:
+     * @param startTime:
+     * @param endTime:
+     * @return java.util.List<java.util.Map<java.lang.Integer,java.lang.Integer>>
+     */
+    List<Map<Integer, Long>> countStudentVipCoursesWithDate(@Param("studentIds") List<Integer> studentIds,
+                                                               @Param("startTime") Date startTime,
+                                                               @Param("endTime") Date endTime);
+
+    /**
+     * @describe 统计学生在未来的vip课数量
+     * @author Joburgess
+     * @date 2020.04.28
+     * @param studentIds:
+     * @return java.util.List<java.util.Map<java.lang.Integer,java.lang.Integer>>
+     */
+    List<Map<Integer, Long>> countStudentVipCoursesInFuture(@Param("studentIds") List<Integer> studentIds);
+
+    /**
      * @param groupId:
      * @param groupId:
      * @param groupType:
      * @param groupType:
      * @param isLock:    冻结状态:1、冻结,0、正常
      * @param isLock:    冻结状态:1、冻结,0、正常

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/PracticeGroupDao.java

@@ -294,6 +294,15 @@ public interface PracticeGroupDao extends com.ym.mec.common.dal.BaseDAO<Long, Pr
     int countStudentTrialPractices(@Param("studentId") Integer studentId);
     int countStudentTrialPractices(@Param("studentId") Integer studentId);
 
 
     /**
     /**
+     * @describe 统计学生进行中的试听课数量
+     * @author Joburgess
+     * @date 2020.04.28
+     * @param studentId:
+     * @return int
+     */
+    int countStudentIngTrialPractices(@Param("studentId") Integer studentId);
+
+    /**
      * @describe 获取老师
      * @describe 获取老师
      * @author Joburgess
      * @author Joburgess
      * @date 2020/4/24
      * @date 2020/4/24

+ 31 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ExtraExerciseStudentsDto.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.dto;
 package com.ym.mec.biz.dal.dto;
 
 
 import com.ym.mec.biz.dal.entity.ExtracurricularExercisesReply;
 import com.ym.mec.biz.dal.entity.ExtracurricularExercisesReply;
+import io.swagger.annotations.ApiModelProperty;
 
 
 import java.util.Date;
 import java.util.Date;
 
 
@@ -25,6 +26,36 @@ public class ExtraExerciseStudentsDto extends ExtracurricularExercisesReply {
     private String statusStr;
     private String statusStr;
     private String isRepliedStr;
     private String isRepliedStr;
     private String isViewStr;
     private String isViewStr;
+    private String isRepliedTimelyStr;
+
+    @ApiModelProperty(value = "是否存在vip课")
+    private Integer existVipCourse;
+
+    private String existVipCourseStr;
+
+    public String getIsRepliedTimelyStr() {
+        return isRepliedTimelyStr;
+    }
+
+    public void setIsRepliedTimelyStr(String isRepliedTimelyStr) {
+        this.isRepliedTimelyStr = isRepliedTimelyStr;
+    }
+
+    public String getExistVipCourseStr() {
+        return existVipCourseStr;
+    }
+
+    public void setExistVipCourseStr(String existVipCourseStr) {
+        this.existVipCourseStr = existVipCourseStr;
+    }
+
+    public Integer getExistVipCourse() {
+        return existVipCourse;
+    }
+
+    public void setExistVipCourse(Integer existVipCourse) {
+        this.existVipCourse = existVipCourse;
+    }
 
 
     public String getStatusStr() {
     public String getStatusStr() {
         return statusStr;
         return statusStr;

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentExercisesSituationDto.java

@@ -14,6 +14,16 @@ public class StudentExercisesSituationDto extends StudentExtracurricularExercise
 
 
     private String teacherName;
     private String teacherName;
 
 
+    private Integer existVipCourse;
+
+    public Integer getExistVipCourse() {
+        return existVipCourse;
+    }
+
+    public void setExistVipCourse(Integer existVipCourse) {
+        this.existVipCourse = existVipCourse;
+    }
+
     public String getStudentName() {
     public String getStudentName() {
         return studentName;
         return studentName;
     }
     }

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/ExtraExercilseReplyQueryInfo.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.page;
 package com.ym.mec.biz.dal.page;
 
 
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
 
 
 import java.util.Date;
 import java.util.Date;
 
 
@@ -39,6 +40,17 @@ public class ExtraExercilseReplyQueryInfo extends QueryInfo {
 
 
 	private Date expireEndDate;
 	private Date expireEndDate;
 
 
+	@ApiModelProperty(value = "是否存在vip课")
+	private Integer existVipCourse;
+
+	public Integer getExistVipCourse() {
+		return existVipCourse;
+	}
+
+	public void setExistVipCourse(Integer existVipCourse) {
+		this.existVipCourse = existVipCourse;
+	}
+
 	public Integer getIsRepliedTimely() {
 	public Integer getIsRepliedTimely() {
 		return isRepliedTimely;
 		return isRepliedTimely;
 	}
 	}

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentExercisesSituationQueryInfo.java

@@ -36,6 +36,17 @@ public class StudentExercisesSituationQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "及时训练评价次数是否达到预期")
     @ApiModelProperty(value = "及时训练评价次数是否达到预期")
     private Integer exercisesMessageTimelyNumIsAchieve;
     private Integer exercisesMessageTimelyNumIsAchieve;
 
 
+    @ApiModelProperty(value = "是否存在vip课")
+    private Integer existVipCourse;
+
+    public Integer getExistVipCourse() {
+        return existVipCourse;
+    }
+
+    public void setExistVipCourse(Integer existVipCourse) {
+        this.existVipCourse = existVipCourse;
+    }
+
     public Integer getTeacherId() {
     public Integer getTeacherId() {
         return teacherId;
         return teacherId;
     }
     }

+ 20 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/EduPracticeGroupServiceImpl.java

@@ -288,6 +288,9 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
             oneMonthPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceOriginalPrice():practiceGroupSellPrice.getTwiceOriginalPrice();
             oneMonthPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceOriginalPrice():practiceGroupSellPrice.getTwiceOriginalPrice();
         }
         }
         BigDecimal amount= oneMonthPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
         BigDecimal amount= oneMonthPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
+        if(!now.before(practicePromotionActivityStartDate)&&studentExitChargePractices<=0){
+            amount= oneMonthPrice.multiply(new BigDecimal(1));
+        }
 
 
         practiceGroupBuyParams.setDrillTimesJson(drillTimesObject.toJSONString());
         practiceGroupBuyParams.setDrillTimesJson(drillTimesObject.toJSONString());
         practiceGroupBuyParams.setOrganId(sysUser.getOrganId());
         practiceGroupBuyParams.setOrganId(sysUser.getOrganId());
@@ -885,9 +888,6 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
                 weekNumApplyTimesMap.put(courseStartTime.getDayOfWeek().getValue(), applyTimeStrs);
                 weekNumApplyTimesMap.put(courseStartTime.getDayOfWeek().getValue(), applyTimeStrs);
             }
             }
         }
         }
-        if(weekNumApplyTimesMap.size()<=1){
-            weekNumApplyTimesMap=new HashMap<>();
-        }
         result.put("teacherFreeDays", weekNumApplyTimesMap);
         result.put("teacherFreeDays", weekNumApplyTimesMap);
         return result;
         return result;
     }
     }
@@ -915,6 +915,11 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
             return BaseController.failed(HttpStatus.EXPECTATION_FAILED, "指定的学生已存在三组试听课");
             return BaseController.failed(HttpStatus.EXPECTATION_FAILED, "指定的学生已存在三组试听课");
         }
         }
 
 
+        int studentIngTrialPracticeNum = practiceGroupDao.countStudentIngTrialPractices(practiceGroupBuyParams.getStudentId());
+        if(studentIngTrialPracticeNum>0){
+            return BaseController.failed(HttpStatus.EXPECTATION_FAILED, "该学员存在进行中的试听课,无法创建");
+        }
+
         int stn = practiceGroupDao.countStudentAndTeacherTrialPractices(practiceGroupBuyParams.getStudentId(), practiceGroupBuyParams.getUserId());
         int stn = practiceGroupDao.countStudentAndTeacherTrialPractices(practiceGroupBuyParams.getStudentId(), practiceGroupBuyParams.getUserId());
         if(stn>0){
         if(stn>0){
             return BaseController.failed(HttpStatus.EXPECTATION_FAILED, "请给该学生分配不同的指导老师");
             return BaseController.failed(HttpStatus.EXPECTATION_FAILED, "请给该学生分配不同的指导老师");
@@ -1136,6 +1141,16 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
             e.printStackTrace();
             e.printStackTrace();
         }
         }
 
 
+        List<ImGroupMember> imGroupMemberList = new ArrayList<>();
+        if(Objects.nonNull(practiceGroupBuyParams.getEducationalTeacherId())){
+            imGroupMemberList.add(new ImGroupMember(practiceGroupBuyParams.getEducationalTeacherId().toString()));
+        }
+        imGroupMemberList.add(new ImGroupMember(practiceGroupBuyParams.getUserId().toString()));
+        imGroupMemberList.add(new ImGroupMember(practiceGroupBuyParams.getStudentId().toString()));
+        ImGroupMember[] imGroupMembers = imGroupMemberList.toArray(new ImGroupMember[imGroupMemberList.size()]);
+        // 创建群组
+        imFeignService.groupCreate(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName()));
+
         return BaseController.succeed();
         return BaseController.succeed();
     }
     }
 
 
@@ -1152,6 +1167,8 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
         Map<String, Object> result=new HashMap<>();
         Map<String, Object> result=new HashMap<>();
         result.put("existNoMemoGroup", existNoMemoGroup);
         result.put("existNoMemoGroup", existNoMemoGroup);
         result.put("practices", studentTrialPractices);
         result.put("practices", studentTrialPractices);
+        int studentIngTrialPracticeNum = practiceGroupDao.countStudentIngTrialPractices(studentId);
+        result.put("existIngTrialPractices", studentIngTrialPracticeNum>0?1:0);
         return result;
         return result;
     }
     }
 }
 }

+ 18 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesReplyServiceImpl.java

@@ -46,6 +46,8 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
 	private SysMessageService sysMessageService;
 	private SysMessageService sysMessageService;
 	@Autowired
 	@Autowired
 	private TeacherDao teacherDao;
 	private TeacherDao teacherDao;
+	@Autowired
+	private CourseScheduleDao courseScheduleDao;
 
 
 	@Override
 	@Override
 	public BaseDAO<Long, ExtracurricularExercisesReply> getDAO() {
 	public BaseDAO<Long, ExtracurricularExercisesReply> getDAO() {
@@ -185,6 +187,22 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
 			Map<Integer, String> idNameMap = teachers.stream().collect(Collectors.toMap(SimpleUserDto::getUserId, SimpleUserDto::getUserName));
 			Map<Integer, String> idNameMap = teachers.stream().collect(Collectors.toMap(SimpleUserDto::getUserId, SimpleUserDto::getUserName));
 			for (ExtraExerciseStudentsDto extraExerciseStudentsDto : dataList) {
 			for (ExtraExerciseStudentsDto extraExerciseStudentsDto : dataList) {
 				extraExerciseStudentsDto.setTeacherName(idNameMap.get(extraExerciseStudentsDto.getTeacherId()));
 				extraExerciseStudentsDto.setTeacherName(idNameMap.get(extraExerciseStudentsDto.getTeacherId()));
+				if(Objects.nonNull(queryInfo.getExistVipCourse())){
+					extraExerciseStudentsDto.setExistVipCourse(queryInfo.getExistVipCourse());
+				}
+			}
+			if(Objects.isNull(queryInfo.getExistVipCourse())){
+				List<Integer> studentIds = dataList.stream().map(ExtraExerciseStudentsDto::getUserId).collect(Collectors.toList());
+				List<Map<Integer, Long>> studentVipCoursesMaps = courseScheduleDao.countStudentVipCoursesInFuture(studentIds);
+				Map<Integer, Long> studentVipCourseMap = MapUtil.convertIntegerMap(studentVipCoursesMaps);
+				for (ExtraExerciseStudentsDto exercisesSituationDto : dataList) {
+					Long vipCourses=studentVipCourseMap.get(exercisesSituationDto.getUserId());
+					if(Objects.isNull(vipCourses)||vipCourses<=0){
+						exercisesSituationDto.setExistVipCourse(0);
+					}else{
+						exercisesSituationDto.setExistVipCourse(1);
+					}
+				}
 			}
 			}
 		}
 		}
 		if (count == 0) {
 		if (count == 0) {

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java

@@ -2824,6 +2824,9 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             oneMonthPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceOriginalPrice():practiceGroupSellPrice.getTwiceOriginalPrice();
             oneMonthPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceOriginalPrice():practiceGroupSellPrice.getTwiceOriginalPrice();
         }
         }
         BigDecimal amount= oneMonthPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
         BigDecimal amount= oneMonthPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
+        if(!now.before(practicePromotionActivityStartDate)&&studentExitChargePractices<=0){
+            amount= oneMonthPrice.multiply(new BigDecimal(1));
+        }
 
 
         practiceGroupBuyParams.setDrillTimesJson(drillTimesObject.toJSONString());
         practiceGroupBuyParams.setDrillTimesJson(drillTimesObject.toJSONString());
         practiceGroupBuyParams.setOrganId(sysUser.getOrganId());
         practiceGroupBuyParams.setOrganId(sysUser.getOrganId());

+ 18 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentExtracurricularExercisesSituationServiceImpl.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service.impl;
 package com.ym.mec.biz.service.impl;
 
 
+import com.ym.mec.biz.dal.dao.CourseScheduleDao;
 import com.ym.mec.biz.dal.dao.StudentExtracurricularExercisesSituationDao;
 import com.ym.mec.biz.dal.dao.StudentExtracurricularExercisesSituationDao;
 import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.dto.StudentExercisesSituationDto;
 import com.ym.mec.biz.dal.dto.StudentExercisesSituationDto;
@@ -13,10 +14,8 @@ import com.ym.mec.util.collection.MapUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.stream.Collectors;
 
 
 @Service
 @Service
 public class StudentExtracurricularExercisesSituationServiceImpl extends BaseServiceImpl<Long, StudentExtracurricularExercisesSituation> implements StudentExtracurricularExercisesSituationService {
 public class StudentExtracurricularExercisesSituationServiceImpl extends BaseServiceImpl<Long, StudentExtracurricularExercisesSituation> implements StudentExtracurricularExercisesSituationService {
@@ -24,6 +23,8 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 	@Autowired
 	@Autowired
 	private StudentExtracurricularExercisesSituationDao studentExtracurricularExercisesSituationDao;
 	private StudentExtracurricularExercisesSituationDao studentExtracurricularExercisesSituationDao;
 	@Autowired
 	@Autowired
+	private CourseScheduleDao courseScheduleDao;
+	@Autowired
 	private TeacherDao teacherDao;
 	private TeacherDao teacherDao;
 
 
 	@Override
 	@Override
@@ -43,6 +44,19 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 			pageInfo.setTotal(count);
 			pageInfo.setTotal(count);
 			params.put("offset", pageInfo.getOffset());
 			params.put("offset", pageInfo.getOffset());
 			dataList = studentExtracurricularExercisesSituationDao.findExercisesSituations(params);
 			dataList = studentExtracurricularExercisesSituationDao.findExercisesSituations(params);
+			if(Objects.isNull(queryInfo.getExistVipCourse())){
+				List<Integer> studentIds = dataList.stream().map(StudentExtracurricularExercisesSituation::getStudentId).collect(Collectors.toList());
+				List<Map<Integer, Long>> studentVipCoursesMaps = courseScheduleDao.countStudentVipCoursesWithDate(studentIds, queryInfo.getMonday(), queryInfo.getSunday());
+				Map<Integer, Long> studentVipCourseMap = MapUtil.convertIntegerMap(studentVipCoursesMaps);
+				for (StudentExercisesSituationDto exercisesSituationDto : dataList) {
+					Long vipCourses=studentVipCourseMap.get(exercisesSituationDto.getStudentId());
+					if(Objects.isNull(vipCourses)||vipCourses<=0){
+						exercisesSituationDto.setExistVipCourse(0);
+					}else{
+						exercisesSituationDto.setExistVipCourse(1);
+					}
+				}
+			}
 		}
 		}
 		if (count == 0) {
 		if (count == 0) {
 			dataList = new ArrayList<>();
 			dataList = new ArrayList<>();

+ 22 - 9
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -15,6 +15,7 @@ import java.util.stream.Collectors;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 
 
+import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.*;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
@@ -27,14 +28,6 @@ import com.alibaba.fastjson.JSONObject;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUserRole;
 import com.ym.mec.auth.api.entity.SysUserRole;
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
-import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
-import com.ym.mec.biz.dal.dao.MusicGroupSubjectPlanDao;
-import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
-import com.ym.mec.biz.dal.dao.SubjectDao;
-import com.ym.mec.biz.dal.dao.SysConfigDao;
-import com.ym.mec.biz.dal.dao.SysUserCashAccountDao;
-import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.dto.StudentAddDto;
 import com.ym.mec.biz.dal.dto.StudentAddDto;
 import com.ym.mec.biz.dal.dto.StudentApplyDetailDto;
 import com.ym.mec.biz.dal.dto.StudentApplyDetailDto;
 import com.ym.mec.biz.dal.dto.StudentFeeDetailDto;
 import com.ym.mec.biz.dal.dto.StudentFeeDetailDto;
@@ -112,6 +105,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     @Autowired
     @Autowired
     private SysUserCashAccountDao sysUserCashAccountDao;
     private SysUserCashAccountDao sysUserCashAccountDao;
     @Autowired
     @Autowired
+    private StudentDao studentDao;
+    @Autowired
     private ContractService contractService;
     private ContractService contractService;
     @Autowired
     @Autowired
     private ImFeignService imFeignService;
     private ImFeignService imFeignService;
@@ -534,6 +529,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         /*if(studentAddDto.getSignClassId() == null && studentAddDto.getMixClassId() == null){
         /*if(studentAddDto.getSignClassId() == null && studentAddDto.getMixClassId() == null){
             throw new BizException("参数校验失败: 单技班或合奏班必填一项");
             throw new BizException("参数校验失败: 单技班或合奏班必填一项");
         }*/
         }*/
+        Date date = new Date();
         String musicGroupId = studentRegistration.getMusicGroupId();
         String musicGroupId = studentRegistration.getMusicGroupId();
 
 
         StudentRegistration phoneAndMusicGroupId = studentRegistrationDao.getByPhoneAndMusicGroupId(musicGroupId, studentRegistration.getParentsPhone());
         StudentRegistration phoneAndMusicGroupId = studentRegistrationDao.getByPhoneAndMusicGroupId(musicGroupId, studentRegistration.getParentsPhone());
@@ -556,6 +552,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 sysUser.setBirthdate(studentRegistration.getBirthdate());
                 sysUser.setBirthdate(studentRegistration.getBirthdate());
                 teacherDao.addSysUser(sysUser);
                 teacherDao.addSysUser(sysUser);
                 userId = sysUser.getId();
                 userId = sysUser.getId();
+                studentDao.insert(new Student(userId,studentRegistration.getSubjectId().toString()));
                 //添加用户现金账户
                 //添加用户现金账户
                 sysUserCashAccountDao.insert(new SysUserCashAccount(userId, "CNY"));
                 sysUserCashAccountDao.insert(new SysUserCashAccount(userId, "CNY"));
                 //添加用户电子签章账户
                 //添加用户电子签章账户
@@ -575,6 +572,23 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 sysUser.setBirthdate(studentRegistration.getBirthdate());
                 sysUser.setBirthdate(studentRegistration.getBirthdate());
                 teacherDao.updateUser(sysUser);
                 teacherDao.updateUser(sysUser);
                 userId = sysUser.getId();
                 userId = sysUser.getId();
+                Student student = studentDao.get(userId);
+                if(student == null){
+                    studentDao.insert(new Student(userId,studentRegistration.getSubjectId().toString()));
+                }else if(StringUtils.isEmpty(student.getSubjectIdList())){
+                    student.setSubjectIdList(studentRegistration.getSubjectId().toString());
+                    student.setUpdateTime(date);
+                    studentDao.update(student);
+                }else if(StringUtils.isNotEmpty(student.getSubjectIdList())){
+                    String[] split = student.getSubjectIdList().split(",");
+                    List<String> list = new ArrayList<>(Arrays.asList(split));
+                    if(!list.contains(studentRegistration.getSubjectId())){
+                        list.add(studentRegistration.getSubjectId().toString());
+                        student.setSubjectIdList(StringUtils.join(list,","));
+                        student.setUpdateTime(date);
+                        studentDao.update(student);
+                    }
+                }
             }
             }
             studentRegistration.setActualSubjectId(studentRegistration.getSubjectId());
             studentRegistration.setActualSubjectId(studentRegistration.getSubjectId());
             studentRegistration.setUserId(userId);
             studentRegistration.setUserId(userId);
@@ -590,7 +604,6 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             musicGroupSubjectPlanService.addApplyStudentNum(musicGroupId, studentRegistration.getSubjectId(), 1);
             musicGroupSubjectPlanService.addApplyStudentNum(musicGroupId, studentRegistration.getSubjectId(), 1);
             //添加班级关联
             //添加班级关联
             addStudents(studentAddDto, userId);
             addStudents(studentAddDto, userId);
-            Date date = new Date();
             //保存乐团学生费用表
             //保存乐团学生费用表
             if (studentAddDto.getCourseFee() == null) {
             if (studentAddDto.getCourseFee() == null) {
                 MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanDao.getMusicOneSubjectClassPlan(musicGroupId, studentRegistration.getActualSubjectId());
                 MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanDao.getMusicOneSubjectClassPlan(musicGroupId, studentRegistration.getActualSubjectId());

+ 34 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -2990,5 +2990,39 @@
         FROM course_schedule cs
         FROM course_schedule cs
         WHERE cs.music_group_id_ = #{practiceGroupId} AND cs.del_flag_ = 0 AND cs.group_type_ = #{groupType};
         WHERE cs.music_group_id_ = #{practiceGroupId} AND cs.del_flag_ = 0 AND cs.group_type_ = #{groupType};
     </select>
     </select>
+    <select id="countStudentVipCoursesWithDate" resultType="map">
+        SELECT
+          cssp.user_id_ as 'key',
+          COUNT( cs.id_ ) as 'value'
+        FROM
+            course_schedule_student_payment cssp
+            LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
+        WHERE
+            cssp.user_id_ IN
+            <foreach collection="studentIds" item="studentId" separator="," open="(" close=")">
+                #{studentId}
+            </foreach>
+            AND cssp.group_type_ = 'VIP'
+            AND cs.class_date_ BETWEEN #{startTime} AND #{endTime}
+        GROUP BY
+        cssp.user_id_
+    </select>
+    <select id="countStudentVipCoursesInFuture" resultType="map">
+        SELECT
+          cssp.user_id_ as 'key',
+          COUNT( cs.id_ ) as 'value'
+        FROM
+          course_schedule_student_payment cssp
+          LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
+        WHERE
+        cssp.user_id_ IN
+        <foreach collection="studentIds" item="studentId" separator="," open="(" close=")">
+            #{studentId}
+        </foreach>
+        AND cssp.group_type_ = 'VIP'
+        AND CONCAT(cs.class_date_," ",cs.start_class_time_) &gt; NOW()
+        GROUP BY
+        cssp.user_id_
+    </select>
 
 
 </mapper>
 </mapper>

+ 6 - 0
mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesReplyMapper.xml

@@ -279,6 +279,12 @@
 			<if test="isRepliedTimely!=null">
 			<if test="isRepliedTimely!=null">
 				AND eer.is_replied_timely_=#{isRepliedTimely}
 				AND eer.is_replied_timely_=#{isRepliedTimely}
 			</if>
 			</if>
+			<if test="existVipCourse!=null and existVipCourse==1">
+				AND EXISTS (SELECT cssp.id_ FROM course_schedule_student_payment cssp LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_ WHERE cssp.user_id_=eer.user_id_ AND cssp.group_type_='VIP' AND CONCAT(cs.class_date_," ",cs.start_class_time_) &gt; NOW())
+			</if>
+			<if test="existVipCourse!=null and existVipCourse==0">
+				AND NOT EXISTS (SELECT cssp.id_ FROM course_schedule_student_payment cssp LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_ WHERE cssp.user_id_=eer.user_id_ AND cssp.group_type_='VIP' AND CONCAT(cs.class_date_," ",cs.start_class_time_) &gt; NOW())
+			</if>
 		</where>
 		</where>
 	</sql>
 	</sql>
 
 

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

@@ -545,7 +545,7 @@
                 SELECT user_id_ FROM course_schedule_student_payment cssp
                 SELECT user_id_ FROM course_schedule_student_payment cssp
                 LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_
                 LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_
                 WHERE cssp.user_id_=su.id_ AND cs.teach_mode_='ONLINE'
                 WHERE cssp.user_id_=su.id_ AND cs.teach_mode_='ONLINE'
-                AND NOT EXISTS(SELECT student_id_ FROM practice_group WHERE cssp.music_group_id_=id_ AND cssp.group_type_='PRACTICE' AND type_!='TRIAL')
+                AND NOT EXISTS(SELECT student_id_ FROM practice_group WHERE cssp.music_group_id_=id_ AND cssp.group_type_='PRACTICE' AND type_='TRIAL')
                 AND CONCAT(cs.class_date_, ' ', cs.start_class_time_) > NOW()
                 AND CONCAT(cs.class_date_, ' ', cs.start_class_time_) > NOW()
             )
             )
         ORDER BY su.id_
         ORDER BY su.id_
@@ -575,7 +575,7 @@
                 SELECT user_id_ FROM course_schedule_student_payment cssp
                 SELECT user_id_ FROM course_schedule_student_payment cssp
                 LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_
                 LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_
                 WHERE cssp.user_id_=su.id_ AND cs.teach_mode_='ONLINE'
                 WHERE cssp.user_id_=su.id_ AND cs.teach_mode_='ONLINE'
-                AND NOT EXISTS(SELECT student_id_ FROM practice_group WHERE cssp.music_group_id_=id_ AND cssp.group_type_='PRACTICE' AND type_!='TRIAL')
+                AND NOT EXISTS(SELECT student_id_ FROM practice_group WHERE cssp.music_group_id_=id_ AND cssp.group_type_='PRACTICE' AND type_='TRIAL')
                 AND CONCAT(cs.class_date_, ' ', cs.start_class_time_) > NOW()
                 AND CONCAT(cs.class_date_, ' ', cs.start_class_time_) > NOW()
             )
             )
     </select>
     </select>
@@ -680,4 +680,8 @@
     <select id="checkStudentExitChargePractice" resultType="int">
     <select id="checkStudentExitChargePractice" resultType="int">
         SELECT COUNT(id_) FROM practice_group WHERE type_='CHARGE' AND student_id_=#{studentId} AND group_status_ IN ('NORMAL', 'FINISH')
         SELECT COUNT(id_) FROM practice_group WHERE type_='CHARGE' AND student_id_=#{studentId} AND group_status_ IN ('NORMAL', 'FINISH')
     </select>
     </select>
+    <select id="countStudentIngTrialPractices" resultType="int">
+      SELECT COUNT(pg.id_) FROM practice_group pg LEFT JOIN course_schedule cs ON cs.music_group_id_=pg.id_
+      WHERE pg.student_id_=#{studentId} AND pg.type_='TRIAL' AND cs.group_type_='PRACTICE' AND CONCAT(cs.class_date_, ' ', cs.end_class_time_)>NOW()
+    </select>
 </mapper>
 </mapper>

+ 19 - 3
mec-biz/src/main/resources/config/mybatis/StudentExtracurricularExercisesSituationMapper.xml

@@ -26,6 +26,7 @@
 		<result column="student_name_" property="studentName"/>
 		<result column="student_name_" property="studentName"/>
 		<result column="teacher_name_" property="teacherName"/>
 		<result column="teacher_name_" property="teacherName"/>
 		<result column="organ_name_" property="organName"/>
 		<result column="organ_name_" property="organName"/>
+		<result column="exist_vip_course_" property="existVipCourse"/>
 	</resultMap>
 	</resultMap>
 	
 	
 	<!-- 根据主键查询一条记录 -->
 	<!-- 根据主键查询一条记录 -->
@@ -124,13 +125,16 @@
 			MAX(sees.id_) id_,
 			MAX(sees.id_) id_,
 			student_id_,
 			student_id_,
 			stu.username_ student_name_,
 			stu.username_ student_name_,
-			MAX(tea.real_name_) teacher_name_,
+			tea.real_name_ teacher_name_,
 			o.name_ organ_name_,
 			o.name_ organ_name_,
 			SUM( expect_exercises_num_ ) expect_exercises_num_,
 			SUM( expect_exercises_num_ ) expect_exercises_num_,
 			SUM( actual_exercises_num_ ) actual_exercises_num_,
 			SUM( actual_exercises_num_ ) actual_exercises_num_,
 			SUM( exercises_reply_num_ ) exercises_reply_num_,
 			SUM( exercises_reply_num_ ) exercises_reply_num_,
 			SUM( exercises_message_num_ ) exercises_message_num_,
 			SUM( exercises_message_num_ ) exercises_message_num_,
 			SUM( exercises_message_timely_num_ ) exercises_message_timely_num_
 			SUM( exercises_message_timely_num_ ) exercises_message_timely_num_
+			<if test="existVipCourse!=null">
+				,#{existVipCourse} exist_vip_course_
+			</if>
 		FROM
 		FROM
 			student_extracurricular_exercises_situation_ sees
 			student_extracurricular_exercises_situation_ sees
 			LEFT JOIN sys_user stu ON stu.id_=sees.student_id_
 			LEFT JOIN sys_user stu ON stu.id_=sees.student_id_
@@ -148,8 +152,14 @@
 			<if test="organIdList != null">
 			<if test="organIdList != null">
 				AND FIND_IN_SET(stu.organ_id_,#{organIdList})
 				AND FIND_IN_SET(stu.organ_id_,#{organIdList})
 			</if>
 			</if>
+			<if test="existVipCourse!=null and existVipCourse==1">
+				AND EXISTS (SELECT cssp.id_ FROM course_schedule_student_payment cssp LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_ WHERE cssp.user_id_=sees.student_id_ AND cssp.group_type_='VIP' AND class_date_ BETWEEN #{monday} AND #{sunday})
+			</if>
+			<if test="existVipCourse!=null and existVipCourse==0">
+				AND NOT EXISTS (SELECT cssp.id_ FROM course_schedule_student_payment cssp LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_ WHERE cssp.user_id_=sees.student_id_ AND cssp.group_type_='VIP' AND class_date_ BETWEEN #{monday} AND #{sunday})
+			</if>
 			GROUP BY
 			GROUP BY
-			student_id_
+			student_id_,teacher_id_
 			<trim prefix="HAVING" suffixOverrides="and">
 			<trim prefix="HAVING" suffixOverrides="and">
 				<if test="expectExercisesNum!=null">  SUM( expect_exercises_num_ ) = #{expectExercisesNum}</if>
 				<if test="expectExercisesNum!=null">  SUM( expect_exercises_num_ ) = #{expectExercisesNum}</if>
 				<if test="actualExercisesNumIsAchieve!=null and actualExercisesNumIsAchieve==0">
 				<if test="actualExercisesNumIsAchieve!=null and actualExercisesNumIsAchieve==0">
@@ -202,8 +212,14 @@
 			<if test="organIdList != null">
 			<if test="organIdList != null">
 				AND FIND_IN_SET(stu.organ_id_, #{organIdList})
 				AND FIND_IN_SET(stu.organ_id_, #{organIdList})
 			</if>
 			</if>
+			<if test="existVipCourse!=null and existVipCourse==1">
+				AND EXISTS (SELECT cssp.id_ FROM course_schedule_student_payment cssp LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_ WHERE cssp.user_id_=sees.student_id_ AND cssp.group_type_='VIP' AND class_date_ BETWEEN #{monday} AND #{sunday})
+			</if>
+			<if test="existVipCourse!=null and existVipCourse==0">
+				AND NOT EXISTS (SELECT cssp.id_ FROM course_schedule_student_payment cssp LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_ WHERE cssp.user_id_=sees.student_id_ AND cssp.group_type_='VIP' AND class_date_ BETWEEN #{monday} AND #{sunday})
+			</if>
 			GROUP BY
 			GROUP BY
-			student_id_
+			student_id_,teacher_id_
 			<trim prefix="HAVING" suffixOverrides="and">
 			<trim prefix="HAVING" suffixOverrides="and">
 				<if test="expectExercisesNum!=null">  SUM( expect_exercises_num_ ) = #{expectExercisesNum}</if>
 				<if test="expectExercisesNum!=null">  SUM( expect_exercises_num_ ) = #{expectExercisesNum}</if>
 				<if test="actualExercisesNumIsAchieve!=null and actualExercisesNumIsAchieve==0">
 				<if test="actualExercisesNumIsAchieve!=null and actualExercisesNumIsAchieve==0">

+ 4 - 2
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -1164,12 +1164,14 @@ public class ExportController extends BaseController {
             row.setStatusStr(Objects.isNull(row.getStatus()) || row.getStatus() == 0 ? "否" : "是");
             row.setStatusStr(Objects.isNull(row.getStatus()) || row.getStatus() == 0 ? "否" : "是");
             row.setIsViewStr(Objects.isNull(row.getIsView()) || row.getIsView() == 0 ? "否" : "是");
             row.setIsViewStr(Objects.isNull(row.getIsView()) || row.getIsView() == 0 ? "否" : "是");
             row.setIsRepliedStr(Objects.isNull(row.getIsReplied()) || row.getIsReplied() == 0 ? "否" : "是");
             row.setIsRepliedStr(Objects.isNull(row.getIsReplied()) || row.getIsReplied() == 0 ? "否" : "是");
+            row.setIsRepliedTimelyStr(Objects.isNull(row.getIsRepliedTimely()) || row.getIsRepliedTimely() == 0 ? "否" : "是");
+            row.setExistVipCourseStr(Objects.isNull(row.getExistVipCourse())|| row.getExistVipCourse()==0?"否":"是");
         }
         }
         OutputStream ouputStream = null;
         OutputStream ouputStream = null;
         try {
         try {
             HSSFWorkbook workbook = POIUtil.exportExcel(
             HSSFWorkbook workbook = POIUtil.exportExcel(
-                    new String[]{"布置时间", "截至时间", "训练标题", "老师名字", "分部", "学生编号", "学生姓名", "提交作业", "提交作业时间", "是否回复", "是否查看"},
-                    new String[]{"createTime", "expireDate", "title", "teacherName", "organName", "user.username","userId", "statusStr","submitTime", "isRepliedStr", "isViewStr"}, rows);
+                    new String[]{"布置时间", "截至时间", "训练标题", "老师名字", "分部", "学生姓名", "学生编号", "提交作业", "提交作业时间", "是否评价", "是否有vip", "及时评价"},
+                    new String[]{"createTime", "expireDate", "title", "teacherName", "organName", "user.username","userId", "statusStr","submitTime", "isRepliedStr", "existVipCourseStr","isRepliedTimelyStr"}, rows);
             response.setContentType("application/octet-stream");
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
             ouputStream = response.getOutputStream();
             ouputStream = response.getOutputStream();