瀏覽代碼

Merge remote-tracking branch 'origin/vip_price_827' into vip_price_827

# Conflicts:
#	mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml
zouxuan 3 年之前
父節點
當前提交
450076aed2

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPreRegistrationDao.java

@@ -26,6 +26,10 @@ public interface StudentPreRegistrationDao extends BaseDAO<Long, StudentPreRegis
 
 	List<Mapper> querySecondSubjectNum(String musicGroupId);
 
+	List<Mapper> queryTeacherRecommandSubjectNum(String musicGroupId);
+
+	List<Mapper> querySelectionSubjectNum(String musicGroupId);
+
 	/**
 	 * 获取乐团预报名人数
 	 * @param musicGroupIds

+ 21 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/PreRegisterSubjectDto.java

@@ -5,8 +5,12 @@ public class PreRegisterSubjectDto {
 	private String subjectName;
 	
 	private int firstSubjectNum;
-	
+
 	private int secondSubjectNum;
+	
+	private int teacherRecommandSubjectNum;
+	
+	private int selectionSubjectNum;
 
 	public String getSubjectName() {
 		return subjectName;
@@ -31,4 +35,20 @@ public class PreRegisterSubjectDto {
 	public void setSecondSubjectNum(int secondSubjectNum) {
 		this.secondSubjectNum = secondSubjectNum;
 	}
+
+	public int getTeacherRecommandSubjectNum() {
+		return teacherRecommandSubjectNum;
+	}
+
+	public void setTeacherRecommandSubjectNum(int teacherRecommandSubjectNum) {
+		this.teacherRecommandSubjectNum = teacherRecommandSubjectNum;
+	}
+
+	public int getSelectionSubjectNum() {
+		return selectionSubjectNum;
+	}
+
+	public void setSelectionSubjectNum(int selectionSubjectNum) {
+		this.selectionSubjectNum = selectionSubjectNum;
+	}
 }

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentPreRegistrationDto.java

@@ -9,6 +9,10 @@ public class StudentPreRegistrationDto extends StudentPreRegistration {
 	private String subjectFirstName;
 	
 	private String subjectSecondName;
+	
+	private String teacherRecommandSubjectName;
+	
+	private String selectionSubjectName;
 
 	public boolean getIsRegistered() {
 		return isRegistered;
@@ -33,4 +37,20 @@ public class StudentPreRegistrationDto extends StudentPreRegistration {
 	public void setSubjectSecondName(String subjectSecondName) {
 		this.subjectSecondName = subjectSecondName;
 	}
+
+	public String getTeacherRecommandSubjectName() {
+		return teacherRecommandSubjectName;
+	}
+
+	public void setTeacherRecommandSubjectName(String teacherRecommandSubjectName) {
+		this.teacherRecommandSubjectName = teacherRecommandSubjectName;
+	}
+
+	public String getSelectionSubjectName() {
+		return selectionSubjectName;
+	}
+
+	public void setSelectionSubjectName(String selectionSubjectName) {
+		this.selectionSubjectName = selectionSubjectName;
+	}
 }

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentPreRegistration.java

@@ -39,6 +39,12 @@ public class StudentPreRegistration {
 	/** 第二专业 */
 	private Integer subjectSecond;
 	
+	/** 老师推荐声部 */
+	private Integer teacherRecommandSubjectId;
+	
+	/** 选报声部 */
+	private Integer selectionSubjectId;
+	
 	/** 是否允许调剂 */
 	private boolean isAllowAdjust;
 	
@@ -131,6 +137,22 @@ public class StudentPreRegistration {
 		return this.subjectSecond;
 	}
 			
+	public Integer getTeacherRecommandSubjectId() {
+		return teacherRecommandSubjectId;
+	}
+
+	public void setTeacherRecommandSubjectId(Integer teacherRecommandSubjectId) {
+		this.teacherRecommandSubjectId = teacherRecommandSubjectId;
+	}
+
+	public Integer getSelectionSubjectId() {
+		return selectionSubjectId;
+	}
+
+	public void setSelectionSubjectId(Integer selectionSubjectId) {
+		this.selectionSubjectId = selectionSubjectId;
+	}
+
 	public void setIsAllowAdjust(boolean isAllowAdjust){
 		this.isAllowAdjust = isAllowAdjust;
 	}

+ 16 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPreRegistrationServiceImpl.java

@@ -58,6 +58,8 @@ public class StudentPreRegistrationServiceImpl extends BaseServiceImpl<Long, Stu
 		Set<String> subjectNames = new HashSet<String>();
 		Map<String, Integer> firstMap = new HashMap<String, Integer>();
 		Map<String, Integer> secondMap = new HashMap<String, Integer>();
+		Map<String, Integer> teacherRecommandMap = new HashMap<String, Integer>();
+		Map<String, Integer> selectionMap = new HashMap<String, Integer>();
 
 		List<Mapper> firstMapperList = studentPreRegistrationDao.queryFirstSubjectNum(musicGroupId);
 		for (Mapper mapper : firstMapperList) {
@@ -71,12 +73,26 @@ public class StudentPreRegistrationServiceImpl extends BaseServiceImpl<Long, Stu
 			subjectNames.add(String.valueOf(mapper.getKey()));
 		}
 
+		List<Mapper> teacherRecommandMapperList = studentPreRegistrationDao.queryTeacherRecommandSubjectNum(musicGroupId);
+		for (Mapper mapper : teacherRecommandMapperList) {
+			teacherRecommandMap.put(String.valueOf(mapper.getKey()), Integer.parseInt(mapper.getValue().toString()));
+			subjectNames.add(String.valueOf(mapper.getKey()));
+		}
+
+		List<Mapper> selectionMapperList = studentPreRegistrationDao.querySelectionSubjectNum(musicGroupId);
+		for (Mapper mapper : selectionMapperList) {
+			selectionMap.put(String.valueOf(mapper.getKey()), Integer.parseInt(mapper.getValue().toString()));
+			subjectNames.add(String.valueOf(mapper.getKey()));
+		}
+
 		List<PreRegisterSubjectDto> list = new ArrayList<PreRegisterSubjectDto>();
 		for (String subjectName : subjectNames) {
 			PreRegisterSubjectDto dto = new PreRegisterSubjectDto();
 			dto.setSubjectName(subjectName);
 			dto.setFirstSubjectNum(firstMap.get(subjectName) == null ? 0 : firstMap.get(subjectName));
 			dto.setSecondSubjectNum(secondMap.get(subjectName) == null ? 0 : secondMap.get(subjectName));
+			dto.setTeacherRecommandSubjectNum(teacherRecommandMap.get(subjectName) == null ? 0 : teacherRecommandMap.get(subjectName));
+			dto.setSelectionSubjectNum(selectionMap.get(subjectName) == null ? 0 : selectionMap.get(subjectName));
 
 			list.add(dto);
 		}

+ 5 - 2
mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml

@@ -106,7 +106,7 @@
                  settlement_type_, cooperation_organ_id_, enlightenment_course_time_,
                  parent_meeting_time_, img_, director_user_id_, is_classroom_lessons_, memo_, expect_start_group_date_,
                  ownership_type_, repair_user_id_, del_flag_, payment_valid_start_date_, payment_valid_end_date_,
-                 payment_pattern_, course_view_type_, transaction_teacher_id_,homework_push_flag_)
+                 payment_pattern_, course_view_type_, transaction_teacher_id_,homework_push_flag_,member_course_show_flag_)
         VALUES (#{id}, #{name}, #{organId}, #{schoolId}, #{applyExpireDate}, #{preApplyExpireDate}, #{teamTeacherId},
                 #{educationalTeacherId},
                 #{chargeTypeId}, #{courseForm}, now(), now(),
@@ -118,7 +118,7 @@
                 #{isClassroomLessons}, #{memo}, #{expectStartGroupDate},
                 #{ownershipType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{repairUserId},
                 #{delFlag}, #{paymentValidStartDate}, #{paymentValidEndDate}, #{paymentPattern},
-                #{courseViewType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{transactionTeacherId},#{homeworkPushFlag})
+                #{courseViewType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{transactionTeacherId},#{homeworkPushFlag},#{memberCourseShowFlag})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -224,6 +224,9 @@
             <if test="musicalInstrumentsProvideStatus != null">
                 musical_instruments_provide_status_ = #{musicalInstrumentsProvideStatus},
             </if>
+            <if test="memberCourseShowFlag != null">
+                member_course_show_flag_ = #{memberCourseShowFlag},
+            </if>
         </set>
         WHERE id_ = #{id}
     </update>

+ 33 - 5
mec-biz/src/main/resources/config/mybatis/StudentPreRegistrationMapper.xml

@@ -18,6 +18,8 @@
         <result column="current_class_" property="currentClass"/>
         <result column="subject_first_" property="subjectFirst"/>
         <result column="subject_second_" property="subjectSecond"/>
+        <result column="teacher_recommand_subject_id_" property="teacherRecommandSubjectId"/>
+        <result column="selection_subject_id_" property="selectionSubjectId"/>
         <result column="is_allow_adjust_" property="isAllowAdjust"/>
         <result column="kit_purchase_method_" property="kitPurchaseMethod"/>
         <result column="cloud_teacher_method_" property="cloudTeacherMethod"/>
@@ -29,6 +31,8 @@
                extends="StudentPreRegistration">
         <result column="subject_first_name_" property="subjectFirstName"/>
         <result column="subject_second_name_" property="subjectSecondName"/>
+        <result column="teacher_recommand_subject_name_" property="teacherRecommandSubjectName"/>
+        <result column="selection_subject_name_" property="selectionSubjectName"/>
         <result column="is_registered_" property="isRegistered"/>
     </resultMap>
 
@@ -84,8 +88,8 @@
         </selectKey>
         -->
         INSERT INTO student_pre_registration
-        (id_,music_group_id_,user_id_,phone_,user_name_,gender_,current_grade_,current_grade_num_,current_class_,subject_first_,subject_second_,is_allow_adjust_,kit_purchase_method_,cloud_teacher_method_,create_time_)
-        VALUES(#{id},#{musicGroupId},#{userId},#{phone},#{userName},#{gender},#{currentGrade},#{currentGradeNum},#{currentClass},#{subjectFirst},#{subjectSecond},#{isAllowAdjust},#{kitPurchaseMethod},#{cloudTeacherMethod},#{createTime})
+        (id_,music_group_id_,user_id_,phone_,user_name_,gender_,current_grade_,current_grade_num_,current_class_,subject_first_,subject_second_,teacher_recommand_subject_id_,selection_subject_id_,is_allow_adjust_,kit_purchase_method_,cloud_teacher_method_,create_time_)
+        VALUES(#{id},#{musicGroupId},#{userId},#{phone},#{userName},#{gender},#{currentGrade},#{currentGradeNum},#{currentClass},#{subjectFirst},#{subjectSecond},#{teacherRecommandSubjectId},#{selectionSubjectId},#{isAllowAdjust},#{kitPurchaseMethod},#{cloudTeacherMethod},#{createTime})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -122,6 +126,12 @@
             <if test="subjectSecond != null">
                 subject_second_ = #{subjectSecond},
             </if>
+            <if test="teacherRecommandSubjectId != null">
+                teacher_recommand_subject_id_ = #{teacherRecommandSubjectId},
+            </if>
+            <if test="selectionSubjectId != null">
+                selection_subject_id_ = #{selectionSubjectId},
+            </if>
             <if test="currentClass != null">
                 current_class_ = #{currentClass},
             </if>
@@ -151,9 +161,11 @@
     <!-- 分页查询 -->
     <select id="queryListForPage" resultMap="StudentPreRegistrationDto" parameterType="map">
         SELECT spr.*,case when sr.id_ is null then false else true end is_registered_,s1.name_
-        subject_first_name_,s2.name_ subject_second_name_ FROM student_pre_registration spr
+        subject_first_name_,s2.name_ subject_second_name_,s3.name_ teacher_recommand_subject_name_,s4.name_ selection_subject_name_ FROM student_pre_registration spr
         left join subject s1 on s1.id_ = spr.subject_first_
         left join subject s2 on s2.id_ = spr.subject_second_
+        left join subject s3 on s3.id_ = spr.teacher_recommand_subject_id_
+        left join subject s4 on s4.id_ = spr.selection_subject_id_
         left join student_registration sr on spr.music_group_id_ = sr.music_group_id_ and spr.user_id_ = sr.user_id_
         <where>
             <if test="musicGroupId != null">
@@ -213,7 +225,7 @@
     </select>
 
     <select id="queryFirstSubjectNum" resultMap="Mapper">
-        SELECT ifnull(s.name_, '听从老师安排') key_, COUNT(spr.id_) value_
+        SELECT case when spr.subject_first_ = 999 then '听从老师安排' else ifnull(s.name_,'无') end key_, COUNT(spr.id_) value_
         FROM student_pre_registration spr
                  left join subject s on s.id_ = spr.subject_first_
         where spr.music_group_id_ = #{musicGroupId}
@@ -221,13 +233,29 @@
     </select>
 
     <select id="querySecondSubjectNum" resultMap="Mapper">
-        SELECT ifnull(s.name_, '听从老师安排') key_, COUNT(spr.id_) value_
+        SELECT case when spr.subject_second_ = 999 then '听从老师安排' else ifnull(s.name_,'无') end key_, COUNT(spr.id_) value_
         FROM student_pre_registration spr
                  left join subject s on s.id_ = spr.subject_second_
         where spr.music_group_id_ = #{musicGroupId}
         group by spr.subject_second_
     </select>
 
+    <select id="queryTeacherRecommandSubjectNum" resultMap="Mapper">
+        SELECT case when spr.teacher_recommand_subject_id_ = 999 then '听从老师安排' else ifnull(s.name_,'无') end key_, COUNT(spr.id_) value_
+        FROM student_pre_registration spr
+                 left join subject s on s.id_ = spr.teacher_recommand_subject_id_
+        where spr.music_group_id_ = #{musicGroupId}
+        group by spr.teacher_recommand_subject_id_
+    </select>
+
+    <select id="querySelectionSubjectNum" resultMap="Mapper">
+        SELECT case when spr.selection_subject_id_ = 999 then '听从老师安排' else ifnull(s.name_,'无') end key_, COUNT(spr.id_) value_
+        FROM student_pre_registration spr
+                 left join subject s on s.id_ = spr.selection_subject_id_
+        where spr.music_group_id_ = #{musicGroupId}
+        group by spr.selection_subject_id_
+    </select>
+
     <select id="queryByMusicGroupIdAndUserId" resultMap="StudentPreRegistration" parameterType="map">
         SELECT *
         FROM student_pre_registration

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

@@ -298,24 +298,36 @@ public class StudentRegistrationController extends BaseController {
             } else if ("GROUP".equals(row.getCloudTeacherMethod())) {
                 row.setCloudTeacherMethod("团购");
             }
-            if (row.getSubjectFirst().equals(999)) {
+            if(row.getSubjectFirst() == null){
+            	row.setSubjectFirstName("无");
+            } else if (row.getSubjectFirst().equals(999)) {
                 row.setSubjectFirstName("听从老师安排");
             }
-            if (row.getSubjectSecond().equals(999)) {
+            if(row.getSubjectSecond() == null){
+            	row.setSubjectSecondName("无");
+            } else if (row.getSubjectSecond().equals(999)) {
                 row.setSubjectSecondName("听从老师安排");
             }
+            if(row.getTeacherRecommandSubjectId() == null){
+            	row.setTeacherRecommandSubjectName("无");
+            }
+            if(row.getSelectionSubjectId() == null){
+            	row.setSelectionSubjectName("无");
+            }else if(row.getSelectionSubjectId().equals(999)){
+            	row.setSelectionSubjectName("听从老师安排");
+            }
             row.setCurrentGrade(row.getCurrentGrade() + row.getCurrentClass());
         }
         OutputStream outputStream = response.getOutputStream();
         try {
             HSSFWorkbook workbook = null;
             if (musicGroup.getCourseViewType().equals(CourseViewTypeEnum.MEMBER_FEE)) {
-                String[] header = {"学员编号", "学员姓名", "性别", "联系电话", "年级班级", "选报声部1", "选报声部2", "是否服从调剂", "乐器准备方式", "练习系统"};
-                String[] body = {"userId", "userName", "gender ? '男' : '女'", "phone", "currentGrade", "subjectFirstName", "subjectSecondName", "isAllowAdjust ? '是' : '否'", "kitPurchaseMethod", "cloudTeacherMethod"};
+                String[] header = {"学员编号", "学员姓名", "性别", "联系电话", "年级班级", "选报声部1", "选报声部2","老师推荐专业","选报专业", "是否服从调剂", "乐器准备方式", "练习系统"};
+                String[] body = {"userId", "userName", "gender ? '男' : '女'", "phone", "currentGrade", "subjectFirstName", "subjectSecondName","teacherRecommandSubjectName","selectionSubjectName", "isAllowAdjust ? '是' : '否'", "kitPurchaseMethod", "cloudTeacherMethod"};
                 workbook = POIUtil.exportExcel(header, body, studentPreRegistration.getRows());
             } else {
-                String[] header = {"学员编号", "学员姓名", "性别", "联系电话", "年级班级", "选报声部1", "选报声部2", "是否服从调剂", "乐器准备方式", "练习系统"};
-                String[] body = {"userId", "userName", "gender ? '男' : '女'", "phone", "currentGrade", "subjectFirstName", "subjectSecondName", "isAllowAdjust ? '是' : '否'", "kitPurchaseMethod", "cloudTeacherMethod"};
+                String[] header = {"学员编号", "学员姓名", "性别", "联系电话", "年级班级", "选报声部1", "选报声部2","老师推荐专业","选报专业", "是否服从调剂", "乐器准备方式", "练习系统"};
+                String[] body = {"userId", "userName", "gender ? '男' : '女'", "phone", "currentGrade", "subjectFirstName", "subjectSecondName","teacherRecommandSubjectName","selectionSubjectName", "isAllowAdjust ? '是' : '否'", "kitPurchaseMethod", "cloudTeacherMethod"};
                 workbook = POIUtil.exportExcel(header, body, studentPreRegistration.getRows());
             }