浏览代码

fix erjianerzao

he2802 2 年之前
父节点
当前提交
aab0ada34a

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

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

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/ClassGradeUserQueryBo.java

@@ -289,4 +289,10 @@ public class ClassGradeUserQueryBo extends BaseEntity {
 	@ApiModelProperty("月份")
 	private Integer month;
 
+	@ApiModelProperty("周查询开始时间")
+	private Long searchWeekStartTime;
+
+	@ApiModelProperty("周查询结束时间")
+	private Long searchWeekEndTime;
+
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/mapper/ClassGradeUserMapper.java

@@ -28,6 +28,8 @@ public interface ClassGradeUserMapper extends BaseMapper<ClassGradeUser> {
 
     List<ClassPeriodStudentVo> listUserPeriod(ClassGradeUserQueryBo bo);
 
+    List<ClassPeriodStudentVo> listUserWeekPeriod(ClassGradeUserQueryBo bo);
+
     List<ClassPeriodStudentVo> listUserVideoRecord(ClassGradeUserQueryBo bo);
 
     List<ClassPeriodStudentVo> listUserPeriodExport(ClassGradeUserQueryBo bo);

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

@@ -84,6 +84,8 @@ public interface IClassGradeUserService extends IService<ClassGradeUser> {
 
 	List<ClassPeriodStudentVo> listUserPeriodRecord(ClassGradeUserQueryBo bo);
 
+	List<ClassPeriodStudentVo> listUserPeriodWeekRecord(ClassGradeUserQueryBo bo);
+
 	List<ClassPeriodStudentVo> listUserVideoRecord(ClassGradeUserQueryBo bo);
 
 	List<UserPeriodExportVo> listUserStudyRecord(ClassGradeUserQueryBo bo);

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

@@ -1247,6 +1247,51 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         return classPeriodStudentVos;
     }
 
+    @Override
+    public List<ClassPeriodStudentVo> listUserPeriodWeekRecord(ClassGradeUserQueryBo bo) {
+        //查询班级学员信息
+        List<ClassPeriodStudentVo> classPeriodStudentVos = baseMapper.listUserWeekPeriod(bo);
+        //查找学员学习记录
+        for (ClassPeriodStudentVo classPeriodStudentVo : classPeriodStudentVos) {
+            //总的审核状态按照策划规则
+            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));
+            }*/
+            //取学时所有拍照最新的一张
+            String recentPhoto = userStudyRecordPhotoMapper.selectGradeRecentOnePhoto(classPeriodStudentVo.getUserId(), classPeriodStudentVo.getGradeId());
+            if (Validator.isNotEmpty(recentPhoto)) {
+                classPeriodStudentVo.setIdCardImg1(recentPhoto);
+            }
+            if (Validator.isNotEmpty(bo.getUserPhoto()) && bo.getUserPhoto() == 1) {
+                //解析身份证和一寸照
+                if (Validator.isNotEmpty(classPeriodStudentVo.getKeyValue())) {
+                    JSONObject keyJSON = null;
+                    try {
+                        classPeriodStudentVo.setKeyValue(null);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+        }
+        return classPeriodStudentVos;
+    }
+
     @Override
     public List<ClassPeriodStudentVo> listUserVideoRecord(ClassGradeUserQueryBo bo) {
         //查询班级学员信息

+ 8 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsServiceImpl.java

@@ -542,6 +542,14 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
     public List<OrderGoodsVo> listUserVideoLive(GoodsQueryBo bo) {
         List<OrderGoodsVo> list = this.baseMapper.listUserVideoLive(bo);
         for(OrderGoodsVo goodsVo : list){
+            String fullName = goodsVo.getEducationName()+goodsVo.getBusinessName()+goodsVo.getProjectName();
+            goodsVo.setErJianErZao(false);
+            if(Validator.isNotEmpty(fullName)){
+                if(fullName.equals("继续教育二级建造师")||fullName.equals("继续教育二级造价师")){
+                    goodsVo.setErJianErZao(true);
+                }
+            }
+
             Long secLong = 0L;
             Long studyLong = 0L;
             SubjectStudyRecordQueryBo subjectStudyRecordQueryBo = new SubjectStudyRecordQueryBo();

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/vo/OrderGoodsVo.java

@@ -339,4 +339,6 @@ public class OrderGoodsVo {
 	@Excel(name = "学时变为待审核时间")
 	@ApiModelProperty("学时变为待审核时间")
 	private Long periodWaitTime;
+	@ApiModelProperty("是否是二建二造")
+	private Boolean erJianErZao;
 }

+ 126 - 0
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -500,6 +500,132 @@
         </if>
     </select>
 
+    <select id="listUserWeekPeriod" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
+            resultMap="ClassPeriodStudentVo">
+        SELECT
+        u.user_account,
+        u.user_id,
+        cgu.`status`,
+        u.realname,
+        cgg.goods_id,
+        u.id_card,
+        cgu.grade_id,
+        u.telphone,
+        u.one_inch_photos,
+        up.`status` as profile_status,
+        g.class_hours as class_hours,
+        g.study_start_time as study_start_time,
+        g.study_end_time as study_end_time,
+        g.goods_name,
+        g.code as goods_code,
+        g.stand_price,
+        cgu.period_status,
+        cg.class_start_time,
+        cg.class_end_time,
+        cg.class_name,
+        cgu.period_plush,
+        cgu.period_status_num,
+        cgu.period_time,
+        <if test="userPhoto != null and userPhoto == 1">
+            up.key_value,
+        </if>
+        cgu.period_wait_time as end_time
+        <if test="userPhoto == null">
+            ,(select COUNT(up.id) from user_period up LEFT JOIN user_period_status ups on up.id=ups.period_id where up.goods_id = (SELECT cgg.goods_id FROM class_grade_goods cgg where cg.grade_id=cgg.grade_id) and up.grade_id = cgu.grade_id and up.user_id = u.user_id
+            and ups.period_status=0 and ups.`status`=0 and (SELECT COUNT(upss.id) from user_period_status upss where upss.id = ups.id and upss.period_status = 1 and upss.`status` = 2) > 0 ) as rebuild_num
+        </if>
+        FROM
+        class_grade_user cgu
+        LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
+        LEFT JOIN class_grade_goods cgg on cg.grade_id=cgg.grade_id
+        LEFT JOIN `user` u ON u.user_id = cgu.user_id
+        LEFT JOIN user_profile up on u.user_id =up.user_id and up.goods_id = cgg.goods_id and cgu.order_goods_id = up.order_goods_id and up.type_status=1 and up.current_status = 1
+        LEFT JOIN goods g on cgg.goods_id = g.goods_id
+        LEFT JOIN course_business cb ON g.business_id = cb.id
+        where 1=1
+        and cgu.`status` =1
+        <if test="searchWeekStartTime != null and searchWeekEndTime != '' ">
+            AND (SELECT count(*) from user_study_record usr where usr.user_id = cgu.user_id AND usr.grade_id = cgu.grade_id AND usr.current_status = 1 AND #{searchWeekEndTime} >=  usr.create_time AND usr.create_time >=#{searchWeekStartTime}) >0
+        </if>
+        <if test="periodPlush != null and periodPlush != ''">
+            AND cgu.period_plush = #{periodPlush}
+        </if>
+        <if test="officialStatus != null and officialStatus != ''">
+            AND cgu.official_status = #{officialStatus}
+        </if>
+        <if test="changeGrade != null and changeGrade != ''">
+            AND cgu.change_grade = #{changeGrade}
+        </if>
+        <if test="profileStatus != null and profileStatus != ''">
+            AND up.status = #{profileStatus}
+        </if>
+        <if test="gradeId != null and gradeId !='' ">
+            and cgu.grade_id = #{gradeId}
+        </if>
+        <if test="businessId != null and businessId != ''">
+            AND g.business_id = #{businessId}
+        </if>
+        <if test="educationTypeId != null and educationTypeId != ''">
+            AND g.education_type_id = #{educationTypeId}
+        </if>
+        <if test="schoolId != null and schoolId != ''">
+            AND g.school_id = #{schoolId}
+        </if>
+        <if test="majorId != null and majorId != ''">
+            AND g.major_id = #{majorId}
+        </if>
+        <if test="periodStatus != null ">
+            and cgu.period_status = #{periodStatus}
+        </if>
+        <if test="classStartTime != null and classStartTime != '' ">
+            AND cg.class_start_time >= #{classStartTime}
+        </if>
+        <if test="classEndTime != null and classEndTime != '' ">
+            AND #{classEndTime} >=  cg.class_end_time
+        </if>
+        <if test="studyStatus != null and studyStatus == 1 ">
+            and cgu.period_status = -1
+        </if>
+        <if test="studyStatus != null and studyStatus == 2 ">
+            and cgu.period_status != -1
+        </if>
+        <if test="className != null and className !='' ">
+            and  cg.class_name like concat('%', #{className}, '%')
+        </if>
+        <if test="searchKey != null and searchKey != '' ">
+            and (u.realname like concat('%', #{searchKey}, '%')  or g.goods_name like concat('%', #{searchKey}, '%') or cg.class_name like concat('%', #{searchKey}, '%'))
+        </if>
+        <if test="idCard != null and idCard !='' ">
+            AND u.id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
+        </if>
+        <if test="telphone != null and telphone !='' ">
+            AND u.telphone = #{telphone,typeHandler=com.zhongzheng.common.type.EncryptHandler}
+        </if>
+        <if test="searchStartTime != null and searchStartTime !='' ">
+            AND cgu.create_time >=#{searchStartTime}
+        </if>
+        <if test="searchEndTime != null and searchEndTime !='' ">
+            AND #{searchEndTime} >= cgu.create_time
+        </if>
+        <if test="periodStartTime != null and periodStartTime !='' ">
+            AND cgu.period_time >=#{periodStartTime}
+        </if>
+        <if test="periodEndTime != null and periodEndTime !='' ">
+            AND #{periodEndTime} >= cgu.period_time
+        </if>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+        <if test="periodStatus != 2 and periodStatus != 3">
+            order by cgu.update_time desc
+        </if>
+        <if test="periodStatus == 2 ">
+            order by cgu.period_wait_time,cgu.create_time
+        </if>
+        <if test="periodStatus == 3 ">
+            order by cgu.period_ing_time,cgu.create_time
+        </if>
+    </select>
+
     <select id="listUserPeriodExport" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
             resultMap="ClassPeriodStudentVo">
         SELECT