浏览代码

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

hgw 3 年之前
父节点
当前提交
c6ef036f13

+ 1 - 3
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -566,9 +566,7 @@
         FROM student stu
           LEFT JOIN sys_user su ON stu.user_id_=su.id_
         WHERE service_tag_=1 AND su.del_flag_=0
-        <if test="tenantId != null">
-        and tenant_id_ = #{tenantId}
-        </if>
+        and stu.tenant_id_ = #{tenantId}
     </select>
     <select id="getServeStudentCourseStartTimes" resultType="com.ym.mec.biz.dal.dto.StudentServeCourseDto">
         SELECT

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

@@ -107,7 +107,7 @@
 		<where>
 			tenant_id_ = #{tenantId}
 			<if test="userId!=null">
-				user_id_=#{userId}
+				and user_id_=#{userId}
 			</if>
 		</where>
 	</sql>

+ 14 - 6
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -6,10 +6,7 @@ import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
-import com.ym.mec.biz.dal.enums.CourseViewTypeEnum;
-import com.ym.mec.biz.dal.enums.DealStatusEnum;
-import com.ym.mec.biz.dal.enums.GroupType;
-import com.ym.mec.biz.dal.enums.OrderTypeEnum;
+import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.common.controller.BaseController;
@@ -97,6 +94,8 @@ public class StudentOrderController extends BaseController {
     private TenantOrderRecordService tenantOrderRecordService;
     @Autowired
     private OrderPayOpsService orderPayOpsService;
+    @Autowired
+    private MusicGroupPaymentCalenderActivityService musicGroupPaymentCalenderActivityService;
 
     @Value("${spring.profiles.active:dev}")
     private String profiles;
@@ -172,9 +171,11 @@ public class StudentOrderController extends BaseController {
         if (orderByOrderNo.getGroupType().equals(GroupType.MUSIC)) {
             MusicGroup musicGroup = musicGroupService.get(orderByOrderNo.getMusicGroupId());
             List<Goods> goodsList = studentPaymentOrderDetailService.findApplyOrderGoods(orderByOrderNo.getId());
-            List<String> orderDetailType = studentPaymentOrderDetailService.getOrderDetailType(orderByOrderNo.getId());
+//            List<String> orderDetailType = studentPaymentOrderDetailService.getOrderDetailType(orderByOrderNo.getId());
             List<StudentPaymentOrderDetail> orderDetail1 = studentPaymentOrderDetailService.getOrderDetail(orderByOrderNo.getId());
-            String kitGroupPurchaseType = orderDetail1.stream().filter(e -> e.getGoodsList() != null).filter(e -> e.getKitGroupPurchaseType() != null).map(e -> e.getKitGroupPurchaseType().getCode()).collect(Collectors.joining(","));
+            List<String> orderDetailType = orderDetail1.stream().map(e->e.getType().getCode()).collect(Collectors.toList());
+            String kitGroupPurchaseType = orderDetail1.stream().filter(e -> e.getGoodsList() != null).
+                    filter(e -> e.getKitGroupPurchaseType() != null).map(e -> e.getKitGroupPurchaseType().getCode()).collect(Collectors.joining(","));
             orderDetail.put("goods", goodsList);
             orderDetail.put("kitGroupPurchaseType", kitGroupPurchaseType);
             orderDetail.put("course", musicGroup.getCourseForm());
@@ -182,6 +183,13 @@ public class StudentOrderController extends BaseController {
             orderDetail.put("detailType", orderDetailType);
             orderDetail.put("chargeTypeId", musicGroup.getChargeTypeId());
             orderDetail.put("courseViewType", musicGroup.getCourseViewType());
+            //如果包含vip和网管,代表购买了活动包
+            if(orderDetailType.contains("VIP") || orderDetailType.contains("PRACTICE")){
+                List<Long> activityList = orderDetail1.stream().filter(e->e.getType() == OrderDetailTypeEnum.VIP
+                        || e.getType() == OrderDetailTypeEnum.PRACTICE).map(e->e.getStudentInstrumentId())
+                        .collect(Collectors.toList());
+                orderDetail.put("activity", musicGroupPaymentCalenderActivityService.findByIds(activityList));
+            }
 
             //新的课程形态10.27
             MusicGroupPaymentCalender musicGroupRegCalender = musicGroupPaymentCalenderDao.getMusicGroupRegCalender(musicGroup.getId());