Browse Source

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

yonge 5 years ago
parent
commit
5b183b9dff

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

@@ -190,6 +190,15 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
     Integer countClassGroupStudentNum(@Param("classGroupId") Integer classGroupId);
 
     /**
+     * @describe 统计班级上学生人数,
+     * @author Joburgess
+     * @date 2019/12/26
+     * @param classGroupId:
+     * @return java.lang.Integer
+     */
+    Integer countClassGroupNormalStudentNum(@Param("classGroupId") Integer classGroupId);
+
+    /**
      * @describe 统计vip课或乐团下的学生人数
      * @author Joburgess
      * @date 2019/12/14

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

@@ -5,8 +5,6 @@ import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.enums.SysUserType;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.*;
-import com.ym.mec.biz.dal.entity.CourseSchedule;
-import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.entity.SysUserCashAccount;
 import com.ym.mec.biz.dal.page.*;
@@ -15,11 +13,8 @@ import com.ym.mec.common.entity.ImResult;
 import com.ym.mec.common.entity.ImUserModel;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
-import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.im.ImFeignService;
 import com.ym.mec.util.collection.MapUtil;
-import com.ym.mec.util.http.HttpUtil;
-import org.apache.commons.collections.MapUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -153,7 +148,7 @@ public class StudentManageServiceImpl implements StudentManageService {
         Map<String, Object> params = new HashMap<String, Object>();
         MapUtil.populateMap(params, queryInfo);
 
-        List dataList = null;
+        List<StudentManageCourseListDto> dataList = null;
         int count = studentManageDao.countStudentAttendances(params);
         if (count > 0) {
             pageInfo.setTotal(count);

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

@@ -1403,7 +1403,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			courseScheduleStudentPaymentDao.batchDeleteWithID(studentPaymentIds);
 		}
 
-		int studentCourseNum = courseScheduleStudentPaymentDao.countStudentCourseNumWithGroup(GroupType.VIP, vipGroupId.toString());
+		int studentCourseNum = classGroupStudentMapperDao.countClassGroupNormalStudentNum(classGroup.getId());
 		if(studentCourseNum<=0){
 			vipGroup.setStatus(VipGroupStatusEnum.PAUSE);
 			if(!CollectionUtils.isEmpty(courseScheduleIds)){
@@ -1568,9 +1568,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         studentRecoverInfoDto.setTeacherId(vipGroup.getUserId());
         studentRecoverInfoDto.setStudentId(studentPauseInfo.getUserId());
         studentRecoverInfoDto.setIsPause(vipGroup.getStatus().equals(VipGroupStatusEnum.PAUSE)?1:0);
-        studentRecoverInfoDto.setTotalCourseTimes(coursePrices.size());
 		Map<BigDecimal, Long> collect = coursePrices.stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
 		studentRecoverInfoDto.setGiveCourseTimes(Objects.isNull(collect.get(new BigDecimal("0.00")))?0:collect.get(new BigDecimal("0.00")).intValue());
+		studentRecoverInfoDto.setTotalCourseTimes(coursePrices.size()-studentRecoverInfoDto.getGiveCourseTimes());
 		return studentRecoverInfoDto;
     }
 

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

@@ -254,6 +254,16 @@
             AND status_!='QUIT'
     </select>
 
+    <select id="countClassGroupNormalStudentNum" resultType="int">
+        SELECT
+            COUNT( user_id_ )
+        FROM
+          class_group_student_mapper
+        WHERE
+            class_group_id_ = #{classGroupId}
+            AND status_!='QUIT' AND status_!='QUIT_SCHOOL'
+    </select>
+
     <select id="countGroupStudentNum" resultType="int">
         SELECT
             COUNT( user_id_ )

+ 2 - 2
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -303,9 +303,9 @@ public class ExportController extends BaseController {
                 }
                 row.setCurrentGrade(row.getCurrentGrade() + row.getCurrentClass());
             }
-            String[] header = {"学生姓名", "性别", "联系电话", "年级班级", "专业", "学员状态", "新增学员", "缴费金额",
+            String[] header = {"学员编号","学生姓名", "性别", "联系电话", "年级班级", "专业", "学员状态", "新增学员", "缴费金额",
                     "下次缴费日期", "报名缴费", "是否激活"};
-            String[] body = {"realName", "gender", "phone", "currentGrade", "subjectName", "studentStatus", "isNewStudentStr",
+            String[] body = {"userId","realName", "gender", "phone", "currentGrade", "subjectName", "studentStatus", "isNewStudentStr",
                     "courseFee", "nextPaymentDate","paymentStatus", "activeName"};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, musicGroupStudentsDtoPageInfo.getRows());
             response.setContentType("application/octet-stream");