瀏覽代碼

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

zouxuan 5 年之前
父節點
當前提交
663d76df2d

+ 14 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupDao.java

@@ -280,4 +280,18 @@ public interface VipGroupDao extends BaseDAO<Long, VipGroup> {
 	 * @return
 	 */
 	int countStudentVipGroups(Map<String, Object> params);
+	
+	/**
+	 * 根编号列表查询对象
+	 * @param idList
+	 * @return
+	 */
+	List<VipGroup> queryByIds(String idList);
+
+	/**
+	 * 批量更新
+	 * @param vipGroupList
+	 * @return
+	 */
+	int batchUpdate(List<VipGroup> vipGroupList);
 }

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

@@ -66,6 +66,7 @@ public class ClassGroupTeacherMapperServiceImpl extends BaseServiceImpl<Long, Cl
         List<ClassGroupTeacherMapper> oldClassGroupTeacherMapper = classGroupTeacherMapperDao.getClassGroupTeacherMapper(classGroupTeacherMapperList);
 
         for (ClassGroup classGroup : classGroups) {
+            imGroupMemberList.clear();
             //原设置的老师删除群组
             for (ClassGroupTeacherMapper classGroupTeacherMapper : oldClassGroupTeacherMapper) {
                 if (!classGroup.getId().equals(classGroupTeacherMapper.getClassGroupId())) continue;

+ 27 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ContractServiceImpl.java

@@ -19,9 +19,11 @@ import org.springframework.stereotype.Service;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
+import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
 import com.ym.mec.biz.dal.dto.StudentInfo;
 import com.ym.mec.biz.dal.entity.Goods;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
+import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
 import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.entity.Subject;
@@ -69,6 +71,9 @@ public class ContractServiceImpl implements ContractService {
 
 	@Autowired
 	private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
+	
+	@Autowired
+	private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
 
 	@Autowired
 	private MusicGroupSubjectGoodsGroupService musicGroupSubjectGoodsGroupService;
@@ -250,12 +255,18 @@ public class ContractServiceImpl implements ContractService {
 		if (studentRegistration == null) {
 			throw new BizException("用户 报名信息不存在");
 		}
-		MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(musicGroupId,
-				studentRegistration.getActualSubjectId());
-		if (musicGroupSubjectPlan == null) {
-			throw new BizException("声部课程费用设置找不到");
+		MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(userId, musicGroupId);
+		if (musicGroupStudentFee == null) {
+			MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(musicGroupId,
+					studentRegistration.getActualSubjectId());
+			if (musicGroupSubjectPlan == null) {
+				throw new BizException("声部课程费用设置找不到");
+			}
+			params.put("courseFee", musicGroupSubjectPlan.getFee().doubleValue());
+		} else {
+			params.put("courseFee", musicGroupStudentFee.getTemporaryCourseFee().doubleValue() > 0 ? musicGroupStudentFee.getTemporaryCourseFee().doubleValue()
+					: musicGroupStudentFee.getCourseFee().doubleValue());
 		}
-		params.put("courseFee", musicGroupSubjectPlan.getFee().doubleValue());
 
 		// 收费形式
 		List<MusicGroupPaymentCalender> calenders = musicGroupPaymentCalenderDao.findByMusicGroupId(musicGroupId);
@@ -327,12 +338,18 @@ public class ContractServiceImpl implements ContractService {
 		if (studentRegistration == null) {
 			throw new BizException("用户 报名信息不存在");
 		}
-		MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(musicGroupId,
-				studentRegistration.getActualSubjectId());
-		if (musicGroupSubjectPlan == null) {
-			throw new BizException("声部课程费用设置找不到");
+		MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(userId, musicGroupId);
+		if (musicGroupStudentFee == null) {
+			MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(musicGroupId,
+					studentRegistration.getActualSubjectId());
+			if (musicGroupSubjectPlan == null) {
+				throw new BizException("声部课程费用设置找不到");
+			}
+			params.put("courseFee", musicGroupSubjectPlan.getFee().doubleValue());
+		} else {
+			params.put("courseFee", musicGroupStudentFee.getTemporaryCourseFee().doubleValue() > 0 ? musicGroupStudentFee.getTemporaryCourseFee().doubleValue()
+					: musicGroupStudentFee.getCourseFee().doubleValue());
 		}
-		params.put("courseFee", musicGroupSubjectPlan.getFee().doubleValue());
 
 		// 收费形式
 		List<MusicGroupPaymentCalender> calenders = musicGroupPaymentCalenderDao.findByMusicGroupId(musicGroupId);

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

@@ -978,6 +978,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class)
 	public boolean updateCourseScheduleToOverStatus() {
 
 		Date date = new Date();
@@ -985,6 +986,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		List<StudentAttendance> studentAttendanceList = courseScheduleDao.queryUnsignedStudentList();
 		for (StudentAttendance studentAttendance : studentAttendanceList) {
 			studentAttendance.setStatus(StudentAttendanceStatusEnum.TRUANT);
+			studentAttendance.setCurrentClassTimes(studentAttendance.getCurrentClassTimes() + 1);
 			studentAttendance.setCreateTime(date);
 		}
 
@@ -996,7 +998,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		List<CourseSchedule> list = courseScheduleDao.queryFinishedWithNoUpdateStatus();
 
 		List<CourseSchedule> updateList = new ArrayList<CourseSchedule>();
-		List<Integer> classGroups = new ArrayList<Integer>();
+		List<Integer> classGroupIds = new ArrayList<Integer>();
 		List<Long> courseScheduleIdList = new ArrayList<Long>();
 		
 		for (CourseSchedule courseSchedule : list) {
@@ -1004,8 +1006,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			courseSchedule.setUpdateTime(date);
 			updateList.add(courseSchedule);
 
-			if (!classGroups.contains(courseSchedule.getClassGroupId())) {
-				classGroups.add(courseSchedule.getClassGroupId());
+			if (!classGroupIds.contains(courseSchedule.getClassGroupId())) {
+				classGroupIds.add(courseSchedule.getClassGroupId());
 			}
 			
 			if(courseSchedule.getGroupType() == GroupType.VIP){
@@ -1018,9 +1020,28 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		}
 
 		// 更新班级已上课次
-		if (classGroups.size() > 0) {
-			classGroupService.batchIncreaseClassTimes(classGroups);
+		if (classGroupIds.size() > 0) {
+			classGroupService.batchIncreaseClassTimes(classGroupIds);
+			
+			//查询班级信息
+			List<ClassGroup> classGroupList = classGroupService.findClassGroupByIds(classGroupIds.stream().map(e->e.toString()).collect(Collectors.joining(",")));
 			
+			List<String> vipGroupIdList = new ArrayList<String>();
+			for(ClassGroup classGroup : classGroupList){
+				if(classGroup.getGroupType() == GroupType.VIP && classGroup.getCurrentClassTimes() == classGroup.getTotalClassTimes().intValue()){
+					if(!vipGroupIdList.contains(classGroup.getMusicGroupId())){
+						vipGroupIdList.add(classGroup.getMusicGroupId());
+					}
+				}
+			}
+			if(vipGroupIdList.size() > 0){
+				List<VipGroup> vipGroupList = vipGroupDao.queryByIds(vipGroupIdList.stream().collect(Collectors.joining(",")));
+				for(VipGroup vipGroup : vipGroupList){
+					vipGroup.setStatus(VipGroupStatusEnum.FINISHED);
+					vipGroup.setUpdateTime(date);
+				}
+				vipGroupDao.batchUpdate(vipGroupList);
+			}
 		}
 		
 		if (courseScheduleIdList.size() > 0) {

+ 7 - 4
mec-biz/src/main/resources/config/contracts/courses.ftl

@@ -80,7 +80,7 @@
         <div style="display: flex;">乙方:
             <div style="flex: 1 auto;">
                 <div class="iInfo">
-                    <span>家长姓名 ${studentInfo.parentsName!}</span>
+                    <span>家长姓名 ${studentInfo.parentsName!}</span>
                     <span>电话: ${studentInfo.phone!}</span>
                 </div>
                 <div class="iInfo">
@@ -106,7 +106,7 @@
         
         <div class="iInfoContent">
             <span>授课类别:${classesType}</span>
-            <span>课程费用:${courseFee?string("0.00")}</span>
+            <span>课程费用:${courseFee?string("0.00")}</span>
             <span>收费形式:${paymentcalender}</span>
         </div>
 
@@ -160,14 +160,17 @@
             <div class="sign">甲方签章:深圳大雅乐盟网络教育股份有限公司<img class="cachet" src="https://daya-online.oss-cn-beijing.aliyuncs.com/website/cachet.png" alt="" />
                 <span>日期:${.now?string("yyyy年MM月dd日")}</span>
             </div>
+            <div class="sign">乙方签字:${studentInfo.parentsName!}
+                <span>日期:${.now?string("yyyy年MM月dd日")} </span>
+            </div>
         	<#else>
             <div class="sign">甲方签章:深圳大雅乐盟网络教育股份有限公司
                 <span>日期:${.now?string("yyyy年MM月dd日")}</span>
             </div>
-        	</#if>
-            <div class="sign">乙方签字:${studentInfo.realName!}
+            <div class="sign">乙方签字:
                 <span>日期:${.now?string("yyyy年MM月dd日")} </span>
             </div>
+        	</#if>
         </div>
     </div>
 </body>

+ 7 - 4
mec-biz/src/main/resources/config/contracts/goods.ftl

@@ -79,7 +79,7 @@
         <div style="display: flex;">乙方:
             <div style="flex: 1 auto;">
                 <div class="iInfo">
-                    <span>家长姓名 ${studentInfo.parentsName!}</span>
+                    <span>家长姓名 ${studentInfo.parentsName!}</span>
                     <span>电话: ${studentInfo.phone!}</span>
                 </div>
                 <div class="iInfo">
@@ -113,7 +113,7 @@
         </div>
         <div class="iInfo">
             <span>型号:${goodsList[0].specification}</span>
-            <span>团购价格:${goodsList[0].groupPurchasePrice?string("0.00")}</span>
+            <span>团购价格:${goodsList[0].groupPurchasePrice?string("0.00")}</span>
         </div>
 
         <h2>四、违约责任</h2>  
@@ -139,14 +139,17 @@
             <div class="sign">甲方签章:深圳大雅乐盟网络教育股份有限公司<img class="cachet" src="https://daya-online.oss-cn-beijing.aliyuncs.com/website/cachet.png" alt="" />
                 <span>日期:${.now?string("yyyy年MM月dd日")}</span>
             </div>
+            <div class="sign">乙方签字:${studentInfo.parentsName!}
+                <span>日期:${.now?string("yyyy年MM月dd日")} </span>
+            </div>
         	<#else>
             <div class="sign">甲方签章:深圳大雅乐盟网络教育股份有限公司
                 <span>日期:${.now?string("yyyy年MM月dd日")}</span>
             </div>
-            </#if>
-            <div class="sign">乙方签字:${studentInfo.realName!}
+            <div class="sign">乙方签字:
                 <span>日期:${.now?string("yyyy年MM月dd日")} </span>
             </div>
+            </#if>
         </div>
     </div>
 </body>

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

@@ -100,7 +100,7 @@
         (id_,group_type_,music_group_id_,class_group_id_,teacher_role_,user_id_,salary_,create_time_,update_time_)
         VALUE
         <foreach collection="classGroupTeacherMapperList" item="item" index="index" separator=",">
-            (#{item.id},#{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.musicGroupId},#{item.classGroupId},#{item.teacherRole},#{item.userId},#{item.salary},NOW(),NOW())
+            (#{item.id},#{item.groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.musicGroupId},#{item.classGroupId},#{item.teacherRole},#{item.userId},#{item.salary},NOW(),NOW())
         </foreach>
     </insert>
 

+ 79 - 0
mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml

@@ -755,4 +755,83 @@
             LEFT JOIN course_schedule_student_payment cssp ON cs.id_=cssp.user_id_
             WHERE cssp.settlement_time_ IS NOT NULL AND cs.class_group_id_=#{classGroupId}
     </select>
+    
+    <select id="queryByIds" resultMap="VipGroup" parameterType="string">
+    	select * from vip_group where id_ in (#{idList})
+    </select>
+    
+    <update id="batchUpdate" parameterType="java.util.List">
+    	<foreach collection="list" item="item" index="index" open="" close="" separator=";">
+	        UPDATE vip_group
+	        <set>
+	            <if test="item.paymentExpireDate != null">
+	                payment_expire_date_ = #{item.paymentExpireDate},
+	            </if>
+	            <if test="item.userId != null">
+	                user_id_ = #{item.userId},
+	            </if>
+	            <if test="item.offlineClassesNum != null">
+	                offline_classes_num_ = #{item.offlineClassesNum},
+	            </if>
+	            <if test="item.onlineClassesNum != null">
+	                online_classes_num_ = #{item.onlineClassesNum},
+	            </if>
+	            <if test="item.updateTime != null">
+	                update_time_ = NOW(),
+	            </if>
+	            <if test="item.singleClassMinutes != null">
+	                single_class_minutes_ = #{item.singleClassMinutes},
+	            </if>
+	            <if test="item.teacherSchoolId != null">
+	                teacher_school_id_ = #{item.teacherSchoolId},
+	            </if>
+	            <if test="item.coursesExpireDate != null">
+	                courses_expire_date_ = #{item.coursesExpireDate},
+	            </if>
+	            <if test="item.registrationStartTime != null">
+	                registration_start_time_ = #{item.registrationStartTime},
+	            </if>
+	            <if test="item.organIdList!=null">
+	                organ_id_list_=#{item.organIdList},
+	            </if>
+	            <if test="item.auditStatus != null">
+	                audit_status_ = #{item.auditStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+	            </if>
+	            <if test="item.organIdList != null">
+	                organ_id_list_ = #{item.organIdList},
+	            </if>
+	            <if test="item.vipGroupActivityId != null">
+	                vip_group_activity_id_ = #{item.vipGroupActivityId},
+	            </if>
+	            <if test="item.status != null">
+	                status_ = #{item.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+	            </if>
+	            <if test="item.onlineClassesUnitPrice != null">
+	                online_classes_unit_price_ = #{item.onlineClassesUnitPrice},
+	            </if>
+	            <if test="item.offlineClassesUnitPrice != null">
+	                offline_classes_unit_price_ = #{item.offlineClassesUnitPrice},
+	            </if>
+	            <if test="item.totalPrice != null">
+	                total_price_ = #{item.totalPrice},
+	            </if>
+	            <if test="item.giveTeachMode!=null">
+	                give_teach_mode_=#{item.giveTeachMode},
+	            </if>
+	            <if test="item.organId!=null">
+	                organ_id_=#{item.organId},
+	            </if>
+	            <if test="item.stopReason!=null">
+	                stop_reason_=#{item.stopReason},
+	            </if>
+	            <if test="item.auditStatus!=null">
+	                audit_status_=#{item.auditStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+	            </if>
+	            <if test="item.courseSchedulesJson!=null">
+	                course_schedules_json_=#{item.courseSchedulesJson},
+	            </if>
+	        </set>
+	        WHERE id_ = #{item.id}
+        </foreach>
+    </update>
 </mapper>