Просмотр исходного кода

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

yonge 4 лет назад
Родитель
Сommit
0d4210e37e
21 измененных файлов с 229 добавлено и 27 удалено
  1. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java
  2. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java
  3. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDetailDao.java
  4. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDao.java
  5. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentCalenderAuditDto.java
  6. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupStudentMapperService.java
  7. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentOrderService.java
  8. 90 11
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupStudentMapperServiceImpl.java
  9. 13 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  10. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SporadicChargeInfoImpl.java
  11. 5 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java
  12. 0 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  13. 16 0
      mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml
  14. 18 0
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  15. 1 1
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml
  16. 3 5
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml
  17. 1 1
      mec-biz/src/main/resources/config/mybatis/SporadicChargeInfo.xml
  18. 4 1
      mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml
  19. 4 0
      mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java
  20. 10 0
      mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupStudentController.java
  21. 13 0
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupSubjectPlanController.java

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java

@@ -14,6 +14,8 @@ import java.util.List;
 import java.util.Map;
 
 public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStudentMapper> {
+
+    int batchUpdate(@Param("classGroupStudentMappers") List<ClassGroupStudentMapper> classGroupStudentMappers);
     /**
      * 批量插入学生
      *

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

@@ -141,6 +141,18 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
     int deleteMusicGroupCourseSchedulesWithStudent(@Param("courseScheduleIds") List<Long> courseScheduleIds,
                                                    @Param("userId") Integer userId);
 
+    int deleteMusicGroupCourseSchedulesWithStudents(@Param("courseScheduleIds") List<Long> courseScheduleIds,
+                                                   @Param("userIds") List<Integer> userIds);
+
+    /**
+     * @describe 获取班级上未开始的课程
+     * @author Joburgess
+     * @date 2020.11.05
+     * @param classGroupId:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
+     */
+    List<CourseSchedule> getClassGroupNotStartCourse(@Param("classGroupId") Long classGroupId);
+
     /**
      * @param teacherId: 教师编号
      * @param classDate: 上课日期

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

@@ -35,10 +35,10 @@ public interface MusicGroupPaymentCalenderDetailDao extends BaseDAO<Long, MusicG
 
 	/**
 	 * 根据指定的日历编号查询
-	 * @param musicGroupPaymentCalenderId
+	 * @param calenderId
 	 * @return
 	 */
-	List<MusicGroupPaymentCalenderDetail> queryByCalenderId(@Param("musicGroupPaymentCalenderId") Long musicGroupPaymentCalenderId, @Param("paymentStatus") String paymentStatus);
+	List<MusicGroupPaymentCalenderDetail> queryByCalenderId(@Param("calenderId") Long calenderId, @Param("paymentStatus") String paymentStatus);
 
 	/**
 	 * 根据声部获取乐团下完成缴费的学员

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDao.java

@@ -337,8 +337,19 @@ public interface StudentPaymentOrderDao extends BaseDAO<Long, StudentPaymentOrde
 
     /**
      * 根据ids获取商品
+     *
      * @param ids
      * @return
      */
     List<UserGoodsDto> getUserGoods(@Param("ids") String ids);
+
+
+    /**
+     * 获取用户某种类型的订单
+     * @param userId
+     * @param type
+     * @param status
+     * @return
+     */
+    List<StudentPaymentOrder> getUserOrderByType(@Param("userId") Integer userId, @Param("type") OrderTypeEnum type, @Param("status") DealStatusEnum status);
 }

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

@@ -37,6 +37,8 @@ public class MusicGroupPaymentCalenderAuditDto {
     @ApiModelProperty(value = "原价",required = false)
     private BigDecimal courseOriginalPrice;
 
+    private BigDecimal paymentAmount;
+
     @ApiModelProperty(value = "申请价格",required = false)
     private BigDecimal courseCurrentPrice;
 
@@ -73,6 +75,14 @@ public class MusicGroupPaymentCalenderAuditDto {
     @ApiModelProperty(value = "缴费截止日期",required = false)
     private String deadlinePaymentDate;
 
+    public BigDecimal getPaymentAmount() {
+        return paymentAmount;
+    }
+
+    public void setPaymentAmount(BigDecimal paymentAmount) {
+        this.paymentAmount = paymentAmount;
+    }
+
     public String getAuditMemo() {
         return auditMemo;
     }

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

@@ -10,6 +10,7 @@ import com.ym.mec.common.service.BaseService;
 
 import java.io.IOException;
 import java.util.List;
+import java.util.Set;
 
 public interface ClassGroupStudentMapperService extends BaseService<Long, ClassGroupStudentMapper> {
 
@@ -86,6 +87,6 @@ public interface ClassGroupStudentMapperService extends BaseService<Long, ClassG
      * @param studentIds:
      * @return void
      */
-    void updateClassGroupStudents(Long classGroupId, String studentIds);
+    void updateClassGroupStudents(Long classGroupId, Set<Integer> studentIds);
 
 }

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentOrderService.java

@@ -122,4 +122,13 @@ public interface StudentPaymentOrderService extends BaseService<Long, StudentPay
 	 */
 	Integer findOrganPayOrderNum(Integer organId);
 
+	/**
+	 * 获取用户某种类型的订单
+	 * @param userId
+	 * @param type
+	 * @param status
+	 * @return
+	 */
+	List<StudentPaymentOrder> getUserOrderByType(Integer userId, OrderTypeEnum type, DealStatusEnum status);
+
 }

+ 90 - 11
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupStudentMapperServiceImpl.java

@@ -2,15 +2,11 @@ package com.ym.mec.biz.service.impl;
 
 import java.io.IOException;
 import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
+import com.ym.mec.biz.dal.dao.CourseScheduleDao;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -49,6 +45,7 @@ import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.im.ImFeignService;
 import com.ym.mec.util.http.HttpUtil;
+import org.springframework.util.CollectionUtils;
 
 @Service
 public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, ClassGroupStudentMapper> implements ClassGroupStudentMapperService {
@@ -78,6 +75,8 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
     private TeacherDefaultMusicGroupSalaryService teacherDefaultMusicGroupSalaryService;
     @Autowired
     private StudentDao studentDao;
+    @Autowired
+    private CourseScheduleDao courseScheduleDao;
 
     private static String holidayUrl = "http://tool.bitefu.net/jiari/?d=";
 
@@ -357,11 +356,91 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
     }
 
     @Override
-    public void updateClassGroupStudents(Long classGroupId, String studentIds) {
+    public void updateClassGroupStudents(Long classGroupId, Set<Integer> studentIds) {
+        ClassGroup classGroup = classGroupService.get(classGroupId.intValue());
+        if(Objects.isNull(classGroup)){
+            throw new BizException("班级信息错误");
+        }
         List<ClassGroupStudentMapper> classGroupStudents = classGroupStudentMapperDao.findAllByClassGroup(classGroupId);
 
-        List<Integer> allStudentIds = new ArrayList<>();
-        List<Integer> addStudentIds = new ArrayList<>();
-        List<Integer> removeStudentIds = new ArrayList<>();
+        Set<Integer> allStudentIds = new HashSet<>();
+        Set<Integer> oldStudentIds = new HashSet<>();
+        Set<Integer> oldNormalStudentIds = new HashSet<>();
+        Set<Integer> addStudentIds;
+        Set<Integer> removeStudentIds;
+
+        if(!CollectionUtils.isEmpty(studentIds)){
+            allStudentIds = studentIds;
+        }
+
+        if(!CollectionUtils.isEmpty(classGroupStudents)){
+            oldStudentIds = classGroupStudents.stream().map(ClassGroupStudentMapper::getUserId).collect(Collectors.toSet());
+            oldNormalStudentIds = classGroupStudents.stream().filter(s -> ClassGroupStudentStatusEnum.NORMAL.equals(s.getStatus())).map(ClassGroupStudentMapper::getUserId).collect(Collectors.toSet());
+        }
+
+        Set<Integer> repeatStudentIds = allStudentIds.stream().filter(oldNormalStudentIds::contains).collect(Collectors.toSet());
+        addStudentIds = allStudentIds.stream().filter(id -> !repeatStudentIds.contains(id)).collect(Collectors.toSet());
+        removeStudentIds = oldNormalStudentIds.stream().filter(id -> !repeatStudentIds.contains(id)).collect(Collectors.toSet());
+
+        for (ClassGroupStudentMapper classGroupStudent : classGroupStudents) {
+            if(addStudentIds.contains(classGroupStudent.getUserId())){
+                classGroupStudent.setStatus(ClassGroupStudentStatusEnum.NORMAL);
+            }else if(removeStudentIds.contains(classGroupStudent.getUserId())){
+                classGroupStudent.setStatus(ClassGroupStudentStatusEnum.QUIT);
+            }
+        }
+
+        classGroupStudentMapperDao.batchUpdate(classGroupStudents);
+
+        Date now = new Date();
+        List<ClassGroupStudentMapper> classGroupStudentMappers = new ArrayList<>();
+        for (Integer addStudentId : addStudentIds) {
+            if(oldStudentIds.contains(addStudentId)){
+                continue;
+            }
+            ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
+            classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
+            classGroupStudentMapper.setClassGroupId(classGroupId.intValue());
+            classGroupStudentMapper.setUserId(addStudentId);
+            classGroupStudentMapper.setCreateTime(now);
+            classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
+            classGroupStudentMapper.setGroupType(GroupType.MUSIC);
+            classGroupStudentMappers.add(classGroupStudentMapper);
+        }
+
+        if (classGroupStudentMappers.size() > 0) {
+            classGroupStudentMapperDao.classGroupStudentsInsert(classGroupStudentMappers);
+        }
+
+        classGroupService.updateClassStudentNum(classGroupId.intValue(), allStudentIds.size());
+
+        List<CourseSchedule> classGroupNotStartCourse = courseScheduleDao.getClassGroupNotStartCourse(classGroupId);
+        if(CollectionUtils.isEmpty(classGroupNotStartCourse)){
+            return;
+        }
+
+        List<Long> courseIds = classGroupNotStartCourse.stream().map(CourseSchedule::getId).collect(Collectors.toList());
+
+        if(!CollectionUtils.isEmpty(removeStudentIds)){
+            courseScheduleDao.deleteMusicGroupCourseSchedulesWithStudents(courseIds, new ArrayList<>(removeStudentIds));
+            List<ImGroupMember> imGroupMemberList = new ArrayList<>();
+            for (Integer addStudentId : addStudentIds) {
+                imGroupMemberList.add(new ImGroupMember(addStudentId.toString()));
+            }
+            //5、学生退出班级群组
+            ImGroupMember[] imGroupMembers = imGroupMemberList.toArray(new ImGroupMember[imGroupMemberList.size()]);
+            imFeignService.groupQuit(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName()));
+        }
+
+        if(!CollectionUtils.isEmpty(addStudentIds)){
+            courseScheduleStudentPaymentService.createForMusicGroup(classGroup.getMusicGroupId(), classGroupNotStartCourse, new ArrayList<>(addStudentIds));
+            List<ImGroupMember> imGroupMemberList = new ArrayList<>();
+            for (Integer addStudentId : addStudentIds) {
+                imGroupMemberList.add(new ImGroupMember(addStudentId.toString()));
+            }
+            //5、添加进IM群组
+            ImGroupMember[] imGroupMembers = imGroupMemberList.toArray(new ImGroupMember[imGroupMemberList.size()]);
+            imFeignService.groupJoin(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName()));
+        }
     }
 }

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

@@ -305,6 +305,19 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             throw new BizException("订单金额异常");
         }
         if (chargeInfo.getMaxAmount() != null) {
+            if(sporadicPayDto.getIsRepeatPay()){
+                List<StudentPaymentOrder> orders = studentPaymentOrderService.getUserOrderByType(sporadicPayDto.getUserId(), OrderTypeEnum.DOUBLE_ELEVEN2020, DealStatusEnum.ING);
+                for (StudentPaymentOrder order : orders) {
+                    Map<String, String> notifyMap = new HashMap<>();
+                    notifyMap.put("tradeState", "0");
+                    notifyMap.put("merOrderNo", order.getOrderNo());
+                    notifyMap.put("channelType", order.getPaymentBusinessChannel());
+                    notifyMap.put("orderNo", "");
+                    notifyMap.put("remarks", "用户主动关闭");
+                    studentPaymentOrderService.updateOrder(notifyMap);
+                }
+            }
+
             if (chargeInfo.getOpenMaxTerm().equals(YesOrNoEnum.YES) && chargeInfo.getMaxAmount().compareTo(chargeInfo.getPaidAmount().add(amount)) < 0) {
                 throw new Exception("活动人数暂时已满,请稍后再试");
             }
@@ -1724,7 +1737,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 studentPaymentOrder.setActualAmount(BigDecimal.ZERO);
                 studentPaymentOrder.setBalancePaymentAmount(amount);
                 studentPaymentOrder.setActualAmount(new BigDecimal(0));
-                studentPaymentOrder.setStatus(SUCCESS);
                 studentPaymentOrder.setUpdateTime(date);
                 studentPaymentOrder.setOrganId(organId);
                 studentPaymentOrder.setRoutingOrganId(organId);

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

@@ -71,9 +71,9 @@ public class SporadicChargeInfoImpl extends BaseServiceImpl<Integer, SporadicCha
         SysUser sysUser = sysUserFeignService.queryUserById(userId);
         SporadicChargeInfo info = sporadicChargeInfoDao.get(Integer.parseInt(studentPaymentOrder.getMusicGroupId()));
 
-        Map<Integer, String> map = new HashMap();
+        Map<Integer, String> map = new HashMap<>();
         map.put(userId, sysUser.getPhone());
-        Map<Integer, String> yimei = new HashMap();
+        Map<Integer, String> yimei = new HashMap<>();
         map.put(userId, userId.toString());
         if (studentPaymentOrder.getStatus() == DealStatusEnum.SUCCESS) {
             try {
@@ -86,7 +86,7 @@ public class SporadicChargeInfoImpl extends BaseServiceImpl<Integer, SporadicCha
             if (info.getChargeType().getCode() == 6 || info.getChargeType().getCode() == 12) {
                 //第二单起每买一单增加一次抽奖机会
                 int times = studentPaymentOrderDao.getUserOrderNumByType(userId, OrderTypeEnum.DOUBLE_ELEVEN2020);
-                Integer num = studentPaymentOrder.getClassGroupId() == null ? 1 : studentPaymentOrder.getClassGroupId();
+                int num = studentPaymentOrder.getClassGroupId() == null ? 1 : studentPaymentOrder.getClassGroupId();
                 if (times <= 1) {
                     num--;
                 }

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -409,4 +409,9 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
     public Integer findOrganPayOrderNum(Integer organId) {
         return studentPaymentOrderDao.findOrganPayOrderNum(organId);
     }
+
+    @Override
+    public List<StudentPaymentOrder> getUserOrderByType(Integer userId, OrderTypeEnum type, DealStatusEnum status) {
+       return studentPaymentOrderDao.getUserOrderByType(userId,type,status);
+    }
 }

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

@@ -908,7 +908,6 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 musicGroupStudentFee.setRemainNetworkClassTimes(0);
                 musicGroupStudentFee.setLatestPaidTime(nowDate);
                 musicGroupStudentFee.setPaymentStatus(MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED);
-                musicGroupStudentFee.setTemporaryCourseFee(BigDecimal.ZERO);
                 musicGroupStudentFee.setUpdateTime(nowDate);
                 musicGroupStudentFee.setContinuousAbsenteeismTimes(0);
                 musicGroupStudentFee.setSubjectId(studentRegistration.getActualSubjectId());

+ 16 - 0
mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml

@@ -61,6 +61,22 @@
         WHERE id_ = #{id}
     </update>
 
+    <update id="batchUpdate" parameterType="com.ym.mec.biz.dal.entity.ClassGroupStudentMapper">
+        <foreach collection="classGroupStudentMappers" item="classGroupStudentMapper" separator=";">
+            UPDATE class_group_student_mapper
+            <set>
+                <if test="classGroupStudentMapper.status != null">
+                    status_ = #{classGroupStudentMapper.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+                </if>
+                <if test="classGroupStudentMapper.groupType != null">
+                    group_type_ = #{classGroupStudentMapper.groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+                </if>
+                update_time_ = now(),
+            </set>
+            WHERE id_ = #{classGroupStudentMapper.id}
+        </foreach>
+    </update>
+
     <!-- 根据主键删除一条记录 -->
     <delete id="delete">
 		DELETE FROM class_group_student_mapper WHERE id_ = #{id} 

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

@@ -2006,6 +2006,24 @@
         </foreach>
     </delete>
 
+    <delete id="deleteMusicGroupCourseSchedulesWithStudents">
+        DELETE
+        FROM
+        course_schedule_student_payment
+        WHERE user_id_ IN
+        <foreach collection="userIds" item="userId" open="(" close=")" separator=",">
+            #{userId}
+        </foreach>
+        AND course_schedule_id_ IN
+        <foreach collection="courseScheduleIds" item="courseScheduleId" open="(" close=")" separator=",">
+            #{courseScheduleId}
+        </foreach>
+    </delete>
+
+    <select id="getClassGroupNotStartCourse" resultMap="CourseSchedule">
+        SELECT * FROM course_schedule WHERE class_group_id_=#{classGroupId} AND CONCAT(class_date_,' ', start_class_time_) &gt; NOW()
+    </select>
+
     <delete id="deleteCourseSchedulesByClassGroupIds">
         DELETE FROM course_schedule WHERE id_ IN
         <foreach collection="courseScheduleIds" item="courseScheduleId" open="(" close=")" separator=",">

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

@@ -253,7 +253,7 @@
 	<select id="queryByCalenderId" resultMap="MusicGroupPaymentCalenderDetail">
 		SELECT * FROM music_group_payment_calender_detail WHERE music_group_payment_calender_id_ = #{calenderId}
 		<if test="paymentStatus != null">
-			AND psyment_status_ = #{paymentStatus}
+			AND payment_status_ = #{paymentStatus}
 		</if>
 	</select>
     <select id="findMusicGroupStudentWithSubject" resultType="com.ym.mec.biz.dal.dto.SimpleUserDto">

+ 3 - 5
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml

@@ -144,9 +144,6 @@
 	    <foreach collection="list" item="item" index="index" open="" close="" separator=";">
 	        UPDATE music_group_payment_calender
 	        <set>
-                <if test="item.auditMemo != null and item.auditMemo != ''">
-                    audit_memo_ = #{auditMemo},
-                </if>
                 <if test="item.paymentPattern != null">
                     payment_pattern_ = #{item.paymentPattern},
                 </if>
@@ -317,7 +314,7 @@
     </select>
     <select id="queryEndIds" resultType="java.lang.Long">
         SELECT DISTINCT mgpc.id_ FROM music_group_payment_calender mgpc
-        WHERE mgpc.payment_valid_end_date_ IS NOT NULL AND DATEDIFF(mgpc.payment_valid_end_date_,#{format}) = #{configValue};
+        WHERE mgpc.payment_valid_end_date_ IS NOT NULL AND DATEDIFF(mgpc.payment_valid_end_date_,#{format}) = #{configValue} AND mgpc.payment_type_ IN ('MUSIC_APPLY','MUSIC_RENEW')
     </select>
     <resultMap id="CalenderPushDto" type="com.ym.mec.biz.dal.dto.CalenderPushDto">
         <result property="paymentValidEndDate" column="payment_valid_end_date_"/>
@@ -398,6 +395,7 @@
         <result property="startPaymentDate" column="start_payment_date_"/>
         <result property="deadlinePaymentDate" column="deadline_payment_date_"/>
         <result property="auditMemo" column="audit_memo_"/>
+        <result property="paymentAmount" column="payment_amount_"/>
     </resultMap>
     <sql id="MusicGroupPaymentCalenderAuditDtoSql">
         <where>
@@ -450,7 +448,7 @@
         mgpc.pay_user_type_,mgpc.memo_,mgpc.status_,SUM(mgpccs.course_total_minuties_) course_total_minuties_,
         SUM(mgpccs.course_original_price_) course_original_price_,SUM(mgpccs.course_current_price_) course_current_price_,
         MAX(mg.name_) music_group_name_,MAX(mg.organ_id_) organ_id_,MAX(mgpccs.name_) calender_settings_name_,mgpc.payment_pattern_,mgpc.payment_valid_start_date_,
-        mgpc.payment_valid_end_date_,mgpc.start_payment_date_,mgpc.deadline_payment_date_,mgpc.audit_memo_
+        mgpc.payment_valid_end_date_,mgpc.start_payment_date_,mgpc.deadline_payment_date_,mgpc.audit_memo_,mgpc.payment_amount_
         FROM music_group_payment_calender mgpc
         LEFT JOIN music_group mg ON mg.id_ = mgpc.music_group_id_
         LEFT JOIN music_group_payment_calender_course_settings mgpccs ON mgpc.id_ = mgpccs.music_group_payment_calender_id_

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

@@ -48,7 +48,7 @@
          user_id_, music_group_id_, max_num_,max_amount_,open_max_term_)
         VALUES (#{title}, #{chargeType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
                 #{organId}, #{amount}, #{discountAmount}, #{detail}, now(), now(), #{operatorId}, #{userId},
-                #{musicGroupId}, #{maxNum},#{maxAmount},#{openMaxTerm})
+                #{musicGroupId}, #{maxNum},#{maxAmount},#{openMaxTerm,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
     </insert>
 
     <!-- 根据主键查询一条记录 -->

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

@@ -731,7 +731,7 @@
 
     <select id="doubleEleven2020Statis" resultMap="luckStatis">
         SELECT o.id_ organId, o.name_ organName, SUM(spo.actual_amount_) money, COUNT(DISTINCT spo.user_id_) nums,
-        COUNT(spo.id_) times FROM student_payment_order spo
+        SUM(IF(spo.class_group_id_ is null ,1,spo.class_group_id_)) times FROM student_payment_order spo
         LEFT JOIN organization o ON o.id_ = spo.organ_id_
         WHERE spo.type_ = 'DOUBLE_ELEVEN2020'
         AND spo.status_ = 'SUCCESS'
@@ -749,4 +749,7 @@
           AND status_ = 'SUCCESS'
           AND type_ = #{orderType}
     </select>
+    <select id="getUserOrderByType" resultMap="StudentPaymentOrder">
+        SELECT * FROM student_payment_order WHERE user_id_=#{userId} AND type_=#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} AND status_=#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+    </select>
 </mapper>

+ 4 - 0
mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java

@@ -12,6 +12,7 @@ import java.util.List;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -239,6 +240,9 @@ public class ClassGroupController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('classGroup/revisionAddClassGroup')")
     @ApiImplicitParams({@ApiImplicitParam(name = "ClassGroup4MixDto", value = "添加班级结构", required = true, dataType = "String")})
     public HttpResponseResult revisionAddClassGroup(@RequestBody List<ClassGroup4MixDto> classGroup4MixDtos) throws Exception {
+        if(CollectionUtils.isEmpty(classGroup4MixDtos)){
+            return failed("请填写班级信息");
+        }
         return succeed(classGroupService.classGroupAdjust(classGroup4MixDtos));
     }
 

+ 10 - 0
mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupStudentController.java

@@ -9,6 +9,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 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.GetMapping;
@@ -17,7 +18,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashSet;
 import java.util.Objects;
+import java.util.Set;
+import java.util.stream.Collectors;
 
 @RequestMapping("classGroupStudent")
 @Api(tags = "班级学生服务")
@@ -88,6 +93,11 @@ public class ClassGroupStudentController extends BaseController {
         if(Objects.isNull(classGroupId)){
             return failed("请指定班级");
         }
+        Set<Integer> studentIdSet = new HashSet<>();
+        if(StringUtils.isNotBlank(studentIds)){
+            studentIdSet = Arrays.stream(studentIds.split(",")).map(Integer::valueOf).collect(Collectors.toSet());
+        }
+        classGroupStudentMapperService.updateClassGroupStudents(classGroupId, studentIdSet);
         return succeed();
     }
 }

+ 13 - 0
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupSubjectPlanController.java

@@ -1,6 +1,7 @@
 package com.ym.mec.web.controller;
 
 import com.ym.mec.biz.dal.dto.MusicGroupGoodsAndDiscountDto;
+import com.ym.mec.biz.dal.dto.MusicGroupSubjectGoodsAndInfoDto;
 import com.ym.mec.biz.dal.entity.ChargeTypeSubjectMapper;
 import com.ym.mec.biz.dal.entity.Goods;
 import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
@@ -85,4 +86,16 @@ public class MusicGroupSubjectPlanController extends BaseController {
         return succeed(result);
     }
 
+    @ApiOperation(value = "获取乐团声部费用信息及乐器和辅件")
+    @GetMapping("/getSubjectGoodsAndInfo")
+    @PreAuthorize("@pcs.hasPermissions('musicGroupSubjectPlan/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)) {
+            return failed("参数校验异常");
+        }
+        return succeed(musicGroupSubjectPlanService.getSubjectGoodsAndInfo(musicGroupId, subjectId));
+    }
+
 }