Browse Source

Merge remote-tracking branch 'origin/dev' into dev

fujinggui 3 years ago
parent
commit
a1eef74b8f
20 changed files with 215 additions and 132 deletions
  1. 3 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/grade/ClassGradeController.java
  2. 3 4
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/order/OrderGoodsController.java
  3. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseAddBo.java
  4. 3 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseEditBo.java
  5. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/domain/Course.java
  6. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseMenuServiceImpl.java
  7. 40 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java
  8. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseVo.java
  9. 6 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsPeriodVo.java
  10. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/mapper/ClassGradeUserMapper.java
  11. 2 7
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java
  12. 2 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderSubjectUserBuyBo.java
  13. 2 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/IOrderGoodsService.java
  14. 23 16
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsServiceImpl.java
  15. 30 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/vo/OrderUserGoodsVo.java
  16. 7 3
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml
  17. 72 85
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseMenuMapper.xml
  18. 1 1
      zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsCourseMapper.xml
  19. 11 10
      zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml
  20. 2 2
      zhongzheng-system/src/main/resources/mapper/modules/user/UserMockSubscribeMapper.xml

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

@@ -117,6 +117,9 @@ public class ClassGradeController extends BaseController {
         if (classGradeVo.getInterfaceAccountId() != null ){
         if (classGradeVo.getInterfaceAccountId() != null ){
             integers.add(3);
             integers.add(3);
         }
         }
+        if (classGradeVo.getNoInterfaceAccountId() != null ){
+            integers.add(4);
+        }
         //初始化需要得到的数组
         //初始化需要得到的数组
         Integer[] array = new Integer[integers.size()];
         Integer[] array = new Integer[integers.size()];
 
 

+ 3 - 4
zhongzheng-admin/src/main/java/com/zhongzheng/controller/order/OrderGoodsController.java

@@ -16,6 +16,7 @@ import com.zhongzheng.modules.order.bo.OrderSubjectUserBuyBo;
 import com.zhongzheng.modules.order.service.IOrderGoodsService;
 import com.zhongzheng.modules.order.service.IOrderGoodsService;
 import com.zhongzheng.modules.order.vo.OrderGoodsLiveExportVo;
 import com.zhongzheng.modules.order.vo.OrderGoodsLiveExportVo;
 import com.zhongzheng.modules.order.vo.OrderGoodsVo;
 import com.zhongzheng.modules.order.vo.OrderGoodsVo;
+import com.zhongzheng.modules.order.vo.OrderUserGoodsVo;
 import com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo;
 import com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo;
 import com.zhongzheng.modules.user.entity.ClientLoginUser;
 import com.zhongzheng.modules.user.entity.ClientLoginUser;
 import com.zhongzheng.modules.user.service.IUserStudyRecordService;
 import com.zhongzheng.modules.user.service.IUserStudyRecordService;
@@ -201,9 +202,7 @@ public class OrderGoodsController extends BaseController {
     @ApiOperation("业务层次,科目查询用户的购买商品列表")
     @ApiOperation("业务层次,科目查询用户的购买商品列表")
     @PreAuthorize("@ss.hasPermi('system:invoice:list')")
     @PreAuthorize("@ss.hasPermi('system:invoice:list')")
     @GetMapping("/listUserSubjectGoods")
     @GetMapping("/listUserSubjectGoods")
-    public TableDataInfo<OrderGoodsVo> listUserSubjectGoods(OrderSubjectUserBuyBo bo) {
-        startPage();
-        List<OrderGoodsVo> list = iOrderGoodsService.listUserSubjectGoods(bo);
-        return getDataTable(list);
+    public AjaxResult<List<OrderUserGoodsVo>> listUserSubjectGoods(OrderSubjectUserBuyBo bo) {
+        return AjaxResult.success(iOrderGoodsService.listUserSubjectGoods(bo));
     }
     }
 }
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseAddBo.java

@@ -75,5 +75,8 @@ public class CourseAddBo {
     /** 项目id */
     /** 项目id */
     @ApiModelProperty("项目id")
     @ApiModelProperty("项目id")
     private Long projectId;
     private Long projectId;
+    /** 1显示 0隐藏 */
+    @ApiModelProperty("1显示 0隐藏")
+    private Integer courseShow;
 
 
 }
 }

+ 3 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseEditBo.java

@@ -93,5 +93,7 @@ public class CourseEditBo {
     /** 项目id */
     /** 项目id */
     @ApiModelProperty("项目id")
     @ApiModelProperty("项目id")
     private Long projectId;
     private Long projectId;
-
+    /** 1显示 0隐藏 */
+    @ApiModelProperty("1显示 0隐藏")
+    private Integer courseShow;
 }
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/domain/Course.java

@@ -67,4 +67,6 @@ private static final long serialVersionUID=1L;
     private Long subjectId;
     private Long subjectId;
     /** 项目id */
     /** 项目id */
     private Long projectId;
     private Long projectId;
+    /** 1显示 0隐藏 */
+    private Integer courseShow;
 }
 }

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseMenuServiceImpl.java

@@ -146,6 +146,7 @@ public class CourseMenuServiceImpl extends ServiceImpl<CourseMenuMapper, CourseM
         addBo.setEducationTypeId(goodsVo.getEducationTypeId());
         addBo.setEducationTypeId(goodsVo.getEducationTypeId());
         addBo.setProjectId(goodsVo.getProjectId());
         addBo.setProjectId(goodsVo.getProjectId());
         addBo.setBusinessId(goodsVo.getBusinessId());
         addBo.setBusinessId(goodsVo.getBusinessId());
+        addBo.setCourseShow(0);//隐藏课程
         Long courseId = iCourseService.insertByAddBo(addBo);
         Long courseId = iCourseService.insertByAddBo(addBo);
         GoodsCourseAddBo courseAddBo = new GoodsCourseAddBo();
         GoodsCourseAddBo courseAddBo = new GoodsCourseAddBo();
         courseAddBo.setCourseId(courseId);
         courseAddBo.setCourseId(courseId);

+ 40 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -257,6 +257,46 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
             subjectStudyRecordQueryBo.setGoodsId(goodsPeriodVo.getGoodsId());
             subjectStudyRecordQueryBo.setGoodsId(goodsPeriodVo.getGoodsId());
             subjectStudyRecordQueryBo.setUserId(bo.getUserId());
             subjectStudyRecordQueryBo.setUserId(bo.getUserId());
             subjectStudyRecordQueryBo.setGradeId(goodsPeriodVo.getGradeId());
             subjectStudyRecordQueryBo.setGradeId(goodsPeriodVo.getGradeId());
+
+            //查询对应考试安排
+            List<ExamApplyGoodsVo> examApplyGoodsVoList = iExamApplyGoodsService.listByGoodsId(goodsPeriodVo.getGoodsId());
+            if (examApplyGoodsVoList != null && examApplyGoodsVoList.size() > 0) {
+                List<ExamApplyGoodsVo> examApplyGoodsVos = new ArrayList<>();
+                List<ExamApplyGoodsVo> examApplyGoodsVos2 = new ArrayList<>();
+                examApplyGoodsVoList.forEach(examApplyGoodsVo -> {
+                    LambdaQueryWrapper<ExamApplyUser> lqw = Wrappers.lambdaQuery();
+                    lqw.eq(ExamApplyUser::getApplyId, examApplyGoodsVo.getApplyId());
+                    List<ExamApplyUser> examApplyUserList = iExamApplyUserService.list(lqw);
+                    if (examApplyUserList != null && examApplyUserList.size() > 0) {
+                        ArrayList<Long> userIds = new ArrayList<>();
+                        examApplyUserList.forEach(examApplyUser -> {
+                            userIds.add(examApplyUser.getUserId());
+                        });
+                        if (userIds.contains(bo.getUserId())) {
+                            examApplyGoodsVos.add(examApplyGoodsVo);
+                        }
+                    }else {
+                        examApplyGoodsVos2.add(examApplyGoodsVo);
+                    }
+                    LambdaQueryWrapper<ExamBeforeApply> lq = Wrappers.lambdaQuery();
+                    lq.eq(ExamBeforeApply::getApplyId, examApplyGoodsVo.getApplyId());
+                    ExamBeforeApply examBeforeApply = iExamBeforeApplyService.getOne(lq);
+                    if (examBeforeApply != null) {
+                        LambdaQueryWrapper<ExamBefore> lqw1 = Wrappers.lambdaQuery();
+                        lqw1.eq(ExamBefore::getBeforeId, examBeforeApply.getBeforeId());
+                        lqw1.eq(ExamBefore::getStatus, 1);
+                        ExamBefore examBefore = iExamBeforeService.getOne(lqw1);
+                        if (examBefore != null) {
+                            if (System.currentTimeMillis()/1000 > examBefore.getBeforeStartTime() && System.currentTimeMillis()/1000 < examBefore.getBeforeEndTime()) {
+                                goodsPeriodVo.setBeforeStatus(1L);
+                                goodsPeriodVo.setBeforeName(examBefore.getBeforeName());
+                            }
+                        }
+                    }
+                });
+                examApplyGoodsVos.addAll(examApplyGoodsVos2);
+                goodsPeriodVo.setExamApplyGoodsList(examApplyGoodsVos);
+            }
             //学时审核状态
             //学时审核状态
        //     List<SubjectStudyRecordVo> subjectStudyRecordVos = iUserStudyRecordService.listSubject(subjectStudyRecordQueryBo);
        //     List<SubjectStudyRecordVo> subjectStudyRecordVos = iUserStudyRecordService.listSubject(subjectStudyRecordQueryBo);
             /*if (!CollectionUtils.isEmpty(subjectStudyRecordVos)) {
             /*if (!CollectionUtils.isEmpty(subjectStudyRecordVos)) {

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseVo.java

@@ -115,4 +115,5 @@ public class CourseVo {
 	/** 1显示 0隐藏 */
 	/** 1显示 0隐藏 */
 	@ApiModelProperty("1显示 0隐藏")
 	@ApiModelProperty("1显示 0隐藏")
 	private Integer courseShow;
 	private Integer courseShow;
+
 }
 }

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsPeriodVo.java

@@ -152,6 +152,12 @@ public class GoodsPeriodVo {
 	private String projectName;
 	private String projectName;
 	@ApiModelProperty("业务层次名称")
 	@ApiModelProperty("业务层次名称")
 	private String businessName;
 	private String businessName;
+	@ApiModelProperty("官方班级")
+	private String officialName;
 	@ApiModelProperty("商品关联的考试安排")
 	@ApiModelProperty("商品关联的考试安排")
 	private List<ExamApplyGoodsVo> applyList;
 	private List<ExamApplyGoodsVo> applyList;
+	/** 考试列表 */
+	@Excel(name = "考试列表")
+	@ApiModelProperty("考试列表")
+	private List<ExamApplyGoodsVo> examApplyGoodsList;
 }
 }

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

@@ -75,5 +75,5 @@ public interface ClassGradeUserMapper extends BaseMapper<ClassGradeUser> {
 
 
     List<ClassGradeUserGoodsVo> selectGoodsGradeList(Long goodsId);
     List<ClassGradeUserGoodsVo> selectGoodsGradeList(Long goodsId);
 
 
-    List<ClassGradeUserVo> queryCountList(@Param("projectId")Integer projectId, @Param("all") Integer all);
+    List<ClassGradeUserVo> queryCountList(@Param("projectId")Integer projectId, @Param("businessId")Integer businessId, @Param("all") Integer all);
 }
 }

+ 2 - 7
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -1685,7 +1685,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 vo.setProjectId(courseProjectTypeVo.getId().intValue());
                 vo.setProjectId(courseProjectTypeVo.getId().intValue());
                 vo.setEducationName(courseProjectTypeVo.getEducationName());
                 vo.setEducationName(courseProjectTypeVo.getEducationName());
                 vo.setEducationTypeId(courseProjectTypeVo.getEducationId().longValue());
                 vo.setEducationTypeId(courseProjectTypeVo.getEducationId().longValue());
-                List<ClassGradeUserVo> countList = queryCountList(courseProjectTypeVo.getId().intValue(), 0);
+                List<ClassGradeUserVo> countList = baseMapper.queryCountList(courseProjectTypeVo.getId().intValue(), courseBusinessVo.getId().intValue(), 0);
                 for (ClassGradeUserVo classGradeUser : countList) {
                 for (ClassGradeUserVo classGradeUser : countList) {
                     if (Validator.isNotEmpty(classGradeUser.getLearnStatus())) {
                     if (Validator.isNotEmpty(classGradeUser.getLearnStatus())) {
                         //统计账号未开通数量
                         //统计账号未开通数量
@@ -1728,7 +1728,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     }
                     }
                 }
                 }
                 //统计所有班级人数
                 //统计所有班级人数
-                vo.setUserNum(queryCountList(courseProjectTypeVo.getId().intValue(), null).size());
+                vo.setUserNum(baseMapper.queryCountList(courseProjectTypeVo.getId().intValue(), courseBusinessVo.getId().intValue(), null).size());
                 vo.setNotConfiguredNum(notConfiguredNum);
                 vo.setNotConfiguredNum(notConfiguredNum);
                 vo.setInterfaceNum(interfaceNum);
                 vo.setInterfaceNum(interfaceNum);
                 vo.setNoInterfaceNum(noInterfaceNum);
                 vo.setNoInterfaceNum(noInterfaceNum);
@@ -1749,11 +1749,6 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
     }
     }
 
 
 
 
-    private List<ClassGradeUserVo> queryCountList(Integer projectId, Integer all) {
-        return baseMapper.queryCountList(projectId, all);
-    }
-
-
     /**
     /**
      * 实体类转化成视图对象
      * 实体类转化成视图对象
      *
      *

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderSubjectUserBuyBo.java

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
 
 
 import javax.validation.constraints.NotNull;
 import javax.validation.constraints.NotNull;
+import java.util.List;
 
 
 /**
 /**
  * 订单添加对象 order
  * 订单添加对象 order
@@ -18,7 +19,7 @@ public class OrderSubjectUserBuyBo {
 
 
     @NotNull(message = "身份证号不能为空")
     @NotNull(message = "身份证号不能为空")
     @ApiModelProperty("身份证号")
     @ApiModelProperty("身份证号")
-    private String idCard;
+    private List<String> idCard;
 
 
 
 
     @ApiModelProperty("业务层次ID")
     @ApiModelProperty("业务层次ID")

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/IOrderGoodsService.java

@@ -5,6 +5,7 @@ import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
 import com.zhongzheng.modules.order.bo.*;
 import com.zhongzheng.modules.order.bo.*;
 import com.zhongzheng.modules.order.domain.OrderGoods;
 import com.zhongzheng.modules.order.domain.OrderGoods;
 import com.zhongzheng.modules.order.vo.OrderGoodsVo;
 import com.zhongzheng.modules.order.vo.OrderGoodsVo;
+import com.zhongzheng.modules.order.vo.OrderUserGoodsVo;
 
 
 import java.util.Collection;
 import java.util.Collection;
 import java.util.List;
 import java.util.List;
@@ -81,5 +82,5 @@ public interface IOrderGoodsService extends IService<OrderGoods> {
 
 
     List<OrderGoodsVo> listGoodsUserLive(Long userId);
     List<OrderGoodsVo> listGoodsUserLive(Long userId);
 
 
-    List<OrderGoodsVo> listUserSubjectGoods(OrderSubjectUserBuyBo bo);
+    List<OrderUserGoodsVo> listUserSubjectGoods(OrderSubjectUserBuyBo bo);
 }
 }

+ 23 - 16
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsServiceImpl.java

@@ -8,12 +8,9 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.SecurityUtils;
 import com.zhongzheng.common.utils.SecurityUtils;
-import com.zhongzheng.modules.bank.mapper.QuestionMapper;
 import com.zhongzheng.modules.base.bo.ConsoleQueryBo;
 import com.zhongzheng.modules.base.bo.ConsoleQueryBo;
-import com.zhongzheng.modules.course.domain.CourseModule;
 import com.zhongzheng.modules.course.vo.CourseVo;
 import com.zhongzheng.modules.course.vo.CourseVo;
 import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
 import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
-import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.service.IGoodsCourseService;
 import com.zhongzheng.modules.goods.service.IGoodsCourseService;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
@@ -25,14 +22,13 @@ import com.zhongzheng.modules.grade.service.IClassGradeUserService;
 import com.zhongzheng.modules.grade.vo.ClassGradeVo;
 import com.zhongzheng.modules.grade.vo.ClassGradeVo;
 import com.zhongzheng.modules.grade.vo.ClassPeriodVo;
 import com.zhongzheng.modules.grade.vo.ClassPeriodVo;
 import com.zhongzheng.modules.order.bo.*;
 import com.zhongzheng.modules.order.bo.*;
-import com.zhongzheng.modules.order.domain.Order;
 import com.zhongzheng.modules.order.domain.OrderGoods;
 import com.zhongzheng.modules.order.domain.OrderGoods;
 import com.zhongzheng.modules.order.mapper.OrderGoodsMapper;
 import com.zhongzheng.modules.order.mapper.OrderGoodsMapper;
 import com.zhongzheng.modules.order.service.IOrderGoodsService;
 import com.zhongzheng.modules.order.service.IOrderGoodsService;
 import com.zhongzheng.modules.order.service.IOrderService;
 import com.zhongzheng.modules.order.service.IOrderService;
 import com.zhongzheng.modules.order.vo.OrderGoodsVo;
 import com.zhongzheng.modules.order.vo.OrderGoodsVo;
 import com.zhongzheng.modules.order.vo.OrderListVo;
 import com.zhongzheng.modules.order.vo.OrderListVo;
-import com.zhongzheng.modules.order.vo.OrderVo;
+import com.zhongzheng.modules.order.vo.OrderUserGoodsVo;
 import com.zhongzheng.modules.user.bo.UserExamGoodsQueryBo;
 import com.zhongzheng.modules.user.bo.UserExamGoodsQueryBo;
 import com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo;
 import com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo;
 import com.zhongzheng.modules.user.domain.User;
 import com.zhongzheng.modules.user.domain.User;
@@ -40,7 +36,6 @@ import com.zhongzheng.modules.user.service.IUserExamGoodsService;
 import com.zhongzheng.modules.user.service.IUserService;
 import com.zhongzheng.modules.user.service.IUserService;
 import com.zhongzheng.modules.user.service.IUserStudyRecordService;
 import com.zhongzheng.modules.user.service.IUserStudyRecordService;
 import com.zhongzheng.modules.user.service.IUserSubscribeService;
 import com.zhongzheng.modules.user.service.IUserSubscribeService;
-import io.swagger.models.auth.In;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -401,17 +396,29 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
     }
     }
 
 
     @Override
     @Override
-    public List<OrderGoodsVo> listUserSubjectGoods(OrderSubjectUserBuyBo bo) {
-        User user = iUserService.getOne(new LambdaQueryWrapper<User>()
-                .eq(User::getIdCard,bo.getIdCard()).last("limit 1"));
-        if(Validator.isNull(user)){
-            throw new CustomException("该身份证号码用户不存在");
+    public List<OrderUserGoodsVo> listUserSubjectGoods(OrderSubjectUserBuyBo bo) {
+        List<OrderUserGoodsVo> allList = new ArrayList<>();
+        for(String idCard : bo.getIdCard()){
+            User user = iUserService.getOne(new LambdaQueryWrapper<User>()
+                    .eq(User::getIdCard,idCard).last("limit 1"));
+            if(Validator.isNull(user)){
+                OrderUserGoodsVo goodsBo = new OrderUserGoodsVo();
+                goodsBo.setIdCard(idCard);
+                goodsBo.setGoodsList(new ArrayList<>());
+                allList.add(goodsBo);
+            }else{
+                GoodsQueryBo queryBo = new GoodsQueryBo();
+                queryBo.setSubjectId(bo.getSubjectId());
+                queryBo.setBusinessId(bo.getBusinessId());
+                queryBo.setUserId(user.getUserId());
+                List<OrderGoodsVo> list = this.baseMapper.listUserSubjectGoods(queryBo);
+                OrderUserGoodsVo goodsBo = new OrderUserGoodsVo();
+                goodsBo.setIdCard(idCard);
+                goodsBo.setGoodsList(list);
+                allList.add(goodsBo);
+            }
         }
         }
-        GoodsQueryBo queryBo = new GoodsQueryBo();
-        queryBo.setSubjectId(bo.getSubjectId());
-        queryBo.setBusinessId(bo.getBusinessId());
-        queryBo.setUserId(user.getUserId());
-        return this.baseMapper.listUserSubjectGoods(queryBo);
+        return allList;
     }
     }
 
 
     public boolean joinGrade(Long orderGoodsId, Long gradeId, Long userId, Long goodsId) {
     public boolean joinGrade(Long orderGoodsId, Long gradeId, Long userId, Long goodsId) {

+ 30 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/vo/OrderUserGoodsVo.java

@@ -0,0 +1,30 @@
+package com.zhongzheng.modules.order.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * 订单添加对象 order
+ *
+ * @author ruoyi
+ * @date 2021-11-08
+ */
+@Data
+@ApiModel("订单用户购买状态对象")
+public class OrderUserGoodsVo {
+
+    @NotNull(message = "身份证号不能为空")
+    @ApiModelProperty("身份证号")
+    private String idCard;
+
+
+    @ApiModelProperty("商品列表")
+    private List<OrderGoodsVo> goodsList;
+
+
+
+}

+ 7 - 3
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml

@@ -25,6 +25,7 @@
         <result property="code" column="code"/>
         <result property="code" column="code"/>
         <result property="subjectId" column="subject_id"/>
         <result property="subjectId" column="subject_id"/>
         <result property="projectId" column="project_id"/>
         <result property="projectId" column="project_id"/>
+        <result property="courseShow" column="course_show"/>
     </resultMap>
     </resultMap>
 
 
     <resultMap type="com.zhongzheng.modules.course.vo.CourseVo" id="CourseResultVo">
     <resultMap type="com.zhongzheng.modules.course.vo.CourseVo" id="CourseResultVo">
@@ -54,6 +55,7 @@
         <result property="schoolName" column="school_name"/>
         <result property="schoolName" column="school_name"/>
         <result property="categoryName" column="category_name"/>
         <result property="categoryName" column="category_name"/>
         <result property="subjectName" column="subject_name"/>
         <result property="subjectName" column="subject_name"/>
+        <result property="courseShow" column="course_show"/>
         <collection property="goodsList" column="course_id" select="findGoodsList"/>
         <collection property="goodsList" column="course_id" select="findGoodsList"/>
     </resultMap>
     </resultMap>
 
 
@@ -118,6 +120,7 @@
         <result property="educationName" column="education_name"/>
         <result property="educationName" column="education_name"/>
         <result property="projectName" column="project_name"/>
         <result property="projectName" column="project_name"/>
         <result property="businessName" column="business_name"/>
         <result property="businessName" column="business_name"/>
+        <result property="officialName" column="official_name"/>
     </resultMap>
     </resultMap>
 
 
     <resultMap type="com.zhongzheng.modules.goods.vo.GoodsPeriodStatusVo" id="GoodsPeriodStatusVo">
     <resultMap type="com.zhongzheng.modules.goods.vo.GoodsPeriodStatusVo" id="GoodsPeriodStatusVo">
@@ -273,7 +276,7 @@
         LEFT JOIN major m ON c.major_id = m.id AND m.status =1
         LEFT JOIN major m ON c.major_id = m.id AND m.status =1
         LEFT JOIN course_subject cs ON cs.id = c.subject_id AND cs.status =1
         LEFT JOIN course_subject cs ON cs.id = c.subject_id AND cs.status =1
         WHERE
         WHERE
-        1 = 1 AND c.status !=-1
+        1 = 1 AND c.status !=-1 AND c.course_show =1
         <if test="subjectIds != null and subjectIds.size()!=0 ">
         <if test="subjectIds != null and subjectIds.size()!=0 ">
             AND c.subject_id in
             AND c.subject_id in
             <foreach collection="subjectIds" item="item" index="index" open="(" close=")" separator=",">
             <foreach collection="subjectIds" item="item" index="index" open="(" close=")" separator=",">
@@ -324,7 +327,7 @@
         FROM
         FROM
             course c
             course c
         WHERE
         WHERE
-        1 = 1   AND c.status !=-1
+        1 = 1   AND c.status !=-1 AND c.course_show =1
         <if test="subjectIds != null and subjectIds.size()!=0 ">
         <if test="subjectIds != null and subjectIds.size()!=0 ">
             AND c.subject_id in
             AND c.subject_id in
             <foreach collection="subjectIds" item="item" index="index" open="(" close=")" separator=",">
             <foreach collection="subjectIds" item="item" index="index" open="(" close=")" separator=",">
@@ -435,7 +438,8 @@
             g.business_id,
             g.business_id,
             cet.education_name,
             cet.education_name,
             cpt.project_name,
             cpt.project_name,
-            cb.business_name
+            cb.business_name,
+            cg.official_name
         FROM
         FROM
             class_grade_user cgu
             class_grade_user cgu
                 LEFT JOIN class_grade_goods cgg ON cgu.grade_id = cgg.grade_id
                 LEFT JOIN class_grade_goods cgg ON cgu.grade_id = cgg.grade_id

+ 72 - 85
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMenuMapper.xml

@@ -57,96 +57,83 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
     </resultMap>
 
 
     <select id="getList" parameterType="com.zhongzheng.modules.course.bo.CourseMenuQueryBo"  resultMap="CourseMenuResultVo">
     <select id="getList" parameterType="com.zhongzheng.modules.course.bo.CourseMenuQueryBo"  resultMap="CourseMenuResultVo">
+        SELECT * from (SELECT
+        m.*,
+        cm.module_name AS menu_name,
+        cm.publish_status AS publish_status,
+        cm.code AS code,
+        0 AS duration_time,
+        NULL AS section_type,
+        NULL AS live_start_time,
+        NULL AS live_end_time,
+        NULL AS live_url,
+        NULL AS recording_url,
+        cm.exam_type AS exam_type,
+        cm.free_exam_id AS free_exam_id,
+        (
+        CASE
+        cm.exam_type
+        WHEN 1 THEN
+        ( SELECT module_name FROM question_module WHERE module_exam_id = cm.free_exam_id )
+        WHEN 2 THEN
+        ( SELECT `name` FROM question_chapter WHERE chapter_exam_id = cm.free_exam_id )
+        WHEN 3 THEN
+        ( SELECT exam_name FROM exam WHERE exam_id = cm.free_exam_id ) ELSE ( NULL )
+        END
+        ) free_exam_name
+        FROM
+        course_menu m
+        LEFT JOIN course_module cm ON m.menu_id = cm.module_id
+        WHERE
+        m.course_id = #{courseId}
+        AND m.type = 1 and cm.`status`!=-1
+        UNION
         SELECT
         SELECT
-            m.*,
-            CASE
-                WHEN m.type = 1 THEN
-                    cm.module_name
-                WHEN m.type = 2 THEN
-                    cc.`name`
-                WHEN m.type = 3 THEN
-                    cs.`name`
-                END menu_name,
-            CASE
-                WHEN m.type = 1 THEN
-                cm.publish_status
-                WHEN m.type = 2 THEN
-                cc.publish_status
-                WHEN m.type = 3 THEN
-                cs.publish_status
-                END publish_status,
-            CASE
-                WHEN m.type = 1 THEN
-                cm.code
-                WHEN m.type = 2 THEN
-                cc.code
-                WHEN m.type = 3 THEN
-                cs.code
-                END code,
-            CASE
-
-                WHEN m.type = 1 THEN
-                    0
-                WHEN m.type = 2 THEN
-                    0
-                WHEN m.type = 3 THEN
-                    cs.duration_time
-                END duration_time,
-            cs.section_type,
-            cs.live_start_time,
-            cs.live_end_time,
-            cs.live_url,
-            CASE
-                WHEN m.type = 1 THEN
-                    ''
-                WHEN m.type = 2 THEN
-                    ''
-                WHEN m.type = 3 THEN
-                    cs.recording_url
-                END recording_url,
-            CASE
-            WHEN m.type = 1 THEN
-            cm.exam_type
-            WHEN m.type = 2 THEN
-            NULL
-            WHEN m.type = 3 THEN
-                NULL
-            END exam_type,
-            CASE
-            WHEN m.type = 1 THEN
-            cm.free_exam_id
-            WHEN m.type = 2 THEN
-            NULL
-            WHEN m.type = 3 THEN
-            NULL
-            END free_exam_id,
-            CASE
-            WHEN m.type = 1 THEN
-            ( CASE cm.exam_type
-        WHEN 1 THEN (SELECT module_name FROM question_module WHERE module_exam_id = cm.free_exam_id)
-        WHEN 2 THEN (SELECT `name` FROM question_chapter WHERE chapter_exam_id = cm.free_exam_id)
-        WHEN 3 THEN (SELECT exam_name FROM exam WHERE exam_id = cm.free_exam_id)
-        ELSE (NULL) END)
-            WHEN m.type = 2 THEN
-            NULL
-            WHEN m.type = 3 THEN
-            NULL
-            END free_exam_name
-
+        m.*,
+        cc.`name` AS menu_name,
+        cc.publish_status AS publish_status,
+        cc.code AS code,
+        0 AS duration_time,
+        NULL AS section_type,
+        NULL AS live_start_time,
+        NULL AS live_end_time,
+        NULL AS live_url,
+        NULL AS recording_url,
+        NULL AS exam_type,
+        NULL AS free_exam_id,
+        NULL as  free_exam_name
         FROM
         FROM
-            course_menu m
-                LEFT JOIN course_module cm ON m.menu_id = cm.module_id
-                AND m.type = 1
-                LEFT JOIN course_chapter cc ON m.menu_id = cc.chapter_id
-                AND m.type = 2
-                LEFT JOIN course_section cs ON m.menu_id = cs.section_id
-                AND m.type = 3
+        course_menu m
+        LEFT JOIN course_chapter cc ON m.menu_id = cc.chapter_id
         WHERE
         WHERE
-            m.course_id = #{courseId}
+        m.course_id = #{courseId}
+        AND m.type = 2 and cc.`status`!=-1
+        UNION
+        SELECT
+        m.*,
+        cs.`name` AS menu_name,
+        cs.publish_status AS publish_status,
+        cs.code AS code,
+        cs.duration_time AS duration_time,
+        cs.section_type AS section_type,
+        cs.live_start_time AS live_start_time,
+        cs.live_end_time AS live_end_time,
+        cs.live_url AS live_url,
+        cs.recording_url AS recording_url,
+        NULL AS exam_type,
+        NULL AS free_exam_id,
+        NULL as  free_exam_name
+        FROM
+        course_menu m
+        LEFT JOIN course_section cs ON m.menu_id = cs.section_id
+        WHERE
+        m.course_id = #{courseId}
+        AND m.type = 3 and cs.`status`!=-1 )un
+        WHERE 1=1
         <if test="type != null and type != ''">
         <if test="type != null and type != ''">
-            AND m.type = #{type}
+            AND un.type = #{type}
         </if>
         </if>
-        ORDER BY m.sort asc
+        ORDER BY un.sort asc
     </select>
     </select>
 
 
     <select id="menuList" parameterType="com.zhongzheng.modules.course.bo.CourseMenuQueryBo"  resultMap="CourseUserMenuVo">
     <select id="menuList" parameterType="com.zhongzheng.modules.course.bo.CourseMenuQueryBo"  resultMap="CourseUserMenuVo">

+ 1 - 1
zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsCourseMapper.xml

@@ -73,7 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         m.category_name,
         m.category_name,
         cs.subject_name,
         cs.subject_name,
                gc.sort as g_sort,
                gc.sort as g_sort,
-        gc.course_show
+        c.course_show
         FROM
         FROM
         goods_course gc
         goods_course gc
         LEFT JOIN course c ON gc.course_id = c.course_id
         LEFT JOIN course c ON gc.course_id = c.course_id

+ 11 - 10
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -1204,19 +1204,20 @@
     </select>
     </select>
     <select id="queryCountList" parameterType="java.lang.Integer" resultMap="ClassGradeUserVoResult">
     <select id="queryCountList" parameterType="java.lang.Integer" resultMap="ClassGradeUserVoResult">
         SELECT
         SELECT
-            cgu.*,
-            cg.interface_account_id,
-            cg.no_interface_account_id
+        cgu.*,
+        cg.interface_account_id,
+        cg.no_interface_account_id
         FROM
         FROM
-            class_grade_user cgu
+        class_grade_user cgu
         LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
         LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
-        LEFT JOIN class_grade_goods cgg ON cgu.grade_id = cgg.grade_id
-        LEFT JOIN goods g ON cgg.goods_id = g.goods_id
+        LEFT JOIN order_goods og on cgu.order_goods_id = og.order_goods_id
+        LEFT JOIN goods g on og.goods_id = g.goods_id
         WHERE
         WHERE
-          cgu.`status` = 1
-          and g.project_id = #{projectId}
-          <if test="all != null and all == 0">
+        cgu.`status` = 1
+        and g.project_id = #{projectId}
+        and g.business_id = #{businessId}
+        <if test="all != null and all == 0">
             and (cg.interface_account_id is not null or cg.no_interface_account_id is not null)
             and (cg.interface_account_id is not null or cg.no_interface_account_id is not null)
-          </if>
+        </if>
     </select>
     </select>
 </mapper>
 </mapper>

+ 2 - 2
zhongzheng-system/src/main/resources/mapper/modules/user/UserMockSubscribeMapper.xml

@@ -212,8 +212,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN course_section cs ON mms.section_id = cs.section_id
         LEFT JOIN course_section cs ON mms.section_id = cs.section_id
         LEFT JOIN course_subject css ON mms.subject_id = css.id
         LEFT JOIN course_subject css ON mms.subject_id = css.id
         WHERE
         WHERE
-          ums.has_live_subscribe = 0
-          and cs.live_start_time is not null
+        ums.has_live_subscribe = 0
+        and cs.live_start_time is not null
     </select>
     </select>
     <select id="listSubscribeInfo" parameterType="java.lang.Long" resultMap="UserMockSubscribeVoResult">
     <select id="listSubscribeInfo" parameterType="java.lang.Long" resultMap="UserMockSubscribeVoResult">
         SELECT
         SELECT