Browse Source

学时学习记录

he2802 3 years ago
parent
commit
51a0cb7005

+ 12 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/grade/ClassGradeController.java

@@ -144,6 +144,18 @@ public class ClassGradeController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 查询学时学员记录列表
+     */
+    @ApiOperation("查询学员学时学习记录列表")
+    @PreAuthorize("@ss.hasPermi('grade:user:list')")
+    @GetMapping("/listUserPeriodRecord")
+    public TableDataInfo<ClassPeriodStudentVo> listUserPeriodRecord(ClassGradeUserQueryBo bo) {
+        startPage();
+        List<ClassPeriodStudentVo> list = iClassGradeUserService.listUserPeriodRecord(bo);
+        return getDataTable(list);
+    }
+
     /**
      * 查询学时学员记录列表
      */

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

@@ -76,6 +76,8 @@ public interface IClassGradeUserService extends IService<ClassGradeUser> {
 
 	List<ClassPeriodStudentVo> listUserPeriod(ClassGradeUserQueryBo bo);
 
+	List<ClassPeriodStudentVo> listUserPeriodRecord(ClassGradeUserQueryBo bo);
+
 	List<UserPeriodExportVo> listUserStudyRecord(ClassGradeUserQueryBo bo);
 
     List<ClassPeriodUserVo> listPeriod(ClassGradeUserQueryBo bo);

+ 72 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -960,6 +960,78 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         return classPeriodStudentVos;
     }
 
+    @Override
+    public List<ClassPeriodStudentVo> listUserPeriodRecord(ClassGradeUserQueryBo bo) {
+        //查询班级学员信息
+        List<ClassPeriodStudentVo> classPeriodStudentVos = baseMapper.listUserPeriod(bo);
+        //查找学员学习记录
+        for (ClassPeriodStudentVo classPeriodStudentVo : classPeriodStudentVos) {
+        //    Long secLong = 0L;
+        //    Long studyLong = 0L;
+
+           /* SubjectStudyRecordQueryBo subjectStudyRecordQueryBo = new SubjectStudyRecordQueryBo();
+            subjectStudyRecordQueryBo.setGoodsId(classPeriodStudentVo.getGoodsId());
+            subjectStudyRecordQueryBo.setUserId(classPeriodStudentVo.getUserId());
+            subjectStudyRecordQueryBo.setGradeId(classPeriodStudentVo.getGradeId());
+            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();
+
+            }*/
+            //总节数
+         //   classPeriodStudentVo.setSecAllNum(secLong);
+            //学习节数
+        //    classPeriodStudentVo.setStuAllNum(studyLong);
+
+            //总的审核状态按照策划规则
+            ClassGradeUserQueryBo classGradeUserQueryBo = new ClassGradeUserQueryBo();
+            classGradeUserQueryBo.setGradeId(classPeriodStudentVo.getGradeId());
+            classGradeUserQueryBo.setUserId(classPeriodStudentVo.getUserId());
+            classGradeUserQueryBo.setGoodsId(classPeriodStudentVo.getGoodsId());
+        //    List<ClassPeriodUserVo> classPeriodUserVos1 = baseMapper.listPeriod(classGradeUserQueryBo);
+        //    ClassPeriodUserVo classPeriodUserVos = classPeriodUserVos1.get(0);
+        //    classPeriodUserVos.setPending(classPeriodStudentVo.getSecAllNum()-classPeriodUserVos.getPass()-classPeriodUserVos.getCheat());
+        //    classPeriodUserVos.setExamPending(classPeriodUserVos.getExamNum()-classPeriodUserVos.getExamPass()-classPeriodUserVos.getExamCheat());
+            //當前班級學員審核狀態 -1不可审核 0待審  1未通过 2通过
+            Integer gradePeriodStatus = 0; //班级里的审核状态字段,保持一致 0 未通过 1通过 2待审核 -1 不可审核
+
+            classPeriodStudentVo.setAllStatus(changePeriodStatus(classPeriodStudentVo.getPeriodStatus()));
+
+        //    classPeriodStudentVo.setWaitRebuildNum(classPeriodUserVos.getCheat()+classPeriodUserVos.getExamCheat());
+            if (!CollectionUtils.isEmpty(baseMapper.selectStart(classPeriodStudentVo.getUserId(),classPeriodStudentVo.getGoodsId(),classPeriodStudentVo.getGradeId()))) {
+                //查找开始学习时间
+                classPeriodStudentVo.setStartTime(baseMapper.selectStart(classPeriodStudentVo.getUserId(),classPeriodStudentVo.getGoodsId(),classPeriodStudentVo.getGradeId()).get(0));
+            }
+
+            if(Validator.isNotEmpty(bo.getUserPhoto())&&bo.getUserPhoto()==1){
+                //解析身份证和一寸照
+                if(Validator.isNotEmpty(classPeriodStudentVo.getKeyValue())){
+                    JSONObject keyJSON = null;
+                    try {
+                        keyJSON = JSON.parseObject(classPeriodStudentVo.getKeyValue());
+                        if(keyJSON.containsKey("recent_photos")){
+                            String recent_photos_data = keyJSON.getString("recent_photos");
+                            JSONObject recent_photos_jsondata= JSON.parseObject(recent_photos_data);
+                            String recent_photos = recent_photos_jsondata.getString("value");
+                            classPeriodStudentVo.setOneInchPhotos(recent_photos);
+                        }
+                        if(keyJSON.containsKey("idcard_face_photo")){
+                            String idcard_face_photo_data = keyJSON.getString("idcard_face_photo");
+                            JSONObject idcard_face_photo_jsondata= JSON.parseObject(idcard_face_photo_data);
+                            String idcard_face_photo = idcard_face_photo_jsondata.getString("value");
+                            classPeriodStudentVo.setIdCardImg1(idcard_face_photo);
+                        }
+                        classPeriodStudentVo.setKeyValue(null);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+        }
+        return classPeriodStudentVos;
+    }
+
     private Integer changePeriodStatus(Long gradePeriodStatus){
         //當前班級學員審核狀態 -1不可审核 0待審  1未通过 2通过
         //班级里的审核状态字段,保持一致 0 未通过 1通过 2待审核 -1 不可审核