yangdamao пре 2 година
родитељ
комит
a0e8b52669

+ 0 - 10
zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java

@@ -7,8 +7,6 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.zhongzheng.common.config.RuoYiConfig;
 import com.zhongzheng.common.constant.Constants;
 import com.zhongzheng.common.core.domain.AjaxResult;
-import com.zhongzheng.common.core.domain.model.LoginBody;
-import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.common.utils.ToolsUtils;
 import com.zhongzheng.common.utils.file.FileUploadUtils;
@@ -17,7 +15,6 @@ import com.zhongzheng.common.utils.poi.ExcelUtil;
 import com.zhongzheng.framework.config.ServerConfig;
 import com.zhongzheng.framework.web.service.WxLoginService;
 import com.zhongzheng.modules.base.bo.ConfigQueryBo;
-import com.zhongzheng.modules.course.vo.CourseMenuVo;
 import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
 import com.zhongzheng.modules.goods.bo.GoodsStudyUrlBo;
 import com.zhongzheng.modules.goods.bo.UserGoodsListBo;
@@ -27,26 +24,19 @@ import com.zhongzheng.modules.goods.vo.UserGoodsListVo;
 import com.zhongzheng.modules.grade.bo.*;
 import com.zhongzheng.modules.grade.service.IClassGradeService;
 import com.zhongzheng.modules.grade.service.IUserPeriodService;
-import com.zhongzheng.modules.grade.vo.ClassNpUserInfoVo;
-import com.zhongzheng.modules.grade.vo.ClassPeriodStudentExportAllVo;
 import com.zhongzheng.modules.grade.vo.SyncGoodsExport;
-import com.zhongzheng.modules.order.bo.OrderAddBo;
 import com.zhongzheng.modules.order.domain.Order;
 import com.zhongzheng.modules.order.domain.OrderGoods;
 import com.zhongzheng.modules.order.service.IOrderGoodsService;
 import com.zhongzheng.modules.order.service.IOrderService;
-import com.zhongzheng.modules.order.service.impl.OrderServiceImpl;
-import com.zhongzheng.modules.system.bo.SysNginxConfigAddBo;
 import com.zhongzheng.modules.system.bo.SysTenantAdminBo;
 import com.zhongzheng.modules.system.domain.SysTenant;
 import com.zhongzheng.modules.system.service.ISysTenantService;
-import com.zhongzheng.modules.system.service.ISysUserService;
 import com.zhongzheng.modules.system.service.ISysWebService;
 import com.zhongzheng.modules.system.vo.SysTenantVo;
 import com.zhongzheng.modules.top.bo.TopSysTenantRegisterAddBo;
 import com.zhongzheng.modules.top.service.ITopSysTenantRegisterService;
 import com.zhongzheng.modules.user.service.IUserService;
-import com.zhongzheng.modules.user.vo.UserExportVo;
 import com.zhongzheng.modules.wx.bo.WxShareGoodsBo;
 import com.zhongzheng.modules.wx.service.IWxPayService;
 import io.swagger.annotations.ApiOperation;

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/ClassGradeListBo.java

@@ -18,4 +18,6 @@ public class ClassGradeListBo implements Serializable {
     private List<Long> subIds;
 
     private Long tenantId;
+
+    private String educationName;
 }

+ 63 - 60
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeServiceImpl.java

@@ -1232,6 +1232,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
         //祥粤云
         Long tenantId = 867735392558919680L;
         bgListBo.setTenantId(tenantId);
+        bgListBo.setEducationName("继续教育");
         List<Long> goodsIds = baseMapper.getGoodsIdByBoTenant(bgListBo);
         if (CollectionUtils.isEmpty(goodsIds)) {
             throw new CustomException("改业务层次下不存在商品,请检查!");
@@ -1240,7 +1241,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
         String encoded = ServletUtils.getEncoded("PIY");
         if (CollectionUtils.isEmpty(classGrades)) {
             //创建新预报名班级
-            creatClass(goodsIds.get(0), tenantId, encoded);
+            creatClass(goodsIds, tenantId, encoded);
         } else {
             //获取班级创建最多的机构
             Map<Long, List<ClassGrade>> map = classGrades.stream().collect(Collectors.groupingBy(ClassGrade::getTenantId));
@@ -1265,7 +1266,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
                 return classUserNumBo;
             } else {
                 //创建新预报名班级
-                creatClass(goodsIds.get(0), tenantId, encoded);
+                creatClass(goodsIds, tenantId, encoded);
             }
         }
 
@@ -1395,66 +1396,68 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
     }
 
     //创建预开班班级
-    private void creatClass(Long goodsId, Long tenantId, String code) {
-        //创建新班级
-        Goods goods = iGoodsService.getGoodsByIdTenant(goodsId, tenantId);
-        CourseBusiness businessVo = iCourseBusinessService.getBusinessByIdTenant(goods.getBusinessId(), tenantId);
-        boolean isConfigTp = false; //商品是否有配置选班模板
-        if (Validator.isNotEmpty(businessVo) && Validator.isNotEmpty(businessVo.getTemplateName()) && businessVo.getTemplateName().equals("班级")) {
-            isConfigTp = true;
-        }
-        ClassGrade classGrade = new ClassGrade();
-        classGrade.setCreateTime(DateUtils.getNowTime());
-        if (isConfigTp) {
-            classGrade.setClassStatus(0);
-            classGrade.setLearningStatus(2);//待定
-            classGrade.setStudentUpper(ClassGrade.INIT_UPPER); //上限300
-            //生成官方班级编号
-            classGrade.setOfficialName(code);
-        }
-        classGrade.setUpdateTime(DateUtils.getNowTime());
-        classGrade.setStatus(1);
-        String gradeCode = ServletUtils.getEncoded("BJ");
-        classGrade.setGradeCode(gradeCode);
+    private void creatClass(List<Long> goodsIds, Long tenantId, String code) {
+        goodsIds.forEach(goodsId -> {
+            //创建新班级
+            Goods goods = iGoodsService.getGoodsByIdTenant(goodsId, tenantId);
+            CourseBusiness businessVo = iCourseBusinessService.getBusinessByIdTenant(goods.getBusinessId(), tenantId);
+            boolean isConfigTp = false; //商品是否有配置选班模板
+            if (Validator.isNotEmpty(businessVo) && Validator.isNotEmpty(businessVo.getTemplateName()) && businessVo.getTemplateName().equals("班级")) {
+                isConfigTp = true;
+            }
+            ClassGrade classGrade = new ClassGrade();
+            classGrade.setCreateTime(DateUtils.getNowTime());
+            if (isConfigTp) {
+                classGrade.setClassStatus(0);
+                classGrade.setLearningStatus(2);//待定
+                classGrade.setStudentUpper(ClassGrade.INIT_UPPER); //上限300
+                //生成官方班级编号
+                classGrade.setOfficialName(code);
+            }
+            classGrade.setUpdateTime(DateUtils.getNowTime());
+            classGrade.setStatus(1);
+            String gradeCode = ServletUtils.getEncoded("BJ");
+            classGrade.setGradeCode(gradeCode);
 //        classGrade.setClassName(goodsName + gradeCode);
-        //班级名称 年份+期数+业务层次(俗名)+教育类型+科目(存在多个科目时,显示多个科目,用“+”分割)
-        String businessName = businessVo.getAliasName();
-        CourseEducationType educationType = courseEducationTypeService.getEducationByIdtenant(goods.getEducationTypeId(), tenantId);
-        String educationName = educationType.getEducationName();
-        String className = businessName + educationName;
-        if (net.polyv.common.v1.util.StringUtils.isNotBlank(goods.getSubjectIds())) {
-            ClassGradeListBo bgListBo = new ClassGradeListBo();
-            bgListBo.setSubIds(Arrays.stream(goods.getSubjectIds().split(",")).map(x -> Long.valueOf(x)).collect(Collectors.toList()));
-            bgListBo.setTenantId(tenantId);
-            List<CourseSubject> subjects = iCourseSubjectService.listByIdsTenant(bgListBo);
-            List<String> names = subjects.stream().map(CourseSubject::getSubjectName).collect(Collectors.toList());
-            className = String.format("%s(%s)", className, org.apache.commons.lang3.StringUtils.join(names, '+'));
-        }
-        Integer nameSort = 1;
-        //获取排序值
-        List<ClassGrade> list = baseMapper.queryListByNameTenantId(className, tenantId);
-        if (CollectionUtils.isNotEmpty(list)) {
-            List<Integer> collect = list.stream().filter(x -> x.getClassName().contains("第") && x.getClassName().contains("期")).map(item -> {
-                String name = item.getClassName();
-                String substring = name.substring(name.indexOf("第") + 1, name.indexOf("期"));
-                return Integer.parseInt(substring);
-            }).collect(Collectors.toList());
-            if (CollectionUtils.isNotEmpty(collect)) {
-                Integer integer = collect.stream().sorted(Comparator.reverseOrder()).findFirst().get();
-                nameSort = integer + 1;
+            //班级名称 年份+期数+业务层次(俗名)+教育类型+科目(存在多个科目时,显示多个科目,用“+”分割)
+            String businessName = businessVo.getAliasName();
+            CourseEducationType educationType = courseEducationTypeService.getEducationByIdtenant(goods.getEducationTypeId(), tenantId);
+            String educationName = educationType.getEducationName();
+            String className = businessName + educationName;
+            if (net.polyv.common.v1.util.StringUtils.isNotBlank(goods.getSubjectIds())) {
+                ClassGradeListBo bgListBo = new ClassGradeListBo();
+                bgListBo.setSubIds(Arrays.stream(goods.getSubjectIds().split(",")).map(x -> Long.valueOf(x)).collect(Collectors.toList()));
+                bgListBo.setTenantId(tenantId);
+                List<CourseSubject> subjects = iCourseSubjectService.listByIdsTenant(bgListBo);
+                List<String> names = subjects.stream().map(CourseSubject::getSubjectName).collect(Collectors.toList());
+                className = String.format("%s(%s)", className, org.apache.commons.lang3.StringUtils.join(names, '+'));
             }
-        }
-        classGrade.setClassName(String.format("%s年第%s期%s", goods.getYear(), nameSort, className));
-        classGrade.setTenantId(tenantId);
-        save(classGrade);
-        //绑定班级商品
-        ClassGradeGoods classGradeGoods = new ClassGradeGoods();
-        classGradeGoods.setGradeId(classGrade.getGradeId());
-        classGradeGoods.setGoodsId(goodsId);
-        classGradeGoods.setCreateTime(DateUtils.getNowTime());
-        classGradeGoods.setUpdateTime(DateUtils.getNowTime());
-        classGradeGoods.setTenantId(tenantId);
-        iClassGradeGoodsService.save(classGradeGoods);
+            Integer nameSort = 1;
+            //获取排序值
+            List<ClassGrade> list = baseMapper.queryListByNameTenantId(className, tenantId);
+            if (CollectionUtils.isNotEmpty(list)) {
+                List<Integer> collect = list.stream().filter(x -> x.getClassName().contains("第") && x.getClassName().contains("期")).map(item -> {
+                    String name = item.getClassName();
+                    String substring = name.substring(name.indexOf("第") + 1, name.indexOf("期"));
+                    return Integer.parseInt(substring);
+                }).collect(Collectors.toList());
+                if (CollectionUtils.isNotEmpty(collect)) {
+                    Integer integer = collect.stream().sorted(Comparator.reverseOrder()).findFirst().get();
+                    nameSort = integer + 1;
+                }
+            }
+            classGrade.setClassName(String.format("%s年第%s期%s", goods.getYear(), nameSort, className));
+            classGrade.setTenantId(tenantId);
+            save(classGrade);
+            //绑定班级商品
+            ClassGradeGoods classGradeGoods = new ClassGradeGoods();
+            classGradeGoods.setGradeId(classGrade.getGradeId());
+            classGradeGoods.setGoodsId(goodsId);
+            classGradeGoods.setCreateTime(DateUtils.getNowTime());
+            classGradeGoods.setUpdateTime(DateUtils.getNowTime());
+            classGradeGoods.setTenantId(tenantId);
+            iClassGradeGoodsService.save(classGradeGoods);
+        });
     }
 
 

+ 14 - 16
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserMockSubscribeServiceImpl.java

@@ -3,42 +3,36 @@ package com.zhongzheng.modules.user.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.base.bo.ConsoleQueryBo;
 import com.zhongzheng.modules.mock.bo.UserMockActivityAddBo;
 import com.zhongzheng.modules.mock.domain.MockApply;
-import com.zhongzheng.modules.mock.domain.MockMajorSubject;
 import com.zhongzheng.modules.mock.domain.MockMajorSubjectGoods;
 import com.zhongzheng.modules.mock.domain.MockMajorSubjectTime;
 import com.zhongzheng.modules.mock.service.IMockApplyService;
 import com.zhongzheng.modules.mock.service.IMockMajorSubjectGoodsService;
-import com.zhongzheng.modules.mock.service.IMockMajorSubjectService;
 import com.zhongzheng.modules.mock.service.IMockMajorSubjectTimeService;
-import com.zhongzheng.modules.mock.vo.MockApplyVo;
 import com.zhongzheng.modules.mock.vo.MockMajorSubjectTimeVo;
 import com.zhongzheng.modules.order.service.IOrderGoodsService;
 import com.zhongzheng.modules.order.service.IOrderService;
-import com.zhongzheng.modules.user.domain.User;
-import com.zhongzheng.modules.user.domain.UserMockRecord;
-import com.zhongzheng.modules.user.service.IUserMockRecordService;
-import com.zhongzheng.modules.user.service.IUserService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 import com.zhongzheng.modules.user.bo.UserMockSubscribeAddBo;
-import com.zhongzheng.modules.user.bo.UserMockSubscribeQueryBo;
 import com.zhongzheng.modules.user.bo.UserMockSubscribeEditBo;
+import com.zhongzheng.modules.user.bo.UserMockSubscribeQueryBo;
+import com.zhongzheng.modules.user.domain.UserMockRecord;
 import com.zhongzheng.modules.user.domain.UserMockSubscribe;
 import com.zhongzheng.modules.user.mapper.UserMockSubscribeMapper;
-import com.zhongzheng.modules.user.vo.UserMockSubscribeVo;
+import com.zhongzheng.modules.user.service.IUserMockRecordService;
 import com.zhongzheng.modules.user.service.IUserMockSubscribeService;
+import com.zhongzheng.modules.user.vo.UserMockSubscribeVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
 
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -316,6 +310,8 @@ public class UserMockSubscribeServiceImpl extends ServiceImpl<UserMockSubscribeM
                 //把用户预约的数据和默认数据组合在一起
                 userMockSubscribeList2.forEach(userMockSubscribe -> {
                     UserMockSubscribeVo userMockSubscribeVo = iMockMajorSubjectTimeService.listByEachExamId(userMockSubscribe.getEachExamId());
+                    userMockSubscribeVo.setOrderGoodsId(userMockSubscribe.getOrderGoodsId());
+                    userMockSubscribeVo.setGoodsId(userMockSubscribe.getOrderGoodsId());
                     if (Validator.isNotEmpty(userMockSubscribe.getHandStatus())){
                         userMockSubscribeVo.setHandStatus(userMockSubscribe.getHandStatus());
                     }
@@ -368,6 +364,8 @@ public class UserMockSubscribeServiceImpl extends ServiceImpl<UserMockSubscribeM
                             .eq(ObjectUtils.isNotNull(userMockSubscribeVo.getMockMajorSubjectId()), UserMockSubscribe::getMockMajorSubjectId, userMockSubscribeVo.getMockMajorSubjectId()));
                     if (ObjectUtils.isNotNull(entity)){
                         userMockSubscribeVo.setSubscribeId(entity.getSubscribeId());
+                        userMockSubscribeVo.setOrderGoodsId(entity.getOrderGoodsId());
+                        userMockSubscribeVo.setGoodsId(entity.getGoodsId());
                         userMockSubscribeVos.add(userMockSubscribeVo);
                     }
                 });

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

@@ -1015,8 +1015,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         FROM
             goods g
             LEFT JOIN course_business cb ON g.business_id = cb.id AND cb.tenant_id = #{tenantId}
+            LEFT JOIN course_project_type cpt ON cb.project_id = cpt.id AND cpt.tenant_id = #{tenantId}
+            LEFT JOIN course_education_type cet ON cpt.education_id = cet.id AND cet.tenant_id = #{tenantId}
         WHERE
-        cb.alias_name = #{aliasName} AND g.`status` = 1 AND g.tenant_id = #{tenantId}
+        cb.alias_name = #{aliasName} AND g.`status` = 1 AND g.tenant_id = #{tenantId} AND g.goods_status = 1 AND cet.education_name = #{educationName}
         AND (SELECT COUNT(*) FROM sys_old_org sog WHERE sog.tenant_id = g.tenant_id AND sog.share_class = 1) > 0
         <if test="subIds != null and subIds.size()!=0 ">
             AND (