he2802 2 gadi atpakaļ
vecāks
revīzija
37a3c66f00

+ 8 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserStudyRecordController.java

@@ -142,6 +142,14 @@ public class UserStudyRecordController extends BaseController {
         return AjaxResult.success(iUserStudyRecordService.menuAllListWithExam(bo));
     }
 
+    @ApiOperation("查询商品所有子目录带试卷结构列表")
+    @GetMapping("/goodsAllListWithExam")
+    public AjaxResult<List<ClassPeriodVo>> goodsAllListWithExam(UserStudyRecordQueryBo bo) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
+        return AjaxResult.success(iUserStudyRecordService.goodsAllListWithExam(bo));
+    }
+
     @ApiOperation("查询用户每天学习记录列表")
     @GetMapping("/listUserRecord")
     public TableDataInfo<SectionStudyRecordVo> listUserRecord(UserStudyRecordQueryBo bo) {

+ 0 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/impl/TopOldOrderServiceImpl.java

@@ -3688,11 +3688,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
         }
         if (bo.getTotalType() == 1) {
             List<TopOldOrderVo> vos = baseMapper.queryListAll();
-//        BigDecimal price = vos.stream().filter(x -> ObjectUtils.isNotNull(x.getOrderPrice())).map(TopOldOrderVo::getOrderPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
-//        BigDecimal received = vos.stream().filter(x -> ObjectUtils.isNotNull(x.getOrderReceived())).map(TopOldOrderVo::getOrderReceived).reduce(BigDecimal.ZERO, BigDecimal::add);
             BigDecimal uncollected = vos.stream().filter(x -> ObjectUtils.isNotNull(x.getOrderUncollected()) && x.getCheckStatus() == 1).map(TopOldOrderVo::getOrderUncollected).reduce(BigDecimal.ZERO, BigDecimal::add);
-/*        map.put("orderPriceTotal", price);
-        map.put("orderReceivedTotal", received);*/
             map.put("orderUncollectedTotal", uncollected); //未收账款
 
         }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserStudyRecordService.java

@@ -97,6 +97,8 @@ public interface IUserStudyRecordService extends IService<UserStudyRecord> {
 
 	List<ClassPeriodVo> menuAllListWithExam(UserStudyRecordQueryBo bo);
 
+	List<ClassPeriodVo> goodsAllListWithExam(UserStudyRecordQueryBo bo);
+
 	List<SectionStudyRecordVo> listUserRecord(UserStudyRecordQueryBo bo);
 
 	Integer getStudyStatus(ClassPeriodVo bo);

+ 111 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java

@@ -25,7 +25,10 @@ import com.zhongzheng.modules.course.mapper.CourseChapterSectionMapper;
 import com.zhongzheng.modules.course.service.*;
 import com.zhongzheng.modules.course.vo.CourseChapterSectionVo;
 import com.zhongzheng.modules.course.vo.CourseSectionVo;
+import com.zhongzheng.modules.course.vo.CourseVo;
+import com.zhongzheng.modules.goods.bo.GoodsCourseQueryBo;
 import com.zhongzheng.modules.goods.domain.Goods;
+import com.zhongzheng.modules.goods.service.IGoodsCourseService;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
@@ -152,6 +155,8 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
 
     @Autowired
     private ClassGradeUserMapper classGradeUserMapper;
+    @Autowired
+    private IGoodsCourseService iGoodsCourseService;
 
     @Override
     public UserStudyRecordVo queryById(Long recordId) {
@@ -802,6 +807,112 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
         return sectionList;
     }
 
+    @Override
+    public List<ClassPeriodVo> goodsAllListWithExam(UserStudyRecordQueryBo bo) {
+        if(Validator.isEmpty(bo.getGoodsId())){
+            throw new CustomException("参数缺失");
+        }
+        //存储整个目录节列表
+        List<ClassPeriodVo> sectionList = new ArrayList<>();
+        GoodsCourseQueryBo queryBo = new GoodsCourseQueryBo();
+        queryBo.setGoodsId(bo.getGoodsId());
+        List<CourseVo> courseList = iGoodsCourseService.selectList(queryBo);
+        for(CourseVo courseVo : courseList){
+            bo.setCourseId(courseVo.getCourseId());
+            //获取课程目录
+            List<ClassPeriodVo> list = baseMapper.listMenu(bo);
+            //排序目录
+            Collections.sort(list);
+            for (ClassPeriodVo classPeriodVo : list) {
+                //为模块搜索下面的章 和节
+                if (classPeriodVo.getType() == 1){
+                    UserStudyRecordQueryBo moduleQueryBo = new UserStudyRecordQueryBo();
+                    moduleQueryBo.setModuleId(classPeriodVo.getId());
+                    List<ClassPeriodVo> classPeriodChapterVos = baseMapper.listModuleChapter(moduleQueryBo);
+                    //排序章目录
+                    Collections.sort(classPeriodChapterVos);
+                    for (ClassPeriodVo classChapterVo : classPeriodChapterVos) {
+                        UserStudyRecordQueryBo chapterQueryBo = new UserStudyRecordQueryBo();
+                        chapterQueryBo.setChapterId(classChapterVo.getId());
+                        List<ClassPeriodVo> classPeriodSectionVos = baseMapper.listChapterSection(chapterQueryBo);
+                        //排序节目录
+                        Collections.sort(classPeriodSectionVos);
+                        for (ClassPeriodVo classSectionVo : classPeriodSectionVos) {
+                            classSectionVo.setModuleId(classPeriodVo.getId());
+                            classSectionVo.setChapterId(classChapterVo.getId());
+                            classSectionVo.setSectionId(classSectionVo.getId());
+                            classSectionVo.setType(3L);
+                            sectionList.add(classSectionVo);
+                        }
+                        List<ClassPeriodSectionVo> cExamList= classGradeUserMapper.listperiodExam(classChapterVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), classPeriodVo.getId());
+                        for (ClassPeriodSectionVo sectionVo : cExamList) {
+                            ClassPeriodVo classSectionVo = BeanUtil.toBean(sectionVo,ClassPeriodVo.class);
+                            classSectionVo.setType(4L);
+                            classSectionVo.setExamId(sectionVo.getId());
+                            sectionList.add(classSectionVo);
+                        }
+                    }
+                    List<ClassPeriodChapterVo> mExamList =  classGradeUserMapper.listperiodModuleExam( bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), classPeriodVo.getId());
+                    for (ClassPeriodChapterVo chapterVo : mExamList) {
+                        ClassPeriodVo classSectionVo = BeanUtil.toBean(chapterVo,ClassPeriodVo.class);
+                        classSectionVo.setType(5L);
+                        classSectionVo.setExamId(chapterVo.getId());
+                        sectionList.add(classSectionVo);
+                    }
+                }
+                //为章搜索节记录
+                if (classPeriodVo.getType() == 2){
+                    UserStudyRecordQueryBo chapterQueryBo = new UserStudyRecordQueryBo();
+                    chapterQueryBo.setChapterId(classPeriodVo.getId());
+                    List<ClassPeriodVo> classPeriodSectionVos = baseMapper.listChapterSection(chapterQueryBo);
+                    //排序节目录
+                    Collections.sort(classPeriodSectionVos);
+                    for (ClassPeriodVo classSectionVo : classPeriodSectionVos) {
+                        classSectionVo.setModuleId(0L);
+                        classSectionVo.setChapterId(classPeriodVo.getId());
+                        classSectionVo.setSectionId(classSectionVo.getId());
+                        classSectionVo.setType(3L);
+                        sectionList.add(classSectionVo);
+                    }
+                    List<ClassPeriodSectionVo> cExamList= classGradeUserMapper.listperiodExam(classPeriodVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), 0L);
+                    for (ClassPeriodSectionVo sectionVo : cExamList) {
+                        ClassPeriodVo classSectionVo = BeanUtil.toBean(sectionVo,ClassPeriodVo.class);
+                        classSectionVo.setType(4L);
+                        classSectionVo.setExamId(sectionVo.getId());
+                        sectionList.add(classSectionVo);
+                    }
+
+                }
+                //为节搜索学时记录
+                if (classPeriodVo.getType() == 3){
+                    classPeriodVo.setModuleId(0L);
+                    classPeriodVo.setChapterId(0L);
+                    classPeriodVo.setSectionId(classPeriodVo.getId());
+                    sectionList.add(classPeriodVo);
+                }
+            }
+            for(ClassPeriodVo section : sectionList){
+                section.setGoodsId(bo.getGoodsId());
+                section.setGradeId(bo.getGradeId());
+                section.setUserId(bo.getUserId());
+                section.setCourseId(bo.getCourseId());
+                if(section.getType()<4){
+                    section.setStudyStatus(baseMapper.getStudyStatus(section));
+                }else{
+                    if(section.getType()==4){
+                        section.setExamType(1);
+                    }
+                    if(section.getType()==5){
+                        section.setExamType(3);
+                    }
+                    section.setStudyStatus(baseMapper.getStudyExamStatus(section));
+                }
+
+            }
+        }
+        return sectionList;
+    }
+
     @Override
     public List<SectionStudyRecordVo> listUserRecord(UserStudyRecordQueryBo bo) {
         return this.baseMapper.listUserRecord(bo);
@@ -884,7 +995,6 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
         if(Validator.isNotEmpty(vo)&&Validator.isNotEmpty(bankVo)){
             if(vo.getUpdateTime().longValue()<bankVo.getUpdateTime().longValue()){
                 vo = mergeToData(bankVo);
-
             }
         }
         return vo;

+ 16 - 0
zhongzheng-system/src/main/resources/mapper/modules/top/TopDivideLogMapper.xml

@@ -111,11 +111,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                         ( pay_status !=1, dl.deduct_money, 0 )) AS un_deduct_money_total
         FROM
             top_divide_log dl
+            LEFT JOIN sys_tenant st ON dl.tenant_id = st.tenant_id
         WHERE
               1=1
         <if test="divideType != null">
             AND dl.divide_type = #{divideType}
         </if>
+        <if test="tenantId != null and tenantId != ''">
+            AND dl.tenant_id = #{tenantId}
+        </if>
+        <if test="payStatus != null">
+            AND dl.pay_status = #{payStatus}
+        </if>
+        <if test="billType != null and billType != ''">
+            AND st.bill_type = #{billType}
+        </if>
+        <if test="monthTime != null and monthTime != ''">
+            AND dl.month_time in
+            <foreach collection="monthTime" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
     </select>
 
     <select id="getSellerList" parameterType="com.zhongzheng.modules.top.financial.bo.TopDivideLogQueryBo"  resultType="com.zhongzheng.modules.top.financial.vo.TopDivideLogVo">