Browse Source

Merge branch 'master' into yonge

yonge 5 years ago
parent
commit
96046b76a4
21 changed files with 944 additions and 94 deletions
  1. 33 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentCompetitionDao.java
  2. 47 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentCompetitionRankingDto.java
  3. 208 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentCompetition.java
  4. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/MessageTypeEnum.java
  5. 101 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentCompetitionQueryInfo.java
  6. 33 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentCompetitionService.java
  7. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java
  8. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  9. 49 60
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java
  10. 51 18
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  11. 5 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupSubjectPlanServiceImpl.java
  12. 89 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentCompetitionServiceImpl.java
  13. 8 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  14. 3 2
      mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml
  15. 1 1
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml
  16. 0 1
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml
  17. 158 0
      mec-biz/src/main/resources/config/mybatis/StudentCompetitionMapper.xml
  18. 3 1
      mec-student/src/main/java/com/ym/mec/student/config/ResourceServerConfig.java
  19. 79 0
      mec-student/src/main/java/com/ym/mec/student/controller/StudentCompetitionController.java
  20. 44 0
      mec-web/src/main/java/com/ym/mec/web/controller/StudentCompetitionController.java
  21. 18 6
      mec-web/src/main/java/com/ym/mec/web/controller/StudentRegistrationController.java

+ 33 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentCompetitionDao.java

@@ -0,0 +1,33 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.StudentCompetition;
+import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+public interface StudentCompetitionDao extends BaseDAO<Long, StudentCompetition> {
+
+    List<StudentCompetition> queryStudentCompetitions(Map<String, Object> params);
+
+    int countStudentCompetitions(Map<String, Object> params);
+
+    /**
+     * @describe 获取指定用户的参赛作品
+     * @author Joburgess
+     * @date 2020.11.10
+     * @param userId:
+     * @return com.ym.mec.biz.dal.entity.StudentCompetition
+     */
+    StudentCompetition getCompetitionWithUser(@Param("userId") Integer userId);
+
+    /**
+     * @describe 获取获奖名单
+     * @author Joburgess
+     * @date 2020.11.10
+     * @return java.util.List<com.ym.mec.biz.dal.dto.StudentCompetitionRankingDto>
+     */
+    List<StudentCompetition> getWinnerList();
+	
+}

+ 47 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentCompetitionRankingDto.java

@@ -0,0 +1,47 @@
+package com.ym.mec.biz.dal.dto;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.11.10
+ */
+public class StudentCompetitionRankingDto {
+
+    private Long competitionId;
+
+    private String username;
+
+    private String pictureUrl;
+
+    public StudentCompetitionRankingDto() {
+    }
+
+    public StudentCompetitionRankingDto(Long competitionId, String username, String pictureUrl) {
+        this.competitionId = competitionId;
+        this.username = username;
+        this.pictureUrl = pictureUrl;
+    }
+
+    public Long getCompetitionId() {
+        return competitionId;
+    }
+
+    public void setCompetitionId(Long competitionId) {
+        this.competitionId = competitionId;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getPictureUrl() {
+        return pictureUrl;
+    }
+
+    public void setPictureUrl(String pictureUrl) {
+        this.pictureUrl = pictureUrl;
+    }
+}

+ 208 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentCompetition.java

@@ -0,0 +1,208 @@
+package com.ym.mec.biz.dal.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(student_competition):
+ */
+public class StudentCompetition {
+
+	private Long id;
+
+	@ApiModelProperty(value = "用户编号")
+	private Integer userId;
+
+	@ApiModelProperty(value = "姓名")
+	private String username;
+
+	@ApiModelProperty(value = "身份证号")
+	private String idCardNo;
+
+	@ApiModelProperty(value = "年龄")
+	private Integer age;
+
+	@ApiModelProperty(value = "性别")
+	private boolean gender;
+
+	@ApiModelProperty(value = "年级")
+	private String grade;
+
+	@ApiModelProperty(value = "专业")
+	private String subject;
+
+	@ApiModelProperty(value = "曲目")
+	private String chapter;
+
+	@ApiModelProperty(value = "头像")
+	private String pictureUrl;
+
+	@ApiModelProperty(value = "作品")
+	private String videoUrl;
+
+	@ApiModelProperty(value = "分数")
+	private java.math.BigDecimal score;
+
+	@ApiModelProperty(value = "获奖等级")
+	private java.math.BigDecimal prizeLevel;
+
+	@ApiModelProperty(value = "是否展示")
+	private boolean isShow;
+
+	@ApiModelProperty(value = "评价")
+	private String comment;
+
+	private java.util.Date createTime;
+
+	private java.util.Date updateTime;
+	
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setUserId(Integer userId){
+		this.userId = userId;
+	}
+	
+	public Integer getUserId(){
+		return this.userId;
+	}
+			
+	public void setUsername(String username){
+		this.username = username;
+	}
+	
+	public String getUsername(){
+		return this.username;
+	}
+			
+	public void setIdCardNo(String idCardNo){
+		this.idCardNo = idCardNo;
+	}
+	
+	public String getIdCardNo(){
+		return this.idCardNo;
+	}
+			
+	public void setAge(Integer age){
+		this.age = age;
+	}
+	
+	public Integer getAge(){
+		return this.age;
+	}
+			
+	public void setGender(boolean gender){
+		this.gender = gender;
+	}
+	
+	public boolean isGender(){
+		return this.gender;
+	}
+			
+	public void setGrade(String grade){
+		this.grade = grade;
+	}
+	
+	public String getGrade(){
+		return this.grade;
+	}
+			
+	public void setSubject(String subject){
+		this.subject = subject;
+	}
+	
+	public String getSubject(){
+		return this.subject;
+	}
+			
+	public void setChapter(String chapter){
+		this.chapter = chapter;
+	}
+	
+	public String getChapter(){
+		return this.chapter;
+	}
+			
+	public void setPictureUrl(String pictureUrl){
+		this.pictureUrl = pictureUrl;
+	}
+	
+	public String getPictureUrl(){
+		return this.pictureUrl;
+	}
+
+	public String getVideoUrl() {
+		return videoUrl;
+	}
+
+	public void setVideoUrl(String videoUrl) {
+		this.videoUrl = videoUrl;
+	}
+
+	public boolean isShow() {
+		return isShow;
+	}
+
+	public void setShow(boolean show) {
+		isShow = show;
+	}
+
+	public void setScore(java.math.BigDecimal score){
+		this.score = score;
+	}
+	
+	public java.math.BigDecimal getScore(){
+		return this.score;
+	}
+			
+	public void setPrizeLevel(java.math.BigDecimal prizeLevel){
+		this.prizeLevel = prizeLevel;
+	}
+	
+	public java.math.BigDecimal getPrizeLevel(){
+		return this.prizeLevel;
+	}
+			
+	public void setIsShow(boolean isShow){
+		this.isShow = isShow;
+	}
+	
+	public boolean isIsShow(){
+		return this.isShow;
+	}
+			
+	public void setComment(String comment){
+		this.comment = comment;
+	}
+	
+	public String getComment(){
+		return this.comment;
+	}
+			
+	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;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/MessageTypeEnum.java

@@ -120,6 +120,7 @@ public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
 
     BACKSTAGE_CREATE_MUSIC_GROUP_APPLY("BACKSTAGE_CREATE_MUSIC_GROUP_APPLY", "建团申请"),
     BACKSTAGE_ACTION_APPLY("BACKSTAGE_ACTION_APPLY", "开启报名"),
+    BACKSTAGE_PAYMENT_CALENDER_AUDIT("BACKSTAGE_PAYMENT_CALENDER_AUDIT", "缴费项目审核"),
     BACKSTAGE_ACTION_PAYMENT("BACKSTAGE_ACTION_PAYMENT", "开启缴费"),
     SMS_STUDENT_OPEN_PAYMENT("SMS_STUDENT_OPEN_PAYMENT", "开启缴费"),
     BACKSTAGE_LENGTHEN_PAYMENT("BACKSTAGE_LENGTHEN_PAYMENT", "延长缴费"),

+ 101 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentCompetitionQueryInfo.java

@@ -0,0 +1,101 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.11.10
+ */
+public class StudentCompetitionQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value = "性别")
+    private boolean gender;
+
+    @ApiModelProperty(value = "年级")
+    private String grade;
+
+    @ApiModelProperty(value = "专业")
+    private String subject;
+
+    @ApiModelProperty(value = "分数")
+    private java.math.BigDecimal score;
+
+    @ApiModelProperty(value = "获奖等级")
+    private Integer prizeLevel;
+
+    @ApiModelProperty(value = "是否展示")
+    private boolean isShow;
+
+    @ApiModelProperty(value = "评价")
+    private String comment;
+
+    private java.util.Date createTime;
+
+    public boolean isGender() {
+        return gender;
+    }
+
+    public void setGender(boolean gender) {
+        this.gender = gender;
+    }
+
+    public String getGrade() {
+        return grade;
+    }
+
+    public void setGrade(String grade) {
+        this.grade = grade;
+    }
+
+    public String getSubject() {
+        return subject;
+    }
+
+    public void setSubject(String subject) {
+        this.subject = subject;
+    }
+
+    public BigDecimal getScore() {
+        return score;
+    }
+
+    public void setScore(BigDecimal score) {
+        this.score = score;
+    }
+
+    public Integer getPrizeLevel() {
+        return prizeLevel;
+    }
+
+    public void setPrizeLevel(Integer prizeLevel) {
+        this.prizeLevel = prizeLevel;
+    }
+
+    public boolean isShow() {
+        return isShow;
+    }
+
+    public void setShow(boolean show) {
+        isShow = show;
+    }
+
+    public String getComment() {
+        return comment;
+    }
+
+    public void setComment(String comment) {
+        this.comment = comment;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+}

+ 33 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentCompetitionService.java

@@ -0,0 +1,33 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.dto.StudentCompetitionRankingDto;
+import com.ym.mec.biz.dal.entity.StudentCompetition;
+import com.ym.mec.biz.dal.page.StudentCompetitionQueryInfo;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.service.BaseService;
+
+import java.util.List;
+
+public interface StudentCompetitionService extends BaseService<Long, StudentCompetition> {
+
+    /**
+     * @describe 新增选手参赛作品
+     * @author Joburgess
+     * @date 2020.11.10
+     * @param studentCompetition:
+     * @return void
+     */
+    void addStudentCompetition(StudentCompetition studentCompetition);
+
+    PageInfo<StudentCompetition> queryPage(StudentCompetitionQueryInfo queryInfo);
+
+    /**
+     * @describe
+     * @author Joburgess
+     * @date 2020.11.10
+     * @return void
+     */
+    List<StudentCompetitionRankingDto> getWinnerList();
+
+    StudentCompetition checkIsUpload(Integer userId);
+}

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -1739,6 +1739,10 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                     .toMinutes();
             classGroup4MixDto.setCourseTimes(totalMinutes/(int)courseDuration);
 
+            if(classGroup4MixDto.getCourseTimes()<=0){
+                throw new BizException("{}课程类型剩余课程时长不足", classGroup4MixDto.getCourseType().getMsg());
+            }
+
             int times = 0;
 
             Set<String> holidayDays = new HashSet<>();
@@ -2022,6 +2026,10 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                     .toMinutes();
             classGroup4MixDto.setCourseTimes(totalMinutes/(int)courseDuration);
 
+            if(classGroup4MixDto.getCourseTimes()<=0){
+                throw new BizException("{}课程类型剩余课程时长不足", classGroup4MixDto.getCourseType().getMsg());
+            }
+
             int times = 0;
             Set<String> holidayDays = new HashSet<>();
             if (classGroup4MixDto.getHoliday()) {
@@ -2308,6 +2316,10 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                     .toMinutes();
             classGroup4MixDto.setCourseTimes(totalMinutes/(int)courseDuration);
 
+            if(classGroup4MixDto.getCourseTimes()<=0){
+                throw new BizException("{}课程类型剩余课程时长不足", classGroup4MixDto.getCourseType().getMsg());
+            }
+
             int times = 0;
             Set<String> holidayDays = new HashSet<>();
             if (classGroup4MixDto.getHoliday()) {

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

@@ -2237,7 +2237,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         Map<Long, IntegerAndIntegerListDto> classGroupTeachingTeacherMap = classGroupAndUserIdsMap.stream()
                 .collect(Collectors.toMap(IntegerAndIntegerListDto::getId, integerAndIntegerListDto -> integerAndIntegerListDto));
 
-        existCourseSchedules.sort(Comparator.comparing(CourseSchedule::getStartClassTime));
+		allCourseSchedules.sort(Comparator.comparing(CourseSchedule::getStartClassTime));
         courseSchedules.sort(Comparator.comparing(CourseSchedule::getStartClassTime));
 
         newNode:

+ 49 - 60
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -1,61 +1,18 @@
 package com.ym.mec.biz.service.impl;
 
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.SCHOOL;
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY;
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_RENEW;
-
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Isolation;
-import org.springframework.transaction.annotation.Transactional;
-
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.MusicGroupBuildLogDao;
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
-import com.ym.mec.biz.dal.dao.MusicGroupOrganizationCourseSettingsDao;
-import com.ym.mec.biz.dal.dao.MusicGroupOrganizationCourseSettingsDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentStudentCourseDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
-import com.ym.mec.biz.dal.dao.OrganizationCourseUnitPriceSettingsDao;
-import com.ym.mec.biz.dal.dao.OrganizationDao;
-import com.ym.mec.biz.dal.dao.SysConfigDao;
+import com.ym.mec.auth.api.entity.SysUserRole;
+import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.CalenderPushDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDetailDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto;
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
-import com.ym.mec.biz.dal.entity.MusicGroup;
-import com.ym.mec.biz.dal.entity.MusicGroupBuildLog;
-import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings;
-import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
-import com.ym.mec.biz.dal.entity.Organization;
-import com.ym.mec.biz.dal.entity.OrganizationCourseUnitPriceSettings;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
 import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
@@ -72,6 +29,20 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
+import java.util.*;
+import java.util.Map.Entry;
+import java.util.stream.Collectors;
+
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.SCHOOL;
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY;
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_RENEW;
 
 @Service
 public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentCalender> implements MusicGroupPaymentCalenderService {
@@ -212,11 +183,11 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		}
 
 		if (musicGroupPaymentCalender.getStatus() != PaymentCalenderStatusEnum.AUDITING) {
-			if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
-				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
-			} else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
+			if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
 				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
-			} else {
+			}else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
+				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
+			}else {
 				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
 			}
 			
@@ -277,6 +248,11 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 					}
 				}
 			}
+		}else {
+            Set<Integer> roleIds = new HashSet<>(1);
+            roleIds.add(SysUserRole.SECTION_MANAGER);
+            Organization organization = organizationDao.get(musicGroup.getOrganId());
+            sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_PAYMENT_CALENDER_AUDIT, "", organization.getName(),musicGroup.getName());
 		}
 
 		// 如果是报名,需要修改乐团状态
@@ -290,6 +266,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 					musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
 					// 记录操作日志
 					musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "报名缴费项目创建成功(草稿 -> 基础信息审核中)", sysUser.getId(), ""));
+					Set<Integer> roleIds = new HashSet<>(1);
+					roleIds.add(SysUserRole.ADMINISTRATOR);
+					sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, "", sysUser.getUsername());
 				}else{
 					musicGroup.setStatus(MusicGroupStatusEnum.FEE_AUDIT);
 					// 记录操作日志
@@ -427,11 +406,11 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		}
 
 		if (musicGroupPaymentCalender.getStatus() != PaymentCalenderStatusEnum.AUDITING) {
-			if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
-				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
-			} else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
+			if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
 				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
-			} else {
+			}else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
+				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
+			}else {
 				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
 			}
 			
@@ -493,19 +472,27 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				}
 			}
 
-		}
+		}else {
+            Set<Integer> roleIds = new HashSet<>(1);
+            roleIds.add(SysUserRole.ADMINISTRATOR);
+            Organization organization = organizationDao.get(musicGroup.getOrganId());
+            sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_PAYMENT_CALENDER_AUDIT, "", organization.getName(),musicGroup.getName());
+        }
 
 		// 如果是报名,需要修改乐团状态
 		if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
 			int countAuditReject = musicGroupPaymentCalenderDao.countAuditReject(musicGroupPaymentCalender.getMusicGroupId(),musicGroupPaymentCalender.getId());
 			if(countAuditReject == 0){
-				if (musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT) {
+				if (musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT && musicGroup.getStatus() != MusicGroupStatusEnum.AUDIT_FAILED) {
 					throw new BizException("创建失败:缴费项目类型不匹配");
 				}
 				if(musicGroupPaymentCalender.getStatus() != PaymentCalenderStatusEnum.AUDITING){
 					musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
 					// 记录操作日志
 					musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "报名缴费项目创建成功(草稿 -> 基础信息审核中)", sysUser.getId(), ""));
+					Set<Integer> roleIds = new HashSet<>(1);
+					roleIds.add(SysUserRole.SECTION_MANAGER);
+					sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, "", sysUser.getUsername());
 				}else{
 					musicGroup.setStatus(MusicGroupStatusEnum.FEE_AUDIT);
 					// 记录操作日志
@@ -638,18 +625,17 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		//如果是报名项目,将乐团改为审核中,缴费项目修改状态,审核状态改为审核通过
 		if(musicGroupPaymentCalender.getPayUserType() == SCHOOL){
 			musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
+		}else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
+			musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
 		}else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
 			musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
-		} else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
-			musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
-		} else {
+		}else {
 			musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
 		}
 		musicGroupPaymentCalender.setAuditMemo(auditMemo);
 		musicGroupPaymentCalender.setUpdateTime(date);
 		musicGroupPaymentCalenderDao.update(musicGroupPaymentCalender);
 		//如果是报名,并且所有的报名都审核通过,需要修改乐团状态
-
 		if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
 			int count = musicGroupPaymentCalenderDao.countAuditReject(musicGroupPaymentCalender.getMusicGroupId(),calenderId);
 			if(count == 0){
@@ -663,6 +649,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				}
 				//记录操作日志
 				musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目通过(草稿 -> 审核中)", sysUser.getId(), ""));
+				Set<Integer> roleIds = new HashSet<>(1);
+				roleIds.add(SysUserRole.SECTION_MANAGER);
+				sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, "", sysUser.getUsername());
 			}
 		}
 	}

+ 51 - 18
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -161,7 +161,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     private SimpleDateFormat sdf_ymd = new SimpleDateFormat("yyyy-MM-dd");
 
     private SimpleDateFormat sdf_hms = new SimpleDateFormat("HH:mm:ss");
-    
+
     private SimpleDateFormat sdf_ymdhms = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
     @Override
@@ -195,7 +195,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if (musicGroup.getStatus() == MusicGroupStatusEnum.AUDIT) {
             Set<Integer> roleIds = new HashSet<>(1);
             roleIds.add(SysUserRole.SECTION_MANAGER);
-
             sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, "", sysUser.getUsername());
         }
         // 保存乐团付费主体列表
@@ -314,20 +313,20 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         }
 
         Date date = new Date();
-        
+
         OrderTypeEnum type = OrderTypeEnum.SPORADIC;
         if (chargeInfo.getChargeType().equals(SporadicChargeTypeEnum.DOUBLE_ELEVEN2020)) {
             type = OrderTypeEnum.DOUBLE_ELEVEN2020;
-            
+
             String startTimeStr = sysConfigDao.findConfigValue(SysConfigService.START_TIME_OF_1111);
             String endTimeStr = sysConfigDao.findConfigValue(SysConfigService.END_TIME_OF_1111);
             Date startTime = sdf_ymdhms.parse(startTimeStr);
             Date endTime = sdf_ymdhms.parse(endTimeStr);
-            if(date.before(startTime)){
-            	throw new Exception("活动暂未开始,请您耐心等待!");
+            if (date.before(startTime)) {
+                throw new Exception("活动暂未开始,请您耐心等待!");
             }
-            if(date.after(endTime)){
-            	throw new Exception("活动已结束,谢谢您的支持!");
+            if (date.after(endTime)) {
+                throw new Exception("活动已结束,谢谢您的支持!");
             }
         }
 
@@ -499,7 +498,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                     }
                     goodsGroup.setKitGroupPurchaseType(KitGroupPurchaseTypeEnum.valueOf(kitGroupPurchaseType));
                     remitFee = groupType.get(kitGroupPurchaseType) == null ? BigDecimal.ZERO : groupType.get(kitGroupPurchaseType);
-                    if (coursePurchase != null){
+                    if (coursePurchase != null) {
                         courseRemitFee = coursePurchase.get(kitGroupPurchaseType) == null ? BigDecimal.ZERO : coursePurchase.get(kitGroupPurchaseType);
                     }
                 }
@@ -1045,6 +1044,14 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "审核通过(审核中 -> 报名中)", sysUser.getId(), ""));
         musicGroup.setStatus(MusicGroupStatusEnum.APPLY);
         musicGroupDao.update(musicGroup);
+        //获取报名缴费项目
+        MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderDao.findByMusicGroupRegCalender(musicGroupId);
+        if (regCalender != null && regCalender.getPayUserType().equals(MusicGroupPaymentCalender.PayUserType.STUDENT)) {
+            regCalender.setStatus(MusicGroupPaymentCalender.PaymentCalenderStatusEnum.OPEN);
+            regCalender.setUpdateTime(new Date());
+            musicGroupPaymentCalenderDao.update(regCalender);
+        }
+
         Set<Integer> roleIds = new HashSet<>(3);
         roleIds.add(SysUserRole.EDUCATIONAL_TEACHER);
         roleIds.add(SysUserRole.OPERATION_EXECUTIVE);
@@ -1386,8 +1393,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         musicGroupDao.update(musicGroup);
 
         MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderService.findByMusicGroupRegCalender(musicGroup.getId());
-        if (regCalender != null) {
+        if (regCalender != null && regCalender.getPayUserType().equals(MusicGroupPaymentCalender.PayUserType.STUDENT)) {
             regCalender.setDeadlinePaymentDate(expireDate);
+            regCalender.setStatus(MusicGroupPaymentCalender.PaymentCalenderStatusEnum.OPEN);
+            regCalender.setUpdateTime(date);
             musicGroupPaymentCalenderService.update(regCalender);
         }
 
@@ -1674,10 +1683,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         Integer organId = studentRegistration.getOrganId();
         MusicGroupPaymentCalenderDetail calenderDetail = musicGroupPaymentCalenderDetailDao.findByCalenderIdAndUserId(calenderId, userId);
         //关闭之前的订单
-        if(calenderDetail.getPaymentOrderId() != null){
+        if (calenderDetail.getPaymentOrderId() != null) {
             StudentPaymentOrder oldStudentPaymentOrder = studentPaymentOrderDao.get(calenderDetail.getPaymentOrderId());
-            if(oldStudentPaymentOrder != null){
-                if(oldStudentPaymentOrder.getStatus() == SUCCESS){
+            if (oldStudentPaymentOrder != null) {
+                if (oldStudentPaymentOrder.getStatus() == SUCCESS) {
                     throw new BizException("您已支付请勿重复提交");
                 }
                 oldStudentPaymentOrder.setStatus(CLOSE);
@@ -1751,7 +1760,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
 
         if (amount.compareTo(BigDecimal.ZERO) == 0) {
-            studentPaymentRouteOrderService.addRouteOrder(orderNo,organId, balance);
+            studentPaymentRouteOrderService.addRouteOrder(orderNo, organId, balance);
             Map<String, String> notifyMap = new HashMap<>(4);
             notifyMap.put("tradeState", "1");
             notifyMap.put("merOrderNo", studentPaymentOrder.getOrderNo());
@@ -1802,7 +1811,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if (studentPaymentOrder.getStatus() == SUCCESS) {
             //当前乐团报名是否赠送乐团网管课
             MusicGroupPaymentCalenderDetail calenderDetail = musicGroupPaymentCalenderDetailDao.findByOrderId(studentPaymentOrder.getId());
-            MusicGroupStudentFee musicGroupStudentFee = musicGroupPaymentCalenderService.updateCalender(calenderDetail.getId(),studentRegistration.getUserId());
+            MusicGroupStudentFee musicGroupStudentFee = musicGroupPaymentCalenderService.updateCalender(calenderDetail.getId(), studentRegistration.getUserId());
 
             musicGroupStudentFee.setUpdateTime(date);
             musicGroupStudentFee.setLatestPaidTime(date);
@@ -2071,6 +2080,20 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 //        List<Integer> months = subFeeSettingDto.getMonths();
 
         Date date = new Date();
+        //缴费方式不同
+        if ((group.getStatus().equals(MusicGroupStatusEnum.AUDIT_FAILED) || group.getStatus().equals(MusicGroupStatusEnum.DRAFT))
+                && !group.getChargeTypeId().equals(musicGroup.getChargeTypeId())) {
+            //删除原有的乐团声部规划
+            musicGroupSubjectPlanDao.delByMusicGroupId(musicGroupId);
+            //删除原有的声部商品组合
+            musicGroupSubjectGoodsGroupDao.delByMusicGroupId(musicGroupId);
+            //删除原有的缴费项目
+            MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderDao.findByMusicGroupRegCalender(musicGroupId);
+            if (regCalender != null) {
+                musicGroupPaymentCalenderDao.delByGroupId(musicGroupId);
+                musicGroupPaymentCalenderCourseSettingsDao.deleteByMusicGroupPaymentCalenderId(regCalender.getId());
+            }
+        }
 
         //判断缴费日历是否修改
         /*boolean isModifiedOfCalender = false;
@@ -2117,7 +2140,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         musicGroup.setUpdateTime(date);
         musicGroupDao.update(musicGroup);
         //修改课程里面的教学点
-        if (!musicGroup.getSchoolId().equals(musicGroup.getSchoolId())) {
+        if (!group.getSchoolId().equals(musicGroup.getSchoolId())) {
             courseScheduleDao.updateByMusicGroupId(musicGroupId, musicGroup.getSchoolId());
         }
         // 删除乐团付费主体列表
@@ -2137,6 +2160,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
         ChargeType chargeType = chargeTypeDao.get(musicGroup.getChargeTypeId());
         musicGroup.setChargeTypeName(chargeType.getName());
+        MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderService.findByMusicGroupRegCalender(musicGroup.getId());
+        if (regCalender != null && regCalender.getPayUserType().equals(MusicGroupPaymentCalender.PayUserType.STUDENT)) {
+            musicGroup.setPaymentExpireDate(regCalender.getDeadlinePaymentDate());
+        }
         subFeeSettingDto.setMusicGroup(musicGroup);
         //获取付费主体
         subFeeSettingDto.setMusicGroupPaymentEntities(musicGroupPaymentEntitiesDao.findByMusicGroupId(musicGroupId));
@@ -2179,6 +2206,14 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         musicGroup.setPaymentExpireDate(DateUtil.toDate(expireDate));
         musicGroup.setStatus(MusicGroupStatusEnum.PAY);
         musicGroupDao.update(musicGroup);
+        //所有人开启缴费
+        studentRegistrationDao.musicGroupOpenPay(musicGroupId, PaymentStatusEnum.OPEN);
+        MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderDao.findByMusicGroupRegCalender(musicGroupId);
+        if (regCalender != null && regCalender.getPayUserType().equals(MusicGroupPaymentCalender.PayUserType.STUDENT)) {
+            regCalender.setStatus(MusicGroupPaymentCalender.PaymentCalenderStatusEnum.OPEN);
+            regCalender.setUpdateTime(new Date());
+            musicGroupPaymentCalenderDao.update(regCalender);
+        }
         //三方乐团不发送缴费通知
         if (musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN) {
             //获取所有已报名学员列表
@@ -2195,8 +2230,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         roleIds.add(SysUserRole.EDUCATIONAL_TEACHER);
         roleIds.add(SysUserRole.OPERATION_EXECUTIVE);
         sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_ACTION_PAYMENT, "", musicGroup.getName());
-        //所有人开启缴费
-        studentRegistrationDao.musicGroupOpenPay(musicGroupId, PaymentStatusEnum.OPEN);
         return musicGroup;
     }
 

+ 5 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupSubjectPlanServiceImpl.java

@@ -227,7 +227,7 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
     @Override
     public List<MusicGroupGoodsAndDiscountDto> getSubjectGoods(Integer subjectId, String type, Integer chargeTypeId) {
         List<MusicGroupGoodsAndDiscountDto> goodsList = goodsDao.getMusicGroupGoodsAndDiscount(subjectId, type);
-        if (chargeTypeId == null || !"INSTRUMENT".equals(type)) {
+        if (chargeTypeId == null || (type != null && !"INSTRUMENT".equals(type))) {
             return goodsList;
         }
 
@@ -236,8 +236,10 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
             return goodsList;
         }
         for (MusicGroupGoodsAndDiscountDto musicGroupGoodsAndDiscountDto : goodsList) {
-            musicGroupGoodsAndDiscountDto.setDiscountRate(subjectDiscount.getGoodsDiscountRate());
-            musicGroupGoodsAndDiscountDto.setGroupPurchasePrice(musicGroupGoodsAndDiscountDto.getGroupPurchasePrice().multiply(subjectDiscount.getGoodsDiscountRate()).setScale(2, BigDecimal.ROUND_HALF_UP));
+            if (musicGroupGoodsAndDiscountDto.getType() != null && musicGroupGoodsAndDiscountDto.getType().equals(GoodsType.INSTRUMENT)) {
+                musicGroupGoodsAndDiscountDto.setDiscountRate(subjectDiscount.getGoodsDiscountRate());
+                musicGroupGoodsAndDiscountDto.setGroupPurchasePrice(musicGroupGoodsAndDiscountDto.getGroupPurchasePrice().multiply(subjectDiscount.getGoodsDiscountRate()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP));
+            }
         }
         return goodsList;
     }

+ 89 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentCompetitionServiceImpl.java

@@ -0,0 +1,89 @@
+package com.ym.mec.biz.service.impl;
+
+import cfca.sadk.org.bouncycastle.apache.bzip2.BZip2Constants;
+import com.ym.mec.biz.dal.dto.StudentCompetitionRankingDto;
+import com.ym.mec.biz.dal.page.StudentCompetitionQueryInfo;
+import com.ym.mec.biz.service.ContractService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.util.collection.MapUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.ss.formula.functions.T;
+import org.springframework.beans.factory.annotation.Autowired;
+import com.ym.mec.biz.dal.entity.StudentCompetition;
+import com.ym.mec.biz.service.StudentCompetitionService;
+import com.ym.mec.biz.dal.dao.StudentCompetitionDao;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+
+@Service
+public class StudentCompetitionServiceImpl extends BaseServiceImpl<Long, StudentCompetition> implements StudentCompetitionService {
+	
+	@Autowired
+	private StudentCompetitionDao studentCompetitionDao;
+
+	@Override
+	public BaseDAO<Long, StudentCompetition> getDAO() {
+		return studentCompetitionDao;
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
+	public void addStudentCompetition(StudentCompetition studentCompetition) {
+		StudentCompetition userCompetition = studentCompetitionDao.getCompetitionWithUser(studentCompetition.getUserId());
+		if(Objects.nonNull(userCompetition)){
+			throw new BizException("您已有正在审核中的参赛作品");
+		}
+		if(StringUtils.isBlank(studentCompetition.getSubject())){
+			throw new BizException("请选择参赛专业");
+		}
+		if(StringUtils.isBlank(studentCompetition.getChapter())){
+			throw new BizException("请选择参赛曲目");
+		}
+		if(StringUtils.isBlank(studentCompetition.getVideoUrl())){
+			throw new BizException("请指定参赛作品");
+		}
+		studentCompetitionDao.insert(studentCompetition);
+	}
+
+	@Override
+	public PageInfo<StudentCompetition> queryPage(StudentCompetitionQueryInfo queryInfo) {
+		PageInfo<StudentCompetition> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+		Map<String, Object> params = new HashMap<String, Object>();
+		MapUtil.populateMap(params, queryInfo);
+
+		List<StudentCompetition> dataList = null;
+		int count = studentCompetitionDao.countStudentCompetitions(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			dataList = studentCompetitionDao.queryStudentCompetitions(params);
+		}
+		if (count == 0) {
+			dataList = new ArrayList<>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
+	public StudentCompetition checkIsUpload(Integer userId) {
+		return studentCompetitionDao.getCompetitionWithUser(userId);
+	}
+
+	@Override
+	public List<StudentCompetitionRankingDto> getWinnerList() {
+		List<StudentCompetition> winnerList = studentCompetitionDao.getWinnerList();
+		List<StudentCompetitionRankingDto> winnerSimpleInfoList = new ArrayList<>();
+		for (StudentCompetition studentCompetition : winnerList) {
+			winnerSimpleInfoList.add(new StudentCompetitionRankingDto(studentCompetition.getId(), studentCompetition.getUsername(), studentCompetition.getPictureUrl()));
+		}
+		return winnerSimpleInfoList;
+	}
+}

+ 8 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -1065,7 +1065,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         List<MusicGroupPaymentStudentCourseDetail> musicGroupPaymentStudentCourseDetails = new ArrayList<>();
 
         for (MusicGroupPaymentCalenderCourseSettings courseSetting : courseSettings) {
-            if (musicGroupRegCalender.getPayUserType().equals(MusicGroupPaymentCalender.PayUserType.STUDENT) && !orderDetailTypes.contains(courseSetting.getCourseType().getCode())) continue;
+            if (musicGroupRegCalender.getPayUserType().equals(MusicGroupPaymentCalender.PayUserType.STUDENT) && !orderDetailTypes.contains(courseSetting.getCourseType().getCode()))
+                continue;
             MusicGroupPaymentStudentCourseDetail musicGroupPaymentStudentCourseDetail = new MusicGroupPaymentStudentCourseDetail();
             musicGroupPaymentStudentCourseDetail.setMusicGroupPaymentCalenderId(musicGroupRegCalender.getId());
             musicGroupPaymentStudentCourseDetail.setMusicGroupPaymentCalenderDetailId(musicGroupPaymentCalenderDetail.getId());
@@ -1140,6 +1141,12 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             //发送短信通知
             List<Long> list = JSONObject.parseArray(JSONObject.toJSONString(Arrays.asList(ids.split(","))), Long.class);
             MusicGroup musicGroup = musicGroupDao.findMusicGroup(list);
+            MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderService.findByMusicGroupRegCalender(musicGroup.getId());
+            if (regCalender != null && regCalender.getPayUserType().equals(MusicGroupPaymentCalender.PayUserType.STUDENT)) {
+                regCalender.setStatus(MusicGroupPaymentCalender.PaymentCalenderStatusEnum.OPEN);
+                musicGroupPaymentCalenderService.update(regCalender);
+            }
+
             //三方乐团不发送缴费通知
             if (musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN) {
                 List<StudentRegistration> registrations = studentRegistrationDao.findStudentListByIdList(list);

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

@@ -323,7 +323,7 @@
                 AND cgsm.user_id_ = #{userId}
             </if>
             <if test="search != null and search != ''">
-                AND cg.name_ LIKE CONCAT('%',#{search},'%')
+                AND (cg.name_ LIKE CONCAT('%',#{search},'%') OR cg.group_name_ LIKE CONCAT('%',#{search},'%') OR mg.name_ LIKE CONCAT('%',#{search},'%'))
             </if>
         </where>
         GROUP BY cg.id_
@@ -475,7 +475,8 @@
         AND cg.del_flag_ = 0 AND ((mg.status_ = 'PROGRESS' OR vg.group_status_ = 2 OR csg.status_ = 'NORMAL')
         OR (vg.group_status_ = 2 AND vg.educational_teacher_id_ =  #{userId}) OR (csg.status_ = 'NORMAL' AND csg.educational_teacher_id_ =  #{userId}))
         <if test="search != null">
-            AND (cg.name_ LIKE CONCAT('%',#{search},'%') OR cg.group_name_ LIKE CONCAT('%',#{search},'%'))
+            AND (cg.name_ LIKE CONCAT('%',#{search},'%') OR cg.group_name_ LIKE CONCAT('%',#{search},'%')
+             OR mg.name_ LIKE CONCAT('%',#{search},'%'))
         </if>
         GROUP BY cg.id_
     </select>

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

@@ -178,7 +178,7 @@
 	<delete id="deleteByUserIdAndMusicGroupId">
 		DELETE FROM music_group_payment_calender_detail
 		WHERE music_group_payment_calender_id_ IN (SELECT mgpc.id_ FROM music_group_payment_calender mgpc
-		WHERE mgpc.music_group_id_ = #{musicGroupId} AND mgpc.payment_status_ IN ('NO','OPEN'))
+		WHERE mgpc.music_group_id_ = #{musicGroupId} AND mgpc.status_ IN ('NO','OPEN'))
 		AND user_id_ = #{userId} AND payment_status_ = 'NON_PAYMENT'
 	</delete>
     <delete id="deleteByCalenderId">

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

@@ -478,7 +478,6 @@
         WHERE music_group_id_ = #{musicGroupId}
         AND payment_type_ = 'MUSIC_APPLY'
         AND pay_user_type_='STUDENT'
-        AND status_='OPEN'
     </select>
     <select id="queryUserPaymentStatus" resultType="java.util.Map">
         SELECT mg.id_ 'key',CASE WHEN COUNT(mgpc.id_) = 0 OR COUNT(DISTINCT mgpcd.id_) > 0 THEN 'NON_PAYMENT' ELSE 'PAID_COMPLETED' END 'value'

+ 158 - 0
mec-biz/src/main/resources/config/mybatis/StudentCompetitionMapper.xml

@@ -0,0 +1,158 @@
+<?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.ym.mec.biz.dal.dao.StudentCompetitionDao">
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.StudentCompetition" id="StudentCompetition">
+		<result column="id_" property="id" />
+		<result column="user_id_" property="userId" />
+		<result column="username_" property="username" />
+		<result column="id_card_no_" property="idCardNo" />
+		<result column="age_" property="age" />
+		<result column="gender_" property="gender" />
+		<result column="grade_" property="grade" />
+		<result column="subject_" property="subject" />
+		<result column="chapter_" property="chapter" />
+		<result column="picture_url_" property="pictureUrl" />
+		<result column="video_url_" property="videoUrl" />
+		<result column="score_" property="score" />
+		<result column="prize_level_" property="prizeLevel" />
+		<result column="is_show_" property="isShow" />
+		<result column="comment_" property="comment" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="StudentCompetition" >
+		SELECT * FROM student_competition WHERE id_ = #{id} FOR UPDATE
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="StudentCompetition">
+		SELECT * FROM student_competition ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentCompetition" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!--
+		<selectKey resultClass="int" keyProperty="id" > 
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		</selectKey>
+		-->
+		INSERT INTO student_competition (id_,user_id_,username_,id_card_no_,age_,gender_,grade_,subject_,chapter_,picture_url_,video_url_,score_,prize_level_,is_show_,comment_,create_time_,update_time_)
+		VALUES(#{id},#{userId},#{username},#{idCardNo},#{age},#{gender},#{grade},#{subject},#{chapter},#{pictureUrl},#{videoUrl},#{score},#{prizeLevel},#{isShow},#{comment},NOW(),NOW())
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.StudentCompetition">
+		UPDATE student_competition <set>
+		<if test="isShow != null">
+			is_show_ = #{isShow},
+		</if>
+		<if test="id != null">
+			id_ = #{id},
+		</if>
+		<if test="gender != null">
+			gender_ = #{gender},
+		</if>
+		<if test="score != null">
+			score_ = #{score},
+		</if>
+		<if test="prizeLevel != null">
+			prize_level_ = #{prizeLevel},
+		</if>
+		<if test="age != null">
+			age_ = #{age},
+		</if>
+		<if test="videoUrl != null">
+			video_url_ = #{videoUrl},
+		</if>
+		<if test="username != null">
+			username_ = #{username},
+		</if>
+		<if test="chapter != null">
+			chapter_ = #{chapter},
+		</if>
+		<if test="userId != null">
+			user_id_ = #{userId},
+		</if>
+		<if test="subject != null">
+			subject_ = #{subject},
+		</if>
+		<if test="comment != null">
+			comment_ = #{comment},
+		</if>
+		<if test="pictureUrl != null">
+			picture_url_ = #{pictureUrl},
+		</if>
+		<if test="idCardNo != null">
+			id_card_no_ = #{idCardNo},
+		</if>
+		<if test="grade != null">
+			grade_ = #{grade},
+		</if>
+			update_time_ = NOW()
+	</set> WHERE id_ = #{id}
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM student_competition WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="StudentCompetition" parameterType="map">
+		SELECT * FROM student_competition ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM student_competition
+	</select>
+
+	<sql id="queryStudentCondition">
+		<where>
+			<if test="grade!=null">
+				AND grade_=#{grade}
+			</if>
+			<if test="gender!=null">
+				AND gender_=#{gender}
+			</if>
+			<if test="subject != null and subject != ''">
+				AND subject_=#{subject}
+			</if>
+			<if test="prizeLevel!=null">
+				AND prize_level_=#{prizeLevel}
+			</if>
+			<if test="isShow!=null">
+				AND is_show_=#{isShow}
+			</if>
+			<if test="search!=null and search!=''">
+				AND (CAST(age_ AS CHAR)=#{search} OR username_ LIKE CONCAT('%', #{search}, '%') OR id_card_no_ LIKE CONCAT('%', #{search}, '%'))
+			</if>
+		</where>
+	</sql>
+
+	<select id="queryStudentCompetitions" resultMap="StudentCompetition">
+		SELECT * FROM student_competition
+		<include refid="queryStudentCondition"/>
+		ORDER BY id_ DESC
+		<include refid="global.limit"/>
+	</select>
+	<select id="countStudentCompetitions" resultType="int">
+		SELECT COUNT(*) FROM student_competition
+		<include refid="queryStudentCondition"/>
+	</select>
+
+	<select id="getWinnerList" resultMap="StudentCompetition">
+		SELECT * FROM student_competition WHERE is_show_ = 1 AND prize_level_ IS NOT NULL ORDER BY prize_level_
+	</select>
+
+	<select id="getCompetitionWithUser" resultMap="StudentCompetition">
+		SELECT * FROM student_competition WHERE user_id_ = #{userId}
+	</select>
+</mapper>

+ 3 - 1
mec-student/src/main/java/com/ym/mec/student/config/ResourceServerConfig.java

@@ -42,7 +42,9 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
                 "/subjectChange/getChangeInfo",
                 "/subjectChange/payChange",
                 "/contracts/queryProduceContract",
-                "/repair/studentPaymentGoodsOrder").permitAll().anyRequest().authenticated().and().httpBasic();
+                "/repair/studentPaymentGoodsOrder",
+                "/studentCompetition/getWinnerList",
+                "/studentCompetition/get").permitAll().anyRequest().authenticated().and().httpBasic();
     }
 
     @Override

+ 79 - 0
mec-student/src/main/java/com/ym/mec/student/controller/StudentCompetitionController.java

@@ -0,0 +1,79 @@
+package com.ym.mec.student.controller;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dto.StudentCompetitionRankingDto;
+import com.ym.mec.biz.dal.entity.StudentCompetition;
+import com.ym.mec.biz.service.ContractService;
+import com.ym.mec.biz.service.StudentCompetitionService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.11.10
+ */
+@RestController
+@RequestMapping("studentCompetition")
+@Api(tags = "长三角比赛服务")
+public class StudentCompetitionController extends BaseController {
+
+    @Autowired
+    private StudentCompetitionService studentCompetitionService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private ContractService contractService;
+
+    @ApiOperation(value = "新增参赛作品")
+    @PostMapping("/add")
+    public HttpResponseResult add(@RequestBody StudentCompetition studentCompetition){
+        if(StringUtils.isBlank(studentCompetition.getUsername())||StringUtils.isBlank(studentCompetition.getIdCardNo())){
+            return failed("参赛选手身份信息不完整");
+        }
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("请登录");
+        }
+        contractService.register(sysUser.getId(), studentCompetition.getUsername(), studentCompetition.getIdCardNo(),sysUser.getPhone());
+        studentCompetition.setUserId(sysUser.getId());
+        studentCompetitionService.addStudentCompetition(studentCompetition);
+        return succeed();
+    }
+
+    @ApiOperation(value = "检测学生是否已有上传作品")
+    @GetMapping("/checkIsUpload")
+    public HttpResponseResult<StudentCompetition> checkIsUpload(){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("请登录");
+        }
+        return succeed(studentCompetitionService.checkIsUpload(sysUser.getId()));
+    }
+
+    @ApiOperation(value = "获取获奖名单")
+    @GetMapping("/getWinnerList")
+    public HttpResponseResult<List<StudentCompetitionRankingDto>> getWinnerList(){
+        return succeed(studentCompetitionService.getWinnerList());
+    }
+
+    @ApiOperation(value = "获取指定参赛作品详情")
+    @GetMapping("/get")
+    public HttpResponseResult<StudentCompetition> get(Long competitionId){
+        StudentCompetition studentCompetition = studentCompetitionService.get(competitionId);
+        if(Objects.isNull(studentCompetition)||!studentCompetition.isShow()){
+            return succeed();
+        }
+        return succeed(studentCompetition);
+    }
+
+}

+ 44 - 0
mec-web/src/main/java/com/ym/mec/web/controller/StudentCompetitionController.java

@@ -0,0 +1,44 @@
+package com.ym.mec.web.controller;
+
+import com.ym.mec.biz.dal.entity.StudentCompetition;
+import com.ym.mec.biz.dal.page.StudentCompetitionQueryInfo;
+import com.ym.mec.biz.service.StudentCompetitionService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.page.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.11.10
+ */
+@RestController
+@RequestMapping("studentCompetition")
+@Api(tags = "长三角比赛服务")
+public class StudentCompetitionController extends BaseController {
+
+    @Autowired
+    private StudentCompetitionService studentCompetitionService;
+
+    @ApiOperation(value = "查询报名记录")
+    @PostMapping("/queryPage")
+    @PreAuthorize("@pcs.hasPermissions('studentCompetition/queryPage')")
+    public HttpResponseResult<PageInfo<StudentCompetition>> queryPage(@RequestBody StudentCompetitionQueryInfo queryInfo){
+        return succeed(studentCompetitionService.queryPage(queryInfo));
+    }
+    @ApiOperation(value = "更新报名记录")
+    @PostMapping("/update")
+    @PreAuthorize("@pcs.hasPermissions('studentCompetition/update')")
+    public HttpResponseResult update(@RequestBody StudentCompetition studentCompetition){
+        studentCompetitionService.update(studentCompetition);
+        return succeed();
+    }
+
+}

+ 18 - 6
mec-web/src/main/java/com/ym/mec/web/controller/StudentRegistrationController.java

@@ -1,10 +1,10 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
 import com.ym.mec.biz.dal.dto.MusicGroupSubjectGoodsAndInfoDto;
 import com.ym.mec.biz.dal.dto.StudentAddDto;
-import com.ym.mec.biz.dal.entity.MusicGroup;
-import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
-import com.ym.mec.biz.dal.entity.StudentRegistration;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
 import com.ym.mec.biz.service.MusicGroupSubjectPlanService;
@@ -33,6 +33,10 @@ public class StudentRegistrationController extends BaseController {
     private StudentRegistrationService studentRegistrationService;
     @Autowired
     private MusicGroupSubjectPlanService musicGroupSubjectPlanService;
+    @Autowired
+    private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
+    @Autowired
+    private MusicGroupPaymentCalenderCourseSettingsDao musicGroupPaymentCalenderCourseSettingsDao;
 
     @ApiOperation(value = "乐团添加学员")
     @PostMapping("/insertStudent")
@@ -153,11 +157,19 @@ public class StudentRegistrationController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('studentRegistration/getSubjectGoodsAndInfo')")
     @ApiImplicitParams({@ApiImplicitParam(name = "subjectId", value = "声部信息", required = true, dataType = "Integer"),
             @ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String")})
-    public HttpResponseResult<MusicGroupSubjectGoodsAndInfoDto> getSubjectGoodsAndInfo(Integer subjectId, String musicGroupId) {
-        if (subjectId == null || StringUtils.isEmpty(musicGroupId)) {
+    public HttpResponseResult<MusicGroupSubjectGoodsAndInfoDto> getSubjectGoodsAndInfo(Integer subjectId, String musicGroupId, Long calenderId) {
+        if (subjectId == null || StringUtils.isEmpty(musicGroupId) || calenderId == null) {
             return failed("参数校验异常");
         }
-        return succeed(musicGroupSubjectPlanService.getSubjectGoodsAndInfo(musicGroupId, subjectId));
+        MusicGroupSubjectGoodsAndInfoDto subjectGoodsAndInfo = musicGroupSubjectPlanService.getSubjectGoodsAndInfo(musicGroupId, subjectId);
+
+        MusicGroupPaymentCalender musicGroupRegCalender = musicGroupPaymentCalenderDao.get(calenderId);
+        if (musicGroupRegCalender != null && musicGroupRegCalender.getPayUserType().equals(MusicGroupPaymentCalender.PayUserType.STUDENT)) {
+            List<MusicGroupPaymentCalenderCourseSettings> courseSettings = musicGroupPaymentCalenderCourseSettingsDao.getWithPaymentCalender(musicGroupRegCalender.getId());
+            musicGroupRegCalender.setMusicGroupPaymentCalenderCourseSettingsList(courseSettings);
+            subjectGoodsAndInfo.setMusicGroupPaymentCalender(musicGroupRegCalender);
+        }
+        return succeed(subjectGoodsAndInfo);
     }
 
     @ApiOperation(value = "获取班级课程的价值")