he2802 1 rok pred
rodič
commit
d2877589a7

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/IClassGradeService.java

@@ -58,6 +58,8 @@ public interface IClassGradeService extends IService<ClassGrade> {
 
 	List<ClassGradeStudentVo> listGradeAll(ClassGradeUserQueryBo bo);
 
+	List<ClassGradeStudentAllExportVo> listGradeAllExport(ClassGradeUserQueryBo bo);
+
     boolean editUserGrade(ClassGradeUserAddQueryBo bo);
 
 	List<ClassGradeUserListVo> listGradeInform(ClassGradeQueryBo bo);

+ 62 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeServiceImpl.java

@@ -1004,6 +1004,68 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
         return classGradeStudentVos;
     }
 
+    @Override
+    public List<ClassGradeStudentAllExportVo> listGradeAllExport(ClassGradeUserQueryBo bo) {
+        if (Validator.isNotEmpty(bo.getIdCard()) && Validator.isNotEmpty(bo.getIdCards())) {
+            String idCard = bo.getIdCard();
+            List<String> idCards = bo.getIdCards();
+            Set<String> set = new HashSet<>();
+            for (String id : idCards) {
+                set.add(id);
+            }
+            set.add(idCard);
+            if (Validator.isNotEmpty(set)) {
+                bo.setIdCards(new ArrayList<>(set));
+            }
+            bo.setIdCard(null);
+        }
+        //查找班级学员
+        List<ClassGradeStudentVo> classGradeStudentVos = baseMapper.listGradeAll(bo);
+        //得到每个学员的课程学习记录
+        for (ClassGradeStudentVo classGradeStudentVo : classGradeStudentVos) {
+            Long secLong = 0L;
+            Long studyLong = 0L;
+
+            SubjectStudyRecordQueryBo subjectStudyRecordQueryBo = new SubjectStudyRecordQueryBo();
+            subjectStudyRecordQueryBo.setGoodsId(classGradeStudentVo.getGoodsId());
+            subjectStudyRecordQueryBo.setUserId(classGradeStudentVo.getUserId());
+            subjectStudyRecordQueryBo.setGradeId(bo.getGradeId());
+            subjectStudyRecordQueryBo.setOrderGoodsId(classGradeStudentVo.getOrderGoodsId());
+            List<SubjectStudyRecordVo> subjectStudyRecordVos = iUserStudyRecordService.listSubject(subjectStudyRecordQueryBo);
+            for (SubjectStudyRecordVo subjectStudyRecordVo : subjectStudyRecordVos) {
+                secLong = new BigDecimal(secLong.toString()).add(new BigDecimal(subjectStudyRecordVo.getSectionNum().toString())).longValue();
+                studyLong = new BigDecimal(studyLong.toString()).add(new BigDecimal(subjectStudyRecordVo.getRecordNum().toString())).longValue();
+
+            }
+
+            List<Long> timeList = classGradeUserMapper.selectStart(classGradeStudentVo.getUserId(), classGradeStudentVo.getGoodsId(), classGradeStudentVo.getGradeId(),classGradeStudentVo.getOrderGoodsId());
+            if (!org.springframework.util.CollectionUtils.isEmpty(timeList)) {
+                //查找开始学习时间
+                classGradeStudentVo.setStartTime(timeList.get(0));
+            }else{
+                classGradeStudentVo.setStartTime(classGradeUserMapper.selectStartNoPhoto(classGradeStudentVo.getUserId(), classGradeStudentVo.getGoodsId(), classGradeStudentVo.getGradeId(),classGradeStudentVo.getOrderGoodsId())
+                );
+            }
+            //BigDecimal divide = new BigDecimal(studyLong.toString()).divide(new BigDecimal(secLong.toString()),2,BigDecimal.ROUND_HALF_UP);
+            //classGradeStudentVo.setStudyNum(divide.multiply(new BigDecimal("100")).longValue());
+            classGradeStudentVo.setSecAllNum(secLong);
+            classGradeStudentVo.setStuAllNum(studyLong);
+            /*UserUpdateQueryBo userUpdateQueryBo = new UserUpdateQueryBo();
+            userUpdateQueryBo.setUserId(classGradeStudentVo.getUserId());
+            classGradeStudentVo.setUserUpdates(iUserUpdateService.queryList(userUpdateQueryBo));*/
+            /*if (Validator.isNotEmpty(classGradeStudentVo.getRebuyOrderGoodsId()) && classGradeStudentVo.getRebuyOrderGoodsId().longValue() > 0) {
+                classGradeStudentVo.setRebuy(orderMapper.getGradePeriod(classGradeStudentVo.getRebuyOrderGoodsId(), classGradeStudentVo.getUserId()));
+            }*/
+            if (ObjectUtils.isNotNull(classGradeStudentVo.getOrgId())){
+                SysTenant tenant = iSysTenantService.getById(classGradeStudentVo.getOrgId());
+                if (ObjectUtils.isNotNull(tenant)){
+                    classGradeStudentVo.setTenantName(tenant.getTenantName());
+                }
+            }
+        }
+        return null;
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean editUserGrade(ClassGradeUserAddQueryBo bo) {

+ 99 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassGradeStudentAllExportVo.java

@@ -0,0 +1,99 @@
+package com.zhongzheng.modules.grade.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import com.zhongzheng.modules.user.vo.UserUpdateVo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+
+/**
+ * 学员记录视图对象 mall_package
+ *
+ * @author ruoyi
+ * @date 2021-11-10
+ */
+@Data
+@ApiModel("学员视图对象")
+public class ClassGradeStudentAllExportVo {
+	private static final long serialVersionUID = 1L;
+
+
+	/** 学员编码 */
+	@Excel(name = "学员姓名")
+	@ApiModelProperty("学员姓名")
+	private String realname;
+
+
+	/** 学员编码 */
+	@Excel(name = "学员身份证")
+	@ApiModelProperty("学员身份证")
+	private String idCard;
+
+	/** 学员编码 */
+	@Excel(name = "学员电话")
+	@ApiModelProperty("学员电话")
+	private String telPhone;
+
+
+	@Excel(name = "工作单位")
+	private String companyName;
+
+	@ApiModelProperty("班级名称")
+	@Excel(name = "班级名称")
+	private String gradeName;
+
+	@Excel(name = "学时")
+	private String hourStr;
+
+	@Excel(name = "学习服务期")
+	@ApiModelProperty("学习服务期")
+	private Long serviceTimeStr;
+
+	@Excel(name = "视频学习(节)")
+	private String videoStr;
+
+	@Excel(name = "做题进度(章卷)")
+	private String examStr;
+
+	@Excel(name = "学习开始")
+	private String studyStartStr;
+
+	@Excel(name = "学习结束")
+	private String studyEndStr;
+
+	@Excel(name = "学习状态")
+	private String studyStatusStr;
+
+	@Excel(name = "学习机会(总共)")
+	@ApiModelProperty("学习机会(总共)")
+	private Integer totalStudyCount;
+
+	@Excel(name = "学习机会(消耗)")
+	@ApiModelProperty("学习机会(消耗)")
+	private Integer useStudyCount;
+
+	@Excel(name = "学习机会(剩余)")
+	@ApiModelProperty("学习机会(剩余)")
+	private Long studyCount;
+
+	@Excel(name = "资料变更")
+	@ApiModelProperty("资料是否变更过 1变更 0未变更")
+	private Integer userStatus;
+
+	@Excel(name = "信息上报")
+	@ApiModelProperty("官方推送状态 1是 0否")
+	private Long officialStatus;
+
+	@Excel(name = "学时审核")
+	@ApiModelProperty("学时审批状态 0 未通过 1通过 2待审核")
+	private Long periodStatus;
+
+	@Excel(name = "学时上报")
+	@ApiModelProperty("是否学时推送 0未推送 1推送")
+	private Integer periodPlush;
+
+}

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassGradeStudentVo.java

@@ -202,6 +202,9 @@ public class ClassGradeStudentVo {
 	@ApiModelProperty("项目名")
 	private String projectName;
 
+	@ApiModelProperty("教育名称")
+	private String educationName;
+
 	@ApiModelProperty("用户是否绑定微信")
 	private Integer userBindWx;
 	@ApiModelProperty("用户是否关注微信")

+ 5 - 1
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeMapper.xml

@@ -170,6 +170,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="reason" column="reason"/>
         <result property="projectName" column="project_name"/>
         <result property="businessName" column="business_name"/>
+        <result property="educationName" column="education_name"/>
         <result property="sevenYear" column="seven_year"/>
         <result property="orgId" column="org_id"/>
 
@@ -594,6 +595,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         cgu.period_plush_msg,
         cgu.learn_status,
         cgu.period_wait_time as end_time,
+        (case WHEN (select COUNT(uu.id) FROM user_update uu where cgu.user_id = uu.user_id and uu.status = 2) >0 then 1 ELSE 0 end) as user_status,
         (SELECT COUNT(m.id) FROM course_menu_exam m LEFT JOIN goods_course c on m.course_id=c.course_id   where c.goods_id=og.goods_id and m.type  in (1,3) ) as exam_num,
         (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr  where ubr.`status`=1 and ubr.type  in (1,3) and  ubr.user_id = u.user_id and ubr.grade_id = cgu.grade_id and ubr.order_goods_id = cgu.order_goods_id and ubr.report_status=1 and ubr.current_status = 1) as record_num,
         (og.study_count) as study_count,
@@ -618,7 +620,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ueg.do_number,
         ueg.expend_number,
         ueg.expend_before,
-        up.`status` as profile_status
+        up.`status` as profile_status,
+        cet.education_name
         FROM
         class_grade_user cgu
         LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
@@ -628,6 +631,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN major m ON g.major_id = m.id
         LEFT JOIN course_business cb ON g.business_id = cb.id
         LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
+        LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
         LEFT JOIN user_exam_goods ueg ON ueg.order_goods_id = og.order_goods_id
         LEFT JOIN user_profile up on cgu.order_goods_id = up.order_goods_id and up.type_status=1 and up.current_status = 1
         where 1=1 and cgu.`status` = 1