浏览代码

Merge branch 'zx_1026_1111' of http://git.dayaedu.com/yonge/mec into test

# Conflicts:
#	mec-application/src/main/resources/bootstrap-dev.properties
#	mec-web/src/main/java/com/ym/mec/web/controller/PhotoAlbumController.java
#	mec-web/src/main/java/com/ym/mec/web/controller/education/EduPhotoAlbumController.java
zouxuan 1 年之前
父节点
当前提交
5e384154f6

+ 14 - 10
mec-application/src/main/java/com/ym/mec/student/controller/SporadicChargeInfoController.java

@@ -11,6 +11,7 @@ import com.ym.mec.biz.dal.enums.PayStatus;
 import com.ym.mec.biz.service.MusicGroupService;
 import com.ym.mec.biz.service.SporadicChargeInfoService;
 import com.ym.mec.biz.service.StudentPaymentOrderService;
+import com.ym.mec.biz.service.SysUserService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
@@ -18,6 +19,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.web.bind.annotation.*;
@@ -33,7 +35,7 @@ public class SporadicChargeInfoController extends BaseController {
     @Autowired
     private SporadicChargeInfoService sporadicChargeInfoService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
+    private SysUserService sysUserService;
     @Autowired
     private StudentPaymentOrderService studentPaymentOrderService;
     @Autowired
@@ -44,7 +46,15 @@ public class SporadicChargeInfoController extends BaseController {
     @ApiOperation(value = "单查询")
     @GetMapping("/get")
     public Object get(Integer id, Integer userId) {
-        return succeed(sporadicChargeInfoService.findDetail(id, userId));
+        SysUser sysUser = sysUserService.getUser();
+        SporadicChargeInfo detail = sporadicChargeInfoService.findDetail(id, userId);
+        if (detail == null) {
+            throw new BizException("数据不存在");
+        }
+        if (StringUtils.isNotEmpty(detail.getOrganId()) && !detail.getOrganId().contains(sysUser.getOrganId().toString())) {
+            throw new BizException("您所在分部不参与此活动");
+        }
+        return succeed(detail);
     }
 
 
@@ -57,10 +67,7 @@ public class SporadicChargeInfoController extends BaseController {
             throw new BizException("参数校验失败");
         }
         if (sporadicPayDto.getUserId() == null) {
-            SysUser sysUser = sysUserFeignService.queryUserInfo();
-            if (sysUser == null || sysUser.getId() == null) {
-                return failed("用户不存在");
-            }
+            SysUser sysUser = sysUserService.getUser();
             sporadicPayDto.setUserId(sysUser.getId());
             sporadicPayDto.setOrganId(sysUser.getOrganId());
         }
@@ -115,13 +122,10 @@ public class SporadicChargeInfoController extends BaseController {
     @GetMapping("/activityInfo")
     @ApiImplicitParams({@ApiImplicitParam(name = "type", value = "类型(福袋活动6)", required = true, dataType = "String")})
     public HttpResponseResult activityInfo(Integer type) throws Exception {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        SysUser sysUser = sysUserService.getUser();
         if (sysUser == null || sysUser.getId() == null) {
             return failed("请先登录");
         }
-        if (sysUser.getOrganId() == null) {
-            return failed("用户信息有误,没有分部信息");
-        }
         Integer organId = sysUser.getOrganId();
 
         if (type == null || type <= 0) {

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

@@ -466,9 +466,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
             courseSchedule.setName(vipGroupApplyBaseInfoDto.getName());
             courseSchedule.setOrganId(vipGroupApplyBaseInfoDto.getOrganId());
         }
+        vipGroupApplyBaseInfoDto.setCourseSchedulesJson(JSON.toJSONString(courseSchedules));
         if (upCourseFlag) {
             vipGroup.setCourseSchedules(courseSchedules);
             courseScheduleDao.batchUpdate(courseSchedules);
+        }else {
+            this.liveProgress(vipGroupApplyBaseInfoDto,classGroup);
         }
         if (vipGroup1.getStatus().equals(VipGroupStatusEnum.PROGRESS)) {
             // 修改课程信息
@@ -500,10 +503,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
             imGroupMemberService.join(classGroup.getId().toString(), applyBaseInfo.getEducationalTeacherId(),EFriendRoleType.ORCHESTRA_MANAGER.getMsg(),false);
         }
 
-        if (!vipGroup1.getStatus().equals(VipGroupStatusEnum.PROGRESS)) {
+        if (!vipGroup1.getStatus().equals(VipGroupStatusEnum.PROGRESS) && upCourseFlag) {
             courseScheduleService.checkNewCourseSchedules(courseSchedules, false, false);
         }
-        vipGroupApplyBaseInfoDto.setCourseSchedulesJson(JSON.toJSONString(courseSchedules));
         vipGroupDao.update(vipGroupApplyBaseInfoDto);
         return BaseController.succeed(vipGroupApplyBaseInfoDto.getAuditStatus().getCode());
     }

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

@@ -172,7 +172,7 @@
 			   COUNT(DISTINCT CASE WHEN sa.qualified_flag_ = 1 THEN sa.id_ ELSE NULL END) standard_num_,
 			   CASE WHEN sch.id_ IS NOT NULL THEN 1 ELSE 0 END homework_flag_,
 			   COUNT(DISTINCT CASE WHEN sch.status_ = 1 THEN sch.id_ ELSE NULL END) homework_commit_num_,cs.class_date_,cs.status_ course_status_
-		FROM course_schedule_statistics_wait cssw
+		FROM (select * from course_schedule_statistics_wait limit 500) cssw
 				 LEFT JOIN course_schedule_statistics css ON css.course_schedule_id_ = cssw.course_schedule_id_
 				 LEFT JOIN course_schedule cs ON cs.id_ = cssw.course_schedule_id_
 				 LEFT JOIN course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cssw.course_schedule_id_

+ 7 - 9
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -2004,15 +2004,13 @@
 			COUNT( DISTINCT user_id_ ) percent_
 		FROM
 		(
-		SELECT
-			su.organ_id_,smcr.tenant_id_,
-			smcr.user_id_
-		FROM
-			sys_music_compare_record smcr
-			LEFT JOIN sys_user su ON smcr.user_id_ = su.id_
-		WHERE su.del_flag_ = 0 and smcr.tenant_id_ = #{tenantId}
-		GROUP BY user_id_
-		HAVING MIN(DATE( smcr.create_time_ ))= #{dayStr}) t
+		SELECT su.organ_id_, smcr.tenant_id_, smcr.user_id_
+		FROM sys_music_compare_record smcr
+		INNER JOIN sys_user su ON smcr.user_id_ = su.id_
+		WHERE su.del_flag_ = 0 AND smcr.tenant_id_ = 3
+		AND smcr.create_time_ >= #{dayStr}
+		AND smcr.create_time_ &lt; DATE_ADD(#{dayStr}, INTERVAL 1 DAY)
+		GROUP BY smcr.user_id_) t
 		GROUP BY t.organ_id_
 	</select>
 	<resultMap id="CloudTeacherActiveTargetDto" type="com.ym.mec.biz.dal.dto.CloudTeacherActiveTargetDto">