Bladeren bron

Merge remote-tracking branch 'origin/master'

Joe 5 jaren geleden
bovenliggende
commit
dd44a76bdc

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentManageDao.java

@@ -280,4 +280,12 @@ public interface StudentManageDao {
      * @return
      */
     List<Map<Integer,Integer>> querySubjectNames(@Param("userIds") Set<Integer> userIds);
+
+    /**
+     * 乐团修改--学员缴费记录--可新增学员列表
+     * @param musicGroupId
+     * @param musicGroupPaymentCalenderId
+     * @return
+     */
+    List<BasicUserDto> queryCanAddStudent(@Param("musicGroupId") String musicGroupId, @Param("musicGroupPaymentCalenderId") Long musicGroupPaymentCalenderId);
 }

+ 9 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/StudentManageService.java

@@ -4,16 +4,7 @@ import java.util.List;
 import java.util.Map;
 
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dto.ConditionDto;
-import com.ym.mec.biz.dal.dto.MusicGroupStudentSignDto;
-import com.ym.mec.biz.dal.dto.MusicGroupStudentsDto;
-import com.ym.mec.biz.dal.dto.Student4operating;
-import com.ym.mec.biz.dal.dto.StudentManageAccountBaseInfoDto;
-import com.ym.mec.biz.dal.dto.StudentManageBaseInfoOfMusicGroupDto;
-import com.ym.mec.biz.dal.dto.StudentManageListDto;
-import com.ym.mec.biz.dal.dto.StudentManageVipGroupClassDto;
-import com.ym.mec.biz.dal.dto.StudentManageVipGroupDto;
-import com.ym.mec.biz.dal.dto.StudentRegisterPerDto;
+import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.page.MusicGroupStudentQueryInfo;
 import com.ym.mec.biz.dal.page.StudentManageAttendanceQueryInfo;
 import com.ym.mec.biz.dal.page.StudentManageCourseQueryInfo;
@@ -167,4 +158,12 @@ public interface StudentManageService {
      * @return
      */
     PageInfo<Student4operating> getOperatingStudents(StudentOperatingQueryInfo queryInfo);
+
+    /**
+     * 乐团修改--学员缴费记录--可新增学员列表
+     * @param musicGroupId
+     * @param musicGroupPaymentCalenderId
+     * @return
+     */
+    List<BasicUserDto> queryCanAddStudent(String musicGroupId, Long musicGroupPaymentCalenderId);
 }

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

@@ -1541,6 +1541,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if(studentRegistration == null || studentRegistration.getPaymentStatus() != PaymentStatusEnum.YES){
         	throw new BizException("请走报名缴费流程");
         }
+        MusicGroupPaymentCalenderDetail userLastCalenderDetail = musicGroupPaymentCalenderDetailDao.getUserLastCalenderDetail(musicGroupId, userId);
+        if(userLastCalenderDetail == null){
+            throw new BizException("当前续费时间已截止,请联系指导老师");
+        }
         
         //判断是否是续费
 		/*List<StudentPaymentOrder> orderList = studentPaymentOrderDao.queryByCondition(GroupType.MUSIC, musicGroupId, userId, DealStatusEnum.SUCCESS);
@@ -1555,7 +1559,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
         BigDecimal amount = musicGroupStudentFee.getCourseFee();
         if (amount == null || amount.doubleValue() == 0) {
-            amount = musicGroupStudentFee.getCourseFee();
+            amount = userLastCalenderDetail.getExpectAmount();
         }
 
         Date date = new Date();
@@ -1610,11 +1614,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 musicGroupStudentFee.setRemainNetworkClassTimes(getRemainNetworkClassTimes+1);
 //                musicGroupStudentFee.setNextPaymentDate(musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, musicGroupStudentFee.getNextPaymentDate(), musicGroupStudentFee));
                 musicGroupStudentFeeDao.update(musicGroupStudentFee);
-                //更新学生的缴费记录状态
-                MusicGroupPaymentCalenderDetail userLastCalenderDetail = musicGroupPaymentCalenderDetailDao.getUserLastCalenderDetail(musicGroupId, userId);
-                if(userLastCalenderDetail == null){
-                    throw new BizException("学生没有续费中的记录");
-                }
+
                 //更新学生的缴费记录状态
                 userLastCalenderDetail.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
                 userLastCalenderDetail.setActualAmount(userLastCalenderDetail.getExpectAmount());

+ 6 - 11
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java

@@ -7,6 +7,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import com.ym.mec.biz.dal.dto.*;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -26,17 +27,6 @@ import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
 import com.ym.mec.biz.dal.dao.SysUserCashAccountDao;
 import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.dao.VipGroupDao;
-import com.ym.mec.biz.dal.dto.ConditionDto;
-import com.ym.mec.biz.dal.dto.MusicGroupStudentSignDto;
-import com.ym.mec.biz.dal.dto.MusicGroupStudentsDto;
-import com.ym.mec.biz.dal.dto.Student4operating;
-import com.ym.mec.biz.dal.dto.StudentManageAccountBaseInfoDto;
-import com.ym.mec.biz.dal.dto.StudentManageBaseInfoOfMusicGroupDto;
-import com.ym.mec.biz.dal.dto.StudentManageCourseListDto;
-import com.ym.mec.biz.dal.dto.StudentManageListDto;
-import com.ym.mec.biz.dal.dto.StudentManageVipGroupClassDto;
-import com.ym.mec.biz.dal.dto.StudentManageVipGroupDto;
-import com.ym.mec.biz.dal.dto.StudentRegisterPerDto;
 import com.ym.mec.biz.dal.entity.Student;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.entity.SysUserCashAccount;
@@ -505,4 +495,9 @@ public class StudentManageServiceImpl implements StudentManageService {
         pageInfo.setRows(dataList);
         return pageInfo;
     }
+
+    @Override
+    public List<BasicUserDto> queryCanAddStudent(String musicGroupId, Long musicGroupPaymentCalenderId) {
+        return studentManageDao.queryCanAddStudent(musicGroupId,musicGroupPaymentCalenderId);
+    }
 }

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

@@ -235,8 +235,9 @@
 		SELECT mgpcd.*,mgpc.music_group_id_ FROM music_group_payment_calender_detail mgpcd
 		LEFT JOIN music_group_payment_calender mgpc ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
 		LEFT JOIN student_registration sr ON sr.music_group_id_ = mgpc.music_group_id_
-		WHERE mgpcd.payment_status_ = 'NON_PAYMENT' AND mgpcd.open_ = 0 AND sr.music_group_status_ != 'QUIT' AND mgpc.payment_status_ = 'YES'
+		WHERE mgpcd.payment_status_ = 'NON_PAYMENT' AND (mgpcd.open_ = 0 OR mgpcd.open_ IS NULL) AND sr.music_group_status_ != 'QUIT' AND mgpc.payment_status_ = 2
 		AND FIND_IN_SET(mgpcd.id_,#{ids})
+		GROUP BY mgpcd.id_
 	</select>
 	<select id="queryIntersectionByPaymentDate" resultType="java.lang.Integer">
 		SELECT COUNT(mgpcd.id_) FROM music_group_payment_calender_detail mgpcd

+ 9 - 0
mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml

@@ -891,5 +891,14 @@
         </foreach>
 		GROUP BY sr.user_id_
     </select>
+    <select id="queryCanAddStudent" resultMap="com.ym.mec.biz.dal.dao.MusicGroupDao.BasicUserDto">
+        SELECT su.id_ user_id_,su.username_ FROM music_group_student_fee_ mgsf
+        LEFT JOIN sys_user su ON su.id_ = mgsf.user_id_
+        WHERE mgsf.user_id_ NOT IN (
+        SELECT DISTINCT mgpcd.user_id_ FROM music_group_payment_calender_detail mgpcd
+        LEFT JOIN music_group_payment_calender mgpc ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
+        WHERE mgpc.id_ = #{musicGroupPaymentCalenderId}
+        ) AND mgsf.music_group_id_ = #{musicGroupId}
+    </select>
 
 </mapper>

+ 1 - 1
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java

@@ -163,7 +163,7 @@ public class MusicGroupController extends BaseController {
 
         BigDecimal amount = musicGroupStudentFee.getTemporaryCourseFee();
         if (amount == null || amount.doubleValue() == 0) {
-            amount = musicGroupStudentFee.getCourseFee();
+            amount = userLastCalenderDetail.getExpectAmount();
         }
 
         StudentRegistration studentRegistration = studentRegistrationService.queryByUserIdAndMusicGroupId(userId, musicGroupId);

+ 7 - 0
mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java

@@ -92,6 +92,13 @@ public class StudentManageController extends BaseController {
         return succeed(studentManageService.queryMusicGroupStudent(queryInfo));
     }
 
+    @ApiOperation(value = "乐团修改--学员缴费记录--可新增学员列表")
+    @GetMapping("/queryCanAddStudent")
+    @PreAuthorize("@pcs.hasPermissions('studentManage/queryCanAddStudent')")
+    public Object queryCanAddStudent(String musicGroupId,Long musicGroupPaymentCalenderId){
+        return succeed(studentManageService.queryCanAddStudent(musicGroupId,musicGroupPaymentCalenderId));
+    }
+
     @ApiOperation(value = "乐团管理--乐团详情--学员列表--查看班级")
     @GetMapping("/queryStudentClassGroup")
     @PreAuthorize("@pcs.hasPermissions('studentManage/queryStudentClassGroup')")