Преглед изворни кода

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

zouxuan пре 5 година
родитељ
комит
816b7dda2f

+ 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

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

@@ -53,6 +53,8 @@ public class MusicGroupStudentsDto{
 
     private String isNewStudentStr;
 
+    private String nextPaymentDateStr;
+
     public Boolean getIsActive() {
         return isActive;
     }
@@ -180,4 +182,12 @@ public class MusicGroupStudentsDto{
     public void setIsNewStudentStr(String isNewStudentStr) {
         this.isNewStudentStr = isNewStudentStr;
     }
+
+    public String getNextPaymentDateStr() {
+        return nextPaymentDateStr;
+    }
+
+    public void setNextPaymentDateStr(String nextPaymentDateStr) {
+        this.nextPaymentDateStr = nextPaymentDateStr;
+    }
 }

+ 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_ )

+ 3 - 0
mec-util/src/main/java/com/ym/mec/util/pdf/PDFUtil.java

@@ -11,6 +11,7 @@ import java.net.URL;
 
 import org.xhtmlrenderer.pdf.ITextRenderer;
 
+import com.google.zxing.client.result.BizcardResultParser;
 import com.lowagie.text.DocumentException;
 import com.lowagie.text.pdf.BaseFont;
 import com.ym.mec.util.exception.UtilException;
@@ -317,6 +318,8 @@ public class PDFUtil {
 		File fontFamilyFile = new File(baseUrl, fontFamily);
 		if (fontFamilyFile.exists()) {
 			renderer.getFontResolver().addFont(fontFamilyFile.getAbsolutePath(), BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
+		} else {
+			throw new FileNotFoundException("字体文件找不到:" + fontFamilyFile.getPath());
 		}
 		renderer.setDocumentFromString(data);
 		renderer.getSharedContext().setBaseURL(baseUrl);

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

@@ -27,7 +27,6 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 
@@ -292,21 +291,22 @@ public class ExportController extends BaseController {
                     row.setStudentStatus("退团");
                 }
                 if (row.getIsActive()) {
-                    row.setActiveName("在读");
+                    row.setActiveName("");
                 } else {
-                    row.setActiveName("退团");
+                    row.setActiveName("");
                 }
                 if(row.getIsNewStudent().equals(1)){
                     row.setIsNewStudentStr("是");
                 }else {
                     row.setIsNewStudentStr("否");
                 }
+                row.setNextPaymentDateStr(DateUtil.format(row.getNextPaymentDate(), DateUtil.DEFAULT_PATTERN));
                 row.setCurrentGrade(row.getCurrentGrade() + row.getCurrentClass());
             }
-            String[] header = {"学姓名", "性别", "联系电话", "年级班级", "专业", "学员状态", "新增学员", "缴费金额",
+            String[] header = {"学员编号","学员姓名", "性别", "联系电话", "年级班级", "专业", "学员状态", "新增学员", "缴费金额",
                     "下次缴费日期", "报名缴费", "是否激活"};
-            String[] body = {"realName", "gender", "phone", "currentGrade", "subjectName", "studentStatus", "isNewStudentStr",
-                    "courseFee", "nextPaymentDate", "activeName"};
+            String[] body = {"userId","realName", "gender", "phone", "currentGrade", "subjectName", "studentStatus", "isNewStudentStr",
+                    "courseFee", "nextPaymentDateStr","paymentStatus", "activeName"};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, musicGroupStudentsDtoPageInfo.getRows());
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");