Selaa lähdekoodia

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

zouxuan 4 vuotta sitten
vanhempi
commit
25b45a41b8

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleStudentPaymentDao.java

@@ -400,7 +400,8 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
      * @date 2020/12/2 0002
      * @return java.util.List<com.ym.mec.biz.dal.entity.CourseScheduleStudentPaymentDto>
      */
-    List<CourseScheduleStudentPaymentDto> findNeedUpdateActualPriceStudentCourses(@Param("courseIds") List<Long> courseIds);
+    List<CourseScheduleStudentPaymentDto> findNeedUpdateActualPriceStudentCourses(@Param("groupIds") List<String> groupIds,
+                                                                                  @Param("groupType") GroupType groupType);
 
     /**
      * 根据课程编号和,学员编号获取列表信息

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

@@ -202,10 +202,20 @@ public class MusicGroupPaymentCalenderDto {
 
 		private Date deadlinePaymentDate;
 
+		private BigDecimal paymentAmount;
+
 		private Date paymentValidStartDate;
 
 		private Date paymentValidEndDate;
 
+		public BigDecimal getPaymentAmount() {
+			return paymentAmount;
+		}
+
+		public void setPaymentAmount(BigDecimal paymentAmount) {
+			this.paymentAmount = paymentAmount;
+		}
+
 		public java.util.Date getStartPaymentDate() {
 			return startPaymentDate;
 		}

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ClassGroup.java

@@ -51,6 +51,10 @@ public class ClassGroup {
 	@ApiModelProperty(value = "乐团名称", required = true)
 	private String musicGroupName;
 
+	/** 分部 */
+	@ApiModelProperty(value = "分部", required = true)
+	private String organName;
+
 	/** 子班级名称列表 */
 	@ApiModelProperty(value = "子班班级名称")
 	private String classNames;
@@ -96,6 +100,14 @@ public class ClassGroup {
 	
 	private List<CourseSchedule> courseScheduleList = new ArrayList<CourseSchedule>();
 
+	public String getOrganName() {
+		return organName;
+	}
+
+	public void setOrganName(String organName) {
+		this.organName = organName;
+	}
+
 	public String getViewGroupName() {
 		return viewGroupName;
 	}

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/event/listener/CourseEventListener.java

@@ -56,7 +56,7 @@ public class CourseEventListener {
         logger.info("课程状态变更(执行开始):{}", courseStatusChangeEvent.getCourseIds());
 
         try{
-            courseScheduleStudentPaymentService.updateCourseActualPrice(new ArrayList<>(courseStatusChangeEvent.getCourseIds()));
+            courseScheduleStudentPaymentService.updateCourseActualPrice(null, null);
         } finally {
             redisCache.delete(KEY);
         }

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

@@ -125,6 +125,6 @@ public interface CourseScheduleStudentPaymentService extends BaseService<Long, C
 	 * @date 2020/12/2 0002
 	 * @return void
 	 */
-	void updateCourseActualPrice(List<Long> courseIds);
+	void updateCourseActualPrice(List<String> groupIds, GroupType groupType);
 
 }

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

@@ -72,7 +72,6 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.redis.service.RedisCache;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
-import com.ym.mec.im.ImFeignService;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateConvertor;
 import com.ym.mec.util.date.DateUtil;
@@ -140,7 +139,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     private CourseScheduleStudentPaymentService courseScheduleStudentPaymentService;
     @Autowired
     private StudentApplyRefundsDao studentApplyRefundsDao;
-
     @Autowired
     private RedisCache<String, Object> redisCache;
     @Autowired
@@ -2936,6 +2934,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
             Map<Integer, Long> totalNumMap = MapUtil.convertIntegerMap(courseScheduleDao.countTotalNumByClassGroupId(classGroupSet, null));
             Map<Integer, Long> currentNumMap = MapUtil.convertIntegerMap(courseScheduleDao.countExpendNumByClassGroupId(classGroupSet));
+
             for (ClassGroupTeachersDto classGroup : dataList) {
                 List<ClassGroupTeacherMapper> classGroupTeacherMappers = new ArrayList<>();
                 for (ClassGroupTeacherMapper classGroupTeacher : classGroupTeachers) {

+ 3 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleStudentPaymentServiceImpl.java

@@ -691,8 +691,9 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public void updateCourseActualPrice(List<Long> courseIds) {
-		List<CourseScheduleStudentPaymentDto> courseScheduleStudentPayments = courseScheduleStudentPaymentDao.findNeedUpdateActualPriceStudentCourses(courseIds);
+	public void updateCourseActualPrice(List<String> groupIds, GroupType groupType) {
+		studentDao.lockUser(1);
+		List<CourseScheduleStudentPaymentDto> courseScheduleStudentPayments = courseScheduleStudentPaymentDao.findNeedUpdateActualPriceStudentCourses(groupIds, groupType);
 		if(CollectionUtils.isEmpty(courseScheduleStudentPayments)){
 			return;
 		}

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

@@ -600,6 +600,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 					musicGroupPaymentCalenderCourseSettingsList.size());
 
 			BigDecimal totalPaymentAmount = new BigDecimal(0);
+			if(musicGroupPaymentCalenderDto.getPaymentType() == SPAN_GROUP_CLASS_ADJUST){
+				totalPaymentAmount = musicGroupPaymentDateRange.getPaymentAmount();
+			}
 			for (MusicGroupPaymentCalenderCourseSettings pccs : musicGroupPaymentCalenderCourseSettingsList) {
 
 				MusicGroupPaymentCalenderCourseSettings tempPccs = new MusicGroupPaymentCalenderCourseSettings();

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

@@ -1659,6 +1659,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if (musicGroup == null) {
             throw new BizException("乐团不存在");
         }
+        courseScheduleStudentPaymentService.updateCourseActualPrice(Arrays.asList(musicGroupId), GroupType.MUSIC);
 
         if (musicGroup.getStatus() == MusicGroupStatusEnum.CANCELED || musicGroup.getStatus() == MusicGroupStatusEnum.PAUSE) {
             throw new BizException("申请失败,乐团状态[已取消]或[已暂停]");
@@ -1817,7 +1818,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if (musicGroup == null) {
             throw new BizException("乐团不存在");
         }
-
+        courseScheduleStudentPaymentService.updateCourseActualPrice(Arrays.asList(musicGroupId), GroupType.MUSIC);
         if (musicGroup.getStatus() == MusicGroupStatusEnum.CANCELED || musicGroup.getStatus() == MusicGroupStatusEnum.PAUSE) {
             throw new BizException("退团失败,乐团状态[已取消]或[已暂停]");
         }

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

@@ -283,6 +283,7 @@
         <result column="id_" property="id"/>
         <result column="music_group_id_" property="musicGroupId"/>
         <result column="music_group_name_" property="musicGroupName"/>
+        <result column="organName" property="organName"/>
         <result column="subject_id_list_" property="subjectIdList"/>
         <result column="memo_" property="memo"/>
         <result column="name_" property="name"/>
@@ -1423,8 +1424,9 @@
         <include refid="queryClassGroupPageSql"/>
     </select>
     <select id="queryClassGroupPage" resultMap="ClassGroupTeachers">
-        SELECT cg.*,mg.name_ music_group_name_ FROM class_group cg
+        SELECT cg.*,mg.name_ music_group_name_,o.name_ organName FROM class_group cg
         LEFT JOIN music_group mg ON mg.id_ = cg.music_group_id_
+        LEFT JOIN organization o ON o.id_ = mg.organ_id_
         <include refid="queryClassGroupPageSql"/>
         ORDER BY cg.id_ DESC
         <include refid="global.limit"/>

+ 5 - 4
mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml

@@ -634,10 +634,11 @@
 			AND cs.id_ IS NOT NULL
 			AND ((cs.status_ = 'OVER' AND (cssp.actual_price_ IS NULL OR cssp.actual_price_ &lt; cssp.expect_price_))
 			OR ( cs.status_ = 'NOT_START' AND cssp.actual_price_ IS NOT NULL AND cssp.actual_price_ &gt; 0))
-			<if test="courseIds!=null and courseIds.size()>0">
-				AND cs.id_ IN
-				<foreach collection="courseIds" item="courseId" open="(" close=")" separator=",">
-					#{courseId}
+			<if test="groupIds!=null and groupIds.size()>0">
+				AND cs.group_type_ = #{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+				AND cs.music_group_id_ IN
+				<foreach collection="groupIds" item="groupId" open="(" close=")" separator=",">
+					#{groupId}
 				</foreach>
 			</if>
 	</select>