Joburgess 5 년 전
부모
커밋
4636ba3d35

+ 4 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupCategoryDao.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.dao;
 
+import com.ym.mec.biz.dal.dto.ConditionDto;
 import com.ym.mec.biz.dal.entity.VipGroupCategory;
 import com.ym.mec.common.dal.BaseDAO;
 
@@ -9,4 +10,6 @@ public interface VipGroupCategoryDao extends BaseDAO<Integer, VipGroupCategory>
 
     List<VipGroupCategory> findAllByOrgan(Long organId);
 
-}
+    List<ConditionDto> findConditionCategorys();
+
+}

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentVipGroupQueryInfo.java

@@ -15,9 +15,20 @@ public class StudentVipGroupQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "课程类型",required = false)
     private String classType;
 
+    @ApiModelProperty(value = "课程类型编号")
+    private String categoryId;
+
     @ApiModelProperty(value = "学生编号")
     private Integer userId;
 
+    public String getCategoryId() {
+        return categoryId;
+    }
+
+    public void setCategoryId(String categoryId) {
+        this.categoryId = categoryId;
+    }
+
     public Integer getUserId() {
         return userId;
     }

+ 4 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/VipGroupCategoryService.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service;
 
+import com.ym.mec.biz.dal.dto.ConditionDto;
 import com.ym.mec.biz.dal.entity.VipGroupCategory;
 import com.ym.mec.common.service.BaseService;
 
@@ -8,4 +9,6 @@ import java.util.List;
 public interface VipGroupCategoryService extends BaseService<Integer, VipGroupCategory> {
 
     List<VipGroupCategory> findAllByOrgan(Long organId);
-}
+
+    List<ConditionDto> findConditionCategorys();
+}

+ 7 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupCategoryServiceImpl.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service.impl;
 
+import com.ym.mec.biz.dal.dto.ConditionDto;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -26,4 +27,9 @@ public class VipGroupCategoryServiceImpl extends BaseServiceImpl<Integer, VipGro
 	public List<VipGroupCategory> findAllByOrgan(Long organId) {
 		return vipGroupCategoryDao.findAllByOrgan(organId);
 	}
-}
+
+	@Override
+	public List<ConditionDto> findConditionCategorys() {
+		return vipGroupCategoryDao.findConditionCategorys();
+	}
+}

+ 2 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -748,6 +748,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		if(Objects.nonNull(byStudentVipGroup)){
 			byStudentVipGroup.setStatus(DealStatusEnum.CLOSE);
 			studentPaymentOrderDao.update(byStudentVipGroup);
+			//更新班级人数,如果订单支付失败则减少
+			updateVipGroupStudentNumAndStatus(vipGroup.getId(),1,false);
 		}
 
 		VipGroupClassGroupMapper vipGroupClassGroupMapper = vipGroupClassGroupMapperDao.findByVipGroupId(vipGroup.getId());
@@ -789,9 +791,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		studentVipGroupPayment.setStudentPaymentOrderId(studentPaymentOrder.getId());
 		studentVipGroupPaymentDao.insert(studentVipGroupPayment);
 
-		//更新班级人数,如果订单支付失败则减少
-		updateVipGroupStudentNumAndStatus(vipGroup.getId(),1,false);
-
 		//生成回调地址
 		Map payMap = payService.getPayMap(
 				vipGroup.getTotalPrice(),

+ 1 - 0
mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml

@@ -118,6 +118,7 @@
         SELECT sr.user_id_,su.username_ real_name_,su.gender_,sr.parents_name_,sr.parents_phone_
         FROM student_registration sr
         LEFT JOIN sys_user su ON sr.user_id_ = su.id_
+        <include refid="findStudentsByOrganIdSql"/>
         <include refid="global.limit"/>
     </select>
     <sql id="findStudentsByOrganIdSql">

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/VipGroupCategoryMapper.xml

@@ -93,4 +93,7 @@
 		SELECT COUNT(*) FROM
 		vip_group_category
 	</select>
+	<select id="findConditionCategorys" resultType="com.ym.mec.biz.dal.dto.ConditionDto">
+      	select id_ id,name_ `name` from vip_group_category where del_flag_ = 0
+    </select>
 </mapper>

+ 4 - 1
mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml

@@ -275,6 +275,9 @@
             <if test="subjectId!=null">
                AND FIND_IN_SET(#{subjectId},cg.subject_id_list_)
             </if>
+            <if test="categoryId!=null">
+                AND FIND_IN_SET(vg.vip_group_category_id_,#{categoryId})
+            </if>
             <if test="classType!=null and classType.toString()=='0'.toString()">
                 AND vg.offline_classes_num_>0
             </if>
@@ -467,7 +470,7 @@
         vip_group_class_group_mapper vgcgm
         LEFT JOIN class_group cg ON vgcgm.class_group_id_=cg.id_
         LEFT JOIN class_group_student_mapper cgsm ON vgcgm.class_group_id_=cgsm.class_group_id_
-        WHERE vgcgm.id_=#{vipGroupId}
+        WHERE vgcgm.vip_group_id_=#{vipGroupId}
     </select>
 
     <resultMap id="teachingRecord" type="com.ym.mec.biz.dal.dto.VipGroupCourseSchduleRecordDto">

+ 4 - 0
mec-student/src/main/java/com/ym/mec/student/controller/StudentVipGroupController.java

@@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.dto.QueryConditionDto;
 import com.ym.mec.biz.dal.dto.VipGroupBuyParamsDto;
 import com.ym.mec.biz.dal.page.StudentVipGroupQueryInfo;
 import com.ym.mec.biz.service.SubjectService;
+import com.ym.mec.biz.service.VipGroupCategoryService;
 import com.ym.mec.biz.service.VipGroupService;
 import com.ym.mec.common.controller.BaseController;
 
@@ -38,12 +39,15 @@ public class StudentVipGroupController extends BaseController {
     private SubjectService subjectService;
     @Autowired
     private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private VipGroupCategoryService vipGroupCategoryService;
 
     @ApiOperation(value = "获取vip课列表筛选条件")
     @GetMapping(value = "/findQueryCondition")
     public Object findQueryCondition(){
         List<QueryConditionDto> conditions=new ArrayList<>();
         conditions.add(new QueryConditionDto("乐器选择","subjectId",subjectService.findSubjectConditions()));
+        conditions.add(new QueryConditionDto("课程类型","categoryId",vipGroupCategoryService.findConditionCategorys()));
         List<ConditionDto> conditionDtos=new ArrayList<>();
         conditionDtos.add(new ConditionDto(0L,"线下"));
         conditionDtos.add(new ConditionDto(1L,"线上"));